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