Example usage for com.liferay.portal.kernel.theme ThemeDisplay getDoAsGroupId

List of usage examples for com.liferay.portal.kernel.theme ThemeDisplay getDoAsGroupId

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.theme ThemeDisplay getDoAsGroupId.

Prototype

public long getDoAsGroupId() 

Source Link

Usage

From source file:com.liferay.site.admin.web.internal.portlet.SiteAdminPortlet.java

License:Open Source License

protected void updateActive(ActionRequest actionRequest, boolean active) throws Exception {

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

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

    if ((groupId == themeDisplay.getDoAsGroupId()) || (groupId == themeDisplay.getScopeGroupId())
            || (groupId == getRefererGroupId(themeDisplay))) {

        throw new RequiredGroupException.MustNotDeleteCurrentGroup(groupId);
    }//from  w w  w. ja va2  s .co  m

    Group group = groupService.getGroup(groupId);

    ServiceContext serviceContext = ServiceContextFactory.getInstance(Group.class.getName(), actionRequest);

    groupService.updateGroup(groupId, group.getParentGroupId(), group.getNameMap(), group.getDescriptionMap(),
            group.getType(), group.isManualMembership(), group.getMembershipRestriction(),
            group.getFriendlyURL(), group.isInheritContent(), active, serviceContext);

    themeDisplay.setScopeGroupId(groupId);
}