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      @SuppressWarnings("unchecked")
62      public static java.util.List dynamicQuery(
63          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
64          throws com.liferay.portal.kernel.exception.SystemException {
65          return getService().dynamicQuery(dynamicQuery);
66      }
67  
68      @SuppressWarnings("unchecked")
69      public static java.util.List dynamicQuery(
70          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
71          int end) throws com.liferay.portal.kernel.exception.SystemException {
72          return getService().dynamicQuery(dynamicQuery, start, end);
73      }
74  
75      @SuppressWarnings("unchecked")
76      public static java.util.List dynamicQuery(
77          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
78          int end,
79          com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
80          throws com.liferay.portal.kernel.exception.SystemException {
81          return getService()
82                     .dynamicQuery(dynamicQuery, start, end, orderByComparator);
83      }
84  
85      public static long dynamicQueryCount(
86          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
87          throws com.liferay.portal.kernel.exception.SystemException {
88          return getService().dynamicQueryCount(dynamicQuery);
89      }
90  
91      public static com.liferay.portal.model.Role getRole(long roleId)
92          throws com.liferay.portal.kernel.exception.PortalException,
93              com.liferay.portal.kernel.exception.SystemException {
94          return getService().getRole(roleId);
95      }
96  
97      public static java.util.List<com.liferay.portal.model.Role> getRoles(
98          int start, int end)
99          throws com.liferay.portal.kernel.exception.SystemException {
100         return getService().getRoles(start, end);
101     }
102 
103     public static int getRolesCount()
104         throws com.liferay.portal.kernel.exception.SystemException {
105         return getService().getRolesCount();
106     }
107 
108     public static com.liferay.portal.model.Role updateRole(
109         com.liferay.portal.model.Role role)
110         throws com.liferay.portal.kernel.exception.SystemException {
111         return getService().updateRole(role);
112     }
113 
114     public static com.liferay.portal.model.Role updateRole(
115         com.liferay.portal.model.Role role, boolean merge)
116         throws com.liferay.portal.kernel.exception.SystemException {
117         return getService().updateRole(role, merge);
118     }
119 
120     public static com.liferay.portal.model.Role addRole(long userId,
121         long companyId, java.lang.String name,
122         java.util.Map<java.util.Locale, java.lang.String> titleMap,
123         java.lang.String description, int type)
124         throws com.liferay.portal.kernel.exception.PortalException,
125             com.liferay.portal.kernel.exception.SystemException {
126         return getService()
127                    .addRole(userId, companyId, name, titleMap, description, type);
128     }
129 
130     public static com.liferay.portal.model.Role addRole(long userId,
131         long companyId, java.lang.String name,
132         java.util.Map<java.util.Locale, java.lang.String> titleMap,
133         java.lang.String description, int type, java.lang.String className,
134         long classPK)
135         throws com.liferay.portal.kernel.exception.PortalException,
136             com.liferay.portal.kernel.exception.SystemException {
137         return getService()
138                    .addRole(userId, companyId, name, titleMap, description,
139             type, className, classPK);
140     }
141 
142     public static void addUserRoles(long userId, long[] roleIds)
143         throws com.liferay.portal.kernel.exception.PortalException,
144             com.liferay.portal.kernel.exception.SystemException {
145         getService().addUserRoles(userId, roleIds);
146     }
147 
148     public static void checkSystemRoles(long companyId)
149         throws com.liferay.portal.kernel.exception.PortalException,
150             com.liferay.portal.kernel.exception.SystemException {
151         getService().checkSystemRoles(companyId);
152     }
153 
154     public static com.liferay.portal.model.Role getDefaultGroupRole(
155         long groupId)
156         throws com.liferay.portal.kernel.exception.PortalException,
157             com.liferay.portal.kernel.exception.SystemException {
158         return getService().getDefaultGroupRole(groupId);
159     }
160 
161     public static java.util.List<com.liferay.portal.model.Role> getGroupRoles(
162         long groupId)
163         throws com.liferay.portal.kernel.exception.SystemException {
164         return getService().getGroupRoles(groupId);
165     }
166 
167     public static java.util.Map<java.lang.String, java.util.List<java.lang.String>> getResourceRoles(
168         long companyId, java.lang.String name, int scope,
169         java.lang.String primKey)
170         throws com.liferay.portal.kernel.exception.SystemException {
171         return getService().getResourceRoles(companyId, name, scope, primKey);
172     }
173 
174     public static com.liferay.portal.model.Role getRole(long companyId,
175         java.lang.String name)
176         throws com.liferay.portal.kernel.exception.PortalException,
177             com.liferay.portal.kernel.exception.SystemException {
178         return getService().getRole(companyId, name);
179     }
180 
181     public static java.util.List<com.liferay.portal.model.Role> getRoles(
182         long companyId)
183         throws com.liferay.portal.kernel.exception.SystemException {
184         return getService().getRoles(companyId);
185     }
186 
187     public static java.util.List<com.liferay.portal.model.Role> getRoles(
188         long[] roleIds)
189         throws com.liferay.portal.kernel.exception.PortalException,
190             com.liferay.portal.kernel.exception.SystemException {
191         return getService().getRoles(roleIds);
192     }
193 
194     public static java.util.List<com.liferay.portal.model.Role> getRoles(
195         int type, java.lang.String subtype)
196         throws com.liferay.portal.kernel.exception.SystemException {
197         return getService().getRoles(type, subtype);
198     }
199 
200     public static java.util.List<com.liferay.portal.model.Role> getSubtypeRoles(
201         java.lang.String subtype)
202         throws com.liferay.portal.kernel.exception.SystemException {
203         return getService().getSubtypeRoles(subtype);
204     }
205 
206     public static int getSubtypeRolesCount(java.lang.String subtype)
207         throws com.liferay.portal.kernel.exception.SystemException {
208         return getService().getSubtypeRolesCount(subtype);
209     }
210 
211     public static com.liferay.portal.model.Role getTeamRole(long companyId,
212         long teamId)
213         throws com.liferay.portal.kernel.exception.PortalException,
214             com.liferay.portal.kernel.exception.SystemException {
215         return getService().getTeamRole(companyId, teamId);
216     }
217 
218     public static java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
219         long userId, long groupId)
220         throws com.liferay.portal.kernel.exception.SystemException {
221         return getService().getUserGroupGroupRoles(userId, groupId);
222     }
223 
224     public static java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
225         long userId, long groupId)
226         throws com.liferay.portal.kernel.exception.SystemException {
227         return getService().getUserGroupRoles(userId, groupId);
228     }
229 
230     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
231         long userId, long groupId)
232         throws com.liferay.portal.kernel.exception.SystemException {
233         return getService().getUserRelatedRoles(userId, groupId);
234     }
235 
236     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
237         long userId, long[] groupIds)
238         throws com.liferay.portal.kernel.exception.SystemException {
239         return getService().getUserRelatedRoles(userId, groupIds);
240     }
241 
242     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
243         long userId, java.util.List<com.liferay.portal.model.Group> groups)
244         throws com.liferay.portal.kernel.exception.SystemException {
245         return getService().getUserRelatedRoles(userId, groups);
246     }
247 
248     public static java.util.List<com.liferay.portal.model.Role> getUserRoles(
249         long userId) throws com.liferay.portal.kernel.exception.SystemException {
250         return getService().getUserRoles(userId);
251     }
252 
253     public static boolean hasUserRole(long userId, long roleId)
254         throws com.liferay.portal.kernel.exception.SystemException {
255         return getService().hasUserRole(userId, roleId);
256     }
257 
258     /**
259     * Returns true if the user has the regular role.
260     *
261     * @return true if the user has the regular role
262     */
263     public static boolean hasUserRole(long userId, long companyId,
264         java.lang.String name, boolean inherited)
265         throws com.liferay.portal.kernel.exception.PortalException,
266             com.liferay.portal.kernel.exception.SystemException {
267         return getService().hasUserRole(userId, companyId, name, inherited);
268     }
269 
270     /**
271     * Returns true if the user has any one of the specified regular roles.
272     *
273     * @return true if the user has the regular role
274     */
275     public static boolean hasUserRoles(long userId, long companyId,
276         java.lang.String[] names, boolean inherited)
277         throws com.liferay.portal.kernel.exception.PortalException,
278             com.liferay.portal.kernel.exception.SystemException {
279         return getService().hasUserRoles(userId, companyId, names, inherited);
280     }
281 
282     public static java.util.List<com.liferay.portal.model.Role> search(
283         long companyId, java.lang.String name, java.lang.String description,
284         java.lang.Integer[] types, int start, int end,
285         com.liferay.portal.kernel.util.OrderByComparator obc)
286         throws com.liferay.portal.kernel.exception.SystemException {
287         return getService()
288                    .search(companyId, name, description, types, start, end, obc);
289     }
290 
291     public static java.util.List<com.liferay.portal.model.Role> search(
292         long companyId, java.lang.String name, java.lang.String description,
293         java.lang.Integer[] types,
294         java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
295         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
296         throws com.liferay.portal.kernel.exception.SystemException {
297         return getService()
298                    .search(companyId, name, description, types, params, start,
299             end, obc);
300     }
301 
302     public static int searchCount(long companyId, java.lang.String name,
303         java.lang.String description, java.lang.Integer[] types)
304         throws com.liferay.portal.kernel.exception.SystemException {
305         return getService().searchCount(companyId, name, description, types);
306     }
307 
308     public static int searchCount(long companyId, java.lang.String name,
309         java.lang.String description, java.lang.Integer[] types,
310         java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
311         throws com.liferay.portal.kernel.exception.SystemException {
312         return getService()
313                    .searchCount(companyId, name, description, types, params);
314     }
315 
316     public static void setUserRoles(long userId, long[] roleIds)
317         throws com.liferay.portal.kernel.exception.PortalException,
318             com.liferay.portal.kernel.exception.SystemException {
319         getService().setUserRoles(userId, roleIds);
320     }
321 
322     public static void unsetUserRoles(long userId, long[] roleIds)
323         throws com.liferay.portal.kernel.exception.PortalException,
324             com.liferay.portal.kernel.exception.SystemException {
325         getService().unsetUserRoles(userId, roleIds);
326     }
327 
328     public static com.liferay.portal.model.Role updateRole(long roleId,
329         java.lang.String name,
330         java.util.Map<java.util.Locale, java.lang.String> titleMap,
331         java.lang.String description, java.lang.String subtype)
332         throws com.liferay.portal.kernel.exception.PortalException,
333             com.liferay.portal.kernel.exception.SystemException {
334         return getService()
335                    .updateRole(roleId, name, titleMap, description, subtype);
336     }
337 
338     public static RoleLocalService getService() {
339         if (_service == null) {
340             _service = (RoleLocalService)PortalBeanLocatorUtil.locate(RoleLocalService.class.getName());
341         }
342 
343         return _service;
344     }
345 
346     public void setService(RoleLocalService service) {
347         _service = service;
348     }
349 
350     private static RoleLocalService _service;
351 }