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  
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.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.PortalException,
52              com.liferay.portal.SystemException {
53          getService().deleteRole(roleId);
54      }
55  
56      public static void deleteRole(com.liferay.portal.model.Role role)
57          throws com.liferay.portal.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.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.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.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.SystemException {
85          return getService().dynamicQueryCount(dynamicQuery);
86      }
87  
88      public static com.liferay.portal.model.Role getRole(long roleId)
89          throws com.liferay.portal.PortalException,
90              com.liferay.portal.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) throws com.liferay.portal.SystemException {
96          return getService().getRoles(start, end);
97      }
98  
99      public static int getRolesCount() throws com.liferay.portal.SystemException {
100         return getService().getRolesCount();
101     }
102 
103     public static com.liferay.portal.model.Role updateRole(
104         com.liferay.portal.model.Role role)
105         throws com.liferay.portal.SystemException {
106         return getService().updateRole(role);
107     }
108 
109     public static com.liferay.portal.model.Role updateRole(
110         com.liferay.portal.model.Role role, boolean merge)
111         throws com.liferay.portal.SystemException {
112         return getService().updateRole(role, merge);
113     }
114 
115     public static com.liferay.portal.model.Role addRole(long userId,
116         long companyId, java.lang.String name, java.lang.String description,
117         int type)
118         throws com.liferay.portal.PortalException,
119             com.liferay.portal.SystemException {
120         return getService().addRole(userId, companyId, name, description, type);
121     }
122 
123     public static com.liferay.portal.model.Role addRole(long userId,
124         long companyId, java.lang.String name, java.lang.String description,
125         int type, java.lang.String className, long classPK)
126         throws com.liferay.portal.PortalException,
127             com.liferay.portal.SystemException {
128         return getService()
129                    .addRole(userId, companyId, name, description, type,
130             className, classPK);
131     }
132 
133     public static void addUserRoles(long userId, long[] roleIds)
134         throws com.liferay.portal.SystemException {
135         getService().addUserRoles(userId, roleIds);
136     }
137 
138     public static void checkSystemRoles(long companyId)
139         throws com.liferay.portal.PortalException,
140             com.liferay.portal.SystemException {
141         getService().checkSystemRoles(companyId);
142     }
143 
144     public static com.liferay.portal.model.Role getGroupRole(long companyId,
145         long groupId)
146         throws com.liferay.portal.PortalException,
147             com.liferay.portal.SystemException {
148         return getService().getGroupRole(companyId, groupId);
149     }
150 
151     public static java.util.List<com.liferay.portal.model.Role> getGroupRoles(
152         long groupId) throws com.liferay.portal.SystemException {
153         return getService().getGroupRoles(groupId);
154     }
155 
156     public static java.util.Map<String, java.util.List<String>> getResourceRoles(
157         long companyId, java.lang.String name, int scope,
158         java.lang.String primKey) throws com.liferay.portal.SystemException {
159         return getService().getResourceRoles(companyId, name, scope, primKey);
160     }
161 
162     public static com.liferay.portal.model.Role getRole(long companyId,
163         java.lang.String name)
164         throws com.liferay.portal.PortalException,
165             com.liferay.portal.SystemException {
166         return getService().getRole(companyId, name);
167     }
168 
169     public static java.util.List<com.liferay.portal.model.Role> getRoles(
170         long companyId) throws com.liferay.portal.SystemException {
171         return getService().getRoles(companyId);
172     }
173 
174     public static java.util.List<com.liferay.portal.model.Role> getRoles(
175         long[] roleIds)
176         throws com.liferay.portal.PortalException,
177             com.liferay.portal.SystemException {
178         return getService().getRoles(roleIds);
179     }
180 
181     public static java.util.List<com.liferay.portal.model.Role> getRoles(
182         int type, java.lang.String subtype)
183         throws com.liferay.portal.SystemException {
184         return getService().getRoles(type, subtype);
185     }
186 
187     public static java.util.List<com.liferay.portal.model.Role> getSubtypeRoles(
188         java.lang.String subtype) throws com.liferay.portal.SystemException {
189         return getService().getSubtypeRoles(subtype);
190     }
191 
192     public static int getSubtypeRolesCount(java.lang.String subtype)
193         throws com.liferay.portal.SystemException {
194         return getService().getSubtypeRolesCount(subtype);
195     }
196 
197     public static java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
198         long userId, long groupId) throws com.liferay.portal.SystemException {
199         return getService().getUserGroupGroupRoles(userId, groupId);
200     }
201 
202     public static java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
203         long userId, long groupId) throws com.liferay.portal.SystemException {
204         return getService().getUserGroupRoles(userId, groupId);
205     }
206 
207     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
208         long userId, long groupId) throws com.liferay.portal.SystemException {
209         return getService().getUserRelatedRoles(userId, groupId);
210     }
211 
212     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
213         long userId, long[] groupIds) throws com.liferay.portal.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.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.SystemException {
225         return getService().getUserRoles(userId);
226     }
227 
228     public static boolean hasUserRole(long userId, long roleId)
229         throws com.liferay.portal.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.PortalException,
236             com.liferay.portal.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.PortalException,
243             com.liferay.portal.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.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.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.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.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.PortalException,
282             com.liferay.portal.SystemException {
283         getService().setUserRoles(userId, roleIds);
284     }
285 
286     public static void unsetUserRoles(long userId, long[] roleIds)
287         throws com.liferay.portal.PortalException,
288             com.liferay.portal.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> localeTitlesMap,
295         java.lang.String description, java.lang.String subtype)
296         throws com.liferay.portal.PortalException,
297             com.liferay.portal.SystemException {
298         return getService()
299                    .updateRole(roleId, name, localeTitlesMap, description,
300             subtype);
301     }
302 
303     public static RoleLocalService getService() {
304         if (_service == null) {
305             _service = (RoleLocalService)PortalBeanLocatorUtil.locate(RoleLocalService.class.getName());
306         }
307 
308         return _service;
309     }
310 
311     public void setService(RoleLocalService service) {
312         _service = service;
313     }
314 
315     private static RoleLocalService _service;
316 }