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