Liferay 6.1.2-ce-ga3

com.liferay.portal.service
Interface UserService

All Superinterfaces:
BaseService
All Known Implementing Classes:
UserServiceWrapper

@JSONWebService
@Transactional(isolation=PORTAL,
               rollbackFor={PortalException.class,SystemException.class})
public interface UserService
extends BaseService

The interface for the user remote service.

This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.

See Also:
UserServiceUtil, UserServiceBaseImpl, com.liferay.portal.service.impl.UserServiceImpl

Method Summary
 void addGroupUsers(long groupId, long[] userIds, ServiceContext serviceContext)
          Adds the users to the group.
 void addOrganizationUsers(long organizationId, long[] userIds)
          Adds the users to the organization.
 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.
 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, int prefixId, int suffixId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, boolean sendEmail, ServiceContext serviceContext)
          Adds a user.
 User addUser(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, int prefixId, int suffixId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, List<Address> addresses, List<EmailAddress> emailAddresses, List<Phone> phones, List<Website> websites, List<AnnouncementsDelivery> announcementsDelivers, boolean sendEmail, ServiceContext serviceContext)
          Adds a user with additional parameters.
 void addUserGroupUsers(long userGroupId, long[] userIds)
          Adds the users to the user group.
 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, int prefixId, int suffixId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, boolean sendEmail, ServiceContext serviceContext)
          Adds a user with workflow.
 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, int prefixId, int suffixId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, List<Address> addresses, List<EmailAddress> emailAddresses, List<Phone> phones, List<Website> websites, List<AnnouncementsDelivery> announcementsDelivers, boolean sendEmail, ServiceContext serviceContext)
          Adds a user with workflow and additional parameters.
 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.
 String getBeanIdentifier()
          Returns the Spring bean ID for this bean.
 List<User> getCompanyUsers(long companyId, int start, int end)
           
 int getCompanyUsersCount(long companyId)
           
 long getDefaultUserId(long companyId)
          Returns the primary key of the default user for the company.
 long[] getGroupUserIds(long groupId)
          Returns the primary keys of all the users belonging to the group.
 List<User> getGroupUsers(long groupId)
          Returns all the users belonging to the group.
 long[] getOrganizationUserIds(long organizationId)
          Returns the primary keys of all the users belonging to the organization.
 List<User> getOrganizationUsers(long organizationId)
          Returns all the users belonging to the organization.
 long[] getRoleUserIds(long roleId)
          Returns the primary keys of all the users belonging to the role.
 User getUserByEmailAddress(long companyId, String emailAddress)
          Returns the user with the email address.
 User getUserById(long userId)
          Returns the user with the primary key.
 User getUserByScreenName(long companyId, String screenName)
          Returns the user with the screen name.
 List<User> getUserGroupUsers(long userGroupId)
           
 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.
 void setBeanIdentifier(String beanIdentifier)
          Sets the Spring bean ID for this bean.
 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, 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.
 User updateAgreedToTermsOfUse(long userId, boolean agreedToTermsOfUse)
          Updates the user's response to the terms of use agreement.
 User updateEmailAddress(long userId, String password, String emailAddress1, String emailAddress2, ServiceContext serviceContext)
          Updates the user's email address.
 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, int prefixId, int suffixId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, boolean updateUserInformation, boolean sendEmail, ServiceContext serviceContext)
          Updates a user account that was automatically created when a guest user participated in an action (e.g. posting a comment) and only provided his name and email address.
 User updateLockoutById(long userId, boolean lockout)
          Updates whether the user is locked out from logging in.
 User updateOpenId(long userId, String openId)
          Updates the user's OpenID.
 void updateOrganizations(long userId, long[] organizationIds, ServiceContext serviceContext)
          Sets the organizations that the user is in, removing and adding organizations as necessary.
 User updatePassword(long userId, String password1, String password2, boolean passwordReset)
          Updates the user's password without tracking or validation of the change.
 User updatePortrait(long userId, byte[] bytes)
          Updates the user's portrait image.
 User updateReminderQuery(long userId, String question, String answer)
          Updates the user's password reset question and answer.
 User updateScreenName(long userId, String screenName)
          Updates the user's screen name.
 User updateStatus(long userId, int status)
          Updates the user's workflow status.
 User updateUser(long userId, String oldPassword, String newPassword1, String newPassword2, boolean passwordReset, String reminderQueryQuestion, String reminderQueryAnswer, String screenName, String emailAddress, long facebookId, String openId, String languageId, String timeZoneId, String greeting, String comments, String firstName, String middleName, String lastName, int prefixId, int suffixId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String smsSn, String aimSn, String facebookSn, String icqSn, String jabberSn, String msnSn, String mySpaceSn, String skypeSn, String twitterSn, String ymSn, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, List<UserGroupRole> userGroupRoles, long[] userGroupIds, List<Address> addresses, List<EmailAddress> emailAddresses, List<Phone> phones, List<Website> websites, List<AnnouncementsDelivery> announcementsDelivers, ServiceContext serviceContext)
          Updates the user with additional parameters.
 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, int prefixId, int suffixId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String smsSn, String aimSn, String facebookSn, String icqSn, String jabberSn, String msnSn, String mySpaceSn, String skypeSn, String twitterSn, String ymSn, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, List<UserGroupRole> userGroupRoles, long[] userGroupIds, ServiceContext serviceContext)
          Updates the user.
 

Method Detail

getBeanIdentifier

String getBeanIdentifier()
Returns the Spring bean ID for this bean.

Returns:
the Spring bean ID for this bean

setBeanIdentifier

void setBeanIdentifier(String beanIdentifier)
Sets the Spring bean ID for this bean.

Parameters:
beanIdentifier - the Spring bean ID for this bean

addGroupUsers

void addGroupUsers(long groupId,
                   long[] userIds,
                   ServiceContext serviceContext)
                   throws PortalException,
                          SystemException
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:
PortalException - if a group or user with the primary key could not be found, or if the user did not have permission to assign group members
SystemException - if a system exception occurred

addOrganizationUsers

void addOrganizationUsers(long organizationId,
                          long[] userIds)
                          throws PortalException,
                                 SystemException
Adds the users to the organization.

Parameters:
organizationId - the primary key of the organization
userIds - the primary keys of the users
Throws:
PortalException - if an organization or user with the primary key could not be found, if the user did not have permission to assign organization members, or if current user did not have an organization in common with a given user
SystemException - if a system exception occurred

addPasswordPolicyUsers

void addPasswordPolicyUsers(long passwordPolicyId,
                            long[] userIds)
                            throws PortalException,
                                   SystemException
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:
PortalException - if the user did not have permission to assign policy members
SystemException - if a system exception occurred

addRoleUsers

void addRoleUsers(long roleId,
                  long[] userIds)
                  throws PortalException,
                         SystemException
Adds the users to the role.

Parameters:
roleId - the primary key of the role
userIds - the primary keys of the users
Throws:
PortalException - if a role or user with the primary key could not be found or if the user did not have permission to assign role members
SystemException - if a system exception occurred

addTeamUsers

void addTeamUsers(long teamId,
                  long[] userIds)
                  throws PortalException,
                         SystemException
Adds the users to the team.

Parameters:
teamId - the primary key of the team
userIds - the primary keys of the users
Throws:
PortalException - if a team or user with the primary key could not be found or if the user did not have permission to assign team members
SystemException - if a system exception occurred

addUser

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,
             int prefixId,
             int suffixId,
             boolean male,
             int birthdayMonth,
             int birthdayDay,
             int birthdayYear,
             String jobTitle,
             long[] groupIds,
             long[] organizationIds,
             long[] roleIds,
             long[] userGroupIds,
             boolean sendEmail,
             ServiceContext serviceContext)
             throws PortalException,
                    SystemException
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
prefixId - the user's name prefix ID
suffixId - the user's name suffix ID
male - whether the user is male
birthdayMonth - the user's birthday month (0-based, meaning 0 for January)
birthdayDay - the user's birthday day
birthdayYear - the user's birthday year
jobTitle - the user's job title
groupIds - the primary keys of the user's groups
organizationIds - the primary keys of the user's organizations
roleIds - the primary keys of the roles this user possesses
userGroupIds - the primary keys of the user's user groups
sendEmail - whether to send the user an email notification about their new account
serviceContext - the user's service context (optionally null). Can set the universally unique identifier (with the uuid attribute), asset category IDs, asset tag names, and expando bridge attributes for the user.
Returns:
the new user
Throws:
PortalException - if the user's information was invalid, if the creator did not have permission to add users, or if the email address was reserved
SystemException - if a system exception occurred

addUser

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,
             int prefixId,
             int suffixId,
             boolean male,
             int birthdayMonth,
             int birthdayDay,
             int birthdayYear,
             String jobTitle,
             long[] groupIds,
             long[] organizationIds,
             long[] roleIds,
             long[] userGroupIds,
             List<Address> addresses,
             List<EmailAddress> emailAddresses,
             List<Phone> phones,
             List<Website> websites,
             List<AnnouncementsDelivery> announcementsDelivers,
             boolean sendEmail,
             ServiceContext serviceContext)
             throws PortalException,
                    SystemException
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
prefixId - the user's name prefix ID
suffixId - the user's name suffix ID
male - whether the user is male
birthdayMonth - the user's birthday month (0-based, meaning 0 for January)
birthdayDay - the user's birthday day
birthdayYear - the user's birthday year
jobTitle - the user's job title
groupIds - the primary keys of the user's groups
organizationIds - the primary keys of the user's organizations
roleIds - the primary keys of the roles this user possesses
userGroupIds - the primary keys of the user's user groups
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 user's service context (optionally null). Can set the universally unique identifier (with the uuid attribute), asset category IDs, asset tag names, and expando bridge attributes for the user.
Returns:
the new user
Throws:
PortalException - if the user's information was invalid, if the creator did not have permission to add users, if the email address was reserved, or some other portal exception occurred
SystemException - if a system exception occurred

addUserGroupUsers

void addUserGroupUsers(long userGroupId,
                       long[] userIds)
                       throws PortalException,
                              SystemException
Adds the users to the user group.

Parameters:
userGroupId - the primary key of the user group
userIds - the primary keys of the users
Throws:
PortalException - if a user group or user with the primary could could not be found, or if the current user did not have permission to assign group members
SystemException - if a system exception occurred

addUserWithWorkflow

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,
                         int prefixId,
                         int suffixId,
                         boolean male,
                         int birthdayMonth,
                         int birthdayDay,
                         int birthdayYear,
                         String jobTitle,
                         long[] groupIds,
                         long[] organizationIds,
                         long[] roleIds,
                         long[] userGroupIds,
                         boolean sendEmail,
                         ServiceContext serviceContext)
                         throws PortalException,
                                SystemException
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
prefixId - the user's name prefix ID
suffixId - the user's name suffix ID
male - whether the user is male
birthdayMonth - the user's birthday month (0-based, meaning 0 for January)
birthdayDay - the user's birthday day
birthdayYear - the user's birthday year
jobTitle - the user's job title
groupIds - the primary keys of the user's groups
organizationIds - the primary keys of the user's organizations
roleIds - the primary keys of the roles this user possesses
userGroupIds - the primary keys of the user's user groups
sendEmail - whether to send the user an email notification about their new account
serviceContext - the user's service context (optionally null). Can set the universally unique identifier (with the uuid attribute), asset category IDs, asset tag names, and expando bridge attributes for the user.
Returns:
the new user
Throws:
PortalException - if the user's information was invalid, if the creator did not have permission to add users, or if the email address was reserved
SystemException - if a system exception occurred

addUserWithWorkflow

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,
                         int prefixId,
                         int suffixId,
                         boolean male,
                         int birthdayMonth,
                         int birthdayDay,
                         int birthdayYear,
                         String jobTitle,
                         long[] groupIds,
                         long[] organizationIds,
                         long[] roleIds,
                         long[] userGroupIds,
                         List<Address> addresses,
                         List<EmailAddress> emailAddresses,
                         List<Phone> phones,
                         List<Website> websites,
                         List<AnnouncementsDelivery> announcementsDelivers,
                         boolean sendEmail,
                         ServiceContext serviceContext)
                         throws PortalException,
                                SystemException
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
prefixId - the user's name prefix ID
suffixId - the user's name suffix ID
male - whether the user is male
birthdayMonth - the user's birthday month (0-based, meaning 0 for January)
birthdayDay - the user's birthday day
birthdayYear - the user's birthday year
jobTitle - the user's job title
groupIds - the primary keys of the user's groups
organizationIds - the primary keys of the user's organizations
roleIds - the primary keys of the roles this user possesses
userGroupIds - the primary keys of the user's user groups
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 user's service context (optionally null). Can set the universally unique identifier (with the uuid attribute), asset category IDs, asset tag names, and expando bridge attributes for the user.
Returns:
the new user
Throws:
PortalException - if the user's information was invalid, if the creator did not have permission to add users, if the email address was reserved, or some other portal exception occurred
SystemException - if a system exception occurred

deletePortrait

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

Parameters:
userId - the primary key of the user
Throws:
PortalException - if a user with the primary key could not be found, if the user's portrait could not be found, or if the current user did not have permission to update the user
SystemException - if a system exception occurred

deleteRoleUser

void deleteRoleUser(long roleId,
                    long userId)
                    throws PortalException,
                           SystemException
Removes the user from the role.

Parameters:
roleId - the primary key of the role
userId - the primary key of the user
Throws:
PortalException - if a role or user with the primary key could not be found, or if the current user did not have permission to assign role members
SystemException - if a system exception occurred

deleteUser

void deleteUser(long userId)
                throws PortalException,
                       SystemException
Deletes the user.

Parameters:
userId - the primary key of the user
Throws:
PortalException - if a user with the primary key could not be found or if the current user did not have permission to delete the user
SystemException - if a system exception occurred

getCompanyUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getCompanyUsers(long companyId,
                                                                    int start,
                                                                    int end)
                           throws PortalException,
                                  SystemException
Throws:
PortalException
SystemException

getCompanyUsersCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getCompanyUsersCount(long companyId)
                         throws PortalException,
                                SystemException
Throws:
PortalException
SystemException

getDefaultUserId

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

Parameters:
companyId - the primary key of the company
Returns:
the primary key of the default user for the company
Throws:
PortalException - if a default user for the company could not be found
SystemException - if a system exception occurred

getGroupUserIds

@Transactional(propagation=SUPPORTS,
               readOnly=true)
long[] getGroupUserIds(long groupId)
                       throws PortalException,
                              SystemException
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:
PortalException - if the current user did not have permission to view group assignments
SystemException - if a system exception occurred

getGroupUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getGroupUsers(long groupId)
                         throws PortalException,
                                SystemException
Returns all the users belonging to the group.

Parameters:
groupId - the primary key of the group
Returns:
the users belonging to the group
Throws:
PortalException - if the current user did not have permission to view group assignments
SystemException - if a system exception occurred

getOrganizationUserIds

@Transactional(propagation=SUPPORTS,
               readOnly=true)
long[] getOrganizationUserIds(long organizationId)
                              throws PortalException,
                                     SystemException
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:
PortalException - if the current user did not have permission to view organization assignments
SystemException - if a system exception occurred

getOrganizationUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getOrganizationUsers(long organizationId)
                                throws PortalException,
                                       SystemException
Returns all the users belonging to the organization.

Parameters:
organizationId - the primary key of the organization
Returns:
users belonging to the organization
Throws:
PortalException - if the current user did not have permission to view organization assignments
SystemException - if a system exception occurred

getRoleUserIds

@Transactional(propagation=SUPPORTS,
               readOnly=true)
long[] getRoleUserIds(long roleId)
                      throws PortalException,
                             SystemException
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:
PortalException - if the current user did not have permission to view role members
SystemException - if a system exception occurred

getUserByEmailAddress

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

Parameters:
companyId - the primary key of the user's company
emailAddress - the user's email address
Returns:
the user with the email address
Throws:
PortalException - if a user with the email address could not be found or if the current user did not have permission to view the user
SystemException - if a system exception occurred

getUserById

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

Parameters:
userId - the primary key of the user
Returns:
the user with the primary key
Throws:
PortalException - if a user with the primary key could not be found or if the current user did not have permission to view the user
SystemException - if a system exception occurred

getUserByScreenName

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

Parameters:
companyId - the primary key of the user's company
screenName - the user's screen name
Returns:
the user with the screen name
Throws:
PortalException - if a user with the screen name could not be found or if the current user did not have permission to veiw the user
SystemException - if a system exception occurred

getUserGroupUsers

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<User> getUserGroupUsers(long userGroupId)
                             throws PortalException,
                                    SystemException
Throws:
PortalException
SystemException

getUserIdByEmailAddress

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

Parameters:
companyId - the primary key of the user's company
emailAddress - the user's email address
Returns:
the primary key of the user with the email address
Throws:
PortalException - if a user with the email address could not be found
SystemException - if a system exception occurred

getUserIdByScreenName

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

Parameters:
companyId - the primary key of the user's company
screenName - the user's screen name
Returns:
the primary key of the user with the screen name
Throws:
PortalException - if a user with the screen name could not be found
SystemException - if a system exception occurred

hasGroupUser

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasGroupUser(long groupId,
                                                              long userId)
                     throws PortalException,
                            SystemException
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:
PortalException - if the current user did not have permission to view the user or group members
SystemException - if a system exception occurred

hasRoleUser

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasRoleUser(long roleId,
                                                             long userId)
                    throws PortalException,
                           SystemException
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:
PortalException - if the current user did not have permission to view the user or role members
SystemException - if a system exception occurred

hasRoleUser

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

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

setRoleUsers

void setRoleUsers(long roleId,
                  long[] userIds)
                  throws PortalException,
                         SystemException
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:
PortalException - if the current user did not have permission to assign role members
SystemException - if a system exception occurred

setUserGroupUsers

void setUserGroupUsers(long userGroupId,
                       long[] userIds)
                       throws PortalException,
                              SystemException
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:
PortalException - if the current user did not have permission to assign group members
SystemException - if a system exception occurred

unsetGroupTeamsUsers

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

Parameters:
groupId - the primary key of the group
userIds - the primary keys of the users
Throws:
PortalException - if the current user did not have permission to modify user group assignments
SystemException - if a system exception occurred

unsetGroupUsers

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

Parameters:
groupId - the primary key of the group
userIds - the primary keys of the users
serviceContext - the service context to be applied (optionally null)
Throws:
PortalException - if the current user did not have permission to modify group assignments
SystemException - if a system exception occurred

unsetOrganizationUsers

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

Parameters:
organizationId - the primary key of the organization
userIds - the primary keys of the users
Throws:
PortalException - if the current user did not have permission to modify organization assignments
SystemException - if a system exception occurred

unsetPasswordPolicyUsers

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

Parameters:
passwordPolicyId - the primary key of the password policy
userIds - the primary keys of the users
Throws:
PortalException - if the current user did not have permission to modify policy assignments
SystemException - if a system exception occurred

unsetRoleUsers

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

Parameters:
roleId - the primary key of the role
userIds - the primary keys of the users
Throws:
PortalException - if the current user did not have permission to modify role assignments
SystemException - if a system exception occurred

unsetTeamUsers

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

Parameters:
teamId - the primary key of the team
userIds - the primary keys of the users
Throws:
PortalException - if the current user did not have permission to modify team assignments
SystemException - if a system exception occurred

unsetUserGroupUsers

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

Parameters:
userGroupId - the primary key of the user group
userIds - the primary keys of the users
Throws:
PortalException - if the current user did not have permission to modify user group assignments
SystemException - if a system exception occurred

updateAgreedToTermsOfUse

User updateAgreedToTermsOfUse(long userId,
                              boolean agreedToTermsOfUse)
                              throws PortalException,
                                     SystemException
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:
PortalException - if the current user did not have permission to update the user's agreement to terms-of-use
SystemException - if a system exception occurred

updateEmailAddress

User updateEmailAddress(long userId,
                        String password,
                        String emailAddress1,
                        String emailAddress2,
                        ServiceContext serviceContext)
                        throws PortalException,
                               SystemException
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:
PortalException - if a user with the primary key could not be found or if the current user did not have permission to update the user
SystemException - if a system exception occurred

updateIncompleteUser

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,
                          int prefixId,
                          int suffixId,
                          boolean male,
                          int birthdayMonth,
                          int birthdayDay,
                          int birthdayYear,
                          String jobTitle,
                          boolean updateUserInformation,
                          boolean sendEmail,
                          ServiceContext serviceContext)
                          throws PortalException,
                                 SystemException
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
prefixId - the user's name prefix ID
suffixId - the user's name suffix ID
male - whether the user is male
birthdayMonth - the user's birthday month (0-based, meaning 0 for January)
birthdayDay - the user's birthday day
birthdayYear - the user's birthday year
jobTitle - the user's job title
updateUserInformation - whether to update the user's information
sendEmail - whether to send the user an email notification about their new account
serviceContext - the user's service context (optionally null). Can set the expando bridge attributes for the user.
Returns:
the user
Throws:
PortalException - if the user's information was invalid or if the email address was reserved
SystemException - if a system exception occurred

updateLockoutById

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

Parameters:
userId - the primary key of the user
lockout - whether the user is locked out
Returns:
the user
Throws:
PortalException - if the user did not have permission to lock out the user
SystemException - if a system exception occurred

updateOpenId

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

Parameters:
userId - the primary key of the user
openId - the new OpenID
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found or if the current user did not have permission to update the user
SystemException - if a system exception occurred

updateOrganizations

void updateOrganizations(long userId,
                         long[] organizationIds,
                         ServiceContext serviceContext)
                         throws PortalException,
                                SystemException
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:
PortalException - if a user with the primary key could not be found or if the current user did not have permission to update the user
SystemException - if a system exception occurred

updatePassword

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

Parameters:
userId - the primary key of the user
password1 - the user's new password
password2 - the user's new password confirmation
passwordReset - whether the user should be asked to reset their password the next time they log in
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found or if the current user did not have permission to update the user
SystemException - if a system exception occurred

updatePortrait

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

Parameters:
userId - the primary key of the user
bytes - the new portrait image data
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found, if the new portrait was invalid, or if the current user did not have permission to update the user
SystemException - if a system exception occurred

updateReminderQuery

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

Parameters:
userId - the primary key of the user
question - the user's new password reset question
answer - the user's new password reset answer
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found, if the new question or answer were invalid, or if the current user did not have permission to update the user
SystemException - if a system exception occurred

updateScreenName

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

Parameters:
userId - the primary key of the user
screenName - the user's new screen name
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found, if the new screen name was invalid, or if the current user did not have permission to update the user
SystemException - if a system exception occurred

updateStatus

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

Parameters:
userId - the primary key of the user
status - the user's new workflow status
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found, if the current user was updating her own status to anything but WorkflowConstants.STATUS_APPROVED, or if the current user did not have permission to update the user's workflow status.
SystemException - if a system exception occurred

updateUser

User updateUser(long userId,
                String oldPassword,
                String newPassword1,
                String newPassword2,
                boolean passwordReset,
                String reminderQueryQuestion,
                String reminderQueryAnswer,
                String screenName,
                String emailAddress,
                long facebookId,
                String openId,
                String languageId,
                String timeZoneId,
                String greeting,
                String comments,
                String firstName,
                String middleName,
                String lastName,
                int prefixId,
                int suffixId,
                boolean male,
                int birthdayMonth,
                int birthdayDay,
                int birthdayYear,
                String smsSn,
                String aimSn,
                String facebookSn,
                String icqSn,
                String jabberSn,
                String msnSn,
                String mySpaceSn,
                String skypeSn,
                String twitterSn,
                String ymSn,
                String jobTitle,
                long[] groupIds,
                long[] organizationIds,
                long[] roleIds,
                List<UserGroupRole> userGroupRoles,
                long[] userGroupIds,
                List<Address> addresses,
                List<EmailAddress> emailAddresses,
                List<Phone> phones,
                List<Website> websites,
                List<AnnouncementsDelivery> announcementsDelivers,
                ServiceContext serviceContext)
                throws PortalException,
                       SystemException
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
facebookId - the user's new Facebook ID
openId - the user's new OpenID
languageId - the user's new language ID
timeZoneId - the user's new time zone ID
greeting - the user's new greeting
comments - the user's new comments
firstName - the user's new first name
middleName - the user's new middle name
lastName - the user's new last name
prefixId - the user's new name prefix ID
suffixId - the user's new name suffix ID
male - whether user is male
birthdayMonth - the user's new birthday month (0-based, meaning 0 for January)
birthdayDay - the user's new birthday day
birthdayYear - the user's birthday year
smsSn - the user's new SMS screen name
aimSn - the user's new AIM screen name
facebookSn - the user's new Facebook screen name
icqSn - the user's new ICQ screen name
jabberSn - the user's new Jabber screen name
msnSn - the user's new MSN screen name
mySpaceSn - the user's new MySpace screen name
skypeSn - the user's new Skype screen name
twitterSn - the user's new Twitter screen name
ymSn - the user's new Yahoo! Messenger 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 user's service context (optionally null). Can set the universally unique identifier (with the uuid attribute), asset category IDs, asset tag names, and expando bridge attributes for the user.
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found, if the new information was invalid, or if the current user did not have permission to update the user
SystemException - if a system exception occurred

updateUser

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

Parameters:
userId - the primary key of the user
oldPassword - the user's old password
newPassword1 - the user's new password (optionally null)
newPassword2 - the user's new password confirmation (optionally null)
passwordReset - whether the user should be asked to reset their password the next time they login
reminderQueryQuestion - the user's new password reset question
reminderQueryAnswer - the user's new password reset answer
screenName - the user's new screen name
emailAddress - the user's new email address
facebookId - the user's new Facebook ID
openId - the user's new OpenID
languageId - the user's new language ID
timeZoneId - the user's new time zone ID
greeting - the user's new greeting
comments - the user's new comments
firstName - the user's new first name
middleName - the user's new middle name
lastName - the user's new last name
prefixId - the user's new name prefix ID
suffixId - the user's new name suffix ID
male - whether user is male
birthdayMonth - the user's new birthday month (0-based, meaning 0 for January)
birthdayDay - the user's new birthday day
birthdayYear - the user's birthday year
smsSn - the user's new SMS screen name
aimSn - the user's new AIM screen name
facebookSn - the user's new Facebook screen name
icqSn - the user's new ICQ screen name
jabberSn - the user's new Jabber screen name
msnSn - the user's new MSN screen name
mySpaceSn - the user's new MySpace screen name
skypeSn - the user's new Skype screen name
twitterSn - the user's new Twitter screen name
ymSn - the user's new Yahoo! Messenger 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 user's service context (optionally null). Can set the universally unique identifier (with the uuid attribute), asset category IDs, asset tag names, and expando bridge attributes for the user.
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found, if the new information was invalid, or if the current user did not have permission to update the user
SystemException - if a system exception occurred

Liferay 6.1.2-ce-ga3