001
014
015 package com.liferay.portal.service;
016
017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018
019
036 public class RoleLocalServiceUtil {
037
044 public static com.liferay.portal.model.Role addRole(
045 com.liferay.portal.model.Role role)
046 throws com.liferay.portal.kernel.exception.SystemException {
047 return getService().addRole(role);
048 }
049
050
056 public static com.liferay.portal.model.Role createRole(long roleId) {
057 return getService().createRole(roleId);
058 }
059
060
067 public static void deleteRole(long roleId)
068 throws com.liferay.portal.kernel.exception.PortalException,
069 com.liferay.portal.kernel.exception.SystemException {
070 getService().deleteRole(roleId);
071 }
072
073
079 public static void deleteRole(com.liferay.portal.model.Role role)
080 throws com.liferay.portal.kernel.exception.SystemException {
081 getService().deleteRole(role);
082 }
083
084
091 @SuppressWarnings("rawtypes")
092 public static java.util.List dynamicQuery(
093 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
094 throws com.liferay.portal.kernel.exception.SystemException {
095 return getService().dynamicQuery(dynamicQuery);
096 }
097
098
111 @SuppressWarnings("rawtypes")
112 public static java.util.List dynamicQuery(
113 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
114 int end) throws com.liferay.portal.kernel.exception.SystemException {
115 return getService().dynamicQuery(dynamicQuery, start, end);
116 }
117
118
132 @SuppressWarnings("rawtypes")
133 public static java.util.List dynamicQuery(
134 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
135 int end,
136 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
137 throws com.liferay.portal.kernel.exception.SystemException {
138 return getService()
139 .dynamicQuery(dynamicQuery, start, end, orderByComparator);
140 }
141
142
149 public static long dynamicQueryCount(
150 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
151 throws com.liferay.portal.kernel.exception.SystemException {
152 return getService().dynamicQueryCount(dynamicQuery);
153 }
154
155
163 public static com.liferay.portal.model.Role getRole(long roleId)
164 throws com.liferay.portal.kernel.exception.PortalException,
165 com.liferay.portal.kernel.exception.SystemException {
166 return getService().getRole(roleId);
167 }
168
169
181 public static java.util.List<com.liferay.portal.model.Role> getRoles(
182 int start, int end)
183 throws com.liferay.portal.kernel.exception.SystemException {
184 return getService().getRoles(start, end);
185 }
186
187
193 public static int getRolesCount()
194 throws com.liferay.portal.kernel.exception.SystemException {
195 return getService().getRolesCount();
196 }
197
198
205 public static com.liferay.portal.model.Role updateRole(
206 com.liferay.portal.model.Role role)
207 throws com.liferay.portal.kernel.exception.SystemException {
208 return getService().updateRole(role);
209 }
210
211
219 public static com.liferay.portal.model.Role updateRole(
220 com.liferay.portal.model.Role role, boolean merge)
221 throws com.liferay.portal.kernel.exception.SystemException {
222 return getService().updateRole(role, merge);
223 }
224
225 public static com.liferay.portal.model.Role addRole(long userId,
226 long companyId, java.lang.String name,
227 java.util.Map<java.util.Locale, java.lang.String> titleMap,
228 java.lang.String description, int type)
229 throws com.liferay.portal.kernel.exception.PortalException,
230 com.liferay.portal.kernel.exception.SystemException {
231 return getService()
232 .addRole(userId, companyId, name, titleMap, description, type);
233 }
234
235 public static com.liferay.portal.model.Role addRole(long userId,
236 long companyId, java.lang.String name,
237 java.util.Map<java.util.Locale, java.lang.String> titleMap,
238 java.lang.String description, int type, java.lang.String className,
239 long classPK)
240 throws com.liferay.portal.kernel.exception.PortalException,
241 com.liferay.portal.kernel.exception.SystemException {
242 return getService()
243 .addRole(userId, companyId, name, titleMap, description,
244 type, className, classPK);
245 }
246
247 public static void addUserRoles(long userId, long[] roleIds)
248 throws com.liferay.portal.kernel.exception.PortalException,
249 com.liferay.portal.kernel.exception.SystemException {
250 getService().addUserRoles(userId, roleIds);
251 }
252
253 public static void checkSystemRoles(long companyId)
254 throws com.liferay.portal.kernel.exception.PortalException,
255 com.liferay.portal.kernel.exception.SystemException {
256 getService().checkSystemRoles(companyId);
257 }
258
259 public static com.liferay.portal.model.Role getDefaultGroupRole(
260 long groupId)
261 throws com.liferay.portal.kernel.exception.PortalException,
262 com.liferay.portal.kernel.exception.SystemException {
263 return getService().getDefaultGroupRole(groupId);
264 }
265
266 public static java.util.List<com.liferay.portal.model.Role> getGroupRoles(
267 long groupId)
268 throws com.liferay.portal.kernel.exception.SystemException {
269 return getService().getGroupRoles(groupId);
270 }
271
272 public static java.util.Map<java.lang.String, java.util.List<java.lang.String>> getResourceRoles(
273 long companyId, java.lang.String name, int scope,
274 java.lang.String primKey)
275 throws com.liferay.portal.kernel.exception.SystemException {
276 return getService().getResourceRoles(companyId, name, scope, primKey);
277 }
278
279 public static com.liferay.portal.model.Role getRole(long companyId,
280 java.lang.String name)
281 throws com.liferay.portal.kernel.exception.PortalException,
282 com.liferay.portal.kernel.exception.SystemException {
283 return getService().getRole(companyId, name);
284 }
285
286 public static java.util.List<com.liferay.portal.model.Role> getRoles(
287 long companyId)
288 throws com.liferay.portal.kernel.exception.SystemException {
289 return getService().getRoles(companyId);
290 }
291
292 public static java.util.List<com.liferay.portal.model.Role> getRoles(
293 long[] roleIds)
294 throws com.liferay.portal.kernel.exception.PortalException,
295 com.liferay.portal.kernel.exception.SystemException {
296 return getService().getRoles(roleIds);
297 }
298
299 public static java.util.List<com.liferay.portal.model.Role> getRoles(
300 int type, java.lang.String subtype)
301 throws com.liferay.portal.kernel.exception.SystemException {
302 return getService().getRoles(type, subtype);
303 }
304
305 public static java.util.List<com.liferay.portal.model.Role> getSubtypeRoles(
306 java.lang.String subtype)
307 throws com.liferay.portal.kernel.exception.SystemException {
308 return getService().getSubtypeRoles(subtype);
309 }
310
311 public static int getSubtypeRolesCount(java.lang.String subtype)
312 throws com.liferay.portal.kernel.exception.SystemException {
313 return getService().getSubtypeRolesCount(subtype);
314 }
315
316 public static com.liferay.portal.model.Role getTeamRole(long companyId,
317 long teamId)
318 throws com.liferay.portal.kernel.exception.PortalException,
319 com.liferay.portal.kernel.exception.SystemException {
320 return getService().getTeamRole(companyId, teamId);
321 }
322
323 public static java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
324 long userId, long groupId)
325 throws com.liferay.portal.kernel.exception.SystemException {
326 return getService().getUserGroupGroupRoles(userId, groupId);
327 }
328
329 public static java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
330 long userId, long groupId)
331 throws com.liferay.portal.kernel.exception.SystemException {
332 return getService().getUserGroupRoles(userId, groupId);
333 }
334
335 public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
336 long userId, long groupId)
337 throws com.liferay.portal.kernel.exception.SystemException {
338 return getService().getUserRelatedRoles(userId, groupId);
339 }
340
341 public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
342 long userId, long[] groupIds)
343 throws com.liferay.portal.kernel.exception.SystemException {
344 return getService().getUserRelatedRoles(userId, groupIds);
345 }
346
347 public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
348 long userId, java.util.List<com.liferay.portal.model.Group> groups)
349 throws com.liferay.portal.kernel.exception.SystemException {
350 return getService().getUserRelatedRoles(userId, groups);
351 }
352
353 public static java.util.List<com.liferay.portal.model.Role> getUserRoles(
354 long userId) throws com.liferay.portal.kernel.exception.SystemException {
355 return getService().getUserRoles(userId);
356 }
357
358 public static boolean hasUserRole(long userId, long roleId)
359 throws com.liferay.portal.kernel.exception.SystemException {
360 return getService().hasUserRole(userId, roleId);
361 }
362
363
368 public static boolean hasUserRole(long userId, long companyId,
369 java.lang.String name, boolean inherited)
370 throws com.liferay.portal.kernel.exception.PortalException,
371 com.liferay.portal.kernel.exception.SystemException {
372 return getService().hasUserRole(userId, companyId, name, inherited);
373 }
374
375
381 public static boolean hasUserRoles(long userId, long companyId,
382 java.lang.String[] names, boolean inherited)
383 throws com.liferay.portal.kernel.exception.PortalException,
384 com.liferay.portal.kernel.exception.SystemException {
385 return getService().hasUserRoles(userId, companyId, names, inherited);
386 }
387
388 public static java.util.List<com.liferay.portal.model.Role> search(
389 long companyId, java.lang.String name, java.lang.String description,
390 java.lang.Integer[] types, int start, int end,
391 com.liferay.portal.kernel.util.OrderByComparator obc)
392 throws com.liferay.portal.kernel.exception.SystemException {
393 return getService()
394 .search(companyId, name, description, types, start, end, obc);
395 }
396
397 public static java.util.List<com.liferay.portal.model.Role> search(
398 long companyId, java.lang.String name, java.lang.String description,
399 java.lang.Integer[] types,
400 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
401 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
402 throws com.liferay.portal.kernel.exception.SystemException {
403 return getService()
404 .search(companyId, name, description, types, params, start,
405 end, obc);
406 }
407
408 public static int searchCount(long companyId, java.lang.String name,
409 java.lang.String description, java.lang.Integer[] types)
410 throws com.liferay.portal.kernel.exception.SystemException {
411 return getService().searchCount(companyId, name, description, types);
412 }
413
414 public static int searchCount(long companyId, java.lang.String name,
415 java.lang.String description, java.lang.Integer[] types,
416 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
417 throws com.liferay.portal.kernel.exception.SystemException {
418 return getService()
419 .searchCount(companyId, name, description, types, params);
420 }
421
422 public static void setUserRoles(long userId, long[] roleIds)
423 throws com.liferay.portal.kernel.exception.PortalException,
424 com.liferay.portal.kernel.exception.SystemException {
425 getService().setUserRoles(userId, roleIds);
426 }
427
428 public static void unsetUserRoles(long userId, long[] roleIds)
429 throws com.liferay.portal.kernel.exception.PortalException,
430 com.liferay.portal.kernel.exception.SystemException {
431 getService().unsetUserRoles(userId, roleIds);
432 }
433
434 public static com.liferay.portal.model.Role updateRole(long roleId,
435 java.lang.String name,
436 java.util.Map<java.util.Locale, java.lang.String> titleMap,
437 java.lang.String description, java.lang.String subtype)
438 throws com.liferay.portal.kernel.exception.PortalException,
439 com.liferay.portal.kernel.exception.SystemException {
440 return getService()
441 .updateRole(roleId, name, titleMap, description, subtype);
442 }
443
444 public static RoleLocalService getService() {
445 if (_service == null) {
446 _service = (RoleLocalService)PortalBeanLocatorUtil.locate(RoleLocalService.class.getName());
447 }
448
449 return _service;
450 }
451
452 public void setService(RoleLocalService service) {
453 _service = service;
454 }
455
456 private static RoleLocalService _service;
457 }