001 /** 002 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.service; 016 017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.util.ReferenceRegistry; 019 020 /** 021 * The utility for the user local service. This utility wraps {@link com.liferay.portal.service.impl.UserLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server. 022 * 023 * <p> 024 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM. 025 * </p> 026 * 027 * @author Brian Wing Shun Chan 028 * @see UserLocalService 029 * @see com.liferay.portal.service.base.UserLocalServiceBaseImpl 030 * @see com.liferay.portal.service.impl.UserLocalServiceImpl 031 * @generated 032 */ 033 public class UserLocalServiceUtil { 034 /* 035 * NOTE FOR DEVELOPERS: 036 * 037 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.UserLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 038 */ 039 040 /** 041 * Adds the user to the database. Also notifies the appropriate model listeners. 042 * 043 * @param user the user 044 * @return the user that was added 045 * @throws SystemException if a system exception occurred 046 */ 047 public static com.liferay.portal.model.User addUser( 048 com.liferay.portal.model.User user) 049 throws com.liferay.portal.kernel.exception.SystemException { 050 return getService().addUser(user); 051 } 052 053 /** 054 * Creates a new user with the primary key. Does not add the user to the database. 055 * 056 * @param userId the primary key for the new user 057 * @return the new user 058 */ 059 public static com.liferay.portal.model.User createUser(long userId) { 060 return getService().createUser(userId); 061 } 062 063 /** 064 * Deletes the user with the primary key from the database. Also notifies the appropriate model listeners. 065 * 066 * @param userId the primary key of the user 067 * @return the user that was removed 068 * @throws PortalException if a user with the primary key could not be found 069 * @throws SystemException if a system exception occurred 070 */ 071 public static com.liferay.portal.model.User deleteUser(long userId) 072 throws com.liferay.portal.kernel.exception.PortalException, 073 com.liferay.portal.kernel.exception.SystemException { 074 return getService().deleteUser(userId); 075 } 076 077 /** 078 * Deletes the user from the database. Also notifies the appropriate model listeners. 079 * 080 * @param user the user 081 * @return the user that was removed 082 * @throws PortalException 083 * @throws SystemException if a system exception occurred 084 */ 085 public static com.liferay.portal.model.User deleteUser( 086 com.liferay.portal.model.User user) 087 throws com.liferay.portal.kernel.exception.PortalException, 088 com.liferay.portal.kernel.exception.SystemException { 089 return getService().deleteUser(user); 090 } 091 092 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 093 return getService().dynamicQuery(); 094 } 095 096 /** 097 * Performs a dynamic query on the database and returns the matching rows. 098 * 099 * @param dynamicQuery the dynamic query 100 * @return the matching rows 101 * @throws SystemException if a system exception occurred 102 */ 103 @SuppressWarnings("rawtypes") 104 public static java.util.List dynamicQuery( 105 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 106 throws com.liferay.portal.kernel.exception.SystemException { 107 return getService().dynamicQuery(dynamicQuery); 108 } 109 110 /** 111 * Performs a dynamic query on the database and returns a range of the matching rows. 112 * 113 * <p> 114 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.UserModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.UserModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.UserModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 198 * </p> 199 * 200 * @param start the lower bound of the range of users 201 * @param end the upper bound of the range of users (not inclusive) 202 * @return the range of users 203 * @throws SystemException if a system exception occurred 204 */ 205 public static java.util.List<com.liferay.portal.model.User> getUsers( 206 int start, int end) 207 throws com.liferay.portal.kernel.exception.SystemException { 208 return getService().getUsers(start, end); 209 } 210 211 /** 212 * Returns the number of users. 213 * 214 * @return the number of users 215 * @throws SystemException if a system exception occurred 216 */ 217 public static int getUsersCount() 218 throws com.liferay.portal.kernel.exception.SystemException { 219 return getService().getUsersCount(); 220 } 221 222 /** 223 * Updates the user in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 224 * 225 * @param user the user 226 * @return the user that was updated 227 * @throws SystemException if a system exception occurred 228 */ 229 public static com.liferay.portal.model.User updateUser( 230 com.liferay.portal.model.User user) 231 throws com.liferay.portal.kernel.exception.SystemException { 232 return getService().updateUser(user); 233 } 234 235 /** 236 * Returns the Spring bean ID for this bean. 237 * 238 * @return the Spring bean ID for this bean 239 */ 240 public static java.lang.String getBeanIdentifier() { 241 return getService().getBeanIdentifier(); 242 } 243 244 /** 245 * Sets the Spring bean ID for this bean. 246 * 247 * @param beanIdentifier the Spring bean ID for this bean 248 */ 249 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 250 getService().setBeanIdentifier(beanIdentifier); 251 } 252 253 /** 254 * Adds a default admin user for the company. 255 * 256 * @param companyId the primary key of the user's company 257 * @param screenName the user's screen name 258 * @param emailAddress the user's email address 259 * @param locale the user's locale 260 * @param firstName the user's first name 261 * @param middleName the user's middle name 262 * @param lastName the user's last name 263 * @return the new default admin user 264 * @throws PortalException n if a portal exception occurred 265 * @throws SystemException if a system exception occurred 266 */ 267 public static com.liferay.portal.model.User addDefaultAdminUser( 268 long companyId, java.lang.String screenName, 269 java.lang.String emailAddress, java.util.Locale locale, 270 java.lang.String firstName, java.lang.String middleName, 271 java.lang.String lastName) 272 throws com.liferay.portal.kernel.exception.PortalException, 273 com.liferay.portal.kernel.exception.SystemException { 274 return getService() 275 .addDefaultAdminUser(companyId, screenName, emailAddress, 276 locale, firstName, middleName, lastName); 277 } 278 279 /** 280 * Adds the user to the default groups, unless the user is already in these 281 * groups. The default groups can be specified in 282 * <code>portal.properties</code> with the key 283 * <code>admin.default.group.names</code>. 284 * 285 * @param userId the primary key of the user 286 * @throws PortalException if a user with the primary key could not be found 287 * @throws SystemException if a system exception occurred 288 */ 289 public static void addDefaultGroups(long userId) 290 throws com.liferay.portal.kernel.exception.PortalException, 291 com.liferay.portal.kernel.exception.SystemException { 292 getService().addDefaultGroups(userId); 293 } 294 295 /** 296 * Adds the user to the default roles, unless the user already has these 297 * roles. The default roles can be specified in 298 * <code>portal.properties</code> with the key 299 * <code>admin.default.role.names</code>. 300 * 301 * @param userId the primary key of the user 302 * @throws PortalException if a user with the primary key could not be found 303 * @throws SystemException if a system exception occurred 304 */ 305 public static void addDefaultRoles(long userId) 306 throws com.liferay.portal.kernel.exception.PortalException, 307 com.liferay.portal.kernel.exception.SystemException { 308 getService().addDefaultRoles(userId); 309 } 310 311 /** 312 * Adds the user to the default user groups, unless the user is already in 313 * these user groups. The default user groups can be specified in 314 * <code>portal.properties</code> with the property 315 * <code>admin.default.user.group.names</code>. 316 * 317 * @param userId the primary key of the user 318 * @throws PortalException if a user with the primary key could not be found 319 * @throws SystemException if a system exception occurred 320 */ 321 public static void addDefaultUserGroups(long userId) 322 throws com.liferay.portal.kernel.exception.PortalException, 323 com.liferay.portal.kernel.exception.SystemException { 324 getService().addDefaultUserGroups(userId); 325 } 326 327 /** 328 * Adds the users to the group. 329 * 330 * @param groupId the primary key of the group 331 * @param userIds the primary keys of the users 332 * @throws PortalException if a group or user with the primary key could not 333 be found 334 * @throws SystemException if a system exception occurred 335 */ 336 public static void addGroupUsers(long groupId, long[] userIds) 337 throws com.liferay.portal.kernel.exception.PortalException, 338 com.liferay.portal.kernel.exception.SystemException { 339 getService().addGroupUsers(groupId, userIds); 340 } 341 342 /** 343 * Adds the users to the organization. 344 * 345 * @param organizationId the primary key of the organization 346 * @param userIds the primary keys of the users 347 * @throws PortalException if an organization or user with the primary key 348 could not be found 349 * @throws SystemException if a system exception occurred 350 */ 351 public static void addOrganizationUsers(long organizationId, long[] userIds) 352 throws com.liferay.portal.kernel.exception.PortalException, 353 com.liferay.portal.kernel.exception.SystemException { 354 getService().addOrganizationUsers(organizationId, userIds); 355 } 356 357 /** 358 * Assigns the password policy to the users, removing any other currently 359 * assigned password policies. 360 * 361 * @param passwordPolicyId the primary key of the password policy 362 * @param userIds the primary keys of the users 363 * @throws SystemException if a system exception occurred 364 */ 365 public static void addPasswordPolicyUsers(long passwordPolicyId, 366 long[] userIds) 367 throws com.liferay.portal.kernel.exception.SystemException { 368 getService().addPasswordPolicyUsers(passwordPolicyId, userIds); 369 } 370 371 /** 372 * Adds the users to the role. 373 * 374 * @param roleId the primary key of the role 375 * @param userIds the primary keys of the users 376 * @throws PortalException if a role or user with the primary key could not 377 be found 378 * @throws SystemException if a system exception occurred 379 */ 380 public static void addRoleUsers(long roleId, long[] userIds) 381 throws com.liferay.portal.kernel.exception.PortalException, 382 com.liferay.portal.kernel.exception.SystemException { 383 getService().addRoleUsers(roleId, userIds); 384 } 385 386 /** 387 * Adds the users to the team. 388 * 389 * @param teamId the primary key of the team 390 * @param userIds the primary keys of the users 391 * @throws PortalException if a team or user with the primary key could not 392 be found 393 * @throws SystemException if a system exception occurred 394 */ 395 public static void addTeamUsers(long teamId, long[] userIds) 396 throws com.liferay.portal.kernel.exception.PortalException, 397 com.liferay.portal.kernel.exception.SystemException { 398 getService().addTeamUsers(teamId, userIds); 399 } 400 401 /** 402 * Adds a user. 403 * 404 * <p> 405 * This method handles the creation and bookkeeping of the user including 406 * its resources, metadata, and internal data structures. It is not 407 * necessary to make subsequent calls to any methods to setup default 408 * groups, resources, etc. 409 * </p> 410 * 411 * @param creatorUserId the primary key of the creator 412 * @param companyId the primary key of the user's company 413 * @param autoPassword whether a password should be automatically generated 414 for the user 415 * @param password1 the user's password 416 * @param password2 the user's password confirmation 417 * @param autoScreenName whether a screen name should be automatically 418 generated for the user 419 * @param screenName the user's screen name 420 * @param emailAddress the user's email address 421 * @param facebookId the user's facebook ID 422 * @param openId the user's OpenID 423 * @param locale the user's locale 424 * @param firstName the user's first name 425 * @param middleName the user's middle name 426 * @param lastName the user's last name 427 * @param prefixId the user's name prefix ID 428 * @param suffixId the user's name suffix ID 429 * @param male whether the user is male 430 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 431 January) 432 * @param birthdayDay the user's birthday day 433 * @param birthdayYear the user's birthday year 434 * @param jobTitle the user's job title 435 * @param groupIds the primary keys of the user's groups 436 * @param organizationIds the primary keys of the user's organizations 437 * @param roleIds the primary keys of the roles this user possesses 438 * @param userGroupIds the primary keys of the user's user groups 439 * @param sendEmail whether to send the user an email notification about 440 their new account 441 * @param serviceContext the user's service context (optionally 442 <code>null</code>). Can set the UUID (with the <code>uuid</code> 443 attribute), asset category IDs, asset tag names, and expando 444 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 UUID (with the <code>uuid</code> 528 attribute), asset category IDs, asset tag names, and expando 529 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 UUID. 1630 * 1631 * @param uuid the user's UUID 1632 * @return the user with the UUID 1633 * @throws PortalException if a user with the UUID could not be found 1634 * @throws SystemException if a system exception occurred 1635 * @deprecated {@link #getUserByUuidAndCompanyId(String, long)} 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 the user with the UUID. 1646 * 1647 * @param uuid the user's UUID 1648 * @param companyId the primary key of the user's company 1649 * @return the user with the UUID 1650 * @throws PortalException if a user with the UUID could not be found 1651 * @throws SystemException if a system exception occurred 1652 */ 1653 public static com.liferay.portal.model.User getUserByUuidAndCompanyId( 1654 java.lang.String uuid, long companyId) 1655 throws com.liferay.portal.kernel.exception.PortalException, 1656 com.liferay.portal.kernel.exception.SystemException { 1657 return getService().getUserByUuidAndCompanyId(uuid, companyId); 1658 } 1659 1660 /** 1661 * Returns all the users belonging to the user group. 1662 * 1663 * @param userGroupId the primary key of the user group 1664 * @return the users belonging to the user group 1665 * @throws SystemException if a system exception occurred 1666 */ 1667 public static java.util.List<com.liferay.portal.model.User> getUserGroupUsers( 1668 long userGroupId) 1669 throws com.liferay.portal.kernel.exception.SystemException { 1670 return getService().getUserGroupUsers(userGroupId); 1671 } 1672 1673 /** 1674 * Returns the number of users belonging to the user group. 1675 * 1676 * @param userGroupId the primary key of the user group 1677 * @return the number of users belonging to the user group 1678 * @throws SystemException if a system exception occurred 1679 */ 1680 public static int getUserGroupUsersCount(long userGroupId) 1681 throws com.liferay.portal.kernel.exception.SystemException { 1682 return getService().getUserGroupUsersCount(userGroupId); 1683 } 1684 1685 /** 1686 * Returns the number of users with the status belonging to the user group. 1687 * 1688 * @param userGroupId the primary key of the user group 1689 * @param status the workflow status 1690 * @return the number of users with the status belonging to the user group 1691 * @throws PortalException if a user group with the primary key could not be 1692 found 1693 * @throws SystemException if a system exception occurred 1694 */ 1695 public static int getUserGroupUsersCount(long userGroupId, int status) 1696 throws com.liferay.portal.kernel.exception.PortalException, 1697 com.liferay.portal.kernel.exception.SystemException { 1698 return getService().getUserGroupUsersCount(userGroupId, status); 1699 } 1700 1701 /** 1702 * Returns the primary key of the user with the email address. 1703 * 1704 * @param companyId the primary key of the user's company 1705 * @param emailAddress the user's email address 1706 * @return the primary key of the user with the email address 1707 * @throws PortalException if a user with the email address could not be 1708 found 1709 * @throws SystemException if a system exception occurred 1710 */ 1711 public static long getUserIdByEmailAddress(long companyId, 1712 java.lang.String emailAddress) 1713 throws com.liferay.portal.kernel.exception.PortalException, 1714 com.liferay.portal.kernel.exception.SystemException { 1715 return getService().getUserIdByEmailAddress(companyId, emailAddress); 1716 } 1717 1718 /** 1719 * Returns the primary key of the user with the screen name. 1720 * 1721 * @param companyId the primary key of the user's company 1722 * @param screenName the user's screen name 1723 * @return the primary key of the user with the screen name 1724 * @throws PortalException if a user with the screen name could not be found 1725 * @throws SystemException if a system exception occurred 1726 */ 1727 public static long getUserIdByScreenName(long companyId, 1728 java.lang.String screenName) 1729 throws com.liferay.portal.kernel.exception.PortalException, 1730 com.liferay.portal.kernel.exception.SystemException { 1731 return getService().getUserIdByScreenName(companyId, screenName); 1732 } 1733 1734 /** 1735 * Returns <code>true</code> if the user is a member of the group. 1736 * 1737 * @param groupId the primary key of the group 1738 * @param userId the primary key of the user 1739 * @return <code>true</code> if the user is a member of the group; 1740 <code>false</code> otherwise 1741 * @throws SystemException if a system exception occurred 1742 */ 1743 public static boolean hasGroupUser(long groupId, long userId) 1744 throws com.liferay.portal.kernel.exception.SystemException { 1745 return getService().hasGroupUser(groupId, userId); 1746 } 1747 1748 /** 1749 * Returns <code>true</code> if the user is a member of the organization. 1750 * 1751 * @param organizationId the primary key of the organization 1752 * @param userId the primary key of the user 1753 * @return <code>true</code> if the user is a member of the organization; 1754 <code>false</code> otherwise 1755 * @throws SystemException if a system exception occurred 1756 */ 1757 public static boolean hasOrganizationUser(long organizationId, long userId) 1758 throws com.liferay.portal.kernel.exception.SystemException { 1759 return getService().hasOrganizationUser(organizationId, userId); 1760 } 1761 1762 /** 1763 * Returns <code>true</code> if the password policy has been assigned to the 1764 * user. 1765 * 1766 * @param passwordPolicyId the primary key of the password policy 1767 * @param userId the primary key of the user 1768 * @return <code>true</code> if the password policy is assigned to the user; 1769 <code>false</code> otherwise 1770 * @throws SystemException if a system exception occurred 1771 */ 1772 public static boolean hasPasswordPolicyUser(long passwordPolicyId, 1773 long userId) throws com.liferay.portal.kernel.exception.SystemException { 1774 return getService().hasPasswordPolicyUser(passwordPolicyId, userId); 1775 } 1776 1777 /** 1778 * Returns <code>true</code> if the user is a member of the role. 1779 * 1780 * @param roleId the primary key of the role 1781 * @param userId the primary key of the user 1782 * @return <code>true</code> if the user is a member of the role; 1783 <code>false</code> otherwise 1784 * @throws SystemException if a system exception occurred 1785 */ 1786 public static boolean hasRoleUser(long roleId, long userId) 1787 throws com.liferay.portal.kernel.exception.SystemException { 1788 return getService().hasRoleUser(roleId, userId); 1789 } 1790 1791 /** 1792 * Returns <code>true</code> if the user has the role with the name, 1793 * optionally through inheritance. 1794 * 1795 * @param companyId the primary key of the role's company 1796 * @param name the name of the role (must be a regular role, not an 1797 organization, site or provider role) 1798 * @param userId the primary key of the user 1799 * @param inherited whether to include roles inherited from organizations, 1800 sites, etc. 1801 * @return <code>true</code> if the user has the role; <code>false</code> 1802 otherwise 1803 * @throws PortalException if a role with the name could not be found 1804 * @throws SystemException if a system exception occurred 1805 */ 1806 public static boolean hasRoleUser(long companyId, java.lang.String name, 1807 long userId, boolean inherited) 1808 throws com.liferay.portal.kernel.exception.PortalException, 1809 com.liferay.portal.kernel.exception.SystemException { 1810 return getService().hasRoleUser(companyId, name, userId, inherited); 1811 } 1812 1813 /** 1814 * Returns <code>true</code> if the user is a member of the team. 1815 * 1816 * @param teamId the primary key of the team 1817 * @param userId the primary key of the user 1818 * @return <code>true</code> if the user is a member of the team; 1819 <code>false</code> otherwise 1820 * @throws SystemException if a system exception occurred 1821 */ 1822 public static boolean hasTeamUser(long teamId, long userId) 1823 throws com.liferay.portal.kernel.exception.SystemException { 1824 return getService().hasTeamUser(teamId, userId); 1825 } 1826 1827 /** 1828 * Returns <code>true</code> if the user is a member of the user group. 1829 * 1830 * @param userGroupId the primary key of the user group 1831 * @param userId the primary key of the user 1832 * @return <code>true</code> if the user is a member of the user group; 1833 <code>false</code> otherwise 1834 * @throws SystemException if a system exception occurred 1835 */ 1836 public static boolean hasUserGroupUser(long userGroupId, long userId) 1837 throws com.liferay.portal.kernel.exception.SystemException { 1838 return getService().hasUserGroupUser(userGroupId, userId); 1839 } 1840 1841 /** 1842 * Returns <code>true</code> if the user's password is expired. 1843 * 1844 * @param user the user 1845 * @return <code>true</code> if the user's password is expired; 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 isPasswordExpired(com.liferay.portal.model.User user) 1852 throws com.liferay.portal.kernel.exception.PortalException, 1853 com.liferay.portal.kernel.exception.SystemException { 1854 return getService().isPasswordExpired(user); 1855 } 1856 1857 /** 1858 * Returns <code>true</code> if the password policy is configured to warn 1859 * the user that his password is expiring and the remaining time until 1860 * expiration is equal or less than the configured warning time. 1861 * 1862 * @param user the user 1863 * @return <code>true</code> if the user's password is expiring soon; 1864 <code>false</code> otherwise 1865 * @throws PortalException if the password policy for the user could not be 1866 found 1867 * @throws SystemException if a system exception occurred 1868 */ 1869 public static boolean isPasswordExpiringSoon( 1870 com.liferay.portal.model.User user) 1871 throws com.liferay.portal.kernel.exception.PortalException, 1872 com.liferay.portal.kernel.exception.SystemException { 1873 return getService().isPasswordExpiringSoon(user); 1874 } 1875 1876 /** 1877 * Returns the default user for the company. 1878 * 1879 * @param companyId the primary key of the company 1880 * @return the default user for the company 1881 * @throws PortalException if the user could not be found 1882 * @throws SystemException if a system exception occurred 1883 */ 1884 public static com.liferay.portal.model.User loadGetDefaultUser( 1885 long companyId) 1886 throws com.liferay.portal.kernel.exception.PortalException, 1887 com.liferay.portal.kernel.exception.SystemException { 1888 return getService().loadGetDefaultUser(companyId); 1889 } 1890 1891 /** 1892 * Returns an ordered range of all the users who match the keywords and 1893 * status, without using the indexer. It is preferable to use the indexed 1894 * version {@link #search(long, String, int, LinkedHashMap, int, int, Sort)} 1895 * instead of this method wherever possible for performance reasons. 1896 * 1897 * <p> 1898 * Useful when paginating results. Returns a maximum of <code>end - 1899 * start</code> instances. <code>start</code> and <code>end</code> are not 1900 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1901 * refers to the first result in the set. Setting both <code>start</code> 1902 * and <code>end</code> to {@link 1903 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1904 * result set. 1905 * </p> 1906 * 1907 * @param companyId the primary key of the user's company 1908 * @param keywords the keywords (space separated), which may occur in the 1909 user's first name, middle name, last name, screen name, or email 1910 address 1911 * @param status the workflow status 1912 * @param params the finder parameters (optionally <code>null</code>). For 1913 more information see {@link 1914 com.liferay.portal.service.persistence.UserFinder}. 1915 * @param start the lower bound of the range of users 1916 * @param end the upper bound of the range of users (not inclusive) 1917 * @param obc the comparator to order the users by (optionally 1918 <code>null</code>) 1919 * @return the matching users 1920 * @throws SystemException if a system exception occurred 1921 * @see com.liferay.portal.service.persistence.UserFinder 1922 */ 1923 public static java.util.List<com.liferay.portal.model.User> search( 1924 long companyId, java.lang.String keywords, int status, 1925 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1926 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 1927 throws com.liferay.portal.kernel.exception.SystemException { 1928 return getService() 1929 .search(companyId, keywords, status, params, start, end, obc); 1930 } 1931 1932 /** 1933 * Returns an ordered range of all the users who match the keywords and 1934 * status, using the indexer. It is preferable to use this method instead of 1935 * the non-indexed version whenever possible for performance reasons. 1936 * 1937 * <p> 1938 * Useful when paginating results. Returns a maximum of <code>end - 1939 * start</code> instances. <code>start</code> and <code>end</code> are not 1940 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1941 * refers to the first result in the set. Setting both <code>start</code> 1942 * and <code>end</code> to {@link 1943 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1944 * result set. 1945 * </p> 1946 * 1947 * @param companyId the primary key of the user's company 1948 * @param keywords the keywords (space separated), which may occur in the 1949 user's first name, middle name, last name, screen name, or email 1950 address 1951 * @param status the workflow status 1952 * @param params the indexer parameters (optionally <code>null</code>). For 1953 more information see {@link 1954 com.liferay.portlet.usersadmin.util.UserIndexer}. 1955 * @param start the lower bound of the range of users 1956 * @param end the upper bound of the range of users (not inclusive) 1957 * @param sort the field and direction to sort by (optionally 1958 <code>null</code>) 1959 * @return the matching users 1960 * @throws SystemException if a system exception occurred 1961 * @see com.liferay.portlet.usersadmin.util.UserIndexer 1962 */ 1963 public static com.liferay.portal.kernel.search.Hits search(long companyId, 1964 java.lang.String keywords, int status, 1965 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1966 int start, int end, com.liferay.portal.kernel.search.Sort sort) 1967 throws com.liferay.portal.kernel.exception.SystemException { 1968 return getService() 1969 .search(companyId, keywords, status, params, start, end, sort); 1970 } 1971 1972 /** 1973 * Returns an ordered range of all the users with the status, and whose 1974 * first name, middle name, last name, screen name, and email address match 1975 * the keywords specified for them, without using the indexer. It is 1976 * preferable to use the indexed version {@link #search(long, String, 1977 * String, String, String, String, int, LinkedHashMap, boolean, int, int, 1978 * Sort)} instead of this method wherever possible for performance reasons. 1979 * 1980 * <p> 1981 * Useful when paginating results. Returns a maximum of <code>end - 1982 * start</code> instances. <code>start</code> and <code>end</code> are not 1983 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1984 * refers to the first result in the set. Setting both <code>start</code> 1985 * and <code>end</code> to {@link 1986 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1987 * result set. 1988 * </p> 1989 * 1990 * @param companyId the primary key of the user's company 1991 * @param firstName the first name keywords (space separated) 1992 * @param middleName the middle name keywords 1993 * @param lastName the last name keywords 1994 * @param screenName the screen name keywords 1995 * @param emailAddress the email address keywords 1996 * @param status the workflow status 1997 * @param params the finder parameters (optionally <code>null</code>). For 1998 more information see {@link 1999 com.liferay.portal.service.persistence.UserFinder}. 2000 * @param andSearch whether every field must match its keywords, or just 2001 one field. For example, "users with the first name 'bob' and 2002 last name 'smith'" vs "users with the first name 'bob' 2003 or the last name 'smith'". 2004 * @param start the lower bound of the range of users 2005 * @param end the upper bound of the range of users (not inclusive) 2006 * @param obc the comparator to order the users by (optionally 2007 <code>null</code>) 2008 * @return the matching users 2009 * @throws SystemException if a system exception occurred 2010 * @see com.liferay.portal.service.persistence.UserFinder 2011 */ 2012 public static java.util.List<com.liferay.portal.model.User> search( 2013 long companyId, java.lang.String firstName, 2014 java.lang.String middleName, java.lang.String lastName, 2015 java.lang.String screenName, java.lang.String emailAddress, int status, 2016 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2017 boolean andSearch, int start, int end, 2018 com.liferay.portal.kernel.util.OrderByComparator obc) 2019 throws com.liferay.portal.kernel.exception.SystemException { 2020 return getService() 2021 .search(companyId, firstName, middleName, lastName, 2022 screenName, emailAddress, status, params, andSearch, start, end, obc); 2023 } 2024 2025 /** 2026 * Returns an ordered range of all the users with the status, and whose 2027 * first name, middle name, last name, screen name, and email address match 2028 * the keywords specified for them, using the indexer. It is preferable to 2029 * use this method instead of the non-indexed version whenever possible for 2030 * performance reasons. 2031 * 2032 * <p> 2033 * Useful when paginating results. Returns a maximum of <code>end - 2034 * start</code> instances. <code>start</code> and <code>end</code> are not 2035 * primary keys, they are indexes in the result set. Thus, <code>0</code> 2036 * refers to the first result in the set. Setting both <code>start</code> 2037 * and <code>end</code> to {@link 2038 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 2039 * result set. 2040 * </p> 2041 * 2042 * @param companyId the primary key of the user's company 2043 * @param firstName the first name keywords (space separated) 2044 * @param middleName the middle name keywords 2045 * @param lastName the last name keywords 2046 * @param screenName the screen name keywords 2047 * @param emailAddress the email address keywords 2048 * @param status the workflow status 2049 * @param params the indexer parameters (optionally <code>null</code>). For 2050 more information see {@link 2051 com.liferay.portlet.usersadmin.util.UserIndexer}. 2052 * @param andSearch whether every field must match its keywords, or just 2053 one field. For example, "users with the first name 'bob' and 2054 last name 'smith'" vs "users with the first name 'bob' 2055 or the last name 'smith'". 2056 * @param start the lower bound of the range of users 2057 * @param end the upper bound of the range of users (not inclusive) 2058 * @param sort the field and direction to sort by (optionally 2059 <code>null</code>) 2060 * @return the matching users 2061 * @throws SystemException if a system exception occurred 2062 * @see com.liferay.portlet.usersadmin.util.UserIndexer 2063 */ 2064 public static com.liferay.portal.kernel.search.Hits search(long companyId, 2065 java.lang.String firstName, java.lang.String middleName, 2066 java.lang.String lastName, java.lang.String screenName, 2067 java.lang.String emailAddress, int status, 2068 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2069 boolean andSearch, int start, int end, 2070 com.liferay.portal.kernel.search.Sort sort) 2071 throws com.liferay.portal.kernel.exception.SystemException { 2072 return getService() 2073 .search(companyId, firstName, middleName, lastName, 2074 screenName, emailAddress, status, params, andSearch, start, end, 2075 sort); 2076 } 2077 2078 /** 2079 * Returns the number of users who match the keywords and status. 2080 * 2081 * @param companyId the primary key of the user's company 2082 * @param keywords the keywords (space separated), which may occur in the 2083 user's first name, middle name, last name, screen name, or email 2084 address 2085 * @param status the workflow status 2086 * @param params the finder parameters (optionally <code>null</code>). For 2087 more information see {@link 2088 com.liferay.portal.service.persistence.UserFinder}. 2089 * @return the number matching users 2090 * @throws SystemException if a system exception occurred 2091 */ 2092 public static int searchCount(long companyId, java.lang.String keywords, 2093 int status, 2094 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 2095 throws com.liferay.portal.kernel.exception.SystemException { 2096 return getService().searchCount(companyId, keywords, status, params); 2097 } 2098 2099 /** 2100 * Returns the number of users with the status, and whose first name, middle 2101 * name, last name, screen name, and email address match the keywords 2102 * specified for them. 2103 * 2104 * @param companyId the primary key of the user's company 2105 * @param firstName the first name keywords (space separated) 2106 * @param middleName the middle name keywords 2107 * @param lastName the last name keywords 2108 * @param screenName the screen name keywords 2109 * @param emailAddress the email address keywords 2110 * @param status the workflow status 2111 * @param params the finder parameters (optionally <code>null</code>). For 2112 more information see {@link 2113 com.liferay.portal.service.persistence.UserFinder}. 2114 * @param andSearch whether every field must match its keywords, or just 2115 one field. For example, "users with the first name 'bob' and 2116 last name 'smith'" vs "users with the first name 'bob' 2117 or the last name 'smith'". 2118 * @return the number of matching users 2119 * @throws SystemException if a system exception occurred 2120 */ 2121 public static int searchCount(long companyId, java.lang.String firstName, 2122 java.lang.String middleName, java.lang.String lastName, 2123 java.lang.String screenName, java.lang.String emailAddress, int status, 2124 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2125 boolean andSearch) 2126 throws com.liferay.portal.kernel.exception.SystemException { 2127 return getService() 2128 .searchCount(companyId, firstName, middleName, lastName, 2129 screenName, emailAddress, status, params, andSearch); 2130 } 2131 2132 /** 2133 * Sends an email address verification to the user. 2134 * 2135 * @param user the verification email recipient 2136 * @param emailAddress the recipient's email address 2137 * @param serviceContext the service context. Must set the portal URL, main 2138 path, primary key of the layout, remote address, remote host, and 2139 agent for the user. 2140 * @throws PortalException if a portal exception occurred 2141 * @throws SystemException if a system exception occurred 2142 */ 2143 public static void sendEmailAddressVerification( 2144 com.liferay.portal.model.User user, java.lang.String emailAddress, 2145 com.liferay.portal.service.ServiceContext serviceContext) 2146 throws com.liferay.portal.kernel.exception.PortalException, 2147 com.liferay.portal.kernel.exception.SystemException { 2148 getService() 2149 .sendEmailAddressVerification(user, emailAddress, serviceContext); 2150 } 2151 2152 /** 2153 * Sends the password email to the user with the email address. The content 2154 * of this email can be specified in <code>portal.properties</code> with the 2155 * <code>admin.email.password</code> keys. 2156 * 2157 * @param companyId the primary key of the user's company 2158 * @param emailAddress the user's email address 2159 * @param fromName the name of the individual that the email should be from 2160 * @param fromAddress the address of the individual that the email should 2161 be from 2162 * @param subject the email subject. If <code>null</code>, the subject 2163 specified in <code>portal.properties</code> will be used. 2164 * @param body the email body. If <code>null</code>, the body specified in 2165 <code>portal.properties</code> will be used. 2166 * @param serviceContext the user's service context 2167 * @throws PortalException if a user with the email address could not be 2168 found 2169 * @throws SystemException if a system exception occurred 2170 */ 2171 public static void sendPassword(long companyId, 2172 java.lang.String emailAddress, java.lang.String fromName, 2173 java.lang.String fromAddress, java.lang.String subject, 2174 java.lang.String body, 2175 com.liferay.portal.service.ServiceContext serviceContext) 2176 throws com.liferay.portal.kernel.exception.PortalException, 2177 com.liferay.portal.kernel.exception.SystemException { 2178 getService() 2179 .sendPassword(companyId, emailAddress, fromName, fromAddress, 2180 subject, body, serviceContext); 2181 } 2182 2183 /** 2184 * Sets the users in the role, removing and adding users to the role as 2185 * necessary. 2186 * 2187 * @param roleId the primary key of the role 2188 * @param userIds the primary keys of the users 2189 * @throws PortalException if a portal exception occurred 2190 * @throws SystemException if a system exception occurred 2191 */ 2192 public static void setRoleUsers(long roleId, long[] userIds) 2193 throws com.liferay.portal.kernel.exception.PortalException, 2194 com.liferay.portal.kernel.exception.SystemException { 2195 getService().setRoleUsers(roleId, userIds); 2196 } 2197 2198 /** 2199 * Sets the users in the user group, removing and adding users to the user 2200 * group as necessary. 2201 * 2202 * @param userGroupId the primary key of the user group 2203 * @param userIds the primary keys of the users 2204 * @throws PortalException if a portal exception occurred 2205 * @throws SystemException if a system exception occurred 2206 */ 2207 public static void setUserGroupUsers(long userGroupId, long[] userIds) 2208 throws com.liferay.portal.kernel.exception.PortalException, 2209 com.liferay.portal.kernel.exception.SystemException { 2210 getService().setUserGroupUsers(userGroupId, userIds); 2211 } 2212 2213 /** 2214 * Removes the users from the teams of a group. 2215 * 2216 * @param groupId the primary key of the group 2217 * @param userIds the primary keys of the users 2218 * @throws PortalException if a portal exception occurred 2219 * @throws SystemException if a system exception occurred 2220 */ 2221 public static void unsetGroupTeamsUsers(long groupId, long[] userIds) 2222 throws com.liferay.portal.kernel.exception.PortalException, 2223 com.liferay.portal.kernel.exception.SystemException { 2224 getService().unsetGroupTeamsUsers(groupId, userIds); 2225 } 2226 2227 /** 2228 * Removes the users from the group. 2229 * 2230 * @param groupId the primary key of the group 2231 * @param userIds the primary keys of the users 2232 * @param serviceContext the service context (optionally <code>null</code>) 2233 * @throws PortalException if a portal exception occurred 2234 * @throws SystemException if a system exception occurred 2235 */ 2236 public static void unsetGroupUsers(long groupId, long[] userIds, 2237 com.liferay.portal.service.ServiceContext serviceContext) 2238 throws com.liferay.portal.kernel.exception.PortalException, 2239 com.liferay.portal.kernel.exception.SystemException { 2240 getService().unsetGroupUsers(groupId, userIds, serviceContext); 2241 } 2242 2243 /** 2244 * Removes the users from the organization. 2245 * 2246 * @param organizationId the primary key of the organization 2247 * @param userIds the primary keys of the users 2248 * @throws PortalException if a portal exception occurred 2249 * @throws SystemException if a system exception occurred 2250 */ 2251 public static void unsetOrganizationUsers(long organizationId, 2252 long[] userIds) 2253 throws com.liferay.portal.kernel.exception.PortalException, 2254 com.liferay.portal.kernel.exception.SystemException { 2255 getService().unsetOrganizationUsers(organizationId, userIds); 2256 } 2257 2258 /** 2259 * Removes the users from the password policy. 2260 * 2261 * @param passwordPolicyId the primary key of the password policy 2262 * @param userIds the primary keys of the users 2263 * @throws SystemException if a system exception occurred 2264 */ 2265 public static void unsetPasswordPolicyUsers(long passwordPolicyId, 2266 long[] userIds) 2267 throws com.liferay.portal.kernel.exception.SystemException { 2268 getService().unsetPasswordPolicyUsers(passwordPolicyId, userIds); 2269 } 2270 2271 /** 2272 * Removes the users from the role. 2273 * 2274 * @param roleId the primary key of the role 2275 * @param users the users 2276 * @throws PortalException if a portal exception occurred 2277 * @throws SystemException if a system exception occurred 2278 */ 2279 public static void unsetRoleUsers(long roleId, 2280 java.util.List<com.liferay.portal.model.User> users) 2281 throws com.liferay.portal.kernel.exception.PortalException, 2282 com.liferay.portal.kernel.exception.SystemException { 2283 getService().unsetRoleUsers(roleId, users); 2284 } 2285 2286 /** 2287 * Removes the users from the role. 2288 * 2289 * @param roleId the primary key of the role 2290 * @param userIds the primary keys of the users 2291 * @throws PortalException if a portal exception occurred 2292 * @throws SystemException if a system exception occurred 2293 */ 2294 public static void unsetRoleUsers(long roleId, long[] userIds) 2295 throws com.liferay.portal.kernel.exception.PortalException, 2296 com.liferay.portal.kernel.exception.SystemException { 2297 getService().unsetRoleUsers(roleId, userIds); 2298 } 2299 2300 /** 2301 * Removes the users from the team. 2302 * 2303 * @param teamId the primary key of the team 2304 * @param userIds the primary keys of the users 2305 * @throws PortalException if a portal exception occurred 2306 * @throws SystemException if a system exception occurred 2307 */ 2308 public static void unsetTeamUsers(long teamId, long[] userIds) 2309 throws com.liferay.portal.kernel.exception.PortalException, 2310 com.liferay.portal.kernel.exception.SystemException { 2311 getService().unsetTeamUsers(teamId, userIds); 2312 } 2313 2314 /** 2315 * Removes the users from the user group. 2316 * 2317 * @param userGroupId the primary key of the user group 2318 * @param userIds the primary keys of the users 2319 * @throws PortalException if a portal exception occurred 2320 * @throws SystemException if a system exception occurred 2321 */ 2322 public static void unsetUserGroupUsers(long userGroupId, long[] userIds) 2323 throws com.liferay.portal.kernel.exception.PortalException, 2324 com.liferay.portal.kernel.exception.SystemException { 2325 getService().unsetUserGroupUsers(userGroupId, userIds); 2326 } 2327 2328 /** 2329 * Updates whether the user has agreed to the terms of use. 2330 * 2331 * @param userId the primary key of the user 2332 * @param agreedToTermsOfUse whether the user has agreet to the terms of 2333 use 2334 * @return the user 2335 * @throws PortalException if a user with the primary key could not be found 2336 * @throws SystemException if a system exception occurred 2337 */ 2338 public static com.liferay.portal.model.User updateAgreedToTermsOfUse( 2339 long userId, boolean agreedToTermsOfUse) 2340 throws com.liferay.portal.kernel.exception.PortalException, 2341 com.liferay.portal.kernel.exception.SystemException { 2342 return getService().updateAgreedToTermsOfUse(userId, agreedToTermsOfUse); 2343 } 2344 2345 /** 2346 * Updates the user's asset with the new asset categories and tag names, 2347 * removing and adding asset categories and tag names as necessary. 2348 * 2349 * @param userId the primary key of the user 2350 * @param user ID the primary key of the user 2351 * @param assetCategoryIds the primary key's of the new asset categories 2352 * @param assetTagNames the new asset tag names 2353 * @throws PortalException if a user with the primary key could not be found 2354 * @throws SystemException if a system exception occurred 2355 */ 2356 public static void updateAsset(long userId, 2357 com.liferay.portal.model.User user, long[] assetCategoryIds, 2358 java.lang.String[] assetTagNames) 2359 throws com.liferay.portal.kernel.exception.PortalException, 2360 com.liferay.portal.kernel.exception.SystemException { 2361 getService().updateAsset(userId, user, assetCategoryIds, assetTagNames); 2362 } 2363 2364 /** 2365 * Updates the user's creation date. 2366 * 2367 * @param userId the primary key of the user 2368 * @param createDate the new creation date 2369 * @return the user 2370 * @throws PortalException if a user with the primary key could not be found 2371 * @throws SystemException if a system exception occurred 2372 */ 2373 public static com.liferay.portal.model.User updateCreateDate(long userId, 2374 java.util.Date createDate) 2375 throws com.liferay.portal.kernel.exception.PortalException, 2376 com.liferay.portal.kernel.exception.SystemException { 2377 return getService().updateCreateDate(userId, createDate); 2378 } 2379 2380 /** 2381 * Updates the user's email address. 2382 * 2383 * @param userId the primary key of the user 2384 * @param password the user's password 2385 * @param emailAddress1 the user's new email address 2386 * @param emailAddress2 the user's new email address confirmation 2387 * @return the user 2388 * @throws PortalException if a user with the primary key could not be found 2389 * @throws SystemException if a system exception occurred 2390 */ 2391 public static com.liferay.portal.model.User updateEmailAddress( 2392 long userId, java.lang.String password, java.lang.String emailAddress1, 2393 java.lang.String emailAddress2) 2394 throws com.liferay.portal.kernel.exception.PortalException, 2395 com.liferay.portal.kernel.exception.SystemException { 2396 return getService() 2397 .updateEmailAddress(userId, password, emailAddress1, 2398 emailAddress2); 2399 } 2400 2401 /** 2402 * Updates the user's email address or sends verification email. 2403 * 2404 * @param userId the primary key of the user 2405 * @param password the user's password 2406 * @param emailAddress1 the user's new email address 2407 * @param emailAddress2 the user's new email address confirmation 2408 * @param serviceContext the service context. Must set the portal URL, main 2409 path, primary key of the layout, remote address, remote host, and 2410 agent for the user. 2411 * @return the user 2412 * @throws PortalException if a user with the primary key could not be found 2413 * @throws SystemException if a system exception occurred 2414 */ 2415 public static com.liferay.portal.model.User updateEmailAddress( 2416 long userId, java.lang.String password, java.lang.String emailAddress1, 2417 java.lang.String emailAddress2, 2418 com.liferay.portal.service.ServiceContext serviceContext) 2419 throws com.liferay.portal.kernel.exception.PortalException, 2420 com.liferay.portal.kernel.exception.SystemException { 2421 return getService() 2422 .updateEmailAddress(userId, password, emailAddress1, 2423 emailAddress2, serviceContext); 2424 } 2425 2426 /** 2427 * Updates whether the user has verified email address. 2428 * 2429 * @param userId the primary key of the user 2430 * @param emailAddressVerified whether the user has verified email address 2431 * @return the user 2432 * @throws PortalException if a user with the primary key could not be found 2433 * @throws SystemException if a system exception occurred 2434 */ 2435 public static com.liferay.portal.model.User updateEmailAddressVerified( 2436 long userId, boolean emailAddressVerified) 2437 throws com.liferay.portal.kernel.exception.PortalException, 2438 com.liferay.portal.kernel.exception.SystemException { 2439 return getService() 2440 .updateEmailAddressVerified(userId, emailAddressVerified); 2441 } 2442 2443 /** 2444 * Updates the user's Facebook ID. 2445 * 2446 * @param userId the primary key of the user 2447 * @param facebookId the user's new Facebook ID 2448 * @return the user 2449 * @throws PortalException if a user with the primary key could not be found 2450 * @throws SystemException if a system exception occurred 2451 */ 2452 public static com.liferay.portal.model.User updateFacebookId(long userId, 2453 long facebookId) 2454 throws com.liferay.portal.kernel.exception.PortalException, 2455 com.liferay.portal.kernel.exception.SystemException { 2456 return getService().updateFacebookId(userId, facebookId); 2457 } 2458 2459 /** 2460 * Sets the groups the user is in, removing and adding groups as necessary. 2461 * 2462 * @param userId the primary key of the user 2463 * @param newGroupIds the primary keys of the groups 2464 * @param serviceContext the service context (optionally <code>null</code>) 2465 * @throws PortalException if a portal exception occurred 2466 * @throws SystemException if a system exception occurred 2467 */ 2468 public static void updateGroups(long userId, long[] newGroupIds, 2469 com.liferay.portal.service.ServiceContext serviceContext) 2470 throws com.liferay.portal.kernel.exception.PortalException, 2471 com.liferay.portal.kernel.exception.SystemException { 2472 getService().updateGroups(userId, newGroupIds, serviceContext); 2473 } 2474 2475 /** 2476 * Updates a user account that was automatically created when a guest user 2477 * participated in an action (e.g. posting a comment) and only provided his 2478 * name and email address. 2479 * 2480 * @param creatorUserId the primary key of the creator 2481 * @param companyId the primary key of the user's company 2482 * @param autoPassword whether a password should be automatically generated 2483 for the user 2484 * @param password1 the user's password 2485 * @param password2 the user's password confirmation 2486 * @param autoScreenName whether a screen name should be automatically 2487 generated for the user 2488 * @param screenName the user's screen name 2489 * @param emailAddress the user's email address 2490 * @param facebookId the user's facebook ID 2491 * @param openId the user's OpenID 2492 * @param locale the user's locale 2493 * @param firstName the user's first name 2494 * @param middleName the user's middle name 2495 * @param lastName the user's last name 2496 * @param prefixId the user's name prefix ID 2497 * @param suffixId the user's name suffix ID 2498 * @param male whether the user is male 2499 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 2500 January) 2501 * @param birthdayDay the user's birthday day 2502 * @param birthdayYear the user's birthday year 2503 * @param jobTitle the user's job title 2504 * @param updateUserInformation whether to update the user's information 2505 * @param sendEmail whether to send the user an email notification about 2506 their new account 2507 * @param serviceContext the user's service context (optionally 2508 <code>null</code>). Can set expando bridge attributes for the 2509 user. 2510 * @return the user 2511 * @throws PortalException if the user's information was invalid 2512 * @throws SystemException if a system exception occurred 2513 */ 2514 public static com.liferay.portal.model.User updateIncompleteUser( 2515 long creatorUserId, long companyId, boolean autoPassword, 2516 java.lang.String password1, java.lang.String password2, 2517 boolean autoScreenName, java.lang.String screenName, 2518 java.lang.String emailAddress, long facebookId, 2519 java.lang.String openId, java.util.Locale locale, 2520 java.lang.String firstName, java.lang.String middleName, 2521 java.lang.String lastName, int prefixId, int suffixId, boolean male, 2522 int birthdayMonth, int birthdayDay, int birthdayYear, 2523 java.lang.String jobTitle, boolean updateUserInformation, 2524 boolean sendEmail, 2525 com.liferay.portal.service.ServiceContext serviceContext) 2526 throws com.liferay.portal.kernel.exception.PortalException, 2527 com.liferay.portal.kernel.exception.SystemException { 2528 return getService() 2529 .updateIncompleteUser(creatorUserId, companyId, 2530 autoPassword, password1, password2, autoScreenName, screenName, 2531 emailAddress, facebookId, openId, locale, firstName, middleName, 2532 lastName, prefixId, suffixId, male, birthdayMonth, birthdayDay, 2533 birthdayYear, jobTitle, updateUserInformation, sendEmail, 2534 serviceContext); 2535 } 2536 2537 /** 2538 * Updates the user's job title. 2539 * 2540 * @param userId the primary key of the user 2541 * @param jobTitle the user's job title 2542 * @return the user 2543 * @throws PortalException if a user with the primary key could not be found 2544 or if a contact could not be found matching the user's contact ID 2545 * @throws SystemException if a system exception occurred 2546 */ 2547 public static com.liferay.portal.model.User updateJobTitle(long userId, 2548 java.lang.String jobTitle) 2549 throws com.liferay.portal.kernel.exception.PortalException, 2550 com.liferay.portal.kernel.exception.SystemException { 2551 return getService().updateJobTitle(userId, jobTitle); 2552 } 2553 2554 /** 2555 * Updates the user's last login with the current time and the IP address. 2556 * 2557 * @param userId the primary key of the user 2558 * @param loginIP the IP address the user logged in from 2559 * @return the user 2560 * @throws PortalException if a user with the primary key could not be found 2561 * @throws SystemException if a system exception occurred 2562 */ 2563 public static com.liferay.portal.model.User updateLastLogin(long userId, 2564 java.lang.String loginIP) 2565 throws com.liferay.portal.kernel.exception.PortalException, 2566 com.liferay.portal.kernel.exception.SystemException { 2567 return getService().updateLastLogin(userId, loginIP); 2568 } 2569 2570 /** 2571 * Updates whether the user is locked out from logging in. 2572 * 2573 * @param user the user 2574 * @param lockout whether the user is locked out 2575 * @return the user 2576 * @throws PortalException if a portal exception occurred 2577 * @throws SystemException if a system exception occurred 2578 */ 2579 public static com.liferay.portal.model.User updateLockout( 2580 com.liferay.portal.model.User user, boolean lockout) 2581 throws com.liferay.portal.kernel.exception.PortalException, 2582 com.liferay.portal.kernel.exception.SystemException { 2583 return getService().updateLockout(user, lockout); 2584 } 2585 2586 /** 2587 * Updates whether the user is locked out from logging in. 2588 * 2589 * @param companyId the primary key of the user's company 2590 * @param emailAddress the user's email address 2591 * @param lockout whether the user is locked out 2592 * @return the user 2593 * @throws PortalException if a user with the email address could not be 2594 found 2595 * @throws SystemException if a system exception occurred 2596 */ 2597 public static com.liferay.portal.model.User updateLockoutByEmailAddress( 2598 long companyId, java.lang.String emailAddress, boolean lockout) 2599 throws com.liferay.portal.kernel.exception.PortalException, 2600 com.liferay.portal.kernel.exception.SystemException { 2601 return getService() 2602 .updateLockoutByEmailAddress(companyId, emailAddress, lockout); 2603 } 2604 2605 /** 2606 * Updates whether the user is locked out from logging in. 2607 * 2608 * @param userId the primary key of the user 2609 * @param lockout whether the user is locked out 2610 * @return the user 2611 * @throws PortalException if a user with the primary key could not be found 2612 * @throws SystemException if a system exception occurred 2613 */ 2614 public static com.liferay.portal.model.User updateLockoutById(long userId, 2615 boolean lockout) 2616 throws com.liferay.portal.kernel.exception.PortalException, 2617 com.liferay.portal.kernel.exception.SystemException { 2618 return getService().updateLockoutById(userId, lockout); 2619 } 2620 2621 /** 2622 * Updates whether the user is locked out from logging in. 2623 * 2624 * @param companyId the primary key of the user's company 2625 * @param screenName the user's screen name 2626 * @param lockout whether the user is locked out 2627 * @return the user 2628 * @throws PortalException if a user with the screen name could not be found 2629 * @throws SystemException if a system exception occurred 2630 */ 2631 public static com.liferay.portal.model.User updateLockoutByScreenName( 2632 long companyId, java.lang.String screenName, boolean lockout) 2633 throws com.liferay.portal.kernel.exception.PortalException, 2634 com.liferay.portal.kernel.exception.SystemException { 2635 return getService() 2636 .updateLockoutByScreenName(companyId, screenName, lockout); 2637 } 2638 2639 /** 2640 * Updates the user's modified date. 2641 * 2642 * @param userId the primary key of the user 2643 * @param modifiedDate the new modified date 2644 * @return the user 2645 * @throws PortalException if a user with the primary key could not be found 2646 * @throws SystemException if a system exception occurred 2647 */ 2648 public static com.liferay.portal.model.User updateModifiedDate( 2649 long userId, java.util.Date modifiedDate) 2650 throws com.liferay.portal.kernel.exception.PortalException, 2651 com.liferay.portal.kernel.exception.SystemException { 2652 return getService().updateModifiedDate(userId, modifiedDate); 2653 } 2654 2655 /** 2656 * Updates the user's OpenID. 2657 * 2658 * @param userId the primary key of the user 2659 * @param openId the new OpenID 2660 * @return the user 2661 * @throws PortalException if a user with the primary key could not be found 2662 * @throws SystemException if a system exception occurred 2663 */ 2664 public static com.liferay.portal.model.User updateOpenId(long userId, 2665 java.lang.String openId) 2666 throws com.liferay.portal.kernel.exception.PortalException, 2667 com.liferay.portal.kernel.exception.SystemException { 2668 return getService().updateOpenId(userId, openId); 2669 } 2670 2671 /** 2672 * Sets the organizations that the user is in, removing and adding 2673 * organizations as necessary. 2674 * 2675 * @param userId the primary key of the user 2676 * @param newOrganizationIds the primary keys of the organizations 2677 * @param serviceContext the service context. Must set whether user 2678 indexing is enabled. 2679 * @throws PortalException if a user with the primary key could not be found 2680 * @throws SystemException if a system exception occurred 2681 */ 2682 public static void updateOrganizations(long userId, 2683 long[] newOrganizationIds, 2684 com.liferay.portal.service.ServiceContext serviceContext) 2685 throws com.liferay.portal.kernel.exception.PortalException, 2686 com.liferay.portal.kernel.exception.SystemException { 2687 getService() 2688 .updateOrganizations(userId, newOrganizationIds, serviceContext); 2689 } 2690 2691 /** 2692 * Updates the user's password without tracking or validation of the change. 2693 * 2694 * @param userId the primary key of the user 2695 * @param password1 the user's new password 2696 * @param password2 the user's new password confirmation 2697 * @param passwordReset whether the user should be asked to reset their 2698 password the next time they log in 2699 * @return the user 2700 * @throws PortalException if a user with the primary key could not be found 2701 * @throws SystemException if a system exception occurred 2702 */ 2703 public static com.liferay.portal.model.User updatePassword(long userId, 2704 java.lang.String password1, java.lang.String password2, 2705 boolean passwordReset) 2706 throws com.liferay.portal.kernel.exception.PortalException, 2707 com.liferay.portal.kernel.exception.SystemException { 2708 return getService() 2709 .updatePassword(userId, password1, password2, passwordReset); 2710 } 2711 2712 /** 2713 * Updates the user's password, optionally with tracking and validation of 2714 * the change. 2715 * 2716 * @param userId the primary key of the user 2717 * @param password1 the user's new password 2718 * @param password2 the user's new password confirmation 2719 * @param passwordReset whether the user should be asked to reset their 2720 password the next time they login 2721 * @param silentUpdate whether the password should be updated without being 2722 tracked, or validated. Primarily used for password imports. 2723 * @return the user 2724 * @throws PortalException if a user with the primary key could not be found 2725 * @throws SystemException if a system exception occurred 2726 */ 2727 public static com.liferay.portal.model.User updatePassword(long userId, 2728 java.lang.String password1, java.lang.String password2, 2729 boolean passwordReset, boolean silentUpdate) 2730 throws com.liferay.portal.kernel.exception.PortalException, 2731 com.liferay.portal.kernel.exception.SystemException { 2732 return getService() 2733 .updatePassword(userId, password1, password2, passwordReset, 2734 silentUpdate); 2735 } 2736 2737 /** 2738 * Updates the user's password with manually input information. This method 2739 * should only be used when performing maintenance. 2740 * 2741 * @param userId the primary key of the user 2742 * @param password the user's new password 2743 * @param passwordEncrypted the user's new encrypted password 2744 * @param passwordReset whether the user should be asked to reset their 2745 password the next time they login 2746 * @param passwordModifiedDate the new password modified date 2747 * @return the user 2748 * @throws PortalException if a user with the primary key could not be found 2749 * @throws SystemException if a system exception occurred 2750 */ 2751 public static com.liferay.portal.model.User updatePasswordManually( 2752 long userId, java.lang.String password, boolean passwordEncrypted, 2753 boolean passwordReset, java.util.Date passwordModifiedDate) 2754 throws com.liferay.portal.kernel.exception.PortalException, 2755 com.liferay.portal.kernel.exception.SystemException { 2756 return getService() 2757 .updatePasswordManually(userId, password, passwordEncrypted, 2758 passwordReset, passwordModifiedDate); 2759 } 2760 2761 /** 2762 * Updates whether the user should be asked to reset their password the next 2763 * time they login. 2764 * 2765 * @param userId the primary key of the user 2766 * @param passwordReset whether the user should be asked to reset their 2767 password the next time they login 2768 * @return the user 2769 * @throws PortalException if a user with the primary key could not be found 2770 * @throws SystemException if a system exception occurred 2771 */ 2772 public static com.liferay.portal.model.User updatePasswordReset( 2773 long userId, boolean passwordReset) 2774 throws com.liferay.portal.kernel.exception.PortalException, 2775 com.liferay.portal.kernel.exception.SystemException { 2776 return getService().updatePasswordReset(userId, passwordReset); 2777 } 2778 2779 /** 2780 * Updates the user's portrait image. 2781 * 2782 * @param userId the primary key of the user 2783 * @param bytes the new portrait image data 2784 * @return the user 2785 * @throws PortalException if a user with the primary key could not be found 2786 or if the new portrait was invalid 2787 * @throws SystemException if a system exception occurred 2788 */ 2789 public static com.liferay.portal.model.User updatePortrait(long userId, 2790 byte[] bytes) 2791 throws com.liferay.portal.kernel.exception.PortalException, 2792 com.liferay.portal.kernel.exception.SystemException { 2793 return getService().updatePortrait(userId, bytes); 2794 } 2795 2796 /** 2797 * Updates the user's password reset question and answer. 2798 * 2799 * @param userId the primary key of the user 2800 * @param question the user's new password reset question 2801 * @param answer the user's new password reset answer 2802 * @return the user 2803 * @throws PortalException if a user with the primary key could not be found 2804 or if the new question or answer were invalid 2805 * @throws SystemException if a system exception occurred 2806 */ 2807 public static com.liferay.portal.model.User updateReminderQuery( 2808 long userId, java.lang.String question, java.lang.String answer) 2809 throws com.liferay.portal.kernel.exception.PortalException, 2810 com.liferay.portal.kernel.exception.SystemException { 2811 return getService().updateReminderQuery(userId, question, answer); 2812 } 2813 2814 /** 2815 * Updates the user's screen name. 2816 * 2817 * @param userId the primary key of the user 2818 * @param screenName the user's new screen name 2819 * @return the user 2820 * @throws PortalException if a user with the primary key could not be found 2821 or if the new screen name was invalid 2822 * @throws SystemException if a system exception occurred 2823 */ 2824 public static com.liferay.portal.model.User updateScreenName(long userId, 2825 java.lang.String screenName) 2826 throws com.liferay.portal.kernel.exception.PortalException, 2827 com.liferay.portal.kernel.exception.SystemException { 2828 return getService().updateScreenName(userId, screenName); 2829 } 2830 2831 /** 2832 * Updates the user's workflow status. 2833 * 2834 * @param userId the primary key of the user 2835 * @param status the user's new workflow status 2836 * @return the user 2837 * @throws PortalException if a user with the primary key could not be found 2838 * @throws SystemException if a system exception occurred 2839 */ 2840 public static com.liferay.portal.model.User updateStatus(long userId, 2841 int status) 2842 throws com.liferay.portal.kernel.exception.PortalException, 2843 com.liferay.portal.kernel.exception.SystemException { 2844 return getService().updateStatus(userId, status); 2845 } 2846 2847 /** 2848 * Updates the user. 2849 * 2850 * @param userId the primary key of the user 2851 * @param oldPassword the user's old password 2852 * @param newPassword1 the user's new password (optionally 2853 <code>null</code>) 2854 * @param newPassword2 the user's new password confirmation (optionally 2855 <code>null</code>) 2856 * @param passwordReset whether the user should be asked to reset their 2857 password the next time they login 2858 * @param reminderQueryQuestion the user's new password reset question 2859 * @param reminderQueryAnswer the user's new password reset answer 2860 * @param screenName the user's new screen name 2861 * @param emailAddress the user's new email address 2862 * @param facebookId the user's new Facebook ID 2863 * @param openId the user's new OpenID 2864 * @param languageId the user's new language ID 2865 * @param timeZoneId the user's new time zone ID 2866 * @param greeting the user's new greeting 2867 * @param comments the user's new comments 2868 * @param firstName the user's new first name 2869 * @param middleName the user's new middle name 2870 * @param lastName the user's new last name 2871 * @param prefixId the user's new name prefix ID 2872 * @param suffixId the user's new name suffix ID 2873 * @param male whether user is male 2874 * @param birthdayMonth the user's new birthday month (0-based, meaning 0 2875 for January) 2876 * @param birthdayDay the user's new birthday day 2877 * @param birthdayYear the user's birthday year 2878 * @param smsSn the user's new SMS screen name 2879 * @param aimSn the user's new AIM screen name 2880 * @param facebookSn the user's new Facebook screen name 2881 * @param icqSn the user's new ICQ screen name 2882 * @param jabberSn the user's new Jabber screen name 2883 * @param msnSn the user's new MSN screen name 2884 * @param mySpaceSn the user's new MySpace screen name 2885 * @param skypeSn the user's new Skype screen name 2886 * @param twitterSn the user's new Twitter screen name 2887 * @param ymSn the user's new Yahoo! Messenger screen name 2888 * @param jobTitle the user's new job title 2889 * @param groupIds the primary keys of the user's groups 2890 * @param organizationIds the primary keys of the user's organizations 2891 * @param roleIds the primary keys of the user's roles 2892 * @param userGroupRoles the user user's group roles 2893 * @param userGroupIds the primary keys of the user's user groups 2894 * @param serviceContext the user's service context (optionally 2895 <code>null</code>). Can set the UUID (with the <code>uuid</code> 2896 attribute), asset category IDs, asset tag names, and expando 2897 bridge attributes for the user. 2898 * @return the user 2899 * @throws PortalException if a user with the primary key could not be found 2900 or if the new information was invalid 2901 * @throws SystemException if a system exception occurred 2902 */ 2903 public static com.liferay.portal.model.User updateUser(long userId, 2904 java.lang.String oldPassword, java.lang.String newPassword1, 2905 java.lang.String newPassword2, boolean passwordReset, 2906 java.lang.String reminderQueryQuestion, 2907 java.lang.String reminderQueryAnswer, java.lang.String screenName, 2908 java.lang.String emailAddress, long facebookId, 2909 java.lang.String openId, java.lang.String languageId, 2910 java.lang.String timeZoneId, java.lang.String greeting, 2911 java.lang.String comments, java.lang.String firstName, 2912 java.lang.String middleName, java.lang.String lastName, int prefixId, 2913 int suffixId, boolean male, int birthdayMonth, int birthdayDay, 2914 int birthdayYear, java.lang.String smsSn, java.lang.String aimSn, 2915 java.lang.String facebookSn, java.lang.String icqSn, 2916 java.lang.String jabberSn, java.lang.String msnSn, 2917 java.lang.String mySpaceSn, java.lang.String skypeSn, 2918 java.lang.String twitterSn, java.lang.String ymSn, 2919 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 2920 long[] roleIds, 2921 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles, 2922 long[] userGroupIds, 2923 com.liferay.portal.service.ServiceContext serviceContext) 2924 throws com.liferay.portal.kernel.exception.PortalException, 2925 com.liferay.portal.kernel.exception.SystemException { 2926 return getService() 2927 .updateUser(userId, oldPassword, newPassword1, newPassword2, 2928 passwordReset, reminderQueryQuestion, reminderQueryAnswer, 2929 screenName, emailAddress, facebookId, openId, languageId, 2930 timeZoneId, greeting, comments, firstName, middleName, lastName, 2931 prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, 2932 smsSn, aimSn, facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, 2933 skypeSn, twitterSn, ymSn, jobTitle, groupIds, organizationIds, 2934 roleIds, userGroupRoles, userGroupIds, serviceContext); 2935 } 2936 2937 /** 2938 * Verifies the email address of the ticket. 2939 * 2940 * @param ticketKey the ticket key 2941 * @throws PortalException if a ticket matching the ticket key could not be 2942 found, if the ticket has expired, if the ticket is an email 2943 address ticket, or if the email address is invalid 2944 * @throws SystemException if a system exception occurred 2945 */ 2946 public static void verifyEmailAddress(java.lang.String ticketKey) 2947 throws com.liferay.portal.kernel.exception.PortalException, 2948 com.liferay.portal.kernel.exception.SystemException { 2949 getService().verifyEmailAddress(ticketKey); 2950 } 2951 2952 public static UserLocalService getService() { 2953 if (_service == null) { 2954 _service = (UserLocalService)PortalBeanLocatorUtil.locate(UserLocalService.class.getName()); 2955 2956 ReferenceRegistry.registerReference(UserLocalServiceUtil.class, 2957 "_service"); 2958 } 2959 2960 return _service; 2961 } 2962 2963 /** 2964 * @deprecated 2965 */ 2966 public void setService(UserLocalService service) { 2967 } 2968 2969 private static UserLocalService _service; 2970 }