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