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