Class UserServiceImpl

Object
com.liferay.portal.kernel.service.BaseServiceImpl
com.liferay.portal.service.base.UserServiceBaseImpl
com.liferay.portal.service.impl.UserServiceImpl
All Implemented Interfaces:
com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService, com.liferay.portal.kernel.service.BaseService, com.liferay.portal.kernel.service.UserService

public class UserServiceImpl extends UserServiceBaseImpl
Provides the remote service for accessing, adding, authenticating, deleting, and updating users. Its methods include permission checks.
Author:
Brian Wing Shun Chan, Brian Myunghun Kim, Scott Lee, Jorge Ferrer, Julio Camarero
  • Field Summary

    Fields inherited from class com.liferay.portal.kernel.service.BaseServiceImpl

    ANONYMOUS_NAMES, JRUN_ANONYMOUS, ORACLE_ANONYMOUS, SUN_ANONYMOUS, WEBLOGIC_ANONYMOUS
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addGroupUsers(long groupId, long[] userIds, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Adds the users to the group.
    void
    addOrganizationUsers(long organizationId, long[] userIds)
    Adds the users to the organization.
    com.liferay.portal.kernel.model.User
    addOrUpdateUser(String externalReferenceCode, long creatorUserId, long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, List<com.liferay.portal.kernel.model.Address> addresses, List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses, List<com.liferay.portal.kernel.model.Phone> phones, List<com.liferay.portal.kernel.model.Website> websites, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext)
     
    void
    addPasswordPolicyUsers(long passwordPolicyId, long[] userIds)
    Assigns the password policy to the users, removing any other currently assigned password policies.
    void
    addRoleUsers(long roleId, long[] userIds)
    Adds the users to the role.
    void
    addTeamUsers(long teamId, long[] userIds)
    Adds the users to the team.
    com.liferay.portal.kernel.model.User
    addUser(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 prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    com.liferay.portal.kernel.model.User
    addUser(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 prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, List<com.liferay.portal.kernel.model.Address> addresses, List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses, List<com.liferay.portal.kernel.model.Phone> phones, List<com.liferay.portal.kernel.model.Website> websites, List<com.liferay.announcements.kernel.model.AnnouncementsDelivery> announcementsDelivers, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    com.liferay.portal.kernel.model.User
    addUser(long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Adds a user.
    com.liferay.portal.kernel.model.User
    addUser(long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, List<com.liferay.portal.kernel.model.Address> addresses, List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses, List<com.liferay.portal.kernel.model.Phone> phones, List<com.liferay.portal.kernel.model.Website> websites, List<com.liferay.announcements.kernel.model.AnnouncementsDelivery> announcementsDelivers, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Adds a user with additional parameters.
    void
    addUserGroupUsers(long userGroupId, long[] userIds)
    Adds the users to the user group.
    com.liferay.portal.kernel.model.User
    addUserWithWorkflow(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 prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    com.liferay.portal.kernel.model.User
    addUserWithWorkflow(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 prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, List<com.liferay.portal.kernel.model.Address> addresses, List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses, List<com.liferay.portal.kernel.model.Phone> phones, List<com.liferay.portal.kernel.model.Website> websites, List<com.liferay.announcements.kernel.model.AnnouncementsDelivery> announcementsDelivers, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    com.liferay.portal.kernel.model.User
    addUserWithWorkflow(long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Adds a user with workflow.
    com.liferay.portal.kernel.model.User
    addUserWithWorkflow(long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, List<com.liferay.portal.kernel.model.Address> addresses, List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses, List<com.liferay.portal.kernel.model.Phone> phones, List<com.liferay.portal.kernel.model.Website> websites, List<com.liferay.announcements.kernel.model.AnnouncementsDelivery> announcementsDelivers, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Adds a user with workflow and additional parameters.
    protected void
    checkAddUserPermission(long creatorUserId, long companyId, String emailAddress, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, com.liferay.portal.kernel.service.ServiceContext serviceContext)
     
    protected long[]
    checkGroups(long userId, long[] groupIds)
     
    protected void
    checkMembership(long[] userIds, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds)
     
    protected long[]
    checkOrganizations(long userId, long[] organizationIds)
     
    protected long[]
    checkRoles(long userId, long[] roleIds)
     
    protected long[]
    checkUserGroupIds(long userId, long[] userGroupIds)
     
    protected List<com.liferay.portal.kernel.model.UserGroupRole>
    checkUserGroupRoles(long userId, List<com.liferay.portal.kernel.model.UserGroupRole> userGroupRoles)
     
    void
    deletePortrait(long userId)
    Deletes the user's portrait image.
    void
    deleteRoleUser(long roleId, long userId)
    Removes the user from the role.
    void
    deleteUser(long userId)
    Deletes the user.
    com.liferay.portal.kernel.model.User
    fetchUserByExternalReferenceCode(String externalReferenceCode, long companyId)
     
    List<com.liferay.portal.kernel.model.User>
    getCompanyUsers(long companyId, int start, int end)
     
    int
    getCompanyUsersCount(long companyId)
     
    com.liferay.portal.kernel.model.User
     
    long[]
    getGroupUserIds(long groupId)
    Returns the primary keys of all the users belonging to the group.
    List<com.liferay.portal.kernel.model.User>
    getGroupUsers(long groupId)
    Returns all the users belonging to the group.
    List<com.liferay.portal.kernel.model.User>
    getGroupUsers(long groupId, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.User> orderByComparator)
    Returns the users belonging to a group.
    List<com.liferay.portal.kernel.model.User>
    getGroupUsers(long groupId, int status, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.User> orderByComparator)
    Returns the users belonging to a group.
    int
    getGroupUsersCount(long groupId, int status)
    Returns the number of users with the status belonging to the group.
    List<com.liferay.portal.kernel.model.User>
    getGtCompanyUsers(long gtUserId, long companyId, int size)
     
    List<com.liferay.portal.kernel.model.User>
    getGtOrganizationUsers(long gtUserId, long organizationId, int size)
     
    List<com.liferay.portal.kernel.model.User>
    getGtUserGroupUsers(long gtUserId, long userGroupId, int size)
     
    int
    getOrganizationsAndUserGroupsUsersCount(long[] organizationIds, long[] userGroupIds)
     
    long[]
    getOrganizationUserIds(long organizationId)
    Returns the primary keys of all the users belonging to the organization.
    List<com.liferay.portal.kernel.model.User>
    getOrganizationUsers(long organizationId)
    Returns all the users belonging to the organization.
    List<com.liferay.portal.kernel.model.User>
    getOrganizationUsers(long organizationId, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.User> orderByComparator)
    Returns the users belonging to the organization with the status.
    List<com.liferay.portal.kernel.model.User>
    getOrganizationUsers(long organizationId, int status, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.User> orderByComparator)
    Returns the users belonging to the organization with the status.
    int
    getOrganizationUsersCount(long organizationId, int status)
    Returns the number of users with the status belonging to the organization.
    long[]
    getRoleUserIds(long roleId)
    Returns the primary keys of all the users belonging to the role.
    com.liferay.portal.kernel.model.User
    getUserByEmailAddress(long companyId, String emailAddress)
    Returns the user with the email address.
    com.liferay.portal.kernel.model.User
    getUserByExternalReferenceCode(long companyId, String externalReferenceCode)
    Returns the user with the external reference code.
    com.liferay.portal.kernel.model.User
    getUserByExternalReferenceCode(String externalReferenceCode, long companyId)
     
    com.liferay.portal.kernel.model.User
    getUserById(long userId)
    Returns the user with the primary key.
    com.liferay.portal.kernel.model.User
    getUserByScreenName(long companyId, String screenName)
    Returns the user with the screen name.
    List<com.liferay.portal.kernel.model.User>
    getUserGroupUsers(long userGroupId)
     
    List<com.liferay.portal.kernel.model.User>
    getUserGroupUsers(long userGroupId, int start, int end)
     
    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.
    boolean
    hasGroupUser(long groupId, long userId)
    Returns true if the user is a member of the group.
    boolean
    hasRoleUser(long roleId, long userId)
    Returns true if the user is a member of the role.
    boolean
    hasRoleUser(long companyId, String name, long userId, boolean inherited)
    Returns true if the user has the role with the name, optionally through inheritance.
    protected void
    propagateMembership(long[] userIds, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds)
     
    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
    setRoleUsers(long roleId, long[] userIds)
    Sets the users in the role, removing and adding users to the role as necessary.
    void
    setUserGroupUsers(long userGroupId, long[] userIds)
    Sets the users in the user group, removing and adding users to the user group as necessary.
    void
    unsetGroupTeamsUsers(long groupId, long[] userIds)
    Removes the users from the teams of a group.
    void
    unsetGroupUsers(long groupId, long[] userIds, com.liferay.portal.kernel.service.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, 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.
    com.liferay.portal.kernel.model.User
    updateAgreedToTermsOfUse(long userId, boolean agreedToTermsOfUse)
    Updates the user's response to the terms of use agreement.
    protected void
    updateAnnouncementsDeliveries(long userId, List<com.liferay.announcements.kernel.model.AnnouncementsDelivery> announcementsDeliveries)
     
    com.liferay.portal.kernel.model.User
    updateEmailAddress(long userId, String password, String emailAddress1, String emailAddress2, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Updates the user's email address.
    com.liferay.portal.kernel.model.User
    updateExternalReferenceCode(long userId, String externalReferenceCode)
     
    com.liferay.portal.kernel.model.User
    updateExternalReferenceCode(com.liferay.portal.kernel.model.User user, String externalReferenceCode)
     
    com.liferay.portal.kernel.model.User
    updateIncompleteUser(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 prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, boolean updateUserInformation, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Deprecated.
    As of Athanasius (7.3.x), replaced by #updateIncompleteUser(long, long, boolean, String, String, boolean, String, String, Locale, String, String, String, long, long, boolean, int, int, int, String, boolean, boolean, ServiceContext)
    com.liferay.portal.kernel.model.User
    updateIncompleteUser(long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, boolean updateUserInformation, boolean sendEmail, com.liferay.portal.kernel.service.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.
    com.liferay.portal.kernel.model.User
    updateLanguageId(long userId, String languageId)
     
    com.liferay.portal.kernel.model.User
    updateLockoutById(long userId, boolean lockout)
    Updates whether the user is locked out from logging in.
    com.liferay.portal.kernel.model.User
    updateOpenId(long userId, String openId)
    Deprecated.
    As of Athanasius (7.3.x), with no direct replacement
    void
    updateOrganizations(long userId, long[] organizationIds, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Sets the organizations that the user is in, removing and adding organizations as necessary.
    com.liferay.portal.kernel.model.User
    updatePassword(long userId, String password1, String password2, boolean passwordReset)
    Updates the user's password without tracking or validation of the change.
    com.liferay.portal.kernel.model.User
    updatePortrait(long userId, byte[] bytes)
    Updates the user's portrait image.
    com.liferay.portal.kernel.model.User
    updateReminderQuery(long userId, String question, String answer)
    Updates the user's password reset question and answer.
    com.liferay.portal.kernel.model.User
    updateScreenName(long userId, String screenName)
    Updates the user's screen name.
    com.liferay.portal.kernel.model.User
    updateStatus(long userId, int status, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Updates the user's workflow status.
    com.liferay.portal.kernel.model.User
    updateStatus(com.liferay.portal.kernel.model.User user, int status, com.liferay.portal.kernel.service.ServiceContext serviceContext)
     
    com.liferay.portal.kernel.model.User
    updateUser(long userId, String oldPassword, String newPassword1, String newPassword2, boolean passwordReset, String reminderQueryQuestion, String reminderQueryAnswer, String screenName, String emailAddress, boolean hasPortrait, byte[] portraitBytes, String languageId, String timeZoneId, String greeting, String comments, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, 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<com.liferay.portal.kernel.model.UserGroupRole> userGroupRoles, long[] userGroupIds, List<com.liferay.portal.kernel.model.Address> addresses, List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses, List<com.liferay.portal.kernel.model.Phone> phones, List<com.liferay.portal.kernel.model.Website> websites, List<com.liferay.announcements.kernel.model.AnnouncementsDelivery> announcementsDelivers, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Updates the user with additional parameters.
    com.liferay.portal.kernel.model.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 hasPortrait, byte[] portraitBytes, String languageId, String timeZoneId, String greeting, String comments, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, 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<com.liferay.portal.kernel.model.UserGroupRole> userGroupRoles, long[] userGroupIds, List<com.liferay.portal.kernel.model.Address> addresses, List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses, List<com.liferay.portal.kernel.model.Phone> phones, List<com.liferay.portal.kernel.model.Website> websites, List<com.liferay.announcements.kernel.model.AnnouncementsDelivery> announcementsDelivers, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    com.liferay.portal.kernel.model.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 prefixListTypeId, long suffixListTypeId, 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<com.liferay.portal.kernel.model.UserGroupRole> userGroupRoles, long[] userGroupIds, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    com.liferay.portal.kernel.model.User
    updateUser(long userId, String oldPassword, String newPassword1, String newPassword2, boolean passwordReset, String reminderQueryQuestion, String reminderQueryAnswer, String screenName, String emailAddress, String languageId, String timeZoneId, String greeting, String comments, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, 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<com.liferay.portal.kernel.model.UserGroupRole> userGroupRoles, long[] userGroupIds, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Updates the user.
    protected void
    validateEmailAddress(com.liferay.portal.kernel.model.User user, String emailAddress)
     
    protected void
    validateOrganizationUsers(long[] userIds)
     
    protected void
    validateUpdatePermission(com.liferay.portal.kernel.model.User user, String screenName, String emailAddress, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, int birthdayMonth, int birthdayDay, int birthdayYear, boolean male, String jobTitle)
     
    protected void
    validateUserIds(long[] userIds)
     

    Methods inherited from class com.liferay.portal.kernel.service.BaseServiceImpl

    getClassLoader, getGuestOrUser, getGuestOrUserId, getPermissionChecker, getUser, getUserId

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • UserServiceImpl

      public UserServiceImpl()
  • Method Details

    • addGroupUsers

      public void addGroupUsers(long groupId, long[] userIds, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Adds the users to 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:
      com.liferay.portal.kernel.exception.PortalException
    • addOrganizationUsers

      public void addOrganizationUsers(long organizationId, long[] userIds) throws com.liferay.portal.kernel.exception.PortalException
      Adds the users to the organization.
      Parameters:
      organizationId - the primary key of the organization
      userIds - the primary keys of the users
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • addOrUpdateUser

      public com.liferay.portal.kernel.model.User addOrUpdateUser(String externalReferenceCode, long creatorUserId, long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, List<com.liferay.portal.kernel.model.Address> addresses, List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses, List<com.liferay.portal.kernel.model.Phone> phones, List<com.liferay.portal.kernel.model.Website> websites, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • addPasswordPolicyUsers

      public void addPasswordPolicyUsers(long passwordPolicyId, long[] userIds) throws com.liferay.portal.kernel.exception.PortalException
      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
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • addRoleUsers

      public void addRoleUsers(long roleId, long[] userIds) throws com.liferay.portal.kernel.exception.PortalException
      Adds the users to the role.
      Parameters:
      roleId - the primary key of the role
      userIds - the primary keys of the users
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • addTeamUsers

      public void addTeamUsers(long teamId, long[] userIds) throws com.liferay.portal.kernel.exception.PortalException
      Adds the users to the team.
      Parameters:
      teamId - the primary key of the team
      userIds - the primary keys of the users
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • addUser

      public com.liferay.portal.kernel.model.User addUser(long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.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:
      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
      locale - the user's locale
      firstName - the user's first name
      middleName - the user's middle name
      lastName - the user's last name
      prefixListTypeId - the user's name prefix ID
      suffixListTypeId - 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:
      com.liferay.portal.kernel.exception.PortalException
    • addUser

      public com.liferay.portal.kernel.model.User addUser(long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, List<com.liferay.portal.kernel.model.Address> addresses, List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses, List<com.liferay.portal.kernel.model.Phone> phones, List<com.liferay.portal.kernel.model.Website> websites, List<com.liferay.announcements.kernel.model.AnnouncementsDelivery> announcementsDelivers, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Adds a user with additional parameters.

      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:
      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
      locale - the user's locale
      firstName - the user's first name
      middleName - the user's middle name
      lastName - the user's last name
      prefixListTypeId - the user's name prefix ID
      suffixListTypeId - 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
      addresses - the user's addresses
      emailAddresses - the user's email addresses
      phones - the user's phone numbers
      websites - the user's websites
      announcementsDelivers - the announcements deliveries
      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:
      com.liferay.portal.kernel.exception.PortalException
    • addUser

      @Deprecated public com.liferay.portal.kernel.model.User addUser(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 prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.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:
      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
      prefixListTypeId - the user's name prefix ID
      suffixListTypeId - 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:
      com.liferay.portal.kernel.exception.PortalException
    • addUser

      @Deprecated public com.liferay.portal.kernel.model.User addUser(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 prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, List<com.liferay.portal.kernel.model.Address> addresses, List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses, List<com.liferay.portal.kernel.model.Phone> phones, List<com.liferay.portal.kernel.model.Website> websites, List<com.liferay.announcements.kernel.model.AnnouncementsDelivery> announcementsDelivers, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Adds a user with additional parameters.

      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:
      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
      prefixListTypeId - the user's name prefix ID
      suffixListTypeId - 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
      addresses - the user's addresses
      emailAddresses - the user's email addresses
      phones - the user's phone numbers
      websites - the user's websites
      announcementsDelivers - the announcements deliveries
      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:
      com.liferay.portal.kernel.exception.PortalException
    • addUserGroupUsers

      public void addUserGroupUsers(long userGroupId, long[] userIds) throws com.liferay.portal.kernel.exception.PortalException
      Adds the users to the user group.
      Parameters:
      userGroupId - the primary key of the user group
      userIds - the primary keys of the users
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • addUserWithWorkflow

      public com.liferay.portal.kernel.model.User addUserWithWorkflow(long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.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:
      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
      locale - the user's locale
      firstName - the user's first name
      middleName - the user's middle name
      lastName - the user's last name
      prefixListTypeId - the user's name prefix ID
      suffixListTypeId - 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:
      com.liferay.portal.kernel.exception.PortalException
    • addUserWithWorkflow

      public com.liferay.portal.kernel.model.User addUserWithWorkflow(long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, List<com.liferay.portal.kernel.model.Address> addresses, List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses, List<com.liferay.portal.kernel.model.Phone> phones, List<com.liferay.portal.kernel.model.Website> websites, List<com.liferay.announcements.kernel.model.AnnouncementsDelivery> announcementsDelivers, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Adds a user with workflow and additional parameters.

      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:
      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
      locale - the user's locale
      firstName - the user's first name
      middleName - the user's middle name
      lastName - the user's last name
      prefixListTypeId - the user's name prefix ID
      suffixListTypeId - 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
      addresses - the user's addresses
      emailAddresses - the user's email addresses
      phones - the user's phone numbers
      websites - the user's websites
      announcementsDelivers - the announcements deliveries
      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:
      com.liferay.portal.kernel.exception.PortalException
    • addUserWithWorkflow

      @Deprecated public com.liferay.portal.kernel.model.User addUserWithWorkflow(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 prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.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:
      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
      prefixListTypeId - the user's name prefix ID
      suffixListTypeId - 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:
      com.liferay.portal.kernel.exception.PortalException
    • addUserWithWorkflow

      @Deprecated public com.liferay.portal.kernel.model.User addUserWithWorkflow(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 prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, List<com.liferay.portal.kernel.model.Address> addresses, List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses, List<com.liferay.portal.kernel.model.Phone> phones, List<com.liferay.portal.kernel.model.Website> websites, List<com.liferay.announcements.kernel.model.AnnouncementsDelivery> announcementsDelivers, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Adds a user with workflow and additional parameters.

      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:
      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
      prefixListTypeId - the user's name prefix ID
      suffixListTypeId - 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
      addresses - the user's addresses
      emailAddresses - the user's email addresses
      phones - the user's phone numbers
      websites - the user's websites
      announcementsDelivers - the announcements deliveries
      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:
      com.liferay.portal.kernel.exception.PortalException
    • deletePortrait

      public void deletePortrait(long userId) throws com.liferay.portal.kernel.exception.PortalException
      Deletes the user's portrait image.
      Parameters:
      userId - the primary key of the user
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • deleteRoleUser

      public void deleteRoleUser(long roleId, long userId) throws com.liferay.portal.kernel.exception.PortalException
      Removes the user from the role.
      Parameters:
      roleId - the primary key of the role
      userId - the primary key of the user
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • deleteUser

      public void deleteUser(long userId) throws com.liferay.portal.kernel.exception.PortalException
      Deletes the user.
      Parameters:
      userId - the primary key of the user
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • fetchUserByExternalReferenceCode

      public com.liferay.portal.kernel.model.User fetchUserByExternalReferenceCode(String externalReferenceCode, long companyId) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getCompanyUsers

      public List<com.liferay.portal.kernel.model.User> getCompanyUsers(long companyId, int start, int end) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getCompanyUsersCount

      public int getCompanyUsersCount(long companyId) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getCurrentUser

      public com.liferay.portal.kernel.model.User getCurrentUser() throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getGroupUserIds

      public long[] getGroupUserIds(long groupId) throws com.liferay.portal.kernel.exception.PortalException
      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
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getGroupUsers

      public List<com.liferay.portal.kernel.model.User> getGroupUsers(long groupId) throws com.liferay.portal.kernel.exception.PortalException
      Returns all the users belonging to the group.
      Parameters:
      groupId - the primary key of the group
      Returns:
      the users belonging to the group
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getGroupUsers

      public List<com.liferay.portal.kernel.model.User> getGroupUsers(long groupId, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.User> orderByComparator) throws com.liferay.portal.kernel.exception.PortalException
      Returns the users belonging to a group.
      Parameters:
      groupId - the primary key of the group
      status - the workflow status
      start - the lower bound of the range of users
      end - the upper bound of the range of users (not inclusive)
      orderByComparator - the comparator to order the users by (optionally null)
      Returns:
      the matching users
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getGroupUsers

      public List<com.liferay.portal.kernel.model.User> getGroupUsers(long groupId, int status, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.User> orderByComparator) throws com.liferay.portal.kernel.exception.PortalException
      Returns the users belonging to a group.
      Parameters:
      groupId - the primary key of the group
      status - the workflow status
      orderByComparator - the comparator to order the users by (optionally null)
      Returns:
      the matching users
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getGroupUsersCount

      public int getGroupUsersCount(long groupId, int status) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • getGtCompanyUsers

      public List<com.liferay.portal.kernel.model.User> getGtCompanyUsers(long gtUserId, long companyId, int size) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getGtOrganizationUsers

      public List<com.liferay.portal.kernel.model.User> getGtOrganizationUsers(long gtUserId, long organizationId, int size) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getGtUserGroupUsers

      public List<com.liferay.portal.kernel.model.User> getGtUserGroupUsers(long gtUserId, long userGroupId, int size) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getOrganizationsAndUserGroupsUsersCount

      public int getOrganizationsAndUserGroupsUsersCount(long[] organizationIds, long[] userGroupIds) throws com.liferay.portal.kernel.security.auth.PrincipalException
      Throws:
      com.liferay.portal.kernel.security.auth.PrincipalException
    • getOrganizationUserIds

      public long[] getOrganizationUserIds(long organizationId) throws com.liferay.portal.kernel.exception.PortalException
      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
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getOrganizationUsers

      public List<com.liferay.portal.kernel.model.User> getOrganizationUsers(long organizationId) throws com.liferay.portal.kernel.exception.PortalException
      Returns all the users belonging to the organization.
      Parameters:
      organizationId - the primary key of the organization
      Returns:
      users belonging to the organization
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getOrganizationUsers

      public List<com.liferay.portal.kernel.model.User> getOrganizationUsers(long organizationId, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.User> orderByComparator) throws com.liferay.portal.kernel.exception.PortalException
      Returns the users belonging to the organization with the status.
      Parameters:
      organizationId - the primary key of the organization
      status - the workflow status
      start - the lower bound of the range of users
      end - the upper bound of the range of users (not inclusive)
      orderByComparator - the comparator to order the users by (optionally null)
      Returns:
      the matching users
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getOrganizationUsers

      public List<com.liferay.portal.kernel.model.User> getOrganizationUsers(long organizationId, int status, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.User> orderByComparator) throws com.liferay.portal.kernel.exception.PortalException
      Returns the users belonging to the organization with the status.
      Parameters:
      organizationId - the primary key of the organization
      status - the workflow status
      orderByComparator - the comparator to order the users by (optionally null)
      Returns:
      the matching users
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getOrganizationUsersCount

      public int getOrganizationUsersCount(long organizationId, int status) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • getRoleUserIds

      public long[] getRoleUserIds(long roleId) throws com.liferay.portal.kernel.exception.PortalException
      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
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getUserByEmailAddress

      public com.liferay.portal.kernel.model.User getUserByEmailAddress(long companyId, String emailAddress) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • getUserByExternalReferenceCode

      public com.liferay.portal.kernel.model.User getUserByExternalReferenceCode(long companyId, String externalReferenceCode) throws com.liferay.portal.kernel.exception.PortalException
      Returns the user with the external reference code.
      Parameters:
      companyId - the primary key of the user's company
      externalReferenceCode - the user's external reference code
      Returns:
      the user with the external reference code
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getUserByExternalReferenceCode

      public com.liferay.portal.kernel.model.User getUserByExternalReferenceCode(String externalReferenceCode, long companyId) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getUserById

      public com.liferay.portal.kernel.model.User getUserById(long userId) throws com.liferay.portal.kernel.exception.PortalException
      Returns the user with the primary key.
      Parameters:
      userId - the primary key of the user
      Returns:
      the user with the primary key
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getUserByScreenName

      public com.liferay.portal.kernel.model.User getUserByScreenName(long companyId, String screenName) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • getUserGroupUsers

      public List<com.liferay.portal.kernel.model.User> getUserGroupUsers(long userGroupId) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getUserGroupUsers

      public List<com.liferay.portal.kernel.model.User> getUserGroupUsers(long userGroupId, int start, int end) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getUserIdByEmailAddress

      public long getUserIdByEmailAddress(long companyId, String emailAddress) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • getUserIdByScreenName

      public long getUserIdByScreenName(long companyId, String screenName) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • hasGroupUser

      public boolean hasGroupUser(long groupId, long userId) throws com.liferay.portal.kernel.exception.PortalException
      Returns true if the user is a member of the group.
      Parameters:
      groupId - the primary key of the group
      userId - the primary key of the user
      Returns:
      true if the user is a member of the group; false otherwise
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • hasRoleUser

      public boolean hasRoleUser(long roleId, long userId) throws com.liferay.portal.kernel.exception.PortalException
      Returns true if the user is a member of the role.
      Parameters:
      roleId - the primary key of the role
      userId - the primary key of the user
      Returns:
      true if the user is a member of the role; false otherwise
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • hasRoleUser

      public boolean hasRoleUser(long companyId, String name, long userId, boolean inherited) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • sendPasswordByEmailAddress

      @JSONWebService(mode=IGNORE) public boolean sendPasswordByEmailAddress(long companyId, String emailAddress) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • sendPasswordByScreenName

      @JSONWebService(mode=IGNORE) public boolean sendPasswordByScreenName(long companyId, String screenName) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • sendPasswordByUserId

      @JSONWebService(mode=IGNORE) public boolean sendPasswordByUserId(long userId) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • setRoleUsers

      public void setRoleUsers(long roleId, long[] userIds) throws com.liferay.portal.kernel.exception.PortalException
      Sets the users in the role, removing and adding users to the role as necessary.
      Parameters:
      roleId - the primary key of the role
      userIds - the primary keys of the users
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • setUserGroupUsers

      public void setUserGroupUsers(long userGroupId, long[] userIds) throws com.liferay.portal.kernel.exception.PortalException
      Sets the users in the user group, removing and adding users to the user group as necessary.
      Parameters:
      userGroupId - the primary key of the user group
      userIds - the primary keys of the users
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • unsetGroupTeamsUsers

      public void unsetGroupTeamsUsers(long groupId, long[] userIds) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • unsetGroupUsers

      public void unsetGroupUsers(long groupId, long[] userIds, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • unsetOrganizationUsers

      public void unsetOrganizationUsers(long organizationId, long[] userIds) throws com.liferay.portal.kernel.exception.PortalException
      Removes the users from the organization.
      Parameters:
      organizationId - the primary key of the organization
      userIds - the primary keys of the users
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • unsetPasswordPolicyUsers

      public void unsetPasswordPolicyUsers(long passwordPolicyId, long[] userIds) throws com.liferay.portal.kernel.exception.PortalException
      Removes the users from the password policy.
      Parameters:
      passwordPolicyId - the primary key of the password policy
      userIds - the primary keys of the users
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • unsetRoleUsers

      public void unsetRoleUsers(long roleId, long[] userIds) throws com.liferay.portal.kernel.exception.PortalException
      Removes the users from the role.
      Parameters:
      roleId - the primary key of the role
      userIds - the primary keys of the users
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • unsetTeamUsers

      public void unsetTeamUsers(long teamId, long[] userIds) throws com.liferay.portal.kernel.exception.PortalException
      Removes the users from the team.
      Parameters:
      teamId - the primary key of the team
      userIds - the primary keys of the users
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • unsetUserGroupUsers

      public void unsetUserGroupUsers(long userGroupId, long[] userIds) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • updateAgreedToTermsOfUse

      @CTAware(onProduction=true) public com.liferay.portal.kernel.model.User updateAgreedToTermsOfUse(long userId, boolean agreedToTermsOfUse) throws com.liferay.portal.kernel.exception.PortalException
      Updates the user's response to the terms of use agreement.
      Parameters:
      userId - the primary key of the user
      agreedToTermsOfUse - whether the user has agree to the terms of use
      Returns:
      the user
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • updateEmailAddress

      public com.liferay.portal.kernel.model.User updateEmailAddress(long userId, String password, String emailAddress1, String emailAddress2, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.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
      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:
      com.liferay.portal.kernel.exception.PortalException
    • updateExternalReferenceCode

      public com.liferay.portal.kernel.model.User updateExternalReferenceCode(long userId, String externalReferenceCode) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • updateExternalReferenceCode

      public com.liferay.portal.kernel.model.User updateExternalReferenceCode(com.liferay.portal.kernel.model.User user, String externalReferenceCode) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • updateIncompleteUser

      public com.liferay.portal.kernel.model.User updateIncompleteUser(long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, boolean updateUserInformation, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.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:
      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
      locale - the user's locale
      firstName - the user's first name
      middleName - the user's middle name
      lastName - the user's last name
      prefixListTypeId - the user's name prefix ID
      suffixListTypeId - 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 the expando bridge attributes for the user.
      Returns:
      the user
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • updateIncompleteUser

      @Deprecated public com.liferay.portal.kernel.model.User updateIncompleteUser(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 prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, boolean updateUserInformation, boolean sendEmail, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Deprecated.
      As of Athanasius (7.3.x), replaced by #updateIncompleteUser(long, long, boolean, String, String, boolean, String, String, Locale, String, String, String, long, long, boolean, int, int, int, String, boolean, boolean, 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.
      Parameters:
      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
      prefixListTypeId - the user's name prefix ID
      suffixListTypeId - 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 the expando bridge attributes for the user.
      Returns:
      the user
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • updateLanguageId

      public com.liferay.portal.kernel.model.User updateLanguageId(long userId, String languageId) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • updateLockoutById

      public com.liferay.portal.kernel.model.User updateLockoutById(long userId, boolean lockout) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • updateOpenId

      @Deprecated public com.liferay.portal.kernel.model.User updateOpenId(long userId, String openId) throws com.liferay.portal.kernel.exception.PortalException
      Deprecated.
      As of Athanasius (7.3.x), with no direct replacement
      Updates the user's OpenID.
      Parameters:
      userId - the primary key of the user
      openId - the new OpenID
      Returns:
      the user
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • updateOrganizations

      public void updateOrganizations(long userId, long[] organizationIds, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Sets the organizations that the user is in, removing and adding organizations as necessary.
      Parameters:
      userId - the primary key of the user
      organizationIds - the primary keys of the organizations
      serviceContext - the service context to be applied. Must set whether user indexing is enabled.
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • updatePassword

      @CTAware(onProduction=true) public com.liferay.portal.kernel.model.User updatePassword(long userId, String password1, String password2, boolean passwordReset) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • updatePortrait

      public com.liferay.portal.kernel.model.User updatePortrait(long userId, byte[] bytes) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • updateReminderQuery

      @CTAware(onProduction=true) public com.liferay.portal.kernel.model.User updateReminderQuery(long userId, String question, String answer) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • updateScreenName

      public com.liferay.portal.kernel.model.User updateScreenName(long userId, String screenName) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • updateStatus

      public com.liferay.portal.kernel.model.User updateStatus(long userId, int status, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.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:
      com.liferay.portal.kernel.exception.PortalException
    • updateStatus

      public com.liferay.portal.kernel.model.User updateStatus(com.liferay.portal.kernel.model.User user, int status, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • updateUser

      public com.liferay.portal.kernel.model.User updateUser(long userId, String oldPassword, String newPassword1, String newPassword2, boolean passwordReset, String reminderQueryQuestion, String reminderQueryAnswer, String screenName, String emailAddress, boolean hasPortrait, byte[] portraitBytes, String languageId, String timeZoneId, String greeting, String comments, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, 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<com.liferay.portal.kernel.model.UserGroupRole> userGroupRoles, long[] userGroupIds, List<com.liferay.portal.kernel.model.Address> addresses, List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses, List<com.liferay.portal.kernel.model.Phone> phones, List<com.liferay.portal.kernel.model.Website> websites, List<com.liferay.announcements.kernel.model.AnnouncementsDelivery> announcementsDelivers, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Updates the user with additional parameters.
      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
      hasPortrait - if the user has a custom 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
      prefixListTypeId - the user's new name prefix ID
      suffixListTypeId - 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
      addresses - the user's addresses
      emailAddresses - the user's email addresses
      phones - the user's phone numbers
      websites - the user's websites
      announcementsDelivers - the announcements deliveries
      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:
      com.liferay.portal.kernel.exception.PortalException
    • updateUser

      @Deprecated public com.liferay.portal.kernel.model.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 hasPortrait, byte[] portraitBytes, String languageId, String timeZoneId, String greeting, String comments, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, 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<com.liferay.portal.kernel.model.UserGroupRole> userGroupRoles, long[] userGroupIds, List<com.liferay.portal.kernel.model.Address> addresses, List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses, List<com.liferay.portal.kernel.model.Phone> phones, List<com.liferay.portal.kernel.model.Website> websites, List<com.liferay.announcements.kernel.model.AnnouncementsDelivery> announcementsDelivers, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Updates the user with additional parameters.
      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
      hasPortrait - if the user has a custom 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
      prefixListTypeId - the user's new name prefix ID
      suffixListTypeId - 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
      addresses - the user's addresses
      emailAddresses - the user's email addresses
      phones - the user's phone numbers
      websites - the user's websites
      announcementsDelivers - the announcements deliveries
      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:
      com.liferay.portal.kernel.exception.PortalException
    • updateUser

      @Deprecated public com.liferay.portal.kernel.model.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 prefixListTypeId, long suffixListTypeId, 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<com.liferay.portal.kernel.model.UserGroupRole> userGroupRoles, long[] userGroupIds, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.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
      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
      prefixListTypeId - the user's new name prefix ID
      suffixListTypeId - 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:
      com.liferay.portal.kernel.exception.PortalException
    • updateUser

      public com.liferay.portal.kernel.model.User updateUser(long userId, String oldPassword, String newPassword1, String newPassword2, boolean passwordReset, String reminderQueryQuestion, String reminderQueryAnswer, String screenName, String emailAddress, String languageId, String timeZoneId, String greeting, String comments, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, 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<com.liferay.portal.kernel.model.UserGroupRole> userGroupRoles, long[] userGroupIds, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.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
      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
      prefixListTypeId - the user's new name prefix ID
      suffixListTypeId - 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:
      com.liferay.portal.kernel.exception.PortalException
    • checkAddUserPermission

      protected void checkAddUserPermission(long creatorUserId, long companyId, String emailAddress, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • checkGroups

      protected long[] checkGroups(long userId, long[] groupIds) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • checkMembership

      protected void checkMembership(long[] userIds, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • checkOrganizations

      protected long[] checkOrganizations(long userId, long[] organizationIds) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • checkRoles

      protected long[] checkRoles(long userId, long[] roleIds) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • checkUserGroupIds

      protected long[] checkUserGroupIds(long userId, long[] userGroupIds) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • checkUserGroupRoles

      protected List<com.liferay.portal.kernel.model.UserGroupRole> checkUserGroupRoles(long userId, List<com.liferay.portal.kernel.model.UserGroupRole> userGroupRoles) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • propagateMembership

      protected void propagateMembership(long[] userIds, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • updateAnnouncementsDeliveries

      protected void updateAnnouncementsDeliveries(long userId, List<com.liferay.announcements.kernel.model.AnnouncementsDelivery> announcementsDeliveries) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • validateEmailAddress

      protected void validateEmailAddress(com.liferay.portal.kernel.model.User user, String emailAddress) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • validateOrganizationUsers

      protected void validateOrganizationUsers(long[] userIds) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • validateUpdatePermission

      protected void validateUpdatePermission(com.liferay.portal.kernel.model.User user, String screenName, String emailAddress, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, int birthdayMonth, int birthdayDay, int birthdayYear, boolean male, String jobTitle) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • validateUserIds

      protected void validateUserIds(long[] userIds) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException