Sometimes situations arises when we want to add our custom made plugin portlet to Liferay Control Panel.
To do so we need to made some entries in liferay-portlet.xml . These are as follows-
1. control-panel-entry-category: It spefies the 'category' where your portlet will appear.
2. control-panel-entry-weight: weight determines the position among the other portlet listed in that category.
3. control-panel-entry-class: The name of a class that implements the ControlPanelEntry interface.
It’s not necessary to specify the class but depends on our requirement.
Here is an example-
<control-panel-entry-category>content</control-panel-entry-category>
<control-panel-entry-weight>100</control-panel-entry-weight>
NOTE- Make sure you provide a unique weight for your plugin portlet otherwise any liferay out of the box portlet with the same weight will override your portlet.
Really good related information! I have been hunting for anything like this for some time finally. Regards!
ReplyDeleteArrived at your blog through Bing. You already know I am subscribing to your feed.
ReplyDeletethanks, Johnsie and Raul for your prompt response. Keep sharing..
ReplyDeleteRegards!!
Nice and easy, does it all the time.
ReplyDeletereally?
ReplyDeleteThis is some thing I have to find more information about, appreciation for the article.
ReplyDeleteThanks Schuhe, would you like to share what more information you are looking for regarding this topic. May be I can help you or find some more about it...
ReplyDeleteWhat do I need to do for the portlet to be shown only to the omniadmin of the liferay portal, that is not to communities administrators but only to the omniadmin, just like the users portlet on the portal control-panel-entry-category. (I would still like to see it in the content control-panel-entry-category)
ReplyDeleteThanks in advance for any help you might give me
Hello Gabo,
ReplyDeleteYou can achieve this by setting the portlet specific permissions. Here are the steps to set the the portlet permissions
Go to Control Panel -> In the left side under Portal Section -> Select Plugins Configuration -> In the right side choose portlet for which you want to change the permissions settings -> Clicking the portlet name list the current permissions for each role along with the options to change same
Here you can apply permissions as per your needs
Hope it will be helpful to you
Regards
Thanks for publishing the info! I do have a minor issue though. I built the sample-jsp portlet from the Liferay SDK and I am trying to stick it on the Control Panel (left side menu) as a proof of concept for something. I added in the 3 entries you mentioned above in my portlets liferay-portlet.xml and upon deployment the portlet blows up with the following error:
ReplyDeleteDocumentException: Error on line 28 of document : The content of element type "portlet" must match ....." (looks like it lists all the elements in the liferay-portlet.xml doc)
It appears as if it is failing on some sort of validation or something. So my question is what am I missing or what else do I need to do to get this to work?
Thanks in advance for any assistance!
Hello
ReplyDeleteMake sure you are adhering to liferay-portlet.xml dtd rules.
Here you can find the liferay-portlet.xml dtd for Liferay 6
http://docs.liferay.com/portal/6.0/definitions/liferay-portlet-app_6_0_0.dtd.org.html
Regards
[...] Since you want the preferences to be set only by admin. Create a portlet which will be available in Control panel under portal section.Next in portlet you can have portlet.properties to have a default key value.In the portlet you [...]
ReplyDelete