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