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