1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  
19  /**
20   * <a href="RoleLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
21   *
22   * <p>
23   * ServiceBuilder generated this class. Modifications in this class will be
24   * overwritten the next time is generated.
25   * </p>
26   *
27   * <p>
28   * This class provides static methods for the
29   * {@link RoleLocalService} bean. The static methods of
30   * this class calls the same methods of the bean instance. It's convenient to be
31   * able to just write one line to call a method on a bean instead of writing a
32   * lookup call and a method call.
33   * </p>
34   *
35   * @author    Brian Wing Shun Chan
36   * @see       RoleLocalService
37   * @generated
38   */
39  public class RoleLocalServiceUtil {
40      public static com.liferay.portal.model.Role addRole(
41          com.liferay.portal.model.Role role)
42          throws com.liferay.portal.kernel.exception.SystemException {
43          return getService().addRole(role);
44      }
45  
46      public static com.liferay.portal.model.Role createRole(long roleId) {
47          return getService().createRole(roleId);
48      }
49  
50      public static void deleteRole(long roleId)
51          throws com.liferay.portal.kernel.exception.PortalException,
52              com.liferay.portal.kernel.exception.SystemException {
53          getService().deleteRole(roleId);
54      }
55  
56      public static void deleteRole(com.liferay.portal.model.Role role)
57          throws com.liferay.portal.kernel.exception.SystemException {
58          getService().deleteRole(role);
59      }
60  
61      public static java.util.List<Object> dynamicQuery(
62          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
63          throws com.liferay.portal.kernel.exception.SystemException {
64          return getService().dynamicQuery(dynamicQuery);
65      }
66  
67      public static java.util.List<Object> dynamicQuery(
68          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
69          int end) throws com.liferay.portal.kernel.exception.SystemException {
70          return getService().dynamicQuery(dynamicQuery, start, end);
71      }
72  
73      public static java.util.List<Object> dynamicQuery(
74          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
75          int end,
76          com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
77          throws com.liferay.portal.kernel.exception.SystemException {
78          return getService()
79                     .dynamicQuery(dynamicQuery, start, end, orderByComparator);
80      }
81  
82      public static int dynamicQueryCount(
83          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
84          throws com.liferay.portal.kernel.exception.SystemException {
85          return getService().dynamicQueryCount(dynamicQuery);
86      }
87  
88      public static com.liferay.portal.model.Role getRole(long roleId)
89          throws com.liferay.portal.kernel.exception.PortalException,
90              com.liferay.portal.kernel.exception.SystemException {
91          return getService().getRole(roleId);
92      }
93  
94      public static java.util.List<com.liferay.portal.model.Role> getRoles(
95          int start, int end)
96          throws com.liferay.portal.kernel.exception.SystemException {
97          return getService().getRoles(start, end);
98      }
99  
100     public static int getRolesCount()
101         throws com.liferay.portal.kernel.exception.SystemException {
102         return getService().getRolesCount();
103     }
104 
105     public static com.liferay.portal.model.Role updateRole(
106         com.liferay.portal.model.Role role)
107         throws com.liferay.portal.kernel.exception.SystemException {
108         return getService().updateRole(role);
109     }
110 
111     public static com.liferay.portal.model.Role updateRole(
112         com.liferay.portal.model.Role role, boolean merge)
113         throws com.liferay.portal.kernel.exception.SystemException {
114         return getService().updateRole(role, merge);
115     }
116 
117     public static com.liferay.portal.model.Role addRole(long userId,
118         long companyId, java.lang.String name,
119         java.util.Map<java.util.Locale, String> titleMap,
120         java.lang.String description, int type)
121         throws com.liferay.portal.kernel.exception.PortalException,
122             com.liferay.portal.kernel.exception.SystemException {
123         return getService()
124                    .addRole(userId, companyId, name, titleMap, description, type);
125     }
126 
127     public static com.liferay.portal.model.Role addRole(long userId,
128         long companyId, java.lang.String name,
129         java.util.Map<java.util.Locale, String> titleMap,
130         java.lang.String description, int type, java.lang.String className,
131         long classPK)
132         throws com.liferay.portal.kernel.exception.PortalException,
133             com.liferay.portal.kernel.exception.SystemException {
134         return getService()
135                    .addRole(userId, companyId, name, titleMap, description,
136             type, className, classPK);
137     }
138 
139     public static void addUserRoles(long userId, long[] roleIds)
140         throws com.liferay.portal.kernel.exception.PortalException,
141             com.liferay.portal.kernel.exception.SystemException {
142         getService().addUserRoles(userId, roleIds);
143     }
144 
145     public static void checkSystemRoles(long companyId)
146         throws com.liferay.portal.kernel.exception.PortalException,
147             com.liferay.portal.kernel.exception.SystemException {
148         getService().checkSystemRoles(companyId);
149     }
150 
151     public static com.liferay.portal.model.Role getDefaultGroupRole(
152         long groupId)
153         throws com.liferay.portal.kernel.exception.PortalException,
154             com.liferay.portal.kernel.exception.SystemException {
155         return getService().getDefaultGroupRole(groupId);
156     }
157 
158     public static java.util.List<com.liferay.portal.model.Role> getGroupRoles(
159         long groupId)
160         throws com.liferay.portal.kernel.exception.SystemException {
161         return getService().getGroupRoles(groupId);
162     }
163 
164     public static java.util.Map<String, java.util.List<String>> getResourceRoles(
165         long companyId, java.lang.String name, int scope,
166         java.lang.String primKey)
167         throws com.liferay.portal.kernel.exception.SystemException {
168         return getService().getResourceRoles(companyId, name, scope, primKey);
169     }
170 
171     public static com.liferay.portal.model.Role getRole(long companyId,
172         java.lang.String name)
173         throws com.liferay.portal.kernel.exception.PortalException,
174             com.liferay.portal.kernel.exception.SystemException {
175         return getService().getRole(companyId, name);
176     }
177 
178     public static java.util.List<com.liferay.portal.model.Role> getRoles(
179         long companyId)
180         throws com.liferay.portal.kernel.exception.SystemException {
181         return getService().getRoles(companyId);
182     }
183 
184     public static java.util.List<com.liferay.portal.model.Role> getRoles(
185         long[] roleIds)
186         throws com.liferay.portal.kernel.exception.PortalException,
187             com.liferay.portal.kernel.exception.SystemException {
188         return getService().getRoles(roleIds);
189     }
190 
191     public static java.util.List<com.liferay.portal.model.Role> getRoles(
192         int type, java.lang.String subtype)
193         throws com.liferay.portal.kernel.exception.SystemException {
194         return getService().getRoles(type, subtype);
195     }
196 
197     public static java.util.List<com.liferay.portal.model.Role> getSubtypeRoles(
198         java.lang.String subtype)
199         throws com.liferay.portal.kernel.exception.SystemException {
200         return getService().getSubtypeRoles(subtype);
201     }
202 
203     public static int getSubtypeRolesCount(java.lang.String subtype)
204         throws com.liferay.portal.kernel.exception.SystemException {
205         return getService().getSubtypeRolesCount(subtype);
206     }
207 
208     public static com.liferay.portal.model.Role getTeamRole(long companyId,
209         long teamId)
210         throws com.liferay.portal.kernel.exception.PortalException,
211             com.liferay.portal.kernel.exception.SystemException {
212         return getService().getTeamRole(companyId, teamId);
213     }
214 
215     public static java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
216         long userId, long groupId)
217         throws com.liferay.portal.kernel.exception.SystemException {
218         return getService().getUserGroupGroupRoles(userId, groupId);
219     }
220 
221     public static java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
222         long userId, long groupId)
223         throws com.liferay.portal.kernel.exception.SystemException {
224         return getService().getUserGroupRoles(userId, groupId);
225     }
226 
227     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
228         long userId, long groupId)
229         throws com.liferay.portal.kernel.exception.SystemException {
230         return getService().getUserRelatedRoles(userId, groupId);
231     }
232 
233     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
234         long userId, long[] groupIds)
235         throws com.liferay.portal.kernel.exception.SystemException {
236         return getService().getUserRelatedRoles(userId, groupIds);
237     }
238 
239     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
240         long userId, java.util.List<com.liferay.portal.model.Group> groups)
241         throws com.liferay.portal.kernel.exception.SystemException {
242         return getService().getUserRelatedRoles(userId, groups);
243     }
244 
245     public static java.util.List<com.liferay.portal.model.Role> getUserRoles(
246         long userId) throws com.liferay.portal.kernel.exception.SystemException {
247         return getService().getUserRoles(userId);
248     }
249 
250     public static boolean hasUserRole(long userId, long roleId)
251         throws com.liferay.portal.kernel.exception.SystemException {
252         return getService().hasUserRole(userId, roleId);
253     }
254 
255     public static boolean hasUserRole(long userId, long companyId,
256         java.lang.String name, boolean inherited)
257         throws com.liferay.portal.kernel.exception.PortalException,
258             com.liferay.portal.kernel.exception.SystemException {
259         return getService().hasUserRole(userId, companyId, name, inherited);
260     }
261 
262     public static boolean hasUserRoles(long userId, long companyId,
263         java.lang.String[] names, boolean inherited)
264         throws com.liferay.portal.kernel.exception.PortalException,
265             com.liferay.portal.kernel.exception.SystemException {
266         return getService().hasUserRoles(userId, companyId, names, inherited);
267     }
268 
269     public static java.util.List<com.liferay.portal.model.Role> search(
270         long companyId, java.lang.String name, java.lang.String description,
271         java.lang.Integer[] types, int start, int end,
272         com.liferay.portal.kernel.util.OrderByComparator obc)
273         throws com.liferay.portal.kernel.exception.SystemException {
274         return getService()
275                    .search(companyId, name, description, types, start, end, obc);
276     }
277 
278     public static java.util.List<com.liferay.portal.model.Role> search(
279         long companyId, java.lang.String name, java.lang.String description,
280         java.lang.Integer[] types,
281         java.util.LinkedHashMap<String, Object> params, int start, int end,
282         com.liferay.portal.kernel.util.OrderByComparator obc)
283         throws com.liferay.portal.kernel.exception.SystemException {
284         return getService()
285                    .search(companyId, name, description, types, params, start,
286             end, obc);
287     }
288 
289     public static int searchCount(long companyId, java.lang.String name,
290         java.lang.String description, java.lang.Integer[] types)
291         throws com.liferay.portal.kernel.exception.SystemException {
292         return getService().searchCount(companyId, name, description, types);
293     }
294 
295     public static int searchCount(long companyId, java.lang.String name,
296         java.lang.String description, java.lang.Integer[] types,
297         java.util.LinkedHashMap<String, Object> params)
298         throws com.liferay.portal.kernel.exception.SystemException {
299         return getService()
300                    .searchCount(companyId, name, description, types, params);
301     }
302 
303     public static void setUserRoles(long userId, long[] roleIds)
304         throws com.liferay.portal.kernel.exception.PortalException,
305             com.liferay.portal.kernel.exception.SystemException {
306         getService().setUserRoles(userId, roleIds);
307     }
308 
309     public static void unsetUserRoles(long userId, long[] roleIds)
310         throws com.liferay.portal.kernel.exception.PortalException,
311             com.liferay.portal.kernel.exception.SystemException {
312         getService().unsetUserRoles(userId, roleIds);
313     }
314 
315     public static com.liferay.portal.model.Role updateRole(long roleId,
316         java.lang.String name,
317         java.util.Map<java.util.Locale, String> titleMap,
318         java.lang.String description, java.lang.String subtype)
319         throws com.liferay.portal.kernel.exception.PortalException,
320             com.liferay.portal.kernel.exception.SystemException {
321         return getService()
322                    .updateRole(roleId, name, titleMap, description, subtype);
323     }
324 
325     public static RoleLocalService getService() {
326         if (_service == null) {
327             _service = (RoleLocalService)PortalBeanLocatorUtil.locate(RoleLocalService.class.getName());
328         }
329 
330         return _service;
331     }
332 
333     public void setService(RoleLocalService service) {
334         _service = service;
335     }
336 
337     private static RoleLocalService _service;
338 }