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