bartex9
bartex9

Reputation: 391

How to get portlet id from it's configuration portlet?

How can I get portlet id in jsp page of it's configuration portlet?

From the level of specific portlet I can call in .jsp page:

String portletId = themeDisplay.getPortletDisplay().getId();

How can I get that id in configuration portlet's jsp?

Upvotes: 0

Views: 1865

Answers (2)

Issamovitch
Issamovitch

Reputation: 413

hello you can try this :

String portletId = themeDisplay.getPortletDisplay().getId();
String portletName = themeDisplay.getPortletDisplay().getPortletName();
String portletInstanceId = themeDisplay.getPortletDisplay().getInstanceId();

Don't forget:

<% ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
    themeDisplay.getUser().getScreenName(); %>

Upvotes: 0

Martin Gamulin
Martin Gamulin

Reputation: 3865

If I understood you correctly this should give you portletId

final String portletResource = ParamUtil.getString(request, "portletResource");

final String portletId = PortletConstants.getRootPortletId(portletResource);

Upvotes: 1

Related Questions