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.SystemException {
72          GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
73  
74          groupLocalService.deleteGroup(group);
75      }
76  
77      public static java.util.List<Object> dynamicQuery(
78          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
79          throws com.liferay.portal.SystemException {
80          GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
81  
82          return groupLocalService.dynamicQuery(dynamicQuery);
83      }
84  
85      public static java.util.List<Object> dynamicQuery(
86          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
87          int end) throws com.liferay.portal.SystemException {
88          GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
89  
90          return groupLocalService.dynamicQuery(dynamicQuery, start, end);
91      }
92  
93      public static com.liferay.portal.model.Group getGroup(long groupId)
94          throws com.liferay.portal.PortalException,
95              com.liferay.portal.SystemException {
96          GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
97  
98          return groupLocalService.getGroup(groupId);
99      }
100 
101     public static com.liferay.portal.model.Group updateGroup(
102         com.liferay.portal.model.Group group)
103         throws com.liferay.portal.SystemException {
104         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
105 
106         return groupLocalService.updateGroup(group);
107     }
108 
109     public static com.liferay.portal.model.Group addGroup(long userId,
110         java.lang.String className, long classPK, java.lang.String name,
111         java.lang.String description, int type, java.lang.String friendlyURL,
112         boolean active)
113         throws com.liferay.portal.PortalException,
114             com.liferay.portal.SystemException {
115         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
116 
117         return groupLocalService.addGroup(userId, className, classPK, name,
118             description, type, friendlyURL, active);
119     }
120 
121     public static com.liferay.portal.model.Group addGroup(long userId,
122         java.lang.String className, long classPK, long liveGroupId,
123         java.lang.String name, java.lang.String description, int type,
124         java.lang.String friendlyURL, boolean active)
125         throws com.liferay.portal.PortalException,
126             com.liferay.portal.SystemException {
127         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
128 
129         return groupLocalService.addGroup(userId, className, classPK,
130             liveGroupId, name, description, type, friendlyURL, active);
131     }
132 
133     public static void addRoleGroups(long roleId, long[] groupIds)
134         throws com.liferay.portal.SystemException {
135         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
136 
137         groupLocalService.addRoleGroups(roleId, groupIds);
138     }
139 
140     public static void addUserGroups(long userId, long[] groupIds)
141         throws com.liferay.portal.PortalException,
142             com.liferay.portal.SystemException {
143         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
144 
145         groupLocalService.addUserGroups(userId, groupIds);
146     }
147 
148     public static void checkSystemGroups(long companyId)
149         throws com.liferay.portal.PortalException,
150             com.liferay.portal.SystemException {
151         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
152 
153         groupLocalService.checkSystemGroups(companyId);
154     }
155 
156     public static com.liferay.portal.model.Group getFriendlyURLGroup(
157         long companyId, java.lang.String friendlyURL)
158         throws com.liferay.portal.PortalException,
159             com.liferay.portal.SystemException {
160         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
161 
162         return groupLocalService.getFriendlyURLGroup(companyId, friendlyURL);
163     }
164 
165     public static com.liferay.portal.model.Group getGroup(long companyId,
166         java.lang.String name)
167         throws com.liferay.portal.PortalException,
168             com.liferay.portal.SystemException {
169         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
170 
171         return groupLocalService.getGroup(companyId, name);
172     }
173 
174     public static java.util.List<com.liferay.portal.model.Group> getNullFriendlyURLGroups()
175         throws com.liferay.portal.SystemException {
176         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
177 
178         return groupLocalService.getNullFriendlyURLGroups();
179     }
180 
181     public static com.liferay.portal.model.Group getOrganizationGroup(
182         long companyId, long organizationId)
183         throws com.liferay.portal.PortalException,
184             com.liferay.portal.SystemException {
185         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
186 
187         return groupLocalService.getOrganizationGroup(companyId, organizationId);
188     }
189 
190     public static java.util.List<com.liferay.portal.model.Group> getOrganizationsGroups(
191         java.util.List<com.liferay.portal.model.Organization> organizations) {
192         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
193 
194         return groupLocalService.getOrganizationsGroups(organizations);
195     }
196 
197     public static java.util.List<com.liferay.portal.model.Group> getRoleGroups(
198         long roleId) throws com.liferay.portal.SystemException {
199         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
200 
201         return groupLocalService.getRoleGroups(roleId);
202     }
203 
204     public static com.liferay.portal.model.Group getStagingGroup(
205         long liveGroupId)
206         throws com.liferay.portal.PortalException,
207             com.liferay.portal.SystemException {
208         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
209 
210         return groupLocalService.getStagingGroup(liveGroupId);
211     }
212 
213     public static com.liferay.portal.model.Group getUserGroup(long companyId,
214         long userId)
215         throws com.liferay.portal.PortalException,
216             com.liferay.portal.SystemException {
217         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
218 
219         return groupLocalService.getUserGroup(companyId, userId);
220     }
221 
222     public static com.liferay.portal.model.Group getUserGroupGroup(
223         long companyId, long userGroupId)
224         throws com.liferay.portal.PortalException,
225             com.liferay.portal.SystemException {
226         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
227 
228         return groupLocalService.getUserGroupGroup(companyId, userGroupId);
229     }
230 
231     public static java.util.List<com.liferay.portal.model.Group> getUserGroups(
232         long userId) throws com.liferay.portal.SystemException {
233         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
234 
235         return groupLocalService.getUserGroups(userId);
236     }
237 
238     public static java.util.List<com.liferay.portal.model.Group> getUserGroupsGroups(
239         java.util.List<com.liferay.portal.model.UserGroup> userGroups) {
240         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
241 
242         return groupLocalService.getUserGroupsGroups(userGroups);
243     }
244 
245     public static boolean hasRoleGroup(long roleId, long groupId)
246         throws com.liferay.portal.SystemException {
247         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
248 
249         return groupLocalService.hasRoleGroup(roleId, groupId);
250     }
251 
252     public static boolean hasUserGroup(long userId, long groupId)
253         throws com.liferay.portal.SystemException {
254         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
255 
256         return groupLocalService.hasUserGroup(userId, groupId);
257     }
258 
259     public static java.util.List<com.liferay.portal.model.Group> search(
260         long companyId, java.lang.String name, java.lang.String description,
261         java.util.LinkedHashMap<String, Object> params, int start, int end)
262         throws com.liferay.portal.SystemException {
263         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
264 
265         return groupLocalService.search(companyId, name, description, params,
266             start, end);
267     }
268 
269     public static java.util.List<com.liferay.portal.model.Group> search(
270         long companyId, java.lang.String name, java.lang.String description,
271         java.util.LinkedHashMap<String, Object> params, int start, int end,
272         com.liferay.portal.kernel.util.OrderByComparator obc)
273         throws com.liferay.portal.SystemException {
274         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
275 
276         return groupLocalService.search(companyId, name, description, params,
277             start, end, obc);
278     }
279 
280     public static int searchCount(long companyId, java.lang.String name,
281         java.lang.String description,
282         java.util.LinkedHashMap<String, Object> params)
283         throws com.liferay.portal.SystemException {
284         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
285 
286         return groupLocalService.searchCount(companyId, name, description,
287             params);
288     }
289 
290     public static void setRoleGroups(long roleId, long[] groupIds)
291         throws com.liferay.portal.SystemException {
292         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
293 
294         groupLocalService.setRoleGroups(roleId, groupIds);
295     }
296 
297     public static void unsetRoleGroups(long roleId, long[] groupIds)
298         throws com.liferay.portal.SystemException {
299         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
300 
301         groupLocalService.unsetRoleGroups(roleId, groupIds);
302     }
303 
304     public static void unsetUserGroups(long userId, long[] groupIds)
305         throws com.liferay.portal.SystemException {
306         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
307 
308         groupLocalService.unsetUserGroups(userId, groupIds);
309     }
310 
311     public static com.liferay.portal.model.Group updateFriendlyURL(
312         long groupId, java.lang.String friendlyURL)
313         throws com.liferay.portal.PortalException,
314             com.liferay.portal.SystemException {
315         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
316 
317         return groupLocalService.updateFriendlyURL(groupId, friendlyURL);
318     }
319 
320     public static com.liferay.portal.model.Group updateGroup(long groupId,
321         java.lang.String name, java.lang.String description, int type,
322         java.lang.String friendlyURL, boolean active)
323         throws com.liferay.portal.PortalException,
324             com.liferay.portal.SystemException {
325         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
326 
327         return groupLocalService.updateGroup(groupId, name, description, type,
328             friendlyURL, active);
329     }
330 
331     public static com.liferay.portal.model.Group updateGroup(long groupId,
332         java.lang.String typeSettings)
333         throws com.liferay.portal.PortalException,
334             com.liferay.portal.SystemException {
335         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
336 
337         return groupLocalService.updateGroup(groupId, typeSettings);
338     }
339 
340     public static com.liferay.portal.model.Group updateWorkflow(long groupId,
341         boolean workflowEnabled, int workflowStages,
342         java.lang.String workflowRoleNames)
343         throws com.liferay.portal.PortalException,
344             com.liferay.portal.SystemException {
345         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
346 
347         return groupLocalService.updateWorkflow(groupId, workflowEnabled,
348             workflowStages, workflowRoleNames);
349     }
350 }