1   /**
2    * Copyright (c) 2000-2008 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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
89          return getService().getGroup(companyId, name);
90      }
91  
92      public static java.util.List<com.liferay.portal.model.Group> getOrganizationsGroups(
93          java.util.List<com.liferay.portal.model.Organization> organizations)
94          throws java.rmi.RemoteException {
95          return getService().getOrganizationsGroups(organizations);
96      }
97  
98      public static java.util.List<com.liferay.portal.model.Group> getUserGroupsGroups(
99          java.util.List<com.liferay.portal.model.UserGroup> userGroups)
100         throws java.rmi.RemoteException {
101         return getService().getUserGroupsGroups(userGroups);
102     }
103 
104     public static boolean hasUserGroup(long userId, long groupId)
105         throws com.liferay.portal.SystemException, java.rmi.RemoteException {
106         return getService().hasUserGroup(userId, groupId);
107     }
108 
109     public static java.util.List<com.liferay.portal.model.Group> search(
110         long companyId, java.lang.String name, java.lang.String description,
111         java.lang.String[] params, int start, int end)
112         throws com.liferay.portal.SystemException, java.rmi.RemoteException {
113         return getService()
114                    .search(companyId, name, description, params, start, end);
115     }
116 
117     public static int searchCount(long companyId, java.lang.String name,
118         java.lang.String description, java.lang.String[] params)
119         throws com.liferay.portal.SystemException, java.rmi.RemoteException {
120         return getService().searchCount(companyId, name, description, params);
121     }
122 
123     public static void setRoleGroups(long roleId, long[] groupIds)
124         throws com.liferay.portal.PortalException,
125             com.liferay.portal.SystemException, java.rmi.RemoteException {
126         getService().setRoleGroups(roleId, groupIds);
127     }
128 
129     public static void unsetRoleGroups(long roleId, long[] groupIds)
130         throws com.liferay.portal.PortalException,
131             com.liferay.portal.SystemException, java.rmi.RemoteException {
132         getService().unsetRoleGroups(roleId, groupIds);
133     }
134 
135     public static com.liferay.portal.model.Group updateFriendlyURL(
136         long groupId, java.lang.String friendlyURL)
137         throws com.liferay.portal.PortalException,
138             com.liferay.portal.SystemException, java.rmi.RemoteException {
139         return getService().updateFriendlyURL(groupId, friendlyURL);
140     }
141 
142     public static com.liferay.portal.model.Group updateGroup(long groupId,
143         java.lang.String name, java.lang.String description, int type,
144         java.lang.String friendlyURL, boolean active)
145         throws com.liferay.portal.PortalException,
146             com.liferay.portal.SystemException, java.rmi.RemoteException {
147         return getService()
148                    .updateGroup(groupId, name, description, type, friendlyURL,
149             active);
150     }
151 
152     public static com.liferay.portal.model.Group updateGroup(long groupId,
153         java.lang.String typeSettings)
154         throws com.liferay.portal.PortalException,
155             com.liferay.portal.SystemException, java.rmi.RemoteException {
156         return getService().updateGroup(groupId, typeSettings);
157     }
158 
159     public static com.liferay.portal.model.Group updateWorkflow(long groupId,
160         boolean workflowEnabled, int workflowStages,
161         java.lang.String workflowRoleNames)
162         throws com.liferay.portal.PortalException,
163             com.liferay.portal.SystemException, java.rmi.RemoteException {
164         return getService()
165                    .updateWorkflow(groupId, workflowEnabled, workflowStages,
166             workflowRoleNames);
167     }
168 
169     public static GroupService getService() {
170         if (_service == null) {
171             throw new RuntimeException("GroupService is not set");
172         }
173 
174         return _service;
175     }
176 
177     public void setService(GroupService service) {
178         _service = service;
179     }
180 
181     private static GroupService _service;
182 }