Example usage for com.liferay.portal.kernel.util PortalUtil getScopeGroupId

List of usage examples for com.liferay.portal.kernel.util PortalUtil getScopeGroupId

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util PortalUtil getScopeGroupId.

Prototype

public static long getScopeGroupId(Layout layout, String portletId) 

Source Link

Usage

From source file:com.liferay.dynamic.data.mapping.util.BaseDDMDisplay.java

License:Open Source License

@Override
public long[] getTemplateGroupIds(ThemeDisplay themeDisplay, boolean includeAncestorTemplates)
        throws Exception {

    HttpServletRequest request = themeDisplay.getRequest();

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    long groupId = themeDisplay.getScopeGroupId();

    String refererPortletName = ParamUtil.getString(request,
            portletDisplay.getNamespace() + "refererPortletName");

    if (Validator.isNull(refererPortletName)) {
        groupId = PortalUtil.getScopeGroupId(request, refererPortletName);
    }/*from  w ww .  java 2 s. c  o  m*/

    if (includeAncestorTemplates) {
        return PortalUtil.getCurrentAndAncestorSiteGroupIds(groupId);
    }

    return new long[] { groupId };
}