1   /**
2    * Copyright (c) 2000-2007 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   * <a href="GroupLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be overwritten
30   * the next time is generated.
31   * </p>
32   *
33   * <p>
34   * This class provides static methods for the <code>com.liferay.portal.service.GroupLocalService</code>
35   * bean. The static methods of this class calls the same methods of the bean instance.
36   * It's convenient to be able to just write one line to call a method on a bean
37   * instead of writing a lookup call and a method call.
38   * </p>
39   *
40   * <p>
41   * <code>com.liferay.portal.service.GroupLocalServiceFactory</code> is responsible
42   * for the lookup of the bean.
43   * </p>
44   *
45   * @author Brian Wing Shun Chan
46   *
47   * @see com.liferay.portal.service.GroupLocalService
48   * @see com.liferay.portal.service.GroupLocalServiceFactory
49   *
50   */
51  public class GroupLocalServiceUtil {
52      public static com.liferay.portal.model.Group addGroup(
53          com.liferay.portal.model.Group model)
54          throws com.liferay.portal.SystemException {
55          GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
56  
57          return groupLocalService.addGroup(model);
58      }
59  
60      public static java.util.List dynamicQuery(
61          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
62          throws com.liferay.portal.SystemException {
63          GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
64  
65          return groupLocalService.dynamicQuery(queryInitializer);
66      }
67  
68      public static java.util.List dynamicQuery(
69          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
70          int begin, int end) throws com.liferay.portal.SystemException {
71          GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
72  
73          return groupLocalService.dynamicQuery(queryInitializer, begin, end);
74      }
75  
76      public static com.liferay.portal.model.Group updateGroup(
77          com.liferay.portal.model.Group model)
78          throws com.liferay.portal.SystemException {
79          GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
80  
81          return groupLocalService.updateGroup(model);
82      }
83  
84      public static com.liferay.portal.model.Group addGroup(long userId,
85          java.lang.String className, long classPK, java.lang.String name,
86          java.lang.String description, java.lang.String type,
87          java.lang.String friendlyURL, boolean active)
88          throws com.liferay.portal.PortalException, 
89              com.liferay.portal.SystemException {
90          GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
91  
92          return groupLocalService.addGroup(userId, className, classPK, name,
93              description, type, friendlyURL, active);
94      }
95  
96      public static com.liferay.portal.model.Group addGroup(long userId,
97          java.lang.String className, long classPK, long liveGroupId,
98          java.lang.String name, java.lang.String description,
99          java.lang.String type, java.lang.String friendlyURL, boolean active)
100         throws com.liferay.portal.PortalException, 
101             com.liferay.portal.SystemException {
102         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
103 
104         return groupLocalService.addGroup(userId, className, classPK,
105             liveGroupId, name, description, type, friendlyURL, active);
106     }
107 
108     public static void addRoleGroups(long roleId, long[] groupIds)
109         throws com.liferay.portal.PortalException, 
110             com.liferay.portal.SystemException {
111         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
112         groupLocalService.addRoleGroups(roleId, groupIds);
113     }
114 
115     public static void addUserGroups(long userId, long[] groupIds)
116         throws com.liferay.portal.PortalException, 
117             com.liferay.portal.SystemException {
118         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
119         groupLocalService.addUserGroups(userId, groupIds);
120     }
121 
122     public static void checkSystemGroups(long companyId)
123         throws com.liferay.portal.PortalException, 
124             com.liferay.portal.SystemException {
125         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
126         groupLocalService.checkSystemGroups(companyId);
127     }
128 
129     public static void deleteGroup(long groupId)
130         throws com.liferay.portal.PortalException, 
131             com.liferay.portal.SystemException {
132         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
133         groupLocalService.deleteGroup(groupId);
134     }
135 
136     public static com.liferay.portal.model.Group getFriendlyURLGroup(
137         long companyId, java.lang.String friendlyURL)
138         throws com.liferay.portal.PortalException, 
139             com.liferay.portal.SystemException {
140         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
141 
142         return groupLocalService.getFriendlyURLGroup(companyId, friendlyURL);
143     }
144 
145     public static com.liferay.portal.model.Group getGroup(long groupId)
146         throws com.liferay.portal.PortalException, 
147             com.liferay.portal.SystemException {
148         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
149 
150         return groupLocalService.getGroup(groupId);
151     }
152 
153     public static com.liferay.portal.model.Group getGroup(long companyId,
154         java.lang.String name)
155         throws com.liferay.portal.PortalException, 
156             com.liferay.portal.SystemException {
157         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
158 
159         return groupLocalService.getGroup(companyId, name);
160     }
161 
162     public static com.liferay.portal.model.Group getOrganizationGroup(
163         long companyId, long organizationId)
164         throws com.liferay.portal.PortalException, 
165             com.liferay.portal.SystemException {
166         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
167 
168         return groupLocalService.getOrganizationGroup(companyId, organizationId);
169     }
170 
171     public static java.util.List getOrganizationsGroups(
172         java.util.List organizations)
173         throws com.liferay.portal.PortalException, 
174             com.liferay.portal.SystemException {
175         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
176 
177         return groupLocalService.getOrganizationsGroups(organizations);
178     }
179 
180     public static java.util.List getRoleGroups(long roleId)
181         throws com.liferay.portal.PortalException, 
182             com.liferay.portal.SystemException {
183         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
184 
185         return groupLocalService.getRoleGroups(roleId);
186     }
187 
188     public static com.liferay.portal.model.Group getStagingGroup(
189         long liveGroupId)
190         throws com.liferay.portal.PortalException, 
191             com.liferay.portal.SystemException {
192         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
193 
194         return groupLocalService.getStagingGroup(liveGroupId);
195     }
196 
197     public static com.liferay.portal.model.Group getUserGroup(long companyId,
198         long userId)
199         throws com.liferay.portal.PortalException, 
200             com.liferay.portal.SystemException {
201         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
202 
203         return groupLocalService.getUserGroup(companyId, userId);
204     }
205 
206     public static com.liferay.portal.model.Group getUserGroupGroup(
207         long companyId, long userGroupId)
208         throws com.liferay.portal.PortalException, 
209             com.liferay.portal.SystemException {
210         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
211 
212         return groupLocalService.getUserGroupGroup(companyId, userGroupId);
213     }
214 
215     public static java.util.List getUserGroupsGroups(java.util.List userGroups)
216         throws com.liferay.portal.PortalException, 
217             com.liferay.portal.SystemException {
218         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
219 
220         return groupLocalService.getUserGroupsGroups(userGroups);
221     }
222 
223     public static boolean hasRoleGroup(long roleId, long groupId)
224         throws com.liferay.portal.PortalException, 
225             com.liferay.portal.SystemException {
226         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
227 
228         return groupLocalService.hasRoleGroup(roleId, groupId);
229     }
230 
231     public static boolean hasUserGroup(long userId, long groupId)
232         throws com.liferay.portal.SystemException {
233         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
234 
235         return groupLocalService.hasUserGroup(userId, groupId);
236     }
237 
238     public static java.util.List search(long companyId, java.lang.String name,
239         java.lang.String description, java.util.LinkedHashMap params,
240         int begin, int end) throws com.liferay.portal.SystemException {
241         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
242 
243         return groupLocalService.search(companyId, name, description, params,
244             begin, end);
245     }
246 
247     public static int searchCount(long companyId, java.lang.String name,
248         java.lang.String description, java.util.LinkedHashMap params)
249         throws com.liferay.portal.SystemException {
250         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
251 
252         return groupLocalService.searchCount(companyId, name, description,
253             params);
254     }
255 
256     public static void setRoleGroups(long roleId, long[] groupIds)
257         throws com.liferay.portal.PortalException, 
258             com.liferay.portal.SystemException {
259         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
260         groupLocalService.setRoleGroups(roleId, groupIds);
261     }
262 
263     public static void setUserGroups(long userId, long[] groupIds)
264         throws com.liferay.portal.PortalException, 
265             com.liferay.portal.SystemException {
266         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
267         groupLocalService.setUserGroups(userId, groupIds);
268     }
269 
270     public static void unsetRoleGroups(long roleId, long[] groupIds)
271         throws com.liferay.portal.PortalException, 
272             com.liferay.portal.SystemException {
273         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
274         groupLocalService.unsetRoleGroups(roleId, groupIds);
275     }
276 
277     public static void unsetUserGroups(long userId, long[] groupIds)
278         throws com.liferay.portal.PortalException, 
279             com.liferay.portal.SystemException {
280         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
281         groupLocalService.unsetUserGroups(userId, groupIds);
282     }
283 
284     public static com.liferay.portal.model.Group updateGroup(long groupId,
285         java.lang.String name, java.lang.String description,
286         java.lang.String type, java.lang.String friendlyURL, boolean active)
287         throws com.liferay.portal.PortalException, 
288             com.liferay.portal.SystemException {
289         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
290 
291         return groupLocalService.updateGroup(groupId, name, description, type,
292             friendlyURL, active);
293     }
294 
295     public static com.liferay.portal.model.Group updateGroup(long groupId,
296         java.lang.String typeSettings)
297         throws com.liferay.portal.PortalException, 
298             com.liferay.portal.SystemException {
299         GroupLocalService groupLocalService = GroupLocalServiceFactory.getService();
300 
301         return groupLocalService.updateGroup(groupId, typeSettings);
302     }
303 }