001 /** 002 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 013 */ 014 015 package com.liferay.portal.service; 016 017 import com.liferay.portal.kernel.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 * Updates the user in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 237 * 238 * @param user the user 239 * @param merge whether to merge the user with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation. 240 * @return the user that was updated 241 * @throws SystemException if a system exception occurred 242 */ 243 public static com.liferay.portal.model.User updateUser( 244 com.liferay.portal.model.User user, boolean merge) 245 throws com.liferay.portal.kernel.exception.SystemException { 246 return getService().updateUser(user, merge); 247 } 248 249 /** 250 * Returns the Spring bean ID for this bean. 251 * 252 * @return the Spring bean ID for this bean 253 */ 254 public static java.lang.String getBeanIdentifier() { 255 return getService().getBeanIdentifier(); 256 } 257 258 /** 259 * Sets the Spring bean ID for this bean. 260 * 261 * @param beanIdentifier the Spring bean ID for this bean 262 */ 263 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 264 getService().setBeanIdentifier(beanIdentifier); 265 } 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 identifier 1634 could not be found 1635 * @throws SystemException if a system exception occurred 1636 */ 1637 public static com.liferay.portal.model.User getUserByUuid( 1638 java.lang.String uuid) 1639 throws com.liferay.portal.kernel.exception.PortalException, 1640 com.liferay.portal.kernel.exception.SystemException { 1641 return getService().getUserByUuid(uuid); 1642 } 1643 1644 /** 1645 * Returns all the users belonging to the user group. 1646 * 1647 * @param userGroupId the primary key of the user group 1648 * @return the users belonging to the user group 1649 * @throws SystemException if a system exception occurred 1650 */ 1651 public static java.util.List<com.liferay.portal.model.User> getUserGroupUsers( 1652 long userGroupId) 1653 throws com.liferay.portal.kernel.exception.SystemException { 1654 return getService().getUserGroupUsers(userGroupId); 1655 } 1656 1657 /** 1658 * Returns the number of users belonging to the user group. 1659 * 1660 * @param userGroupId the primary key of the user group 1661 * @return the number of users belonging to the user group 1662 * @throws SystemException if a system exception occurred 1663 */ 1664 public static int getUserGroupUsersCount(long userGroupId) 1665 throws com.liferay.portal.kernel.exception.SystemException { 1666 return getService().getUserGroupUsersCount(userGroupId); 1667 } 1668 1669 /** 1670 * Returns the number of users with the status belonging to the user group. 1671 * 1672 * @param userGroupId the primary key of the user group 1673 * @param status the workflow status 1674 * @return the number of users with the status belonging to the user group 1675 * @throws PortalException if a user group with the primary key could not be 1676 found 1677 * @throws SystemException if a system exception occurred 1678 */ 1679 public static int getUserGroupUsersCount(long userGroupId, int status) 1680 throws com.liferay.portal.kernel.exception.PortalException, 1681 com.liferay.portal.kernel.exception.SystemException { 1682 return getService().getUserGroupUsersCount(userGroupId, status); 1683 } 1684 1685 /** 1686 * Returns the primary key of the user with the email address. 1687 * 1688 * @param companyId the primary key of the user's company 1689 * @param emailAddress the user's email address 1690 * @return the primary key of the user with the email address 1691 * @throws PortalException if a user with the email address could not be 1692 found 1693 * @throws SystemException if a system exception occurred 1694 */ 1695 public static long getUserIdByEmailAddress(long companyId, 1696 java.lang.String emailAddress) 1697 throws com.liferay.portal.kernel.exception.PortalException, 1698 com.liferay.portal.kernel.exception.SystemException { 1699 return getService().getUserIdByEmailAddress(companyId, emailAddress); 1700 } 1701 1702 /** 1703 * Returns the primary key of the user with the screen name. 1704 * 1705 * @param companyId the primary key of the user's company 1706 * @param screenName the user's screen name 1707 * @return the primary key of the user with the screen name 1708 * @throws PortalException if a user with the screen name could not be found 1709 * @throws SystemException if a system exception occurred 1710 */ 1711 public static long getUserIdByScreenName(long companyId, 1712 java.lang.String screenName) 1713 throws com.liferay.portal.kernel.exception.PortalException, 1714 com.liferay.portal.kernel.exception.SystemException { 1715 return getService().getUserIdByScreenName(companyId, screenName); 1716 } 1717 1718 /** 1719 * Returns <code>true</code> if the user is a member of the group. 1720 * 1721 * @param groupId the primary key of the group 1722 * @param userId the primary key of the user 1723 * @return <code>true</code> if the user is a member of the group; 1724 <code>false</code> otherwise 1725 * @throws SystemException if a system exception occurred 1726 */ 1727 public static boolean hasGroupUser(long groupId, long userId) 1728 throws com.liferay.portal.kernel.exception.SystemException { 1729 return getService().hasGroupUser(groupId, userId); 1730 } 1731 1732 /** 1733 * Returns <code>true</code> if the user is a member of the organization. 1734 * 1735 * @param organizationId the primary key of the organization 1736 * @param userId the primary key of the user 1737 * @return <code>true</code> if the user is a member of the organization; 1738 <code>false</code> otherwise 1739 * @throws SystemException if a system exception occurred 1740 */ 1741 public static boolean hasOrganizationUser(long organizationId, long userId) 1742 throws com.liferay.portal.kernel.exception.SystemException { 1743 return getService().hasOrganizationUser(organizationId, userId); 1744 } 1745 1746 /** 1747 * Returns <code>true</code> if the password policy has been assigned to the 1748 * user. 1749 * 1750 * @param passwordPolicyId the primary key of the password policy 1751 * @param userId the primary key of the user 1752 * @return <code>true</code> if the password policy is assigned to the user; 1753 <code>false</code> otherwise 1754 * @throws SystemException if a system exception occurred 1755 */ 1756 public static boolean hasPasswordPolicyUser(long passwordPolicyId, 1757 long userId) throws com.liferay.portal.kernel.exception.SystemException { 1758 return getService().hasPasswordPolicyUser(passwordPolicyId, userId); 1759 } 1760 1761 /** 1762 * Returns <code>true</code> if the user is a member of the role. 1763 * 1764 * @param roleId the primary key of the role 1765 * @param userId the primary key of the user 1766 * @return <code>true</code> if the user is a member of the role; 1767 <code>false</code> otherwise 1768 * @throws SystemException if a system exception occurred 1769 */ 1770 public static boolean hasRoleUser(long roleId, long userId) 1771 throws com.liferay.portal.kernel.exception.SystemException { 1772 return getService().hasRoleUser(roleId, userId); 1773 } 1774 1775 /** 1776 * Returns <code>true</code> if the user has the role with the name, 1777 * optionally through inheritance. 1778 * 1779 * @param companyId the primary key of the role's company 1780 * @param name the name of the role (must be a regular role, not an 1781 organization, site or provider role) 1782 * @param userId the primary key of the user 1783 * @param inherited whether to include roles inherited from organizations, 1784 sites, etc. 1785 * @return <code>true</code> if the user has the role; <code>false</code> 1786 otherwise 1787 * @throws PortalException if a role with the name could not be found 1788 * @throws SystemException if a system exception occurred 1789 */ 1790 public static boolean hasRoleUser(long companyId, java.lang.String name, 1791 long userId, boolean inherited) 1792 throws com.liferay.portal.kernel.exception.PortalException, 1793 com.liferay.portal.kernel.exception.SystemException { 1794 return getService().hasRoleUser(companyId, name, userId, inherited); 1795 } 1796 1797 /** 1798 * Returns <code>true</code> if the user is a member of the team. 1799 * 1800 * @param teamId the primary key of the team 1801 * @param userId the primary key of the user 1802 * @return <code>true</code> if the user is a member of the team; 1803 <code>false</code> otherwise 1804 * @throws SystemException if a system exception occurred 1805 */ 1806 public static boolean hasTeamUser(long teamId, long userId) 1807 throws com.liferay.portal.kernel.exception.SystemException { 1808 return getService().hasTeamUser(teamId, userId); 1809 } 1810 1811 /** 1812 * Returns <code>true</code> if the user is a member of the user group. 1813 * 1814 * @param userGroupId the primary key of the user group 1815 * @param userId the primary key of the user 1816 * @return <code>true</code> if the user is a member of the user group; 1817 <code>false</code> otherwise 1818 * @throws SystemException if a system exception occurred 1819 */ 1820 public static boolean hasUserGroupUser(long userGroupId, long userId) 1821 throws com.liferay.portal.kernel.exception.SystemException { 1822 return getService().hasUserGroupUser(userGroupId, userId); 1823 } 1824 1825 /** 1826 * Returns <code>true</code> if the user's password is expired. 1827 * 1828 * @param user the user 1829 * @return <code>true</code> if the user's password is expired; 1830 <code>false</code> otherwise 1831 * @throws PortalException if the password policy for the user could not be 1832 found 1833 * @throws SystemException if a system exception occurred 1834 */ 1835 public static boolean isPasswordExpired(com.liferay.portal.model.User user) 1836 throws com.liferay.portal.kernel.exception.PortalException, 1837 com.liferay.portal.kernel.exception.SystemException { 1838 return getService().isPasswordExpired(user); 1839 } 1840 1841 /** 1842 * Returns <code>true</code> if the user's password is expiring soon. 1843 * 1844 * @param user the user 1845 * @return <code>true</code> if the user's password is expiring soon; 1846 <code>false</code> otherwise 1847 * @throws PortalException if the password policy for the user could not be 1848 found 1849 * @throws SystemException if a system exception occurred 1850 */ 1851 public static boolean isPasswordExpiringSoon( 1852 com.liferay.portal.model.User user) 1853 throws com.liferay.portal.kernel.exception.PortalException, 1854 com.liferay.portal.kernel.exception.SystemException { 1855 return getService().isPasswordExpiringSoon(user); 1856 } 1857 1858 public static com.liferay.portal.model.User loadGetDefaultUser( 1859 long companyId) 1860 throws com.liferay.portal.kernel.exception.PortalException, 1861 com.liferay.portal.kernel.exception.SystemException { 1862 return getService().loadGetDefaultUser(companyId); 1863 } 1864 1865 /** 1866 * Returns an ordered range of all the users who match the keywords and 1867 * status, without using the indexer. It is preferable to use the indexed 1868 * version {@link #search(long, String, int, LinkedHashMap, int, int, Sort)} 1869 * instead of this method wherever possible for performance reasons. 1870 * 1871 * <p> 1872 * Useful when paginating results. Returns a maximum of <code>end - 1873 * start</code> instances. <code>start</code> and <code>end</code> are not 1874 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1875 * refers to the first result in the set. Setting both <code>start</code> 1876 * and <code>end</code> to {@link 1877 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1878 * result set. 1879 * </p> 1880 * 1881 * @param companyId the primary key of the user's company 1882 * @param keywords the keywords (space separated), which may occur in the 1883 user's first name, middle name, last name, screen name, or email 1884 address 1885 * @param status the workflow status 1886 * @param params the finder parameters (optionally <code>null</code>). For 1887 more information see {@link 1888 com.liferay.portal.service.persistence.UserFinder}. 1889 * @param start the lower bound of the range of users 1890 * @param end the upper bound of the range of users (not inclusive) 1891 * @param obc the comparator to order the users by (optionally 1892 <code>null</code>) 1893 * @return the matching users 1894 * @throws SystemException if a system exception occurred 1895 * @see com.liferay.portal.service.persistence.UserFinder 1896 */ 1897 public static java.util.List<com.liferay.portal.model.User> search( 1898 long companyId, java.lang.String keywords, int status, 1899 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1900 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 1901 throws com.liferay.portal.kernel.exception.SystemException { 1902 return getService() 1903 .search(companyId, keywords, status, params, start, end, obc); 1904 } 1905 1906 /** 1907 * Returns an ordered range of all the users who match the keywords and 1908 * status, using the indexer. It is preferable to use this method instead of 1909 * the non-indexed version whenever possible for performance reasons. 1910 * 1911 * <p> 1912 * Useful when paginating results. Returns a maximum of <code>end - 1913 * start</code> instances. <code>start</code> and <code>end</code> are not 1914 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1915 * refers to the first result in the set. Setting both <code>start</code> 1916 * and <code>end</code> to {@link 1917 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1918 * result set. 1919 * </p> 1920 * 1921 * @param companyId the primary key of the user's company 1922 * @param keywords the keywords (space separated), which may occur in the 1923 user's first name, middle name, last name, screen name, or email 1924 address 1925 * @param status the workflow status 1926 * @param params the indexer parameters (optionally <code>null</code>). For 1927 more information see {@link 1928 com.liferay.portlet.usersadmin.util.UserIndexer}. 1929 * @param start the lower bound of the range of users 1930 * @param end the upper bound of the range of users (not inclusive) 1931 * @param sort the field and direction to sort by (optionally 1932 <code>null</code>) 1933 * @return the matching users 1934 * @throws SystemException if a system exception occurred 1935 * @see com.liferay.portlet.usersadmin.util.UserIndexer 1936 */ 1937 public static com.liferay.portal.kernel.search.Hits search(long companyId, 1938 java.lang.String keywords, int status, 1939 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1940 int start, int end, com.liferay.portal.kernel.search.Sort sort) 1941 throws com.liferay.portal.kernel.exception.SystemException { 1942 return getService() 1943 .search(companyId, keywords, status, params, start, end, sort); 1944 } 1945 1946 /** 1947 * Returns an ordered range of all the users with the status, and whose 1948 * first name, middle name, last name, screen name, and email address match 1949 * the keywords specified for them, without using the indexer. It is 1950 * preferable to use the indexed version {@link #search(long, String, 1951 * String, String, String, String, int, LinkedHashMap, boolean, int, int, 1952 * Sort)} instead of this method wherever possible for performance reasons. 1953 * 1954 * <p> 1955 * Useful when paginating results. Returns a maximum of <code>end - 1956 * start</code> instances. <code>start</code> and <code>end</code> are not 1957 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1958 * refers to the first result in the set. Setting both <code>start</code> 1959 * and <code>end</code> to {@link 1960 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1961 * result set. 1962 * </p> 1963 * 1964 * @param companyId the primary key of the user's company 1965 * @param firstName the first name keywords (space separated) 1966 * @param middleName the middle name keywords 1967 * @param lastName the last name keywords 1968 * @param screenName the screen name keywords 1969 * @param emailAddress the email address keywords 1970 * @param status the workflow status 1971 * @param params the finder parameters (optionally <code>null</code>). For 1972 more information see {@link 1973 com.liferay.portal.service.persistence.UserFinder}. 1974 * @param andSearch whether every field must match its keywords, or just 1975 one field. For example, "users with the first name 'bob' and 1976 last name 'smith'" vs "users with the first name 'bob' 1977 or the last name 'smith'". 1978 * @param start the lower bound of the range of users 1979 * @param end the upper bound of the range of users (not inclusive) 1980 * @param obc the comparator to order the users by (optionally 1981 <code>null</code>) 1982 * @return the matching users 1983 * @throws SystemException if a system exception occurred 1984 * @see com.liferay.portal.service.persistence.UserFinder 1985 */ 1986 public static java.util.List<com.liferay.portal.model.User> search( 1987 long companyId, java.lang.String firstName, 1988 java.lang.String middleName, java.lang.String lastName, 1989 java.lang.String screenName, java.lang.String emailAddress, int status, 1990 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1991 boolean andSearch, int start, int end, 1992 com.liferay.portal.kernel.util.OrderByComparator obc) 1993 throws com.liferay.portal.kernel.exception.SystemException { 1994 return getService() 1995 .search(companyId, firstName, middleName, lastName, 1996 screenName, emailAddress, status, params, andSearch, start, end, obc); 1997 } 1998 1999 /** 2000 * Returns an ordered range of all the users with the status, and whose 2001 * first name, middle name, last name, screen name, and email address match 2002 * the keywords specified for them, using the indexer. It is preferable to 2003 * use this method instead of the non-indexed version whenever possible for 2004 * performance reasons. 2005 * 2006 * <p> 2007 * Useful when paginating results. Returns a maximum of <code>end - 2008 * start</code> instances. <code>start</code> and <code>end</code> are not 2009 * primary keys, they are indexes in the result set. Thus, <code>0</code> 2010 * refers to the first result in the set. Setting both <code>start</code> 2011 * and <code>end</code> to {@link 2012 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 2013 * result set. 2014 * </p> 2015 * 2016 * @param companyId the primary key of the user's company 2017 * @param firstName the first name keywords (space separated) 2018 * @param middleName the middle name keywords 2019 * @param lastName the last name keywords 2020 * @param screenName the screen name keywords 2021 * @param emailAddress the email address keywords 2022 * @param status the workflow status 2023 * @param params the indexer parameters (optionally <code>null</code>). For 2024 more information see {@link 2025 com.liferay.portlet.usersadmin.util.UserIndexer}. 2026 * @param andSearch whether every field must match its keywords, or just 2027 one field. For example, "users with the first name 'bob' and 2028 last name 'smith'" vs "users with the first name 'bob' 2029 or the last name 'smith'". 2030 * @param start the lower bound of the range of users 2031 * @param end the upper bound of the range of users (not inclusive) 2032 * @param sort the field and direction to sort by (optionally 2033 <code>null</code>) 2034 * @return the matching users 2035 * @throws SystemException if a system exception occurred 2036 * @see com.liferay.portlet.usersadmin.util.UserIndexer 2037 */ 2038 public static com.liferay.portal.kernel.search.Hits search(long companyId, 2039 java.lang.String firstName, java.lang.String middleName, 2040 java.lang.String lastName, java.lang.String screenName, 2041 java.lang.String emailAddress, int status, 2042 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2043 boolean andSearch, int start, int end, 2044 com.liferay.portal.kernel.search.Sort sort) 2045 throws com.liferay.portal.kernel.exception.SystemException { 2046 return getService() 2047 .search(companyId, firstName, middleName, lastName, 2048 screenName, emailAddress, status, params, andSearch, start, end, 2049 sort); 2050 } 2051 2052 /** 2053 * Returns the number of users who match the keywords and status. 2054 * 2055 * @param companyId the primary key of the user's company 2056 * @param keywords the keywords (space separated), which may occur in the 2057 user's first name, middle name, last name, screen name, or email 2058 address 2059 * @param status the workflow status 2060 * @param params the finder parameters (optionally <code>null</code>). For 2061 more information see {@link 2062 com.liferay.portal.service.persistence.UserFinder}. 2063 * @return the number matching users 2064 * @throws SystemException if a system exception occurred 2065 */ 2066 public static int searchCount(long companyId, java.lang.String keywords, 2067 int status, 2068 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 2069 throws com.liferay.portal.kernel.exception.SystemException { 2070 return getService().searchCount(companyId, keywords, status, params); 2071 } 2072 2073 /** 2074 * Returns the number of users with the status, and whose first name, middle 2075 * name, last name, screen name, and email address match the keywords 2076 * specified for them. 2077 * 2078 * @param companyId the primary key of the user's company 2079 * @param firstName the first name keywords (space separated) 2080 * @param middleName the middle name keywords 2081 * @param lastName the last name keywords 2082 * @param screenName the screen name keywords 2083 * @param emailAddress the email address keywords 2084 * @param status the workflow status 2085 * @param params the finder parameters (optionally <code>null</code>). For 2086 more information see {@link 2087 com.liferay.portal.service.persistence.UserFinder}. 2088 * @param andSearch whether every field must match its keywords, or just 2089 one field. For example, "users with the first name 'bob' and 2090 last name 'smith'" vs "users with the first name 'bob' 2091 or the last name 'smith'". 2092 * @return the number of matching users 2093 * @throws SystemException if a system exception occurred 2094 */ 2095 public static int searchCount(long companyId, java.lang.String firstName, 2096 java.lang.String middleName, java.lang.String lastName, 2097 java.lang.String screenName, java.lang.String emailAddress, int status, 2098 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2099 boolean andSearch) 2100 throws com.liferay.portal.kernel.exception.SystemException { 2101 return getService() 2102 .searchCount(companyId, firstName, middleName, lastName, 2103 screenName, emailAddress, status, params, andSearch); 2104 } 2105 2106 /** 2107 * Sends an email address verification to the user. 2108 * 2109 * @param user the verification email recipient 2110 * @param emailAddress the recipient's email address 2111 * @param serviceContext the service context. Must set the portal URL, main 2112 path, primary key of the layout, remote address, remote host, and 2113 agent for the user. 2114 * @throws PortalException if a portal exception occurred 2115 * @throws SystemException if a system exception occurred 2116 */ 2117 public static void sendEmailAddressVerification( 2118 com.liferay.portal.model.User user, java.lang.String emailAddress, 2119 com.liferay.portal.service.ServiceContext serviceContext) 2120 throws com.liferay.portal.kernel.exception.PortalException, 2121 com.liferay.portal.kernel.exception.SystemException { 2122 getService() 2123 .sendEmailAddressVerification(user, emailAddress, serviceContext); 2124 } 2125 2126 /** 2127 * Sends the password email to the user with the email address. The content 2128 * of this email can be specified in <code>portal.properties</code> with the 2129 * <code>admin.email.password</code> keys. 2130 * 2131 * @param companyId the primary key of the user's company 2132 * @param emailAddress the user's email address 2133 * @param fromName the name of the individual that the email should be from 2134 * @param fromAddress the address of the individual that the email should 2135 be from 2136 * @param subject the email subject. If <code>null</code>, the subject 2137 specified in <code>portal.properties</code> will be used. 2138 * @param body the email body. If <code>null</code>, the body specified in 2139 <code>portal.properties</code> will be used. 2140 * @param serviceContext the user's service context 2141 * @throws PortalException if a user with the email address could not be 2142 found 2143 * @throws SystemException if a system exception occurred 2144 */ 2145 public static void sendPassword(long companyId, 2146 java.lang.String emailAddress, java.lang.String fromName, 2147 java.lang.String fromAddress, java.lang.String subject, 2148 java.lang.String body, 2149 com.liferay.portal.service.ServiceContext serviceContext) 2150 throws com.liferay.portal.kernel.exception.PortalException, 2151 com.liferay.portal.kernel.exception.SystemException { 2152 getService() 2153 .sendPassword(companyId, emailAddress, fromName, fromAddress, 2154 subject, body, serviceContext); 2155 } 2156 2157 /** 2158 * Sets the users in the role, removing and adding users to the role as 2159 * necessary. 2160 * 2161 * @param roleId the primary key of the role 2162 * @param userIds the primary keys of the users 2163 * @throws PortalException if a portal exception occurred 2164 * @throws SystemException if a system exception occurred 2165 */ 2166 public static void setRoleUsers(long roleId, long[] userIds) 2167 throws com.liferay.portal.kernel.exception.PortalException, 2168 com.liferay.portal.kernel.exception.SystemException { 2169 getService().setRoleUsers(roleId, userIds); 2170 } 2171 2172 /** 2173 * Sets the users in the user group, removing and adding users to the user 2174 * group as necessary. 2175 * 2176 * @param userGroupId the primary key of the user group 2177 * @param userIds the primary keys of the users 2178 * @throws PortalException if a portal exception occurred 2179 * @throws SystemException if a system exception occurred 2180 */ 2181 public static void setUserGroupUsers(long userGroupId, long[] userIds) 2182 throws com.liferay.portal.kernel.exception.PortalException, 2183 com.liferay.portal.kernel.exception.SystemException { 2184 getService().setUserGroupUsers(userGroupId, userIds); 2185 } 2186 2187 /** 2188 * Removes the users from the teams of a group. 2189 * 2190 * @param groupId the primary key of the group 2191 * @param userIds the primary keys of the users 2192 * @throws PortalException if a portal exception occurred 2193 * @throws SystemException if a system exception occurred 2194 */ 2195 public static void unsetGroupTeamsUsers(long groupId, long[] userIds) 2196 throws com.liferay.portal.kernel.exception.PortalException, 2197 com.liferay.portal.kernel.exception.SystemException { 2198 getService().unsetGroupTeamsUsers(groupId, userIds); 2199 } 2200 2201 /** 2202 * Removes the users from the group. 2203 * 2204 * @param groupId the primary key of the 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 unsetGroupUsers(long groupId, long[] userIds, 2210 com.liferay.portal.service.ServiceContext serviceContext) 2211 throws com.liferay.portal.kernel.exception.PortalException, 2212 com.liferay.portal.kernel.exception.SystemException { 2213 getService().unsetGroupUsers(groupId, userIds, serviceContext); 2214 } 2215 2216 /** 2217 * Removes the users from the organization. 2218 * 2219 * @param organizationId the primary key of the organization 2220 * @param userIds the primary keys of the users 2221 * @throws PortalException if a portal exception occurred 2222 * @throws SystemException if a system exception occurred 2223 */ 2224 public static void unsetOrganizationUsers(long organizationId, 2225 long[] userIds) 2226 throws com.liferay.portal.kernel.exception.PortalException, 2227 com.liferay.portal.kernel.exception.SystemException { 2228 getService().unsetOrganizationUsers(organizationId, userIds); 2229 } 2230 2231 /** 2232 * Removes the users from the password policy. 2233 * 2234 * @param passwordPolicyId the primary key of the password policy 2235 * @param userIds the primary keys of the users 2236 * @throws SystemException if a system exception occurred 2237 */ 2238 public static void unsetPasswordPolicyUsers(long passwordPolicyId, 2239 long[] userIds) 2240 throws com.liferay.portal.kernel.exception.SystemException { 2241 getService().unsetPasswordPolicyUsers(passwordPolicyId, userIds); 2242 } 2243 2244 /** 2245 * Removes the users from the role. 2246 * 2247 * @param roleId the primary key of the role 2248 * @param users the users 2249 * @throws PortalException if a portal exception occurred 2250 * @throws SystemException if a system exception occurred 2251 */ 2252 public static void unsetRoleUsers(long roleId, 2253 java.util.List<com.liferay.portal.model.User> users) 2254 throws com.liferay.portal.kernel.exception.PortalException, 2255 com.liferay.portal.kernel.exception.SystemException { 2256 getService().unsetRoleUsers(roleId, users); 2257 } 2258 2259 /** 2260 * Removes the users from the role. 2261 * 2262 * @param roleId the primary key of the role 2263 * @param userIds the primary keys of the users 2264 * @throws PortalException if a portal exception occurred 2265 * @throws SystemException if a system exception occurred 2266 */ 2267 public static void unsetRoleUsers(long roleId, long[] userIds) 2268 throws com.liferay.portal.kernel.exception.PortalException, 2269 com.liferay.portal.kernel.exception.SystemException { 2270 getService().unsetRoleUsers(roleId, userIds); 2271 } 2272 2273 /** 2274 * Removes the users from the team. 2275 * 2276 * @param teamId the primary key of the team 2277 * @param userIds the primary keys of the users 2278 * @throws PortalException if a portal exception occurred 2279 * @throws SystemException if a system exception occurred 2280 */ 2281 public static void unsetTeamUsers(long teamId, long[] userIds) 2282 throws com.liferay.portal.kernel.exception.PortalException, 2283 com.liferay.portal.kernel.exception.SystemException { 2284 getService().unsetTeamUsers(teamId, userIds); 2285 } 2286 2287 /** 2288 * Removes the users from the user group. 2289 * 2290 * @param userGroupId the primary key of the user group 2291 * @param userIds the primary keys of the users 2292 * @throws PortalException if a portal exception occurred 2293 * @throws SystemException if a system exception occurred 2294 */ 2295 public static void unsetUserGroupUsers(long userGroupId, long[] userIds) 2296 throws com.liferay.portal.kernel.exception.PortalException, 2297 com.liferay.portal.kernel.exception.SystemException { 2298 getService().unsetUserGroupUsers(userGroupId, userIds); 2299 } 2300 2301 /** 2302 * Updates whether the user has agreed to the terms of use. 2303 * 2304 * @param userId the primary key of the user 2305 * @param agreedToTermsOfUse whether the user has agreet to the terms of 2306 use 2307 * @return the user 2308 * @throws PortalException if a user with the primary key could not be found 2309 * @throws SystemException if a system exception occurred 2310 */ 2311 public static com.liferay.portal.model.User updateAgreedToTermsOfUse( 2312 long userId, boolean agreedToTermsOfUse) 2313 throws com.liferay.portal.kernel.exception.PortalException, 2314 com.liferay.portal.kernel.exception.SystemException { 2315 return getService().updateAgreedToTermsOfUse(userId, agreedToTermsOfUse); 2316 } 2317 2318 /** 2319 * Updates the user's asset with the new asset categories and tag names, 2320 * removing and adding asset categories and tag names as necessary. 2321 * 2322 * @param userId the primary key of the user 2323 * @param user ID the primary key of the user 2324 * @param assetCategoryIds the primary key's of the new asset categories 2325 * @param assetTagNames the new asset tag names 2326 * @throws PortalException if a user with the primary key could not be found 2327 * @throws SystemException if a system exception occurred 2328 */ 2329 public static void updateAsset(long userId, 2330 com.liferay.portal.model.User user, long[] assetCategoryIds, 2331 java.lang.String[] assetTagNames) 2332 throws com.liferay.portal.kernel.exception.PortalException, 2333 com.liferay.portal.kernel.exception.SystemException { 2334 getService().updateAsset(userId, user, assetCategoryIds, assetTagNames); 2335 } 2336 2337 /** 2338 * Updates the user's creation date. 2339 * 2340 * @param userId the primary key of the user 2341 * @param createDate the new creation date 2342 * @return the user 2343 * @throws PortalException if a user with the primary key could not be found 2344 * @throws SystemException if a system exception occurred 2345 */ 2346 public static com.liferay.portal.model.User updateCreateDate(long userId, 2347 java.util.Date createDate) 2348 throws com.liferay.portal.kernel.exception.PortalException, 2349 com.liferay.portal.kernel.exception.SystemException { 2350 return getService().updateCreateDate(userId, createDate); 2351 } 2352 2353 /** 2354 * Updates the user's email address. 2355 * 2356 * @param userId the primary key of the user 2357 * @param password the user's password 2358 * @param emailAddress1 the user's new email address 2359 * @param emailAddress2 the user's new email address confirmation 2360 * @return the user 2361 * @throws PortalException if a user with the primary key could not be found 2362 * @throws SystemException if a system exception occurred 2363 */ 2364 public static com.liferay.portal.model.User updateEmailAddress( 2365 long userId, java.lang.String password, java.lang.String emailAddress1, 2366 java.lang.String emailAddress2) 2367 throws com.liferay.portal.kernel.exception.PortalException, 2368 com.liferay.portal.kernel.exception.SystemException { 2369 return getService() 2370 .updateEmailAddress(userId, password, emailAddress1, 2371 emailAddress2); 2372 } 2373 2374 /** 2375 * Updates the user's email address or sends verification email. 2376 * 2377 * @param userId the primary key of the user 2378 * @param password the user's password 2379 * @param emailAddress1 the user's new email address 2380 * @param emailAddress2 the user's new email address confirmation 2381 * @return the user 2382 * @throws PortalException if a user with the primary key could not be found 2383 * @throws SystemException if a system exception occurred 2384 */ 2385 public static com.liferay.portal.model.User updateEmailAddress( 2386 long userId, java.lang.String password, java.lang.String emailAddress1, 2387 java.lang.String emailAddress2, 2388 com.liferay.portal.service.ServiceContext serviceContext) 2389 throws com.liferay.portal.kernel.exception.PortalException, 2390 com.liferay.portal.kernel.exception.SystemException { 2391 return getService() 2392 .updateEmailAddress(userId, password, emailAddress1, 2393 emailAddress2, serviceContext); 2394 } 2395 2396 /** 2397 * Updates whether the user has verified email address. 2398 * 2399 * @param userId the primary key of the user 2400 * @param emailAddressVerified whether the user has verified email address 2401 * @return the user 2402 * @throws PortalException if a user with the primary key could not be found 2403 * @throws SystemException if a system exception occurred 2404 */ 2405 public static com.liferay.portal.model.User updateEmailAddressVerified( 2406 long userId, boolean emailAddressVerified) 2407 throws com.liferay.portal.kernel.exception.PortalException, 2408 com.liferay.portal.kernel.exception.SystemException { 2409 return getService() 2410 .updateEmailAddressVerified(userId, emailAddressVerified); 2411 } 2412 2413 /** 2414 * Updates the user's Facebook ID. 2415 * 2416 * @param userId the primary key of the user 2417 * @param facebookId the user's new Facebook ID 2418 * @return the user 2419 * @throws PortalException if a user with the primary key could not be found 2420 * @throws SystemException if a system exception occurred 2421 */ 2422 public static com.liferay.portal.model.User updateFacebookId(long userId, 2423 long facebookId) 2424 throws com.liferay.portal.kernel.exception.PortalException, 2425 com.liferay.portal.kernel.exception.SystemException { 2426 return getService().updateFacebookId(userId, facebookId); 2427 } 2428 2429 /** 2430 * Sets the groups the user is in, removing and adding groups as necessary. 2431 * 2432 * @param userId the primary key of the user 2433 * @param newGroupIds the primary keys of the groups 2434 * @throws PortalException if a portal exception occurred 2435 * @throws SystemException if a system exception occurred 2436 */ 2437 public static void updateGroups(long userId, long[] newGroupIds, 2438 com.liferay.portal.service.ServiceContext serviceContext) 2439 throws com.liferay.portal.kernel.exception.PortalException, 2440 com.liferay.portal.kernel.exception.SystemException { 2441 getService().updateGroups(userId, newGroupIds, serviceContext); 2442 } 2443 2444 /** 2445 * Updates a user account that was automatically created when a guest user 2446 * participated in an action (e.g. posting a comment) and only provided his 2447 * name and email address. 2448 * 2449 * @param creatorUserId the primary key of the creator 2450 * @param companyId the primary key of the user's company 2451 * @param autoPassword whether a password should be automatically generated 2452 for the user 2453 * @param password1 the user's password 2454 * @param password2 the user's password confirmation 2455 * @param autoScreenName whether a screen name should be automatically 2456 generated for the user 2457 * @param screenName the user's screen name 2458 * @param emailAddress the user's email address 2459 * @param facebookId the user's facebook ID 2460 * @param openId the user's OpenID 2461 * @param locale the user's locale 2462 * @param firstName the user's first name 2463 * @param middleName the user's middle name 2464 * @param lastName the user's last name 2465 * @param prefixId the user's name prefix ID 2466 * @param suffixId the user's name suffix ID 2467 * @param male whether the user is male 2468 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 2469 January) 2470 * @param birthdayDay the user's birthday day 2471 * @param birthdayYear the user's birthday year 2472 * @param jobTitle the user's job title 2473 * @param updateUserInformation whether to update the user's information 2474 * @param sendEmail whether to send the user an email notification about 2475 their new account 2476 * @param serviceContext the user's service context (optionally 2477 <code>null</code>). Can set expando bridge attributes for the 2478 user. 2479 * @return the user 2480 * @throws PortalException if the user's information was invalid 2481 * @throws SystemException if a system exception occurred 2482 */ 2483 public static com.liferay.portal.model.User updateIncompleteUser( 2484 long creatorUserId, long companyId, boolean autoPassword, 2485 java.lang.String password1, java.lang.String password2, 2486 boolean autoScreenName, java.lang.String screenName, 2487 java.lang.String emailAddress, long facebookId, 2488 java.lang.String openId, java.util.Locale locale, 2489 java.lang.String firstName, java.lang.String middleName, 2490 java.lang.String lastName, int prefixId, int suffixId, boolean male, 2491 int birthdayMonth, int birthdayDay, int birthdayYear, 2492 java.lang.String jobTitle, boolean updateUserInformation, 2493 boolean sendEmail, 2494 com.liferay.portal.service.ServiceContext serviceContext) 2495 throws com.liferay.portal.kernel.exception.PortalException, 2496 com.liferay.portal.kernel.exception.SystemException { 2497 return getService() 2498 .updateIncompleteUser(creatorUserId, companyId, 2499 autoPassword, password1, password2, autoScreenName, screenName, 2500 emailAddress, facebookId, openId, locale, firstName, middleName, 2501 lastName, prefixId, suffixId, male, birthdayMonth, birthdayDay, 2502 birthdayYear, jobTitle, updateUserInformation, sendEmail, 2503 serviceContext); 2504 } 2505 2506 /** 2507 * Updates the user's job title. 2508 * 2509 * @param userId the primary key of the user 2510 * @param jobTitle the user's job title 2511 * @return the user 2512 * @throws PortalException if a user with the primary key could not be found 2513 or if a contact could not be found matching the user's contact ID 2514 * @throws SystemException if a system exception occurred 2515 */ 2516 public static com.liferay.portal.model.User updateJobTitle(long userId, 2517 java.lang.String jobTitle) 2518 throws com.liferay.portal.kernel.exception.PortalException, 2519 com.liferay.portal.kernel.exception.SystemException { 2520 return getService().updateJobTitle(userId, jobTitle); 2521 } 2522 2523 /** 2524 * Updates the user's last login with the current time and the IP address. 2525 * 2526 * @param userId the primary key of the user 2527 * @param loginIP the IP address the user logged in from 2528 * @return the user 2529 * @throws PortalException if a user with the primary key could not be found 2530 * @throws SystemException if a system exception occurred 2531 */ 2532 public static com.liferay.portal.model.User updateLastLogin(long userId, 2533 java.lang.String loginIP) 2534 throws com.liferay.portal.kernel.exception.PortalException, 2535 com.liferay.portal.kernel.exception.SystemException { 2536 return getService().updateLastLogin(userId, loginIP); 2537 } 2538 2539 /** 2540 * Updates whether the user is locked out from logging in. 2541 * 2542 * @param user the user 2543 * @param lockout whether the user is locked out 2544 * @return the user 2545 * @throws PortalException if a portal exception occurred 2546 * @throws SystemException if a system exception occurred 2547 */ 2548 public static com.liferay.portal.model.User updateLockout( 2549 com.liferay.portal.model.User user, boolean lockout) 2550 throws com.liferay.portal.kernel.exception.PortalException, 2551 com.liferay.portal.kernel.exception.SystemException { 2552 return getService().updateLockout(user, lockout); 2553 } 2554 2555 /** 2556 * Updates whether the user is locked out from logging in. 2557 * 2558 * @param companyId the primary key of the user's company 2559 * @param emailAddress the user's email address 2560 * @param lockout whether the user is locked out 2561 * @return the user 2562 * @throws PortalException if a user with the email address could not be 2563 found 2564 * @throws SystemException if a system exception occurred 2565 */ 2566 public static com.liferay.portal.model.User updateLockoutByEmailAddress( 2567 long companyId, java.lang.String emailAddress, boolean lockout) 2568 throws com.liferay.portal.kernel.exception.PortalException, 2569 com.liferay.portal.kernel.exception.SystemException { 2570 return getService() 2571 .updateLockoutByEmailAddress(companyId, emailAddress, lockout); 2572 } 2573 2574 /** 2575 * Updates whether the user is locked out from logging in. 2576 * 2577 * @param userId the primary key of the user 2578 * @param lockout whether the user is locked out 2579 * @return the user 2580 * @throws PortalException if a user with the primary key could not be found 2581 * @throws SystemException if a system exception occurred 2582 */ 2583 public static com.liferay.portal.model.User updateLockoutById(long userId, 2584 boolean lockout) 2585 throws com.liferay.portal.kernel.exception.PortalException, 2586 com.liferay.portal.kernel.exception.SystemException { 2587 return getService().updateLockoutById(userId, lockout); 2588 } 2589 2590 /** 2591 * Updates whether the user is locked out from logging in. 2592 * 2593 * @param companyId the primary key of the user's company 2594 * @param screenName the user's screen name 2595 * @param lockout whether the user is locked out 2596 * @return the user 2597 * @throws PortalException if a user with the screen name could not be found 2598 * @throws SystemException if a system exception occurred 2599 */ 2600 public static com.liferay.portal.model.User updateLockoutByScreenName( 2601 long companyId, java.lang.String screenName, boolean lockout) 2602 throws com.liferay.portal.kernel.exception.PortalException, 2603 com.liferay.portal.kernel.exception.SystemException { 2604 return getService() 2605 .updateLockoutByScreenName(companyId, screenName, lockout); 2606 } 2607 2608 /** 2609 * Updates the user's modified date. 2610 * 2611 * @param userId the primary key of the user 2612 * @param modifiedDate the new modified date 2613 * @return the user 2614 * @throws PortalException if a user with the primary key could not be found 2615 * @throws SystemException if a system exception occurred 2616 */ 2617 public static com.liferay.portal.model.User updateModifiedDate( 2618 long userId, java.util.Date modifiedDate) 2619 throws com.liferay.portal.kernel.exception.PortalException, 2620 com.liferay.portal.kernel.exception.SystemException { 2621 return getService().updateModifiedDate(userId, modifiedDate); 2622 } 2623 2624 /** 2625 * Updates the user's OpenID. 2626 * 2627 * @param userId the primary key of the user 2628 * @param openId the new OpenID 2629 * @return the user 2630 * @throws PortalException if a user with the primary key could not be found 2631 * @throws SystemException if a system exception occurred 2632 */ 2633 public static com.liferay.portal.model.User updateOpenId(long userId, 2634 java.lang.String openId) 2635 throws com.liferay.portal.kernel.exception.PortalException, 2636 com.liferay.portal.kernel.exception.SystemException { 2637 return getService().updateOpenId(userId, openId); 2638 } 2639 2640 /** 2641 * Sets the organizations that the user is in, removing and adding 2642 * organizations as necessary. 2643 * 2644 * @param userId the primary key of the user 2645 * @param newOrganizationIds the primary keys of the organizations 2646 * @throws PortalException if a user with the primary key could not be found 2647 * @throws SystemException if a system exception occurred 2648 */ 2649 public static void updateOrganizations(long userId, 2650 long[] newOrganizationIds, 2651 com.liferay.portal.service.ServiceContext serviceContext) 2652 throws com.liferay.portal.kernel.exception.PortalException, 2653 com.liferay.portal.kernel.exception.SystemException { 2654 getService() 2655 .updateOrganizations(userId, newOrganizationIds, serviceContext); 2656 } 2657 2658 /** 2659 * Updates the user's password without tracking or validation of the change. 2660 * 2661 * @param userId the primary key of the user 2662 * @param password1 the user's new password 2663 * @param password2 the user's new password confirmation 2664 * @param passwordReset whether the user should be asked to reset their 2665 password the next time they log in 2666 * @return the user 2667 * @throws PortalException if a user with the primary key could not be found 2668 * @throws SystemException if a system exception occurred 2669 */ 2670 public static com.liferay.portal.model.User updatePassword(long userId, 2671 java.lang.String password1, java.lang.String password2, 2672 boolean passwordReset) 2673 throws com.liferay.portal.kernel.exception.PortalException, 2674 com.liferay.portal.kernel.exception.SystemException { 2675 return getService() 2676 .updatePassword(userId, password1, password2, passwordReset); 2677 } 2678 2679 /** 2680 * Updates the user's password, optionally with tracking and validation of 2681 * the change. 2682 * 2683 * @param userId the primary key of the user 2684 * @param password1 the user's new password 2685 * @param password2 the user's new password confirmation 2686 * @param passwordReset whether the user should be asked to reset their 2687 password the next time they login 2688 * @param silentUpdate whether the password should be updated without being 2689 tracked, or validated. Primarily used for password imports. 2690 * @return the user 2691 * @throws PortalException if a user with the primary key could not be found 2692 * @throws SystemException if a system exception occurred 2693 */ 2694 public static com.liferay.portal.model.User updatePassword(long userId, 2695 java.lang.String password1, java.lang.String password2, 2696 boolean passwordReset, boolean silentUpdate) 2697 throws com.liferay.portal.kernel.exception.PortalException, 2698 com.liferay.portal.kernel.exception.SystemException { 2699 return getService() 2700 .updatePassword(userId, password1, password2, passwordReset, 2701 silentUpdate); 2702 } 2703 2704 /** 2705 * Updates the user's password with manually input information. This method 2706 * should only be used when performing maintenance. 2707 * 2708 * @param userId the primary key of the user 2709 * @param password the user's new password 2710 * @param passwordEncrypted the user's new encrypted password 2711 * @param passwordReset whether the user should be asked to reset their 2712 password the next time they login 2713 * @param passwordModifiedDate the new password modified date 2714 * @return the user 2715 * @throws PortalException if a user with the primary key could not be found 2716 * @throws SystemException if a system exception occurred 2717 */ 2718 public static com.liferay.portal.model.User updatePasswordManually( 2719 long userId, java.lang.String password, boolean passwordEncrypted, 2720 boolean passwordReset, java.util.Date passwordModifiedDate) 2721 throws com.liferay.portal.kernel.exception.PortalException, 2722 com.liferay.portal.kernel.exception.SystemException { 2723 return getService() 2724 .updatePasswordManually(userId, password, passwordEncrypted, 2725 passwordReset, passwordModifiedDate); 2726 } 2727 2728 /** 2729 * Updates whether the user should be asked to reset their password the next 2730 * time they login. 2731 * 2732 * @param userId the primary key of the user 2733 * @param passwordReset whether the user should be asked to reset their 2734 password the next time they login 2735 * @return the user 2736 * @throws PortalException if a user with the primary key could not be found 2737 * @throws SystemException if a system exception occurred 2738 */ 2739 public static com.liferay.portal.model.User updatePasswordReset( 2740 long userId, boolean passwordReset) 2741 throws com.liferay.portal.kernel.exception.PortalException, 2742 com.liferay.portal.kernel.exception.SystemException { 2743 return getService().updatePasswordReset(userId, passwordReset); 2744 } 2745 2746 /** 2747 * Updates the user's portrait image. 2748 * 2749 * @param userId the primary key of the user 2750 * @param bytes the new portrait image data 2751 * @return the user 2752 * @throws PortalException if a user with the primary key could not be found 2753 or if the new portrait was invalid 2754 * @throws SystemException if a system exception occurred 2755 */ 2756 public static com.liferay.portal.model.User updatePortrait(long userId, 2757 byte[] bytes) 2758 throws com.liferay.portal.kernel.exception.PortalException, 2759 com.liferay.portal.kernel.exception.SystemException { 2760 return getService().updatePortrait(userId, bytes); 2761 } 2762 2763 /** 2764 * Updates the user's password reset question and answer. 2765 * 2766 * @param userId the primary key of the user 2767 * @param question the user's new password reset question 2768 * @param answer the user's new password reset answer 2769 * @return the user 2770 * @throws PortalException if a user with the primary key could not be found 2771 or if the new question or answer were invalid 2772 * @throws SystemException if a system exception occurred 2773 */ 2774 public static com.liferay.portal.model.User updateReminderQuery( 2775 long userId, java.lang.String question, java.lang.String answer) 2776 throws com.liferay.portal.kernel.exception.PortalException, 2777 com.liferay.portal.kernel.exception.SystemException { 2778 return getService().updateReminderQuery(userId, question, answer); 2779 } 2780 2781 /** 2782 * Updates the user's screen name. 2783 * 2784 * @param userId the primary key of the user 2785 * @param screenName the user's new screen name 2786 * @return the user 2787 * @throws PortalException if a user with the primary key could not be found 2788 or if the new screen name was invalid 2789 * @throws SystemException if a system exception occurred 2790 */ 2791 public static com.liferay.portal.model.User updateScreenName(long userId, 2792 java.lang.String screenName) 2793 throws com.liferay.portal.kernel.exception.PortalException, 2794 com.liferay.portal.kernel.exception.SystemException { 2795 return getService().updateScreenName(userId, screenName); 2796 } 2797 2798 /** 2799 * Updates the user's workflow status. 2800 * 2801 * @param userId the primary key of the user 2802 * @param status the user's new workflow status 2803 * @return the user 2804 * @throws PortalException if a user with the primary key could not be found 2805 * @throws SystemException if a system exception occurred 2806 */ 2807 public static com.liferay.portal.model.User updateStatus(long userId, 2808 int status) 2809 throws com.liferay.portal.kernel.exception.PortalException, 2810 com.liferay.portal.kernel.exception.SystemException { 2811 return getService().updateStatus(userId, status); 2812 } 2813 2814 /** 2815 * Updates the user. 2816 * 2817 * @param userId the primary key of the user 2818 * @param oldPassword the user's old password 2819 * @param newPassword1 the user's new password (optionally 2820 <code>null</code>) 2821 * @param newPassword2 the user's new password confirmation (optionally 2822 <code>null</code>) 2823 * @param passwordReset whether the user should be asked to reset their 2824 password the next time they login 2825 * @param reminderQueryQuestion the user's new password reset question 2826 * @param reminderQueryAnswer the user's new password reset answer 2827 * @param screenName the user's new screen name 2828 * @param emailAddress the user's new email address 2829 * @param facebookId the user's new Facebook ID 2830 * @param openId the user's new OpenID 2831 * @param languageId the user's new language ID 2832 * @param timeZoneId the user's new time zone ID 2833 * @param greeting the user's new greeting 2834 * @param comments the user's new comments 2835 * @param firstName the user's new first name 2836 * @param middleName the user's new middle name 2837 * @param lastName the user's new last name 2838 * @param prefixId the user's new name prefix ID 2839 * @param suffixId the user's new name suffix ID 2840 * @param male whether user is male 2841 * @param birthdayMonth the user's new birthday month (0-based, meaning 0 2842 for January) 2843 * @param birthdayDay the user's new birthday day 2844 * @param birthdayYear the user's birthday year 2845 * @param smsSn the user's new SMS screen name 2846 * @param aimSn the user's new AIM screen name 2847 * @param facebookSn the user's new Facebook screen name 2848 * @param icqSn the user's new ICQ screen name 2849 * @param jabberSn the user's new Jabber screen name 2850 * @param msnSn the user's new MSN screen name 2851 * @param mySpaceSn the user's new MySpace screen name 2852 * @param skypeSn the user's new Skype screen name 2853 * @param twitterSn the user's new Twitter screen name 2854 * @param ymSn the user's new Yahoo! Messenger screen name 2855 * @param jobTitle the user's new job title 2856 * @param groupIds the primary keys of the user's groups 2857 * @param organizationIds the primary keys of the user's organizations 2858 * @param roleIds the primary keys of the user's roles 2859 * @param userGroupRoles the user user's group roles 2860 * @param userGroupIds the primary keys of the user's user groups 2861 * @param serviceContext the user's service context (optionally 2862 <code>null</code>). Can set the universally unique identifier 2863 (with the <code>uuid</code> attribute), asset category IDs, asset 2864 tag names, and expando bridge attributes for the user. 2865 * @return the user 2866 * @throws PortalException if a user with the primary key could not be found 2867 or if the new information was invalid 2868 * @throws SystemException if a system exception occurred 2869 */ 2870 public static com.liferay.portal.model.User updateUser(long userId, 2871 java.lang.String oldPassword, java.lang.String newPassword1, 2872 java.lang.String newPassword2, boolean passwordReset, 2873 java.lang.String reminderQueryQuestion, 2874 java.lang.String reminderQueryAnswer, java.lang.String screenName, 2875 java.lang.String emailAddress, long facebookId, 2876 java.lang.String openId, java.lang.String languageId, 2877 java.lang.String timeZoneId, java.lang.String greeting, 2878 java.lang.String comments, java.lang.String firstName, 2879 java.lang.String middleName, java.lang.String lastName, int prefixId, 2880 int suffixId, boolean male, int birthdayMonth, int birthdayDay, 2881 int birthdayYear, java.lang.String smsSn, java.lang.String aimSn, 2882 java.lang.String facebookSn, java.lang.String icqSn, 2883 java.lang.String jabberSn, java.lang.String msnSn, 2884 java.lang.String mySpaceSn, java.lang.String skypeSn, 2885 java.lang.String twitterSn, java.lang.String ymSn, 2886 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 2887 long[] roleIds, 2888 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles, 2889 long[] userGroupIds, 2890 com.liferay.portal.service.ServiceContext serviceContext) 2891 throws com.liferay.portal.kernel.exception.PortalException, 2892 com.liferay.portal.kernel.exception.SystemException { 2893 return getService() 2894 .updateUser(userId, oldPassword, newPassword1, newPassword2, 2895 passwordReset, reminderQueryQuestion, reminderQueryAnswer, 2896 screenName, emailAddress, facebookId, openId, languageId, 2897 timeZoneId, greeting, comments, firstName, middleName, lastName, 2898 prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, 2899 smsSn, aimSn, facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, 2900 skypeSn, twitterSn, ymSn, jobTitle, groupIds, organizationIds, 2901 roleIds, userGroupRoles, userGroupIds, serviceContext); 2902 } 2903 2904 /** 2905 * Verifies the email address of the ticket. 2906 * 2907 * @param ticketKey the ticket key 2908 * @throws PortalException if a ticket matching the ticket key could not be 2909 found, if the ticket has expired, if the ticket is an email 2910 address ticket, or if the email address is invalid 2911 * @throws SystemException if a system exception occurred 2912 */ 2913 public static void verifyEmailAddress(java.lang.String ticketKey) 2914 throws com.liferay.portal.kernel.exception.PortalException, 2915 com.liferay.portal.kernel.exception.SystemException { 2916 getService().verifyEmailAddress(ticketKey); 2917 } 2918 2919 public static UserLocalService getService() { 2920 if (_service == null) { 2921 _service = (UserLocalService)PortalBeanLocatorUtil.locate(UserLocalService.class.getName()); 2922 2923 ReferenceRegistry.registerReference(UserLocalServiceUtil.class, 2924 "_service"); 2925 } 2926 2927 return _service; 2928 } 2929 2930 /** 2931 * @deprecated 2932 */ 2933 public void setService(UserLocalService service) { 2934 } 2935 2936 private static UserLocalService _service; 2937 }