Example usage for com.liferay.portal.kernel.service GroupLocalServiceUtil addGroup

List of usage examples for com.liferay.portal.kernel.service GroupLocalServiceUtil addGroup

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.service GroupLocalServiceUtil addGroup.

Prototype

public static com.liferay.portal.kernel.model.Group addGroup(long userId, long parentGroupId, String className,
            long classPK, long liveGroupId, java.util.Map<java.util.Locale, String> nameMap,
            java.util.Map<java.util.Locale, String> descriptionMap, int type, boolean manualMembership,
            int membershipRestriction, String friendlyURL, boolean site, boolean inheritContent, boolean active,
            ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException 

Source Link

Usage

From source file:eu.gerhards.liferay.services.angular.service.impl.AngularGroupServiceImpl.java

License:Open Source License

@Override
public Group createGroup(long parentGroupId, long liveGroupId, Map<Locale, String> nameMap,
        Map<Locale, String> descriptionMap, int type, boolean manualMembership, int membershipRestriction,
        String friendlyURL, boolean site, boolean inheritContent, boolean active) throws PortalException {

    _log.info("Creating new group ...");

    _log.debug("    security check ...");

    PortalPermissionUtil.check(getPermissionChecker(), ActionKeys.ADD_COMMUNITY);

    _log.debug("    ... processing ...");

    User user = this.getGuestOrUser();

    com.liferay.portal.kernel.service.ServiceContext serviceContext = new com.liferay.portal.kernel.service.ServiceContext();
    serviceContext.setUserId(user.getUserId());
    serviceContext.setCompanyId(user.getCompanyId());

    return GroupLocalServiceUtil.addGroup(user.getUserId(), parentGroupId, null, 0L, liveGroupId, nameMap,
            descriptionMap, type, manualMembership, membershipRestriction, friendlyURL, site, inheritContent,
            active, serviceContext);//from  w  w w . jav  a2 s .  c  om

}

From source file:eu.gerhards.liferay.services.angular.service.impl.AngularSiteServiceImpl.java

License:Open Source License

@Override
public Group createSite(long parentSiteId, long liveGroupId, Map<Locale, String> nameMap,
        Map<Locale, String> descriptionMap, int type, boolean manualMembership, int membershipRestriction,
        String friendlyURL, boolean site, boolean inheritContent, boolean active) throws PortalException {

    _log.info("Creating new site ...");

    _log.debug("    security check ...");

    PortalPermissionUtil.check(getPermissionChecker(), ActionKeys.ADD_COMMUNITY);

    _log.debug("    ... processing ...");

    User user = this.getGuestOrUser();

    com.liferay.portal.kernel.service.ServiceContext serviceContext = new com.liferay.portal.kernel.service.ServiceContext();
    serviceContext.setUserId(user.getUserId());
    serviceContext.setCompanyId(user.getCompanyId());

    return GroupLocalServiceUtil.addGroup(user.getUserId(), parentSiteId, null, 0L, liveGroupId, nameMap,
            descriptionMap, type, manualMembership, membershipRestriction, friendlyURL, site, inheritContent,
            active, serviceContext);/*from  w  w  w .jav a 2 s. c o m*/
}