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         return getService().getUserGroupsGroups(userGroups);
109     }
110 
111     public static java.util.List<com.liferay.portal.model.Group> getUserOrganizationsGroups(
112         long userId, int start, int end)
113         throws com.liferay.portal.kernel.exception.PortalException,
114             com.liferay.portal.kernel.exception.SystemException {
115         return getService().getUserOrganizationsGroups(userId, start, end);
116     }
117 
118     public static boolean hasUserGroup(long userId, long groupId)
119         throws com.liferay.portal.kernel.exception.SystemException {
120         return getService().hasUserGroup(userId, groupId);
121     }
122 
123     public static java.util.List<com.liferay.portal.model.Group> search(
124         long companyId, java.lang.String name, java.lang.String description,
125         java.lang.String[] params, int start, int end)
126         throws com.liferay.portal.kernel.exception.SystemException {
127         return getService()
128                    .search(companyId, name, description, params, start, end);
129     }
130 
131     public static int searchCount(long companyId, java.lang.String name,
132         java.lang.String description, java.lang.String[] params)
133         throws com.liferay.portal.kernel.exception.SystemException {
134         return getService().searchCount(companyId, name, description, params);
135     }
136 
137     public static void setRoleGroups(long roleId, long[] groupIds)
138         throws com.liferay.portal.kernel.exception.PortalException,
139             com.liferay.portal.kernel.exception.SystemException {
140         getService().setRoleGroups(roleId, groupIds);
141     }
142 
143     public static void unsetRoleGroups(long roleId, long[] groupIds)
144         throws com.liferay.portal.kernel.exception.PortalException,
145             com.liferay.portal.kernel.exception.SystemException {
146         getService().unsetRoleGroups(roleId, groupIds);
147     }
148 
149     public static com.liferay.portal.model.Group updateFriendlyURL(
150         long groupId, java.lang.String friendlyURL)
151         throws com.liferay.portal.kernel.exception.PortalException,
152             com.liferay.portal.kernel.exception.SystemException {
153         return getService().updateFriendlyURL(groupId, friendlyURL);
154     }
155 
156     public static com.liferay.portal.model.Group updateGroup(long groupId,
157         java.lang.String name, java.lang.String description, int type,
158         java.lang.String friendlyURL, boolean active,
159         com.liferay.portal.service.ServiceContext serviceContext)
160         throws com.liferay.portal.kernel.exception.PortalException,
161             com.liferay.portal.kernel.exception.SystemException {
162         return getService()
163                    .updateGroup(groupId, name, description, type, friendlyURL,
164             active, serviceContext);
165     }
166 
167     public static com.liferay.portal.model.Group updateGroup(long groupId,
168         java.lang.String typeSettings)
169         throws com.liferay.portal.kernel.exception.PortalException,
170             com.liferay.portal.kernel.exception.SystemException {
171         return getService().updateGroup(groupId, typeSettings);
172     }
173 
174     public static com.liferay.portal.model.Group updateWorkflow(long groupId,
175         boolean workflowEnabled, int workflowStages,
176         java.lang.String workflowRoleNames)
177         throws com.liferay.portal.kernel.exception.PortalException,
178             com.liferay.portal.kernel.exception.SystemException {
179         return getService()
180                    .updateWorkflow(groupId, workflowEnabled, workflowStages,
181             workflowRoleNames);
182     }
183 
184     public static GroupService getService() {
185         if (_service == null) {
186             _service = (GroupService)PortalBeanLocatorUtil.locate(GroupService.class.getName());
187         }
188 
189         return _service;
190     }
191 
192     public void setService(GroupService service) {
193         _service = service;
194     }
195 
196     private static GroupService _service;
197 }