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