001 /** 002 * Copyright (c) 2000-present 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 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 User. This utility wraps 024 * {@link com.liferay.portal.service.impl.UserLocalServiceImpl} 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 UserLocalService 032 * @see com.liferay.portal.service.base.UserLocalServiceBaseImpl 033 * @see com.liferay.portal.service.impl.UserLocalServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class UserLocalServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.UserLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * Adds a default admin user for the company. 046 * 047 * @param companyId the primary key of the user's company 048 * @param screenName the user's screen name 049 * @param emailAddress the user's email address 050 * @param locale the user's locale 051 * @param firstName the user's first name 052 * @param middleName the user's middle name 053 * @param lastName the user's last name 054 * @return the new default admin user 055 */ 056 public static com.liferay.portal.model.User addDefaultAdminUser( 057 long companyId, java.lang.String screenName, 058 java.lang.String emailAddress, java.util.Locale locale, 059 java.lang.String firstName, java.lang.String middleName, 060 java.lang.String lastName) 061 throws com.liferay.portal.kernel.exception.PortalException { 062 return getService() 063 .addDefaultAdminUser(companyId, screenName, emailAddress, 064 locale, firstName, middleName, lastName); 065 } 066 067 /** 068 * Adds the user to the default groups, unless the user is already in these 069 * groups. The default groups can be specified in 070 * <code>portal.properties</code> with the key 071 * <code>admin.default.group.names</code>. 072 * 073 * @param userId the primary key of the user 074 */ 075 public static void addDefaultGroups(long userId) 076 throws com.liferay.portal.kernel.exception.PortalException { 077 getService().addDefaultGroups(userId); 078 } 079 080 /** 081 * Adds the user to the default roles, unless the user already has these 082 * roles. The default roles can be specified in 083 * <code>portal.properties</code> with the key 084 * <code>admin.default.role.names</code>. 085 * 086 * @param userId the primary key of the user 087 */ 088 public static void addDefaultRoles(long userId) 089 throws com.liferay.portal.kernel.exception.PortalException { 090 getService().addDefaultRoles(userId); 091 } 092 093 /** 094 * Adds the user to the default user groups, unless the user is already in 095 * these user groups. The default user groups can be specified in 096 * <code>portal.properties</code> with the property 097 * <code>admin.default.user.group.names</code>. 098 * 099 * @param userId the primary key of the user 100 */ 101 public static void addDefaultUserGroups(long userId) 102 throws com.liferay.portal.kernel.exception.PortalException { 103 getService().addDefaultUserGroups(userId); 104 } 105 106 public static void addGroupUser(long groupId, 107 com.liferay.portal.model.User user) { 108 getService().addGroupUser(groupId, user); 109 } 110 111 public static void addGroupUser(long groupId, long userId) { 112 getService().addGroupUser(groupId, userId); 113 } 114 115 /** 116 * @throws PortalException 117 */ 118 public static void addGroupUsers(long groupId, 119 java.util.List<com.liferay.portal.model.User> Users) 120 throws com.liferay.portal.kernel.exception.PortalException { 121 getService().addGroupUsers(groupId, Users); 122 } 123 124 /** 125 * @throws PortalException 126 */ 127 public static void addGroupUsers(long groupId, long[] userIds) 128 throws com.liferay.portal.kernel.exception.PortalException { 129 getService().addGroupUsers(groupId, userIds); 130 } 131 132 public static void addOrganizationUser(long organizationId, 133 com.liferay.portal.model.User user) { 134 getService().addOrganizationUser(organizationId, user); 135 } 136 137 public static void addOrganizationUser(long organizationId, long userId) { 138 getService().addOrganizationUser(organizationId, userId); 139 } 140 141 /** 142 * @throws PortalException 143 */ 144 public static void addOrganizationUsers(long organizationId, 145 java.util.List<com.liferay.portal.model.User> Users) 146 throws com.liferay.portal.kernel.exception.PortalException { 147 getService().addOrganizationUsers(organizationId, Users); 148 } 149 150 /** 151 * @throws PortalException 152 */ 153 public static void addOrganizationUsers(long organizationId, long[] userIds) 154 throws com.liferay.portal.kernel.exception.PortalException { 155 getService().addOrganizationUsers(organizationId, userIds); 156 } 157 158 /** 159 * Assigns the password policy to the users, removing any other currently 160 * assigned password policies. 161 * 162 * @param passwordPolicyId the primary key of the password policy 163 * @param userIds the primary keys of the users 164 */ 165 public static void addPasswordPolicyUsers(long passwordPolicyId, 166 long[] userIds) { 167 getService().addPasswordPolicyUsers(passwordPolicyId, userIds); 168 } 169 170 public static void addRoleUser(long roleId, 171 com.liferay.portal.model.User user) { 172 getService().addRoleUser(roleId, user); 173 } 174 175 public static void addRoleUser(long roleId, long userId) { 176 getService().addRoleUser(roleId, userId); 177 } 178 179 /** 180 * @throws PortalException 181 */ 182 public static void addRoleUsers(long roleId, 183 java.util.List<com.liferay.portal.model.User> Users) 184 throws com.liferay.portal.kernel.exception.PortalException { 185 getService().addRoleUsers(roleId, Users); 186 } 187 188 /** 189 * @throws PortalException 190 */ 191 public static void addRoleUsers(long roleId, long[] userIds) 192 throws com.liferay.portal.kernel.exception.PortalException { 193 getService().addRoleUsers(roleId, userIds); 194 } 195 196 public static void addTeamUser(long teamId, 197 com.liferay.portal.model.User user) { 198 getService().addTeamUser(teamId, user); 199 } 200 201 public static void addTeamUser(long teamId, long userId) { 202 getService().addTeamUser(teamId, userId); 203 } 204 205 /** 206 * @throws PortalException 207 */ 208 public static void addTeamUsers(long teamId, 209 java.util.List<com.liferay.portal.model.User> Users) 210 throws com.liferay.portal.kernel.exception.PortalException { 211 getService().addTeamUsers(teamId, Users); 212 } 213 214 /** 215 * @throws PortalException 216 */ 217 public static void addTeamUsers(long teamId, long[] userIds) 218 throws com.liferay.portal.kernel.exception.PortalException { 219 getService().addTeamUsers(teamId, userIds); 220 } 221 222 /** 223 * Adds a user. 224 * 225 * <p> 226 * This method handles the creation and bookkeeping of the user including 227 * its resources, metadata, and internal data structures. It is not 228 * necessary to make subsequent calls to any methods to setup default 229 * groups, resources, etc. 230 * </p> 231 * 232 * @param creatorUserId the primary key of the creator 233 * @param companyId the primary key of the user's company 234 * @param autoPassword whether a password should be automatically generated 235 for the user 236 * @param password1 the user's password 237 * @param password2 the user's password confirmation 238 * @param autoScreenName whether a screen name should be automatically 239 generated for the user 240 * @param screenName the user's screen name 241 * @param emailAddress the user's email address 242 * @param facebookId the user's facebook ID 243 * @param openId the user's OpenID 244 * @param locale the user's locale 245 * @param firstName the user's first name 246 * @param middleName the user's middle name 247 * @param lastName the user's last name 248 * @param prefixId the user's name prefix ID 249 * @param suffixId the user's name suffix ID 250 * @param male whether the user is male 251 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 252 January) 253 * @param birthdayDay the user's birthday day 254 * @param birthdayYear the user's birthday year 255 * @param jobTitle the user's job title 256 * @param groupIds the primary keys of the user's groups 257 * @param organizationIds the primary keys of the user's organizations 258 * @param roleIds the primary keys of the roles this user possesses 259 * @param userGroupIds the primary keys of the user's user groups 260 * @param sendEmail whether to send the user an email notification about 261 their new account 262 * @param serviceContext the service context to be applied (optionally 263 <code>null</code>). Can set the UUID (with the <code>uuid</code> 264 attribute), asset category IDs, asset tag names, and expando 265 bridge attributes for the user. 266 * @return the new user 267 */ 268 public static com.liferay.portal.model.User addUser(long creatorUserId, 269 long companyId, boolean autoPassword, java.lang.String password1, 270 java.lang.String password2, boolean autoScreenName, 271 java.lang.String screenName, java.lang.String emailAddress, 272 long facebookId, java.lang.String openId, java.util.Locale locale, 273 java.lang.String firstName, java.lang.String middleName, 274 java.lang.String lastName, long prefixId, long suffixId, boolean male, 275 int birthdayMonth, int birthdayDay, int birthdayYear, 276 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 277 long[] roleIds, long[] userGroupIds, boolean sendEmail, 278 com.liferay.portal.service.ServiceContext serviceContext) 279 throws com.liferay.portal.kernel.exception.PortalException { 280 return getService() 281 .addUser(creatorUserId, companyId, autoPassword, password1, 282 password2, autoScreenName, screenName, emailAddress, facebookId, 283 openId, locale, firstName, middleName, lastName, prefixId, 284 suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, 285 groupIds, organizationIds, roleIds, userGroupIds, sendEmail, 286 serviceContext); 287 } 288 289 /** 290 * Adds the user to the database. Also notifies the appropriate model listeners. 291 * 292 * @param user the user 293 * @return the user that was added 294 */ 295 public static com.liferay.portal.model.User addUser( 296 com.liferay.portal.model.User user) { 297 return getService().addUser(user); 298 } 299 300 public static void addUserGroupUser(long userGroupId, 301 com.liferay.portal.model.User user) { 302 getService().addUserGroupUser(userGroupId, user); 303 } 304 305 public static void addUserGroupUser(long userGroupId, long userId) { 306 getService().addUserGroupUser(userGroupId, userId); 307 } 308 309 /** 310 * @throws PortalException 311 */ 312 public static void addUserGroupUsers(long userGroupId, 313 java.util.List<com.liferay.portal.model.User> Users) 314 throws com.liferay.portal.kernel.exception.PortalException { 315 getService().addUserGroupUsers(userGroupId, Users); 316 } 317 318 /** 319 * @throws PortalException 320 */ 321 public static void addUserGroupUsers(long userGroupId, long[] userIds) 322 throws com.liferay.portal.kernel.exception.PortalException { 323 getService().addUserGroupUsers(userGroupId, userIds); 324 } 325 326 /** 327 * Adds a user with workflow. 328 * 329 * <p> 330 * This method handles the creation and bookkeeping of the user including 331 * its resources, metadata, and internal data structures. It is not 332 * necessary to make subsequent calls to any methods to setup default 333 * groups, resources, etc. 334 * </p> 335 * 336 * @param creatorUserId the primary key of the creator 337 * @param companyId the primary key of the user's company 338 * @param autoPassword whether a password should be automatically generated 339 for the user 340 * @param password1 the user's password 341 * @param password2 the user's password confirmation 342 * @param autoScreenName whether a screen name should be automatically 343 generated for the user 344 * @param screenName the user's screen name 345 * @param emailAddress the user's email address 346 * @param facebookId the user's facebook ID 347 * @param openId the user's OpenID 348 * @param locale the user's locale 349 * @param firstName the user's first name 350 * @param middleName the user's middle name 351 * @param lastName the user's last name 352 * @param prefixId the user's name prefix ID 353 * @param suffixId the user's name suffix ID 354 * @param male whether the user is male 355 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 356 January) 357 * @param birthdayDay the user's birthday day 358 * @param birthdayYear the user's birthday year 359 * @param jobTitle the user's job title 360 * @param groupIds the primary keys of the user's groups 361 * @param organizationIds the primary keys of the user's organizations 362 * @param roleIds the primary keys of the roles this user possesses 363 * @param userGroupIds the primary keys of the user's user groups 364 * @param sendEmail whether to send the user an email notification about 365 their new account 366 * @param serviceContext the service context to be applied (optionally 367 <code>null</code>). Can set the UUID (with the <code>uuid</code> 368 attribute), asset category IDs, asset tag names, and expando 369 bridge attributes for the user. 370 * @return the new user 371 */ 372 public static com.liferay.portal.model.User addUserWithWorkflow( 373 long creatorUserId, long companyId, boolean autoPassword, 374 java.lang.String password1, java.lang.String password2, 375 boolean autoScreenName, java.lang.String screenName, 376 java.lang.String emailAddress, long facebookId, 377 java.lang.String openId, java.util.Locale locale, 378 java.lang.String firstName, java.lang.String middleName, 379 java.lang.String lastName, long prefixId, long suffixId, boolean male, 380 int birthdayMonth, int birthdayDay, int birthdayYear, 381 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 382 long[] roleIds, long[] userGroupIds, boolean sendEmail, 383 com.liferay.portal.service.ServiceContext serviceContext) 384 throws com.liferay.portal.kernel.exception.PortalException { 385 return getService() 386 .addUserWithWorkflow(creatorUserId, companyId, autoPassword, 387 password1, password2, autoScreenName, screenName, emailAddress, 388 facebookId, openId, locale, firstName, middleName, lastName, 389 prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, 390 jobTitle, groupIds, organizationIds, roleIds, userGroupIds, 391 sendEmail, serviceContext); 392 } 393 394 /** 395 * Attempts to authenticate the user by their email address and password, 396 * while using the AuthPipeline. 397 * 398 * @param companyId the primary key of the user's company 399 * @param emailAddress the user's email address 400 * @param password the user's password 401 * @param headerMap the header map from the authentication request 402 * @param parameterMap the parameter map from the authentication request 403 * @param resultsMap the map of authentication results (may be nil). After 404 a successful authentication the user's primary key will be placed 405 under the key <code>userId</code>. 406 * @return the authentication status. This can be {@link 407 Authenticator#FAILURE} indicating that the user's credentials are 408 invalid, {@link Authenticator#SUCCESS} indicating a successful 409 login, or {@link Authenticator#DNE} indicating that a user with 410 that login does not exist. 411 * @see AuthPipeline 412 */ 413 public static int authenticateByEmailAddress(long companyId, 414 java.lang.String emailAddress, java.lang.String password, 415 java.util.Map<java.lang.String, java.lang.String[]> headerMap, 416 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 417 java.util.Map<java.lang.String, java.lang.Object> resultsMap) 418 throws com.liferay.portal.kernel.exception.PortalException { 419 return getService() 420 .authenticateByEmailAddress(companyId, emailAddress, 421 password, headerMap, parameterMap, resultsMap); 422 } 423 424 /** 425 * Attempts to authenticate the user by their screen name and password, 426 * while using the AuthPipeline. 427 * 428 * @param companyId the primary key of the user's company 429 * @param screenName the user's screen name 430 * @param password the user's password 431 * @param headerMap the header map from the authentication request 432 * @param parameterMap the parameter map from the authentication request 433 * @param resultsMap the map of authentication results (may be nil). After 434 a successful authentication the user's primary key will be placed 435 under the key <code>userId</code>. 436 * @return the authentication status. This can be {@link 437 Authenticator#FAILURE} indicating that the user's credentials are 438 invalid, {@link Authenticator#SUCCESS} indicating a successful 439 login, or {@link Authenticator#DNE} indicating that a user with 440 that login does not exist. 441 * @see AuthPipeline 442 */ 443 public static int authenticateByScreenName(long companyId, 444 java.lang.String screenName, java.lang.String password, 445 java.util.Map<java.lang.String, java.lang.String[]> headerMap, 446 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 447 java.util.Map<java.lang.String, java.lang.Object> resultsMap) 448 throws com.liferay.portal.kernel.exception.PortalException { 449 return getService() 450 .authenticateByScreenName(companyId, screenName, password, 451 headerMap, parameterMap, resultsMap); 452 } 453 454 /** 455 * Attempts to authenticate the user by their primary key and password, 456 * while using the AuthPipeline. 457 * 458 * @param companyId the primary key of the user's company 459 * @param userId the user's primary key 460 * @param password the user's password 461 * @param headerMap the header map from the authentication request 462 * @param parameterMap the parameter map from the authentication request 463 * @param resultsMap the map of authentication results (may be nil). After 464 a successful authentication the user's primary key will be placed 465 under the key <code>userId</code>. 466 * @return the authentication status. This can be {@link 467 Authenticator#FAILURE} indicating that the user's credentials are 468 invalid, {@link Authenticator#SUCCESS} indicating a successful 469 login, or {@link Authenticator#DNE} indicating that a user with 470 that login does not exist. 471 * @see AuthPipeline 472 */ 473 public static int authenticateByUserId(long companyId, long userId, 474 java.lang.String password, 475 java.util.Map<java.lang.String, java.lang.String[]> headerMap, 476 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 477 java.util.Map<java.lang.String, java.lang.Object> resultsMap) 478 throws com.liferay.portal.kernel.exception.PortalException { 479 return getService() 480 .authenticateByUserId(companyId, userId, password, 481 headerMap, parameterMap, resultsMap); 482 } 483 484 /** 485 * Attempts to authenticate the user using HTTP basic access authentication, 486 * without using the AuthPipeline. Primarily used for authenticating users 487 * of <code>tunnel-web</code>. 488 * 489 * <p> 490 * Authentication type specifies what <code>login</code> contains.The valid 491 * values are: 492 * </p> 493 * 494 * <ul> 495 * <li> 496 * <code>CompanyConstants.AUTH_TYPE_EA</code> - <code>login</code> is the 497 * user's email address 498 * </li> 499 * <li> 500 * <code>CompanyConstants.AUTH_TYPE_SN</code> - <code>login</code> is the 501 * user's screen name 502 * </li> 503 * <li> 504 * <code>CompanyConstants.AUTH_TYPE_ID</code> - <code>login</code> is the 505 * user's primary key 506 * </li> 507 * </ul> 508 * 509 * @param companyId the primary key of the user's company 510 * @param authType the type of authentication to perform 511 * @param login either the user's email address, screen name, or primary 512 key depending on the value of <code>authType</code> 513 * @param password the user's password 514 * @return the user's primary key if authentication is successful; 515 <code>0</code> otherwise 516 */ 517 public static long authenticateForBasic(long companyId, 518 java.lang.String authType, java.lang.String login, 519 java.lang.String password) 520 throws com.liferay.portal.kernel.exception.PortalException { 521 return getService() 522 .authenticateForBasic(companyId, authType, login, password); 523 } 524 525 /** 526 * Attempts to authenticate the user using HTTP digest access 527 * authentication, without using the AuthPipeline. Primarily used for 528 * authenticating users of <code>tunnel-web</code>. 529 * 530 * @param companyId the primary key of the user's company 531 * @param username either the user's email address, screen name, or primary 532 key 533 * @param realm unused 534 * @param nonce the number used once 535 * @param method the request method 536 * @param uri the request URI 537 * @param response the authentication response hash 538 * @return the user's primary key if authentication is successful; 539 <code>0</code> otherwise 540 */ 541 public static long authenticateForDigest(long companyId, 542 java.lang.String username, java.lang.String realm, 543 java.lang.String nonce, java.lang.String method, java.lang.String uri, 544 java.lang.String response) 545 throws com.liferay.portal.kernel.exception.PortalException { 546 return getService() 547 .authenticateForDigest(companyId, username, realm, nonce, 548 method, uri, response); 549 } 550 551 /** 552 * Attempts to authenticate the user using JAAS credentials, without using 553 * the AuthPipeline. 554 * 555 * @param userId the primary key of the user 556 * @param encPassword the encrypted password 557 * @return <code>true</code> if authentication is successful; 558 <code>false</code> otherwise 559 */ 560 public static boolean authenticateForJAAS(long userId, 561 java.lang.String encPassword) { 562 return getService().authenticateForJAAS(userId, encPassword); 563 } 564 565 /** 566 * Checks if the user is currently locked out based on the password policy, 567 * and performs maintenance on the user's lockout and failed login data. 568 * 569 * @param user the user 570 */ 571 public static void checkLockout(com.liferay.portal.model.User user) 572 throws com.liferay.portal.kernel.exception.PortalException { 573 getService().checkLockout(user); 574 } 575 576 /** 577 * Adds a failed login attempt to the user and updates the user's last 578 * failed login date. 579 * 580 * @param user the user 581 */ 582 public static void checkLoginFailure(com.liferay.portal.model.User user) { 583 getService().checkLoginFailure(user); 584 } 585 586 /** 587 * Adds a failed login attempt to the user with the email address and 588 * updates the user's last failed login date. 589 * 590 * @param companyId the primary key of the user's company 591 * @param emailAddress the user's email address 592 */ 593 public static void checkLoginFailureByEmailAddress(long companyId, 594 java.lang.String emailAddress) 595 throws com.liferay.portal.kernel.exception.PortalException { 596 getService().checkLoginFailureByEmailAddress(companyId, emailAddress); 597 } 598 599 /** 600 * Adds a failed login attempt to the user and updates the user's last 601 * failed login date. 602 * 603 * @param userId the primary key of the user 604 */ 605 public static void checkLoginFailureById(long userId) 606 throws com.liferay.portal.kernel.exception.PortalException { 607 getService().checkLoginFailureById(userId); 608 } 609 610 /** 611 * Adds a failed login attempt to the user with the screen name and updates 612 * the user's last failed login date. 613 * 614 * @param companyId the primary key of the user's company 615 * @param screenName the user's screen name 616 */ 617 public static void checkLoginFailureByScreenName(long companyId, 618 java.lang.String screenName) 619 throws com.liferay.portal.kernel.exception.PortalException { 620 getService().checkLoginFailureByScreenName(companyId, screenName); 621 } 622 623 /** 624 * Checks if the user's password is expired based on the password policy, 625 * and performs maintenance on the user's grace login and password reset 626 * data. 627 * 628 * @param user the user 629 */ 630 public static void checkPasswordExpired(com.liferay.portal.model.User user) 631 throws com.liferay.portal.kernel.exception.PortalException { 632 getService().checkPasswordExpired(user); 633 } 634 635 public static void clearGroupUsers(long groupId) { 636 getService().clearGroupUsers(groupId); 637 } 638 639 public static void clearOrganizationUsers(long organizationId) { 640 getService().clearOrganizationUsers(organizationId); 641 } 642 643 public static void clearRoleUsers(long roleId) { 644 getService().clearRoleUsers(roleId); 645 } 646 647 public static void clearTeamUsers(long teamId) { 648 getService().clearTeamUsers(teamId); 649 } 650 651 public static void clearUserGroupUsers(long userGroupId) { 652 getService().clearUserGroupUsers(userGroupId); 653 } 654 655 /** 656 * Completes the user's registration by generating a password and sending 657 * the confirmation email. 658 * 659 * @param user the user 660 * @param serviceContext the service context to be applied. You can specify 661 an unencrypted custom password for the user via attribute 662 <code>passwordUnencrypted</code>. You automatically generate a 663 password for the user by setting attribute 664 <code>autoPassword</code> to <code>true</code>. You can send a 665 confirmation email to the user by setting attribute 666 <code>sendEmail</code> to <code>true</code>. 667 */ 668 public static void completeUserRegistration( 669 com.liferay.portal.model.User user, 670 com.liferay.portal.service.ServiceContext serviceContext) 671 throws com.liferay.portal.kernel.exception.PortalException { 672 getService().completeUserRegistration(user, serviceContext); 673 } 674 675 /** 676 * Creates a new user with the primary key. Does not add the user to the database. 677 * 678 * @param userId the primary key for the new user 679 * @return the new user 680 */ 681 public static com.liferay.portal.model.User createUser(long userId) { 682 return getService().createUser(userId); 683 } 684 685 /** 686 * Decrypts the user's primary key and password from their encrypted forms. 687 * Used for decrypting a user's credentials from the values stored in an 688 * automatic login cookie. 689 * 690 * @param companyId the primary key of the user's company 691 * @param name the encrypted primary key of the user 692 * @param password the encrypted password of the user 693 * @return the user's primary key and password 694 */ 695 public static com.liferay.portal.kernel.util.KeyValuePair decryptUserId( 696 long companyId, java.lang.String name, java.lang.String password) 697 throws com.liferay.portal.kernel.exception.PortalException { 698 return getService().decryptUserId(companyId, name, password); 699 } 700 701 public static void deleteGroupUser(long groupId, 702 com.liferay.portal.model.User user) { 703 getService().deleteGroupUser(groupId, user); 704 } 705 706 public static void deleteGroupUser(long groupId, long userId) { 707 getService().deleteGroupUser(groupId, userId); 708 } 709 710 public static void deleteGroupUsers(long groupId, 711 java.util.List<com.liferay.portal.model.User> Users) { 712 getService().deleteGroupUsers(groupId, Users); 713 } 714 715 public static void deleteGroupUsers(long groupId, long[] userIds) { 716 getService().deleteGroupUsers(groupId, userIds); 717 } 718 719 public static void deleteOrganizationUser(long organizationId, 720 com.liferay.portal.model.User user) { 721 getService().deleteOrganizationUser(organizationId, user); 722 } 723 724 public static void deleteOrganizationUser(long organizationId, long userId) { 725 getService().deleteOrganizationUser(organizationId, userId); 726 } 727 728 public static void deleteOrganizationUsers(long organizationId, 729 java.util.List<com.liferay.portal.model.User> Users) { 730 getService().deleteOrganizationUsers(organizationId, Users); 731 } 732 733 public static void deleteOrganizationUsers(long organizationId, 734 long[] userIds) { 735 getService().deleteOrganizationUsers(organizationId, userIds); 736 } 737 738 /** 739 * @throws PortalException 740 */ 741 public static com.liferay.portal.model.PersistedModel deletePersistedModel( 742 com.liferay.portal.model.PersistedModel persistedModel) 743 throws com.liferay.portal.kernel.exception.PortalException { 744 return getService().deletePersistedModel(persistedModel); 745 } 746 747 /** 748 * Deletes the user's portrait image. 749 * 750 * @param userId the primary key of the user 751 */ 752 public static void deletePortrait(long userId) 753 throws com.liferay.portal.kernel.exception.PortalException { 754 getService().deletePortrait(userId); 755 } 756 757 /** 758 * @throws PortalException 759 */ 760 public static void deleteRoleUser(long roleId, 761 com.liferay.portal.model.User user) 762 throws com.liferay.portal.kernel.exception.PortalException { 763 getService().deleteRoleUser(roleId, user); 764 } 765 766 /** 767 * @throws PortalException 768 */ 769 public static void deleteRoleUser(long roleId, long userId) 770 throws com.liferay.portal.kernel.exception.PortalException { 771 getService().deleteRoleUser(roleId, userId); 772 } 773 774 public static void deleteRoleUsers(long roleId, 775 java.util.List<com.liferay.portal.model.User> Users) { 776 getService().deleteRoleUsers(roleId, Users); 777 } 778 779 public static void deleteRoleUsers(long roleId, long[] userIds) { 780 getService().deleteRoleUsers(roleId, userIds); 781 } 782 783 public static void deleteTeamUser(long teamId, 784 com.liferay.portal.model.User user) { 785 getService().deleteTeamUser(teamId, user); 786 } 787 788 public static void deleteTeamUser(long teamId, long userId) { 789 getService().deleteTeamUser(teamId, userId); 790 } 791 792 public static void deleteTeamUsers(long teamId, 793 java.util.List<com.liferay.portal.model.User> Users) { 794 getService().deleteTeamUsers(teamId, Users); 795 } 796 797 public static void deleteTeamUsers(long teamId, long[] userIds) { 798 getService().deleteTeamUsers(teamId, userIds); 799 } 800 801 /** 802 * Deletes the user from the database. Also notifies the appropriate model listeners. 803 * 804 * @param user the user 805 * @return the user that was removed 806 * @throws PortalException 807 */ 808 public static com.liferay.portal.model.User deleteUser( 809 com.liferay.portal.model.User user) 810 throws com.liferay.portal.kernel.exception.PortalException { 811 return getService().deleteUser(user); 812 } 813 814 /** 815 * Deletes the user with the primary key from the database. Also notifies the appropriate model listeners. 816 * 817 * @param userId the primary key of the user 818 * @return the user that was removed 819 * @throws PortalException if a user with the primary key could not be found 820 */ 821 public static com.liferay.portal.model.User deleteUser(long userId) 822 throws com.liferay.portal.kernel.exception.PortalException { 823 return getService().deleteUser(userId); 824 } 825 826 /** 827 * @throws PortalException 828 */ 829 public static void deleteUserGroupUser(long userGroupId, 830 com.liferay.portal.model.User user) 831 throws com.liferay.portal.kernel.exception.PortalException { 832 getService().deleteUserGroupUser(userGroupId, user); 833 } 834 835 /** 836 * @throws PortalException 837 */ 838 public static void deleteUserGroupUser(long userGroupId, long userId) 839 throws com.liferay.portal.kernel.exception.PortalException { 840 getService().deleteUserGroupUser(userGroupId, userId); 841 } 842 843 public static void deleteUserGroupUsers(long userGroupId, 844 java.util.List<com.liferay.portal.model.User> Users) { 845 getService().deleteUserGroupUsers(userGroupId, Users); 846 } 847 848 public static void deleteUserGroupUsers(long userGroupId, long[] userIds) { 849 getService().deleteUserGroupUsers(userGroupId, userIds); 850 } 851 852 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 853 return getService().dynamicQuery(); 854 } 855 856 /** 857 * Performs a dynamic query on the database and returns the matching rows. 858 * 859 * @param dynamicQuery the dynamic query 860 * @return the matching rows 861 */ 862 public static <T> java.util.List<T> dynamicQuery( 863 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 864 return getService().dynamicQuery(dynamicQuery); 865 } 866 867 /** 868 * Performs a dynamic query on the database and returns a range of the matching rows. 869 * 870 * <p> 871 * 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.UserModelImpl}. 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. 872 * </p> 873 * 874 * @param dynamicQuery the dynamic query 875 * @param start the lower bound of the range of model instances 876 * @param end the upper bound of the range of model instances (not inclusive) 877 * @return the range of matching rows 878 */ 879 public static <T> java.util.List<T> dynamicQuery( 880 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 881 int end) { 882 return getService().dynamicQuery(dynamicQuery, start, end); 883 } 884 885 /** 886 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 887 * 888 * <p> 889 * 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.UserModelImpl}. 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. 890 * </p> 891 * 892 * @param dynamicQuery the dynamic query 893 * @param start the lower bound of the range of model instances 894 * @param end the upper bound of the range of model instances (not inclusive) 895 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 896 * @return the ordered range of matching rows 897 */ 898 public static <T> java.util.List<T> dynamicQuery( 899 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 900 int end, 901 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 902 return getService() 903 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 904 } 905 906 /** 907 * Returns the number of rows matching the dynamic query. 908 * 909 * @param dynamicQuery the dynamic query 910 * @return the number of rows matching the dynamic query 911 */ 912 public static long dynamicQueryCount( 913 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 914 return getService().dynamicQueryCount(dynamicQuery); 915 } 916 917 /** 918 * Returns the number of rows matching the dynamic query. 919 * 920 * @param dynamicQuery the dynamic query 921 * @param projection the projection to apply to the query 922 * @return the number of rows matching the dynamic query 923 */ 924 public static long dynamicQueryCount( 925 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 926 com.liferay.portal.kernel.dao.orm.Projection projection) { 927 return getService().dynamicQueryCount(dynamicQuery, projection); 928 } 929 930 /** 931 * Encrypts the primary key of the user. Used when encrypting the user's 932 * credentials for storage in an automatic login cookie. 933 * 934 * @param name the primary key of the user 935 * @return the user's encrypted primary key 936 */ 937 public static java.lang.String encryptUserId(java.lang.String name) 938 throws com.liferay.portal.kernel.exception.PortalException { 939 return getService().encryptUserId(name); 940 } 941 942 public static com.liferay.portal.model.User fetchUser(long userId) { 943 return getService().fetchUser(userId); 944 } 945 946 /** 947 * Returns the user with the contact ID. 948 * 949 * @param contactId the user's contact ID 950 * @return the user with the contact ID, or <code>null</code> if a user with 951 the contact ID could not be found 952 */ 953 public static com.liferay.portal.model.User fetchUserByContactId( 954 long contactId) { 955 return getService().fetchUserByContactId(contactId); 956 } 957 958 /** 959 * Returns the user with the email address. 960 * 961 * @param companyId the primary key of the user's company 962 * @param emailAddress the user's email address 963 * @return the user with the email address, or <code>null</code> if a user 964 with the email address could not be found 965 */ 966 public static com.liferay.portal.model.User fetchUserByEmailAddress( 967 long companyId, java.lang.String emailAddress) { 968 return getService().fetchUserByEmailAddress(companyId, emailAddress); 969 } 970 971 /** 972 * Returns the user with the Facebook ID. 973 * 974 * @param companyId the primary key of the user's company 975 * @param facebookId the user's Facebook ID 976 * @return the user with the Facebook ID, or <code>null</code> if a user 977 with the Facebook ID could not be found 978 */ 979 public static com.liferay.portal.model.User fetchUserByFacebookId( 980 long companyId, long facebookId) { 981 return getService().fetchUserByFacebookId(companyId, facebookId); 982 } 983 984 /** 985 * Returns the user with the primary key. 986 * 987 * @param userId the primary key of the user 988 * @return the user with the primary key, or <code>null</code> if a user 989 with the primary key could not be found 990 */ 991 public static com.liferay.portal.model.User fetchUserById(long userId) { 992 return getService().fetchUserById(userId); 993 } 994 995 /** 996 * Returns the user with the OpenID. 997 * 998 * @param companyId the primary key of the user's company 999 * @param openId the user's OpenID 1000 * @return the user with the OpenID, or <code>null</code> if a user with the 1001 OpenID could not be found 1002 */ 1003 public static com.liferay.portal.model.User fetchUserByOpenId( 1004 long companyId, java.lang.String openId) { 1005 return getService().fetchUserByOpenId(companyId, openId); 1006 } 1007 1008 /** 1009 * Returns the user with the portrait ID. 1010 * 1011 * @param portraitId the user's portrait ID 1012 * @return the user with the portrait ID, or <code>null</code> if a user 1013 with the portrait ID could not be found 1014 */ 1015 public static com.liferay.portal.model.User fetchUserByPortraitId( 1016 long portraitId) { 1017 return getService().fetchUserByPortraitId(portraitId); 1018 } 1019 1020 /** 1021 * Returns the user with the screen name. 1022 * 1023 * @param companyId the primary key of the user's company 1024 * @param screenName the user's screen name 1025 * @return the user with the screen name, or <code>null</code> if a user 1026 with the screen name could not be found 1027 */ 1028 public static com.liferay.portal.model.User fetchUserByScreenName( 1029 long companyId, java.lang.String screenName) { 1030 return getService().fetchUserByScreenName(companyId, screenName); 1031 } 1032 1033 /** 1034 * Returns the user with the matching UUID and company. 1035 * 1036 * @param uuid the user's UUID 1037 * @param companyId the primary key of the company 1038 * @return the matching user, or <code>null</code> if a matching user could not be found 1039 */ 1040 public static com.liferay.portal.model.User fetchUserByUuidAndCompanyId( 1041 java.lang.String uuid, long companyId) { 1042 return getService().fetchUserByUuidAndCompanyId(uuid, companyId); 1043 } 1044 1045 public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 1046 return getService().getActionableDynamicQuery(); 1047 } 1048 1049 /** 1050 * Returns a range of all the users belonging to the company. 1051 * 1052 * <p> 1053 * Useful when paginating results. Returns a maximum of <code>end - 1054 * start</code> instances. <code>start</code> and <code>end</code> are not 1055 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1056 * refers to the first result in the set. Setting both <code>start</code> 1057 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1058 * result set. 1059 * </p> 1060 * 1061 * @param companyId the primary key of the company 1062 * @param start the lower bound of the range of users 1063 * @param end the upper bound of the range of users (not inclusive) 1064 * @return the range of users belonging to the company 1065 */ 1066 public static java.util.List<com.liferay.portal.model.User> getCompanyUsers( 1067 long companyId, int start, int end) { 1068 return getService().getCompanyUsers(companyId, start, end); 1069 } 1070 1071 /** 1072 * Returns the number of users belonging to the company. 1073 * 1074 * @param companyId the primary key of the company 1075 * @return the number of users belonging to the company 1076 */ 1077 public static int getCompanyUsersCount(long companyId) { 1078 return getService().getCompanyUsersCount(companyId); 1079 } 1080 1081 /** 1082 * Returns the default user for the company. 1083 * 1084 * @param companyId the primary key of the company 1085 * @return the default user for the company 1086 */ 1087 public static com.liferay.portal.model.User getDefaultUser(long companyId) 1088 throws com.liferay.portal.kernel.exception.PortalException { 1089 return getService().getDefaultUser(companyId); 1090 } 1091 1092 /** 1093 * Returns the primary key of the default user for the company. 1094 * 1095 * @param companyId the primary key of the company 1096 * @return the primary key of the default user for the company 1097 */ 1098 public static long getDefaultUserId(long companyId) 1099 throws com.liferay.portal.kernel.exception.PortalException { 1100 return getService().getDefaultUserId(companyId); 1101 } 1102 1103 public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery( 1104 com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext) { 1105 return getService().getExportActionableDynamicQuery(portletDataContext); 1106 } 1107 1108 /** 1109 * Returns the groupIds of the groups associated with the user. 1110 * 1111 * @param userId the userId of the user 1112 * @return long[] the groupIds of groups associated with the user 1113 */ 1114 public static long[] getGroupPrimaryKeys(long userId) { 1115 return getService().getGroupPrimaryKeys(userId); 1116 } 1117 1118 /** 1119 * Returns the primary keys of all the users belonging to the group. 1120 * 1121 * @param groupId the primary key of the group 1122 * @return the primary keys of the users belonging to the group 1123 */ 1124 public static long[] getGroupUserIds(long groupId) { 1125 return getService().getGroupUserIds(groupId); 1126 } 1127 1128 public static java.util.List<com.liferay.portal.model.User> getGroupUsers( 1129 long groupId) { 1130 return getService().getGroupUsers(groupId); 1131 } 1132 1133 public static java.util.List<com.liferay.portal.model.User> getGroupUsers( 1134 long groupId, int start, int end) { 1135 return getService().getGroupUsers(groupId, start, end); 1136 } 1137 1138 public static java.util.List<com.liferay.portal.model.User> getGroupUsers( 1139 long groupId, int start, int end, 1140 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.User> orderByComparator) { 1141 return getService().getGroupUsers(groupId, start, end, orderByComparator); 1142 } 1143 1144 public static int getGroupUsersCount(long groupId) { 1145 return getService().getGroupUsersCount(groupId); 1146 } 1147 1148 /** 1149 * Returns the number of users with the status belonging to the group. 1150 * 1151 * @param groupId the primary key of the group 1152 * @param status the workflow status 1153 * @return the number of users with the status belonging to the group 1154 */ 1155 public static int getGroupUsersCount(long groupId, int status) 1156 throws com.liferay.portal.kernel.exception.PortalException { 1157 return getService().getGroupUsersCount(groupId, status); 1158 } 1159 1160 public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 1161 return getService().getIndexableActionableDynamicQuery(); 1162 } 1163 1164 public static java.util.List<com.liferay.portal.model.User> getInheritedRoleUsers( 1165 long roleId, int start, int end, 1166 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.User> obc) 1167 throws com.liferay.portal.kernel.exception.PortalException { 1168 return getService().getInheritedRoleUsers(roleId, start, end, obc); 1169 } 1170 1171 /** 1172 * Returns all the users who have not had any announcements of the type 1173 * delivered, excluding the default user. 1174 * 1175 * @param type the type of announcement 1176 * @return the users who have not had any annoucements of the type delivered 1177 */ 1178 public static java.util.List<com.liferay.portal.model.User> getNoAnnouncementsDeliveries( 1179 java.lang.String type) { 1180 return getService().getNoAnnouncementsDeliveries(type); 1181 } 1182 1183 /** 1184 * Returns all the users who do not have any contacts. 1185 * 1186 * @return the users who do not have any contacts 1187 */ 1188 public static java.util.List<com.liferay.portal.model.User> getNoContacts() { 1189 return getService().getNoContacts(); 1190 } 1191 1192 /** 1193 * Returns all the users who do not belong to any groups, excluding the 1194 * default user. 1195 * 1196 * @return the users who do not belong to any groups 1197 */ 1198 public static java.util.List<com.liferay.portal.model.User> getNoGroups() { 1199 return getService().getNoGroups(); 1200 } 1201 1202 /** 1203 * Returns the OSGi service identifier. 1204 * 1205 * @return the OSGi service identifier 1206 */ 1207 public static java.lang.String getOSGiServiceIdentifier() { 1208 return getService().getOSGiServiceIdentifier(); 1209 } 1210 1211 /** 1212 * Returns the organizationIds of the organizations associated with the user. 1213 * 1214 * @param userId the userId of the user 1215 * @return long[] the organizationIds of organizations associated with the user 1216 */ 1217 public static long[] getOrganizationPrimaryKeys(long userId) { 1218 return getService().getOrganizationPrimaryKeys(userId); 1219 } 1220 1221 /** 1222 * Returns the primary keys of all the users belonging to the organization. 1223 * 1224 * @param organizationId the primary key of the organization 1225 * @return the primary keys of the users belonging to the organization 1226 */ 1227 public static long[] getOrganizationUserIds(long organizationId) { 1228 return getService().getOrganizationUserIds(organizationId); 1229 } 1230 1231 public static java.util.List<com.liferay.portal.model.User> getOrganizationUsers( 1232 long organizationId) { 1233 return getService().getOrganizationUsers(organizationId); 1234 } 1235 1236 public static java.util.List<com.liferay.portal.model.User> getOrganizationUsers( 1237 long organizationId, int start, int end) { 1238 return getService().getOrganizationUsers(organizationId, start, end); 1239 } 1240 1241 public static java.util.List<com.liferay.portal.model.User> getOrganizationUsers( 1242 long organizationId, int start, int end, 1243 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.User> orderByComparator) { 1244 return getService() 1245 .getOrganizationUsers(organizationId, start, end, 1246 orderByComparator); 1247 } 1248 1249 public static int getOrganizationUsersCount(long organizationId) { 1250 return getService().getOrganizationUsersCount(organizationId); 1251 } 1252 1253 /** 1254 * Returns the number of users with the status belonging to the 1255 * organization. 1256 * 1257 * @param organizationId the primary key of the organization 1258 * @param status the workflow status 1259 * @return the number of users with the status belonging to the organization 1260 */ 1261 public static int getOrganizationUsersCount(long organizationId, int status) 1262 throws com.liferay.portal.kernel.exception.PortalException { 1263 return getService().getOrganizationUsersCount(organizationId, status); 1264 } 1265 1266 public static com.liferay.portal.model.PersistedModel getPersistedModel( 1267 java.io.Serializable primaryKeyObj) 1268 throws com.liferay.portal.kernel.exception.PortalException { 1269 return getService().getPersistedModel(primaryKeyObj); 1270 } 1271 1272 /** 1273 * Returns the roleIds of the roles associated with the user. 1274 * 1275 * @param userId the userId of the user 1276 * @return long[] the roleIds of roles associated with the user 1277 */ 1278 public static long[] getRolePrimaryKeys(long userId) { 1279 return getService().getRolePrimaryKeys(userId); 1280 } 1281 1282 /** 1283 * Returns the primary keys of all the users belonging to the role. 1284 * 1285 * @param roleId the primary key of the role 1286 * @return the primary keys of the users belonging to the role 1287 */ 1288 public static long[] getRoleUserIds(long roleId) { 1289 return getService().getRoleUserIds(roleId); 1290 } 1291 1292 public static java.util.List<com.liferay.portal.model.User> getRoleUsers( 1293 long roleId) { 1294 return getService().getRoleUsers(roleId); 1295 } 1296 1297 public static java.util.List<com.liferay.portal.model.User> getRoleUsers( 1298 long roleId, int start, int end) { 1299 return getService().getRoleUsers(roleId, start, end); 1300 } 1301 1302 public static java.util.List<com.liferay.portal.model.User> getRoleUsers( 1303 long roleId, int start, int end, 1304 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.User> orderByComparator) { 1305 return getService().getRoleUsers(roleId, start, end, orderByComparator); 1306 } 1307 1308 public static int getRoleUsersCount(long roleId) { 1309 return getService().getRoleUsersCount(roleId); 1310 } 1311 1312 /** 1313 * Returns the number of users with the status belonging to the role. 1314 * 1315 * @param roleId the primary key of the role 1316 * @param status the workflow status 1317 * @return the number of users with the status belonging to the role 1318 */ 1319 public static int getRoleUsersCount(long roleId, int status) 1320 throws com.liferay.portal.kernel.exception.PortalException { 1321 return getService().getRoleUsersCount(roleId, status); 1322 } 1323 1324 public static java.util.List<com.liferay.portal.model.User> getSocialUsers( 1325 long userId, int socialRelationType, 1326 java.lang.String socialRelationTypeComparator, int start, int end, 1327 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.User> obc) 1328 throws com.liferay.portal.kernel.exception.PortalException { 1329 return getService() 1330 .getSocialUsers(userId, socialRelationType, 1331 socialRelationTypeComparator, start, end, obc); 1332 } 1333 1334 /** 1335 * Returns an ordered range of all the users with a social relation of the 1336 * type with the user. 1337 * 1338 * <p> 1339 * Useful when paginating results. Returns a maximum of <code>end - 1340 * start</code> instances. <code>start</code> and <code>end</code> are not 1341 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1342 * refers to the first result in the set. Setting both <code>start</code> 1343 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1344 * result set. 1345 * </p> 1346 * 1347 * @param userId the primary key of the user 1348 * @param socialRelationType the type of social relation. The possible 1349 types can be found in {@link SocialRelationConstants}. 1350 * @param start the lower bound of the range of users 1351 * @param end the upper bound of the range of users (not inclusive) 1352 * @param obc the comparator to order the users by (optionally 1353 <code>null</code>) 1354 * @return the ordered range of users with a social relation of the type 1355 with the user 1356 * @deprecated As of 7.0.0, replaced by {@link #getSocialUsers(long, int, 1357 String, int, int, OrderByComparator)} 1358 */ 1359 @Deprecated 1360 public static java.util.List<com.liferay.portal.model.User> getSocialUsers( 1361 long userId, int socialRelationType, int start, int end, 1362 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.User> obc) 1363 throws com.liferay.portal.kernel.exception.PortalException { 1364 return getService() 1365 .getSocialUsers(userId, socialRelationType, start, end, obc); 1366 } 1367 1368 /** 1369 * Returns an ordered range of all the users with a social relation with the 1370 * user. 1371 * 1372 * <p> 1373 * Useful when paginating results. Returns a maximum of <code>end - 1374 * start</code> instances. <code>start</code> and <code>end</code> are not 1375 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1376 * refers to the first result in the set. Setting both <code>start</code> 1377 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1378 * result set. 1379 * </p> 1380 * 1381 * @param userId the primary key of the user 1382 * @param start the lower bound of the range of users 1383 * @param end the upper bound of the range of users (not inclusive) 1384 * @param obc the comparator to order the users by (optionally 1385 <code>null</code>) 1386 * @return the ordered range of users with a social relation with the 1387 user 1388 * @deprecated As of 7.0.0, replaced by {@link #getSocialUsers(long, int, 1389 String, int, int, OrderByComparator)} 1390 */ 1391 @Deprecated 1392 public static java.util.List<com.liferay.portal.model.User> getSocialUsers( 1393 long userId, int start, int end, 1394 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.User> obc) 1395 throws com.liferay.portal.kernel.exception.PortalException { 1396 return getService().getSocialUsers(userId, start, end, obc); 1397 } 1398 1399 /** 1400 * Returns an ordered range of all the users with a mutual social relation 1401 * of the type with both of the given users. 1402 * 1403 * <p> 1404 * Useful when paginating results. Returns a maximum of <code>end - 1405 * start</code> instances. <code>start</code> and <code>end</code> are not 1406 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1407 * refers to the first result in the set. Setting both <code>start</code> 1408 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1409 * result set. 1410 * </p> 1411 * 1412 * @param userId1 the primary key of the first user 1413 * @param userId2 the primary key of the second user 1414 * @param socialRelationType the type of social relation. The possible 1415 types can be found in {@link SocialRelationConstants}. 1416 * @param start the lower bound of the range of users 1417 * @param end the upper bound of the range of users (not inclusive) 1418 * @param obc the comparator to order the users by (optionally 1419 <code>null</code>) 1420 * @return the ordered range of users with a mutual social relation of the 1421 type with the user 1422 */ 1423 public static java.util.List<com.liferay.portal.model.User> getSocialUsers( 1424 long userId1, long userId2, int socialRelationType, int start, int end, 1425 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.User> obc) 1426 throws com.liferay.portal.kernel.exception.PortalException { 1427 return getService() 1428 .getSocialUsers(userId1, userId2, socialRelationType, start, 1429 end, obc); 1430 } 1431 1432 /** 1433 * Returns an ordered range of all the users with a mutual social relation 1434 * with both of the given users. 1435 * 1436 * <p> 1437 * Useful when paginating results. Returns a maximum of <code>end - 1438 * start</code> instances. <code>start</code> and <code>end</code> are not 1439 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1440 * refers to the first result in the set. Setting both <code>start</code> 1441 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1442 * result set. 1443 * </p> 1444 * 1445 * @param userId1 the primary key of the first user 1446 * @param userId2 the primary key of the second user 1447 * @param start the lower bound of the range of users 1448 * @param end the upper bound of the range of users (not inclusive) 1449 * @param obc the comparator to order the users by (optionally 1450 <code>null</code>) 1451 * @return the ordered range of users with a mutual social relation with the 1452 user 1453 */ 1454 public static java.util.List<com.liferay.portal.model.User> getSocialUsers( 1455 long userId1, long userId2, int start, int end, 1456 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.User> obc) 1457 throws com.liferay.portal.kernel.exception.PortalException { 1458 return getService().getSocialUsers(userId1, userId2, start, end, obc); 1459 } 1460 1461 /** 1462 * Returns the number of users with a social relation with the user. 1463 * 1464 * @param userId the primary key of the user 1465 * @return the number of users with a social relation with the user 1466 * @deprecated As of 7.0.0, replaced by {@link #getSocialUsersCount(long, 1467 int, String)} 1468 */ 1469 @Deprecated 1470 public static int getSocialUsersCount(long userId) 1471 throws com.liferay.portal.kernel.exception.PortalException { 1472 return getService().getSocialUsersCount(userId); 1473 } 1474 1475 /** 1476 * Returns the number of users with a social relation of the type with the 1477 * user. 1478 * 1479 * @param userId the primary key of the user 1480 * @param socialRelationType the type of social relation. The possible 1481 types can be found in {@link SocialRelationConstants}. 1482 * @return the number of users with a social relation of the type with 1483 the user 1484 * @deprecated As of 7.0.0, replaced by {@link #getSocialUsersCount(long, 1485 int, String)} 1486 */ 1487 @Deprecated 1488 public static int getSocialUsersCount(long userId, int socialRelationType) 1489 throws com.liferay.portal.kernel.exception.PortalException { 1490 return getService().getSocialUsersCount(userId, socialRelationType); 1491 } 1492 1493 /** 1494 * Returns the number of users with a social relation with the user. 1495 * 1496 * @param userId the primary key of the user 1497 * @param socialRelationType the type of social relation. The possible 1498 types can be found in {@link SocialRelationConstants}. 1499 * @return the number of users with a social relation with the user 1500 */ 1501 public static int getSocialUsersCount(long userId, int socialRelationType, 1502 java.lang.String socialRelationTypeComparator) 1503 throws com.liferay.portal.kernel.exception.PortalException { 1504 return getService() 1505 .getSocialUsersCount(userId, socialRelationType, 1506 socialRelationTypeComparator); 1507 } 1508 1509 /** 1510 * Returns the number of users with a mutual social relation with both of 1511 * the given users. 1512 * 1513 * @param userId1 the primary key of the first user 1514 * @param userId2 the primary key of the second user 1515 * @return the number of users with a mutual social relation with the user 1516 */ 1517 public static int getSocialUsersCount(long userId1, long userId2) 1518 throws com.liferay.portal.kernel.exception.PortalException { 1519 return getService().getSocialUsersCount(userId1, userId2); 1520 } 1521 1522 /** 1523 * Returns the number of users with a mutual social relation of the type 1524 * with both of the given users. 1525 * 1526 * @param userId1 the primary key of the first user 1527 * @param userId2 the primary key of the second user 1528 * @param socialRelationType the type of social relation. The possible 1529 types can be found in {@link SocialRelationConstants}. 1530 * @return the number of users with a mutual social relation of the type 1531 with the user 1532 */ 1533 public static int getSocialUsersCount(long userId1, long userId2, 1534 int socialRelationType) 1535 throws com.liferay.portal.kernel.exception.PortalException { 1536 return getService() 1537 .getSocialUsersCount(userId1, userId2, socialRelationType); 1538 } 1539 1540 /** 1541 * Returns the teamIds of the teams associated with the user. 1542 * 1543 * @param userId the userId of the user 1544 * @return long[] the teamIds of teams associated with the user 1545 */ 1546 public static long[] getTeamPrimaryKeys(long userId) { 1547 return getService().getTeamPrimaryKeys(userId); 1548 } 1549 1550 public static java.util.List<com.liferay.portal.model.User> getTeamUsers( 1551 long teamId) { 1552 return getService().getTeamUsers(teamId); 1553 } 1554 1555 public static java.util.List<com.liferay.portal.model.User> getTeamUsers( 1556 long teamId, int start, int end) { 1557 return getService().getTeamUsers(teamId, start, end); 1558 } 1559 1560 public static java.util.List<com.liferay.portal.model.User> getTeamUsers( 1561 long teamId, int start, int end, 1562 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.User> orderByComparator) { 1563 return getService().getTeamUsers(teamId, start, end, orderByComparator); 1564 } 1565 1566 public static int getTeamUsersCount(long teamId) { 1567 return getService().getTeamUsersCount(teamId); 1568 } 1569 1570 /** 1571 * Returns the user with the primary key. 1572 * 1573 * @param userId the primary key of the user 1574 * @return the user 1575 * @throws PortalException if a user with the primary key could not be found 1576 */ 1577 public static com.liferay.portal.model.User getUser(long userId) 1578 throws com.liferay.portal.kernel.exception.PortalException { 1579 return getService().getUser(userId); 1580 } 1581 1582 /** 1583 * Returns the user with the contact ID. 1584 * 1585 * @param contactId the user's contact ID 1586 * @return the user with the contact ID 1587 */ 1588 public static com.liferay.portal.model.User getUserByContactId( 1589 long contactId) 1590 throws com.liferay.portal.kernel.exception.PortalException { 1591 return getService().getUserByContactId(contactId); 1592 } 1593 1594 /** 1595 * Returns the user with the email address. 1596 * 1597 * @param companyId the primary key of the user's company 1598 * @param emailAddress the user's email address 1599 * @return the user with the email address 1600 */ 1601 public static com.liferay.portal.model.User getUserByEmailAddress( 1602 long companyId, java.lang.String emailAddress) 1603 throws com.liferay.portal.kernel.exception.PortalException { 1604 return getService().getUserByEmailAddress(companyId, emailAddress); 1605 } 1606 1607 /** 1608 * Returns the user with the Facebook ID. 1609 * 1610 * @param companyId the primary key of the user's company 1611 * @param facebookId the user's Facebook ID 1612 * @return the user with the Facebook ID 1613 */ 1614 public static com.liferay.portal.model.User getUserByFacebookId( 1615 long companyId, long facebookId) 1616 throws com.liferay.portal.kernel.exception.PortalException { 1617 return getService().getUserByFacebookId(companyId, facebookId); 1618 } 1619 1620 /** 1621 * Returns the user with the primary key from the company. 1622 * 1623 * @param companyId the primary key of the user's company 1624 * @param userId the primary key of the user 1625 * @return the user with the primary key 1626 */ 1627 public static com.liferay.portal.model.User getUserById(long companyId, 1628 long userId) throws com.liferay.portal.kernel.exception.PortalException { 1629 return getService().getUserById(companyId, userId); 1630 } 1631 1632 /** 1633 * Returns the user with the primary key. 1634 * 1635 * @param userId the primary key of the user 1636 * @return the user with the primary key 1637 */ 1638 public static com.liferay.portal.model.User getUserById(long userId) 1639 throws com.liferay.portal.kernel.exception.PortalException { 1640 return getService().getUserById(userId); 1641 } 1642 1643 /** 1644 * Returns the user with the OpenID. 1645 * 1646 * @param companyId the primary key of the user's company 1647 * @param openId the user's OpenID 1648 * @return the user with the OpenID 1649 */ 1650 public static com.liferay.portal.model.User getUserByOpenId( 1651 long companyId, java.lang.String openId) 1652 throws com.liferay.portal.kernel.exception.PortalException { 1653 return getService().getUserByOpenId(companyId, openId); 1654 } 1655 1656 /** 1657 * Returns the user with the portrait ID. 1658 * 1659 * @param portraitId the user's portrait ID 1660 * @return the user with the portrait ID 1661 */ 1662 public static com.liferay.portal.model.User getUserByPortraitId( 1663 long portraitId) 1664 throws com.liferay.portal.kernel.exception.PortalException { 1665 return getService().getUserByPortraitId(portraitId); 1666 } 1667 1668 /** 1669 * Returns the user with the screen name. 1670 * 1671 * @param companyId the primary key of the user's company 1672 * @param screenName the user's screen name 1673 * @return the user with the screen name 1674 */ 1675 public static com.liferay.portal.model.User getUserByScreenName( 1676 long companyId, java.lang.String screenName) 1677 throws com.liferay.portal.kernel.exception.PortalException { 1678 return getService().getUserByScreenName(companyId, screenName); 1679 } 1680 1681 /** 1682 * Returns the user with the UUID. 1683 * 1684 * @param uuid the user's UUID 1685 * @return the user with the UUID 1686 * @deprecated As of 6.2.0, replaced by {@link 1687 #getUserByUuidAndCompanyId(String, long)} 1688 */ 1689 @Deprecated 1690 public static com.liferay.portal.model.User getUserByUuid( 1691 java.lang.String uuid) 1692 throws com.liferay.portal.kernel.exception.PortalException { 1693 return getService().getUserByUuid(uuid); 1694 } 1695 1696 /** 1697 * Returns the user with the matching UUID and company. 1698 * 1699 * @param uuid the user's UUID 1700 * @param companyId the primary key of the company 1701 * @return the matching user 1702 * @throws PortalException if a matching user could not be found 1703 */ 1704 public static com.liferay.portal.model.User getUserByUuidAndCompanyId( 1705 java.lang.String uuid, long companyId) 1706 throws com.liferay.portal.kernel.exception.PortalException { 1707 return getService().getUserByUuidAndCompanyId(uuid, companyId); 1708 } 1709 1710 /** 1711 * Returns the userGroupIds of the user groups associated with the user. 1712 * 1713 * @param userId the userId of the user 1714 * @return long[] the userGroupIds of user groups associated with the user 1715 */ 1716 public static long[] getUserGroupPrimaryKeys(long userId) { 1717 return getService().getUserGroupPrimaryKeys(userId); 1718 } 1719 1720 public static java.util.List<com.liferay.portal.model.User> getUserGroupUsers( 1721 long userGroupId) { 1722 return getService().getUserGroupUsers(userGroupId); 1723 } 1724 1725 public static java.util.List<com.liferay.portal.model.User> getUserGroupUsers( 1726 long userGroupId, int start, int end) { 1727 return getService().getUserGroupUsers(userGroupId, start, end); 1728 } 1729 1730 public static java.util.List<com.liferay.portal.model.User> getUserGroupUsers( 1731 long userGroupId, int start, int end, 1732 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.User> orderByComparator) { 1733 return getService() 1734 .getUserGroupUsers(userGroupId, start, end, orderByComparator); 1735 } 1736 1737 public static int getUserGroupUsersCount(long userGroupId) { 1738 return getService().getUserGroupUsersCount(userGroupId); 1739 } 1740 1741 /** 1742 * Returns the number of users with the status belonging to the user group. 1743 * 1744 * @param userGroupId the primary key of the user group 1745 * @param status the workflow status 1746 * @return the number of users with the status belonging to the user group 1747 */ 1748 public static int getUserGroupUsersCount(long userGroupId, int status) 1749 throws com.liferay.portal.kernel.exception.PortalException { 1750 return getService().getUserGroupUsersCount(userGroupId, status); 1751 } 1752 1753 /** 1754 * Returns the primary key of the user with the email address. 1755 * 1756 * @param companyId the primary key of the user's company 1757 * @param emailAddress the user's email address 1758 * @return the primary key of the user with the email address 1759 */ 1760 public static long getUserIdByEmailAddress(long companyId, 1761 java.lang.String emailAddress) 1762 throws com.liferay.portal.kernel.exception.PortalException { 1763 return getService().getUserIdByEmailAddress(companyId, emailAddress); 1764 } 1765 1766 /** 1767 * Returns the primary key of the user with the screen name. 1768 * 1769 * @param companyId the primary key of the user's company 1770 * @param screenName the user's screen name 1771 * @return the primary key of the user with the screen name 1772 */ 1773 public static long getUserIdByScreenName(long companyId, 1774 java.lang.String screenName) 1775 throws com.liferay.portal.kernel.exception.PortalException { 1776 return getService().getUserIdByScreenName(companyId, screenName); 1777 } 1778 1779 /** 1780 * Returns a range of all the users. 1781 * 1782 * <p> 1783 * 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.UserModelImpl}. 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. 1784 * </p> 1785 * 1786 * @param start the lower bound of the range of users 1787 * @param end the upper bound of the range of users (not inclusive) 1788 * @return the range of users 1789 */ 1790 public static java.util.List<com.liferay.portal.model.User> getUsers( 1791 int start, int end) { 1792 return getService().getUsers(start, end); 1793 } 1794 1795 /** 1796 * Returns the number of users. 1797 * 1798 * @return the number of users 1799 */ 1800 public static int getUsersCount() { 1801 return getService().getUsersCount(); 1802 } 1803 1804 public static boolean hasGroupUser(long groupId, long userId) { 1805 return getService().hasGroupUser(groupId, userId); 1806 } 1807 1808 public static boolean hasGroupUsers(long groupId) { 1809 return getService().hasGroupUsers(groupId); 1810 } 1811 1812 public static boolean hasOrganizationUser(long organizationId, long userId) { 1813 return getService().hasOrganizationUser(organizationId, userId); 1814 } 1815 1816 public static boolean hasOrganizationUsers(long organizationId) { 1817 return getService().hasOrganizationUsers(organizationId); 1818 } 1819 1820 /** 1821 * Returns <code>true</code> if the password policy has been assigned to the 1822 * user. 1823 * 1824 * @param passwordPolicyId the primary key of the password policy 1825 * @param userId the primary key of the user 1826 * @return <code>true</code> if the password policy is assigned to the user; 1827 <code>false</code> otherwise 1828 */ 1829 public static boolean hasPasswordPolicyUser(long passwordPolicyId, 1830 long userId) { 1831 return getService().hasPasswordPolicyUser(passwordPolicyId, userId); 1832 } 1833 1834 /** 1835 * Returns <code>true</code> if the user has the role with the name, 1836 * optionally through inheritance. 1837 * 1838 * @param companyId the primary key of the role's company 1839 * @param name the name of the role (must be a regular role, not an 1840 organization, site or provider role) 1841 * @param userId the primary key of the user 1842 * @param inherited whether to include roles inherited from organizations, 1843 sites, etc. 1844 * @return <code>true</code> if the user has the role; <code>false</code> 1845 otherwise 1846 */ 1847 public static boolean hasRoleUser(long companyId, java.lang.String name, 1848 long userId, boolean inherited) 1849 throws com.liferay.portal.kernel.exception.PortalException { 1850 return getService().hasRoleUser(companyId, name, userId, inherited); 1851 } 1852 1853 public static boolean hasRoleUser(long roleId, long userId) { 1854 return getService().hasRoleUser(roleId, userId); 1855 } 1856 1857 public static boolean hasRoleUsers(long roleId) { 1858 return getService().hasRoleUsers(roleId); 1859 } 1860 1861 public static boolean hasTeamUser(long teamId, long userId) { 1862 return getService().hasTeamUser(teamId, userId); 1863 } 1864 1865 public static boolean hasTeamUsers(long teamId) { 1866 return getService().hasTeamUsers(teamId); 1867 } 1868 1869 public static boolean hasUserGroupUser(long userGroupId, long userId) { 1870 return getService().hasUserGroupUser(userGroupId, userId); 1871 } 1872 1873 public static boolean hasUserGroupUsers(long userGroupId) { 1874 return getService().hasUserGroupUsers(userGroupId); 1875 } 1876 1877 /** 1878 * Returns <code>true</code> if the user's password is expired. 1879 * 1880 * @param user the user 1881 * @return <code>true</code> if the user's password is expired; 1882 <code>false</code> otherwise 1883 */ 1884 public static boolean isPasswordExpired(com.liferay.portal.model.User user) 1885 throws com.liferay.portal.kernel.exception.PortalException { 1886 return getService().isPasswordExpired(user); 1887 } 1888 1889 /** 1890 * Returns <code>true</code> if the password policy is configured to warn 1891 * the user that his password is expiring and the remaining time until 1892 * expiration is equal or less than the configured warning time. 1893 * 1894 * @param user the user 1895 * @return <code>true</code> if the user's password is expiring soon; 1896 <code>false</code> otherwise 1897 */ 1898 public static boolean isPasswordExpiringSoon( 1899 com.liferay.portal.model.User user) 1900 throws com.liferay.portal.kernel.exception.PortalException { 1901 return getService().isPasswordExpiringSoon(user); 1902 } 1903 1904 /** 1905 * Returns the default user for the company. 1906 * 1907 * @param companyId the primary key of the company 1908 * @return the default user for the company 1909 */ 1910 public static com.liferay.portal.model.User loadGetDefaultUser( 1911 long companyId) 1912 throws com.liferay.portal.kernel.exception.PortalException { 1913 return getService().loadGetDefaultUser(companyId); 1914 } 1915 1916 /** 1917 * Returns an ordered range of all the users with the status, and whose 1918 * first name, middle name, last name, screen name, and email address match 1919 * the keywords specified for them, without using the indexer. It is 1920 * preferable to use the indexed version {@link #search(long, String, 1921 * String, String, String, String, int, LinkedHashMap, boolean, int, int, 1922 * Sort)} instead of this method wherever possible for performance reasons. 1923 * 1924 * <p> 1925 * Useful when paginating results. Returns a maximum of <code>end - 1926 * start</code> instances. <code>start</code> and <code>end</code> are not 1927 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1928 * refers to the first result in the set. Setting both <code>start</code> 1929 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1930 * result set. 1931 * </p> 1932 * 1933 * @param companyId the primary key of the user's company 1934 * @param firstName the first name keywords (space separated) 1935 * @param middleName the middle name keywords 1936 * @param lastName the last name keywords 1937 * @param screenName the screen name keywords 1938 * @param emailAddress the email address keywords 1939 * @param status the workflow status 1940 * @param params the finder parameters (optionally <code>null</code>). For 1941 more information see {@link 1942 com.liferay.portal.service.persistence.UserFinder}. 1943 * @param andSearch whether every field must match its keywords, or just 1944 one field. For example, "users with the first name 'bob' and 1945 last name 'smith'" vs "users with the first name 'bob' 1946 or the last name 'smith'". 1947 * @param start the lower bound of the range of users 1948 * @param end the upper bound of the range of users (not inclusive) 1949 * @param obc the comparator to order the users by (optionally 1950 <code>null</code>) 1951 * @return the matching users 1952 * @see com.liferay.portal.service.persistence.UserFinder 1953 */ 1954 public static java.util.List<com.liferay.portal.model.User> search( 1955 long companyId, java.lang.String firstName, 1956 java.lang.String middleName, java.lang.String lastName, 1957 java.lang.String screenName, java.lang.String emailAddress, int status, 1958 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1959 boolean andSearch, int start, int end, 1960 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.User> obc) { 1961 return getService() 1962 .search(companyId, firstName, middleName, lastName, 1963 screenName, emailAddress, status, params, andSearch, start, end, obc); 1964 } 1965 1966 /** 1967 * Returns an ordered range of all the users with the status, and whose 1968 * first name, middle name, last name, screen name, and email address match 1969 * the keywords specified for them, using the indexer. It is preferable to 1970 * use this method instead of the non-indexed version whenever possible for 1971 * performance reasons. 1972 * 1973 * <p> 1974 * Useful when paginating results. Returns a maximum of <code>end - 1975 * start</code> instances. <code>start</code> and <code>end</code> are not 1976 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1977 * refers to the first result in the set. Setting both <code>start</code> 1978 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1979 * result set. 1980 * </p> 1981 * 1982 * @param companyId the primary key of the user's company 1983 * @param firstName the first name keywords (space separated) 1984 * @param middleName the middle name keywords 1985 * @param lastName the last name keywords 1986 * @param screenName the screen name keywords 1987 * @param emailAddress the email address keywords 1988 * @param status the workflow status 1989 * @param params the indexer parameters (optionally <code>null</code>). For 1990 more information see {@link 1991 com.liferay.portlet.usersadmin.util.UserIndexer}. 1992 * @param andSearch whether every field must match its keywords, or just 1993 one field. For example, "users with the first name 'bob' and 1994 last name 'smith'" vs "users with the first name 'bob' 1995 or the last name 'smith'". 1996 * @param start the lower bound of the range of users 1997 * @param end the upper bound of the range of users (not inclusive) 1998 * @param sort the field and direction to sort by (optionally 1999 <code>null</code>) 2000 * @return the matching users 2001 * @see com.liferay.portlet.usersadmin.util.UserIndexer 2002 */ 2003 public static com.liferay.portal.kernel.search.Hits search(long companyId, 2004 java.lang.String firstName, java.lang.String middleName, 2005 java.lang.String lastName, java.lang.String screenName, 2006 java.lang.String emailAddress, int status, 2007 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2008 boolean andSearch, int start, int end, 2009 com.liferay.portal.kernel.search.Sort sort) { 2010 return getService() 2011 .search(companyId, firstName, middleName, lastName, 2012 screenName, emailAddress, status, params, andSearch, start, end, 2013 sort); 2014 } 2015 2016 public static com.liferay.portal.kernel.search.Hits search(long companyId, 2017 java.lang.String firstName, java.lang.String middleName, 2018 java.lang.String lastName, java.lang.String screenName, 2019 java.lang.String emailAddress, int status, 2020 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2021 boolean andSearch, int start, int end, 2022 com.liferay.portal.kernel.search.Sort[] sorts) { 2023 return getService() 2024 .search(companyId, firstName, middleName, lastName, 2025 screenName, emailAddress, status, params, andSearch, start, end, 2026 sorts); 2027 } 2028 2029 /** 2030 * Returns an ordered range of all the users who match the keywords and 2031 * status, without using the indexer. It is preferable to use the indexed 2032 * version {@link #search(long, String, int, LinkedHashMap, int, int, Sort)} 2033 * instead of this method wherever possible for performance reasons. 2034 * 2035 * <p> 2036 * Useful when paginating results. Returns a maximum of <code>end - 2037 * start</code> instances. <code>start</code> and <code>end</code> are not 2038 * primary keys, they are indexes in the result set. Thus, <code>0</code> 2039 * refers to the first result in the set. Setting both <code>start</code> 2040 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 2041 * result set. 2042 * </p> 2043 * 2044 * @param companyId the primary key of the user's company 2045 * @param keywords the keywords (space separated), which may occur in the 2046 user's first name, middle name, last name, screen name, or email 2047 address 2048 * @param status the workflow status 2049 * @param params the finder parameters (optionally <code>null</code>). For 2050 more information see {@link 2051 com.liferay.portal.service.persistence.UserFinder}. 2052 * @param start the lower bound of the range of users 2053 * @param end the upper bound of the range of users (not inclusive) 2054 * @param obc the comparator to order the users by (optionally 2055 <code>null</code>) 2056 * @return the matching users 2057 * @see com.liferay.portal.service.persistence.UserFinder 2058 */ 2059 public static java.util.List<com.liferay.portal.model.User> search( 2060 long companyId, java.lang.String keywords, int status, 2061 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2062 int start, int end, 2063 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.User> obc) { 2064 return getService() 2065 .search(companyId, keywords, status, params, start, end, obc); 2066 } 2067 2068 /** 2069 * Returns an ordered range of all the users who match the keywords and 2070 * status, using the indexer. It is preferable to use this method instead of 2071 * the non-indexed version whenever possible for performance reasons. 2072 * 2073 * <p> 2074 * Useful when paginating results. Returns a maximum of <code>end - 2075 * start</code> instances. <code>start</code> and <code>end</code> are not 2076 * primary keys, they are indexes in the result set. Thus, <code>0</code> 2077 * refers to the first result in the set. Setting both <code>start</code> 2078 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 2079 * result set. 2080 * </p> 2081 * 2082 * @param companyId the primary key of the user's company 2083 * @param keywords the keywords (space separated), which may occur in the 2084 user's first name, middle name, last name, screen name, or email 2085 address 2086 * @param status the workflow status 2087 * @param params the indexer parameters (optionally <code>null</code>). For 2088 more information see {@link 2089 com.liferay.portlet.usersadmin.util.UserIndexer}. 2090 * @param start the lower bound of the range of users 2091 * @param end the upper bound of the range of users (not inclusive) 2092 * @param sort the field and direction to sort by (optionally 2093 <code>null</code>) 2094 * @return the matching users 2095 * @see com.liferay.portlet.usersadmin.util.UserIndexer 2096 */ 2097 public static com.liferay.portal.kernel.search.Hits search(long companyId, 2098 java.lang.String keywords, int status, 2099 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2100 int start, int end, com.liferay.portal.kernel.search.Sort sort) { 2101 return getService() 2102 .search(companyId, keywords, status, params, start, end, sort); 2103 } 2104 2105 public static com.liferay.portal.kernel.search.Hits search(long companyId, 2106 java.lang.String keywords, int status, 2107 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2108 int start, int end, com.liferay.portal.kernel.search.Sort[] sorts) { 2109 return getService() 2110 .search(companyId, keywords, status, params, start, end, 2111 sorts); 2112 } 2113 2114 /** 2115 * Returns the number of users with the status, and whose first name, middle 2116 * name, last name, screen name, and email address match the keywords 2117 * specified for them. 2118 * 2119 * @param companyId the primary key of the user's company 2120 * @param firstName the first name keywords (space separated) 2121 * @param middleName the middle name keywords 2122 * @param lastName the last name keywords 2123 * @param screenName the screen name keywords 2124 * @param emailAddress the email address keywords 2125 * @param status the workflow status 2126 * @param params the finder parameters (optionally <code>null</code>). For 2127 more information see {@link 2128 com.liferay.portal.service.persistence.UserFinder}. 2129 * @param andSearch whether every field must match its keywords, or just 2130 one field. For example, "users with the first name 'bob' and 2131 last name 'smith'" vs "users with the first name 'bob' 2132 or the last name 'smith'". 2133 * @return the number of matching users 2134 */ 2135 public static int searchCount(long companyId, java.lang.String firstName, 2136 java.lang.String middleName, java.lang.String lastName, 2137 java.lang.String screenName, java.lang.String emailAddress, int status, 2138 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2139 boolean andSearch) { 2140 return getService() 2141 .searchCount(companyId, firstName, middleName, lastName, 2142 screenName, emailAddress, status, params, andSearch); 2143 } 2144 2145 /** 2146 * Returns the number of users who match the keywords and status. 2147 * 2148 * @param companyId the primary key of the user's company 2149 * @param keywords the keywords (space separated), which may occur in the 2150 user's first name, middle name, last name, screen name, or email 2151 address 2152 * @param status the workflow status 2153 * @param params the finder parameters (optionally <code>null</code>). For 2154 more information see {@link 2155 com.liferay.portal.service.persistence.UserFinder}. 2156 * @return the number matching users 2157 */ 2158 public static int searchCount(long companyId, java.lang.String keywords, 2159 int status, 2160 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) { 2161 return getService().searchCount(companyId, keywords, status, params); 2162 } 2163 2164 public static java.util.Map<java.lang.Long, java.lang.Integer> searchCounts( 2165 long companyId, int status, long[] groupIds) { 2166 return getService().searchCounts(companyId, status, groupIds); 2167 } 2168 2169 public static java.util.List<com.liferay.portal.model.User> searchSocial( 2170 long companyId, long[] groupIds, java.lang.String keywords, int start, 2171 int end) { 2172 return getService() 2173 .searchSocial(companyId, groupIds, keywords, start, end); 2174 } 2175 2176 public static java.util.List<com.liferay.portal.model.User> searchSocial( 2177 long[] groupIds, long userId, int[] socialRelationTypes, 2178 java.lang.String keywords, int start, int end) 2179 throws com.liferay.portal.kernel.exception.PortalException { 2180 return getService() 2181 .searchSocial(groupIds, userId, socialRelationTypes, 2182 keywords, start, end); 2183 } 2184 2185 public static java.util.List<com.liferay.portal.model.User> searchSocial( 2186 long userId, int[] socialRelationTypes, java.lang.String keywords, 2187 int start, int end) 2188 throws com.liferay.portal.kernel.exception.PortalException { 2189 return getService() 2190 .searchSocial(userId, socialRelationTypes, keywords, start, 2191 end); 2192 } 2193 2194 public static com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portal.model.User> searchUsers( 2195 long companyId, java.lang.String firstName, 2196 java.lang.String middleName, java.lang.String lastName, 2197 java.lang.String screenName, java.lang.String emailAddress, int status, 2198 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2199 boolean andSearch, int start, int end, 2200 com.liferay.portal.kernel.search.Sort sort) 2201 throws com.liferay.portal.kernel.exception.PortalException { 2202 return getService() 2203 .searchUsers(companyId, firstName, middleName, lastName, 2204 screenName, emailAddress, status, params, andSearch, start, end, 2205 sort); 2206 } 2207 2208 public static com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portal.model.User> searchUsers( 2209 long companyId, java.lang.String firstName, 2210 java.lang.String middleName, java.lang.String lastName, 2211 java.lang.String screenName, java.lang.String emailAddress, int status, 2212 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2213 boolean andSearch, int start, int end, 2214 com.liferay.portal.kernel.search.Sort[] sorts) 2215 throws com.liferay.portal.kernel.exception.PortalException { 2216 return getService() 2217 .searchUsers(companyId, firstName, middleName, lastName, 2218 screenName, emailAddress, status, params, andSearch, start, end, 2219 sorts); 2220 } 2221 2222 public static com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portal.model.User> searchUsers( 2223 long companyId, java.lang.String keywords, int status, 2224 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2225 int start, int end, com.liferay.portal.kernel.search.Sort sort) 2226 throws com.liferay.portal.kernel.exception.PortalException { 2227 return getService() 2228 .searchUsers(companyId, keywords, status, params, start, 2229 end, sort); 2230 } 2231 2232 public static com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portal.model.User> searchUsers( 2233 long companyId, java.lang.String keywords, int status, 2234 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2235 int start, int end, com.liferay.portal.kernel.search.Sort[] sorts) 2236 throws com.liferay.portal.kernel.exception.PortalException { 2237 return getService() 2238 .searchUsers(companyId, keywords, status, params, start, 2239 end, sorts); 2240 } 2241 2242 /** 2243 * Sends an email address verification to the user. 2244 * 2245 * @param user the verification email recipient 2246 * @param emailAddress the recipient's email address 2247 * @param serviceContext the service context to be applied. Must set the 2248 portal URL, main path, primary key of the layout, remote address, 2249 remote host, and agent for the user. 2250 */ 2251 public static void sendEmailAddressVerification( 2252 com.liferay.portal.model.User user, java.lang.String emailAddress, 2253 com.liferay.portal.service.ServiceContext serviceContext) 2254 throws com.liferay.portal.kernel.exception.PortalException { 2255 getService() 2256 .sendEmailAddressVerification(user, emailAddress, serviceContext); 2257 } 2258 2259 /** 2260 * Sends the password email to the user with the email address. The content 2261 * of this email can be specified in <code>portal.properties</code> with the 2262 * <code>admin.email.password</code> keys. 2263 * 2264 * @param companyId the primary key of the user's company 2265 * @param emailAddress the user's email address 2266 * @param fromName the name of the individual that the email should be from 2267 * @param fromAddress the address of the individual that the email should be 2268 from 2269 * @param subject the email subject. If <code>null</code>, the subject 2270 specified in <code>portal.properties</code> will be used. 2271 * @param body the email body. If <code>null</code>, the body specified in 2272 <code>portal.properties</code> will be used. 2273 * @param serviceContext the service context to be applied 2274 */ 2275 public static boolean sendPassword(long companyId, 2276 java.lang.String emailAddress, java.lang.String fromName, 2277 java.lang.String fromAddress, java.lang.String subject, 2278 java.lang.String body, 2279 com.liferay.portal.service.ServiceContext serviceContext) 2280 throws com.liferay.portal.kernel.exception.PortalException { 2281 return getService() 2282 .sendPassword(companyId, emailAddress, fromName, 2283 fromAddress, subject, body, serviceContext); 2284 } 2285 2286 /** 2287 * Sends a password notification email to the user matching the email 2288 * address. The portal's settings determine whether a password is sent 2289 * explicitly or whether a link for resetting the user's password is sent. 2290 * The method sends the email asynchronously and returns before the email is 2291 * sent. 2292 * 2293 * <p> 2294 * The content of the notification email is specified with the 2295 * <code>admin.email.password</code> portal property keys. They can be 2296 * overridden via a <code>portal-ext.properties</code> file or modified 2297 * through the Portal Settings UI. 2298 * </p> 2299 * 2300 * @param companyId the primary key of the user's company 2301 * @param emailAddress the user's email address 2302 * @return <code>true</code> if the notification email includes a new 2303 password; <code>false</code> if the notification email only 2304 contains a reset link 2305 */ 2306 public static boolean sendPasswordByEmailAddress(long companyId, 2307 java.lang.String emailAddress) 2308 throws com.liferay.portal.kernel.exception.PortalException { 2309 return getService().sendPasswordByEmailAddress(companyId, emailAddress); 2310 } 2311 2312 /** 2313 * Sends a password notification email to the user matching the screen name. 2314 * The portal's settings determine whether a password is sent explicitly or 2315 * whether a link for resetting the user's password is sent. The method 2316 * sends the email asynchronously and returns before the email is sent. 2317 * 2318 * <p> 2319 * The content of the notification email is specified with the 2320 * <code>admin.email.password</code> portal property keys. They can be 2321 * overridden via a <code>portal-ext.properties</code> file or modified 2322 * through the Portal Settings UI. 2323 * </p> 2324 * 2325 * @param companyId the primary key of the user's company 2326 * @param screenName the user's screen name 2327 * @return <code>true</code> if the notification email includes a new 2328 password; <code>false</code> if the notification email only 2329 contains a reset link 2330 */ 2331 public static boolean sendPasswordByScreenName(long companyId, 2332 java.lang.String screenName) 2333 throws com.liferay.portal.kernel.exception.PortalException { 2334 return getService().sendPasswordByScreenName(companyId, screenName); 2335 } 2336 2337 /** 2338 * Sends a password notification email to the user matching the ID. The 2339 * portal's settings determine whether a password is sent explicitly or 2340 * whether a link for resetting the user's password is sent. The method 2341 * sends the email asynchronously and returns before the email is sent. 2342 * 2343 * <p> 2344 * The content of the notification email is specified with the 2345 * <code>admin.email.password</code> portal property keys. They can be 2346 * overridden via a <code>portal-ext.properties</code> file or modified 2347 * through the Portal Settings UI. 2348 * </p> 2349 * 2350 * @param userId the user's primary key 2351 * @return <code>true</code> if the notification email includes a new 2352 password; <code>false</code> if the notification email only 2353 contains a reset link 2354 */ 2355 public static boolean sendPasswordByUserId(long userId) 2356 throws com.liferay.portal.kernel.exception.PortalException { 2357 return getService().sendPasswordByUserId(userId); 2358 } 2359 2360 public static void setGroupUsers(long groupId, long[] userIds) { 2361 getService().setGroupUsers(groupId, userIds); 2362 } 2363 2364 public static void setOrganizationUsers(long organizationId, long[] userIds) { 2365 getService().setOrganizationUsers(organizationId, userIds); 2366 } 2367 2368 /** 2369 * @throws PortalException 2370 */ 2371 public static void setRoleUsers(long roleId, long[] userIds) 2372 throws com.liferay.portal.kernel.exception.PortalException { 2373 getService().setRoleUsers(roleId, userIds); 2374 } 2375 2376 public static void setTeamUsers(long teamId, long[] userIds) { 2377 getService().setTeamUsers(teamId, userIds); 2378 } 2379 2380 /** 2381 * @throws PortalException 2382 */ 2383 public static void setUserGroupUsers(long userGroupId, long[] userIds) 2384 throws com.liferay.portal.kernel.exception.PortalException { 2385 getService().setUserGroupUsers(userGroupId, userIds); 2386 } 2387 2388 /** 2389 * Removes the users from the teams of a group. 2390 * 2391 * @param groupId the primary key of the group 2392 * @param userIds the primary keys of the users 2393 */ 2394 public static void unsetGroupTeamsUsers(long groupId, long[] userIds) 2395 throws com.liferay.portal.kernel.exception.PortalException { 2396 getService().unsetGroupTeamsUsers(groupId, userIds); 2397 } 2398 2399 /** 2400 * Removes the users from the group. 2401 * 2402 * @param groupId the primary key of the group 2403 * @param userIds the primary keys of the users 2404 * @param serviceContext the service context to be applied (optionally 2405 <code>null</code>) 2406 */ 2407 public static void unsetGroupUsers(long groupId, long[] userIds, 2408 com.liferay.portal.service.ServiceContext serviceContext) 2409 throws com.liferay.portal.kernel.exception.PortalException { 2410 getService().unsetGroupUsers(groupId, userIds, serviceContext); 2411 } 2412 2413 /** 2414 * Removes the users from the organization. 2415 * 2416 * @param organizationId the primary key of the organization 2417 * @param userIds the primary keys of the users 2418 */ 2419 public static void unsetOrganizationUsers(long organizationId, 2420 long[] userIds) 2421 throws com.liferay.portal.kernel.exception.PortalException { 2422 getService().unsetOrganizationUsers(organizationId, userIds); 2423 } 2424 2425 /** 2426 * Removes the users from the password policy. 2427 * 2428 * @param passwordPolicyId the primary key of the password policy 2429 * @param userIds the primary keys of the users 2430 */ 2431 public static void unsetPasswordPolicyUsers(long passwordPolicyId, 2432 long[] userIds) { 2433 getService().unsetPasswordPolicyUsers(passwordPolicyId, userIds); 2434 } 2435 2436 /** 2437 * Removes the users from the role. 2438 * 2439 * @param roleId the primary key of the role 2440 * @param userIds the primary keys of the users 2441 */ 2442 public static void unsetRoleUsers(long roleId, long[] userIds) 2443 throws com.liferay.portal.kernel.exception.PortalException { 2444 getService().unsetRoleUsers(roleId, userIds); 2445 } 2446 2447 /** 2448 * Removes the users from the role. 2449 * 2450 * @param roleId the primary key of the role 2451 * @param users the users 2452 */ 2453 public static void unsetRoleUsers(long roleId, 2454 java.util.List<com.liferay.portal.model.User> users) 2455 throws com.liferay.portal.kernel.exception.PortalException { 2456 getService().unsetRoleUsers(roleId, users); 2457 } 2458 2459 /** 2460 * Removes the users from the team. 2461 * 2462 * @param teamId the primary key of the team 2463 * @param userIds the primary keys of the users 2464 */ 2465 public static void unsetTeamUsers(long teamId, long[] userIds) 2466 throws com.liferay.portal.kernel.exception.PortalException { 2467 getService().unsetTeamUsers(teamId, userIds); 2468 } 2469 2470 /** 2471 * Removes the users from the user group. 2472 * 2473 * @param userGroupId the primary key of the user group 2474 * @param userIds the primary keys of the users 2475 */ 2476 public static void unsetUserGroupUsers(long userGroupId, long[] userIds) 2477 throws com.liferay.portal.kernel.exception.PortalException { 2478 getService().unsetUserGroupUsers(userGroupId, userIds); 2479 } 2480 2481 /** 2482 * Updates whether the user has agreed to the terms of use. 2483 * 2484 * @param userId the primary key of the user 2485 * @param agreedToTermsOfUse whether the user has agreet to the terms of 2486 use 2487 * @return the user 2488 */ 2489 public static com.liferay.portal.model.User updateAgreedToTermsOfUse( 2490 long userId, boolean agreedToTermsOfUse) 2491 throws com.liferay.portal.kernel.exception.PortalException { 2492 return getService().updateAgreedToTermsOfUse(userId, agreedToTermsOfUse); 2493 } 2494 2495 /** 2496 * Updates the user's asset with the new asset categories and tag names, 2497 * removing and adding asset categories and tag names as necessary. 2498 * 2499 * @param userId the primary key of the user 2500 * @param user ID the primary key of the user 2501 * @param assetCategoryIds the primary key's of the new asset categories 2502 * @param assetTagNames the new asset tag names 2503 */ 2504 public static void updateAsset(long userId, 2505 com.liferay.portal.model.User user, long[] assetCategoryIds, 2506 java.lang.String[] assetTagNames) 2507 throws com.liferay.portal.kernel.exception.PortalException { 2508 getService().updateAsset(userId, user, assetCategoryIds, assetTagNames); 2509 } 2510 2511 /** 2512 * Updates the user's creation date. 2513 * 2514 * @param userId the primary key of the user 2515 * @param createDate the new creation date 2516 * @return the user 2517 */ 2518 public static com.liferay.portal.model.User updateCreateDate(long userId, 2519 java.util.Date createDate) 2520 throws com.liferay.portal.kernel.exception.PortalException { 2521 return getService().updateCreateDate(userId, createDate); 2522 } 2523 2524 /** 2525 * Updates the user's email address. 2526 * 2527 * @param userId the primary key of the user 2528 * @param password the user's password 2529 * @param emailAddress1 the user's new email address 2530 * @param emailAddress2 the user's new email address confirmation 2531 * @return the user 2532 */ 2533 public static com.liferay.portal.model.User updateEmailAddress( 2534 long userId, java.lang.String password, java.lang.String emailAddress1, 2535 java.lang.String emailAddress2) 2536 throws com.liferay.portal.kernel.exception.PortalException { 2537 return getService() 2538 .updateEmailAddress(userId, password, emailAddress1, 2539 emailAddress2); 2540 } 2541 2542 /** 2543 * Updates the user's email address or sends verification email. 2544 * 2545 * @param userId the primary key of the user 2546 * @param password the user's password 2547 * @param emailAddress1 the user's new email address 2548 * @param emailAddress2 the user's new email address confirmation 2549 * @param serviceContext the service context to be applied. Must set the 2550 portal URL, main path, primary key of the layout, remote address, 2551 remote host, and agent for the user. 2552 * @return the user 2553 */ 2554 public static com.liferay.portal.model.User updateEmailAddress( 2555 long userId, java.lang.String password, java.lang.String emailAddress1, 2556 java.lang.String emailAddress2, 2557 com.liferay.portal.service.ServiceContext serviceContext) 2558 throws com.liferay.portal.kernel.exception.PortalException { 2559 return getService() 2560 .updateEmailAddress(userId, password, emailAddress1, 2561 emailAddress2, serviceContext); 2562 } 2563 2564 /** 2565 * Updates whether the user has verified email address. 2566 * 2567 * @param userId the primary key of the user 2568 * @param emailAddressVerified whether the user has verified email address 2569 * @return the user 2570 */ 2571 public static com.liferay.portal.model.User updateEmailAddressVerified( 2572 long userId, boolean emailAddressVerified) 2573 throws com.liferay.portal.kernel.exception.PortalException { 2574 return getService() 2575 .updateEmailAddressVerified(userId, emailAddressVerified); 2576 } 2577 2578 /** 2579 * Updates the user's Facebook ID. 2580 * 2581 * @param userId the primary key of the user 2582 * @param facebookId the user's new Facebook ID 2583 * @return the user 2584 */ 2585 public static com.liferay.portal.model.User updateFacebookId(long userId, 2586 long facebookId) 2587 throws com.liferay.portal.kernel.exception.PortalException { 2588 return getService().updateFacebookId(userId, facebookId); 2589 } 2590 2591 /** 2592 * Sets the groups the user is in, removing and adding groups as necessary. 2593 * 2594 * @param userId the primary key of the user 2595 * @param newGroupIds the primary keys of the groups 2596 * @param serviceContext the service context to be applied (optionally 2597 <code>null</code>) 2598 */ 2599 public static void updateGroups(long userId, long[] newGroupIds, 2600 com.liferay.portal.service.ServiceContext serviceContext) 2601 throws com.liferay.portal.kernel.exception.PortalException { 2602 getService().updateGroups(userId, newGroupIds, serviceContext); 2603 } 2604 2605 /** 2606 * Updates a user account that was automatically created when a guest user 2607 * participated in an action (e.g. posting a comment) and only provided his 2608 * name and email address. 2609 * 2610 * @param creatorUserId the primary key of the creator 2611 * @param companyId the primary key of the user's company 2612 * @param autoPassword whether a password should be automatically generated 2613 for the user 2614 * @param password1 the user's password 2615 * @param password2 the user's password confirmation 2616 * @param autoScreenName whether a screen name should be automatically 2617 generated for the user 2618 * @param screenName the user's screen name 2619 * @param emailAddress the user's email address 2620 * @param facebookId the user's facebook ID 2621 * @param openId the user's OpenID 2622 * @param locale the user's locale 2623 * @param firstName the user's first name 2624 * @param middleName the user's middle name 2625 * @param lastName the user's last name 2626 * @param prefixId the user's name prefix ID 2627 * @param suffixId the user's name suffix ID 2628 * @param male whether the user is male 2629 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 2630 January) 2631 * @param birthdayDay the user's birthday day 2632 * @param birthdayYear the user's birthday year 2633 * @param jobTitle the user's job title 2634 * @param updateUserInformation whether to update the user's information 2635 * @param sendEmail whether to send the user an email notification about 2636 their new account 2637 * @param serviceContext the service context to be applied (optionally 2638 <code>null</code>). Can set expando bridge attributes for the 2639 user. 2640 * @return the user 2641 */ 2642 public static com.liferay.portal.model.User updateIncompleteUser( 2643 long creatorUserId, long companyId, boolean autoPassword, 2644 java.lang.String password1, java.lang.String password2, 2645 boolean autoScreenName, java.lang.String screenName, 2646 java.lang.String emailAddress, long facebookId, 2647 java.lang.String openId, java.util.Locale locale, 2648 java.lang.String firstName, java.lang.String middleName, 2649 java.lang.String lastName, long prefixId, long suffixId, boolean male, 2650 int birthdayMonth, int birthdayDay, int birthdayYear, 2651 java.lang.String jobTitle, boolean updateUserInformation, 2652 boolean sendEmail, 2653 com.liferay.portal.service.ServiceContext serviceContext) 2654 throws com.liferay.portal.kernel.exception.PortalException { 2655 return getService() 2656 .updateIncompleteUser(creatorUserId, companyId, 2657 autoPassword, password1, password2, autoScreenName, screenName, 2658 emailAddress, facebookId, openId, locale, firstName, middleName, 2659 lastName, prefixId, suffixId, male, birthdayMonth, birthdayDay, 2660 birthdayYear, jobTitle, updateUserInformation, sendEmail, 2661 serviceContext); 2662 } 2663 2664 /** 2665 * Updates the user's job title. 2666 * 2667 * @param userId the primary key of the user 2668 * @param jobTitle the user's job title 2669 * @return the user 2670 */ 2671 public static com.liferay.portal.model.User updateJobTitle(long userId, 2672 java.lang.String jobTitle) 2673 throws com.liferay.portal.kernel.exception.PortalException { 2674 return getService().updateJobTitle(userId, jobTitle); 2675 } 2676 2677 /** 2678 * Updates the user's last login with the current time and the IP address. 2679 * 2680 * @param userId the primary key of the user 2681 * @param loginIP the IP address the user logged in from 2682 * @return the user 2683 */ 2684 public static com.liferay.portal.model.User updateLastLogin(long userId, 2685 java.lang.String loginIP) 2686 throws com.liferay.portal.kernel.exception.PortalException { 2687 return getService().updateLastLogin(userId, loginIP); 2688 } 2689 2690 /** 2691 * Updates whether the user is locked out from logging in. 2692 * 2693 * @param user the user 2694 * @param lockout whether the user is locked out 2695 * @return the user 2696 */ 2697 public static com.liferay.portal.model.User updateLockout( 2698 com.liferay.portal.model.User user, boolean lockout) 2699 throws com.liferay.portal.kernel.exception.PortalException { 2700 return getService().updateLockout(user, lockout); 2701 } 2702 2703 /** 2704 * Updates whether the user is locked out from logging in. 2705 * 2706 * @param companyId the primary key of the user's company 2707 * @param emailAddress the user's email address 2708 * @param lockout whether the user is locked out 2709 * @return the user 2710 */ 2711 public static com.liferay.portal.model.User updateLockoutByEmailAddress( 2712 long companyId, java.lang.String emailAddress, boolean lockout) 2713 throws com.liferay.portal.kernel.exception.PortalException { 2714 return getService() 2715 .updateLockoutByEmailAddress(companyId, emailAddress, lockout); 2716 } 2717 2718 /** 2719 * Updates whether the user is locked out from logging in. 2720 * 2721 * @param userId the primary key of the user 2722 * @param lockout whether the user is locked out 2723 * @return the user 2724 */ 2725 public static com.liferay.portal.model.User updateLockoutById(long userId, 2726 boolean lockout) 2727 throws com.liferay.portal.kernel.exception.PortalException { 2728 return getService().updateLockoutById(userId, lockout); 2729 } 2730 2731 /** 2732 * Updates whether the user is locked out from logging in. 2733 * 2734 * @param companyId the primary key of the user's company 2735 * @param screenName the user's screen name 2736 * @param lockout whether the user is locked out 2737 * @return the user 2738 */ 2739 public static com.liferay.portal.model.User updateLockoutByScreenName( 2740 long companyId, java.lang.String screenName, boolean lockout) 2741 throws com.liferay.portal.kernel.exception.PortalException { 2742 return getService() 2743 .updateLockoutByScreenName(companyId, screenName, lockout); 2744 } 2745 2746 /** 2747 * Updates the user's modified date. 2748 * 2749 * @param userId the primary key of the user 2750 * @param modifiedDate the new modified date 2751 * @return the user 2752 */ 2753 public static com.liferay.portal.model.User updateModifiedDate( 2754 long userId, java.util.Date modifiedDate) 2755 throws com.liferay.portal.kernel.exception.PortalException { 2756 return getService().updateModifiedDate(userId, modifiedDate); 2757 } 2758 2759 /** 2760 * Updates the user's OpenID. 2761 * 2762 * @param userId the primary key of the user 2763 * @param openId the new OpenID 2764 * @return the user 2765 */ 2766 public static com.liferay.portal.model.User updateOpenId(long userId, 2767 java.lang.String openId) 2768 throws com.liferay.portal.kernel.exception.PortalException { 2769 return getService().updateOpenId(userId, openId); 2770 } 2771 2772 /** 2773 * Sets the organizations that the user is in, removing and adding 2774 * organizations as necessary. 2775 * 2776 * @param userId the primary key of the user 2777 * @param newOrganizationIds the primary keys of the organizations 2778 * @param serviceContext the service context to be applied. Must set whether 2779 user indexing is enabled. 2780 */ 2781 public static void updateOrganizations(long userId, 2782 long[] newOrganizationIds, 2783 com.liferay.portal.service.ServiceContext serviceContext) 2784 throws com.liferay.portal.kernel.exception.PortalException { 2785 getService() 2786 .updateOrganizations(userId, newOrganizationIds, serviceContext); 2787 } 2788 2789 /** 2790 * Updates the user's password without tracking or validation of the change. 2791 * 2792 * @param userId the primary key of the user 2793 * @param password1 the user's new password 2794 * @param password2 the user's new password confirmation 2795 * @param passwordReset whether the user should be asked to reset their 2796 password the next time they log in 2797 * @return the user 2798 */ 2799 public static com.liferay.portal.model.User updatePassword(long userId, 2800 java.lang.String password1, java.lang.String password2, 2801 boolean passwordReset) 2802 throws com.liferay.portal.kernel.exception.PortalException { 2803 return getService() 2804 .updatePassword(userId, password1, password2, passwordReset); 2805 } 2806 2807 /** 2808 * Updates the user's password, optionally with tracking and validation of 2809 * the change. 2810 * 2811 * @param userId the primary key of the user 2812 * @param password1 the user's new password 2813 * @param password2 the user's new password confirmation 2814 * @param passwordReset whether the user should be asked to reset their 2815 password the next time they login 2816 * @param silentUpdate whether the password should be updated without being 2817 tracked, or validated. Primarily used for password imports. 2818 * @return the user 2819 */ 2820 public static com.liferay.portal.model.User updatePassword(long userId, 2821 java.lang.String password1, java.lang.String password2, 2822 boolean passwordReset, boolean silentUpdate) 2823 throws com.liferay.portal.kernel.exception.PortalException { 2824 return getService() 2825 .updatePassword(userId, password1, password2, passwordReset, 2826 silentUpdate); 2827 } 2828 2829 /** 2830 * Updates the user's password with manually input information. This method 2831 * should only be used when performing maintenance. 2832 * 2833 * @param userId the primary key of the user 2834 * @param password the user's new password 2835 * @param passwordEncrypted the user's new encrypted password 2836 * @param passwordReset whether the user should be asked to reset their 2837 password the next time they login 2838 * @param passwordModifiedDate the new password modified date 2839 * @return the user 2840 */ 2841 public static com.liferay.portal.model.User updatePasswordManually( 2842 long userId, java.lang.String password, boolean passwordEncrypted, 2843 boolean passwordReset, java.util.Date passwordModifiedDate) 2844 throws com.liferay.portal.kernel.exception.PortalException { 2845 return getService() 2846 .updatePasswordManually(userId, password, passwordEncrypted, 2847 passwordReset, passwordModifiedDate); 2848 } 2849 2850 /** 2851 * Updates whether the user should be asked to reset their password the next 2852 * time they login. 2853 * 2854 * @param userId the primary key of the user 2855 * @param passwordReset whether the user should be asked to reset their 2856 password the next time they login 2857 * @return the user 2858 */ 2859 public static com.liferay.portal.model.User updatePasswordReset( 2860 long userId, boolean passwordReset) 2861 throws com.liferay.portal.kernel.exception.PortalException { 2862 return getService().updatePasswordReset(userId, passwordReset); 2863 } 2864 2865 /** 2866 * Updates the user's portrait image. 2867 * 2868 * @param userId the primary key of the user 2869 * @param bytes the new portrait image data 2870 * @return the user 2871 */ 2872 public static com.liferay.portal.model.User updatePortrait(long userId, 2873 byte[] bytes) 2874 throws com.liferay.portal.kernel.exception.PortalException { 2875 return getService().updatePortrait(userId, bytes); 2876 } 2877 2878 /** 2879 * Updates the user's password reset question and answer. 2880 * 2881 * @param userId the primary key of the user 2882 * @param question the user's new password reset question 2883 * @param answer the user's new password reset answer 2884 * @return the user 2885 */ 2886 public static com.liferay.portal.model.User updateReminderQuery( 2887 long userId, java.lang.String question, java.lang.String answer) 2888 throws com.liferay.portal.kernel.exception.PortalException { 2889 return getService().updateReminderQuery(userId, question, answer); 2890 } 2891 2892 /** 2893 * Updates the user's screen name. 2894 * 2895 * @param userId the primary key of the user 2896 * @param screenName the user's new screen name 2897 * @return the user 2898 */ 2899 public static com.liferay.portal.model.User updateScreenName(long userId, 2900 java.lang.String screenName) 2901 throws com.liferay.portal.kernel.exception.PortalException { 2902 return getService().updateScreenName(userId, screenName); 2903 } 2904 2905 /** 2906 * Updates the user's workflow status. 2907 * 2908 * @param userId the primary key of the user 2909 * @param status the user's new workflow status 2910 * @return the user 2911 * @deprecated As of 7.0.0, replaced by {@link #updateStatus(long, int, 2912 ServiceContext)} 2913 */ 2914 @Deprecated 2915 public static com.liferay.portal.model.User updateStatus(long userId, 2916 int status) throws com.liferay.portal.kernel.exception.PortalException { 2917 return getService().updateStatus(userId, status); 2918 } 2919 2920 /** 2921 * Updates the user's workflow status. 2922 * 2923 * @param userId the primary key of the user 2924 * @param status the user's new workflow status 2925 * @param serviceContext the service context to be applied. You can specify 2926 an unencrypted custom password (used by an LDAP listener) for the 2927 user via attribute <code>passwordUnencrypted</code>. 2928 * @return the user 2929 */ 2930 public static com.liferay.portal.model.User updateStatus(long userId, 2931 int status, com.liferay.portal.service.ServiceContext serviceContext) 2932 throws com.liferay.portal.kernel.exception.PortalException { 2933 return getService().updateStatus(userId, status, serviceContext); 2934 } 2935 2936 /** 2937 * Updates the user in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 2938 * 2939 * @param user the user 2940 * @return the user that was updated 2941 */ 2942 public static com.liferay.portal.model.User updateUser( 2943 com.liferay.portal.model.User user) { 2944 return getService().updateUser(user); 2945 } 2946 2947 /** 2948 * Updates the user. 2949 * 2950 * @param userId the primary key of the user 2951 * @param oldPassword the user's old password 2952 * @param newPassword1 the user's new password (optionally 2953 <code>null</code>) 2954 * @param newPassword2 the user's new password confirmation (optionally 2955 <code>null</code>) 2956 * @param passwordReset whether the user should be asked to reset their 2957 password the next time they login 2958 * @param reminderQueryQuestion the user's new password reset question 2959 * @param reminderQueryAnswer the user's new password reset answer 2960 * @param screenName the user's new screen name 2961 * @param emailAddress the user's new email address 2962 * @param facebookId the user's new Facebook ID 2963 * @param openId the user's new OpenID 2964 * @param languageId the user's new language ID 2965 * @param timeZoneId the user's new time zone ID 2966 * @param greeting the user's new greeting 2967 * @param comments the user's new comments 2968 * @param firstName the user's new first name 2969 * @param middleName the user's new middle name 2970 * @param lastName the user's new last name 2971 * @param prefixId the user's new name prefix ID 2972 * @param suffixId the user's new name suffix ID 2973 * @param male whether user is male 2974 * @param birthdayMonth the user's new birthday month (0-based, meaning 2975 0 for January) 2976 * @param birthdayDay the user's new birthday day 2977 * @param birthdayYear the user's birthday year 2978 * @param smsSn the user's new SMS screen name 2979 * @param facebookSn the user's new Facebook screen name 2980 * @param jabberSn the user's new Jabber screen name 2981 * @param skypeSn the user's new Skype screen name 2982 * @param twitterSn the user's new Twitter screen name 2983 * @param jobTitle the user's new job title 2984 * @param groupIds the primary keys of the user's groups 2985 * @param organizationIds the primary keys of the user's organizations 2986 * @param roleIds the primary keys of the user's roles 2987 * @param userGroupRoles the user user's group roles 2988 * @param userGroupIds the primary keys of the user's user groups 2989 * @param serviceContext the service context to be applied (optionally 2990 <code>null</code>). Can set the UUID (with the 2991 <code>uuid</code> attribute), asset category IDs, asset tag 2992 names, and expando bridge attributes for the user. 2993 * @return the user 2994 * @deprecated As of 7.0.0, replaced by {@link #updateUser(long, String, 2995 String, String, boolean, String, String, String, String, 2996 long, String, boolean, byte[], String, String, String, 2997 String, String, String, String, int, int, boolean, int, int, 2998 int, String, String, String, String, String, String, String, 2999 String, String, String, String, long[], long[], long[], List, 3000 long[], ServiceContext)} 3001 */ 3002 @Deprecated 3003 public static com.liferay.portal.model.User updateUser(long userId, 3004 java.lang.String oldPassword, java.lang.String newPassword1, 3005 java.lang.String newPassword2, boolean passwordReset, 3006 java.lang.String reminderQueryQuestion, 3007 java.lang.String reminderQueryAnswer, java.lang.String screenName, 3008 java.lang.String emailAddress, long facebookId, 3009 java.lang.String openId, java.lang.String languageId, 3010 java.lang.String timeZoneId, java.lang.String greeting, 3011 java.lang.String comments, java.lang.String firstName, 3012 java.lang.String middleName, java.lang.String lastName, long prefixId, 3013 long suffixId, boolean male, int birthdayMonth, int birthdayDay, 3014 int birthdayYear, java.lang.String smsSn, java.lang.String facebookSn, 3015 java.lang.String jabberSn, java.lang.String skypeSn, 3016 java.lang.String twitterSn, java.lang.String jobTitle, long[] groupIds, 3017 long[] organizationIds, long[] roleIds, 3018 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles, 3019 long[] userGroupIds, 3020 com.liferay.portal.service.ServiceContext serviceContext) 3021 throws com.liferay.portal.kernel.exception.PortalException { 3022 return getService() 3023 .updateUser(userId, oldPassword, newPassword1, newPassword2, 3024 passwordReset, reminderQueryQuestion, reminderQueryAnswer, 3025 screenName, emailAddress, facebookId, openId, languageId, 3026 timeZoneId, greeting, comments, firstName, middleName, lastName, 3027 prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, 3028 smsSn, facebookSn, jabberSn, skypeSn, twitterSn, jobTitle, 3029 groupIds, organizationIds, roleIds, userGroupRoles, userGroupIds, 3030 serviceContext); 3031 } 3032 3033 /** 3034 * Updates the user. 3035 * 3036 * @param userId the primary key of the user 3037 * @param oldPassword the user's old password 3038 * @param newPassword1 the user's new password (optionally 3039 <code>null</code>) 3040 * @param newPassword2 the user's new password confirmation (optionally 3041 <code>null</code>) 3042 * @param passwordReset whether the user should be asked to reset their 3043 password the next time they login 3044 * @param reminderQueryQuestion the user's new password reset question 3045 * @param reminderQueryAnswer the user's new password reset answer 3046 * @param screenName the user's new screen name 3047 * @param emailAddress the user's new email address 3048 * @param facebookId the user's new Facebook ID 3049 * @param openId the user's new OpenID 3050 * @param portrait whether to update the user's portrait image 3051 * @param portraitBytes the new portrait image data 3052 * @param languageId the user's new language ID 3053 * @param timeZoneId the user's new time zone ID 3054 * @param greeting the user's new greeting 3055 * @param comments the user's new comments 3056 * @param firstName the user's new first name 3057 * @param middleName the user's new middle name 3058 * @param lastName the user's new last name 3059 * @param prefixId the user's new name prefix ID 3060 * @param suffixId the user's new name suffix ID 3061 * @param male whether user is male 3062 * @param birthdayMonth the user's new birthday month (0-based, meaning 0 3063 for January) 3064 * @param birthdayDay the user's new birthday day 3065 * @param birthdayYear the user's birthday year 3066 * @param smsSn the user's new SMS screen name 3067 * @param facebookSn the user's new Facebook screen name 3068 * @param jabberSn the user's new Jabber screen name 3069 * @param skypeSn the user's new Skype screen name 3070 * @param twitterSn the user's new Twitter screen name 3071 * @param jobTitle the user's new job title 3072 * @param groupIds the primary keys of the user's groups 3073 * @param organizationIds the primary keys of the user's organizations 3074 * @param roleIds the primary keys of the user's roles 3075 * @param userGroupRoles the user user's group roles 3076 * @param userGroupIds the primary keys of the user's user groups 3077 * @param serviceContext the service context to be applied (optionally 3078 <code>null</code>). Can set the UUID (with the <code>uuid</code> 3079 attribute), asset category IDs, asset tag names, and expando 3080 bridge attributes for the user. 3081 * @return the user 3082 */ 3083 public static com.liferay.portal.model.User updateUser(long userId, 3084 java.lang.String oldPassword, java.lang.String newPassword1, 3085 java.lang.String newPassword2, boolean passwordReset, 3086 java.lang.String reminderQueryQuestion, 3087 java.lang.String reminderQueryAnswer, java.lang.String screenName, 3088 java.lang.String emailAddress, long facebookId, 3089 java.lang.String openId, boolean portrait, byte[] portraitBytes, 3090 java.lang.String languageId, java.lang.String timeZoneId, 3091 java.lang.String greeting, java.lang.String comments, 3092 java.lang.String firstName, java.lang.String middleName, 3093 java.lang.String lastName, long prefixId, long suffixId, boolean male, 3094 int birthdayMonth, int birthdayDay, int birthdayYear, 3095 java.lang.String smsSn, java.lang.String facebookSn, 3096 java.lang.String jabberSn, java.lang.String skypeSn, 3097 java.lang.String twitterSn, java.lang.String jobTitle, long[] groupIds, 3098 long[] organizationIds, long[] roleIds, 3099 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles, 3100 long[] userGroupIds, 3101 com.liferay.portal.service.ServiceContext serviceContext) 3102 throws com.liferay.portal.kernel.exception.PortalException { 3103 return getService() 3104 .updateUser(userId, oldPassword, newPassword1, newPassword2, 3105 passwordReset, reminderQueryQuestion, reminderQueryAnswer, 3106 screenName, emailAddress, facebookId, openId, portrait, 3107 portraitBytes, languageId, timeZoneId, greeting, comments, 3108 firstName, middleName, lastName, prefixId, suffixId, male, 3109 birthdayMonth, birthdayDay, birthdayYear, smsSn, facebookSn, 3110 jabberSn, skypeSn, twitterSn, jobTitle, groupIds, organizationIds, 3111 roleIds, userGroupRoles, userGroupIds, serviceContext); 3112 } 3113 3114 /** 3115 * Verifies the email address of the ticket. 3116 * 3117 * @param ticketKey the ticket key 3118 */ 3119 public static void verifyEmailAddress(java.lang.String ticketKey) 3120 throws com.liferay.portal.kernel.exception.PortalException { 3121 getService().verifyEmailAddress(ticketKey); 3122 } 3123 3124 public static UserLocalService getService() { 3125 if (_service == null) { 3126 _service = (UserLocalService)PortalBeanLocatorUtil.locate(UserLocalService.class.getName()); 3127 3128 ReferenceRegistry.registerReference(UserLocalServiceUtil.class, 3129 "_service"); 3130 } 3131 3132 return _service; 3133 } 3134 3135 private static UserLocalService _service; 3136 }