Liferay 7.0-ce-b4

com.liferay.portal.service
Interface UserLocalService

All Superinterfaces:
BaseLocalService, PersistedModelLocalService
All Known Implementing Classes:
UserLocalServiceWrapper

@ProviderType
@Transactional(isolation=PORTAL,
               rollbackFor={PortalException.class,SystemException.class})
public interface UserLocalService
extends BaseLocalService, PersistedModelLocalService

Provides the local service interface for User. 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.

See Also:
UserLocalServiceUtil, UserLocalServiceBaseImpl, com.liferay.portal.service.impl.UserLocalServiceImpl

Method Summary
 User addDefaultAdminUser(long companyId, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName)
          Adds a default admin user for the company.
 void addDefaultGroups(long userId)
          Adds the user to the default groups, unless the user is already in these groups.
 void addDefaultRoles(long userId)
          Adds the user to the default roles, unless the user already has these roles.
 void addDefaultUserGroups(long userId)
          Adds the user to the default user groups, unless the user is already in these user groups.
 void addGroupUser(long groupId, long userId)
           
 void addGroupUser(long groupId, User user)
           
 void addGroupUsers(long groupId, List<User> Users)
           
 void addGroupUsers(long groupId, long[] userIds)
           
 void addOrganizationUser(long organizationId, long userId)
           
 void addOrganizationUser(long organizationId, User user)
           
 void addOrganizationUsers(long organizationId, List<User> Users)
           
 void addOrganizationUsers(long organizationId, long[] userIds)
           
 void addPasswordPolicyUsers(long passwordPolicyId, long[] userIds)
          Assigns the password policy to the users, removing any other currently assigned password policies.
 void addRoleUser(long roleId, long userId)
           
 void addRoleUser(long roleId, User user)
           
 void addRoleUsers(long roleId, List<User> Users)
           
 void addRoleUsers(long roleId, long[] userIds)
           
 void addTeamUser(long teamId, long userId)
           
 void addTeamUser(long teamId, User user)
           
 void addTeamUsers(long teamId, List<User> Users)
           
 void addTeamUsers(long teamId, long[] userIds)
           
 User addUser(long creatorUserId, long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, long facebookId, String openId, Locale locale, String firstName, String middleName, String lastName, long prefixId, long suffixId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, boolean sendEmail, ServiceContext serviceContext)
          Adds a user.
 User addUser(User user)
          Adds the user to the database.
 void addUserGroupUser(long userGroupId, long userId)
           
 void addUserGroupUser(long userGroupId, User user)
           
 void addUserGroupUsers(long userGroupId, List<User> Users)
           
 void addUserGroupUsers(long userGroupId, long[] userIds)
           
 User addUserWithWorkflow(long creatorUserId, long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, long facebookId, String openId, Locale locale, String firstName, String middleName, String lastName, long prefixId, long suffixId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, boolean sendEmail, ServiceContext serviceContext)
          Adds a user with workflow.
 int authenticateByEmailAddress(long companyId, String emailAddress, String password, Map<String,String[]> headerMap, Map<String,String[]> parameterMap, Map<String,Object> resultsMap)
          Attempts to authenticate the user by their email address and password, while using the AuthPipeline.
 int authenticateByScreenName(long companyId, String screenName, String password, Map<String,String[]> headerMap, Map<String,String[]> parameterMap, Map<String,Object> resultsMap)
          Attempts to authenticate the user by their screen name and password, while using the AuthPipeline.
 int authenticateByUserId(long companyId, long userId, String password, Map<String,String[]> headerMap, Map<String,String[]> parameterMap, Map<String,Object> resultsMap)
          Attempts to authenticate the user by their primary key and password, while using the AuthPipeline.
 long authenticateForBasic(long companyId, String authType, String login, String password)
          Attempts to authenticate the user using HTTP basic access authentication, without using the AuthPipeline.
 long authenticateForDigest(long companyId, String username, String realm, String nonce, String method, String uri, String response)
          Attempts to authenticate the user using HTTP digest access authentication, without using the AuthPipeline.
 boolean authenticateForJAAS(long userId, String encPassword)
          Attempts to authenticate the user using JAAS credentials, without using the AuthPipeline.
 void checkLockout(User user)
          Checks if the user is currently locked out based on the password policy, and performs maintenance on the user's lockout and failed login data.
 void checkLoginFailure(User user)
          Adds a failed login attempt to the user and updates the user's last failed login date.
 void checkLoginFailureByEmailAddress(long companyId, String emailAddress)
          Adds a failed login attempt to the user with the email address and updates the user's last failed login date.
 void checkLoginFailureById(long userId)
          Adds a failed login attempt to the user and updates the user's last failed login date.
 void checkLoginFailureByScreenName(long companyId, String screenName)
          Adds a failed login attempt to the user with the screen name and updates the user's last failed login date.
 void checkPasswordExpired(User user)
          Checks if the user's password is expired based on the password policy, and performs maintenance on the user's grace login and password reset data.
 void clearGroupUsers(long groupId)
           
 void clearOrganizationUsers(long organizationId)
           
 void clearRoleUsers(long roleId)
           
 void clearTeamUsers(long teamId)
           
 void clearUserGroupUsers(long userGroupId)
           
 void completeUserRegistration(User user, ServiceContext serviceContext)
          Completes the user's registration by generating a password and sending the confirmation email.
 User createUser(long userId)
          Creates a new user with the primary key.
 KeyValuePair decryptUserId(long companyId, String name, String password)
          Decrypts the user's primary key and password from their encrypted forms.
 void deleteGroupUser(long groupId, long userId)
           
 void deleteGroupUser(long groupId, User user)
           
 void deleteGroupUsers(long groupId, List<User> Users)
           
 void deleteGroupUsers(long groupId, long[] userIds)
           
 void deleteOrganizationUser(long organizationId, long userId)
           
 void deleteOrganizationUser(long organizationId, User user)
           
 void deleteOrganizationUsers(long organizationId, List<User> Users)
           
 void deleteOrganizationUsers(long organizationId, long[] userIds)
           
 PersistedModel deletePersistedModel(PersistedModel persistedModel)
           
 void deletePortrait(long userId)
          Deletes the user's portrait image.
 void deleteRoleUser(long roleId, long userId)
           
 void deleteRoleUser(long roleId, User user)
           
 void deleteRoleUsers(long roleId, List<User> Users)
           
 void deleteRoleUsers(long roleId, long[] userIds)
           
 void deleteTeamUser(long teamId, long userId)
           
 void deleteTeamUser(long teamId, User user)
           
 void deleteTeamUsers(long teamId, List<User> Users)
           
 void deleteTeamUsers(long teamId, long[] userIds)
           
 User deleteUser(long userId)
          Deletes the user with the primary key from the database.
 User deleteUser(User user)
          Deletes the user from the database.
 void deleteUserGroupUser(long userGroupId, long userId)
           
 void deleteUserGroupUser(long userGroupId, User user)
           
 void deleteUserGroupUsers(long userGroupId, List<User> Users)
           
 void deleteUserGroupUsers(long userGroupId, long[] userIds)
           
 DynamicQuery dynamicQuery()
           
<T> List<T>
dynamicQuery(DynamicQuery dynamicQuery)
          Performs a dynamic query on the database and returns the matching rows.
<T> List<T>
dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
          Performs a dynamic query on the database and returns a range of the matching rows.
<T> List<T>
dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator)
          Performs a dynamic query on the database and returns an ordered range of the matching rows.
 long dynamicQueryCount(DynamicQuery dynamicQuery)
          Returns the number of rows matching the dynamic query.
 long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection)
          Returns the number of rows matching the dynamic query.
 String encryptUserId(String name)
          Encrypts the primary key of the user.
 User fetchUser(long userId)
           
 User fetchUserByContactId(long contactId)
          Returns the user with the contact ID.
 User fetchUserByEmailAddress(long companyId, String emailAddress)
          Returns the user with the email address.
 User fetchUserByFacebookId(long companyId, long facebookId)
          Returns the user with the Facebook ID.
 User fetchUserById(long userId)
          Returns the user with the primary key.
 User fetchUserByOpenId(long companyId, String openId)
          Returns the user with the OpenID.
 User fetchUserByPortraitId(long portraitId)
          Returns the user with the portrait ID.
 User fetchUserByScreenName(long companyId, String screenName)
          Returns the user with the screen name.
 User fetchUserByUuidAndCompanyId(String uuid, long companyId)
          Returns the user with the matching UUID and company.
 ActionableDynamicQuery getActionableDynamicQuery()
           
 List<User> getCompanyUsers(long companyId, int start, int end)
          Returns a range of all the users belonging to the company.
 int getCompanyUsersCount(long companyId)
          Returns the number of users belonging to the company.
 User getDefaultUser(long companyId)
          Returns the default user for the company.
 long getDefaultUserId(long companyId)
          Returns the primary key of the default user for the company.
 ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext)
           
 long[] getGroupPrimaryKeys(long userId)
          Returns the groupIds of the groups associated with the user.
 long[] getGroupUserIds(long groupId)
          Returns the primary keys of all the users belonging to the group.
 List<User> getGroupUsers(long groupId)
           
 List<User> getGroupUsers(long groupId, int start, int end)
           
 List<User> getGroupUsers(long groupId, int start, int end, OrderByComparator<User> orderByComparator)
           
 int getGroupUsersCount(long groupId)
           
 int getGroupUsersCount(long groupId, int status)
          Returns the number of users with the status belonging to the group.
 IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
           
 List<User> getInheritedRoleUsers(long roleId, int start, int end, OrderByComparator<User> obc)
           
 List<User> getNoAnnouncementsDeliveries(String type)
          Returns all the users who have not had any announcements of the type delivered, excluding the default user.
 List<User> getNoContacts()
          Returns all the users who do not have any contacts.
 List<User> getNoGroups()
          Returns all the users who do not belong to any groups, excluding the default user.
 long[] getOrganizationPrimaryKeys(long userId)
          Returns the organizationIds of the organizations associated with the user.
 long[] getOrganizationUserIds(long organizationId)
          Returns the primary keys of all the users belonging to the organization.
 List<User> getOrganizationUsers(long organizationId)
           
 List<User> getOrganizationUsers(long organizationId, int start, int end)
           
 List<User> getOrganizationUsers(long organizationId, int start, int end, OrderByComparator<User> orderByComparator)
           
 int getOrganizationUsersCount(long organizationId)
           
 int getOrganizationUsersCount(long organizationId, int status)
          Returns the number of users with the status belonging to the organization.
 String getOSGiServiceIdentifier()
          Returns the OSGi service identifier.
 PersistedModel getPersistedModel(Serializable primaryKeyObj)
           
 long[] getRolePrimaryKeys(long userId)
          Returns the roleIds of the roles associated with the user.
 long[] getRoleUserIds(long roleId)
          Returns the primary keys of all the users belonging to the role.
 List<User> getRoleUsers(long roleId)
           
 List<User> getRoleUsers(long roleId, int start, int end)
           
 List<User> getRoleUsers(long roleId, int start, int end, OrderByComparator<User> orderByComparator)
           
 int getRoleUsersCount(long roleId)
           
 int getRoleUsersCount(long roleId, int status)
          Returns the number of users with the status belonging to the role.
 List<User> getSocialUsers(long userId, int socialRelationType, int start, int end, OrderByComparator<User> obc)
          Deprecated. As of 7.0.0, replaced by getSocialUsers(long, int, String, int, int, OrderByComparator)
 List<User> getSocialUsers(long userId, int start, int end, OrderByComparator<User> obc)
          Deprecated. As of 7.0.0, replaced by getSocialUsers(long, int, String, int, int, OrderByComparator)
 List<User> getSocialUsers(long userId, int socialRelationType, String socialRelationTypeComparator, int start, int end, OrderByComparator<User> obc)
           
 List<User> getSocialUsers(long userId1, long userId2, int socialRelationType, int start, int end, OrderByComparator<User> obc)
          Returns an ordered range of all the users with a mutual social relation of the type with both of the given users.
 List<User> getSocialUsers(long userId1, long userId2, int start, int end, OrderByComparator<User> obc)
          Returns an ordered range of all the users with a mutual social relation with both of the given users.
 int getSocialUsersCount(long userId)
          Deprecated. As of 7.0.0, replaced by getSocialUsersCount(long, int, String)
 int getSocialUsersCount(long userId, int socialRelationType)
          Deprecated. As of 7.0.0, replaced by getSocialUsersCount(long, int, String)
 int getSocialUsersCount(long userId, int socialRelationType, String socialRelationTypeComparator)
          Returns the number of users with a social relation with the user.
 int getSocialUsersCount(long userId1, long userId2)
          Returns the number of users with a mutual social relation with both of the given users.
 int getSocialUsersCount(long userId1, long userId2, int socialRelationType)
          Returns the number of users with a mutual social relation of the type with both of the given users.
 long[] getTeamPrimaryKeys(long userId)
          Returns the teamIds of the teams associated with the user.
 List<User> getTeamUsers(long teamId)
           
 List<User> getTeamUsers(long teamId, int start, int end)
           
 List<User> getTeamUsers(long teamId, int start, int end, OrderByComparator<User> orderByComparator)
           
 int getTeamUsersCount(long teamId)
           
 User getUser(long userId)
          Returns the user with the primary key.
 User getUserByContactId(long contactId)
          Returns the user with the contact ID.
 User getUserByEmailAddress(long companyId, String emailAddress)
          Returns the user with the email address.
 User getUserByFacebookId(long companyId, long facebookId)
          Returns the user with the Facebook ID.
 User getUserById(long userId)
          Returns the user with the primary key.
 User getUserById(long companyId, long userId)
          Returns the user with the primary key from the company.
 User getUserByOpenId(long companyId, String openId)
          Returns the user with the OpenID.
 User getUserByPortraitId(long portraitId)
          Returns the user with the portrait ID.
 User getUserByScreenName(long companyId, String screenName)
          Returns the user with the screen name.
 User getUserByUuid(String uuid)
          Deprecated. As of 6.2.0, replaced by getUserByUuidAndCompanyId(String, long)
 User getUserByUuidAndCompanyId(String uuid, long companyId)
          Returns the user with the matching UUID and company.
 long[] getUserGroupPrimaryKeys(long userId)
          Returns the userGroupIds of the user groups associated with the user.
 List<User> getUserGroupUsers(long userGroupId)
           
 List<User> getUserGroupUsers(long userGroupId, int start, int end)
           
 List<User> getUserGroupUsers(long userGroupId, int start, int end, OrderByComparator<User> orderByComparator)
           
 int getUserGroupUsersCount(long userGroupId)
           
 int getUserGroupUsersCount(long userGroupId, int status)
          Returns the number of users with the status belonging to the user group.
 long getUserIdByEmailAddress(long companyId, String emailAddress)
          Returns the primary key of the user with the email address.
 long getUserIdByScreenName(long companyId, String screenName)
          Returns the primary key of the user with the screen name.
 List<User> getUsers(int start, int end)
          Returns a range of all the users.
 int getUsersCount()
          Returns the number of users.
 boolean hasGroupUser(long groupId, long userId)
           
 boolean hasGroupUsers(long groupId)
           
 boolean hasOrganizationUser(long organizationId, long userId)
           
 boolean hasOrganizationUsers(long organizationId)
           
 boolean hasPasswordPolicyUser(long passwordPolicyId, long userId)
          Returns true if the password policy has been assigned to the user.
 boolean hasRoleUser(long roleId, long userId)
           
 boolean hasRoleUser(long companyId, String name, long userId, boolean inherited)
          Returns true if the user has the role with the name, optionally through inheritance.
 boolean hasRoleUsers(long roleId)
           
 boolean hasTeamUser(long teamId, long userId)
           
 boolean hasTeamUsers(long teamId)
           
 boolean hasUserGroupUser(long userGroupId, long userId)
           
 boolean hasUserGroupUsers(long userGroupId)
           
 boolean isPasswordExpired(User user)
          Returns true if the user's password is expired.
 boolean isPasswordExpiringSoon(User user)
          Returns true if the password policy is configured to warn the user that his password is expiring and the remaining time until expiration is equal or less than the configured warning time.
 User loadGetDefaultUser(long companyId)
          Returns the default user for the company.
 List<User> search(long companyId, String keywords, int status, LinkedHashMap<String,Object> params, int start, int end, OrderByComparator<User> obc)
          Returns an ordered range of all the users who match the keywords and status, without using the indexer.
 Hits search(long companyId, String keywords, int status, LinkedHashMap<String,Object> params, int start, int end, Sort sort)
          Returns an ordered range of all the users who match the keywords and status, using the indexer.
 Hits search(long companyId, String keywords, int status, LinkedHashMap<String,Object> params, int start, int end, Sort[] sorts)
           
 List<User> search(long companyId, String firstName, String middleName, String lastName, String screenName, String emailAddress, int status, LinkedHashMap<String,Object> params, boolean andSearch, int start, int end, OrderByComparator<User> obc)
          Returns an ordered range of all the users with the status, and whose first name, middle name, last name, screen name, and email address match the keywords specified for them, without using the indexer.
 Hits search(long companyId, String firstName, String middleName, String lastName, String screenName, String emailAddress, int status, LinkedHashMap<String,Object> params, boolean andSearch, int start, int end, Sort sort)
          Returns an ordered range of all the users with the status, and whose first name, middle name, last name, screen name, and email address match the keywords specified for them, using the indexer.
 Hits search(long companyId, String firstName, String middleName, String lastName, String screenName, String emailAddress, int status, LinkedHashMap<String,Object> params, boolean andSearch, int start, int end, Sort[] sorts)
           
 int searchCount(long companyId, String keywords, int status, LinkedHashMap<String,Object> params)
          Returns the number of users who match the keywords and status.
 int searchCount(long companyId, String firstName, String middleName, String lastName, String screenName, String emailAddress, int status, LinkedHashMap<String,Object> params, boolean andSearch)
          Returns the number of users with the status, and whose first name, middle name, last name, screen name, and email address match the keywords specified for them.
 Map<Long,Integer> searchCounts(long companyId, int status, long[] groupIds)
           
 List<User> searchSocial(long[] groupIds, long userId, int[] socialRelationTypes, String keywords, int start, int end)
           
 List<User> searchSocial(long userId, int[] socialRelationTypes, String keywords, int start, int end)
           
 List<User> searchSocial(long companyId, long[] groupIds, String keywords, int start, int end)
           
 BaseModelSearchResult<User> searchUsers(long companyId, String keywords, int status, LinkedHashMap<String,Object> params, int start, int end, Sort sort)
           
 BaseModelSearchResult<User> searchUsers(long companyId, String keywords, int status, LinkedHashMap<String,Object> params, int start, int end, Sort[] sorts)
           
 BaseModelSearchResult<User> searchUsers(long companyId, String firstName, String middleName, String lastName, String screenName, String emailAddress, int status, LinkedHashMap<String,Object> params, boolean andSearch, int start, int end, Sort sort)
           
 BaseModelSearchResult<User> searchUsers(long companyId, String firstName, String middleName, String lastName, String screenName, String emailAddress, int status, LinkedHashMap<String,Object> params, boolean andSearch, int start, int end, Sort[] sorts)
           
 void sendEmailAddressVerification(User user, String emailAddress, ServiceContext serviceContext)
          Sends an email address verification to the user.
 boolean sendPassword(long companyId, String emailAddress, String fromName, String fromAddress, String subject, String body, ServiceContext serviceContext)
          Sends the password email to the user with the email address.
 boolean sendPasswordByEmailAddress(long companyId, String emailAddress)
          Sends a password notification email to the user matching the email address.
 boolean sendPasswordByScreenName(long companyId, String screenName)
          Sends a password notification email to the user matching the screen name.
 boolean sendPasswordByUserId(long userId)
          Sends a password notification email to the user matching the ID.
 void setGroupUsers(long groupId, long[] userIds)
           
 void setOrganizationUsers(long organizationId, long[] userIds)
           
 void setRoleUsers(long roleId, long[] userIds)
           
 void setTeamUsers(long teamId, long[] userIds)
           
 void setUserGroupUsers(long userGroupId, long[] userIds)
           
 void unsetGroupTeamsUsers(long groupId, long[] userIds)
          Removes the users from the teams of a group.
 void unsetGroupUsers(long groupId, long[] userIds, ServiceContext serviceContext)
          Removes the users from the group.
 void unsetOrganizationUsers(long organizationId, long[] userIds)
          Removes the users from the organization.
 void unsetPasswordPolicyUsers(long passwordPolicyId, long[] userIds)
          Removes the users from the password policy.
 void unsetRoleUsers(long roleId, List<User> users)
          Removes the users from the role.
 void unsetRoleUsers(long roleId, long[] userIds)
          Removes the users from the role.
 void unsetTeamUsers(long teamId, long[] userIds)
          Removes the users from the team.
 void unsetUserGroupUsers(long userGroupId, long[] userIds)
          Removes the users from the user group.
 User updateAgreedToTermsOfUse(long userId, boolean agreedToTermsOfUse)
          Updates whether the user has agreed to the terms of use.
 void updateAsset(long userId, User user, long[] assetCategoryIds, String[] assetTagNames)
          Updates the user's asset with the new asset categories and tag names, removing and adding asset categories and tag names as necessary.
 User updateCreateDate(long userId, Date createDate)
          Updates the user's creation date.
 User updateEmailAddress(long userId, String password, String emailAddress1, String emailAddress2)
          Updates the user's email address.
 User updateEmailAddress(long userId, String password, String emailAddress1, String emailAddress2, ServiceContext serviceContext)
          Updates the user's email address or sends verification email.
 User updateEmailAddressVerified(long userId, boolean emailAddressVerified)
          Updates whether the user has verified email address.
 User updateFacebookId(long userId, long facebookId)
          Updates the user's Facebook ID.
 void updateGroups(long userId, long[] newGroupIds, ServiceContext serviceContext)
          Sets the groups the user is in, removing and adding groups as necessary.
 User updateIncompleteUser(long creatorUserId, long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, long facebookId, String openId, Locale locale, String firstName, String middleName, String lastName, long prefixId, long suffixId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, boolean updateUserInformation, boolean sendEmail, ServiceContext serviceContext)
          Updates a user account that was automatically created when a guest user participated in an action (e.g. posting a comment) and only provided his name and email address.
 User updateJobTitle(long userId, String jobTitle)
          Updates the user's job title.
 User updateLastLogin(long userId, String loginIP)
          Updates the user's last login with the current time and the IP address.
 User updateLockout(User user, boolean lockout)
          Updates whether the user is locked out from logging in.
 User updateLockoutByEmailAddress(long companyId, String emailAddress, boolean lockout)
          Updates whether the user is locked out from logging in.
 User updateLockoutById(long userId, boolean lockout)
          Updates whether the user is locked out from logging in.
 User updateLockoutByScreenName(long companyId, String screenName, boolean lockout)
          Updates whether the user is locked out from logging in.
 User updateModifiedDate(long userId, Date modifiedDate)
          Updates the user's modified date.
 User updateOpenId(long userId, String openId)
          Updates the user's OpenID.
 void updateOrganizations(long userId, long[] newOrganizationIds, ServiceContext serviceContext)
          Sets the organizations that the user is in, removing and adding organizations as necessary.
 User updatePassword(long userId, String password1, String password2, boolean passwordReset)
          Updates the user's password without tracking or validation of the change.
 User updatePassword(long userId, String password1, String password2, boolean passwordReset, boolean silentUpdate)
          Updates the user's password, optionally with tracking and validation of the change.
 User updatePasswordManually(long userId, String password, boolean passwordEncrypted, boolean passwordReset, Date passwordModifiedDate)
          Updates the user's password with manually input information.
 User updatePasswordReset(long userId, boolean passwordReset)
          Updates whether the user should be asked to reset their password the next time they login.
 User updatePortrait(long userId, byte[] bytes)
          Updates the user's portrait image.
 User updateReminderQuery(long userId, String question, String answer)
          Updates the user's password reset question and answer.
 User updateScreenName(long userId, String screenName)
          Updates the user's screen name.
 User updateStatus(long userId, int status)
          Deprecated. As of 7.0.0, replaced by updateStatus(long, int, ServiceContext)
 User updateStatus(long userId, int status, ServiceContext serviceContext)
          Updates the user's workflow status.
 User updateUser(long userId, String oldPassword, String newPassword1, String newPassword2, boolean passwordReset, String reminderQueryQuestion, String reminderQueryAnswer, String screenName, String emailAddress, long facebookId, String openId, boolean portrait, byte[] portraitBytes, String languageId, String timeZoneId, String greeting, String comments, String firstName, String middleName, String lastName, long prefixId, long suffixId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String smsSn, String facebookSn, String jabberSn, String skypeSn, String twitterSn, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, List<UserGroupRole> userGroupRoles, long[] userGroupIds, ServiceContext serviceContext)
          Updates the user.
 User updateUser(long userId, String oldPassword, String newPassword1, String newPassword2, boolean passwordReset, String reminderQueryQuestion, String reminderQueryAnswer, String screenName, String emailAddress, long facebookId, String openId, String languageId, String timeZoneId, String greeting, String comments, String firstName, String middleName, String lastName, long prefixId, long suffixId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String smsSn, String facebookSn, String jabberSn, String skypeSn, String twitterSn, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, List<UserGroupRole> userGroupRoles, long[] userGroupIds, ServiceContext serviceContext)
          Deprecated. As of 7.0.0, replaced by #updateUser(long, String, String, String, boolean, String, String, String, String, long, String, boolean, byte[], String, String, String, String, String, String, String, int, int, boolean, int, int, int, String, String, String, String, String, String, String, String, String, String, String, long[], long[], long[], List, long[], ServiceContext)
 User updateUser(User user)
          Updates the user in the database or adds it if it does not yet exist.
 void verifyEmailAddress(String ticketKey)
          Verifies the email address of the ticket.
 

Method Detail

addDefaultAdminUser

User addDefaultAdminUser(long companyId,
                         String screenName,
                         String emailAddress,
                         Locale locale,
                         String firstName,
                         String middleName,
                         String lastName)
                         throws PortalException
Adds a default admin user for the company.

Parameters:
companyId - the primary key of the user's company
screenName - the user's screen name
emailAddress - the user's email address
locale - the user's locale
firstName - the user's first name
middleName - the user's middle name
lastName - the user's last name
Returns:
the new default admin user
Throws:
PortalException

addDefaultGroups

void addDefaultGroups(long userId)
                      throws PortalException
Adds the user to the default groups, unless the user is already in these groups. The default groups can be specified in portal.properties with the key admin.default.group.names.

Parameters:
userId - the primary key of the user
Throws:
PortalException

addDefaultRoles

void addDefaultRoles(long userId)
                     throws PortalException
Adds the user to the default roles, unless the user already has these roles. The default roles can be specified in portal.properties with the key admin.default.role.names.

Parameters:
userId - the primary key of the user
Throws:
PortalException

addDefaultUserGroups

void addDefaultUserGroups(long userId)
                          throws PortalException
Adds the user to the default user groups, unless the user is already in these user groups. The default user groups can be specified in portal.properties with the property admin.default.user.group.names.

Parameters:
userId - the primary key of the user
Throws:
PortalException

addGroupUser

void addGroupUser(long groupId,
                  User user)

addGroupUser

void addGroupUser(long groupId,
                  long userId)

addGroupUsers

void addGroupUsers(long groupId,
                   List<User> Users)
                   throws PortalException
Throws:
PortalException

addGroupUsers

void addGroupUsers(long groupId,
                   long[] userIds)
                   throws PortalException
Throws:
PortalException

addOrganizationUser

void addOrganizationUser(long organizationId,
                         User user)

addOrganizationUser

void addOrganizationUser(long organizationId,
                         long userId)

addOrganizationUsers

void addOrganizationUsers(long organizationId,
                          List<User> Users)
                          throws PortalException
Throws:
PortalException

addOrganizationUsers

void addOrganizationUsers(long organizationId,
                          long[] userIds)
                          throws PortalException
Throws:
PortalException

addPasswordPolicyUsers

void addPasswordPolicyUsers(long passwordPolicyId,
                            long[] userIds)
Assigns the password policy to the users, removing any other currently assigned password policies.

Parameters:
passwordPolicyId - the primary key of the password policy
userIds - the primary keys of the users

addRoleUser

void addRoleUser(long roleId,
                 User user)

addRoleUser

void addRoleUser(long roleId,
                 long userId)

addRoleUsers

void addRoleUsers(long roleId,
                  List<User> Users)
                  throws PortalException
Throws:
PortalException

addRoleUsers

void addRoleUsers(long roleId,
                  long[] userIds)
                  throws PortalException
Throws:
PortalException

addTeamUser

void addTeamUser(long teamId,
                 User user)

addTeamUser

void addTeamUser(long teamId,
                 long userId)

addTeamUsers

void addTeamUsers(long teamId,
                  List<User> Users)
                  throws PortalException
Throws:
PortalException

addTeamUsers

void addTeamUsers(long teamId,
                  long[] userIds)
                  throws PortalException
Throws:
PortalException

addUser

User addUser(long creatorUserId,
             long companyId,
             boolean autoPassword,
             String password1,
             String password2,
             boolean autoScreenName,
             String screenName,
             String emailAddress,
             long facebookId,
             String openId,
             Locale locale,
             String firstName,
             String middleName,
             String lastName,
             long prefixId,
             long suffixId,
             boolean male,
             int birthdayMonth,
             int birthdayDay,
             int birthdayYear,
             String jobTitle,
             long[] groupIds,
             long[] organizationIds,
             long[] roleIds,
             long[] userGroupIds,
             boolean sendEmail,
             ServiceContext serviceContext)
             throws PortalException
Adds a user.

This method handles the creation and bookkeeping of the user including its resources, metadata, and internal data structures. It is not necessary to make subsequent calls to any methods to setup default groups, resources, etc.

Parameters:
creatorUserId - the primary key of the creator
companyId - the primary key of the user's company
autoPassword - whether a password should be automatically generated for the user
password1 - the user's password
password2 - the user's password confirmation
autoScreenName - whether a screen name should be automatically generated for the user
screenName - the user's screen name
emailAddress - the user's email address
facebookId - the user's facebook ID
openId - the user's OpenID
locale - the user's locale
firstName - the user's first name
middleName - the user's middle name
lastName - the user's last name
prefixId - the user's name prefix ID
suffixId - the user's name suffix ID
male - whether the user is male
birthdayMonth - the user's birthday month (0-based, meaning 0 for January)
birthdayDay - the user's birthday day
birthdayYear - the user's birthday year
jobTitle - the user's job title
groupIds - the primary keys of the user's groups
organizationIds - the primary keys of the user's organizations
roleIds - the primary keys of the roles this user possesses
userGroupIds - the primary keys of the user's user groups
sendEmail - whether to send the user an email notification about their new account
serviceContext - the service context to be applied (optionally null). Can set the UUID (with the uuid attribute), asset category IDs, asset tag names, and expando bridge attributes for the user.
Returns:
the new user
Throws:
PortalException

addUser

@Indexable(type=REINDEX)
User addUser(User user)
Adds the user to the database. Also notifies the appropriate model listeners.

Parameters:
user - the user
Returns:
the user that was added

addUserGroupUser

void addUserGroupUser(long userGroupId,
                      User user)

addUserGroupUser

void addUserGroupUser(long userGroupId,
                      long userId)

addUserGroupUsers

void addUserGroupUsers(long userGroupId,
                       List<User> Users)
                       throws PortalException
Throws:
PortalException

addUserGroupUsers

void addUserGroupUsers(long userGroupId,
                       long[] userIds)
                       throws PortalException
Throws:
PortalException

addUserWithWorkflow

User addUserWithWorkflow(long creatorUserId,
                         long companyId,
                         boolean autoPassword,
                         String password1,
                         String password2,
                         boolean autoScreenName,
                         String screenName,
                         String emailAddress,
                         long facebookId,
                         String openId,
                         Locale locale,
                         String firstName,
                         String middleName,
                         String lastName,
                         long prefixId,
                         long suffixId,
                         boolean male,
                         int birthdayMonth,
                         int birthdayDay,
                         int birthdayYear,
                         String jobTitle,
                         long[] groupIds,
                         long[] organizationIds,
                         long[] roleIds,
                         long[] userGroupIds,
                         boolean sendEmail,
                         ServiceContext serviceContext)
                         throws PortalException
Adds a user with workflow.

This method handles the creation and bookkeeping of the user including its resources, metadata, and internal data structures. It is not necessary to make subsequent calls to any methods to setup default groups, resources, etc.

Parameters:
creatorUserId - the primary key of the creator
companyId - the primary key of the user's company
autoPassword - whether a password should be automatically generated for the user
password1 - the user's password
password2 - the user's password confirmation
autoScreenName - whether a screen name should be automatically generated for the user
screenName - the user's screen name
emailAddress - the user's email address
facebookId - the user's facebook ID
openId - the user's OpenID
locale - the user's locale
firstName - the user's first name
middleName - the user's middle name
lastName - the user's last name
prefixId - the user's name prefix ID
suffixId - the user's name suffix ID
male - whether the user is male
birthdayMonth - the user's birthday month (0-based, meaning 0 for January)
birthdayDay - the user's birthday day
birthdayYear - the user's birthday year
jobTitle - the user's job title
groupIds - the primary keys of the user's groups
organizationIds - the primary keys of the user's organizations
roleIds - the primary keys of the roles this user possesses
userGroupIds - the primary keys of the user's user groups
sendEmail - whether to send the user an email notification about their new account
serviceContext - the service context to be applied (optionally null). Can set the UUID (with the uuid attribute), asset category IDs, asset tag names, and expando bridge attributes for the user.
Returns:
the new user
Throws:
PortalException

authenticateByEmailAddress

int authenticateByEmailAddress(long companyId,
                               String emailAddress,
                               String password,
                               Map<String,String[]> headerMap,
                               Map<String,String[]> parameterMap,
                               Map<String,Object> resultsMap)
                               throws PortalException
Attempts to authenticate the user by their email address and password, while using the AuthPipeline.

Parameters:
companyId - the primary key of the user's company
emailAddress - the user's email address
password - the user's password
headerMap - the header map from the authentication request
parameterMap - the parameter map from the authentication request
resultsMap - the map of authentication results (may be nil). After a successful authentication the user's primary key will be placed under the key userId.
Returns:
the authentication status. This can be Authenticator#FAILURE indicating that the user's credentials are invalid, Authenticator#SUCCESS indicating a successful login, or Authenticator#DNE indicating that a user with that login does not exist.
Throws:
PortalException
See Also:
AuthPipeline

authenticateByScreenName

int authenticateByScreenName(long companyId,
                             String screenName,
                             String password,
                             Map<String,String[]> headerMap,
                             Map<String,String[]> parameterMap,
                             Map<String,Object> resultsMap)
                             throws PortalException
Attempts to authenticate the user by their screen name and password, while using the AuthPipeline.

Parameters:
companyId - the primary key of the user's company
screenName - the user's screen name
password - the user's password
headerMap - the header map from the authentication request
parameterMap - the parameter map from the authentication request
resultsMap - the map of authentication results (may be nil). After a successful authentication the user's primary key will be placed under the key userId.
Returns:
the authentication status. This can be Authenticator#FAILURE indicating that the user's credentials are invalid, Authenticator#SUCCESS indicating a successful login, or Authenticator#DNE indicating that a user with that login does not exist.
Throws:
PortalException
See Also:
AuthPipeline

authenticateByUserId

int authenticateByUserId(long companyId,
                         long userId,
                         String password,
                         Map<String,String[]> headerMap,
                         Map<String,String[]> parameterMap,
                         Map<String,Object> resultsMap)
                         throws PortalException
Attempts to authenticate the user by their primary key and password, while using the AuthPipeline.

Parameters:
companyId - the primary key of the user's company
userId - the user's primary key
password - the user's password
headerMap - the header map from the authentication request
parameterMap - the parameter map from the authentication request
resultsMap - the map of authentication results (may be nil). After a successful authentication the user's primary key will be placed under the key userId.
Returns:
the authentication status. This can be Authenticator#FAILURE indicating that the user's credentials are invalid, Authenticator#SUCCESS indicating a successful login, or Authenticator#DNE indicating that a user with that login does not exist.
Throws:
PortalException
See Also:
AuthPipeline

authenticateForBasic

@Transactional(propagation=SUPPORTS)
long authenticateForBasic(long companyId,
                                                           String authType,
                                                           String login,
                                                           String password)
                          throws PortalException
Attempts to authenticate the user using HTTP basic access authentication, without using the AuthPipeline. Primarily used for authenticating users of tunnel-web.

Authentication type specifies what login contains.The valid values are:

Parameters:
companyId - the primary key of the user's company
authType - the type of authentication to perform
login - either the user's email address, screen name, or primary key depending on the value of authType
password - the user's password
Returns:
the user's primary key if authentication is successful; 0 otherwise
Throws:
PortalException

authenticateForDigest

@Transactional(propagation=SUPPORTS)
long authenticateForDigest(long companyId,
                                                            String username,
                                                            String realm,
                                                            String nonce,
                                                            String method,
                                                            String uri,
                                                            String response)
                           throws PortalException
Attempts to authenticate the user using HTTP digest access authentication, without using the AuthPipeline. Primarily used for authenticating users of tunnel-web.

Parameters:
companyId - the primary key of the user's company
username - either the user's email address, screen name, or primary key
realm - unused
nonce - the number used once
method - the request method
uri - the request URI
response - the authentication response hash
Returns:
the user's primary key if authentication is successful; 0 otherwise
Throws:
PortalException

authenticateForJAAS

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean authenticateForJAAS(long userId,
                                                                     String encPassword)
Attempts to authenticate the user using JAAS credentials, without using the AuthPipeline.

Parameters:
userId - the primary key of the user
encPassword - the encrypted password
Returns:
true if authentication is successful; false otherwise

checkLockout

void checkLockout(User user)
                  throws PortalException
Checks if the user is currently locked out based on the password policy, and performs maintenance on the user's lockout and failed login data.

Parameters:
user - the user
Throws:
PortalException

checkLoginFailure

void checkLoginFailure(User user)
Adds a failed login attempt to the user and updates the user's last failed login date.

Parameters:
user - the user

checkLoginFailureByEmailAddress

void checkLoginFailureByEmailAddress(long companyId,
                                     String emailAddress)
                                     throws PortalException
Adds a failed login attempt to the user with the email address and updates the user's last failed login date.

Parameters:
companyId - the primary key of the user's company
emailAddress - the user's email address
Throws:
PortalException

checkLoginFailureById

void checkLoginFailureById(long userId)
                           throws PortalException
Adds a failed login attempt to the user and updates the user's last failed login date.

Parameters:
userId - the primary key of the user
Throws:
PortalException

checkLoginFailureByScreenName

void checkLoginFailureByScreenName(long companyId,
                                   String screenName)
                                   throws PortalException
Adds a failed login attempt to the user with the screen name and updates the user's last failed login date.

Parameters:
companyId - the primary key of the user's company
screenName - the user's screen name
Throws:
PortalException

checkPasswordExpired

void checkPasswordExpired(User user)
                          throws PortalException
Checks if the user's password is expired based on the password policy, and performs maintenance on the user's grace login and password reset data.

Parameters:
user - the user
Throws:
PortalException

clearGroupUsers

void clearGroupUsers(long groupId)

clearOrganizationUsers

void clearOrganizationUsers(long organizationId)

clearRoleUsers

void clearRoleUsers(long roleId)

clearTeamUsers

void clearTeamUsers(long teamId)

clearUserGroupUsers

void clearUserGroupUsers(long userGroupId)

completeUserRegistration

void completeUserRegistration(User user,
                              ServiceContext serviceContext)
                              throws PortalException
Completes the user's registration by generating a password and sending the confirmation email.

Parameters:
user - the user
serviceContext - the service context to be applied. You can specify an unencrypted custom password for the user via attribute passwordUnencrypted. You automatically generate a password for the user by setting attribute autoPassword to true. You can send a confirmation email to the user by setting attribute sendEmail to true.
Throws:
PortalException

createUser

User createUser(long userId)
Creates a new user with the primary key. Does not add the user to the database.

Parameters:
userId - the primary key for the new user
Returns:
the new user

decryptUserId

KeyValuePair decryptUserId(long companyId,
                           String name,
                           String password)
                           throws PortalException
Decrypts the user's primary key and password from their encrypted forms. Used for decrypting a user's credentials from the values stored in an automatic login cookie.

Parameters:
companyId - the primary key of the user's company
name - the encrypted primary key of the user
password - the encrypted password of the user
Returns:
the user's primary key and password
Throws:
PortalException

deleteGroupUser

void deleteGroupUser(long groupId,
                     User user)

deleteGroupUser

void deleteGroupUser(long groupId,
                     long userId)

deleteGroupUsers

void deleteGroupUsers(long groupId,
                      List<User> Users)

deleteGroupUsers

void deleteGroupUsers(long groupId,
                      long[] userIds)

deleteOrganizationUser

void deleteOrganizationUser(long organizationId,
                            User user)

deleteOrganizationUser

void deleteOrganizationUser(long organizationId,
                            long userId)

deleteOrganizationUsers

void deleteOrganizationUsers(long organizationId,
                             List<User> Users)

deleteOrganizationUsers

void deleteOrganizationUsers(long organizationId,
                             long[] userIds)

deletePersistedModel

PersistedModel deletePersistedModel(PersistedModel persistedModel)
                                    throws PortalException
Specified by:
deletePersistedModel in interface PersistedModelLocalService
Throws:
PortalException

deletePortrait

void deletePortrait(long userId)
                    throws PortalException
Deletes the user's portrait image.

Parameters:
userId - the primary key of the user
Throws:
PortalException

deleteRoleUser

void deleteRoleUser(long roleId,
                    User user)
                    throws PortalException
Throws:
PortalException

deleteRoleUser

void deleteRoleUser(long roleId,
                    long userId)
                    throws PortalException
Throws:
PortalException

deleteRoleUsers

void deleteRoleUsers(long roleId,
                     List<User> Users)

deleteRoleUsers

void deleteRoleUsers(long roleId,
                     long[] userIds)

deleteTeamUser

void deleteTeamUser(long teamId,
                    User user)

deleteTeamUser

void deleteTeamUser(long teamId,
                    long userId)

deleteTeamUsers

void deleteTeamUsers(long teamId,
                     List<User> Users)

deleteTeamUsers

void deleteTeamUsers(long teamId,
                     long[] userIds)

deleteUser

@Indexable(type=DELETE)
User deleteUser(User user)
                throws PortalException
Deletes the user from the database. Also notifies the appropriate model listeners.

Parameters:
user - the user
Returns:
the user that was removed
Throws:
PortalException

deleteUser

@Indexable(type=DELETE)
User deleteUser(long userId)
                throws PortalException
Deletes the user with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
userId - the primary key of the user
Returns:
the user that was removed
Throws:
PortalException - if a user with the primary key could not be found

deleteUserGroupUser

void deleteUserGroupUser(long userGroupId,
                         User user)
                         throws PortalException
Throws:
PortalException

deleteUserGroupUser

void deleteUserGroupUser(long userGroupId,
                         long userId)
                         throws PortalException
Throws:
PortalException

deleteUserGroupUsers

void deleteUserGroupUsers(long userGroupId,
                          List<User> Users)

deleteUserGroupUsers

void deleteUserGroupUsers(long userGroupId,
                          long[] userIds)

dynamicQuery

DynamicQuery dynamicQuery()

dynamicQuery

<T> List<T> dynamicQuery(DynamicQuery dynamicQuery)
Performs a dynamic query on the database and returns the matching rows.

Parameters:
dynamicQuery - the dynamic query
Returns:
the matching rows

dynamicQuery

<T> List<T> dynamicQuery(DynamicQuery dynamicQuery,
                         int start,
                         int end)
Performs a dynamic query on the database and returns a range of the matching rows.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil.ALL_POS), then the query will include the default ORDER BY logic from UserModelImpl. If both orderByComparator 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.

Parameters:
dynamicQuery - the dynamic query
start - the lower bound of the range of model instances
end - the upper bound of the range of model instances (not inclusive)
Returns:
the range of matching rows

dynamicQuery

<T> List<T> dynamicQuery(DynamicQuery dynamicQuery,
                         int start,
                         int end,
                         OrderByComparator<T> orderByComparator)
Performs a dynamic query on the database and returns an ordered range of the matching rows.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil.ALL_POS), then the query will include the default ORDER BY logic from UserModelImpl. If both orderByComparator 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.

Parameters:
dynamicQuery - the dynamic query
start - the lower bound of the range of model instances
end - the upper bound of the range of model instances (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching rows

dynamicQueryCount

long dynamicQueryCount(DynamicQuery dynamicQuery)
Returns the number of rows matching the dynamic query.

Parameters:
dynamicQuery - the dynamic query
Returns:
the number of rows matching the dynamic query

dynamicQueryCount

long dynamicQueryCount(DynamicQuery dynamicQuery,
                       Projection projection)
Returns the number of rows matching the dynamic query.

Parameters:
dynamicQuery - the dynamic query
projection - the projection to apply to the query
Returns:
the number of rows matching the dynamic query

encryptUserId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
String encryptUserId(String name)
                     throws PortalException
Encrypts the primary key of the user. Used when encrypting the user's credentials for storage in an automatic login cookie.

Parameters:
name - the primary key of the user
Returns:
the user's encrypted primary key
Throws:
PortalException

fetchUser

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User fetchUser(long userId)

fetchUserByContactId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User fetchUserByContactId(long contactId)
Returns the user with the contact ID.

Parameters:
contactId - the user's contact ID
Returns:
the user with the contact ID, or null if a user with the contact ID could not be found

fetchUserByEmailAddress

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User fetchUserByEmailAddress(long companyId,
                                                                      String emailAddress)
Returns the user with the email address.

Parameters:
companyId - the primary key of the user's company
emailAddress - the user's email address
Returns:
the user with the email address, or null if a user with the email address could not be found

fetchUserByFacebookId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User fetchUserByFacebookId(long companyId,
                                                                    long facebookId)
Returns the user with the Facebook ID.

Parameters:
companyId - the primary key of the user's company
facebookId - the user's Facebook ID
Returns:
the user with the Facebook ID, or null if a user with the Facebook ID could not be found

fetchUserById

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User fetchUserById(long userId)
Returns the user with the primary key.

Parameters:
userId - the primary key of the user
Returns:
the user with the primary key, or null if a user with the primary key could not be found

fetchUserByOpenId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User fetchUserByOpenId(long companyId,
                                                                String openId)
Returns the user with the OpenID.

Parameters:
companyId - the primary key of the user's company
openId - the user's OpenID
Returns:
the user with the OpenID, or null if a user with the OpenID could not be found

fetchUserByPortraitId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User fetchUserByPortraitId(long portraitId)
Returns the user with the portrait ID.

Parameters:
portraitId - the user's portrait ID
Returns:
the user with the portrait ID, or null if a user with the portrait ID could not be found

fetchUserByScreenName

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User fetchUserByScreenName(long companyId,
                                                                    String screenName)
Returns the user with the screen name.

Parameters:
companyId - the primary key of the user's company
screenName - the user's screen name
Returns:
the user with the screen name, or null if a user with the screen name could not be found

fetchUserByUuidAndCompanyId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User fetchUserByUuidAndCompanyId(String uuid,
                                                                          long companyId)
Returns the user with the matching UUID and company.

Parameters:
uuid - the user's UUID
companyId - the primary key of the company
Returns:
the matching user, or null if a matching user could not be found

getActionableDynamicQuery

@Transactional(propagation=SUPPORTS,
               readOnly=true)
ActionableDynamicQuery getActionableDynamicQuery()

getCompanyUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getCompanyUsers(long companyId,
                                                                    int start,
                                                                    int end)
Returns a range of all the users belonging to the company.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

Parameters:
companyId - the primary key of the company
start - the lower bound of the range of users
end - the upper bound of the range of users (not inclusive)
Returns:
the range of users belonging to the company

getCompanyUsersCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getCompanyUsersCount(long companyId)
Returns the number of users belonging to the company.

Parameters:
companyId - the primary key of the company
Returns:
the number of users belonging to the company

getDefaultUser

@Skip
@Transactional(propagation=SUPPORTS,
               readOnly=true)
User getDefaultUser(long companyId)
                    throws PortalException
Returns the default user for the company.

Parameters:
companyId - the primary key of the company
Returns:
the default user for the company
Throws:
PortalException

getDefaultUserId

@Skip
@Transactional(propagation=SUPPORTS,
               readOnly=true)
long getDefaultUserId(long companyId)
                      throws PortalException
Returns the primary key of the default user for the company.

Parameters:
companyId - the primary key of the company
Returns:
the primary key of the default user for the company
Throws:
PortalException

getExportActionableDynamicQuery

@Transactional(propagation=SUPPORTS,
               readOnly=true)
ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext)

getGroupPrimaryKeys

@Transactional(propagation=SUPPORTS,
               readOnly=true)
long[] getGroupPrimaryKeys(long userId)
Returns the groupIds of the groups associated with the user.

Parameters:
userId - the userId of the user
Returns:
long[] the groupIds of groups associated with the user

getGroupUserIds

@Transactional(propagation=SUPPORTS,
               readOnly=true)
long[] getGroupUserIds(long groupId)
Returns the primary keys of all the users belonging to the group.

Parameters:
groupId - the primary key of the group
Returns:
the primary keys of the users belonging to the group

getGroupUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getGroupUsers(long groupId)

getGroupUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getGroupUsers(long groupId,
                                                                  int start,
                                                                  int end)

getGroupUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getGroupUsers(long groupId,
                                                                  int start,
                                                                  int end,
                                                                  OrderByComparator<User> orderByComparator)

getGroupUsersCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getGroupUsersCount(long groupId)

getGroupUsersCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getGroupUsersCount(long groupId,
                                                                int status)
                       throws PortalException
Returns the number of users with the status belonging to the group.

Parameters:
groupId - the primary key of the group
status - the workflow status
Returns:
the number of users with the status belonging to the group
Throws:
PortalException

getIndexableActionableDynamicQuery

@Transactional(propagation=SUPPORTS,
               readOnly=true)
IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()

getInheritedRoleUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getInheritedRoleUsers(long roleId,
                                                                          int start,
                                                                          int end,
                                                                          OrderByComparator<User> obc)
                                 throws PortalException
Throws:
PortalException

getNoAnnouncementsDeliveries

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getNoAnnouncementsDeliveries(String type)
Returns all the users who have not had any announcements of the type delivered, excluding the default user.

Parameters:
type - the type of announcement
Returns:
the users who have not had any annoucements of the type delivered

getNoContacts

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getNoContacts()
Returns all the users who do not have any contacts.

Returns:
the users who do not have any contacts

getNoGroups

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getNoGroups()
Returns all the users who do not belong to any groups, excluding the default user.

Returns:
the users who do not belong to any groups

getOSGiServiceIdentifier

String getOSGiServiceIdentifier()
Returns the OSGi service identifier.

Returns:
the OSGi service identifier

getOrganizationPrimaryKeys

@Transactional(propagation=SUPPORTS,
               readOnly=true)
long[] getOrganizationPrimaryKeys(long userId)
Returns the organizationIds of the organizations associated with the user.

Parameters:
userId - the userId of the user
Returns:
long[] the organizationIds of organizations associated with the user

getOrganizationUserIds

@Transactional(propagation=SUPPORTS,
               readOnly=true)
long[] getOrganizationUserIds(long organizationId)
Returns the primary keys of all the users belonging to the organization.

Parameters:
organizationId - the primary key of the organization
Returns:
the primary keys of the users belonging to the organization

getOrganizationUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getOrganizationUsers(long organizationId)

getOrganizationUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getOrganizationUsers(long organizationId,
                                                                         int start,
                                                                         int end)

getOrganizationUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getOrganizationUsers(long organizationId,
                                                                         int start,
                                                                         int end,
                                                                         OrderByComparator<User> orderByComparator)

getOrganizationUsersCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getOrganizationUsersCount(long organizationId)

getOrganizationUsersCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getOrganizationUsersCount(long organizationId,
                                                                       int status)
                              throws PortalException
Returns the number of users with the status belonging to the organization.

Parameters:
organizationId - the primary key of the organization
status - the workflow status
Returns:
the number of users with the status belonging to the organization
Throws:
PortalException

getPersistedModel

@Transactional(propagation=SUPPORTS,
               readOnly=true)
PersistedModel getPersistedModel(Serializable primaryKeyObj)
                                 throws PortalException
Specified by:
getPersistedModel in interface PersistedModelLocalService
Throws:
PortalException

getRolePrimaryKeys

@Transactional(propagation=SUPPORTS,
               readOnly=true)
long[] getRolePrimaryKeys(long userId)
Returns the roleIds of the roles associated with the user.

Parameters:
userId - the userId of the user
Returns:
long[] the roleIds of roles associated with the user

getRoleUserIds

@Transactional(propagation=SUPPORTS,
               readOnly=true)
long[] getRoleUserIds(long roleId)
Returns the primary keys of all the users belonging to the role.

Parameters:
roleId - the primary key of the role
Returns:
the primary keys of the users belonging to the role

getRoleUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getRoleUsers(long roleId)

getRoleUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getRoleUsers(long roleId,
                                                                 int start,
                                                                 int end)

getRoleUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getRoleUsers(long roleId,
                                                                 int start,
                                                                 int end,
                                                                 OrderByComparator<User> orderByComparator)

getRoleUsersCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getRoleUsersCount(long roleId)

getRoleUsersCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getRoleUsersCount(long roleId,
                                                               int status)
                      throws PortalException
Returns the number of users with the status belonging to the role.

Parameters:
roleId - the primary key of the role
status - the workflow status
Returns:
the number of users with the status belonging to the role
Throws:
PortalException

getSocialUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getSocialUsers(long userId,
                                                                   int socialRelationType,
                                                                   String socialRelationTypeComparator,
                                                                   int start,
                                                                   int end,
                                                                   OrderByComparator<User> obc)
                          throws PortalException
Throws:
PortalException

getSocialUsers

@Deprecated
@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getSocialUsers(long userId,
                                                                              int socialRelationType,
                                                                              int start,
                                                                              int end,
                                                                              OrderByComparator<User> obc)
                          throws PortalException
Deprecated. As of 7.0.0, replaced by getSocialUsers(long, int, String, int, int, OrderByComparator)

Returns an ordered range of all the users with a social relation of the type with the user.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

Parameters:
userId - the primary key of the user
socialRelationType - the type of social relation. The possible types can be found in SocialRelationConstants.
start - the lower bound of the range of users
end - the upper bound of the range of users (not inclusive)
obc - the comparator to order the users by (optionally null)
Returns:
the ordered range of users with a social relation of the type with the user
Throws:
PortalException

getSocialUsers

@Deprecated
@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getSocialUsers(long userId,
                                                                              int start,
                                                                              int end,
                                                                              OrderByComparator<User> obc)
                          throws PortalException
Deprecated. As of 7.0.0, replaced by getSocialUsers(long, int, String, int, int, OrderByComparator)

Returns an ordered range of all the users with a social relation with the user.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

Parameters:
userId - the primary key of the user
start - the lower bound of the range of users
end - the upper bound of the range of users (not inclusive)
obc - the comparator to order the users by (optionally null)
Returns:
the ordered range of users with a social relation with the user
Throws:
PortalException

getSocialUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getSocialUsers(long userId1,
                                                                   long userId2,
                                                                   int socialRelationType,
                                                                   int start,
                                                                   int end,
                                                                   OrderByComparator<User> obc)
                          throws PortalException
Returns an ordered range of all the users with a mutual social relation of the type with both of the given users.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

Parameters:
userId1 - the primary key of the first user
userId2 - the primary key of the second user
socialRelationType - the type of social relation. The possible types can be found in SocialRelationConstants.
start - the lower bound of the range of users
end - the upper bound of the range of users (not inclusive)
obc - the comparator to order the users by (optionally null)
Returns:
the ordered range of users with a mutual social relation of the type with the user
Throws:
PortalException

getSocialUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getSocialUsers(long userId1,
                                                                   long userId2,
                                                                   int start,
                                                                   int end,
                                                                   OrderByComparator<User> obc)
                          throws PortalException
Returns an ordered range of all the users with a mutual social relation with both of the given users.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

Parameters:
userId1 - the primary key of the first user
userId2 - the primary key of the second user
start - the lower bound of the range of users
end - the upper bound of the range of users (not inclusive)
obc - the comparator to order the users by (optionally null)
Returns:
the ordered range of users with a mutual social relation with the user
Throws:
PortalException

getSocialUsersCount

@Deprecated
@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getSocialUsersCount(long userId)
                        throws PortalException
Deprecated. As of 7.0.0, replaced by getSocialUsersCount(long, int, String)

Returns the number of users with a social relation with the user.

Parameters:
userId - the primary key of the user
Returns:
the number of users with a social relation with the user
Throws:
PortalException

getSocialUsersCount

@Deprecated
@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getSocialUsersCount(long userId,
                                                                            int socialRelationType)
                        throws PortalException
Deprecated. As of 7.0.0, replaced by getSocialUsersCount(long, int, String)

Returns the number of users with a social relation of the type with the user.

Parameters:
userId - the primary key of the user
socialRelationType - the type of social relation. The possible types can be found in SocialRelationConstants.
Returns:
the number of users with a social relation of the type with the user
Throws:
PortalException

getSocialUsersCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getSocialUsersCount(long userId,
                                                                 int socialRelationType,
                                                                 String socialRelationTypeComparator)
                        throws PortalException
Returns the number of users with a social relation with the user.

Parameters:
userId - the primary key of the user
socialRelationType - the type of social relation. The possible types can be found in SocialRelationConstants.
Returns:
the number of users with a social relation with the user
Throws:
PortalException

getSocialUsersCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getSocialUsersCount(long userId1,
                                                                 long userId2)
                        throws PortalException
Returns the number of users with a mutual social relation with both of the given users.

Parameters:
userId1 - the primary key of the first user
userId2 - the primary key of the second user
Returns:
the number of users with a mutual social relation with the user
Throws:
PortalException

getSocialUsersCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getSocialUsersCount(long userId1,
                                                                 long userId2,
                                                                 int socialRelationType)
                        throws PortalException
Returns the number of users with a mutual social relation of the type with both of the given users.

Parameters:
userId1 - the primary key of the first user
userId2 - the primary key of the second user
socialRelationType - the type of social relation. The possible types can be found in SocialRelationConstants.
Returns:
the number of users with a mutual social relation of the type with the user
Throws:
PortalException

getTeamPrimaryKeys

@Transactional(propagation=SUPPORTS,
               readOnly=true)
long[] getTeamPrimaryKeys(long userId)
Returns the teamIds of the teams associated with the user.

Parameters:
userId - the userId of the user
Returns:
long[] the teamIds of teams associated with the user

getTeamUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getTeamUsers(long teamId)

getTeamUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getTeamUsers(long teamId,
                                                                 int start,
                                                                 int end)

getTeamUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getTeamUsers(long teamId,
                                                                 int start,
                                                                 int end,
                                                                 OrderByComparator<User> orderByComparator)

getTeamUsersCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getTeamUsersCount(long teamId)

getUser

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User getUser(long userId)
             throws PortalException
Returns the user with the primary key.

Parameters:
userId - the primary key of the user
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found

getUserByContactId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User getUserByContactId(long contactId)
                        throws PortalException
Returns the user with the contact ID.

Parameters:
contactId - the user's contact ID
Returns:
the user with the contact ID
Throws:
PortalException

getUserByEmailAddress

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User getUserByEmailAddress(long companyId,
                                                                    String emailAddress)
                           throws PortalException
Returns the user with the email address.

Parameters:
companyId - the primary key of the user's company
emailAddress - the user's email address
Returns:
the user with the email address
Throws:
PortalException

getUserByFacebookId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User getUserByFacebookId(long companyId,
                                                                  long facebookId)
                         throws PortalException
Returns the user with the Facebook ID.

Parameters:
companyId - the primary key of the user's company
facebookId - the user's Facebook ID
Returns:
the user with the Facebook ID
Throws:
PortalException

getUserById

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User getUserById(long companyId,
                                                          long userId)
                 throws PortalException
Returns the user with the primary key from the company.

Parameters:
companyId - the primary key of the user's company
userId - the primary key of the user
Returns:
the user with the primary key
Throws:
PortalException

getUserById

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User getUserById(long userId)
                 throws PortalException
Returns the user with the primary key.

Parameters:
userId - the primary key of the user
Returns:
the user with the primary key
Throws:
PortalException

getUserByOpenId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User getUserByOpenId(long companyId,
                                                              String openId)
                     throws PortalException
Returns the user with the OpenID.

Parameters:
companyId - the primary key of the user's company
openId - the user's OpenID
Returns:
the user with the OpenID
Throws:
PortalException

getUserByPortraitId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User getUserByPortraitId(long portraitId)
                         throws PortalException
Returns the user with the portrait ID.

Parameters:
portraitId - the user's portrait ID
Returns:
the user with the portrait ID
Throws:
PortalException

getUserByScreenName

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User getUserByScreenName(long companyId,
                                                                  String screenName)
                         throws PortalException
Returns the user with the screen name.

Parameters:
companyId - the primary key of the user's company
screenName - the user's screen name
Returns:
the user with the screen name
Throws:
PortalException

getUserByUuid

@Deprecated
@Transactional(propagation=SUPPORTS,
               readOnly=true)
User getUserByUuid(String uuid)
                   throws PortalException
Deprecated. As of 6.2.0, replaced by getUserByUuidAndCompanyId(String, long)

Returns the user with the UUID.

Parameters:
uuid - the user's UUID
Returns:
the user with the UUID
Throws:
PortalException

getUserByUuidAndCompanyId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User getUserByUuidAndCompanyId(String uuid,
                                                                        long companyId)
                               throws PortalException
Returns the user with the matching UUID and company.

Parameters:
uuid - the user's UUID
companyId - the primary key of the company
Returns:
the matching user
Throws:
PortalException - if a matching user could not be found

getUserGroupPrimaryKeys

@Transactional(propagation=SUPPORTS,
               readOnly=true)
long[] getUserGroupPrimaryKeys(long userId)
Returns the userGroupIds of the user groups associated with the user.

Parameters:
userId - the userId of the user
Returns:
long[] the userGroupIds of user groups associated with the user

getUserGroupUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getUserGroupUsers(long userGroupId)

getUserGroupUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getUserGroupUsers(long userGroupId,
                                                                      int start,
                                                                      int end)

getUserGroupUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getUserGroupUsers(long userGroupId,
                                                                      int start,
                                                                      int end,
                                                                      OrderByComparator<User> orderByComparator)

getUserGroupUsersCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getUserGroupUsersCount(long userGroupId)

getUserGroupUsersCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getUserGroupUsersCount(long userGroupId,
                                                                    int status)
                           throws PortalException
Returns the number of users with the status belonging to the user group.

Parameters:
userGroupId - the primary key of the user group
status - the workflow status
Returns:
the number of users with the status belonging to the user group
Throws:
PortalException

getUserIdByEmailAddress

@Transactional(propagation=SUPPORTS,
               readOnly=true)
long getUserIdByEmailAddress(long companyId,
                                                                      String emailAddress)
                             throws PortalException
Returns the primary key of the user with the email address.

Parameters:
companyId - the primary key of the user's company
emailAddress - the user's email address
Returns:
the primary key of the user with the email address
Throws:
PortalException

getUserIdByScreenName

@Transactional(propagation=SUPPORTS,
               readOnly=true)
long getUserIdByScreenName(long companyId,
                                                                    String screenName)
                           throws PortalException
Returns the primary key of the user with the screen name.

Parameters:
companyId - the primary key of the user's company
screenName - the user's screen name
Returns:
the primary key of the user with the screen name
Throws:
PortalException

getUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getUsers(int start,
                                                             int end)
Returns a range of all the users.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil.ALL_POS), then the query will include the default ORDER BY logic from UserModelImpl. If both orderByComparator 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.

Parameters:
start - the lower bound of the range of users
end - the upper bound of the range of users (not inclusive)
Returns:
the range of users

getUsersCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getUsersCount()
Returns the number of users.

Returns:
the number of users

hasGroupUser

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasGroupUser(long groupId,
                                                              long userId)

hasGroupUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasGroupUsers(long groupId)

hasOrganizationUser

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasOrganizationUser(long organizationId,
                                                                     long userId)

hasOrganizationUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasOrganizationUsers(long organizationId)

hasPasswordPolicyUser

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasPasswordPolicyUser(long passwordPolicyId,
                                                                       long userId)
Returns true if the password policy has been assigned to the user.

Parameters:
passwordPolicyId - the primary key of the password policy
userId - the primary key of the user
Returns:
true if the password policy is assigned to the user; false otherwise

hasRoleUser

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasRoleUser(long companyId,
                                                             String name,
                                                             long userId,
                                                             boolean inherited)
                    throws PortalException
Returns true if the user has the role with the name, optionally through inheritance.

Parameters:
companyId - the primary key of the role's company
name - the name of the role (must be a regular role, not an organization, site or provider role)
userId - the primary key of the user
inherited - whether to include roles inherited from organizations, sites, etc.
Returns:
true if the user has the role; false otherwise
Throws:
PortalException

hasRoleUser

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasRoleUser(long roleId,
                                                             long userId)

hasRoleUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasRoleUsers(long roleId)

hasTeamUser

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasTeamUser(long teamId,
                                                             long userId)

hasTeamUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasTeamUsers(long teamId)

hasUserGroupUser

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasUserGroupUser(long userGroupId,
                                                                  long userId)

hasUserGroupUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasUserGroupUsers(long userGroupId)

isPasswordExpired

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean isPasswordExpired(User user)
                          throws PortalException
Returns true if the user's password is expired.

Parameters:
user - the user
Returns:
true if the user's password is expired; false otherwise
Throws:
PortalException

isPasswordExpiringSoon

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean isPasswordExpiringSoon(User user)
                               throws PortalException
Returns true if the password policy is configured to warn the user that his password is expiring and the remaining time until expiration is equal or less than the configured warning time.

Parameters:
user - the user
Returns:
true if the user's password is expiring soon; false otherwise
Throws:
PortalException

loadGetDefaultUser

@Transactional(propagation=SUPPORTS,
               readOnly=true)
User loadGetDefaultUser(long companyId)
                        throws PortalException
Returns the default user for the company.

Parameters:
companyId - the primary key of the company
Returns:
the default user for the company
Throws:
PortalException

search

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> search(long companyId,
                                                           String firstName,
                                                           String middleName,
                                                           String lastName,
                                                           String screenName,
                                                           String emailAddress,
                                                           int status,
                                                           LinkedHashMap<String,Object> params,
                                                           boolean andSearch,
                                                           int start,
                                                           int end,
                                                           OrderByComparator<User> obc)
Returns an ordered range of all the users with the status, and whose first name, middle name, last name, screen name, and email address match the keywords specified for them, without using the indexer. It is preferable to use the indexed version search(long, String, String, String, String, String, int, LinkedHashMap, boolean, int, int, Sort) instead of this method wherever possible for performance reasons.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

Parameters:
companyId - the primary key of the user's company
firstName - the first name keywords (space separated)
middleName - the middle name keywords
lastName - the last name keywords
screenName - the screen name keywords
emailAddress - the email address keywords
status - the workflow status
params - the finder parameters (optionally null). For more information see UserFinder.
andSearch - whether every field must match its keywords, or just one field. For example, "users with the first name 'bob' and last name 'smith'" vs "users with the first name 'bob' or the last name 'smith'".
start - the lower bound of the range of users
end - the upper bound of the range of users (not inclusive)
obc - the comparator to order the users by (optionally null)
Returns:
the matching users
See Also:
UserFinder

search

@Transactional(propagation=SUPPORTS,
               readOnly=true)
Hits search(long companyId,
                                                     String firstName,
                                                     String middleName,
                                                     String lastName,
                                                     String screenName,
                                                     String emailAddress,
                                                     int status,
                                                     LinkedHashMap<String,Object> params,
                                                     boolean andSearch,
                                                     int start,
                                                     int end,
                                                     Sort sort)
Returns an ordered range of all the users with the status, and whose first name, middle name, last name, screen name, and email address match the keywords specified for them, using the indexer. It is preferable to use this method instead of the non-indexed version whenever possible for performance reasons.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

Parameters:
companyId - the primary key of the user's company
firstName - the first name keywords (space separated)
middleName - the middle name keywords
lastName - the last name keywords
screenName - the screen name keywords
emailAddress - the email address keywords
status - the workflow status
params - the indexer parameters (optionally null). For more information see UserIndexer.
andSearch - whether every field must match its keywords, or just one field. For example, "users with the first name 'bob' and last name 'smith'" vs "users with the first name 'bob' or the last name 'smith'".
start - the lower bound of the range of users
end - the upper bound of the range of users (not inclusive)
sort - the field and direction to sort by (optionally null)
Returns:
the matching users
See Also:
UserIndexer

search

@Transactional(propagation=SUPPORTS,
               readOnly=true)
Hits search(long companyId,
                                                     String firstName,
                                                     String middleName,
                                                     String lastName,
                                                     String screenName,
                                                     String emailAddress,
                                                     int status,
                                                     LinkedHashMap<String,Object> params,
                                                     boolean andSearch,
                                                     int start,
                                                     int end,
                                                     Sort[] sorts)

search

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> search(long companyId,
                                                           String keywords,
                                                           int status,
                                                           LinkedHashMap<String,Object> params,
                                                           int start,
                                                           int end,
                                                           OrderByComparator<User> obc)
Returns an ordered range of all the users who match the keywords and status, without using the indexer. It is preferable to use the indexed version search(long, String, int, LinkedHashMap, int, int, Sort) instead of this method wherever possible for performance reasons.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

Parameters:
companyId - the primary key of the user's company
keywords - the keywords (space separated), which may occur in the user's first name, middle name, last name, screen name, or email address
status - the workflow status
params - the finder parameters (optionally null). For more information see UserFinder.
start - the lower bound of the range of users
end - the upper bound of the range of users (not inclusive)
obc - the comparator to order the users by (optionally null)
Returns:
the matching users
See Also:
UserFinder

search

@Transactional(propagation=SUPPORTS,
               readOnly=true)
Hits search(long companyId,
                                                     String keywords,
                                                     int status,
                                                     LinkedHashMap<String,Object> params,
                                                     int start,
                                                     int end,
                                                     Sort sort)
Returns an ordered range of all the users who match the keywords and status, using the indexer. It is preferable to use this method instead of the non-indexed version whenever possible for performance reasons.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

Parameters:
companyId - the primary key of the user's company
keywords - the keywords (space separated), which may occur in the user's first name, middle name, last name, screen name, or email address
status - the workflow status
params - the indexer parameters (optionally null). For more information see UserIndexer.
start - the lower bound of the range of users
end - the upper bound of the range of users (not inclusive)
sort - the field and direction to sort by (optionally null)
Returns:
the matching users
See Also:
UserIndexer

search

@Transactional(propagation=SUPPORTS,
               readOnly=true)
Hits search(long companyId,
                                                     String keywords,
                                                     int status,
                                                     LinkedHashMap<String,Object> params,
                                                     int start,
                                                     int end,
                                                     Sort[] sorts)

searchCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int searchCount(long companyId,
                                                         String firstName,
                                                         String middleName,
                                                         String lastName,
                                                         String screenName,
                                                         String emailAddress,
                                                         int status,
                                                         LinkedHashMap<String,Object> params,
                                                         boolean andSearch)
Returns the number of users with the status, and whose first name, middle name, last name, screen name, and email address match the keywords specified for them.

Parameters:
companyId - the primary key of the user's company
firstName - the first name keywords (space separated)
middleName - the middle name keywords
lastName - the last name keywords
screenName - the screen name keywords
emailAddress - the email address keywords
status - the workflow status
params - the finder parameters (optionally null). For more information see UserFinder.
andSearch - whether every field must match its keywords, or just one field. For example, "users with the first name 'bob' and last name 'smith'" vs "users with the first name 'bob' or the last name 'smith'".
Returns:
the number of matching users

searchCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int searchCount(long companyId,
                                                         String keywords,
                                                         int status,
                                                         LinkedHashMap<String,Object> params)
Returns the number of users who match the keywords and status.

Parameters:
companyId - the primary key of the user's company
keywords - the keywords (space separated), which may occur in the user's first name, middle name, last name, screen name, or email address
status - the workflow status
params - the finder parameters (optionally null). For more information see UserFinder.
Returns:
the number matching users

searchCounts

@Transactional(propagation=SUPPORTS,
               readOnly=true)
Map<Long,Integer> searchCounts(long companyId,
                                                                        int status,
                                                                        long[] groupIds)

searchSocial

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> searchSocial(long companyId,
                                                                 long[] groupIds,
                                                                 String keywords,
                                                                 int start,
                                                                 int end)

searchSocial

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> searchSocial(long[] groupIds,
                                                                 long userId,
                                                                 int[] socialRelationTypes,
                                                                 String keywords,
                                                                 int start,
                                                                 int end)
                        throws PortalException
Throws:
PortalException

searchSocial

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> searchSocial(long userId,
                                                                 int[] socialRelationTypes,
                                                                 String keywords,
                                                                 int start,
                                                                 int end)
                        throws PortalException
Throws:
PortalException

searchUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
BaseModelSearchResult<User> searchUsers(long companyId,
                                                                                 String firstName,
                                                                                 String middleName,
                                                                                 String lastName,
                                                                                 String screenName,
                                                                                 String emailAddress,
                                                                                 int status,
                                                                                 LinkedHashMap<String,Object> params,
                                                                                 boolean andSearch,
                                                                                 int start,
                                                                                 int end,
                                                                                 Sort sort)
                                        throws PortalException
Throws:
PortalException

searchUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
BaseModelSearchResult<User> searchUsers(long companyId,
                                                                                 String firstName,
                                                                                 String middleName,
                                                                                 String lastName,
                                                                                 String screenName,
                                                                                 String emailAddress,
                                                                                 int status,
                                                                                 LinkedHashMap<String,Object> params,
                                                                                 boolean andSearch,
                                                                                 int start,
                                                                                 int end,
                                                                                 Sort[] sorts)
                                        throws PortalException
Throws:
PortalException

searchUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
BaseModelSearchResult<User> searchUsers(long companyId,
                                                                                 String keywords,
                                                                                 int status,
                                                                                 LinkedHashMap<String,Object> params,
                                                                                 int start,
                                                                                 int end,
                                                                                 Sort sort)
                                        throws PortalException
Throws:
PortalException

searchUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
BaseModelSearchResult<User> searchUsers(long companyId,
                                                                                 String keywords,
                                                                                 int status,
                                                                                 LinkedHashMap<String,Object> params,
                                                                                 int start,
                                                                                 int end,
                                                                                 Sort[] sorts)
                                        throws PortalException
Throws:
PortalException

sendEmailAddressVerification

void sendEmailAddressVerification(User user,
                                  String emailAddress,
                                  ServiceContext serviceContext)
                                  throws PortalException
Sends an email address verification to the user.

Parameters:
user - the verification email recipient
emailAddress - the recipient's email address
serviceContext - the service context to be applied. Must set the portal URL, main path, primary key of the layout, remote address, remote host, and agent for the user.
Throws:
PortalException

sendPassword

boolean sendPassword(long companyId,
                     String emailAddress,
                     String fromName,
                     String fromAddress,
                     String subject,
                     String body,
                     ServiceContext serviceContext)
                     throws PortalException
Sends the password email to the user with the email address. The content of this email can be specified in portal.properties with the admin.email.password keys.

Parameters:
companyId - the primary key of the user's company
emailAddress - the user's email address
fromName - the name of the individual that the email should be from
fromAddress - the address of the individual that the email should be from
subject - the email subject. If null, the subject specified in portal.properties will be used.
body - the email body. If null, the body specified in portal.properties will be used.
serviceContext - the service context to be applied
Throws:
PortalException

sendPasswordByEmailAddress

boolean sendPasswordByEmailAddress(long companyId,
                                   String emailAddress)
                                   throws PortalException
Sends a password notification email to the user matching the email address. The portal's settings determine whether a password is sent explicitly or whether a link for resetting the user's password is sent. The method sends the email asynchronously and returns before the email is sent.

The content of the notification email is specified with the admin.email.password portal property keys. They can be overridden via a portal-ext.properties file or modified through the Portal Settings UI.

Parameters:
companyId - the primary key of the user's company
emailAddress - the user's email address
Returns:
true if the notification email includes a new password; false if the notification email only contains a reset link
Throws:
PortalException

sendPasswordByScreenName

boolean sendPasswordByScreenName(long companyId,
                                 String screenName)
                                 throws PortalException
Sends a password notification email to the user matching the screen name. The portal's settings determine whether a password is sent explicitly or whether a link for resetting the user's password is sent. The method sends the email asynchronously and returns before the email is sent.

The content of the notification email is specified with the admin.email.password portal property keys. They can be overridden via a portal-ext.properties file or modified through the Portal Settings UI.

Parameters:
companyId - the primary key of the user's company
screenName - the user's screen name
Returns:
true if the notification email includes a new password; false if the notification email only contains a reset link
Throws:
PortalException

sendPasswordByUserId

boolean sendPasswordByUserId(long userId)
                             throws PortalException
Sends a password notification email to the user matching the ID. The portal's settings determine whether a password is sent explicitly or whether a link for resetting the user's password is sent. The method sends the email asynchronously and returns before the email is sent.

The content of the notification email is specified with the admin.email.password portal property keys. They can be overridden via a portal-ext.properties file or modified through the Portal Settings UI.

Parameters:
userId - the user's primary key
Returns:
true if the notification email includes a new password; false if the notification email only contains a reset link
Throws:
PortalException

setGroupUsers

void setGroupUsers(long groupId,
                   long[] userIds)

setOrganizationUsers

void setOrganizationUsers(long organizationId,
                          long[] userIds)

setRoleUsers

void setRoleUsers(long roleId,
                  long[] userIds)
                  throws PortalException
Throws:
PortalException

setTeamUsers

void setTeamUsers(long teamId,
                  long[] userIds)

setUserGroupUsers

void setUserGroupUsers(long userGroupId,
                       long[] userIds)
                       throws PortalException
Throws:
PortalException

unsetGroupTeamsUsers

void unsetGroupTeamsUsers(long groupId,
                          long[] userIds)
                          throws PortalException
Removes the users from the teams of a group.

Parameters:
groupId - the primary key of the group
userIds - the primary keys of the users
Throws:
PortalException

unsetGroupUsers

void unsetGroupUsers(long groupId,
                     long[] userIds,
                     ServiceContext serviceContext)
                     throws PortalException
Removes the users from the group.

Parameters:
groupId - the primary key of the group
userIds - the primary keys of the users
serviceContext - the service context to be applied (optionally null)
Throws:
PortalException

unsetOrganizationUsers

void unsetOrganizationUsers(long organizationId,
                            long[] userIds)
                            throws PortalException
Removes the users from the organization.

Parameters:
organizationId - the primary key of the organization
userIds - the primary keys of the users
Throws:
PortalException

unsetPasswordPolicyUsers

void unsetPasswordPolicyUsers(long passwordPolicyId,
                              long[] userIds)
Removes the users from the password policy.

Parameters:
passwordPolicyId - the primary key of the password policy
userIds - the primary keys of the users

unsetRoleUsers

void unsetRoleUsers(long roleId,
                    long[] userIds)
                    throws PortalException
Removes the users from the role.

Parameters:
roleId - the primary key of the role
userIds - the primary keys of the users
Throws:
PortalException

unsetRoleUsers

void unsetRoleUsers(long roleId,
                    List<User> users)
                    throws PortalException
Removes the users from the role.

Parameters:
roleId - the primary key of the role
users - the users
Throws:
PortalException

unsetTeamUsers

void unsetTeamUsers(long teamId,
                    long[] userIds)
                    throws PortalException
Removes the users from the team.

Parameters:
teamId - the primary key of the team
userIds - the primary keys of the users
Throws:
PortalException

unsetUserGroupUsers

void unsetUserGroupUsers(long userGroupId,
                         long[] userIds)
                         throws PortalException
Removes the users from the user group.

Parameters:
userGroupId - the primary key of the user group
userIds - the primary keys of the users
Throws:
PortalException

updateAgreedToTermsOfUse

User updateAgreedToTermsOfUse(long userId,
                              boolean agreedToTermsOfUse)
                              throws PortalException
Updates whether the user has agreed to the terms of use.

Parameters:
userId - the primary key of the user
agreedToTermsOfUse - whether the user has agreet to the terms of use
Returns:
the user
Throws:
PortalException

updateAsset

void updateAsset(long userId,
                 User user,
                 long[] assetCategoryIds,
                 String[] assetTagNames)
                 throws PortalException
Updates the user's asset with the new asset categories and tag names, removing and adding asset categories and tag names as necessary.

Parameters:
userId - the primary key of the user
user - ID the primary key of the user
assetCategoryIds - the primary key's of the new asset categories
assetTagNames - the new asset tag names
Throws:
PortalException

updateCreateDate

User updateCreateDate(long userId,
                      Date createDate)
                      throws PortalException
Updates the user's creation date.

Parameters:
userId - the primary key of the user
createDate - the new creation date
Returns:
the user
Throws:
PortalException

updateEmailAddress

User updateEmailAddress(long userId,
                        String password,
                        String emailAddress1,
                        String emailAddress2)
                        throws PortalException
Updates the user's email address.

Parameters:
userId - the primary key of the user
password - the user's password
emailAddress1 - the user's new email address
emailAddress2 - the user's new email address confirmation
Returns:
the user
Throws:
PortalException

updateEmailAddress

User updateEmailAddress(long userId,
                        String password,
                        String emailAddress1,
                        String emailAddress2,
                        ServiceContext serviceContext)
                        throws PortalException
Updates the user's email address or sends verification email.

Parameters:
userId - the primary key of the user
password - the user's password
emailAddress1 - the user's new email address
emailAddress2 - the user's new email address confirmation
serviceContext - the service context to be applied. Must set the portal URL, main path, primary key of the layout, remote address, remote host, and agent for the user.
Returns:
the user
Throws:
PortalException

updateEmailAddressVerified

User updateEmailAddressVerified(long userId,
                                boolean emailAddressVerified)
                                throws PortalException
Updates whether the user has verified email address.

Parameters:
userId - the primary key of the user
emailAddressVerified - whether the user has verified email address
Returns:
the user
Throws:
PortalException

updateFacebookId

User updateFacebookId(long userId,
                      long facebookId)
                      throws PortalException
Updates the user's Facebook ID.

Parameters:
userId - the primary key of the user
facebookId - the user's new Facebook ID
Returns:
the user
Throws:
PortalException

updateGroups

void updateGroups(long userId,
                  long[] newGroupIds,
                  ServiceContext serviceContext)
                  throws PortalException
Sets the groups the user is in, removing and adding groups as necessary.

Parameters:
userId - the primary key of the user
newGroupIds - the primary keys of the groups
serviceContext - the service context to be applied (optionally null)
Throws:
PortalException

updateIncompleteUser

User updateIncompleteUser(long creatorUserId,
                          long companyId,
                          boolean autoPassword,
                          String password1,
                          String password2,
                          boolean autoScreenName,
                          String screenName,
                          String emailAddress,
                          long facebookId,
                          String openId,
                          Locale locale,
                          String firstName,
                          String middleName,
                          String lastName,
                          long prefixId,
                          long suffixId,
                          boolean male,
                          int birthdayMonth,
                          int birthdayDay,
                          int birthdayYear,
                          String jobTitle,
                          boolean updateUserInformation,
                          boolean sendEmail,
                          ServiceContext serviceContext)
                          throws PortalException
Updates a user account that was automatically created when a guest user participated in an action (e.g. posting a comment) and only provided his name and email address.

Parameters:
creatorUserId - the primary key of the creator
companyId - the primary key of the user's company
autoPassword - whether a password should be automatically generated for the user
password1 - the user's password
password2 - the user's password confirmation
autoScreenName - whether a screen name should be automatically generated for the user
screenName - the user's screen name
emailAddress - the user's email address
facebookId - the user's facebook ID
openId - the user's OpenID
locale - the user's locale
firstName - the user's first name
middleName - the user's middle name
lastName - the user's last name
prefixId - the user's name prefix ID
suffixId - the user's name suffix ID
male - whether the user is male
birthdayMonth - the user's birthday month (0-based, meaning 0 for January)
birthdayDay - the user's birthday day
birthdayYear - the user's birthday year
jobTitle - the user's job title
updateUserInformation - whether to update the user's information
sendEmail - whether to send the user an email notification about their new account
serviceContext - the service context to be applied (optionally null). Can set expando bridge attributes for the user.
Returns:
the user
Throws:
PortalException

updateJobTitle

User updateJobTitle(long userId,
                    String jobTitle)
                    throws PortalException
Updates the user's job title.

Parameters:
userId - the primary key of the user
jobTitle - the user's job title
Returns:
the user
Throws:
PortalException

updateLastLogin

User updateLastLogin(long userId,
                     String loginIP)
                     throws PortalException
Updates the user's last login with the current time and the IP address.

Parameters:
userId - the primary key of the user
loginIP - the IP address the user logged in from
Returns:
the user
Throws:
PortalException

updateLockout

User updateLockout(User user,
                   boolean lockout)
                   throws PortalException
Updates whether the user is locked out from logging in.

Parameters:
user - the user
lockout - whether the user is locked out
Returns:
the user
Throws:
PortalException

updateLockoutByEmailAddress

User updateLockoutByEmailAddress(long companyId,
                                 String emailAddress,
                                 boolean lockout)
                                 throws PortalException
Updates whether the user is locked out from logging in.

Parameters:
companyId - the primary key of the user's company
emailAddress - the user's email address
lockout - whether the user is locked out
Returns:
the user
Throws:
PortalException

updateLockoutById

User updateLockoutById(long userId,
                       boolean lockout)
                       throws PortalException
Updates whether the user is locked out from logging in.

Parameters:
userId - the primary key of the user
lockout - whether the user is locked out
Returns:
the user
Throws:
PortalException

updateLockoutByScreenName

User updateLockoutByScreenName(long companyId,
                               String screenName,
                               boolean lockout)
                               throws PortalException
Updates whether the user is locked out from logging in.

Parameters:
companyId - the primary key of the user's company
screenName - the user's screen name
lockout - whether the user is locked out
Returns:
the user
Throws:
PortalException

updateModifiedDate

User updateModifiedDate(long userId,
                        Date modifiedDate)
                        throws PortalException
Updates the user's modified date.

Parameters:
userId - the primary key of the user
modifiedDate - the new modified date
Returns:
the user
Throws:
PortalException

updateOpenId

User updateOpenId(long userId,
                  String openId)
                  throws PortalException
Updates the user's OpenID.

Parameters:
userId - the primary key of the user
openId - the new OpenID
Returns:
the user
Throws:
PortalException

updateOrganizations

void updateOrganizations(long userId,
                         long[] newOrganizationIds,
                         ServiceContext serviceContext)
                         throws PortalException
Sets the organizations that the user is in, removing and adding organizations as necessary.

Parameters:
userId - the primary key of the user
newOrganizationIds - the primary keys of the organizations
serviceContext - the service context to be applied. Must set whether user indexing is enabled.
Throws:
PortalException

updatePassword

User updatePassword(long userId,
                    String password1,
                    String password2,
                    boolean passwordReset)
                    throws PortalException
Updates the user's password without tracking or validation of the change.

Parameters:
userId - the primary key of the user
password1 - the user's new password
password2 - the user's new password confirmation
passwordReset - whether the user should be asked to reset their password the next time they log in
Returns:
the user
Throws:
PortalException

updatePassword

User updatePassword(long userId,
                    String password1,
                    String password2,
                    boolean passwordReset,
                    boolean silentUpdate)
                    throws PortalException
Updates the user's password, optionally with tracking and validation of the change.

Parameters:
userId - the primary key of the user
password1 - the user's new password
password2 - the user's new password confirmation
passwordReset - whether the user should be asked to reset their password the next time they login
silentUpdate - whether the password should be updated without being tracked, or validated. Primarily used for password imports.
Returns:
the user
Throws:
PortalException

updatePasswordManually

User updatePasswordManually(long userId,
                            String password,
                            boolean passwordEncrypted,
                            boolean passwordReset,
                            Date passwordModifiedDate)
                            throws PortalException
Updates the user's password with manually input information. This method should only be used when performing maintenance.

Parameters:
userId - the primary key of the user
password - the user's new password
passwordEncrypted - the user's new encrypted password
passwordReset - whether the user should be asked to reset their password the next time they login
passwordModifiedDate - the new password modified date
Returns:
the user
Throws:
PortalException

updatePasswordReset

User updatePasswordReset(long userId,
                         boolean passwordReset)
                         throws PortalException
Updates whether the user should be asked to reset their password the next time they login.

Parameters:
userId - the primary key of the user
passwordReset - whether the user should be asked to reset their password the next time they login
Returns:
the user
Throws:
PortalException

updatePortrait

User updatePortrait(long userId,
                    byte[] bytes)
                    throws PortalException
Updates the user's portrait image.

Parameters:
userId - the primary key of the user
bytes - the new portrait image data
Returns:
the user
Throws:
PortalException

updateReminderQuery

User updateReminderQuery(long userId,
                         String question,
                         String answer)
                         throws PortalException
Updates the user's password reset question and answer.

Parameters:
userId - the primary key of the user
question - the user's new password reset question
answer - the user's new password reset answer
Returns:
the user
Throws:
PortalException

updateScreenName

User updateScreenName(long userId,
                      String screenName)
                      throws PortalException
Updates the user's screen name.

Parameters:
userId - the primary key of the user
screenName - the user's new screen name
Returns:
the user
Throws:
PortalException

updateStatus

@Deprecated
User updateStatus(long userId,
                             int status)
                  throws PortalException
Deprecated. As of 7.0.0, replaced by updateStatus(long, int, ServiceContext)

Updates the user's workflow status.

Parameters:
userId - the primary key of the user
status - the user's new workflow status
Returns:
the user
Throws:
PortalException

updateStatus

User updateStatus(long userId,
                  int status,
                  ServiceContext serviceContext)
                  throws PortalException
Updates the user's workflow status.

Parameters:
userId - the primary key of the user
status - the user's new workflow status
serviceContext - the service context to be applied. You can specify an unencrypted custom password (used by an LDAP listener) for the user via attribute passwordUnencrypted.
Returns:
the user
Throws:
PortalException

updateUser

@Indexable(type=REINDEX)
User updateUser(User user)
Updates the user in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

Parameters:
user - the user
Returns:
the user that was updated

updateUser

@Deprecated
User updateUser(long userId,
                           String oldPassword,
                           String newPassword1,
                           String newPassword2,
                           boolean passwordReset,
                           String reminderQueryQuestion,
                           String reminderQueryAnswer,
                           String screenName,
                           String emailAddress,
                           long facebookId,
                           String openId,
                           String languageId,
                           String timeZoneId,
                           String greeting,
                           String comments,
                           String firstName,
                           String middleName,
                           String lastName,
                           long prefixId,
                           long suffixId,
                           boolean male,
                           int birthdayMonth,
                           int birthdayDay,
                           int birthdayYear,
                           String smsSn,
                           String facebookSn,
                           String jabberSn,
                           String skypeSn,
                           String twitterSn,
                           String jobTitle,
                           long[] groupIds,
                           long[] organizationIds,
                           long[] roleIds,
                           List<UserGroupRole> userGroupRoles,
                           long[] userGroupIds,
                           ServiceContext serviceContext)
                throws PortalException
Deprecated. As of 7.0.0, replaced by #updateUser(long, String, String, String, boolean, String, String, String, String, long, String, boolean, byte[], String, String, String, String, String, String, String, int, int, boolean, int, int, int, String, String, String, String, String, String, String, String, String, String, String, long[], long[], long[], List, long[], ServiceContext)

Updates the user.

Parameters:
userId - the primary key of the user
oldPassword - the user's old password
newPassword1 - the user's new password (optionally null)
newPassword2 - the user's new password confirmation (optionally null)
passwordReset - whether the user should be asked to reset their password the next time they login
reminderQueryQuestion - the user's new password reset question
reminderQueryAnswer - the user's new password reset answer
screenName - the user's new screen name
emailAddress - the user's new email address
facebookId - the user's new Facebook ID
openId - the user's new OpenID
languageId - the user's new language ID
timeZoneId - the user's new time zone ID
greeting - the user's new greeting
comments - the user's new comments
firstName - the user's new first name
middleName - the user's new middle name
lastName - the user's new last name
prefixId - the user's new name prefix ID
suffixId - the user's new name suffix ID
male - whether user is male
birthdayMonth - the user's new birthday month (0-based, meaning 0 for January)
birthdayDay - the user's new birthday day
birthdayYear - the user's birthday year
smsSn - the user's new SMS screen name
facebookSn - the user's new Facebook screen name
jabberSn - the user's new Jabber screen name
skypeSn - the user's new Skype screen name
twitterSn - the user's new Twitter screen name
jobTitle - the user's new job title
groupIds - the primary keys of the user's groups
organizationIds - the primary keys of the user's organizations
roleIds - the primary keys of the user's roles
userGroupRoles - the user user's group roles
userGroupIds - the primary keys of the user's user groups
serviceContext - the service context to be applied (optionally null). Can set the UUID (with the uuid attribute), asset category IDs, asset tag names, and expando bridge attributes for the user.
Returns:
the user
Throws:
PortalException

updateUser

User updateUser(long userId,
                String oldPassword,
                String newPassword1,
                String newPassword2,
                boolean passwordReset,
                String reminderQueryQuestion,
                String reminderQueryAnswer,
                String screenName,
                String emailAddress,
                long facebookId,
                String openId,
                boolean portrait,
                byte[] portraitBytes,
                String languageId,
                String timeZoneId,
                String greeting,
                String comments,
                String firstName,
                String middleName,
                String lastName,
                long prefixId,
                long suffixId,
                boolean male,
                int birthdayMonth,
                int birthdayDay,
                int birthdayYear,
                String smsSn,
                String facebookSn,
                String jabberSn,
                String skypeSn,
                String twitterSn,
                String jobTitle,
                long[] groupIds,
                long[] organizationIds,
                long[] roleIds,
                List<UserGroupRole> userGroupRoles,
                long[] userGroupIds,
                ServiceContext serviceContext)
                throws PortalException
Updates the user.

Parameters:
userId - the primary key of the user
oldPassword - the user's old password
newPassword1 - the user's new password (optionally null)
newPassword2 - the user's new password confirmation (optionally null)
passwordReset - whether the user should be asked to reset their password the next time they login
reminderQueryQuestion - the user's new password reset question
reminderQueryAnswer - the user's new password reset answer
screenName - the user's new screen name
emailAddress - the user's new email address
facebookId - the user's new Facebook ID
openId - the user's new OpenID
portrait - whether to update the user's portrait image
portraitBytes - the new portrait image data
languageId - the user's new language ID
timeZoneId - the user's new time zone ID
greeting - the user's new greeting
comments - the user's new comments
firstName - the user's new first name
middleName - the user's new middle name
lastName - the user's new last name
prefixId - the user's new name prefix ID
suffixId - the user's new name suffix ID
male - whether user is male
birthdayMonth - the user's new birthday month (0-based, meaning 0 for January)
birthdayDay - the user's new birthday day
birthdayYear - the user's birthday year
smsSn - the user's new SMS screen name
facebookSn - the user's new Facebook screen name
jabberSn - the user's new Jabber screen name
skypeSn - the user's new Skype screen name
twitterSn - the user's new Twitter screen name
jobTitle - the user's new job title
groupIds - the primary keys of the user's groups
organizationIds - the primary keys of the user's organizations
roleIds - the primary keys of the user's roles
userGroupRoles - the user user's group roles
userGroupIds - the primary keys of the user's user groups
serviceContext - the service context to be applied (optionally null). Can set the UUID (with the uuid attribute), asset category IDs, asset tag names, and expando bridge attributes for the user.
Returns:
the user
Throws:
PortalException

verifyEmailAddress

void verifyEmailAddress(String ticketKey)
                        throws PortalException
Verifies the email address of the ticket.

Parameters:
ticketKey - the ticket key
Throws:
PortalException

Liferay 7.0-ce-b4