1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service;
21  
22  
23  /**
24   * <a href="GroupServiceUtil.java.html"><b><i>View Source</i></b></a>
25   *
26   * <p>
27   * ServiceBuilder generated this class. Modifications in this class will be
28   * overwritten the next time is generated.
29   * </p>
30   *
31   * <p>
32   * This class provides static methods for the
33   * <code>com.liferay.portal.service.GroupService</code>
34   * bean. The static methods of this class calls the same methods of the bean
35   * instance. It's convenient to be able to just write one line to call a method
36   * on a bean instead of writing a lookup call and a method call.
37   * </p>
38   *
39   * @author Brian Wing Shun Chan
40   *
41   * @see com.liferay.portal.service.GroupService
42   *
43   */
44  public class GroupServiceUtil {
45      public static com.liferay.portal.model.Group addGroup(
46          java.lang.String name, java.lang.String description, int type,
47          java.lang.String friendlyURL, boolean active)
48          throws com.liferay.portal.PortalException,
49              com.liferay.portal.SystemException, java.rmi.RemoteException {
50          return getService()
51                     .addGroup(name, description, type, friendlyURL, active);
52      }
53  
54      public static com.liferay.portal.model.Group addGroup(long liveGroupId,
55          java.lang.String name, java.lang.String description, int type,
56          java.lang.String friendlyURL, boolean active)
57          throws com.liferay.portal.PortalException,
58              com.liferay.portal.SystemException, java.rmi.RemoteException {
59          return getService()
60                     .addGroup(liveGroupId, name, description, type, friendlyURL,
61              active);
62      }
63  
64      public static void addRoleGroups(long roleId, long[] groupIds)
65          throws com.liferay.portal.PortalException,
66              com.liferay.portal.SystemException, java.rmi.RemoteException {
67          getService().addRoleGroups(roleId, groupIds);
68      }
69  
70      public static void deleteGroup(long groupId)
71          throws com.liferay.portal.PortalException,
72              com.liferay.portal.SystemException, java.rmi.RemoteException {
73          getService().deleteGroup(groupId);
74      }
75  
76      public static com.liferay.portal.model.Group getGroup(long groupId)
77          throws com.liferay.portal.PortalException,
78              com.liferay.portal.SystemException, java.rmi.RemoteException {
79          return getService().getGroup(groupId);
80      }
81  
82      public static com.liferay.portal.model.Group getGroup(long companyId,
83          java.lang.String name)
84          throws com.liferay.portal.PortalException,
85              com.liferay.portal.SystemException, java.rmi.RemoteException {
86          return getService().getGroup(companyId, name);
87      }
88  
89      public static java.util.List<com.liferay.portal.model.Group> getOrganizationsGroups(
90          java.util.List<com.liferay.portal.model.Organization> organizations)
91          throws java.rmi.RemoteException {
92          return getService().getOrganizationsGroups(organizations);
93      }
94  
95      public static java.util.List<com.liferay.portal.model.Group> getUserGroupsGroups(
96          java.util.List<com.liferay.portal.model.UserGroup> userGroups)
97          throws java.rmi.RemoteException {
98          return getService().getUserGroupsGroups(userGroups);
99      }
100 
101     public static boolean hasUserGroup(long userId, long groupId)
102         throws com.liferay.portal.SystemException, java.rmi.RemoteException {
103         return getService().hasUserGroup(userId, groupId);
104     }
105 
106     public static java.util.List<com.liferay.portal.model.Group> search(
107         long companyId, java.lang.String name, java.lang.String description,
108         java.lang.String[] params, int start, int end)
109         throws com.liferay.portal.SystemException, java.rmi.RemoteException {
110         return getService()
111                    .search(companyId, name, description, params, start, end);
112     }
113 
114     public static int searchCount(long companyId, java.lang.String name,
115         java.lang.String description, java.lang.String[] params)
116         throws com.liferay.portal.SystemException, java.rmi.RemoteException {
117         return getService().searchCount(companyId, name, description, params);
118     }
119 
120     public static void setRoleGroups(long roleId, long[] groupIds)
121         throws com.liferay.portal.PortalException,
122             com.liferay.portal.SystemException, java.rmi.RemoteException {
123         getService().setRoleGroups(roleId, groupIds);
124     }
125 
126     public static void unsetRoleGroups(long roleId, long[] groupIds)
127         throws com.liferay.portal.PortalException,
128             com.liferay.portal.SystemException, java.rmi.RemoteException {
129         getService().unsetRoleGroups(roleId, groupIds);
130     }
131 
132     public static com.liferay.portal.model.Group updateFriendlyURL(
133         long groupId, java.lang.String friendlyURL)
134         throws com.liferay.portal.PortalException,
135             com.liferay.portal.SystemException, java.rmi.RemoteException {
136         return getService().updateFriendlyURL(groupId, friendlyURL);
137     }
138 
139     public static com.liferay.portal.model.Group updateGroup(long groupId,
140         java.lang.String name, java.lang.String description, int type,
141         java.lang.String friendlyURL, boolean active)
142         throws com.liferay.portal.PortalException,
143             com.liferay.portal.SystemException, java.rmi.RemoteException {
144         return getService()
145                    .updateGroup(groupId, name, description, type, friendlyURL,
146             active);
147     }
148 
149     public static com.liferay.portal.model.Group updateGroup(long groupId,
150         java.lang.String typeSettings)
151         throws com.liferay.portal.PortalException,
152             com.liferay.portal.SystemException, java.rmi.RemoteException {
153         return getService().updateGroup(groupId, typeSettings);
154     }
155 
156     public static com.liferay.portal.model.Group updateWorkflow(long groupId,
157         boolean workflowEnabled, int workflowStages,
158         java.lang.String workflowRoleNames)
159         throws com.liferay.portal.PortalException,
160             com.liferay.portal.SystemException, java.rmi.RemoteException {
161         return getService()
162                    .updateWorkflow(groupId, workflowEnabled, workflowStages,
163             workflowRoleNames);
164     }
165 
166     public static GroupService getService() {
167         if (_service == null) {
168             throw new RuntimeException("GroupService is not set");
169         }
170 
171         return _service;
172     }
173 
174     public void setService(GroupService service) {
175         _service = service;
176     }
177 
178     private static GroupService _service;
179 }