Type: Technical Task
Affects Version/s: 6.2.5 CE GA6, 7.0.3 CE GA4
Section PLT.8.4 of the JSR 168 (Portlet 1.0) Specification titled "Custom Portlet Modes" states:
Portal vendors may define custom portlet modes for vendor specific functionality. Portlets can only use portlet modes that are defined by the portal.
Liferay Portal implements this feature with out-of-the-box custom portlet modes such as "about", "config", "edit_defaults", "edit_guest", "preview", and "print" as defined in LiferayPortletMode.java.
However, Section PLT.8.4 of the JSR 286 (Portlet 2.0) Specification contains additional language that extends the definition of a custom portlet mode to the portlet developer:
Portlets may define additional modes that don't need to be managed by the portal [...] The portlet must declare portlet modes that are not managed by the portal via the <portal-managed>false</portal-managed> tag.
1. Download the attached com.liferay.demo.customportletmode.portlet.war demo and deploy it to $LIFERAY_HOME/deploy
2. Add the "Custom Mode Portlet" to a portal page
3. Click on the "Click me to navigate to the custom1 portlet mode" hyperlink
The "Navigation to custom1 portlet mode was successful" message should be displayed.
The "Click me to navigate to the custom1 portlet mode" hyperlink is redisplayed.