To implement an edit functionality in a custom portlet for Asset publisher, I found out some limitations but they aren't documented on dev.liferay.com. This may need to be clarified if it's a bug or design too.
I followed this document.
The link is shown in the attached image, edit_link_explanation.png
Following informations are missing to enable edit link that's generated by getURLEdit,
You need to have at least one portlet that's configured com.liferay.portlet.instanceable=false and the portlet have to be capable of providing edit functionality, which is pointed by URL that's generated in getURLEdit. The combinations that I confirmed working were as follows.
- Only an admin portlet, which is consisted of a portlet extend MVCPortlet and *PanelApp extended BasePanelApp.(a portlet in the product menu in the left panel of Liferay)
- A portlet that can be placed in a page (a general portlet) and an admin portlet. A general portlet is not necessarily to be configured com.liferay.portlet.instanceable=false, but the admin portlet must be configured com.liferay.portlet.instanceable=false, capable of providing edit functionality and PortalUtil#getControlPanelPortletURL needs to point to the Admin portlet to generate a link.
Given that, I believe kind of following texts and actual snippets of the vital parts need to be added. I can send PR of a draft if you guys need it.
It looks like the document is referring BlogsEntry implementations, then you may want to add explanations of BlogsPanelApp.java, BlogsAdminPortlet. e.g.
To enable a link on Asset publisher for your custom portlet, you either need to have,
- An admin portlet
- A portlet and an admin portlet
An admin portlet need to be configured com.liferay.portlet.instanceable=false and capable of providing edit functionality or you'll get NPE when Asset publisher get rendered.