留言板

How to override an Admin Portlet class

Nisha Rani,修改在6 年前。

How to override an Admin Portlet class

New Member 帖子: 2 加入日期: 17-8-15 最近的帖子
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,修改在6 年前。

RE: How to override an Admin Portlet class

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
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,修改在6 年前。

RE: How to override an Admin Portlet class

New Member 帖子: 2 加入日期: 17-8-15 最近的帖子
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