1   /**
2    * Copyright (c) 2000-2010 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   *
12   *
13   */
14  
15  package com.liferay.portal.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.util.MethodCache;
19  import com.liferay.portal.kernel.util.ReferenceRegistry;
20  
21  /**
22   * <a href="UserGroupLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
23   *
24   * <p>
25   * ServiceBuilder generated this class. Modifications in this class will be
26   * overwritten the next time is generated.
27   * </p>
28   *
29   * <p>
30   * This class provides static methods for the
31   * {@link UserGroupLocalService} bean. The static methods of
32   * this class calls the same methods of the bean instance. It's convenient to be
33   * able to just write one line to call a method on a bean instead of writing a
34   * lookup call and a method call.
35   * </p>
36   *
37   * @author    Brian Wing Shun Chan
38   * @see       UserGroupLocalService
39   * @generated
40   */
41  public class UserGroupLocalServiceUtil {
42      public static com.liferay.portal.model.UserGroup addUserGroup(
43          com.liferay.portal.model.UserGroup userGroup)
44          throws com.liferay.portal.SystemException {
45          return getService().addUserGroup(userGroup);
46      }
47  
48      public static com.liferay.portal.model.UserGroup createUserGroup(
49          long userGroupId) {
50          return getService().createUserGroup(userGroupId);
51      }
52  
53      public static void deleteUserGroup(long userGroupId)
54          throws com.liferay.portal.PortalException,
55              com.liferay.portal.SystemException {
56          getService().deleteUserGroup(userGroupId);
57      }
58  
59      public static void deleteUserGroup(
60          com.liferay.portal.model.UserGroup userGroup)
61          throws com.liferay.portal.SystemException {
62          getService().deleteUserGroup(userGroup);
63      }
64  
65      @SuppressWarnings("rawtypes")
66      public static java.util.List dynamicQuery(
67          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
68          throws com.liferay.portal.SystemException {
69          return getService().dynamicQuery(dynamicQuery);
70      }
71  
72      @SuppressWarnings("rawtypes")
73      public static java.util.List dynamicQuery(
74          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
75          int end) throws com.liferay.portal.SystemException {
76          return getService().dynamicQuery(dynamicQuery, start, end);
77      }
78  
79      @SuppressWarnings("rawtypes")
80      public static java.util.List dynamicQuery(
81          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
82          int end,
83          com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
84          throws com.liferay.portal.SystemException {
85          return getService()
86                     .dynamicQuery(dynamicQuery, start, end, orderByComparator);
87      }
88  
89      public static int dynamicQueryCount(
90          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
91          throws com.liferay.portal.SystemException {
92          return getService().dynamicQueryCount(dynamicQuery);
93      }
94  
95      public static com.liferay.portal.model.UserGroup getUserGroup(
96          long userGroupId)
97          throws com.liferay.portal.PortalException,
98              com.liferay.portal.SystemException {
99          return getService().getUserGroup(userGroupId);
100     }
101 
102     public static java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
103         int start, int end) throws com.liferay.portal.SystemException {
104         return getService().getUserGroups(start, end);
105     }
106 
107     public static int getUserGroupsCount()
108         throws com.liferay.portal.SystemException {
109         return getService().getUserGroupsCount();
110     }
111 
112     public static com.liferay.portal.model.UserGroup updateUserGroup(
113         com.liferay.portal.model.UserGroup userGroup)
114         throws com.liferay.portal.SystemException {
115         return getService().updateUserGroup(userGroup);
116     }
117 
118     public static com.liferay.portal.model.UserGroup updateUserGroup(
119         com.liferay.portal.model.UserGroup userGroup, boolean merge)
120         throws com.liferay.portal.SystemException {
121         return getService().updateUserGroup(userGroup, merge);
122     }
123 
124     public static void addGroupUserGroups(long groupId, long[] userGroupIds)
125         throws com.liferay.portal.SystemException {
126         getService().addGroupUserGroups(groupId, userGroupIds);
127     }
128 
129     public static com.liferay.portal.model.UserGroup addUserGroup(long userId,
130         long companyId, java.lang.String name, java.lang.String description)
131         throws com.liferay.portal.PortalException,
132             com.liferay.portal.SystemException {
133         return getService().addUserGroup(userId, companyId, name, description);
134     }
135 
136     public static void clearUserUserGroups(long userId)
137         throws com.liferay.portal.SystemException {
138         getService().clearUserUserGroups(userId);
139     }
140 
141     public static void copyUserGroupLayouts(long userGroupId, long[] userIds)
142         throws com.liferay.portal.PortalException,
143             com.liferay.portal.SystemException {
144         getService().copyUserGroupLayouts(userGroupId, userIds);
145     }
146 
147     public static void copyUserGroupLayouts(long[] userGroupIds, long userId)
148         throws com.liferay.portal.PortalException,
149             com.liferay.portal.SystemException {
150         getService().copyUserGroupLayouts(userGroupIds, userId);
151     }
152 
153     public static void copyUserGroupLayouts(long userGroupId, long userId)
154         throws com.liferay.portal.PortalException,
155             com.liferay.portal.SystemException {
156         getService().copyUserGroupLayouts(userGroupId, userId);
157     }
158 
159     public static com.liferay.portal.model.UserGroup getUserGroup(
160         long companyId, java.lang.String name)
161         throws com.liferay.portal.PortalException,
162             com.liferay.portal.SystemException {
163         return getService().getUserGroup(companyId, name);
164     }
165 
166     public static java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
167         long companyId) throws com.liferay.portal.SystemException {
168         return getService().getUserGroups(companyId);
169     }
170 
171     public static java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
172         long[] userGroupIds)
173         throws com.liferay.portal.PortalException,
174             com.liferay.portal.SystemException {
175         return getService().getUserGroups(userGroupIds);
176     }
177 
178     public static java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
179         long userId) throws com.liferay.portal.SystemException {
180         return getService().getUserUserGroups(userId);
181     }
182 
183     public static boolean hasGroupUserGroup(long groupId, long userGroupId)
184         throws com.liferay.portal.SystemException {
185         return getService().hasGroupUserGroup(groupId, userGroupId);
186     }
187 
188     public static java.util.List<com.liferay.portal.model.UserGroup> search(
189         long companyId, java.lang.String name, java.lang.String description,
190         java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
191         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
192         throws com.liferay.portal.SystemException {
193         return getService()
194                    .search(companyId, name, description, params, start, end, obc);
195     }
196 
197     public static int searchCount(long companyId, java.lang.String name,
198         java.lang.String description,
199         java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
200         throws com.liferay.portal.SystemException {
201         return getService().searchCount(companyId, name, description, params);
202     }
203 
204     public static void setUserUserGroups(long userId, long[] userGroupIds)
205         throws com.liferay.portal.PortalException,
206             com.liferay.portal.SystemException {
207         getService().setUserUserGroups(userId, userGroupIds);
208     }
209 
210     public static void unsetGroupUserGroups(long groupId, long[] userGroupIds)
211         throws com.liferay.portal.SystemException {
212         getService().unsetGroupUserGroups(groupId, userGroupIds);
213     }
214 
215     public static com.liferay.portal.model.UserGroup updateUserGroup(
216         long companyId, long userGroupId, java.lang.String name,
217         java.lang.String description)
218         throws com.liferay.portal.PortalException,
219             com.liferay.portal.SystemException {
220         return getService()
221                    .updateUserGroup(companyId, userGroupId, name, description);
222     }
223 
224     public static UserGroupLocalService getService() {
225         if (_service == null) {
226             _service = (UserGroupLocalService)PortalBeanLocatorUtil.locate(UserGroupLocalService.class.getName());
227 
228             ReferenceRegistry.registerReference(UserGroupLocalServiceUtil.class,
229                 "_service");
230             MethodCache.remove(UserGroupLocalService.class);
231         }
232 
233         return _service;
234     }
235 
236     public void setService(UserGroupLocalService service) {
237         MethodCache.remove(UserGroupLocalService.class);
238 
239         _service = service;
240 
241         ReferenceRegistry.registerReference(UserGroupLocalServiceUtil.class,
242             "_service");
243         MethodCache.remove(UserGroupLocalService.class);
244     }
245 
246     private static UserGroupLocalService _service;
247 }