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