1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service;
24  
25  
26  /**
27   * <a href="GroupLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides static methods for the
36   * <code>com.liferay.portal.service.GroupLocalService</code>
37   * bean. The static methods of this class calls the same methods of the bean
38   * instance. It's convenient to be able to just write one line to call a method
39   * on a bean instead of writing a lookup call and a method call.
40   * </p>
41   *
42   * <p>
43   * <code>com.liferay.portal.service.GroupLocalServiceFactory</code>
44   * is responsible for the lookup of the bean.
45   * </p>
46   *
47   * @author Brian Wing Shun Chan
48   *
49   * @see com.liferay.portal.service.GroupLocalService
50   * @see com.liferay.portal.service.GroupLocalServiceFactory
51   *
52   */
53  public class GroupLocalServiceUtil {
54      public static com.liferay.portal.model.Group addGroup(
55          com.liferay.portal.model.Group group)
56          throws com.liferay.portal.SystemException {
57          GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
58  
59          return groupLocalService.addGroup(group);
60      }
61  
62      public static void deleteGroup(long groupId)
63          throws com.liferay.portal.PortalException,
64              com.liferay.portal.SystemException {
65          GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
66  
67          groupLocalService.deleteGroup(groupId);
68      }
69  
70      public static void deleteGroup(com.liferay.portal.model.Group group)
71          throws com.liferay.portal.PortalException,
72              com.liferay.portal.SystemException {
73          GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
74  
75          groupLocalService.deleteGroup(group);
76      }
77  
78      public static java.util.List<com.liferay.portal.model.Group> dynamicQuery(
79          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
80          throws com.liferay.portal.SystemException {
81          GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
82  
83          return groupLocalService.dynamicQuery(queryInitializer);
84      }
85  
86      public static java.util.List<com.liferay.portal.model.Group> dynamicQuery(
87          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
88          int begin, int end) throws com.liferay.portal.SystemException {
89          GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
90  
91          return groupLocalService.dynamicQuery(queryInitializer, begin, end);
92      }
93  
94      public static com.liferay.portal.model.Group updateGroup(
95          com.liferay.portal.model.Group group)
96          throws com.liferay.portal.SystemException {
97          GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
98  
99          return groupLocalService.updateGroup(group);
100     }
101 
102     public static com.liferay.portal.model.Group addGroup(long userId,
103         java.lang.String className, long classPK, java.lang.String name,
104         java.lang.String description, int type, java.lang.String friendlyURL,
105         boolean active)
106         throws com.liferay.portal.PortalException,
107             com.liferay.portal.SystemException {
108         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
109 
110         return groupLocalService.addGroup(userId, className, classPK, name,
111             description, type, friendlyURL, active);
112     }
113 
114     public static com.liferay.portal.model.Group addGroup(long userId,
115         java.lang.String className, long classPK, long liveGroupId,
116         java.lang.String name, java.lang.String description, int type,
117         java.lang.String friendlyURL, boolean active)
118         throws com.liferay.portal.PortalException,
119             com.liferay.portal.SystemException {
120         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
121 
122         return groupLocalService.addGroup(userId, className, classPK,
123             liveGroupId, name, description, type, friendlyURL, active);
124     }
125 
126     public static void addRoleGroups(long roleId, long[] groupIds)
127         throws com.liferay.portal.PortalException,
128             com.liferay.portal.SystemException {
129         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
130 
131         groupLocalService.addRoleGroups(roleId, groupIds);
132     }
133 
134     public static void addUserGroups(long userId, long[] groupIds)
135         throws com.liferay.portal.PortalException,
136             com.liferay.portal.SystemException {
137         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
138 
139         groupLocalService.addUserGroups(userId, groupIds);
140     }
141 
142     public static void checkSystemGroups(long companyId)
143         throws com.liferay.portal.PortalException,
144             com.liferay.portal.SystemException {
145         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
146 
147         groupLocalService.checkSystemGroups(companyId);
148     }
149 
150     public static com.liferay.portal.model.Group getFriendlyURLGroup(
151         long companyId, java.lang.String friendlyURL)
152         throws com.liferay.portal.PortalException,
153             com.liferay.portal.SystemException {
154         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
155 
156         return groupLocalService.getFriendlyURLGroup(companyId, friendlyURL);
157     }
158 
159     public static com.liferay.portal.model.Group getGroup(long groupId)
160         throws com.liferay.portal.PortalException,
161             com.liferay.portal.SystemException {
162         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
163 
164         return groupLocalService.getGroup(groupId);
165     }
166 
167     public static com.liferay.portal.model.Group getGroup(long companyId,
168         java.lang.String name)
169         throws com.liferay.portal.PortalException,
170             com.liferay.portal.SystemException {
171         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
172 
173         return groupLocalService.getGroup(companyId, name);
174     }
175 
176     public static java.util.List<com.liferay.portal.model.Group> getNullFriendlyURLGroups()
177         throws com.liferay.portal.SystemException {
178         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
179 
180         return groupLocalService.getNullFriendlyURLGroups();
181     }
182 
183     public static com.liferay.portal.model.Group getOrganizationGroup(
184         long companyId, long organizationId)
185         throws com.liferay.portal.PortalException,
186             com.liferay.portal.SystemException {
187         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
188 
189         return groupLocalService.getOrganizationGroup(companyId, organizationId);
190     }
191 
192     public static java.util.List<com.liferay.portal.model.Group> getOrganizationsGroups(
193         java.util.List<com.liferay.portal.model.Organization> organizations)
194         throws com.liferay.portal.PortalException,
195             com.liferay.portal.SystemException {
196         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
197 
198         return groupLocalService.getOrganizationsGroups(organizations);
199     }
200 
201     public static java.util.List<com.liferay.portal.model.Group> getRoleGroups(
202         long roleId)
203         throws com.liferay.portal.PortalException,
204             com.liferay.portal.SystemException {
205         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
206 
207         return groupLocalService.getRoleGroups(roleId);
208     }
209 
210     public static com.liferay.portal.model.Group getStagingGroup(
211         long liveGroupId)
212         throws com.liferay.portal.PortalException,
213             com.liferay.portal.SystemException {
214         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
215 
216         return groupLocalService.getStagingGroup(liveGroupId);
217     }
218 
219     public static com.liferay.portal.model.Group getUserGroup(long companyId,
220         long userId)
221         throws com.liferay.portal.PortalException,
222             com.liferay.portal.SystemException {
223         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
224 
225         return groupLocalService.getUserGroup(companyId, userId);
226     }
227 
228     public static com.liferay.portal.model.Group getUserGroupGroup(
229         long companyId, long userGroupId)
230         throws com.liferay.portal.PortalException,
231             com.liferay.portal.SystemException {
232         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
233 
234         return groupLocalService.getUserGroupGroup(companyId, userGroupId);
235     }
236 
237     public static java.util.List<com.liferay.portal.model.Group> getUserGroups(
238         long userId)
239         throws com.liferay.portal.PortalException,
240             com.liferay.portal.SystemException {
241         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
242 
243         return groupLocalService.getUserGroups(userId);
244     }
245 
246     public static java.util.List<com.liferay.portal.model.Group> getUserGroupsGroups(
247         java.util.List<com.liferay.portal.model.UserGroup> userGroups)
248         throws com.liferay.portal.PortalException,
249             com.liferay.portal.SystemException {
250         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
251 
252         return groupLocalService.getUserGroupsGroups(userGroups);
253     }
254 
255     public static boolean hasRoleGroup(long roleId, long groupId)
256         throws com.liferay.portal.PortalException,
257             com.liferay.portal.SystemException {
258         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
259 
260         return groupLocalService.hasRoleGroup(roleId, groupId);
261     }
262 
263     public static boolean hasUserGroup(long userId, long groupId)
264         throws com.liferay.portal.SystemException {
265         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
266 
267         return groupLocalService.hasUserGroup(userId, groupId);
268     }
269 
270     public static java.util.List<com.liferay.portal.model.Group> search(
271         long companyId, java.lang.String name, java.lang.String description,
272         java.util.LinkedHashMap<String, Object> params, int begin, int end)
273         throws com.liferay.portal.SystemException {
274         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
275 
276         return groupLocalService.search(companyId, name, description, params,
277             begin, end);
278     }
279 
280     public static java.util.List<com.liferay.portal.model.Group> search(
281         long companyId, java.lang.String name, java.lang.String description,
282         java.util.LinkedHashMap<String, Object> params, int begin, int end,
283         com.liferay.portal.kernel.util.OrderByComparator obc)
284         throws com.liferay.portal.SystemException {
285         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
286 
287         return groupLocalService.search(companyId, name, description, params,
288             begin, end, obc);
289     }
290 
291     public static int searchCount(long companyId, java.lang.String name,
292         java.lang.String description,
293         java.util.LinkedHashMap<String, Object> params)
294         throws com.liferay.portal.SystemException {
295         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
296 
297         return groupLocalService.searchCount(companyId, name, description,
298             params);
299     }
300 
301     public static void setRoleGroups(long roleId, long[] groupIds)
302         throws com.liferay.portal.PortalException,
303             com.liferay.portal.SystemException {
304         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
305 
306         groupLocalService.setRoleGroups(roleId, groupIds);
307     }
308 
309     public static void unsetRoleGroups(long roleId, long[] groupIds)
310         throws com.liferay.portal.PortalException,
311             com.liferay.portal.SystemException {
312         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
313 
314         groupLocalService.unsetRoleGroups(roleId, groupIds);
315     }
316 
317     public static void unsetUserGroups(long userId, long[] groupIds)
318         throws com.liferay.portal.PortalException,
319             com.liferay.portal.SystemException {
320         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
321 
322         groupLocalService.unsetUserGroups(userId, groupIds);
323     }
324 
325     public static com.liferay.portal.model.Group updateFriendlyURL(
326         long groupId, java.lang.String friendlyURL)
327         throws com.liferay.portal.PortalException,
328             com.liferay.portal.SystemException {
329         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
330 
331         return groupLocalService.updateFriendlyURL(groupId, friendlyURL);
332     }
333 
334     public static com.liferay.portal.model.Group updateGroup(long groupId,
335         java.lang.String name, java.lang.String description, int type,
336         java.lang.String friendlyURL, boolean active)
337         throws com.liferay.portal.PortalException,
338             com.liferay.portal.SystemException {
339         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
340 
341         return groupLocalService.updateGroup(groupId, name, description, type,
342             friendlyURL, active);
343     }
344 
345     public static com.liferay.portal.model.Group updateGroup(long groupId,
346         java.lang.String typeSettings)
347         throws com.liferay.portal.PortalException,
348             com.liferay.portal.SystemException {
349         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
350 
351         return groupLocalService.updateGroup(groupId, typeSettings);
352     }
353 
354     public static com.liferay.portal.model.Group updateWorkflow(long groupId,
355         boolean workflowEnabled, int workflowStages,
356         java.lang.String workflowRoleNames)
357         throws com.liferay.portal.PortalException,
358             com.liferay.portal.SystemException {
359         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
360 
361         return groupLocalService.updateWorkflow(groupId, workflowEnabled,
362             workflowStages, workflowRoleNames);
363     }
364 }