Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Marcin sa
Add new method in service impl
November 14, 2012 5:08 AM
Answer

Marcin sa

Rank: New Member

Posts: 21

Join Date: June 27, 2012

Recent Posts

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?
Bart Simpson
RE: Add new method in service impl
November 14, 2012 5:45 AM
Answer

Bart Simpson

Rank: Liferay Master

Posts: 523

Join Date: August 29, 2011

Recent Posts

I think you meant
1DLAppLocalServiceImpl
and not
1DLAppLocalServiceServiceImpl

You can use this wrapper
1DLAppLocalServiceWrapper
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 sa
RE: Add new method in service impl
November 14, 2012 6:19 AM
Answer

Marcin sa

Rank: New Member

Posts: 21

Join Date: June 27, 2012

Recent Posts

Bart Simpson:
I think you meant
1DLAppLocalServiceImpl
and not
1DLAppLocalServiceServiceImpl

You can use this wrapper
1DLAppLocalServiceWrapper
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
RE: Add new method in service impl
November 14, 2012 6:27 AM
Answer

Siby Mathew

Rank: Expert

Posts: 259

Join Date: March 4, 2011

Recent Posts

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 sa
RE: Add new method in service impl
November 14, 2012 6:41 AM
Answer

Marcin sa

Rank: New Member

Posts: 21

Join Date: June 27, 2012

Recent Posts

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:
1public class ExtDLAppLocalService extends DLAppLocalServiceWrapper


but how invoke new method from ExtDLAppLocalService?
Siby Mathew
RE: Add new method in service impl
November 14, 2012 7:13 AM
Answer

Siby Mathew

Rank: Expert

Posts: 259

Join Date: March 4, 2011

Recent Posts

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 sa
RE: Add new method in service impl
November 14, 2012 7:21 AM
Answer

Marcin sa

Rank: New Member

Posts: 21

Join Date: June 27, 2012

Recent Posts

Ok, fine but i create new method copyFileEntry(*params*).