001
014
015 package com.liferay.portal.service;
016
017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018 import com.liferay.portal.kernel.util.MethodCache;
019 import com.liferay.portal.kernel.util.ReferenceRegistry;
020
021
034 public class RoleLocalServiceUtil {
035
040
041
048 public static com.liferay.portal.model.Role addRole(
049 com.liferay.portal.model.Role role)
050 throws com.liferay.portal.kernel.exception.SystemException {
051 return getService().addRole(role);
052 }
053
054
060 public static com.liferay.portal.model.Role createRole(long roleId) {
061 return getService().createRole(roleId);
062 }
063
064
071 public static void deleteRole(long roleId)
072 throws com.liferay.portal.kernel.exception.PortalException,
073 com.liferay.portal.kernel.exception.SystemException {
074 getService().deleteRole(roleId);
075 }
076
077
084 public static void deleteRole(com.liferay.portal.model.Role role)
085 throws com.liferay.portal.kernel.exception.PortalException,
086 com.liferay.portal.kernel.exception.SystemException {
087 getService().deleteRole(role);
088 }
089
090
097 @SuppressWarnings("rawtypes")
098 public static java.util.List dynamicQuery(
099 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
100 throws com.liferay.portal.kernel.exception.SystemException {
101 return getService().dynamicQuery(dynamicQuery);
102 }
103
104
117 @SuppressWarnings("rawtypes")
118 public static java.util.List dynamicQuery(
119 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
120 int end) throws com.liferay.portal.kernel.exception.SystemException {
121 return getService().dynamicQuery(dynamicQuery, start, end);
122 }
123
124
138 @SuppressWarnings("rawtypes")
139 public static java.util.List dynamicQuery(
140 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
141 int end,
142 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
143 throws com.liferay.portal.kernel.exception.SystemException {
144 return getService()
145 .dynamicQuery(dynamicQuery, start, end, orderByComparator);
146 }
147
148
155 public static long dynamicQueryCount(
156 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
157 throws com.liferay.portal.kernel.exception.SystemException {
158 return getService().dynamicQueryCount(dynamicQuery);
159 }
160
161
169 public static com.liferay.portal.model.Role getRole(long roleId)
170 throws com.liferay.portal.kernel.exception.PortalException,
171 com.liferay.portal.kernel.exception.SystemException {
172 return getService().getRole(roleId);
173 }
174
175 public static com.liferay.portal.model.PersistedModel getPersistedModel(
176 java.io.Serializable primaryKeyObj)
177 throws com.liferay.portal.kernel.exception.PortalException,
178 com.liferay.portal.kernel.exception.SystemException {
179 return getService().getPersistedModel(primaryKeyObj);
180 }
181
182
194 public static java.util.List<com.liferay.portal.model.Role> getRoles(
195 int start, int end)
196 throws com.liferay.portal.kernel.exception.SystemException {
197 return getService().getRoles(start, end);
198 }
199
200
206 public static int getRolesCount()
207 throws com.liferay.portal.kernel.exception.SystemException {
208 return getService().getRolesCount();
209 }
210
211
218 public static com.liferay.portal.model.Role updateRole(
219 com.liferay.portal.model.Role role)
220 throws com.liferay.portal.kernel.exception.SystemException {
221 return getService().updateRole(role);
222 }
223
224
232 public static com.liferay.portal.model.Role updateRole(
233 com.liferay.portal.model.Role role, boolean merge)
234 throws com.liferay.portal.kernel.exception.SystemException {
235 return getService().updateRole(role, merge);
236 }
237
238
243 public static java.lang.String getBeanIdentifier() {
244 return getService().getBeanIdentifier();
245 }
246
247
252 public static void setBeanIdentifier(java.lang.String beanIdentifier) {
253 getService().setBeanIdentifier(beanIdentifier);
254 }
255
256 public static com.liferay.portal.model.Role addRole(long userId,
257 long companyId, java.lang.String name,
258 java.util.Map<java.util.Locale, java.lang.String> titleMap,
259 java.lang.String description, int type)
260 throws com.liferay.portal.kernel.exception.PortalException,
261 com.liferay.portal.kernel.exception.SystemException {
262 return getService()
263 .addRole(userId, companyId, name, titleMap, description, type);
264 }
265
266 public static com.liferay.portal.model.Role addRole(long userId,
267 long companyId, java.lang.String name,
268 java.util.Map<java.util.Locale, java.lang.String> titleMap,
269 java.lang.String description, int type, java.lang.String className,
270 long classPK)
271 throws com.liferay.portal.kernel.exception.PortalException,
272 com.liferay.portal.kernel.exception.SystemException {
273 return getService()
274 .addRole(userId, companyId, name, titleMap, description,
275 type, className, classPK);
276 }
277
278 public static void addUserRoles(long userId, long[] roleIds)
279 throws com.liferay.portal.kernel.exception.PortalException,
280 com.liferay.portal.kernel.exception.SystemException {
281 getService().addUserRoles(userId, roleIds);
282 }
283
284 public static void checkSystemRoles()
285 throws com.liferay.portal.kernel.exception.PortalException,
286 com.liferay.portal.kernel.exception.SystemException {
287 getService().checkSystemRoles();
288 }
289
290 public static void checkSystemRoles(long companyId)
291 throws com.liferay.portal.kernel.exception.PortalException,
292 com.liferay.portal.kernel.exception.SystemException {
293 getService().checkSystemRoles(companyId);
294 }
295
296 public static com.liferay.portal.model.Role getDefaultGroupRole(
297 long groupId)
298 throws com.liferay.portal.kernel.exception.PortalException,
299 com.liferay.portal.kernel.exception.SystemException {
300 return getService().getDefaultGroupRole(groupId);
301 }
302
303 public static java.util.List<com.liferay.portal.model.Role> getGroupRoles(
304 long groupId)
305 throws com.liferay.portal.kernel.exception.SystemException {
306 return getService().getGroupRoles(groupId);
307 }
308
309 public static java.util.Map<java.lang.String, java.util.List<java.lang.String>> getResourceRoles(
310 long companyId, java.lang.String name, int scope,
311 java.lang.String primKey)
312 throws com.liferay.portal.kernel.exception.SystemException {
313 return getService().getResourceRoles(companyId, name, scope, primKey);
314 }
315
316 public static java.util.List<com.liferay.portal.model.Role> getResourceRoles(
317 long companyId, java.lang.String name, int scope,
318 java.lang.String primKey, java.lang.String actionId)
319 throws com.liferay.portal.kernel.exception.SystemException {
320 return getService()
321 .getResourceRoles(companyId, name, scope, primKey, actionId);
322 }
323
324 public static com.liferay.portal.model.Role getRole(long companyId,
325 java.lang.String name)
326 throws com.liferay.portal.kernel.exception.PortalException,
327 com.liferay.portal.kernel.exception.SystemException {
328 return getService().getRole(companyId, name);
329 }
330
331 public static java.util.List<com.liferay.portal.model.Role> getRoles(
332 int type, java.lang.String subtype)
333 throws com.liferay.portal.kernel.exception.SystemException {
334 return getService().getRoles(type, subtype);
335 }
336
337 public static java.util.List<com.liferay.portal.model.Role> getRoles(
338 long companyId)
339 throws com.liferay.portal.kernel.exception.SystemException {
340 return getService().getRoles(companyId);
341 }
342
343 public static java.util.List<com.liferay.portal.model.Role> getRoles(
344 long[] roleIds)
345 throws com.liferay.portal.kernel.exception.PortalException,
346 com.liferay.portal.kernel.exception.SystemException {
347 return getService().getRoles(roleIds);
348 }
349
350 public static java.util.List<com.liferay.portal.model.Role> getSubtypeRoles(
351 java.lang.String subtype)
352 throws com.liferay.portal.kernel.exception.SystemException {
353 return getService().getSubtypeRoles(subtype);
354 }
355
356 public static int getSubtypeRolesCount(java.lang.String subtype)
357 throws com.liferay.portal.kernel.exception.SystemException {
358 return getService().getSubtypeRolesCount(subtype);
359 }
360
361 public static com.liferay.portal.model.Role getTeamRole(long companyId,
362 long teamId)
363 throws com.liferay.portal.kernel.exception.PortalException,
364 com.liferay.portal.kernel.exception.SystemException {
365 return getService().getTeamRole(companyId, teamId);
366 }
367
368 public static java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
369 long userId, long groupId)
370 throws com.liferay.portal.kernel.exception.SystemException {
371 return getService().getUserGroupGroupRoles(userId, groupId);
372 }
373
374 public static java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
375 long userId, long groupId)
376 throws com.liferay.portal.kernel.exception.SystemException {
377 return getService().getUserGroupRoles(userId, groupId);
378 }
379
380 public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
381 long userId, java.util.List<com.liferay.portal.model.Group> groups)
382 throws com.liferay.portal.kernel.exception.SystemException {
383 return getService().getUserRelatedRoles(userId, groups);
384 }
385
386 public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
387 long userId, long groupId)
388 throws com.liferay.portal.kernel.exception.SystemException {
389 return getService().getUserRelatedRoles(userId, groupId);
390 }
391
392 public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
393 long userId, long[] groupIds)
394 throws com.liferay.portal.kernel.exception.SystemException {
395 return getService().getUserRelatedRoles(userId, groupIds);
396 }
397
398 public static java.util.List<com.liferay.portal.model.Role> getUserRoles(
399 long userId) throws com.liferay.portal.kernel.exception.SystemException {
400 return getService().getUserRoles(userId);
401 }
402
403 public static boolean hasUserRole(long userId, long roleId)
404 throws com.liferay.portal.kernel.exception.SystemException {
405 return getService().hasUserRole(userId, roleId);
406 }
407
408
413 public static boolean hasUserRole(long userId, long companyId,
414 java.lang.String name, boolean inherited)
415 throws com.liferay.portal.kernel.exception.PortalException,
416 com.liferay.portal.kernel.exception.SystemException {
417 return getService().hasUserRole(userId, companyId, name, inherited);
418 }
419
420
426 public static boolean hasUserRoles(long userId, long companyId,
427 java.lang.String[] names, boolean inherited)
428 throws com.liferay.portal.kernel.exception.PortalException,
429 com.liferay.portal.kernel.exception.SystemException {
430 return getService().hasUserRoles(userId, companyId, names, inherited);
431 }
432
433 public static java.util.List<com.liferay.portal.model.Role> search(
434 long companyId, java.lang.String keywords, java.lang.Integer[] types,
435 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
436 throws com.liferay.portal.kernel.exception.SystemException {
437 return getService().search(companyId, keywords, types, start, end, obc);
438 }
439
440 public static java.util.List<com.liferay.portal.model.Role> search(
441 long companyId, java.lang.String keywords, java.lang.Integer[] types,
442 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
443 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
444 throws com.liferay.portal.kernel.exception.SystemException {
445 return getService()
446 .search(companyId, keywords, types, params, start, end, obc);
447 }
448
449 public static java.util.List<com.liferay.portal.model.Role> search(
450 long companyId, java.lang.String name, java.lang.String description,
451 java.lang.Integer[] types, int start, int end,
452 com.liferay.portal.kernel.util.OrderByComparator obc)
453 throws com.liferay.portal.kernel.exception.SystemException {
454 return getService()
455 .search(companyId, name, description, types, start, end, obc);
456 }
457
458 public static java.util.List<com.liferay.portal.model.Role> search(
459 long companyId, java.lang.String name, java.lang.String description,
460 java.lang.Integer[] types,
461 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
462 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
463 throws com.liferay.portal.kernel.exception.SystemException {
464 return getService()
465 .search(companyId, name, description, types, params, start,
466 end, obc);
467 }
468
469 public static int searchCount(long companyId, java.lang.String keywords,
470 java.lang.Integer[] types)
471 throws com.liferay.portal.kernel.exception.SystemException {
472 return getService().searchCount(companyId, keywords, types);
473 }
474
475 public static int searchCount(long companyId, java.lang.String keywords,
476 java.lang.Integer[] types,
477 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
478 throws com.liferay.portal.kernel.exception.SystemException {
479 return getService().searchCount(companyId, keywords, types, params);
480 }
481
482 public static int searchCount(long companyId, java.lang.String name,
483 java.lang.String description, java.lang.Integer[] types)
484 throws com.liferay.portal.kernel.exception.SystemException {
485 return getService().searchCount(companyId, name, description, types);
486 }
487
488 public static int searchCount(long companyId, java.lang.String name,
489 java.lang.String description, java.lang.Integer[] types,
490 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
491 throws com.liferay.portal.kernel.exception.SystemException {
492 return getService()
493 .searchCount(companyId, name, description, types, params);
494 }
495
496 public static void setUserRoles(long userId, long[] roleIds)
497 throws com.liferay.portal.kernel.exception.PortalException,
498 com.liferay.portal.kernel.exception.SystemException {
499 getService().setUserRoles(userId, roleIds);
500 }
501
502 public static void unsetUserRoles(long userId, long[] roleIds)
503 throws com.liferay.portal.kernel.exception.PortalException,
504 com.liferay.portal.kernel.exception.SystemException {
505 getService().unsetUserRoles(userId, roleIds);
506 }
507
508 public static com.liferay.portal.model.Role updateRole(long roleId,
509 java.lang.String name,
510 java.util.Map<java.util.Locale, java.lang.String> titleMap,
511 java.lang.String description, java.lang.String subtype)
512 throws com.liferay.portal.kernel.exception.PortalException,
513 com.liferay.portal.kernel.exception.SystemException {
514 return getService()
515 .updateRole(roleId, name, titleMap, description, subtype);
516 }
517
518 public static RoleLocalService getService() {
519 if (_service == null) {
520 _service = (RoleLocalService)PortalBeanLocatorUtil.locate(RoleLocalService.class.getName());
521
522 ReferenceRegistry.registerReference(RoleLocalServiceUtil.class,
523 "_service");
524 MethodCache.remove(RoleLocalService.class);
525 }
526
527 return _service;
528 }
529
530 public void setService(RoleLocalService service) {
531 MethodCache.remove(RoleLocalService.class);
532
533 _service = service;
534
535 ReferenceRegistry.registerReference(RoleLocalServiceUtil.class,
536 "_service");
537 MethodCache.remove(RoleLocalService.class);
538 }
539
540 private static RoleLocalService _service;
541 }