1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  
19  /**
20   * <a href="GroupServiceUtil.java.html"><b><i>View Source</i></b></a>
21   *
22   * <p>
23   * ServiceBuilder generated this class. Modifications in this class will be
24   * overwritten the next time is generated.
25   * </p>
26   *
27   * <p>
28   * This class provides static methods for the
29   * {@link GroupService} bean. The static methods of
30   * this class calls the same methods of the bean instance. It's convenient to be
31   * able to just write one line to call a method on a bean instead of writing a
32   * lookup call and a method call.
33   * </p>
34   *
35   * @author    Brian Wing Shun Chan
36   * @see       GroupService
37   * @generated
38   */
39  public class GroupServiceUtil {
40      public static com.liferay.portal.model.Group addGroup(
41          java.lang.String name, java.lang.String description, int type,
42          java.lang.String friendlyURL, boolean active,
43          com.liferay.portal.service.ServiceContext serviceContext)
44          throws com.liferay.portal.kernel.exception.PortalException,
45              com.liferay.portal.kernel.exception.SystemException {
46          return getService()
47                     .addGroup(name, description, type, friendlyURL, active,
48              serviceContext);
49      }
50  
51      public static com.liferay.portal.model.Group addGroup(long liveGroupId,
52          java.lang.String name, java.lang.String description, int type,
53          java.lang.String friendlyURL, boolean active,
54          com.liferay.portal.service.ServiceContext serviceContext)
55          throws com.liferay.portal.kernel.exception.PortalException,
56              com.liferay.portal.kernel.exception.SystemException {
57          return getService()
58                     .addGroup(liveGroupId, name, description, type, friendlyURL,
59              active, serviceContext);
60      }
61  
62      public static void addRoleGroups(long roleId, long[] groupIds)
63          throws com.liferay.portal.kernel.exception.PortalException,
64              com.liferay.portal.kernel.exception.SystemException {
65          getService().addRoleGroups(roleId, groupIds);
66      }
67  
68      public static void deleteGroup(long groupId)
69          throws com.liferay.portal.kernel.exception.PortalException,
70              com.liferay.portal.kernel.exception.SystemException {
71          getService().deleteGroup(groupId);
72      }
73  
74      public static com.liferay.portal.model.Group getGroup(long groupId)
75          throws com.liferay.portal.kernel.exception.PortalException,
76              com.liferay.portal.kernel.exception.SystemException {
77          return getService().getGroup(groupId);
78      }
79  
80      public static com.liferay.portal.model.Group getGroup(long companyId,
81          java.lang.String name)
82          throws com.liferay.portal.kernel.exception.PortalException,
83              com.liferay.portal.kernel.exception.SystemException {
84          return getService().getGroup(companyId, name);
85      }
86  
87      public static java.util.List<com.liferay.portal.model.Group> getManageableGroups(
88          java.lang.String actionId, int max)
89          throws com.liferay.portal.kernel.exception.PortalException,
90              com.liferay.portal.kernel.exception.SystemException {
91          return getService().getManageableGroups(actionId, max);
92      }
93  
94      public static java.util.List<com.liferay.portal.model.Group> getOrganizationsGroups(
95          java.util.List<com.liferay.portal.model.Organization> organizations) {
96          return getService().getOrganizationsGroups(organizations);
97      }
98  
99      public static com.liferay.portal.model.Group getUserGroup(long companyId,
100         long userId)
101         throws com.liferay.portal.kernel.exception.PortalException,
102             com.liferay.portal.kernel.exception.SystemException {
103         return getService().getUserGroup(companyId, userId);
104     }
105 
106     public static java.util.List<com.liferay.portal.model.Group> getUserGroupsGroups(
107         java.util.List<com.liferay.portal.model.UserGroup> userGroups)
108         throws com.liferay.portal.kernel.exception.PortalException,
109             com.liferay.portal.kernel.exception.SystemException {
110         return getService().getUserGroupsGroups(userGroups);
111     }
112 
113     public static java.util.List<com.liferay.portal.model.Group> getUserOrganizationsGroups(
114         long userId, int start, int end)
115         throws com.liferay.portal.kernel.exception.PortalException,
116             com.liferay.portal.kernel.exception.SystemException {
117         return getService().getUserOrganizationsGroups(userId, start, end);
118     }
119 
120     public static boolean hasUserGroup(long userId, long groupId)
121         throws com.liferay.portal.kernel.exception.SystemException {
122         return getService().hasUserGroup(userId, groupId);
123     }
124 
125     public static java.util.List<com.liferay.portal.model.Group> search(
126         long companyId, java.lang.String name, java.lang.String description,
127         java.lang.String[] params, int start, int end)
128         throws com.liferay.portal.kernel.exception.SystemException {
129         return getService()
130                    .search(companyId, name, description, params, start, end);
131     }
132 
133     public static int searchCount(long companyId, java.lang.String name,
134         java.lang.String description, java.lang.String[] params)
135         throws com.liferay.portal.kernel.exception.SystemException {
136         return getService().searchCount(companyId, name, description, params);
137     }
138 
139     public static void setRoleGroups(long roleId, long[] groupIds)
140         throws com.liferay.portal.kernel.exception.PortalException,
141             com.liferay.portal.kernel.exception.SystemException {
142         getService().setRoleGroups(roleId, groupIds);
143     }
144 
145     public static void unsetRoleGroups(long roleId, long[] groupIds)
146         throws com.liferay.portal.kernel.exception.PortalException,
147             com.liferay.portal.kernel.exception.SystemException {
148         getService().unsetRoleGroups(roleId, groupIds);
149     }
150 
151     public static com.liferay.portal.model.Group updateFriendlyURL(
152         long groupId, java.lang.String friendlyURL)
153         throws com.liferay.portal.kernel.exception.PortalException,
154             com.liferay.portal.kernel.exception.SystemException {
155         return getService().updateFriendlyURL(groupId, friendlyURL);
156     }
157 
158     public static com.liferay.portal.model.Group updateGroup(long groupId,
159         java.lang.String name, java.lang.String description, int type,
160         java.lang.String friendlyURL, boolean active,
161         com.liferay.portal.service.ServiceContext serviceContext)
162         throws com.liferay.portal.kernel.exception.PortalException,
163             com.liferay.portal.kernel.exception.SystemException {
164         return getService()
165                    .updateGroup(groupId, name, description, type, friendlyURL,
166             active, serviceContext);
167     }
168 
169     public static com.liferay.portal.model.Group updateGroup(long groupId,
170         java.lang.String typeSettings)
171         throws com.liferay.portal.kernel.exception.PortalException,
172             com.liferay.portal.kernel.exception.SystemException {
173         return getService().updateGroup(groupId, typeSettings);
174     }
175 
176     public static com.liferay.portal.model.Group updateWorkflow(long groupId,
177         boolean workflowEnabled, int workflowStages,
178         java.lang.String workflowRoleNames)
179         throws com.liferay.portal.kernel.exception.PortalException,
180             com.liferay.portal.kernel.exception.SystemException {
181         return getService()
182                    .updateWorkflow(groupId, workflowEnabled, workflowStages,
183             workflowRoleNames);
184     }
185 
186     public static GroupService getService() {
187         if (_service == null) {
188             _service = (GroupService)PortalBeanLocatorUtil.locate(GroupService.class.getName());
189         }
190 
191         return _service;
192     }
193 
194     public void setService(GroupService service) {
195         _service = service;
196     }
197 
198     private static GroupService _service;
199 }