0

I can get the current Liferay site name from JSP:

<%= themeDisplay.getLayout().getGroup().getName() %>

It gives for instance "Guest".

QUESTION: How to get the same from the Java Portlet class?

The closest I have found are the PortalUtil.getLayoutURL methods but I don't want an URL as the site name from the URL is all lowercase and potentially different from the real site name.

Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373

2 Answers2

3

Or simply:

ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest
            .getAttribute(WebKeys.THEME_DISPLAY);
themeDisplay.getScopeGroup().getName();
Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373
MedHajri
  • 101
  • 4
1
ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest
            .getAttribute(WebKeys.THEME_DISPLAY);    
GroupLocalServiceUtil.getGroup(themeDisplay.getScopeGroupId()).getName();
Harsha Kasturi
  • 233
  • 2
  • 13