001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the group remote service. This utility wraps {@link com.liferay.portal.service.impl.GroupServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
023     *
024     * <p>
025     * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see GroupService
030     * @see com.liferay.portal.service.base.GroupServiceBaseImpl
031     * @see com.liferay.portal.service.impl.GroupServiceImpl
032     * @generated
033     */
034    public class GroupServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.GroupServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static com.liferay.portal.model.Group addGroup(long liveGroupId,
041                    java.lang.String name, java.lang.String description, int type,
042                    java.lang.String friendlyURL, boolean active,
043                    com.liferay.portal.service.ServiceContext serviceContext)
044                    throws com.liferay.portal.kernel.exception.PortalException,
045                            com.liferay.portal.kernel.exception.SystemException {
046                    return getService()
047                                       .addGroup(liveGroupId, name, description, type, friendlyURL,
048                            active, serviceContext);
049            }
050    
051            public static com.liferay.portal.model.Group addGroup(
052                    java.lang.String name, java.lang.String description, int type,
053                    java.lang.String friendlyURL, boolean active,
054                    com.liferay.portal.service.ServiceContext serviceContext)
055                    throws com.liferay.portal.kernel.exception.PortalException,
056                            com.liferay.portal.kernel.exception.SystemException {
057                    return getService()
058                                       .addGroup(name, description, type, friendlyURL, active,
059                            serviceContext);
060            }
061    
062            public static void addRoleGroups(long roleId, long[] groupIds)
063                    throws com.liferay.portal.kernel.exception.PortalException,
064                            com.liferay.portal.kernel.exception.SystemException {
065                    getService().addRoleGroups(roleId, groupIds);
066            }
067    
068            public static void deleteGroup(long groupId)
069                    throws com.liferay.portal.kernel.exception.PortalException,
070                            com.liferay.portal.kernel.exception.SystemException {
071                    getService().deleteGroup(groupId);
072            }
073    
074            public static com.liferay.portal.model.Group getGroup(long groupId)
075                    throws com.liferay.portal.kernel.exception.PortalException,
076                            com.liferay.portal.kernel.exception.SystemException {
077                    return getService().getGroup(groupId);
078            }
079    
080            public static com.liferay.portal.model.Group getGroup(long companyId,
081                    java.lang.String name)
082                    throws com.liferay.portal.kernel.exception.PortalException,
083                            com.liferay.portal.kernel.exception.SystemException {
084                    return getService().getGroup(companyId, name);
085            }
086    
087            public static java.util.List<com.liferay.portal.model.Group> getManageableGroups(
088                    java.lang.String actionId, int max)
089                    throws com.liferay.portal.kernel.exception.PortalException,
090                            com.liferay.portal.kernel.exception.SystemException {
091                    return getService().getManageableGroups(actionId, max);
092            }
093    
094            public static java.util.List<com.liferay.portal.model.Group> getOrganizationsGroups(
095                    java.util.List<com.liferay.portal.model.Organization> organizations) {
096                    return getService().getOrganizationsGroups(organizations);
097            }
098    
099            public static com.liferay.portal.model.Group getUserGroup(long companyId,
100                    long userId)
101                    throws com.liferay.portal.kernel.exception.PortalException,
102                            com.liferay.portal.kernel.exception.SystemException {
103                    return getService().getUserGroup(companyId, userId);
104            }
105    
106            public static java.util.List<com.liferay.portal.model.Group> getUserGroupsGroups(
107                    java.util.List<com.liferay.portal.model.UserGroup> userGroups)
108                    throws com.liferay.portal.kernel.exception.PortalException,
109                            com.liferay.portal.kernel.exception.SystemException {
110                    return getService().getUserGroupsGroups(userGroups);
111            }
112    
113            public static java.util.List<com.liferay.portal.model.Group> getUserOrganizationsGroups(
114                    long userId, int start, int end)
115                    throws com.liferay.portal.kernel.exception.PortalException,
116                            com.liferay.portal.kernel.exception.SystemException {
117                    return getService().getUserOrganizationsGroups(userId, start, end);
118            }
119    
120            public static boolean hasUserGroup(long userId, long groupId)
121                    throws com.liferay.portal.kernel.exception.SystemException {
122                    return getService().hasUserGroup(userId, groupId);
123            }
124    
125            public static java.util.List<com.liferay.portal.model.Group> search(
126                    long companyId, java.lang.String name, java.lang.String description,
127                    java.lang.String[] params, int start, int end)
128                    throws com.liferay.portal.kernel.exception.SystemException {
129                    return getService()
130                                       .search(companyId, name, description, params, start, end);
131            }
132    
133            public static int searchCount(long companyId, java.lang.String name,
134                    java.lang.String description, java.lang.String[] params)
135                    throws com.liferay.portal.kernel.exception.SystemException {
136                    return getService().searchCount(companyId, name, description, params);
137            }
138    
139            public static void setRoleGroups(long roleId, long[] groupIds)
140                    throws com.liferay.portal.kernel.exception.PortalException,
141                            com.liferay.portal.kernel.exception.SystemException {
142                    getService().setRoleGroups(roleId, groupIds);
143            }
144    
145            public static void unsetRoleGroups(long roleId, long[] groupIds)
146                    throws com.liferay.portal.kernel.exception.PortalException,
147                            com.liferay.portal.kernel.exception.SystemException {
148                    getService().unsetRoleGroups(roleId, groupIds);
149            }
150    
151            public static com.liferay.portal.model.Group updateFriendlyURL(
152                    long groupId, java.lang.String friendlyURL)
153                    throws com.liferay.portal.kernel.exception.PortalException,
154                            com.liferay.portal.kernel.exception.SystemException {
155                    return getService().updateFriendlyURL(groupId, friendlyURL);
156            }
157    
158            public static com.liferay.portal.model.Group updateGroup(long groupId,
159                    java.lang.String typeSettings)
160                    throws com.liferay.portal.kernel.exception.PortalException,
161                            com.liferay.portal.kernel.exception.SystemException {
162                    return getService().updateGroup(groupId, typeSettings);
163            }
164    
165            public static com.liferay.portal.model.Group updateGroup(long groupId,
166                    java.lang.String name, java.lang.String description, int type,
167                    java.lang.String friendlyURL, boolean active,
168                    com.liferay.portal.service.ServiceContext serviceContext)
169                    throws com.liferay.portal.kernel.exception.PortalException,
170                            com.liferay.portal.kernel.exception.SystemException {
171                    return getService()
172                                       .updateGroup(groupId, name, description, type, friendlyURL,
173                            active, serviceContext);
174            }
175    
176            public static com.liferay.portal.model.Group updateWorkflow(long groupId,
177                    boolean workflowEnabled, int workflowStages,
178                    java.lang.String workflowRoleNames)
179                    throws com.liferay.portal.kernel.exception.PortalException,
180                            com.liferay.portal.kernel.exception.SystemException {
181                    return getService()
182                                       .updateWorkflow(groupId, workflowEnabled, workflowStages,
183                            workflowRoleNames);
184            }
185    
186            public static GroupService getService() {
187                    if (_service == null) {
188                            _service = (GroupService)PortalBeanLocatorUtil.locate(GroupService.class.getName());
189    
190                            ReferenceRegistry.registerReference(GroupServiceUtil.class,
191                                    "_service");
192                            MethodCache.remove(GroupService.class);
193                    }
194    
195                    return _service;
196            }
197    
198            public void setService(GroupService service) {
199                    MethodCache.remove(GroupService.class);
200    
201                    _service = service;
202    
203                    ReferenceRegistry.registerReference(GroupServiceUtil.class, "_service");
204                    MethodCache.remove(GroupService.class);
205            }
206    
207            private static GroupService _service;
208    }