Fórumok

Add new method in service impl

Marcin Sareło, módosítva 11 év-val korábban

Add new method in service impl

New Member Bejegyzések: 21 Csatlakozás dátuma: 2012.06.27. Legújabb bejegyzések
Hi, i trying to add new method in DLAppLocalServiceServiceImpl like override method via hook but that don't work. What i should do? I should use Ext and write own DLAppLocalServiceServiceImpl?
thumbnail
Bart Simpson, módosítva 11 év-val korábban

RE: Add new method in service impl

Liferay Master Bejegyzések: 522 Csatlakozás dátuma: 2011.08.29. Legújabb bejegyzések
I think you meant
DLAppLocalServiceImpl
and not
DLAppLocalServiceServiceImpl 

You can use this wrapper
DLAppLocalServiceWrapper
and create the hook for the portal service
More details are available on http://www.liferay.com/documentation/liferay-portal/6.0/development/-/ai/overriding-a-portal-service

Do post if you have any further queries on this.
Marcin Sareło, módosítva 11 év-val korábban

RE: Add new method in service impl

New Member Bejegyzések: 21 Csatlakozás dátuma: 2012.06.27. Legújabb bejegyzések
Bart Simpson:
I think you meant
DLAppLocalServiceImpl
and not
DLAppLocalServiceServiceImpl 

You can use this wrapper
DLAppLocalServiceWrapper
and create the hook for the portal service
More details are available on http://www.liferay.com/documentation/liferay-portal/6.0/development/-/ai/overriding-a-portal-service

Do post if you have any further queries on this.


Thanks for replay but how to call my metohds? I must use DLAppLocalServiceUtil or DLAppLocalServiceWrapper?
Siby Mathew, módosítva 11 év-val korábban

RE: Add new method in service impl

Expert Bejegyzések: 268 Csatlakozás dátuma: 2011.03.04. Legújabb bejegyzések
Hi Marcin,
Your custom service class must extend the Wrapper class.
You can override the methods and invoke your custom logic.

Thank.s
Siby
Marcin Sareło, módosítva 11 év-val korábban

RE: Add new method in service impl

New Member Bejegyzések: 21 Csatlakozás dátuma: 2012.06.27. Legújabb bejegyzések
Siby Mathew:
Hi Marcin,
Your custom service class must extend the Wrapper class.
You can override the methods and invoke your custom logic.

Thank.s
Siby


Ok, i extend the Wrapper class like this:
public class ExtDLAppLocalService extends DLAppLocalServiceWrapper


but how invoke new method from ExtDLAppLocalService?
Siby Mathew, módosítva 11 év-val korábban

RE: Add new method in service impl

Expert Bejegyzések: 268 Csatlakozás dátuma: 2011.03.04. Legújabb bejegyzések
Hi Marcin,
You are extending the wrapper so that you can override the methods available in DLAppLocalServiceWrapper.
eg: You can override addFileEntry() and add your custom logic inside.
After you deploy this hook, if any code calls DLAppLocalServiceUtil.addFileEntry(), your overridden method is invoked.

Thanks,
Siby
Marcin Sareło, módosítva 11 év-val korábban

RE: Add new method in service impl

New Member Bejegyzések: 21 Csatlakozás dátuma: 2012.06.27. Legújabb bejegyzések
Ok, fine but i create new method copyFileEntry(*params*).