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