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