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

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

Introduction

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

Prototype

public boolean hasRemoteStagingGroup();

Source Link

Usage

From source file:com.liferay.exportimport.internal.upgrade.v1_0_0.UpgradePublisherRequest.java

License:Open Source License

protected void updateScheduledPublications(Group group) throws PortalException {

    try (LoggingTimer loggingTimer = new LoggingTimer(String.valueOf(group.getGroupId()))) {

        boolean localStaging = true;

        if (group.isStagedRemotely() || group.hasRemoteStagingGroup()) {
            localStaging = false;/*from   www . ja  va2s. co  m*/
        }

        List<SchedulerResponse> scheduledJobs = _schedulerEngineHelper.getScheduledJobs(
                getSchedulerGroupName(group.getGroupId(), localStaging), StorageType.PERSISTED);

        for (SchedulerResponse schedulerResponse : scheduledJobs) {
            if (localStaging) {
                updateScheduledLocalPublication(schedulerResponse);
            } else {
                updateScheduleRemotePublication(schedulerResponse);
            }
        }
    }
}

From source file:com.liferay.staging.processes.web.internal.portlet.configuration.icon.PublishTemplatesConfigurationIcon.java

License:Open Source License

@Override
public boolean isShow(PortletRequest portletRequest) {
    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    Group scopeGroup = themeDisplay.getScopeGroup();

    if ((scopeGroup != null) && (scopeGroup.hasStagingGroup()
            || (scopeGroup.hasRemoteStagingGroup() && !scopeGroup.isStagedRemotely())
            || (!scopeGroup.isStaged() && !scopeGroup.isStagingGroup()))) {

        return false;
    }/*from   w  ww  .  j a v  a  2 s .c  o m*/

    User user = themeDisplay.getUser();

    if (user.isDefaultUser()) {
        return false;
    }

    return true;
}

From source file:com.liferay.staging.taglib.servlet.taglib.DefineObjectsTag.java

License:Open Source License

@Override
public int doStartTag() {
    HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();

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

    long groupId = ParamUtil.getLong(request, "groupId");

    Group group = GroupLocalServiceUtil.fetchGroup(groupId);

    if (group == null) {
        group = (Group) request.getAttribute(WebKeys.GROUP);
    }// ww  w  . j av  a  2s. c  o m

    if (group == null) {
        group = themeDisplay.getScopeGroup();
    }

    if (group == null) {
        return SKIP_BODY;
    }

    pageContext.setAttribute("group", group);
    pageContext.setAttribute("groupId", group.getGroupId());
    pageContext.setAttribute("liveGroup", null);
    pageContext.setAttribute("liveGroupId", 0L);

    Layout layout = themeDisplay.getLayout();

    String privateLayoutString = request.getParameter("privateLayout");

    if (Validator.isNull(privateLayoutString)) {
        privateLayoutString = GetterUtil.getString(request.getAttribute(WebKeys.PRIVATE_LAYOUT), null);
    }

    boolean privateLayout = GetterUtil.getBoolean(privateLayoutString, layout.isPrivateLayout());

    pageContext.setAttribute("privateLayout", privateLayout);

    pageContext.setAttribute("stagingGroup", null);
    pageContext.setAttribute("stagingGroupId", 0L);

    if (!group.isStaged() && !group.isStagedRemotely() && !group.hasLocalOrRemoteStagingGroup()) {

        return SKIP_BODY;
    }

    Group liveGroup = StagingUtil.getLiveGroup(group.getGroupId());

    pageContext.setAttribute("liveGroup", liveGroup);
    pageContext.setAttribute("liveGroupId", liveGroup.getGroupId());

    Group stagingGroup = null;

    if (!group.hasRemoteStagingGroup() || group.isStagedRemotely()) {
        stagingGroup = StagingUtil.getStagingGroup(group.getGroupId());
    }

    if (stagingGroup != null) {
        pageContext.setAttribute("stagingGroup", stagingGroup);
        pageContext.setAttribute("stagingGroupId", stagingGroup.getGroupId());
    }

    if (Validator.isNotNull(_portletId)) {
        boolean stagedPortlet = liveGroup.isStagedPortlet(_portletId);

        if (group.isStagedRemotely()) {
            stagedPortlet = stagingGroup.isStagedPortlet(_portletId);
        }

        if (stagedPortlet) {
            pageContext.setAttribute("group", stagingGroup);
            pageContext.setAttribute("groupId", stagingGroup.getGroupId());
            pageContext.setAttribute("scopeGroup", stagingGroup);
            pageContext.setAttribute("scopeGroupId", stagingGroup.getGroupId());
        }
    }

    return SKIP_BODY;
}