001 /** 002 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.service; 016 017 /** 018 * <p> 019 * This class is a wrapper for {@link RoleLocalService}. 020 * </p> 021 * 022 * @author Brian Wing Shun Chan 023 * @see RoleLocalService 024 * @generated 025 */ 026 public class RoleLocalServiceWrapper implements RoleLocalService, 027 ServiceWrapper<RoleLocalService> { 028 public RoleLocalServiceWrapper(RoleLocalService roleLocalService) { 029 _roleLocalService = roleLocalService; 030 } 031 032 /** 033 * Adds the role to the database. Also notifies the appropriate model listeners. 034 * 035 * @param role the role 036 * @return the role that was added 037 * @throws SystemException if a system exception occurred 038 */ 039 public com.liferay.portal.model.Role addRole( 040 com.liferay.portal.model.Role role) 041 throws com.liferay.portal.kernel.exception.SystemException { 042 return _roleLocalService.addRole(role); 043 } 044 045 /** 046 * Creates a new role with the primary key. Does not add the role to the database. 047 * 048 * @param roleId the primary key for the new role 049 * @return the new role 050 */ 051 public com.liferay.portal.model.Role createRole(long roleId) { 052 return _roleLocalService.createRole(roleId); 053 } 054 055 /** 056 * Deletes the role with the primary key from the database. Also notifies the appropriate model listeners. 057 * 058 * @param roleId the primary key of the role 059 * @return the role that was removed 060 * @throws PortalException if a role with the primary key could not be found 061 * @throws SystemException if a system exception occurred 062 */ 063 public com.liferay.portal.model.Role deleteRole(long roleId) 064 throws com.liferay.portal.kernel.exception.PortalException, 065 com.liferay.portal.kernel.exception.SystemException { 066 return _roleLocalService.deleteRole(roleId); 067 } 068 069 /** 070 * Deletes the role from the database. Also notifies the appropriate model listeners. 071 * 072 * @param role the role 073 * @return the role that was removed 074 * @throws PortalException 075 * @throws SystemException if a system exception occurred 076 */ 077 public com.liferay.portal.model.Role deleteRole( 078 com.liferay.portal.model.Role role) 079 throws com.liferay.portal.kernel.exception.PortalException, 080 com.liferay.portal.kernel.exception.SystemException { 081 return _roleLocalService.deleteRole(role); 082 } 083 084 public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 085 return _roleLocalService.dynamicQuery(); 086 } 087 088 /** 089 * Performs a dynamic query on the database and returns the matching rows. 090 * 091 * @param dynamicQuery the dynamic query 092 * @return the matching rows 093 * @throws SystemException if a system exception occurred 094 */ 095 @SuppressWarnings("rawtypes") 096 public java.util.List dynamicQuery( 097 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 098 throws com.liferay.portal.kernel.exception.SystemException { 099 return _roleLocalService.dynamicQuery(dynamicQuery); 100 } 101 102 /** 103 * Performs a dynamic query on the database and returns a range of the matching rows. 104 * 105 * <p> 106 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RoleModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 107 * </p> 108 * 109 * @param dynamicQuery the dynamic query 110 * @param start the lower bound of the range of model instances 111 * @param end the upper bound of the range of model instances (not inclusive) 112 * @return the range of matching rows 113 * @throws SystemException if a system exception occurred 114 */ 115 @SuppressWarnings("rawtypes") 116 public java.util.List dynamicQuery( 117 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 118 int end) throws com.liferay.portal.kernel.exception.SystemException { 119 return _roleLocalService.dynamicQuery(dynamicQuery, start, end); 120 } 121 122 /** 123 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 124 * 125 * <p> 126 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RoleModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 127 * </p> 128 * 129 * @param dynamicQuery the dynamic query 130 * @param start the lower bound of the range of model instances 131 * @param end the upper bound of the range of model instances (not inclusive) 132 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 133 * @return the ordered range of matching rows 134 * @throws SystemException if a system exception occurred 135 */ 136 @SuppressWarnings("rawtypes") 137 public java.util.List dynamicQuery( 138 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 139 int end, 140 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 141 throws com.liferay.portal.kernel.exception.SystemException { 142 return _roleLocalService.dynamicQuery(dynamicQuery, start, end, 143 orderByComparator); 144 } 145 146 /** 147 * Returns the number of rows that match the dynamic query. 148 * 149 * @param dynamicQuery the dynamic query 150 * @return the number of rows that match the dynamic query 151 * @throws SystemException if a system exception occurred 152 */ 153 public long dynamicQueryCount( 154 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 155 throws com.liferay.portal.kernel.exception.SystemException { 156 return _roleLocalService.dynamicQueryCount(dynamicQuery); 157 } 158 159 public com.liferay.portal.model.Role fetchRole(long roleId) 160 throws com.liferay.portal.kernel.exception.SystemException { 161 return _roleLocalService.fetchRole(roleId); 162 } 163 164 /** 165 * Returns the role with the primary key. 166 * 167 * @param roleId the primary key of the role 168 * @return the role 169 * @throws PortalException if a role with the primary key could not be found 170 * @throws SystemException if a system exception occurred 171 */ 172 public com.liferay.portal.model.Role getRole(long roleId) 173 throws com.liferay.portal.kernel.exception.PortalException, 174 com.liferay.portal.kernel.exception.SystemException { 175 return _roleLocalService.getRole(roleId); 176 } 177 178 public com.liferay.portal.model.PersistedModel getPersistedModel( 179 java.io.Serializable primaryKeyObj) 180 throws com.liferay.portal.kernel.exception.PortalException, 181 com.liferay.portal.kernel.exception.SystemException { 182 return _roleLocalService.getPersistedModel(primaryKeyObj); 183 } 184 185 /** 186 * Returns a range of all the roles. 187 * 188 * <p> 189 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RoleModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 190 * </p> 191 * 192 * @param start the lower bound of the range of roles 193 * @param end the upper bound of the range of roles (not inclusive) 194 * @return the range of roles 195 * @throws SystemException if a system exception occurred 196 */ 197 public java.util.List<com.liferay.portal.model.Role> getRoles(int start, 198 int end) throws com.liferay.portal.kernel.exception.SystemException { 199 return _roleLocalService.getRoles(start, end); 200 } 201 202 /** 203 * Returns the number of roles. 204 * 205 * @return the number of roles 206 * @throws SystemException if a system exception occurred 207 */ 208 public int getRolesCount() 209 throws com.liferay.portal.kernel.exception.SystemException { 210 return _roleLocalService.getRolesCount(); 211 } 212 213 /** 214 * Updates the role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 215 * 216 * @param role the role 217 * @return the role that was updated 218 * @throws SystemException if a system exception occurred 219 */ 220 public com.liferay.portal.model.Role updateRole( 221 com.liferay.portal.model.Role role) 222 throws com.liferay.portal.kernel.exception.SystemException { 223 return _roleLocalService.updateRole(role); 224 } 225 226 /** 227 * Returns the Spring bean ID for this bean. 228 * 229 * @return the Spring bean ID for this bean 230 */ 231 public java.lang.String getBeanIdentifier() { 232 return _roleLocalService.getBeanIdentifier(); 233 } 234 235 /** 236 * Sets the Spring bean ID for this bean. 237 * 238 * @param beanIdentifier the Spring bean ID for this bean 239 */ 240 public void setBeanIdentifier(java.lang.String beanIdentifier) { 241 _roleLocalService.setBeanIdentifier(beanIdentifier); 242 } 243 244 /** 245 * Adds a role. The user is reindexed after role is added. 246 * 247 * @param userId the primary key of the user 248 * @param companyId the primary key of the company 249 * @param name the role's name 250 * @param titleMap the role's localized titles (optionally 251 <code>null</code>) 252 * @param descriptionMap the role's localized descriptions (optionally 253 <code>null</code>) 254 * @param type the role's type (optionally <code>0</code>) 255 * @return the role 256 * @throws PortalException if the class name or the role name were 257 invalid, if the role is a duplicate, or if a user with the 258 primary key could not be found 259 * @throws SystemException if a system exception occurred 260 * @deprecated {@link #addRole(long, String, long, String, Map, Map, int, 261 String, ServiceContext)} 262 */ 263 public com.liferay.portal.model.Role addRole(long userId, long companyId, 264 java.lang.String name, 265 java.util.Map<java.util.Locale, java.lang.String> titleMap, 266 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 267 int type) 268 throws com.liferay.portal.kernel.exception.PortalException, 269 com.liferay.portal.kernel.exception.SystemException { 270 return _roleLocalService.addRole(userId, companyId, name, titleMap, 271 descriptionMap, type); 272 } 273 274 /** 275 * Adds a role with additional parameters. The user is reindexed after role 276 * is added. 277 * 278 * @param userId the primary key of the user 279 * @param companyId the primary key of the company 280 * @param name the role's name 281 * @param titleMap the role's localized titles (optionally 282 <code>null</code>) 283 * @param descriptionMap the role's localized descriptions (optionally 284 <code>null</code>) 285 * @param type the role's type (optionally <code>0</code>) 286 * @param className the name of the class for which the role is created 287 (optionally <code>null</code>) 288 * @param classPK the primary key of the class for which the role is 289 created (optionally <code>0</code>) 290 * @return the role 291 * @throws PortalException if the class name or the role name were 292 invalid, if the role is a duplicate, or if a user with the 293 primary key could not be found 294 * @throws SystemException if a system exception occurred 295 * @deprecated {@link #addRole(long, String, long, String, Map, Map, int, 296 String, ServiceContext)} 297 */ 298 public com.liferay.portal.model.Role addRole(long userId, long companyId, 299 java.lang.String name, 300 java.util.Map<java.util.Locale, java.lang.String> titleMap, 301 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 302 int type, java.lang.String className, long classPK) 303 throws com.liferay.portal.kernel.exception.PortalException, 304 com.liferay.portal.kernel.exception.SystemException { 305 return _roleLocalService.addRole(userId, companyId, name, titleMap, 306 descriptionMap, type, className, classPK); 307 } 308 309 /** 310 * Adds a role with additional parameters. The user is reindexed after role 311 * is added. 312 * 313 * @param userId the primary key of the user 314 * @param className the name of the class for which the role is created 315 (optionally <code>null</code>) 316 * @param classPK the primary key of the class for which the role is 317 created (optionally <code>0</code>) 318 * @param name the role's name 319 * @param titleMap the role's localized titles (optionally 320 <code>null</code>) 321 * @param descriptionMap the role's localized descriptions (optionally 322 <code>null</code>) 323 * @param type the role's type (optionally <code>0</code>) 324 * @param subType the role's subtype (optionally <code>null</code>) 325 * @param serviceContext the roles's service context (optionally 326 <code>null</code>). Can set expando bridge attributes for the 327 role. 328 * @return the role 329 * @throws PortalException if the class name or the role name were invalid, 330 if the role is a duplicate, or if a user with the primary key 331 could not be found 332 * @throws SystemException if a system exception occurred 333 */ 334 public com.liferay.portal.model.Role addRole(long userId, 335 java.lang.String className, long classPK, java.lang.String name, 336 java.util.Map<java.util.Locale, java.lang.String> titleMap, 337 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 338 int type, java.lang.String subType, 339 com.liferay.portal.service.ServiceContext serviceContext) 340 throws com.liferay.portal.kernel.exception.PortalException, 341 com.liferay.portal.kernel.exception.SystemException { 342 return _roleLocalService.addRole(userId, className, classPK, name, 343 titleMap, descriptionMap, type, subType, serviceContext); 344 } 345 346 /** 347 * Adds the roles to the user. The user is reindexed after the roles are 348 * added. 349 * 350 * @param userId the primary key of the user 351 * @param roleIds the primary keys of the roles 352 * @throws PortalException if a user with the primary key could not be found 353 * @throws SystemException if a system exception occurred 354 * @see com.liferay.portal.service.persistence.UserPersistence#addRoles( 355 long, long[]) 356 */ 357 public void addUserRoles(long userId, long[] roleIds) 358 throws com.liferay.portal.kernel.exception.PortalException, 359 com.liferay.portal.kernel.exception.SystemException { 360 _roleLocalService.addUserRoles(userId, roleIds); 361 } 362 363 public void checkMembershipPolicy(com.liferay.portal.model.User user) 364 throws com.liferay.portal.kernel.exception.PortalException, 365 com.liferay.portal.kernel.exception.SystemException { 366 _roleLocalService.checkMembershipPolicy(user); 367 } 368 369 /** 370 * Checks to ensure that the system roles map has appropriate default roles 371 * in each company. 372 * 373 * @throws PortalException if the current user did not have permission to 374 set applicable permissions on a role 375 * @throws SystemException if a system exception occurred 376 */ 377 public void checkSystemRoles() 378 throws com.liferay.portal.kernel.exception.PortalException, 379 com.liferay.portal.kernel.exception.SystemException { 380 _roleLocalService.checkSystemRoles(); 381 } 382 383 /** 384 * Checks to ensure that the system roles map has appropriate default roles 385 * in the company. 386 * 387 * @param companyId the primary key of the company 388 * @throws PortalException if the current user did not have permission to 389 set applicable permissions on a role 390 * @throws SystemException if a system exception occurred 391 */ 392 public void checkSystemRoles(long companyId) 393 throws com.liferay.portal.kernel.exception.PortalException, 394 com.liferay.portal.kernel.exception.SystemException { 395 _roleLocalService.checkSystemRoles(companyId); 396 } 397 398 /** 399 * Returns the role with the name in the company. 400 * 401 * <p> 402 * The method searches the system roles map first for default roles. If a 403 * role with the name is not found, then the method will query the database. 404 * </p> 405 * 406 * @param companyId the primary key of the company 407 * @param name the role's name 408 * @return Returns the role with the name or <code>null</code> if a role 409 with the name could not be found in the company 410 * @throws SystemException if a system exception occurred 411 */ 412 public com.liferay.portal.model.Role fetchRole(long companyId, 413 java.lang.String name) 414 throws com.liferay.portal.kernel.exception.SystemException { 415 return _roleLocalService.fetchRole(companyId, name); 416 } 417 418 /** 419 * Returns the default role for the group with the primary key. 420 * 421 * <p> 422 * If the group is a site, then the default role is {@link 423 * com.liferay.portal.model.RoleConstants#SITE_MEMBER}. If the group is an 424 * organization, then the default role is {@link 425 * com.liferay.portal.model.RoleConstants#ORGANIZATION_USER}. If the group 426 * is a user or user group, then the default role is {@link 427 * com.liferay.portal.model.RoleConstants#POWER_USER}. For all other group 428 * types, the default role is {@link 429 * com.liferay.portal.model.RoleConstants#USER}. 430 * </p> 431 * 432 * @param groupId the primary key of the group 433 * @return the default role for the group with the primary key 434 * @throws PortalException if a group with the primary key could not be 435 found, or if a default role could not be found for the group 436 * @throws SystemException if a system exception occurred 437 */ 438 public com.liferay.portal.model.Role getDefaultGroupRole(long groupId) 439 throws com.liferay.portal.kernel.exception.PortalException, 440 com.liferay.portal.kernel.exception.SystemException { 441 return _roleLocalService.getDefaultGroupRole(groupId); 442 } 443 444 /** 445 * Returns all the roles associated with the group. 446 * 447 * @param groupId the primary key of the group 448 * @return the roles associated with the group 449 * @throws SystemException if a system exception occurred 450 */ 451 public java.util.List<com.liferay.portal.model.Role> getGroupRoles( 452 long groupId) 453 throws com.liferay.portal.kernel.exception.SystemException { 454 return _roleLocalService.getGroupRoles(groupId); 455 } 456 457 public java.util.List<com.liferay.portal.model.Role> getResourceBlockRoles( 458 long resourceBlockId, java.lang.String className, 459 java.lang.String actionId) 460 throws com.liferay.portal.kernel.exception.SystemException { 461 return _roleLocalService.getResourceBlockRoles(resourceBlockId, 462 className, actionId); 463 } 464 465 /** 466 * Returns a map of role names to associated action IDs for the named 467 * resource in the company within the permission scope. 468 * 469 * @param companyId the primary key of the company 470 * @param name the resource name 471 * @param scope the permission scope 472 * @param primKey the primary key of the resource's class 473 * @return the role names and action IDs 474 * @throws SystemException if a system exception occurred 475 * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P( 476 long, String, int, String) 477 */ 478 public java.util.Map<java.lang.String, java.util.List<java.lang.String>> getResourceRoles( 479 long companyId, java.lang.String name, int scope, 480 java.lang.String primKey) 481 throws com.liferay.portal.kernel.exception.SystemException { 482 return _roleLocalService.getResourceRoles(companyId, name, scope, 483 primKey); 484 } 485 486 /** 487 * Returns all the roles associated with the action ID in the company within 488 * the permission scope. 489 * 490 * @param companyId the primary key of the company 491 * @param name the resource name 492 * @param scope the permission scope 493 * @param primKey the primary key of the resource's class 494 * @param actionId the name of the resource action 495 * @return the roles 496 * @throws SystemException if a system exception occurred 497 * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P_A( 498 long, String, int, String, String) 499 */ 500 public java.util.List<com.liferay.portal.model.Role> getResourceRoles( 501 long companyId, java.lang.String name, int scope, 502 java.lang.String primKey, java.lang.String actionId) 503 throws com.liferay.portal.kernel.exception.SystemException { 504 return _roleLocalService.getResourceRoles(companyId, name, scope, 505 primKey, actionId); 506 } 507 508 /** 509 * Returns the role with the name in the company. 510 * 511 * <p> 512 * The method searches the system roles map first for default roles. If a 513 * role with the name is not found, then the method will query the database. 514 * </p> 515 * 516 * @param companyId the primary key of the company 517 * @param name the role's name 518 * @return the role with the name 519 * @throws PortalException if a role with the name could not be found in the 520 company 521 * @throws SystemException if a system exception occurred 522 */ 523 public com.liferay.portal.model.Role getRole(long companyId, 524 java.lang.String name) 525 throws com.liferay.portal.kernel.exception.PortalException, 526 com.liferay.portal.kernel.exception.SystemException { 527 return _roleLocalService.getRole(companyId, name); 528 } 529 530 /** 531 * Returns all the roles of the type and subtype. 532 * 533 * @param type the role's type (optionally <code>0</code>) 534 * @param subtype the role's subtype (optionally <code>null</code>) 535 * @return the roles of the type and subtype 536 * @throws SystemException if a system exception occurred 537 */ 538 public java.util.List<com.liferay.portal.model.Role> getRoles(int type, 539 java.lang.String subtype) 540 throws com.liferay.portal.kernel.exception.SystemException { 541 return _roleLocalService.getRoles(type, subtype); 542 } 543 544 /** 545 * Returns all the roles in the company. 546 * 547 * @param companyId the primary key of the company 548 * @return the roles in the company 549 * @throws SystemException if a system exception occurred 550 */ 551 public java.util.List<com.liferay.portal.model.Role> getRoles( 552 long companyId) 553 throws com.liferay.portal.kernel.exception.SystemException { 554 return _roleLocalService.getRoles(companyId); 555 } 556 557 /** 558 * Returns all the roles with the primary keys. 559 * 560 * @param roleIds the primary keys of the roles 561 * @return the roles with the primary keys 562 * @throws PortalException if any one of the roles with the primary keys 563 could not be found 564 * @throws SystemException if a system exception occurred 565 */ 566 public java.util.List<com.liferay.portal.model.Role> getRoles( 567 long[] roleIds) 568 throws com.liferay.portal.kernel.exception.PortalException, 569 com.liferay.portal.kernel.exception.SystemException { 570 return _roleLocalService.getRoles(roleIds); 571 } 572 573 /** 574 * Returns all the roles of the subtype. 575 * 576 * @param subtype the role's subtype (optionally <code>null</code>) 577 * @return the roles of the subtype 578 * @throws SystemException if a system exception occurred 579 */ 580 public java.util.List<com.liferay.portal.model.Role> getSubtypeRoles( 581 java.lang.String subtype) 582 throws com.liferay.portal.kernel.exception.SystemException { 583 return _roleLocalService.getSubtypeRoles(subtype); 584 } 585 586 /** 587 * Returns the number of roles of the subtype. 588 * 589 * @param subtype the role's subtype (optionally <code>null</code>) 590 * @return the number of roles of the subtype 591 * @throws SystemException if a system exception occurred 592 */ 593 public int getSubtypeRolesCount(java.lang.String subtype) 594 throws com.liferay.portal.kernel.exception.SystemException { 595 return _roleLocalService.getSubtypeRolesCount(subtype); 596 } 597 598 /** 599 * Returns the team role in the company. 600 * 601 * @param companyId the primary key of the company 602 * @param teamId the primary key of the team 603 * @return the team role in the company 604 * @throws PortalException if a role could not be found in the team and 605 company 606 * @throws SystemException if a system exception occurred 607 */ 608 public com.liferay.portal.model.Role getTeamRole(long companyId, long teamId) 609 throws com.liferay.portal.kernel.exception.PortalException, 610 com.liferay.portal.kernel.exception.SystemException { 611 return _roleLocalService.getTeamRole(companyId, teamId); 612 } 613 614 /** 615 * Returns all the user's roles within the user group. 616 * 617 * @param userId the primary key of the user 618 * @param groupId the primary key of the group 619 * @return the user's roles within the user group 620 * @throws SystemException if a system exception occurred 621 * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupGroupRole( 622 long, long) 623 */ 624 public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles( 625 long userId, long groupId) 626 throws com.liferay.portal.kernel.exception.SystemException { 627 return _roleLocalService.getUserGroupGroupRoles(userId, groupId); 628 } 629 630 /** 631 * Returns all the user's roles within the user group. 632 * 633 * @param userId the primary key of the user 634 * @param groupId the primary key of the group 635 * @return the user's roles within the user group 636 * @throws SystemException if a system exception occurred 637 * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupRole( 638 long, long) 639 */ 640 public java.util.List<com.liferay.portal.model.Role> getUserGroupRoles( 641 long userId, long groupId) 642 throws com.liferay.portal.kernel.exception.SystemException { 643 return _roleLocalService.getUserGroupRoles(userId, groupId); 644 } 645 646 /** 647 * Returns the union of all the user's roles within the groups. 648 * 649 * @param userId the primary key of the user 650 * @param groups the groups (optionally <code>null</code>) 651 * @return the union of all the user's roles within the groups 652 * @throws SystemException if a system exception occurred 653 * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G( 654 long, List) 655 */ 656 public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 657 long userId, java.util.List<com.liferay.portal.model.Group> groups) 658 throws com.liferay.portal.kernel.exception.SystemException { 659 return _roleLocalService.getUserRelatedRoles(userId, groups); 660 } 661 662 /** 663 * Returns all the user's roles within the group. 664 * 665 * @param userId the primary key of the user 666 * @param groupId the primary key of the group 667 * @return the user's roles within the group 668 * @throws SystemException if a system exception occurred 669 * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G( 670 long, long) 671 */ 672 public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 673 long userId, long groupId) 674 throws com.liferay.portal.kernel.exception.SystemException { 675 return _roleLocalService.getUserRelatedRoles(userId, groupId); 676 } 677 678 /** 679 * Returns the union of all the user's roles within the groups. 680 * 681 * @param userId the primary key of the user 682 * @param groupIds the primary keys of the groups 683 * @return the union of all the user's roles within the groups 684 * @throws SystemException if a system exception occurred 685 * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G( 686 long, long[]) 687 */ 688 public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 689 long userId, long[] groupIds) 690 throws com.liferay.portal.kernel.exception.SystemException { 691 return _roleLocalService.getUserRelatedRoles(userId, groupIds); 692 } 693 694 /** 695 * Returns all the roles associated with the user. 696 * 697 * @param userId the primary key of the user 698 * @return the roles associated with the user 699 * @throws SystemException if a system exception occurred 700 */ 701 public java.util.List<com.liferay.portal.model.Role> getUserRoles( 702 long userId) throws com.liferay.portal.kernel.exception.SystemException { 703 return _roleLocalService.getUserRoles(userId); 704 } 705 706 /** 707 * Returns <code>true</code> if the user is associated with the role. 708 * 709 * @param userId the primary key of the user 710 * @param roleId the primary key of the role 711 * @return <code>true</code> if the user is associated with the role; 712 <code>false</code> otherwise 713 * @throws SystemException if a system exception occurred 714 */ 715 public boolean hasUserRole(long userId, long roleId) 716 throws com.liferay.portal.kernel.exception.SystemException { 717 return _roleLocalService.hasUserRole(userId, roleId); 718 } 719 720 /** 721 * Returns <code>true</code> if the user is associated with the named 722 * regular role. 723 * 724 * @param userId the primary key of the user 725 * @param companyId the primary key of the company 726 * @param name the name of the role 727 * @param inherited whether to include the user's inherited roles in the 728 search 729 * @return <code>true</code> if the user is associated with the regular 730 role; <code>false</code> otherwise 731 * @throws PortalException if a role with the name could not be found in the 732 company or if a default user for the company could not be found 733 * @throws SystemException if a system exception occurred 734 */ 735 public boolean hasUserRole(long userId, long companyId, 736 java.lang.String name, boolean inherited) 737 throws com.liferay.portal.kernel.exception.PortalException, 738 com.liferay.portal.kernel.exception.SystemException { 739 return _roleLocalService.hasUserRole(userId, companyId, name, inherited); 740 } 741 742 /** 743 * Returns <code>true</code> if the user has any one of the named regular 744 * roles. 745 * 746 * @param userId the primary key of the user 747 * @param companyId the primary key of the company 748 * @param names the names of the roles 749 * @param inherited whether to include the user's inherited roles in the 750 search 751 * @return <code>true</code> if the user has any one of the regular roles; 752 <code>false</code> otherwise 753 * @throws PortalException if any one of the roles with the names could not 754 be found in the company or if the default user for the company 755 could not be found 756 * @throws SystemException if a system exception occurred 757 */ 758 public boolean hasUserRoles(long userId, long companyId, 759 java.lang.String[] names, boolean inherited) 760 throws com.liferay.portal.kernel.exception.PortalException, 761 com.liferay.portal.kernel.exception.SystemException { 762 return _roleLocalService.hasUserRoles(userId, companyId, names, 763 inherited); 764 } 765 766 /** 767 * Returns a role with the name in the company. 768 * 769 * @param companyId the primary key of the company 770 * @param name the role's name (optionally <code>null</code>) 771 * @return the role with the name, or <code>null</code> if a role with the 772 name could not be found in the company 773 * @throws SystemException if a system exception occurred 774 */ 775 public com.liferay.portal.model.Role loadFetchRole(long companyId, 776 java.lang.String name) 777 throws com.liferay.portal.kernel.exception.SystemException { 778 return _roleLocalService.loadFetchRole(companyId, name); 779 } 780 781 /** 782 * Returns a role with the name in the company. 783 * 784 * @param companyId the primary key of the company 785 * @param name the role's name 786 * @return the role with the name in the company 787 * @throws PortalException if a role with the name could not be found in the 788 company 789 * @throws SystemException if a system exception occurred 790 */ 791 public com.liferay.portal.model.Role loadGetRole(long companyId, 792 java.lang.String name) 793 throws com.liferay.portal.kernel.exception.PortalException, 794 com.liferay.portal.kernel.exception.SystemException { 795 return _roleLocalService.loadGetRole(companyId, name); 796 } 797 798 /** 799 * Returns an ordered range of all the roles that match the keywords and 800 * types. 801 * 802 * <p> 803 * Useful when paginating results. Returns a maximum of <code>end - 804 * start</code> instances. <code>start</code> and <code>end</code> are not 805 * primary keys, they are indexes in the result set. Thus, <code>0</code> 806 * refers to the first result in the set. Setting both <code>start</code> 807 * and <code>end</code> to {@link 808 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 809 * result set. 810 * </p> 811 * 812 * @param companyId the primary key of the company 813 * @param keywords the keywords (space separated), which may occur in the 814 role's name or description (optionally <code>null</code>) 815 * @param types the role types (optionally <code>null</code>) 816 * @param start the lower bound of the range of roles to return 817 * @param end the upper bound of the range of roles to return (not 818 inclusive) 819 * @param obc the comparator to order the roles (optionally 820 <code>null</code>) 821 * @return the ordered range of the matching roles, ordered by 822 <code>obc</code> 823 * @throws SystemException if a system exception occurred 824 * @see com.liferay.portal.service.persistence.RoleFinder 825 */ 826 public java.util.List<com.liferay.portal.model.Role> search( 827 long companyId, java.lang.String keywords, java.lang.Integer[] types, 828 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 829 throws com.liferay.portal.kernel.exception.SystemException { 830 return _roleLocalService.search(companyId, keywords, types, start, end, 831 obc); 832 } 833 834 /** 835 * Returns an ordered range of all the roles that match the keywords, types, 836 * and params. 837 * 838 * <p> 839 * Useful when paginating results. Returns a maximum of <code>end - 840 * start</code> instances. <code>start</code> and <code>end</code> are not 841 * primary keys, they are indexes in the result set. Thus, <code>0</code> 842 * refers to the first result in the set. Setting both <code>start</code> 843 * and <code>end</code> to {@link 844 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 845 * result set. 846 * </p> 847 * 848 * @param companyId the primary key of the company 849 * @param keywords the keywords (space separated), which may occur in the 850 role's name or description (optionally <code>null</code>) 851 * @param types the role types (optionally <code>null</code>) 852 * @param params the finder parameters. Can specify values for the 853 "usersRoles" key. For more information, see {@link 854 com.liferay.portal.service.persistence.RoleFinder} 855 * @param start the lower bound of the range of roles to return 856 * @param end the upper bound of the range of roles to return (not 857 inclusive) 858 * @param obc the comparator to order the roles (optionally 859 <code>null</code>) 860 * @return the ordered range of the matching roles, ordered by 861 <code>obc</code> 862 * @throws SystemException if a system exception occurred 863 * @see com.liferay.portal.service.persistence.RoleFinder 864 */ 865 public java.util.List<com.liferay.portal.model.Role> search( 866 long companyId, java.lang.String keywords, java.lang.Integer[] types, 867 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 868 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 869 throws com.liferay.portal.kernel.exception.SystemException { 870 return _roleLocalService.search(companyId, keywords, types, params, 871 start, end, obc); 872 } 873 874 /** 875 * Returns an ordered range of all the roles that match the name, 876 * description, and types. 877 * 878 * <p> 879 * Useful when paginating results. Returns a maximum of <code>end - 880 * start</code> instances. <code>start</code> and <code>end</code> are not 881 * primary keys, they are indexes in the result set. Thus, <code>0</code> 882 * refers to the first result in the set. Setting both <code>start</code> 883 * and <code>end</code> to {@link 884 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 885 * result set. 886 * </p> 887 * 888 * @param companyId the primary key of the company 889 * @param name the role's name (optionally <code>null</code>) 890 * @param description the role's description (optionally <code>null</code>) 891 * @param types the role types (optionally <code>null</code>) 892 * @param start the lower bound of the range of the roles to return 893 * @param end the upper bound of the range of the roles to return (not 894 inclusive) 895 * @param obc the comparator to order the roles (optionally 896 <code>null</code>) 897 * @return the ordered range of the matching roles, ordered by 898 <code>obc</code> 899 * @throws SystemException if a system exception occurred 900 * @see com.liferay.portal.service.persistence.RoleFinder 901 */ 902 public java.util.List<com.liferay.portal.model.Role> search( 903 long companyId, java.lang.String name, java.lang.String description, 904 java.lang.Integer[] types, int start, int end, 905 com.liferay.portal.kernel.util.OrderByComparator obc) 906 throws com.liferay.portal.kernel.exception.SystemException { 907 return _roleLocalService.search(companyId, name, description, types, 908 start, end, obc); 909 } 910 911 /** 912 * Returns an ordered range of all the roles that match the name, 913 * description, types, and params. 914 * 915 * <p> 916 * Useful when paginating results. Returns a maximum of <code>end - 917 * start</code> instances. <code>start</code> and <code>end</code> are not 918 * primary keys, they are indexes in the result set. Thus, <code>0</code> 919 * refers to the first result in the set. Setting both <code>start</code> 920 * and <code>end</code> to {@link 921 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 922 * result set. 923 * </p> 924 * 925 * @param companyId the primary key of the company 926 * @param name the role's name (optionally <code>null</code>) 927 * @param description the role's description (optionally <code>null</code>) 928 * @param types the role types (optionally <code>null</code>) 929 * @param params the finder's parameters. Can specify values for the 930 "usersRoles" key. For more information, see {@link 931 com.liferay.portal.service.persistence.RoleFinder} 932 * @param start the lower bound of the range of the roles to return 933 * @param end the upper bound of the range of the roles to return (not 934 inclusive) 935 * @param obc the comparator to order the roles (optionally 936 <code>null</code>) 937 * @return the ordered range of the matching roles, ordered by 938 <code>obc</code> 939 * @throws SystemException if a system exception occurred 940 * @see com.liferay.portal.service.persistence.RoleFinder 941 */ 942 public java.util.List<com.liferay.portal.model.Role> search( 943 long companyId, java.lang.String name, java.lang.String description, 944 java.lang.Integer[] types, 945 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 946 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 947 throws com.liferay.portal.kernel.exception.SystemException { 948 return _roleLocalService.search(companyId, name, description, types, 949 params, start, end, obc); 950 } 951 952 /** 953 * Returns the number of roles that match the keywords and types. 954 * 955 * @param companyId the primary key of the company 956 * @param keywords the keywords (space separated), which may occur in the 957 role's name or description (optionally <code>null</code>) 958 * @param types the role types (optionally <code>null</code>) 959 * @return the number of matching roles 960 * @throws SystemException if a system exception occurred 961 */ 962 public int searchCount(long companyId, java.lang.String keywords, 963 java.lang.Integer[] types) 964 throws com.liferay.portal.kernel.exception.SystemException { 965 return _roleLocalService.searchCount(companyId, keywords, types); 966 } 967 968 /** 969 * Returns the number of roles that match the keywords, types and params. 970 * 971 * @param companyId the primary key of the company 972 * @param keywords the keywords (space separated), which may occur in the 973 role's name or description (optionally <code>null</code>) 974 * @param types the role types (optionally <code>null</code>) 975 * @param params the finder parameters. For more information, see {@link 976 com.liferay.portal.service.persistence.RoleFinder} 977 * @return the number of matching roles 978 * @throws SystemException if a system exception occurred 979 */ 980 public int searchCount(long companyId, java.lang.String keywords, 981 java.lang.Integer[] types, 982 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 983 throws com.liferay.portal.kernel.exception.SystemException { 984 return _roleLocalService.searchCount(companyId, keywords, types, params); 985 } 986 987 /** 988 * Returns the number of roles that match the name, description, and types. 989 * 990 * @param companyId the primary key of the company 991 * @param name the role's name (optionally <code>null</code>) 992 * @param description the role's description (optionally <code>null</code>) 993 * @param types the role types (optionally <code>null</code>) 994 * @return the number of matching roles 995 * @throws SystemException if a system exception occurred 996 */ 997 public int searchCount(long companyId, java.lang.String name, 998 java.lang.String description, java.lang.Integer[] types) 999 throws com.liferay.portal.kernel.exception.SystemException { 1000 return _roleLocalService.searchCount(companyId, name, description, types); 1001 } 1002 1003 /** 1004 * Returns the number of roles that match the name, description, types, and 1005 * params. 1006 * 1007 * @param companyId the primary key of the company 1008 * @param name the role's name (optionally <code>null</code>) 1009 * @param description the role's description (optionally <code>null</code>) 1010 * @param types the role types (optionally <code>null</code>) 1011 * @param params the finder parameters. Can specify values for the 1012 "usersRoles" key. For more information, see {@link 1013 com.liferay.portal.service.persistence.RoleFinder} 1014 * @return the number of matching roles 1015 * @throws SystemException if a system exception occurred 1016 */ 1017 public int searchCount(long companyId, java.lang.String name, 1018 java.lang.String description, java.lang.Integer[] types, 1019 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 1020 throws com.liferay.portal.kernel.exception.SystemException { 1021 return _roleLocalService.searchCount(companyId, name, description, 1022 types, params); 1023 } 1024 1025 /** 1026 * Sets the roles associated with the user, replacing the user's existing 1027 * roles. The user is reindexed after the roles are set. 1028 * 1029 * @param userId the primary key of the user 1030 * @param roleIds the primary keys of the roles 1031 * @throws PortalException if a user with the primary could not be found or 1032 if any one of the roles with the primary keys could not be found 1033 * @throws SystemException if a system exception occurred 1034 */ 1035 public void setUserRoles(long userId, long[] roleIds) 1036 throws com.liferay.portal.kernel.exception.PortalException, 1037 com.liferay.portal.kernel.exception.SystemException { 1038 _roleLocalService.setUserRoles(userId, roleIds); 1039 } 1040 1041 /** 1042 * Removes the matching roles associated with the user. The user is 1043 * reindexed after the roles are removed. 1044 * 1045 * @param userId the primary key of the user 1046 * @param roleIds the primary keys of the roles 1047 * @throws PortalException if a user with the primary key could not be found 1048 or if a role with any one of the primary keys could not be found 1049 * @throws SystemException if a system exception occurred 1050 */ 1051 public void unsetUserRoles(long userId, long[] roleIds) 1052 throws com.liferay.portal.kernel.exception.PortalException, 1053 com.liferay.portal.kernel.exception.SystemException { 1054 _roleLocalService.unsetUserRoles(userId, roleIds); 1055 } 1056 1057 /** 1058 * Updates the role with the primary key. 1059 * 1060 * @param roleId the primary key of the role 1061 * @param name the role's new name 1062 * @param titleMap the new localized titles (optionally <code>null</code>) 1063 to replace those existing for the role 1064 * @param descriptionMap the new localized descriptions (optionally 1065 <code>null</code>) to replace those existing for the role 1066 * @param subtype the role's new subtype (optionally <code>null</code>) 1067 * @param serviceContext the roles's service context (optionally 1068 <code>null</code>). Can set expando bridge attributes for the 1069 role. 1070 * @return the role with the primary key 1071 * @throws PortalException if a role with the primary could not be found or 1072 if the role's name was invalid 1073 * @throws SystemException if a system exception occurred 1074 */ 1075 public com.liferay.portal.model.Role updateRole(long roleId, 1076 java.lang.String name, 1077 java.util.Map<java.util.Locale, java.lang.String> titleMap, 1078 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 1079 java.lang.String subtype, 1080 com.liferay.portal.service.ServiceContext serviceContext) 1081 throws com.liferay.portal.kernel.exception.PortalException, 1082 com.liferay.portal.kernel.exception.SystemException { 1083 return _roleLocalService.updateRole(roleId, name, titleMap, 1084 descriptionMap, subtype, serviceContext); 1085 } 1086 1087 /** 1088 * @deprecated Renamed to {@link #getWrappedService} 1089 */ 1090 public RoleLocalService getWrappedRoleLocalService() { 1091 return _roleLocalService; 1092 } 1093 1094 /** 1095 * @deprecated Renamed to {@link #setWrappedService} 1096 */ 1097 public void setWrappedRoleLocalService(RoleLocalService roleLocalService) { 1098 _roleLocalService = roleLocalService; 1099 } 1100 1101 public RoleLocalService getWrappedService() { 1102 return _roleLocalService; 1103 } 1104 1105 public void setWrappedService(RoleLocalService roleLocalService) { 1106 _roleLocalService = roleLocalService; 1107 } 1108 1109 private RoleLocalService _roleLocalService; 1110 }