Adding portlet to control panel

Getting the crrent portlet Id can be done through themeDisplay.

ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest
.getAttribute(WebKeys.THEME_DISPLAY);

If you want to retrieve portlet Id in View, this is the typical way to do it.

However, when you are in Portlet class (java), you can directly get it through request using some Util class (ex PortletUtil... not this one tho)
I could not find the appropriate util, so I am gonna just apply the themeDisplay way.

found it
PortalUtil.getPortletId(HttpServletRequest request)

Comments

Popular posts from this blog

Portlet Edit Mode (Portlet preference) to replace Portlet configuration

GoGo Shell & What can be deleted in Liferay Instance