Samuel
Samuel

Reputation: 1667

Use other Liferay Services in a Service Hook

I am writing a wrapper to JournalArticleLocalService in a Liferay hook plugin. The goal I am trying to achieve is to persist the priority field of the asset, which is currently hardcoded to be set to null.

I need to use the AssetEntryLocalService. I tried this:

public class MyJournalArticleLocalServiceImpl extends
    JournalArticleLocalServiceWrapper {

@BeanReference(type = AssetEntryLocalService.class)
protected AssetEntryLocalService assetEntryLocalService;

When the overwritten method is called, the reference is not set.

What do I need to do such that the reference is set?

Upvotes: 1

Views: 381

Answers (1)

Daniele Baggio
Daniele Baggio

Reputation: 2257

You can use directly AssetEntryLocalServiceUtil, it not fast as the reference assetEntryLocalService but it works.

I think the reference could not be set in the way you want.

Upvotes: 2

Related Questions