|
Liferay 6.2-ce-ga5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.liferay.portal.service.UserServiceUtil
@ProviderType public class UserServiceUtil
Provides the remote service utility for User. This utility wraps
com.liferay.portal.service.impl.UserServiceImpl
and is the
primary access point for service operations in application layer code running
on a remote server. Methods of this service are expected to have security
checks based on the propagated JAAS credentials because this service can be
accessed remotely.
UserService
,
UserServiceBaseImpl
,
com.liferay.portal.service.impl.UserServiceImpl
Constructor Summary | |
---|---|
UserServiceUtil()
|
Method Summary | |
---|---|
static void |
addGroupUsers(long groupId,
long[] userIds,
ServiceContext serviceContext)
Adds the users to the group. |
static void |
addOrganizationUsers(long organizationId,
long[] userIds)
Adds the users to the organization. |
static void |
addPasswordPolicyUsers(long passwordPolicyId,
long[] userIds)
Assigns the password policy to the users, removing any other currently assigned password policies. |
static void |
addRoleUsers(long roleId,
long[] userIds)
Adds the users to the role. |
static void |
addTeamUsers(long teamId,
long[] userIds)
Adds the users to the team. |
static 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. |
static 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. |
static void |
addUserGroupUsers(long userGroupId,
long[] userIds)
Adds the users to the user group. |
static 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. |
static 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. |
static void |
deletePortrait(long userId)
Deletes the user's portrait image. |
static void |
deleteRoleUser(long roleId,
long userId)
Removes the user from the role. |
static void |
deleteUser(long userId)
Deletes the user. |
static String |
getBeanIdentifier()
Returns the Spring bean ID for this bean. |
static List<User> |
getCompanyUsers(long companyId,
int start,
int end)
|
static int |
getCompanyUsersCount(long companyId)
|
static User |
getCurrentUser()
|
static long[] |
getGroupUserIds(long groupId)
Returns the primary keys of all the users belonging to the group. |
static List<User> |
getGroupUsers(long groupId)
Returns all the users belonging to the group. |
static long[] |
getOrganizationUserIds(long organizationId)
Returns the primary keys of all the users belonging to the organization. |
static List<User> |
getOrganizationUsers(long organizationId)
Returns all the users belonging to the organization. |
static long[] |
getRoleUserIds(long roleId)
Returns the primary keys of all the users belonging to the role. |
static UserService |
getService()
|
static User |
getUserByEmailAddress(long companyId,
String emailAddress)
Returns the user with the email address. |
static User |
getUserById(long userId)
Returns the user with the primary key. |
static User |
getUserByScreenName(long companyId,
String screenName)
Returns the user with the screen name. |
static List<User> |
getUserGroupUsers(long userGroupId)
|
static long |
getUserIdByEmailAddress(long companyId,
String emailAddress)
Returns the primary key of the user with the email address. |
static long |
getUserIdByScreenName(long companyId,
String screenName)
Returns the primary key of the user with the screen name. |
static boolean |
hasGroupUser(long groupId,
long userId)
Returns true if the user is a member of the group. |
static boolean |
hasRoleUser(long roleId,
long userId)
Returns true if the user is a member of the role. |
static boolean |
hasRoleUser(long companyId,
String name,
long userId,
boolean inherited)
Returns true if the user has the role with the name,
optionally through inheritance. |
static void |
setBeanIdentifier(String beanIdentifier)
Sets the Spring bean ID for this bean. |
static void |
setRoleUsers(long roleId,
long[] userIds)
Sets the users in the role, removing and adding users to the role as necessary. |
void |
setService(UserService service)
Deprecated. As of 6.2.0 |
static void |
setUserGroupUsers(long userGroupId,
long[] userIds)
Sets the users in the user group, removing and adding users to the user group as necessary. |
static void |
unsetGroupTeamsUsers(long groupId,
long[] userIds)
Removes the users from the teams of a group. |
static void |
unsetGroupUsers(long groupId,
long[] userIds,
ServiceContext serviceContext)
Removes the users from the group. |
static void |
unsetOrganizationUsers(long organizationId,
long[] userIds)
Removes the users from the organization. |
static void |
unsetPasswordPolicyUsers(long passwordPolicyId,
long[] userIds)
Removes the users from the password policy. |
static void |
unsetRoleUsers(long roleId,
long[] userIds)
Removes the users from the role. |
static void |
unsetTeamUsers(long teamId,
long[] userIds)
Removes the users from the team. |
static void |
unsetUserGroupUsers(long userGroupId,
long[] userIds)
Removes the users from the user group. |
static User |
updateAgreedToTermsOfUse(long userId,
boolean agreedToTermsOfUse)
Updates the user's response to the terms of use agreement. |
static User |
updateEmailAddress(long userId,
String password,
String emailAddress1,
String emailAddress2,
ServiceContext serviceContext)
Updates the user's email address. |
static 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. |
static User |
updateLockoutById(long userId,
boolean lockout)
Updates whether the user is locked out from logging in. |
static User |
updateOpenId(long userId,
String openId)
Updates the user's OpenID. |
static void |
updateOrganizations(long userId,
long[] organizationIds,
ServiceContext serviceContext)
Sets the organizations that the user is in, removing and adding organizations as necessary. |
static User |
updatePassword(long userId,
String password1,
String password2,
boolean passwordReset)
Updates the user's password without tracking or validation of the change. |
static User |
updatePortrait(long userId,
byte[] bytes)
Updates the user's portrait image. |
static User |
updateReminderQuery(long userId,
String question,
String answer)
Updates the user's password reset question and answer. |
static User |
updateScreenName(long userId,
String screenName)
Updates the user's screen name. |
static User |
updateStatus(long userId,
int status)
Deprecated. As of 7.0.0, replaced by updateStatus(long, int,
ServiceContext) |
static User |
updateStatus(long userId,
int status,
ServiceContext serviceContext)
Updates the user's workflow status. |
static 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. |
static 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UserServiceUtil()
Method Detail |
---|
public static String getBeanIdentifier()
public static void setBeanIdentifier(String beanIdentifier)
beanIdentifier
- the Spring bean ID for this beanpublic static void addGroupUsers(long groupId, long[] userIds, ServiceContext serviceContext) throws PortalException, SystemException
groupId
- the primary key of the groupuserIds
- the primary keys of the usersserviceContext
- the service context to be applied (optionally
null
)
PortalException
- if a group or user with the primary key could not
be found, if the user did not have permission to assign group
members, or if the operation was not allowed by the membership
policy
SystemException
- if a system exception occurredpublic static void addOrganizationUsers(long organizationId, long[] userIds) throws PortalException, SystemException
organizationId
- the primary key of the organizationuserIds
- the primary keys of the users
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, if current user did not have an
organization in common with a given user, or if the operation was
not allowed by the membership policy
SystemException
- if a system exception occurredpublic static void addPasswordPolicyUsers(long passwordPolicyId, long[] userIds) throws PortalException, SystemException
passwordPolicyId
- the primary key of the password policyuserIds
- the primary keys of the users
PortalException
- if the user did not have permission to assign
policy members
SystemException
- if a system exception occurredpublic static void addRoleUsers(long roleId, long[] userIds) throws PortalException, SystemException
roleId
- the primary key of the roleuserIds
- the primary keys of the users
PortalException
- if a role or user with the primary key could not
be found, if the user did not have permission to assign role
members, or if the operation was not allowed by the membership
policy
SystemException
- if a system exception occurredpublic static void addTeamUsers(long teamId, long[] userIds) throws PortalException, SystemException
teamId
- the primary key of the teamuserIds
- the primary keys of the users
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 occurredpublic static 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
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.
companyId
- the primary key of the user's companyautoPassword
- whether a password should be automatically generated
for the userpassword1
- the user's passwordpassword2
- the user's password confirmationautoScreenName
- whether a screen name should be automatically
generated for the userscreenName
- the user's screen nameemailAddress
- the user's email addressfacebookId
- the user's facebook IDopenId
- the user's OpenIDlocale
- the user's localefirstName
- the user's first namemiddleName
- the user's middle namelastName
- the user's last nameprefixId
- the user's name prefix IDsuffixId
- the user's name suffix IDmale
- whether the user is malebirthdayMonth
- the user's birthday month (0-based, meaning 0 for
January)birthdayDay
- the user's birthday daybirthdayYear
- the user's birthday yearjobTitle
- the user's job titlegroupIds
- the primary keys of the user's groupsorganizationIds
- the primary keys of the user's organizationsroleIds
- the primary keys of the roles this user possessesuserGroupIds
- the primary keys of the user's user groupssendEmail
- whether to send the user an email notification about
their new accountserviceContext
- 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.
PortalException
- if the user's information was invalid, if the
operation was not allowed by the membership policy, if the
creator did not have permission to add users, or if the email
address was reserved
SystemException
- if a system exception occurredpublic static 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
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.
companyId
- the primary key of the user's companyautoPassword
- whether a password should be automatically generated
for the userpassword1
- the user's passwordpassword2
- the user's password confirmationautoScreenName
- whether a screen name should be automatically
generated for the userscreenName
- the user's screen nameemailAddress
- the user's email addressfacebookId
- the user's facebook IDopenId
- the user's OpenIDlocale
- the user's localefirstName
- the user's first namemiddleName
- the user's middle namelastName
- the user's last nameprefixId
- the user's name prefix IDsuffixId
- the user's name suffix IDmale
- whether the user is malebirthdayMonth
- the user's birthday month (0-based, meaning 0 for
January)birthdayDay
- the user's birthday daybirthdayYear
- the user's birthday yearjobTitle
- the user's job titlegroupIds
- the primary keys of the user's groupsorganizationIds
- the primary keys of the user's organizationsroleIds
- the primary keys of the roles this user possessesuserGroupIds
- the primary keys of the user's user groupsaddresses
- the user's addressesemailAddresses
- the user's email addressesphones
- the user's phone numberswebsites
- the user's websitesannouncementsDelivers
- the announcements deliveriessendEmail
- whether to send the user an email notification about
their new accountserviceContext
- 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.
PortalException
- if the user's information was invalid, if the
creator did not have permission to add users, if the email
address was reserved, if the operation was not allowed by the
membership policy, or if some other portal exception occurred
SystemException
- if a system exception occurredpublic static void addUserGroupUsers(long userGroupId, long[] userIds) throws PortalException, SystemException
userGroupId
- the primary key of the user groupuserIds
- the primary keys of the users
PortalException
- if a user group or user with the primary could
could not be found, if the current user did not have permission
to assign group members, or if the operation was not allowed by
the membership policy
SystemException
- if a system exception occurredpublic static 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
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.
companyId
- the primary key of the user's companyautoPassword
- whether a password should be automatically generated
for the userpassword1
- the user's passwordpassword2
- the user's password confirmationautoScreenName
- whether a screen name should be automatically
generated for the userscreenName
- the user's screen nameemailAddress
- the user's email addressfacebookId
- the user's facebook IDopenId
- the user's OpenIDlocale
- the user's localefirstName
- the user's first namemiddleName
- the user's middle namelastName
- the user's last nameprefixId
- the user's name prefix IDsuffixId
- the user's name suffix IDmale
- whether the user is malebirthdayMonth
- the user's birthday month (0-based, meaning 0 for
January)birthdayDay
- the user's birthday daybirthdayYear
- the user's birthday yearjobTitle
- the user's job titlegroupIds
- the primary keys of the user's groupsorganizationIds
- the primary keys of the user's organizationsroleIds
- the primary keys of the roles this user possessesuserGroupIds
- the primary keys of the user's user groupssendEmail
- whether to send the user an email notification about
their new accountserviceContext
- 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.
PortalException
- if the user's information was invalid, if the
operation was not allowed by the membership policy, if the
creator did not have permission to add users, or if the email
address was reserved
SystemException
- if a system exception occurredpublic static 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
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.
companyId
- the primary key of the user's companyautoPassword
- whether a password should be automatically generated
for the userpassword1
- the user's passwordpassword2
- the user's password confirmationautoScreenName
- whether a screen name should be automatically
generated for the userscreenName
- the user's screen nameemailAddress
- the user's email addressfacebookId
- the user's facebook IDopenId
- the user's OpenIDlocale
- the user's localefirstName
- the user's first namemiddleName
- the user's middle namelastName
- the user's last nameprefixId
- the user's name prefix IDsuffixId
- the user's name suffix IDmale
- whether the user is malebirthdayMonth
- the user's birthday month (0-based, meaning 0 for
January)birthdayDay
- the user's birthday daybirthdayYear
- the user's birthday yearjobTitle
- the user's job titlegroupIds
- the primary keys of the user's groupsorganizationIds
- the primary keys of the user's organizationsroleIds
- the primary keys of the roles this user possessesuserGroupIds
- the primary keys of the user's user groupsaddresses
- the user's addressesemailAddresses
- the user's email addressesphones
- the user's phone numberswebsites
- the user's websitesannouncementsDelivers
- the announcements deliveriessendEmail
- whether to send the user an email notification about
their new accountserviceContext
- 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.
PortalException
- if the user's information was invalid, if the
operation was not allowed by the membership policy, if the
creator did not have permission to add users, if the email
address was reserved, or if some other portal exception occurred
SystemException
- if a system exception occurredpublic static void deletePortrait(long userId) throws PortalException, SystemException
userId
- the primary key of the user
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 occurredpublic static void deleteRoleUser(long roleId, long userId) throws PortalException, SystemException
roleId
- the primary key of the roleuserId
- the primary key of the user
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 occurredpublic static void deleteUser(long userId) throws PortalException, SystemException
userId
- the primary key of the user
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 occurredpublic static List<User> getCompanyUsers(long companyId, int start, int end) throws PortalException, SystemException
PortalException
SystemException
public static int getCompanyUsersCount(long companyId) throws PortalException, SystemException
PortalException
SystemException
public static User getCurrentUser() throws PortalException, SystemException
PortalException
SystemException
public static long[] getGroupUserIds(long groupId) throws PortalException, SystemException
groupId
- the primary key of the group
PortalException
- if the current user did not have permission to
view group assignments
SystemException
- if a system exception occurredpublic static List<User> getGroupUsers(long groupId) throws PortalException, SystemException
groupId
- the primary key of the group
PortalException
- if the current user did not have permission to
view group assignments
SystemException
- if a system exception occurredpublic static long[] getOrganizationUserIds(long organizationId) throws PortalException, SystemException
organizationId
- the primary key of the organization
PortalException
- if the current user did not have permission to
view organization assignments
SystemException
- if a system exception occurredpublic static List<User> getOrganizationUsers(long organizationId) throws PortalException, SystemException
organizationId
- the primary key of the organization
PortalException
- if the current user did not have permission to
view organization assignments
SystemException
- if a system exception occurredpublic static long[] getRoleUserIds(long roleId) throws PortalException, SystemException
roleId
- the primary key of the role
PortalException
- if the current user did not have permission to
view role members
SystemException
- if a system exception occurredpublic static User getUserByEmailAddress(long companyId, String emailAddress) throws PortalException, SystemException
companyId
- the primary key of the user's companyemailAddress
- the user's email address
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 occurredpublic static User getUserById(long userId) throws PortalException, SystemException
userId
- the primary key of the user
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 occurredpublic static User getUserByScreenName(long companyId, String screenName) throws PortalException, SystemException
companyId
- the primary key of the user's companyscreenName
- the user's screen name
PortalException
- if a user with the screen name could not be found
or if the current user did not have permission to view the user
SystemException
- if a system exception occurredpublic static List<User> getUserGroupUsers(long userGroupId) throws PortalException, SystemException
PortalException
SystemException
public static long getUserIdByEmailAddress(long companyId, String emailAddress) throws PortalException, SystemException
companyId
- the primary key of the user's companyemailAddress
- the user's email address
PortalException
- if a user with the email address could not be
found
SystemException
- if a system exception occurredpublic static long getUserIdByScreenName(long companyId, String screenName) throws PortalException, SystemException
companyId
- the primary key of the user's companyscreenName
- the user's screen name
PortalException
- if a user with the screen name could not be found
SystemException
- if a system exception occurredpublic static boolean hasGroupUser(long groupId, long userId) throws PortalException, SystemException
true
if the user is a member of the group.
groupId
- the primary key of the groupuserId
- the primary key of the user
true
if the user is a member of the group;
false
otherwise
PortalException
- if the current user did not have permission to
view the user or group members
SystemException
- if a system exception occurredpublic static boolean hasRoleUser(long roleId, long userId) throws PortalException, SystemException
true
if the user is a member of the role.
roleId
- the primary key of the roleuserId
- the primary key of the user
true
if the user is a member of the role;
false
otherwise
PortalException
- if the current user did not have permission to
view the user or role members
SystemException
- if a system exception occurredpublic static boolean hasRoleUser(long companyId, String name, long userId, boolean inherited) throws PortalException, SystemException
true
if the user has the role with the name,
optionally through inheritance.
companyId
- the primary key of the role's companyname
- the name of the role (must be a regular role, not an
organization, site or provider role)userId
- the primary key of the userinherited
- whether to include roles inherited from organizations,
sites, etc.
true
if the user has the role; false
otherwise
PortalException
- if a role with the name could not be found
SystemException
- if a system exception occurredpublic static void setRoleUsers(long roleId, long[] userIds) throws PortalException, SystemException
roleId
- the primary key of the roleuserIds
- the primary keys of the users
PortalException
- if the current user did not have permission to
assign role members or if the operation was not allowed by the
membership policy
SystemException
- if a system exception occurredpublic static void setUserGroupUsers(long userGroupId, long[] userIds) throws PortalException, SystemException
userGroupId
- the primary key of the user groupuserIds
- the primary keys of the users
PortalException
- if the current user did not have permission to
assign group members
SystemException
- if a system exception occurredpublic static void unsetGroupTeamsUsers(long groupId, long[] userIds) throws PortalException, SystemException
groupId
- the primary key of the groupuserIds
- the primary keys of the users
PortalException
- if the current user did not have permission to
modify user group assignments
SystemException
- if a system exception occurredpublic static void unsetGroupUsers(long groupId, long[] userIds, ServiceContext serviceContext) throws PortalException, SystemException
groupId
- the primary key of the groupuserIds
- the primary keys of the usersserviceContext
- the service context to be applied (optionally
null
)
PortalException
- if the current user did not have permission to
modify group assignments or if the operation was not allowed by
the membership policy
SystemException
- if a system exception occurredpublic static void unsetOrganizationUsers(long organizationId, long[] userIds) throws PortalException, SystemException
organizationId
- the primary key of the organizationuserIds
- the primary keys of the users
PortalException
- if the current user did not have permission to
modify organization assignments or if the operation was not
allowed by the membership policy
SystemException
- if a system exception occurredpublic static void unsetPasswordPolicyUsers(long passwordPolicyId, long[] userIds) throws PortalException, SystemException
passwordPolicyId
- the primary key of the password policyuserIds
- the primary keys of the users
PortalException
- if the current user did not have permission to
modify policy assignments
SystemException
- if a system exception occurredpublic static void unsetRoleUsers(long roleId, long[] userIds) throws PortalException, SystemException
roleId
- the primary key of the roleuserIds
- the primary keys of the users
PortalException
- if the current user did not have permission to
modify role assignments or if the operation was not allowed by
the membership policy
SystemException
- if a system exception occurredpublic static void unsetTeamUsers(long teamId, long[] userIds) throws PortalException, SystemException
teamId
- the primary key of the teamuserIds
- the primary keys of the users
PortalException
- if the current user did not have permission to
modify team assignments
SystemException
- if a system exception occurredpublic static void unsetUserGroupUsers(long userGroupId, long[] userIds) throws PortalException, SystemException
userGroupId
- the primary key of the user groupuserIds
- the primary keys of the users
PortalException
- if the current user did not have permission to
modify user group assignments or if the operation was not allowed
by the membership policy
SystemException
- if a system exception occurredpublic static User updateAgreedToTermsOfUse(long userId, boolean agreedToTermsOfUse) throws PortalException, SystemException
userId
- the primary key of the useragreedToTermsOfUse
- whether the user has agree to the terms of use
PortalException
- if the current user did not have permission to
update the user's agreement to terms-of-use
SystemException
- if a system exception occurredpublic static User updateEmailAddress(long userId, String password, String emailAddress1, String emailAddress2, ServiceContext serviceContext) throws PortalException, SystemException
userId
- the primary key of the userpassword
- the user's passwordemailAddress1
- the user's new email addressemailAddress2
- the user's new email address confirmationserviceContext
- 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.
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 occurredpublic static 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
companyId
- the primary key of the user's companyautoPassword
- whether a password should be automatically generated
for the userpassword1
- the user's passwordpassword2
- the user's password confirmationautoScreenName
- whether a screen name should be automatically
generated for the userscreenName
- the user's screen nameemailAddress
- the user's email addressfacebookId
- the user's facebook IDopenId
- the user's OpenIDlocale
- the user's localefirstName
- the user's first namemiddleName
- the user's middle namelastName
- the user's last nameprefixId
- the user's name prefix IDsuffixId
- the user's name suffix IDmale
- whether the user is malebirthdayMonth
- the user's birthday month (0-based, meaning 0 for
January)birthdayDay
- the user's birthday daybirthdayYear
- the user's birthday yearjobTitle
- the user's job titleupdateUserInformation
- whether to update the user's informationsendEmail
- whether to send the user an email notification about
their new accountserviceContext
- the service context to be applied (optionally
null
). Can set the expando bridge attributes for the
user.
PortalException
- if the user's information was invalid or if the
email address was reserved
SystemException
- if a system exception occurredpublic static User updateLockoutById(long userId, boolean lockout) throws PortalException, SystemException
userId
- the primary key of the userlockout
- whether the user is locked out
PortalException
- if the user did not have permission to lock out
the user
SystemException
- if a system exception occurredpublic static User updateOpenId(long userId, String openId) throws PortalException, SystemException
userId
- the primary key of the useropenId
- the new OpenID
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 occurredpublic static void updateOrganizations(long userId, long[] organizationIds, ServiceContext serviceContext) throws PortalException, SystemException
userId
- the primary key of the userorganizationIds
- the primary keys of the organizationsserviceContext
- the service context to be applied. Must set
whether user indexing is enabled.
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 occurredpublic static User updatePassword(long userId, String password1, String password2, boolean passwordReset) throws PortalException, SystemException
userId
- the primary key of the userpassword1
- the user's new passwordpassword2
- the user's new password confirmationpasswordReset
- whether the user should be asked to reset their
password the next time they log in
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 occurredpublic static User updatePortrait(long userId, byte[] bytes) throws PortalException, SystemException
userId
- the primary key of the userbytes
- the new portrait image data
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 occurredpublic static User updateReminderQuery(long userId, String question, String answer) throws PortalException, SystemException
userId
- the primary key of the userquestion
- the user's new password reset questionanswer
- the user's new password reset answer
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 occurredpublic static User updateScreenName(long userId, String screenName) throws PortalException, SystemException
userId
- the primary key of the userscreenName
- the user's new screen name
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 occurredpublic static User updateStatus(long userId, int status) throws PortalException, SystemException
updateStatus(long, int,
ServiceContext)
userId
- the primary key of the userstatus
- the user's new workflow status
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 occurredpublic static User updateStatus(long userId, int status, ServiceContext serviceContext) throws PortalException, SystemException
userId
- the primary key of the userstatus
- the user's new workflow statusserviceContext
- the service context to be applied. You can specify
an unencrypted custom password (used by an LDAP listener) for the
user via attribute passwordUnencrypted
.
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 occurredpublic static 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
userId
- the primary key of the useroldPassword
- the user's old passwordnewPassword1
- 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 loginreminderQueryQuestion
- the user's new password reset questionreminderQueryAnswer
- the user's new password reset answerscreenName
- the user's new screen nameemailAddress
- the user's new email addressfacebookId
- the user's new Facebook IDopenId
- the user's new OpenIDlanguageId
- the user's new language IDtimeZoneId
- the user's new time zone IDgreeting
- the user's new greetingcomments
- the user's new commentsfirstName
- the user's new first namemiddleName
- the user's new middle namelastName
- the user's new last nameprefixId
- the user's new name prefix IDsuffixId
- the user's new name suffix IDmale
- whether user is malebirthdayMonth
- the user's new birthday month (0-based, meaning 0
for January)birthdayDay
- the user's new birthday daybirthdayYear
- the user's birthday yearsmsSn
- the user's new SMS screen nameaimSn
- the user's new AIM screen namefacebookSn
- the user's new Facebook screen nameicqSn
- the user's new ICQ screen namejabberSn
- the user's new Jabber screen namemsnSn
- the user's new MSN screen namemySpaceSn
- the user's new MySpace screen nameskypeSn
- the user's new Skype screen nametwitterSn
- the user's new Twitter screen nameymSn
- the user's new Yahoo! Messenger screen namejobTitle
- the user's new job titlegroupIds
- the primary keys of the user's groupsorganizationIds
- the primary keys of the user's organizationsroleIds
- the primary keys of the user's rolesuserGroupRoles
- the user user's group rolesuserGroupIds
- the primary keys of the user's user groupsaddresses
- the user's addressesemailAddresses
- the user's email addressesphones
- the user's phone numberswebsites
- the user's websitesannouncementsDelivers
- the announcements deliveriesserviceContext
- 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.
PortalException
- if a user with the primary key could not be
found, if the new information was invalid, if the current user
did not have permission to update the user, or if the operation
was not allowed by the membership policy
SystemException
- if a system exception occurredpublic static 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
userId
- the primary key of the useroldPassword
- the user's old passwordnewPassword1
- 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 loginreminderQueryQuestion
- the user's new password reset questionreminderQueryAnswer
- the user's new password reset answerscreenName
- the user's new screen nameemailAddress
- the user's new email addressfacebookId
- the user's new Facebook IDopenId
- the user's new OpenIDlanguageId
- the user's new language IDtimeZoneId
- the user's new time zone IDgreeting
- the user's new greetingcomments
- the user's new commentsfirstName
- the user's new first namemiddleName
- the user's new middle namelastName
- the user's new last nameprefixId
- the user's new name prefix IDsuffixId
- the user's new name suffix IDmale
- whether user is malebirthdayMonth
- the user's new birthday month (0-based, meaning 0
for January)birthdayDay
- the user's new birthday daybirthdayYear
- the user's birthday yearsmsSn
- the user's new SMS screen nameaimSn
- the user's new AIM screen namefacebookSn
- the user's new Facebook screen nameicqSn
- the user's new ICQ screen namejabberSn
- the user's new Jabber screen namemsnSn
- the user's new MSN screen namemySpaceSn
- the user's new MySpace screen nameskypeSn
- the user's new Skype screen nametwitterSn
- the user's new Twitter screen nameymSn
- the user's new Yahoo! Messenger screen namejobTitle
- the user's new job titlegroupIds
- the primary keys of the user's groupsorganizationIds
- the primary keys of the user's organizationsroleIds
- the primary keys of the user's rolesuserGroupRoles
- the user user's group rolesuserGroupIds
- the primary keys of the user's user groupsserviceContext
- 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.
PortalException
- if a user with the primary key could not be
found, if the new information was invalid, if the current user
did not have permission to update the user, or if the operation
was not allowed by the membership policy
SystemException
- if a system exception occurredpublic static UserService getService()
public void setService(UserService service)
|
Liferay 6.2-ce-ga5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |