1   /**
2    * Copyright (c) 2000-2007 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   * <a href="GroupServiceUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be overwritten
30   * the next time is generated.
31   * </p>
32   *
33   * <p>
34   * This class provides static methods for the <code>com.liferay.portal.service.GroupService</code>
35   * bean. The static methods of this class calls the same methods of the bean instance.
36   * It's convenient to be able to just write one line to call a method on a bean
37   * instead of writing a lookup call and a method call.
38   * </p>
39   *
40   * <p>
41   * <code>com.liferay.portal.service.GroupServiceFactory</code> is responsible for
42   * the lookup of the bean.
43   * </p>
44   *
45   * @author Brian Wing Shun Chan
46   *
47   * @see com.liferay.portal.service.GroupService
48   * @see com.liferay.portal.service.GroupServiceFactory
49   *
50   */
51  public class GroupServiceUtil {
52      public static com.liferay.portal.model.Group addGroup(
53          java.lang.String name, java.lang.String description,
54          java.lang.String type, java.lang.String friendlyURL, boolean active)
55          throws com.liferay.portal.PortalException, 
56              com.liferay.portal.SystemException, java.rmi.RemoteException {
57          GroupService groupService = GroupServiceFactory.getService();
58  
59          return groupService.addGroup(name, description, type, friendlyURL,
60              active);
61      }
62  
63      public static com.liferay.portal.model.Group addGroup(long liveGroupId,
64          java.lang.String name, java.lang.String description,
65          java.lang.String type, java.lang.String friendlyURL, boolean active)
66          throws com.liferay.portal.PortalException, 
67              com.liferay.portal.SystemException, java.rmi.RemoteException {
68          GroupService groupService = GroupServiceFactory.getService();
69  
70          return groupService.addGroup(liveGroupId, name, description, type,
71              friendlyURL, active);
72      }
73  
74      public static void addRoleGroups(long roleId, long[] groupIds)
75          throws com.liferay.portal.PortalException, 
76              com.liferay.portal.SystemException, java.rmi.RemoteException {
77          GroupService groupService = GroupServiceFactory.getService();
78          groupService.addRoleGroups(roleId, groupIds);
79      }
80  
81      public static void deleteGroup(long groupId)
82          throws com.liferay.portal.PortalException, 
83              com.liferay.portal.SystemException, java.rmi.RemoteException {
84          GroupService groupService = GroupServiceFactory.getService();
85          groupService.deleteGroup(groupId);
86      }
87  
88      public static com.liferay.portal.model.Group getGroup(long groupId)
89          throws com.liferay.portal.PortalException, 
90              com.liferay.portal.SystemException, java.rmi.RemoteException {
91          GroupService groupService = GroupServiceFactory.getService();
92  
93          return groupService.getGroup(groupId);
94      }
95  
96      public static com.liferay.portal.model.Group getGroup(long companyId,
97          java.lang.String name)
98          throws com.liferay.portal.PortalException, 
99              com.liferay.portal.SystemException, java.rmi.RemoteException {
100         GroupService groupService = GroupServiceFactory.getService();
101 
102         return groupService.getGroup(companyId, name);
103     }
104 
105     public static java.util.List getOrganizationsGroups(
106         java.util.List organizations)
107         throws com.liferay.portal.PortalException, 
108             com.liferay.portal.SystemException, java.rmi.RemoteException {
109         GroupService groupService = GroupServiceFactory.getService();
110 
111         return groupService.getOrganizationsGroups(organizations);
112     }
113 
114     public static java.util.List getUserGroupsGroups(java.util.List userGroups)
115         throws com.liferay.portal.PortalException, 
116             com.liferay.portal.SystemException, java.rmi.RemoteException {
117         GroupService groupService = GroupServiceFactory.getService();
118 
119         return groupService.getUserGroupsGroups(userGroups);
120     }
121 
122     public static boolean hasUserGroup(long userId, long groupId)
123         throws com.liferay.portal.SystemException, java.rmi.RemoteException {
124         GroupService groupService = GroupServiceFactory.getService();
125 
126         return groupService.hasUserGroup(userId, groupId);
127     }
128 
129     public static java.util.List search(long companyId, java.lang.String name,
130         java.lang.String description, java.lang.String[] params, int begin,
131         int end)
132         throws com.liferay.portal.SystemException, java.rmi.RemoteException {
133         GroupService groupService = GroupServiceFactory.getService();
134 
135         return groupService.search(companyId, name, description, params, begin,
136             end);
137     }
138 
139     public static int searchCount(long companyId, java.lang.String name,
140         java.lang.String description, java.lang.String[] params)
141         throws com.liferay.portal.SystemException, java.rmi.RemoteException {
142         GroupService groupService = GroupServiceFactory.getService();
143 
144         return groupService.searchCount(companyId, name, description, params);
145     }
146 
147     public static void setRoleGroups(long roleId, long[] groupIds)
148         throws com.liferay.portal.PortalException, 
149             com.liferay.portal.SystemException, java.rmi.RemoteException {
150         GroupService groupService = GroupServiceFactory.getService();
151         groupService.setRoleGroups(roleId, groupIds);
152     }
153 
154     public static void unsetRoleGroups(long roleId, long[] groupIds)
155         throws com.liferay.portal.PortalException, 
156             com.liferay.portal.SystemException, java.rmi.RemoteException {
157         GroupService groupService = GroupServiceFactory.getService();
158         groupService.unsetRoleGroups(roleId, groupIds);
159     }
160 
161     public static com.liferay.portal.model.Group updateGroup(long groupId,
162         java.lang.String name, java.lang.String description,
163         java.lang.String type, java.lang.String friendlyURL, boolean active)
164         throws com.liferay.portal.PortalException, 
165             com.liferay.portal.SystemException, java.rmi.RemoteException {
166         GroupService groupService = GroupServiceFactory.getService();
167 
168         return groupService.updateGroup(groupId, name, description, type,
169             friendlyURL, active);
170     }
171 
172     public static com.liferay.portal.model.Group updateGroup(long groupId,
173         java.lang.String typeSettings)
174         throws com.liferay.portal.PortalException, 
175             com.liferay.portal.SystemException, java.rmi.RemoteException {
176         GroupService groupService = GroupServiceFactory.getService();
177 
178         return groupService.updateGroup(groupId, typeSettings);
179     }
180 }