Fórum

How to override an Admin Portlet class

Nisha Rani, modificado 6 Anos atrás.

How to override an Admin Portlet class

New Member Postagens: 2 Data de Entrada: 15/08/17 Postagens Recentes
Hi,

I need to add and update a method in AssetCategoryAdminPortlet.java class. Is it possible to do? if yes, please guide me how to do it in Liferay DXP.
Please share the sample code for it.

Thanks,
Nisha Mittal
thumbnail
David H Nebinger, modificado 6 Anos atrás.

RE: How to override an Admin Portlet class

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Nisha Rani:
I need to add and update a method in AssetCategoryAdminPortlet.java class. Is it possible to do?


No.

if yes, please guide me how to do it in Liferay DXP.


Well, there is the "module extending a module" concept I blogged about, but you gotta look at all of the various warnings indicating why you should consider this route carefully.

https://web.liferay.com/web/user.26526/blog/-/blogs/extending-liferay-osgi-modules









Come meet me at Devcon 2017 or 2017 LSNA!
Nisha Rani, modificado 6 Anos atrás.

RE: How to override an Admin Portlet class

New Member Postagens: 2 Data de Entrada: 15/08/17 Postagens Recentes
Hi David,

Thanks for your response.
I checked for alternate approach suggested by you https://web.liferay.com/web/user.26526/blog/-/blogs/extending-liferay-osgi-modules
Unfortunately its not suitable with my requirement.

Now I am trying to achieve my requirement with different approach in that I am trying to render the Categories page default by ascending order of 'SortOrder' value, that I have stored for each category in the key_, value pair.
To achieve it want to override the getCategories(Hits hits) method of 'assetCategoryLocalServiceImpl.java' file.

Could you please guide on procedure to override 'assetCategoryLocalServiceImpl.java' class.
Also, is there any document or online material is available that can help in overriding different files in Liferay 7. Till now I am able to override JSPs, wrapper class only.

Thanks in advance!
Regards,
Nisha Rani