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