001 /** 002 * Copyright (c) 2000-2013 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 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.util.ReferenceRegistry; 019 020 /** 021 * The utility for the role local service. This utility wraps {@link com.liferay.portal.service.impl.RoleLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server. 022 * 023 * <p> 024 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM. 025 * </p> 026 * 027 * @author Brian Wing Shun Chan 028 * @see RoleLocalService 029 * @see com.liferay.portal.service.base.RoleLocalServiceBaseImpl 030 * @see com.liferay.portal.service.impl.RoleLocalServiceImpl 031 * @generated 032 */ 033 public class RoleLocalServiceUtil { 034 /* 035 * NOTE FOR DEVELOPERS: 036 * 037 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.RoleLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 038 */ 039 040 /** 041 * Adds the role to the database. Also notifies the appropriate model listeners. 042 * 043 * @param role the role 044 * @return the role that was added 045 * @throws SystemException if a system exception occurred 046 */ 047 public static com.liferay.portal.model.Role addRole( 048 com.liferay.portal.model.Role role) 049 throws com.liferay.portal.kernel.exception.SystemException { 050 return getService().addRole(role); 051 } 052 053 /** 054 * Creates a new role with the primary key. Does not add the role to the database. 055 * 056 * @param roleId the primary key for the new role 057 * @return the new role 058 */ 059 public static com.liferay.portal.model.Role createRole(long roleId) { 060 return getService().createRole(roleId); 061 } 062 063 /** 064 * Deletes the role with the primary key from the database. Also notifies the appropriate model listeners. 065 * 066 * @param roleId the primary key of the role 067 * @return the role that was removed 068 * @throws PortalException if a role with the primary key could not be found 069 * @throws SystemException if a system exception occurred 070 */ 071 public static com.liferay.portal.model.Role deleteRole(long roleId) 072 throws com.liferay.portal.kernel.exception.PortalException, 073 com.liferay.portal.kernel.exception.SystemException { 074 return getService().deleteRole(roleId); 075 } 076 077 /** 078 * Deletes the role from the database. Also notifies the appropriate model listeners. 079 * 080 * @param role the role 081 * @return the role that was removed 082 * @throws PortalException 083 * @throws SystemException if a system exception occurred 084 */ 085 public static com.liferay.portal.model.Role deleteRole( 086 com.liferay.portal.model.Role role) 087 throws com.liferay.portal.kernel.exception.PortalException, 088 com.liferay.portal.kernel.exception.SystemException { 089 return getService().deleteRole(role); 090 } 091 092 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 093 return getService().dynamicQuery(); 094 } 095 096 /** 097 * Performs a dynamic query on the database and returns the matching rows. 098 * 099 * @param dynamicQuery the dynamic query 100 * @return the matching rows 101 * @throws SystemException if a system exception occurred 102 */ 103 @SuppressWarnings("rawtypes") 104 public static java.util.List dynamicQuery( 105 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 106 throws com.liferay.portal.kernel.exception.SystemException { 107 return getService().dynamicQuery(dynamicQuery); 108 } 109 110 /** 111 * Performs a dynamic query on the database and returns a range of the matching rows. 112 * 113 * <p> 114 * 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. 115 * </p> 116 * 117 * @param dynamicQuery the dynamic query 118 * @param start the lower bound of the range of model instances 119 * @param end the upper bound of the range of model instances (not inclusive) 120 * @return the range of matching rows 121 * @throws SystemException if a system exception occurred 122 */ 123 @SuppressWarnings("rawtypes") 124 public static java.util.List dynamicQuery( 125 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 126 int end) throws com.liferay.portal.kernel.exception.SystemException { 127 return getService().dynamicQuery(dynamicQuery, start, end); 128 } 129 130 /** 131 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 132 * 133 * <p> 134 * 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. 135 * </p> 136 * 137 * @param dynamicQuery the dynamic query 138 * @param start the lower bound of the range of model instances 139 * @param end the upper bound of the range of model instances (not inclusive) 140 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 141 * @return the ordered range of matching rows 142 * @throws SystemException if a system exception occurred 143 */ 144 @SuppressWarnings("rawtypes") 145 public static java.util.List dynamicQuery( 146 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 147 int end, 148 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 149 throws com.liferay.portal.kernel.exception.SystemException { 150 return getService() 151 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 152 } 153 154 /** 155 * Returns the number of rows that match the dynamic query. 156 * 157 * @param dynamicQuery the dynamic query 158 * @return the number of rows that match the dynamic query 159 * @throws SystemException if a system exception occurred 160 */ 161 public static long dynamicQueryCount( 162 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 163 throws com.liferay.portal.kernel.exception.SystemException { 164 return getService().dynamicQueryCount(dynamicQuery); 165 } 166 167 public static com.liferay.portal.model.Role fetchRole(long roleId) 168 throws com.liferay.portal.kernel.exception.SystemException { 169 return getService().fetchRole(roleId); 170 } 171 172 /** 173 * Returns the role with the primary key. 174 * 175 * @param roleId the primary key of the role 176 * @return the role 177 * @throws PortalException if a role with the primary key could not be found 178 * @throws SystemException if a system exception occurred 179 */ 180 public static com.liferay.portal.model.Role getRole(long roleId) 181 throws com.liferay.portal.kernel.exception.PortalException, 182 com.liferay.portal.kernel.exception.SystemException { 183 return getService().getRole(roleId); 184 } 185 186 public static com.liferay.portal.model.PersistedModel getPersistedModel( 187 java.io.Serializable primaryKeyObj) 188 throws com.liferay.portal.kernel.exception.PortalException, 189 com.liferay.portal.kernel.exception.SystemException { 190 return getService().getPersistedModel(primaryKeyObj); 191 } 192 193 /** 194 * Returns a range of all the roles. 195 * 196 * <p> 197 * 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. 198 * </p> 199 * 200 * @param start the lower bound of the range of roles 201 * @param end the upper bound of the range of roles (not inclusive) 202 * @return the range of roles 203 * @throws SystemException if a system exception occurred 204 */ 205 public static java.util.List<com.liferay.portal.model.Role> getRoles( 206 int start, int end) 207 throws com.liferay.portal.kernel.exception.SystemException { 208 return getService().getRoles(start, end); 209 } 210 211 /** 212 * Returns the number of roles. 213 * 214 * @return the number of roles 215 * @throws SystemException if a system exception occurred 216 */ 217 public static int getRolesCount() 218 throws com.liferay.portal.kernel.exception.SystemException { 219 return getService().getRolesCount(); 220 } 221 222 /** 223 * Updates the role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 224 * 225 * @param role the role 226 * @return the role that was updated 227 * @throws SystemException if a system exception occurred 228 */ 229 public static com.liferay.portal.model.Role updateRole( 230 com.liferay.portal.model.Role role) 231 throws com.liferay.portal.kernel.exception.SystemException { 232 return getService().updateRole(role); 233 } 234 235 /** 236 * Updates the role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 237 * 238 * @param role the role 239 * @param merge whether to merge the role with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation. 240 * @return the role that was updated 241 * @throws SystemException if a system exception occurred 242 */ 243 public static com.liferay.portal.model.Role updateRole( 244 com.liferay.portal.model.Role role, boolean merge) 245 throws com.liferay.portal.kernel.exception.SystemException { 246 return getService().updateRole(role, merge); 247 } 248 249 /** 250 * @throws SystemException if a system exception occurred 251 */ 252 public static void addGroupRole(long groupId, long roleId) 253 throws com.liferay.portal.kernel.exception.SystemException { 254 getService().addGroupRole(groupId, roleId); 255 } 256 257 /** 258 * @throws SystemException if a system exception occurred 259 */ 260 public static void addGroupRole(long groupId, 261 com.liferay.portal.model.Role role) 262 throws com.liferay.portal.kernel.exception.SystemException { 263 getService().addGroupRole(groupId, role); 264 } 265 266 /** 267 * @throws SystemException if a system exception occurred 268 */ 269 public static void addGroupRoles(long groupId, long[] roleIds) 270 throws com.liferay.portal.kernel.exception.SystemException { 271 getService().addGroupRoles(groupId, roleIds); 272 } 273 274 /** 275 * @throws SystemException if a system exception occurred 276 */ 277 public static void addGroupRoles(long groupId, 278 java.util.List<com.liferay.portal.model.Role> Roles) 279 throws com.liferay.portal.kernel.exception.SystemException { 280 getService().addGroupRoles(groupId, Roles); 281 } 282 283 /** 284 * @throws SystemException if a system exception occurred 285 */ 286 public static void clearGroupRoles(long groupId) 287 throws com.liferay.portal.kernel.exception.SystemException { 288 getService().clearGroupRoles(groupId); 289 } 290 291 /** 292 * @throws SystemException if a system exception occurred 293 */ 294 public static void deleteGroupRole(long groupId, long roleId) 295 throws com.liferay.portal.kernel.exception.SystemException { 296 getService().deleteGroupRole(groupId, roleId); 297 } 298 299 /** 300 * @throws SystemException if a system exception occurred 301 */ 302 public static void deleteGroupRole(long groupId, 303 com.liferay.portal.model.Role role) 304 throws com.liferay.portal.kernel.exception.SystemException { 305 getService().deleteGroupRole(groupId, role); 306 } 307 308 /** 309 * @throws SystemException if a system exception occurred 310 */ 311 public static void deleteGroupRoles(long groupId, long[] roleIds) 312 throws com.liferay.portal.kernel.exception.SystemException { 313 getService().deleteGroupRoles(groupId, roleIds); 314 } 315 316 /** 317 * @throws SystemException if a system exception occurred 318 */ 319 public static void deleteGroupRoles(long groupId, 320 java.util.List<com.liferay.portal.model.Role> Roles) 321 throws com.liferay.portal.kernel.exception.SystemException { 322 getService().deleteGroupRoles(groupId, Roles); 323 } 324 325 /** 326 * @throws SystemException if a system exception occurred 327 */ 328 public static java.util.List<com.liferay.portal.model.Role> getGroupRoles( 329 long groupId) 330 throws com.liferay.portal.kernel.exception.SystemException { 331 return getService().getGroupRoles(groupId); 332 } 333 334 /** 335 * @throws SystemException if a system exception occurred 336 */ 337 public static java.util.List<com.liferay.portal.model.Role> getGroupRoles( 338 long groupId, int start, int end) 339 throws com.liferay.portal.kernel.exception.SystemException { 340 return getService().getGroupRoles(groupId, start, end); 341 } 342 343 /** 344 * @throws SystemException if a system exception occurred 345 */ 346 public static java.util.List<com.liferay.portal.model.Role> getGroupRoles( 347 long groupId, int start, int end, 348 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 349 throws com.liferay.portal.kernel.exception.SystemException { 350 return getService().getGroupRoles(groupId, start, end, orderByComparator); 351 } 352 353 /** 354 * @throws SystemException if a system exception occurred 355 */ 356 public static int getGroupRolesCount(long groupId) 357 throws com.liferay.portal.kernel.exception.SystemException { 358 return getService().getGroupRolesCount(groupId); 359 } 360 361 /** 362 * @throws SystemException if a system exception occurred 363 */ 364 public static boolean hasGroupRole(long groupId, long roleId) 365 throws com.liferay.portal.kernel.exception.SystemException { 366 return getService().hasGroupRole(groupId, roleId); 367 } 368 369 /** 370 * @throws SystemException if a system exception occurred 371 */ 372 public static boolean hasGroupRoles(long groupId) 373 throws com.liferay.portal.kernel.exception.SystemException { 374 return getService().hasGroupRoles(groupId); 375 } 376 377 /** 378 * @throws SystemException if a system exception occurred 379 */ 380 public static void setGroupRoles(long groupId, long[] roleIds) 381 throws com.liferay.portal.kernel.exception.SystemException { 382 getService().setGroupRoles(groupId, roleIds); 383 } 384 385 /** 386 * @throws SystemException if a system exception occurred 387 */ 388 public static void addPermissionRole(long permissionId, long roleId) 389 throws com.liferay.portal.kernel.exception.SystemException { 390 getService().addPermissionRole(permissionId, roleId); 391 } 392 393 /** 394 * @throws SystemException if a system exception occurred 395 */ 396 public static void addPermissionRole(long permissionId, 397 com.liferay.portal.model.Role role) 398 throws com.liferay.portal.kernel.exception.SystemException { 399 getService().addPermissionRole(permissionId, role); 400 } 401 402 /** 403 * @throws SystemException if a system exception occurred 404 */ 405 public static void addPermissionRoles(long permissionId, long[] roleIds) 406 throws com.liferay.portal.kernel.exception.SystemException { 407 getService().addPermissionRoles(permissionId, roleIds); 408 } 409 410 /** 411 * @throws SystemException if a system exception occurred 412 */ 413 public static void addPermissionRoles(long permissionId, 414 java.util.List<com.liferay.portal.model.Role> Roles) 415 throws com.liferay.portal.kernel.exception.SystemException { 416 getService().addPermissionRoles(permissionId, Roles); 417 } 418 419 /** 420 * @throws SystemException if a system exception occurred 421 */ 422 public static void clearPermissionRoles(long permissionId) 423 throws com.liferay.portal.kernel.exception.SystemException { 424 getService().clearPermissionRoles(permissionId); 425 } 426 427 /** 428 * @throws SystemException if a system exception occurred 429 */ 430 public static void deletePermissionRole(long permissionId, long roleId) 431 throws com.liferay.portal.kernel.exception.SystemException { 432 getService().deletePermissionRole(permissionId, roleId); 433 } 434 435 /** 436 * @throws SystemException if a system exception occurred 437 */ 438 public static void deletePermissionRole(long permissionId, 439 com.liferay.portal.model.Role role) 440 throws com.liferay.portal.kernel.exception.SystemException { 441 getService().deletePermissionRole(permissionId, role); 442 } 443 444 /** 445 * @throws SystemException if a system exception occurred 446 */ 447 public static void deletePermissionRoles(long permissionId, long[] roleIds) 448 throws com.liferay.portal.kernel.exception.SystemException { 449 getService().deletePermissionRoles(permissionId, roleIds); 450 } 451 452 /** 453 * @throws SystemException if a system exception occurred 454 */ 455 public static void deletePermissionRoles(long permissionId, 456 java.util.List<com.liferay.portal.model.Role> Roles) 457 throws com.liferay.portal.kernel.exception.SystemException { 458 getService().deletePermissionRoles(permissionId, Roles); 459 } 460 461 /** 462 * @throws SystemException if a system exception occurred 463 */ 464 public static java.util.List<com.liferay.portal.model.Role> getPermissionRoles( 465 long permissionId) 466 throws com.liferay.portal.kernel.exception.SystemException { 467 return getService().getPermissionRoles(permissionId); 468 } 469 470 /** 471 * @throws SystemException if a system exception occurred 472 */ 473 public static java.util.List<com.liferay.portal.model.Role> getPermissionRoles( 474 long permissionId, int start, int end) 475 throws com.liferay.portal.kernel.exception.SystemException { 476 return getService().getPermissionRoles(permissionId, start, end); 477 } 478 479 /** 480 * @throws SystemException if a system exception occurred 481 */ 482 public static java.util.List<com.liferay.portal.model.Role> getPermissionRoles( 483 long permissionId, int start, int end, 484 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 485 throws com.liferay.portal.kernel.exception.SystemException { 486 return getService() 487 .getPermissionRoles(permissionId, start, end, 488 orderByComparator); 489 } 490 491 /** 492 * @throws SystemException if a system exception occurred 493 */ 494 public static int getPermissionRolesCount(long permissionId) 495 throws com.liferay.portal.kernel.exception.SystemException { 496 return getService().getPermissionRolesCount(permissionId); 497 } 498 499 /** 500 * @throws SystemException if a system exception occurred 501 */ 502 public static boolean hasPermissionRole(long permissionId, long roleId) 503 throws com.liferay.portal.kernel.exception.SystemException { 504 return getService().hasPermissionRole(permissionId, roleId); 505 } 506 507 /** 508 * @throws SystemException if a system exception occurred 509 */ 510 public static boolean hasPermissionRoles(long permissionId) 511 throws com.liferay.portal.kernel.exception.SystemException { 512 return getService().hasPermissionRoles(permissionId); 513 } 514 515 /** 516 * @throws SystemException if a system exception occurred 517 */ 518 public static void setPermissionRoles(long permissionId, long[] roleIds) 519 throws com.liferay.portal.kernel.exception.SystemException { 520 getService().setPermissionRoles(permissionId, roleIds); 521 } 522 523 /** 524 * @throws SystemException if a system exception occurred 525 */ 526 public static void addUserRole(long userId, long roleId) 527 throws com.liferay.portal.kernel.exception.SystemException { 528 getService().addUserRole(userId, roleId); 529 } 530 531 /** 532 * @throws SystemException if a system exception occurred 533 */ 534 public static void addUserRole(long userId, 535 com.liferay.portal.model.Role role) 536 throws com.liferay.portal.kernel.exception.SystemException { 537 getService().addUserRole(userId, role); 538 } 539 540 /** 541 * @throws PortalException 542 * @throws SystemException if a system exception occurred 543 */ 544 public static void addUserRoles(long userId, long[] roleIds) 545 throws com.liferay.portal.kernel.exception.PortalException, 546 com.liferay.portal.kernel.exception.SystemException { 547 getService().addUserRoles(userId, roleIds); 548 } 549 550 /** 551 * @throws PortalException 552 * @throws SystemException if a system exception occurred 553 */ 554 public static void addUserRoles(long userId, 555 java.util.List<com.liferay.portal.model.Role> Roles) 556 throws com.liferay.portal.kernel.exception.PortalException, 557 com.liferay.portal.kernel.exception.SystemException { 558 getService().addUserRoles(userId, Roles); 559 } 560 561 /** 562 * @throws SystemException if a system exception occurred 563 */ 564 public static void clearUserRoles(long userId) 565 throws com.liferay.portal.kernel.exception.SystemException { 566 getService().clearUserRoles(userId); 567 } 568 569 /** 570 * @throws SystemException if a system exception occurred 571 */ 572 public static void deleteUserRole(long userId, long roleId) 573 throws com.liferay.portal.kernel.exception.SystemException { 574 getService().deleteUserRole(userId, roleId); 575 } 576 577 /** 578 * @throws SystemException if a system exception occurred 579 */ 580 public static void deleteUserRole(long userId, 581 com.liferay.portal.model.Role role) 582 throws com.liferay.portal.kernel.exception.SystemException { 583 getService().deleteUserRole(userId, role); 584 } 585 586 /** 587 * @throws SystemException if a system exception occurred 588 */ 589 public static void deleteUserRoles(long userId, long[] roleIds) 590 throws com.liferay.portal.kernel.exception.SystemException { 591 getService().deleteUserRoles(userId, roleIds); 592 } 593 594 /** 595 * @throws SystemException if a system exception occurred 596 */ 597 public static void deleteUserRoles(long userId, 598 java.util.List<com.liferay.portal.model.Role> Roles) 599 throws com.liferay.portal.kernel.exception.SystemException { 600 getService().deleteUserRoles(userId, Roles); 601 } 602 603 /** 604 * @throws SystemException if a system exception occurred 605 */ 606 public static java.util.List<com.liferay.portal.model.Role> getUserRoles( 607 long userId) throws com.liferay.portal.kernel.exception.SystemException { 608 return getService().getUserRoles(userId); 609 } 610 611 /** 612 * @throws SystemException if a system exception occurred 613 */ 614 public static java.util.List<com.liferay.portal.model.Role> getUserRoles( 615 long userId, int start, int end) 616 throws com.liferay.portal.kernel.exception.SystemException { 617 return getService().getUserRoles(userId, start, end); 618 } 619 620 /** 621 * @throws SystemException if a system exception occurred 622 */ 623 public static java.util.List<com.liferay.portal.model.Role> getUserRoles( 624 long userId, int start, int end, 625 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 626 throws com.liferay.portal.kernel.exception.SystemException { 627 return getService().getUserRoles(userId, start, end, orderByComparator); 628 } 629 630 /** 631 * @throws SystemException if a system exception occurred 632 */ 633 public static int getUserRolesCount(long userId) 634 throws com.liferay.portal.kernel.exception.SystemException { 635 return getService().getUserRolesCount(userId); 636 } 637 638 /** 639 * @throws SystemException if a system exception occurred 640 */ 641 public static boolean hasUserRole(long userId, long roleId) 642 throws com.liferay.portal.kernel.exception.SystemException { 643 return getService().hasUserRole(userId, roleId); 644 } 645 646 /** 647 * @throws SystemException if a system exception occurred 648 */ 649 public static boolean hasUserRoles(long userId) 650 throws com.liferay.portal.kernel.exception.SystemException { 651 return getService().hasUserRoles(userId); 652 } 653 654 /** 655 * @throws PortalException 656 * @throws SystemException if a system exception occurred 657 */ 658 public static void setUserRoles(long userId, long[] roleIds) 659 throws com.liferay.portal.kernel.exception.PortalException, 660 com.liferay.portal.kernel.exception.SystemException { 661 getService().setUserRoles(userId, roleIds); 662 } 663 664 /** 665 * Returns the Spring bean ID for this bean. 666 * 667 * @return the Spring bean ID for this bean 668 */ 669 public static java.lang.String getBeanIdentifier() { 670 return getService().getBeanIdentifier(); 671 } 672 673 /** 674 * Sets the Spring bean ID for this bean. 675 * 676 * @param beanIdentifier the Spring bean ID for this bean 677 */ 678 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 679 getService().setBeanIdentifier(beanIdentifier); 680 } 681 682 /** 683 * Adds a role. The user is reindexed after role is added. 684 * 685 * @param userId the primary key of the user 686 * @param companyId the primary key of the company 687 * @param name the role's name 688 * @param titleMap the role's localized titles (optionally 689 <code>null</code>) 690 * @param descriptionMap the role's localized descriptions (optionally 691 <code>null</code>) 692 * @param type the role's type (optionally <code>0</code>) 693 * @return the role 694 * @throws PortalException if the class name or the role name were 695 invalid, if the role is a duplicate, or if a user with the 696 primary key could not be found 697 * @throws SystemException if a system exception occurred 698 * @deprecated {@link #addRole(long, String, long, String, Map, Map, int, 699 String)} 700 */ 701 public static com.liferay.portal.model.Role addRole(long userId, 702 long companyId, java.lang.String name, 703 java.util.Map<java.util.Locale, java.lang.String> titleMap, 704 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 705 int type) 706 throws com.liferay.portal.kernel.exception.PortalException, 707 com.liferay.portal.kernel.exception.SystemException { 708 return getService() 709 .addRole(userId, companyId, name, titleMap, descriptionMap, 710 type); 711 } 712 713 /** 714 * Adds a role with additional parameters. The user is reindexed after role 715 * is added. 716 * 717 * @param userId the primary key of the user 718 * @param companyId the primary key of the company 719 * @param name the role's name 720 * @param titleMap the role's localized titles (optionally 721 <code>null</code>) 722 * @param descriptionMap the role's localized descriptions (optionally 723 <code>null</code>) 724 * @param type the role's type (optionally <code>0</code>) 725 * @param className the name of the class for which the role is created 726 (optionally <code>null</code>) 727 * @param classPK the primary key of the class for which the role is 728 created (optionally <code>0</code>) 729 * @return the role 730 * @throws PortalException if the class name or the role name were 731 invalid, if the role is a duplicate, or if a user with the 732 primary key could not be found 733 * @throws SystemException if a system exception occurred 734 * @deprecated {@link #addRole(long, String, long, String, Map, Map, int, 735 String)} 736 */ 737 public static com.liferay.portal.model.Role addRole(long userId, 738 long companyId, java.lang.String name, 739 java.util.Map<java.util.Locale, java.lang.String> titleMap, 740 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 741 int type, java.lang.String className, long classPK) 742 throws com.liferay.portal.kernel.exception.PortalException, 743 com.liferay.portal.kernel.exception.SystemException { 744 return getService() 745 .addRole(userId, companyId, name, titleMap, descriptionMap, 746 type, className, classPK); 747 } 748 749 /** 750 * Adds a role with additional parameters. The user is reindexed after role 751 * is added. 752 * 753 * @param userId the primary key of the user 754 * @param className the name of the class for which the role is created 755 (optionally <code>null</code>) 756 * @param classPK the primary key of the class for which the role is 757 created (optionally <code>0</code>) 758 * @param name the role's name 759 * @param titleMap the role's localized titles (optionally 760 <code>null</code>) 761 * @param descriptionMap the role's localized descriptions (optionally 762 <code>null</code>) 763 * @param type the role's type (optionally <code>0</code>) 764 * @param subType the role's subtype (optionally <code>null</code>) 765 * @return the role 766 * @throws PortalException if the class name or the role name were invalid, 767 if the role is a duplicate, or if a user with the primary key 768 could not be found 769 * @throws SystemException if a system exception occurred 770 */ 771 public static com.liferay.portal.model.Role addRole(long userId, 772 java.lang.String className, long classPK, java.lang.String name, 773 java.util.Map<java.util.Locale, java.lang.String> titleMap, 774 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 775 int type, java.lang.String subType) 776 throws com.liferay.portal.kernel.exception.PortalException, 777 com.liferay.portal.kernel.exception.SystemException { 778 return getService() 779 .addRole(userId, className, classPK, name, titleMap, 780 descriptionMap, type, subType); 781 } 782 783 /** 784 * Checks to ensure that the system roles map has appropriate default roles 785 * in each company. 786 * 787 * @throws PortalException if the current user did not have permission to 788 set applicable permissions on a role 789 * @throws SystemException if a system exception occurred 790 */ 791 public static void checkSystemRoles() 792 throws com.liferay.portal.kernel.exception.PortalException, 793 com.liferay.portal.kernel.exception.SystemException { 794 getService().checkSystemRoles(); 795 } 796 797 /** 798 * Checks to ensure that the system roles map has appropriate default roles 799 * in the company. 800 * 801 * @param companyId the primary key of the company 802 * @throws PortalException if the current user did not have permission to 803 set applicable permissions on a role 804 * @throws SystemException if a system exception occurred 805 */ 806 public static void checkSystemRoles(long companyId) 807 throws com.liferay.portal.kernel.exception.PortalException, 808 com.liferay.portal.kernel.exception.SystemException { 809 getService().checkSystemRoles(companyId); 810 } 811 812 /** 813 * Returns the role with the name in the company. 814 * 815 * <p> 816 * The method searches the system roles map first for default roles. If a 817 * role with the name is not found, then the method will query the database. 818 * </p> 819 * 820 * @param companyId the primary key of the company 821 * @param name the role's name 822 * @return Returns the role with the name or <code>null</code> if a role 823 with the name could not be found in the company 824 * @throws SystemException if a system exception occurred 825 */ 826 public static com.liferay.portal.model.Role fetchRole(long companyId, 827 java.lang.String name) 828 throws com.liferay.portal.kernel.exception.SystemException { 829 return getService().fetchRole(companyId, name); 830 } 831 832 /** 833 * Returns the default role for the group with the primary key. 834 * 835 * <p> 836 * If the group is a site, then the default role is {@link 837 * com.liferay.portal.model.RoleConstants#SITE_MEMBER}. If the group is an 838 * organization, then the default role is {@link 839 * com.liferay.portal.model.RoleConstants#ORGANIZATION_USER}. If the group 840 * is a user or user group, then the default role is {@link 841 * com.liferay.portal.model.RoleConstants#POWER_USER}. For all other group 842 * types, the default role is {@link 843 * com.liferay.portal.model.RoleConstants#USER}. 844 * </p> 845 * 846 * @param groupId the primary key of the group 847 * @return the default role for the group with the primary key 848 * @throws PortalException if a group with the primary key could not be 849 found, or if a default role could not be found for the group 850 * @throws SystemException if a system exception occurred 851 */ 852 public static com.liferay.portal.model.Role getDefaultGroupRole( 853 long groupId) 854 throws com.liferay.portal.kernel.exception.PortalException, 855 com.liferay.portal.kernel.exception.SystemException { 856 return getService().getDefaultGroupRole(groupId); 857 } 858 859 public static java.util.List<com.liferay.portal.model.Role> getResourceBlockRoles( 860 long resourceBlockId, java.lang.String className, 861 java.lang.String actionId) 862 throws com.liferay.portal.kernel.exception.SystemException { 863 return getService() 864 .getResourceBlockRoles(resourceBlockId, className, actionId); 865 } 866 867 /** 868 * Returns a map of role names to associated action IDs for the named 869 * resource in the company within the permission scope. 870 * 871 * @param companyId the primary key of the company 872 * @param name the resource name 873 * @param scope the permission scope 874 * @param primKey the primary key of the resource's class 875 * @return the role names and action IDs 876 * @throws SystemException if a system exception occurred 877 * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P( 878 long, String, int, String) 879 */ 880 public static java.util.Map<java.lang.String, java.util.List<java.lang.String>> getResourceRoles( 881 long companyId, java.lang.String name, int scope, 882 java.lang.String primKey) 883 throws com.liferay.portal.kernel.exception.SystemException { 884 return getService().getResourceRoles(companyId, name, scope, primKey); 885 } 886 887 /** 888 * Returns all the roles associated with the action ID in the company within 889 * the permission scope. 890 * 891 * @param companyId the primary key of the company 892 * @param name the resource name 893 * @param scope the permission scope 894 * @param primKey the primary key of the resource's class 895 * @param actionId the name of the resource action 896 * @return the roles 897 * @throws SystemException if a system exception occurred 898 * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P_A( 899 long, String, int, String, String) 900 */ 901 public static java.util.List<com.liferay.portal.model.Role> getResourceRoles( 902 long companyId, java.lang.String name, int scope, 903 java.lang.String primKey, java.lang.String actionId) 904 throws com.liferay.portal.kernel.exception.SystemException { 905 return getService() 906 .getResourceRoles(companyId, name, scope, primKey, actionId); 907 } 908 909 /** 910 * Returns the role with the name in the company. 911 * 912 * <p> 913 * The method searches the system roles map first for default roles. If a 914 * role with the name is not found, then the method will query the database. 915 * </p> 916 * 917 * @param companyId the primary key of the company 918 * @param name the role's name 919 * @return the role with the name 920 * @throws PortalException if a role with the name could not be found in the 921 company 922 * @throws SystemException if a system exception occurred 923 */ 924 public static com.liferay.portal.model.Role getRole(long companyId, 925 java.lang.String name) 926 throws com.liferay.portal.kernel.exception.PortalException, 927 com.liferay.portal.kernel.exception.SystemException { 928 return getService().getRole(companyId, name); 929 } 930 931 /** 932 * Returns all the roles of the type and subtype. 933 * 934 * @param type the role's type (optionally <code>0</code>) 935 * @param subtype the role's subtype (optionally <code>null</code>) 936 * @return the roles of the type and subtype 937 * @throws SystemException if a system exception occurred 938 */ 939 public static java.util.List<com.liferay.portal.model.Role> getRoles( 940 int type, java.lang.String subtype) 941 throws com.liferay.portal.kernel.exception.SystemException { 942 return getService().getRoles(type, subtype); 943 } 944 945 /** 946 * Returns all the roles in the company. 947 * 948 * @param companyId the primary key of the company 949 * @return the roles in the company 950 * @throws SystemException if a system exception occurred 951 */ 952 public static java.util.List<com.liferay.portal.model.Role> getRoles( 953 long companyId) 954 throws com.liferay.portal.kernel.exception.SystemException { 955 return getService().getRoles(companyId); 956 } 957 958 /** 959 * Returns all the roles with the primary keys. 960 * 961 * @param roleIds the primary keys of the roles 962 * @return the roles with the primary keys 963 * @throws PortalException if any one of the roles with the primary keys 964 could not be found 965 * @throws SystemException if a system exception occurred 966 */ 967 public static java.util.List<com.liferay.portal.model.Role> getRoles( 968 long[] roleIds) 969 throws com.liferay.portal.kernel.exception.PortalException, 970 com.liferay.portal.kernel.exception.SystemException { 971 return getService().getRoles(roleIds); 972 } 973 974 /** 975 * Returns all the roles of the subtype. 976 * 977 * @param subtype the role's subtype (optionally <code>null</code>) 978 * @return the roles of the subtype 979 * @throws SystemException if a system exception occurred 980 */ 981 public static java.util.List<com.liferay.portal.model.Role> getSubtypeRoles( 982 java.lang.String subtype) 983 throws com.liferay.portal.kernel.exception.SystemException { 984 return getService().getSubtypeRoles(subtype); 985 } 986 987 /** 988 * Returns the number of roles of the subtype. 989 * 990 * @param subtype the role's subtype (optionally <code>null</code>) 991 * @return the number of roles of the subtype 992 * @throws SystemException if a system exception occurred 993 */ 994 public static int getSubtypeRolesCount(java.lang.String subtype) 995 throws com.liferay.portal.kernel.exception.SystemException { 996 return getService().getSubtypeRolesCount(subtype); 997 } 998 999 /** 1000 * Returns the team role in the company. 1001 * 1002 * @param companyId the primary key of the company 1003 * @param teamId the primary key of the team 1004 * @return the team role in the company 1005 * @throws PortalException if a role could not be found in the team and 1006 company 1007 * @throws SystemException if a system exception occurred 1008 */ 1009 public static com.liferay.portal.model.Role getTeamRole(long companyId, 1010 long teamId) 1011 throws com.liferay.portal.kernel.exception.PortalException, 1012 com.liferay.portal.kernel.exception.SystemException { 1013 return getService().getTeamRole(companyId, teamId); 1014 } 1015 1016 /** 1017 * Returns all the user's roles within the user group. 1018 * 1019 * @param userId the primary key of the user 1020 * @param groupId the primary key of the group 1021 * @return the user's roles within the user group 1022 * @throws SystemException if a system exception occurred 1023 * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupGroupRole( 1024 long, long) 1025 */ 1026 public static java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles( 1027 long userId, long groupId) 1028 throws com.liferay.portal.kernel.exception.SystemException { 1029 return getService().getUserGroupGroupRoles(userId, groupId); 1030 } 1031 1032 /** 1033 * Returns all the user's roles within the user group. 1034 * 1035 * @param userId the primary key of the user 1036 * @param groupId the primary key of the group 1037 * @return the user's roles within the user group 1038 * @throws SystemException if a system exception occurred 1039 * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupRole( 1040 long, long) 1041 */ 1042 public static java.util.List<com.liferay.portal.model.Role> getUserGroupRoles( 1043 long userId, long groupId) 1044 throws com.liferay.portal.kernel.exception.SystemException { 1045 return getService().getUserGroupRoles(userId, groupId); 1046 } 1047 1048 /** 1049 * Returns the union of all the user's roles within the groups. 1050 * 1051 * @param userId the primary key of the user 1052 * @param groups the groups (optionally <code>null</code>) 1053 * @return the union of all the user's roles within the groups 1054 * @throws SystemException if a system exception occurred 1055 * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G( 1056 long, List) 1057 */ 1058 public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 1059 long userId, java.util.List<com.liferay.portal.model.Group> groups) 1060 throws com.liferay.portal.kernel.exception.SystemException { 1061 return getService().getUserRelatedRoles(userId, groups); 1062 } 1063 1064 /** 1065 * Returns all the user's roles within the group. 1066 * 1067 * @param userId the primary key of the user 1068 * @param groupId the primary key of the group 1069 * @return the user's roles within the group 1070 * @throws SystemException if a system exception occurred 1071 * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G( 1072 long, long) 1073 */ 1074 public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 1075 long userId, long groupId) 1076 throws com.liferay.portal.kernel.exception.SystemException { 1077 return getService().getUserRelatedRoles(userId, groupId); 1078 } 1079 1080 /** 1081 * Returns the union of all the user's roles within the groups. 1082 * 1083 * @param userId the primary key of the user 1084 * @param groupIds the primary keys of the groups 1085 * @return the union of all the user's roles within the groups 1086 * @throws SystemException if a system exception occurred 1087 * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G( 1088 long, long[]) 1089 */ 1090 public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 1091 long userId, long[] groupIds) 1092 throws com.liferay.portal.kernel.exception.SystemException { 1093 return getService().getUserRelatedRoles(userId, groupIds); 1094 } 1095 1096 /** 1097 * Returns <code>true</code> if the user is associated with the named 1098 * regular role. 1099 * 1100 * @param userId the primary key of the user 1101 * @param companyId the primary key of the company 1102 * @param name the name of the role 1103 * @param inherited whether to include the user's inherited roles in the 1104 search 1105 * @return <code>true</code> if the user is associated with the regular 1106 role; <code>false</code> otherwise 1107 * @throws PortalException if a role with the name could not be found in the 1108 company or if a default user for the company could not be found 1109 * @throws SystemException if a system exception occurred 1110 */ 1111 public static boolean hasUserRole(long userId, long companyId, 1112 java.lang.String name, boolean inherited) 1113 throws com.liferay.portal.kernel.exception.PortalException, 1114 com.liferay.portal.kernel.exception.SystemException { 1115 return getService().hasUserRole(userId, companyId, name, inherited); 1116 } 1117 1118 /** 1119 * Returns <code>true</code> if the user has any one of the named regular 1120 * roles. 1121 * 1122 * @param userId the primary key of the user 1123 * @param companyId the primary key of the company 1124 * @param names the names of the roles 1125 * @param inherited whether to include the user's inherited roles in the 1126 search 1127 * @return <code>true</code> if the user has any one of the regular roles; 1128 <code>false</code> otherwise 1129 * @throws PortalException if any one of the roles with the names could not 1130 be found in the company or if the default user for the company 1131 could not be found 1132 * @throws SystemException if a system exception occurred 1133 */ 1134 public static boolean hasUserRoles(long userId, long companyId, 1135 java.lang.String[] names, boolean inherited) 1136 throws com.liferay.portal.kernel.exception.PortalException, 1137 com.liferay.portal.kernel.exception.SystemException { 1138 return getService().hasUserRoles(userId, companyId, names, inherited); 1139 } 1140 1141 /** 1142 * Returns a role with the name in the company. 1143 * 1144 * @param companyId the primary key of the company 1145 * @param name the role's name (optionally <code>null</code>) 1146 * @return the role with the name, or <code>null</code> if a role with the 1147 name could not be found in the company 1148 * @throws SystemException if a system exception occurred 1149 */ 1150 public static com.liferay.portal.model.Role loadFetchRole(long companyId, 1151 java.lang.String name) 1152 throws com.liferay.portal.kernel.exception.SystemException { 1153 return getService().loadFetchRole(companyId, name); 1154 } 1155 1156 /** 1157 * Returns a role with the name in the company. 1158 * 1159 * @param companyId the primary key of the company 1160 * @param name the role's name 1161 * @return the role with the name in the company 1162 * @throws PortalException if a role with the name could not be found in the 1163 company 1164 * @throws SystemException if a system exception occurred 1165 */ 1166 public static com.liferay.portal.model.Role loadGetRole(long companyId, 1167 java.lang.String name) 1168 throws com.liferay.portal.kernel.exception.PortalException, 1169 com.liferay.portal.kernel.exception.SystemException { 1170 return getService().loadGetRole(companyId, name); 1171 } 1172 1173 /** 1174 * Returns an ordered range of all the roles that match the keywords and 1175 * types. 1176 * 1177 * <p> 1178 * Useful when paginating results. Returns a maximum of <code>end - 1179 * start</code> instances. <code>start</code> and <code>end</code> are not 1180 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1181 * refers to the first result in the set. Setting both <code>start</code> 1182 * and <code>end</code> to {@link 1183 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1184 * result set. 1185 * </p> 1186 * 1187 * @param companyId the primary key of the company 1188 * @param keywords the keywords (space separated), which may occur in the 1189 role's name or description (optionally <code>null</code>) 1190 * @param types the role types (optionally <code>null</code>) 1191 * @param start the lower bound of the range of roles to return 1192 * @param end the upper bound of the range of roles to return (not 1193 inclusive) 1194 * @param obc the comparator to order the roles (optionally 1195 <code>null</code>) 1196 * @return the ordered range of the matching roles, ordered by 1197 <code>obc</code> 1198 * @throws SystemException if a system exception occurred 1199 * @see com.liferay.portal.service.persistence.RoleFinder 1200 */ 1201 public static java.util.List<com.liferay.portal.model.Role> search( 1202 long companyId, java.lang.String keywords, java.lang.Integer[] types, 1203 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 1204 throws com.liferay.portal.kernel.exception.SystemException { 1205 return getService().search(companyId, keywords, types, start, end, obc); 1206 } 1207 1208 /** 1209 * Returns an ordered range of all the roles that match the keywords, types, 1210 * and params. 1211 * 1212 * <p> 1213 * Useful when paginating results. Returns a maximum of <code>end - 1214 * start</code> instances. <code>start</code> and <code>end</code> are not 1215 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1216 * refers to the first result in the set. Setting both <code>start</code> 1217 * and <code>end</code> to {@link 1218 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1219 * result set. 1220 * </p> 1221 * 1222 * @param companyId the primary key of the company 1223 * @param keywords the keywords (space separated), which may occur in the 1224 role's name or description (optionally <code>null</code>) 1225 * @param types the role types (optionally <code>null</code>) 1226 * @param params the finder parameters. Can specify values for 1227 "permissionsResourceId" and "usersRoles" keys. For more 1228 information, see {@link 1229 com.liferay.portal.service.persistence.RoleFinder} 1230 * @param start the lower bound of the range of roles to return 1231 * @param end the upper bound of the range of roles to return (not 1232 inclusive) 1233 * @param obc the comparator to order the roles (optionally 1234 <code>null</code>) 1235 * @return the ordered range of the matching roles, ordered by 1236 <code>obc</code> 1237 * @throws SystemException if a system exception occurred 1238 * @see com.liferay.portal.service.persistence.RoleFinder 1239 */ 1240 public static java.util.List<com.liferay.portal.model.Role> search( 1241 long companyId, java.lang.String keywords, java.lang.Integer[] types, 1242 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1243 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 1244 throws com.liferay.portal.kernel.exception.SystemException { 1245 return getService() 1246 .search(companyId, keywords, types, params, start, end, obc); 1247 } 1248 1249 /** 1250 * Returns an ordered range of all the roles that match the name, 1251 * description, and types. 1252 * 1253 * <p> 1254 * Useful when paginating results. Returns a maximum of <code>end - 1255 * start</code> instances. <code>start</code> and <code>end</code> are not 1256 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1257 * refers to the first result in the set. Setting both <code>start</code> 1258 * and <code>end</code> to {@link 1259 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1260 * result set. 1261 * </p> 1262 * 1263 * @param companyId the primary key of the company 1264 * @param name the role's name (optionally <code>null</code>) 1265 * @param description the role's description (optionally <code>null</code>) 1266 * @param types the role types (optionally <code>null</code>) 1267 * @param start the lower bound of the range of the roles to return 1268 * @param end the upper bound of the range of the roles to return (not 1269 inclusive) 1270 * @param obc the comparator to order the roles (optionally 1271 <code>null</code>) 1272 * @return the ordered range of the matching roles, ordered by 1273 <code>obc</code> 1274 * @throws SystemException if a system exception occurred 1275 * @see com.liferay.portal.service.persistence.RoleFinder 1276 */ 1277 public static java.util.List<com.liferay.portal.model.Role> search( 1278 long companyId, java.lang.String name, java.lang.String description, 1279 java.lang.Integer[] types, int start, int end, 1280 com.liferay.portal.kernel.util.OrderByComparator obc) 1281 throws com.liferay.portal.kernel.exception.SystemException { 1282 return getService() 1283 .search(companyId, name, description, types, start, end, obc); 1284 } 1285 1286 /** 1287 * Returns an ordered range of all the roles that match the name, 1288 * description, types, and params. 1289 * 1290 * <p> 1291 * Useful when paginating results. Returns a maximum of <code>end - 1292 * start</code> instances. <code>start</code> and <code>end</code> are not 1293 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1294 * refers to the first result in the set. Setting both <code>start</code> 1295 * and <code>end</code> to {@link 1296 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1297 * result set. 1298 * </p> 1299 * 1300 * @param companyId the primary key of the company 1301 * @param name the role's name (optionally <code>null</code>) 1302 * @param description the role's description (optionally <code>null</code>) 1303 * @param types the role types (optionally <code>null</code>) 1304 * @param params the finder's parameters. Can specify values for 1305 "permissionsResourceId" and "usersRoles" keys. For more 1306 information, see {@link 1307 com.liferay.portal.service.persistence.RoleFinder} 1308 * @param start the lower bound of the range of the roles to return 1309 * @param end the upper bound of the range of the roles to return (not 1310 inclusive) 1311 * @param obc the comparator to order the roles (optionally 1312 <code>null</code>) 1313 * @return the ordered range of the matching roles, ordered by 1314 <code>obc</code> 1315 * @throws SystemException if a system exception occurred 1316 * @see com.liferay.portal.service.persistence.RoleFinder 1317 */ 1318 public static java.util.List<com.liferay.portal.model.Role> search( 1319 long companyId, java.lang.String name, java.lang.String description, 1320 java.lang.Integer[] types, 1321 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1322 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 1323 throws com.liferay.portal.kernel.exception.SystemException { 1324 return getService() 1325 .search(companyId, name, description, types, params, start, 1326 end, obc); 1327 } 1328 1329 /** 1330 * Returns the number of roles that match the keywords and types. 1331 * 1332 * @param companyId the primary key of the company 1333 * @param keywords the keywords (space separated), which may occur in the 1334 role's name or description (optionally <code>null</code>) 1335 * @param types the role types (optionally <code>null</code>) 1336 * @return the number of matching roles 1337 * @throws SystemException if a system exception occurred 1338 */ 1339 public static int searchCount(long companyId, java.lang.String keywords, 1340 java.lang.Integer[] types) 1341 throws com.liferay.portal.kernel.exception.SystemException { 1342 return getService().searchCount(companyId, keywords, types); 1343 } 1344 1345 /** 1346 * Returns the number of roles that match the keywords, types and params. 1347 * 1348 * @param companyId the primary key of the company 1349 * @param keywords the keywords (space separated), which may occur in the 1350 role's name or description (optionally <code>null</code>) 1351 * @param types the role types (optionally <code>null</code>) 1352 * @param params the finder parameters. For more information, see {@link 1353 com.liferay.portal.service.persistence.RoleFinder} 1354 * @return the number of matching roles 1355 * @throws SystemException if a system exception occurred 1356 */ 1357 public static int searchCount(long companyId, java.lang.String keywords, 1358 java.lang.Integer[] types, 1359 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 1360 throws com.liferay.portal.kernel.exception.SystemException { 1361 return getService().searchCount(companyId, keywords, types, params); 1362 } 1363 1364 /** 1365 * Returns the number of roles that match the name, description, and types. 1366 * 1367 * @param companyId the primary key of the company 1368 * @param name the role's name (optionally <code>null</code>) 1369 * @param description the role's description (optionally <code>null</code>) 1370 * @param types the role types (optionally <code>null</code>) 1371 * @return the number of matching roles 1372 * @throws SystemException if a system exception occurred 1373 */ 1374 public static int searchCount(long companyId, java.lang.String name, 1375 java.lang.String description, java.lang.Integer[] types) 1376 throws com.liferay.portal.kernel.exception.SystemException { 1377 return getService().searchCount(companyId, name, description, types); 1378 } 1379 1380 /** 1381 * Returns the number of roles that match the name, description, types, and 1382 * params. 1383 * 1384 * @param companyId the primary key of the company 1385 * @param name the role's name (optionally <code>null</code>) 1386 * @param description the role's description (optionally <code>null</code>) 1387 * @param types the role types (optionally <code>null</code>) 1388 * @param params the finder parameters. Can specify values for 1389 "permissionsResourceId" and "usersRoles" keys. For more 1390 information, see {@link 1391 com.liferay.portal.service.persistence.RoleFinder} 1392 * @return the number of matching roles 1393 * @throws SystemException if a system exception occurred 1394 */ 1395 public static int searchCount(long companyId, java.lang.String name, 1396 java.lang.String description, java.lang.Integer[] types, 1397 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 1398 throws com.liferay.portal.kernel.exception.SystemException { 1399 return getService() 1400 .searchCount(companyId, name, description, types, params); 1401 } 1402 1403 /** 1404 * Removes the matching roles associated with the user. The user is 1405 * reindexed after the roles are removed. 1406 * 1407 * @param userId the primary key of the user 1408 * @param roleIds the primary keys of the roles 1409 * @throws PortalException if a user with the primary key could not be found 1410 or if a role with any one of the primary keys could not be found 1411 * @throws SystemException if a system exception occurred 1412 */ 1413 public static void unsetUserRoles(long userId, long[] roleIds) 1414 throws com.liferay.portal.kernel.exception.PortalException, 1415 com.liferay.portal.kernel.exception.SystemException { 1416 getService().unsetUserRoles(userId, roleIds); 1417 } 1418 1419 /** 1420 * Updates the role with the primary key. 1421 * 1422 * @param roleId the primary key of the role 1423 * @param name the role's new name 1424 * @param titleMap the new localized titles (optionally <code>null</code>) 1425 to replace those existing for the role 1426 * @param descriptionMap the new localized descriptions (optionally 1427 <code>null</code>) to replace those existing for the role 1428 * @param subtype the role's new subtype (optionally <code>null</code>) 1429 * @return the role with the primary key 1430 * @throws PortalException if a role with the primary could not be found or 1431 if the role's name was invalid 1432 * @throws SystemException if a system exception occurred 1433 */ 1434 public static com.liferay.portal.model.Role updateRole(long roleId, 1435 java.lang.String name, 1436 java.util.Map<java.util.Locale, java.lang.String> titleMap, 1437 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 1438 java.lang.String subtype) 1439 throws com.liferay.portal.kernel.exception.PortalException, 1440 com.liferay.portal.kernel.exception.SystemException { 1441 return getService() 1442 .updateRole(roleId, name, titleMap, descriptionMap, subtype); 1443 } 1444 1445 public static RoleLocalService getService() { 1446 if (_service == null) { 1447 _service = (RoleLocalService)PortalBeanLocatorUtil.locate(RoleLocalService.class.getName()); 1448 1449 ReferenceRegistry.registerReference(RoleLocalServiceUtil.class, 1450 "_service"); 1451 } 1452 1453 return _service; 1454 } 1455 1456 /** 1457 * @deprecated 1458 */ 1459 public void setService(RoleLocalService service) { 1460 } 1461 1462 private static RoleLocalService _service; 1463 }