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