1   /**
2    * Copyright (c) 2000-2009 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="GroupServiceUtil.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.GroupService</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   * @author Brian Wing Shun Chan
43   *
44   * @see com.liferay.portal.service.GroupService
45   *
46   */
47  public class GroupServiceUtil {
48      public static com.liferay.portal.model.Group addGroup(
49          java.lang.String name, java.lang.String description, int type,
50          java.lang.String friendlyURL, boolean active,
51          com.liferay.portal.service.ServiceContext serviceContext)
52          throws com.liferay.portal.PortalException,
53              com.liferay.portal.SystemException {
54          return getService()
55                     .addGroup(name, description, type, friendlyURL, active,
56              serviceContext);
57      }
58  
59      public static com.liferay.portal.model.Group addGroup(long liveGroupId,
60          java.lang.String name, java.lang.String description, int type,
61          java.lang.String friendlyURL, boolean active,
62          com.liferay.portal.service.ServiceContext serviceContext)
63          throws com.liferay.portal.PortalException,
64              com.liferay.portal.SystemException {
65          return getService()
66                     .addGroup(liveGroupId, name, description, type, friendlyURL,
67              active, serviceContext);
68      }
69  
70      public static void addRoleGroups(long roleId, long[] groupIds)
71          throws com.liferay.portal.PortalException,
72              com.liferay.portal.SystemException {
73          getService().addRoleGroups(roleId, groupIds);
74      }
75  
76      public static void deleteGroup(long groupId)
77          throws com.liferay.portal.PortalException,
78              com.liferay.portal.SystemException {
79          getService().deleteGroup(groupId);
80      }
81  
82      public static com.liferay.portal.model.Group getGroup(long groupId)
83          throws com.liferay.portal.PortalException,
84              com.liferay.portal.SystemException {
85          return getService().getGroup(groupId);
86      }
87  
88      public static com.liferay.portal.model.Group getGroup(long companyId,
89          java.lang.String name)
90          throws com.liferay.portal.PortalException,
91              com.liferay.portal.SystemException {
92          return getService().getGroup(companyId, name);
93      }
94  
95      public static java.util.List<com.liferay.portal.model.Group> getManageableGroups(
96          java.lang.String actionId, int max)
97          throws com.liferay.portal.PortalException,
98              com.liferay.portal.SystemException {
99          return getService().getManageableGroups(actionId, max);
100     }
101 
102     public static java.util.List<com.liferay.portal.model.Group> getOrganizationsGroups(
103         java.util.List<com.liferay.portal.model.Organization> organizations) {
104         return getService().getOrganizationsGroups(organizations);
105     }
106 
107     public static com.liferay.portal.model.Group getUserGroup(long companyId,
108         long userId)
109         throws com.liferay.portal.PortalException,
110             com.liferay.portal.SystemException {
111         return getService().getUserGroup(companyId, userId);
112     }
113 
114     public static java.util.List<com.liferay.portal.model.Group> getUserGroupsGroups(
115         java.util.List<com.liferay.portal.model.UserGroup> userGroups) {
116         return getService().getUserGroupsGroups(userGroups);
117     }
118 
119     public static java.util.List<com.liferay.portal.model.Group> getUserOrganizationsGroups(
120         long userId, int start, int end)
121         throws com.liferay.portal.PortalException,
122             com.liferay.portal.SystemException {
123         return getService().getUserOrganizationsGroups(userId, start, end);
124     }
125 
126     public static boolean hasUserGroup(long userId, long groupId)
127         throws com.liferay.portal.SystemException {
128         return getService().hasUserGroup(userId, groupId);
129     }
130 
131     public static java.util.List<com.liferay.portal.model.Group> search(
132         long companyId, java.lang.String name, java.lang.String description,
133         java.lang.String[] params, int start, int end)
134         throws com.liferay.portal.SystemException {
135         return getService()
136                    .search(companyId, name, description, params, start, end);
137     }
138 
139     public static int searchCount(long companyId, java.lang.String name,
140         java.lang.String description, java.lang.String[] params)
141         throws com.liferay.portal.SystemException {
142         return getService().searchCount(companyId, name, description, params);
143     }
144 
145     public static void setRoleGroups(long roleId, long[] groupIds)
146         throws com.liferay.portal.PortalException,
147             com.liferay.portal.SystemException {
148         getService().setRoleGroups(roleId, groupIds);
149     }
150 
151     public static void unsetRoleGroups(long roleId, long[] groupIds)
152         throws com.liferay.portal.PortalException,
153             com.liferay.portal.SystemException {
154         getService().unsetRoleGroups(roleId, groupIds);
155     }
156 
157     public static com.liferay.portal.model.Group updateFriendlyURL(
158         long groupId, java.lang.String friendlyURL)
159         throws com.liferay.portal.PortalException,
160             com.liferay.portal.SystemException {
161         return getService().updateFriendlyURL(groupId, friendlyURL);
162     }
163 
164     public static com.liferay.portal.model.Group updateGroup(long groupId,
165         java.lang.String name, java.lang.String description, int type,
166         java.lang.String friendlyURL, boolean active,
167         com.liferay.portal.service.ServiceContext serviceContext)
168         throws com.liferay.portal.PortalException,
169             com.liferay.portal.SystemException {
170         return getService()
171                    .updateGroup(groupId, name, description, type, friendlyURL,
172             active, serviceContext);
173     }
174 
175     public static com.liferay.portal.model.Group updateGroup(long groupId,
176         java.lang.String typeSettings)
177         throws com.liferay.portal.PortalException,
178             com.liferay.portal.SystemException {
179         return getService().updateGroup(groupId, typeSettings);
180     }
181 
182     public static com.liferay.portal.model.Group updateWorkflow(long groupId,
183         boolean workflowEnabled, int workflowStages,
184         java.lang.String workflowRoleNames)
185         throws com.liferay.portal.PortalException,
186             com.liferay.portal.SystemException {
187         return getService()
188                    .updateWorkflow(groupId, workflowEnabled, workflowStages,
189             workflowRoleNames);
190     }
191 
192     public static GroupService getService() {
193         if (_service == null) {
194             throw new RuntimeException("GroupService is not set");
195         }
196 
197         return _service;
198     }
199 
200     public void setService(GroupService service) {
201         _service = service;
202     }
203 
204     private static GroupService _service;
205 }