Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding new section in control panel of Liferay

Tags:

liferay

I want to add a new section in control panel of liferay and within that section I want to have my custom-portlet. I did it using ext. However I want to do it with hook . Is it possible ?

like image 314
One Avatar asked Nov 25 '25 19:11

One


1 Answers

I don't think it would be that easy with a hook, because of the following reasons:

  1. You can't modify in a Hook - the class com.liferay.portal.util.PortletCategoryKeys which contains the keys for displaying the different sections. The different sections are hard-coded in this class in a String array ALL.
  2. You can't modify the logic of PortalImpl#isControlPanelPortlet() which uses the PortletCategoryKeys#ALL to determine if the request in question is for a control panel portlet.
  3. Then you also have another method which you can't modify with a Hook and is used extensively PortalImpl#getControlPanelCategory()

Doing it with a hook:

I have not tried this but I think if you need to do it with a hook you would have to change all those JSPs which make use of PortletCategoryKeys#ALL and the methods of PortalImpl as stated above, and provide your custom implementation for all these methods in the JSP.

I would really like to know how you implemented it with an EXT may be just the steps or the methods you have overridden. So that I can try to convert those in terms of a hook.

This is as far as my understanding goes. Hope this helps.

like image 107
Prakash K Avatar answered Nov 28 '25 15:11

Prakash K



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!