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