Example usage for com.liferay.portal.kernel.model Group isInStagingPortlet

List of usage examples for com.liferay.portal.kernel.model Group isInStagingPortlet

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.model Group isInStagingPortlet.

Prototype

public boolean isInStagingPortlet(String portletId);

Source Link

Usage

From source file:com.liferay.journal.content.web.internal.display.context.JournalContentDisplayContext.java

License:Open Source License

public long getGroupId() {
    ThemeDisplay themeDisplay = (ThemeDisplay) _portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    long groupId = themeDisplay.getScopeGroupId();

    Group scopeGroup = themeDisplay.getScopeGroup();

    if (!scopeGroup.isStaged() || !scopeGroup.isInStagingPortlet(JournalPortletKeys.JOURNAL)) {

        groupId = scopeGroup.getLiveGroupId();
    }//  www.  j ava2 s  . c  o m

    return groupId;
}

From source file:com.liferay.journal.content.web.internal.display.context.JournalContentDisplayContext.java

License:Open Source License

public long[] getSelectedGroupIds() throws PortalException {
    ThemeDisplay themeDisplay = (ThemeDisplay) _portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    Group scopeGroup = themeDisplay.getScopeGroup();

    if (scopeGroup.isStagingGroup() && !scopeGroup.isInStagingPortlet(JournalPortletKeys.JOURNAL)) {

        return new long[] { scopeGroup.getLiveGroupId() };
    }/*www. j  ava 2s  .co  m*/

    if (themeDisplay.getScopeGroupId() == themeDisplay.getSiteGroupId()) {
        return PortalUtil.getSharedContentSiteGroupIds(themeDisplay.getCompanyId(),
                themeDisplay.getScopeGroupId(), themeDisplay.getUserId());
    }

    return new long[] { themeDisplay.getScopeGroupId() };
}