1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
26  
27  /**
28   * <a href="GroupServiceUtil.java.html"><b><i>View Source</i></b></a>
29   *
30   * <p>
31   * ServiceBuilder generated this class. Modifications in this class will be
32   * overwritten the next time is generated.
33   * </p>
34   *
35   * <p>
36   * This class provides static methods for the
37   * {@link GroupService} bean. The static methods of
38   * this class calls the same methods of the bean instance. It's convenient to be
39   * able to just write one line to call a method on a bean instead of writing a
40   * lookup call and a method call.
41   * </p>
42   *
43   * @author    Brian Wing Shun Chan
44   * @see       GroupService
45   * @generated
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             _service = (GroupService)PortalBeanLocatorUtil.locate(GroupService.class.getName());
195         }
196 
197         return _service;
198     }
199 
200     public void setService(GroupService service) {
201         _service = service;
202     }
203 
204     private static GroupService _service;
205 }