Interface UserManager
- All Known Implementing Classes:
LiferayUserManager,LiferayWSUserManager
public interface UserManager
- Author:
- Massimiliano Assante, CNR-ISTI
-
Method Summary
Modifier and TypeMethodDescriptionacceptMembershipRequest(long requestUserId, long groupId, boolean addUserToGroup, String replyUsername, String replyComment) accept a membership request and optionally add the user to the groupvoidassignUserToGroup(long groupId, long userId) this method assigns the user to the Group and perform other necessary actions (such as adding him to the HL Folder)createUser(boolean autoScreenName, String username, String email, String firstName, String middleName, String lastName, String jobTitle, String location_industry, String backgroundSummary, boolean male, String reminderQuestion, String reminderAnswer, boolean sendEmail, boolean forcePasswordReset, byte[] portraitBytes, int type) Create the user and let you choose if you want to send him/her a mail notification and force or not the user to change his/her password.createUser(boolean autoScreenName, String username, String email, String firstName, String middleName, String lastName, String jobTitle, String location_industry, String backgroundSummary, boolean male, String reminderQuestion, String reminderAnswer, boolean sendEmail, boolean forcePasswordReset, byte[] portraitBytes, String mySpacesn, String twittersn, String facebooksn, String skypesn, String jabbersn, String aimsn, int type) Create the user and let you choose if you want to send him/her a mail notification and force or not the user to change his/her password.createUser(boolean autoScreenName, String username, String email, String firstName, String middleName, String lastName, String jobTitle, String location_industry, String backgroundSummary, boolean male, String reminderQuestion, String reminderAnswer, boolean sendEmail, boolean forcePasswordReset, int type) Create the user and let you choose if you want to send him/her a mail notification and force or not the user to change his/her password.createUser(boolean autoScreenName, String username, String email, String firstName, String middleName, String lastName, String jobTitle, String location_industry, String backgroundSummary, boolean male, String reminderQuestion, String reminderAnswer, int type) Create the user without sending notification mail and without forcing him to change the password at first login.voiddeleteUserByEMail(String email) Delete a user given his mailvoiddismissUserFromGroup(long groupId, long userId) this method removes the user to the Group and perform other necessary actions (such as removing him from the HL Folder)getFullNameFromEmail(String email) Returns the user's full name given his emailintgetGroupUsersCount(long groupId) Returns the number of users in the group (VRE).getMembershipRequests(long userId, long groupId, MembershipRequestStatus status) getMembershipRequestsById(long membershipRequestId) byte[]getUserAvatarBytes(String screenName) Retrieve user's avatar as bytesgetUserByEmail(String email) getUserById(long userId) getUserByScreenName(String username) Deprecated.use getUserByUsernamegetUserByUsername(String username) getUserContactsByGroup(long userId, long scopeGroupId) longgetUserIdsByGroup(long groupId) Retrieve the list of user identifiers by group id.getUserOpenId(String screenName) Retrieve user's openId fieldgetUserProfessionalBackground(long userId) intReturns the number of total users.booleanisPasswordChanged(String email) Check if the user changed his/her password from the initial one.listMembershipRequestsByGroup(long groupId) listPendingMembershipRequestsByGroup(long groupId) listUnregisteredUsersByGroup(long groupId) long[]listUserIdsByGroupAndRole(long groupId, long roleId) listUsers(boolean indexed) listUsers(int start, int end) Returns a range of all the users.listUsersAndRolesByGroup(long groupId) listUsersByGlobalRole(long roleId) Retrieve a list of users having a global role (e.g., Administrator)listUsersByGroup(long groupId) listUsersByGroup(long groupId, boolean indexed) listUsersByGroup(long groupId, int start, int end) listUsersByGroupAndRole(long groupId, long roleId) listUsersByGroupName(String name) listUsersByTeam(long teamId) /**readCustomAttr(long userId, String attributeKey) rejectMembershipRequest(long userId, long groupId, String replyUsername, String replyComment) rejects a membership requestrequestMembership(long userId, long groupId, String comment) request the membership to a restricted Site, no further actions are performed (no emails are sent, nor notifications)voidsaveCustomAttr(long userId, String attributeKey, Serializable value) searchUsersByGroup(String keywords, long groupId) voidsetUserProfessionalBackground(long userId, String summary) Save the user professional backgroundbooleanupdateContactInformation(String screenName, String mySpacesn, String twittersn, String facebooksn, String skypesn, String jabbersn, String aimsn) Update screenName user's contact informationbooleanupdateJobTitle(long userId, String theJob) booleanuserExistsByEmail(String email) Check if a user with such email exists.
-
Method Details
-
createUser
GCubeUser createUser(boolean autoScreenName, String username, String email, String firstName, String middleName, String lastName, String jobTitle, String location_industry, String backgroundSummary, boolean male, String reminderQuestion, String reminderAnswer, int type) throws UserManagementSystemException Create the user without sending notification mail and without forcing him to change the password at first login.- Parameters:
autoScreenName- set true if you want liferay to auto generate a screename for this user, false otherwiseusername- the username of the user you wantemail- a valid email addressfirstName-middleName-lastName-jobTitle-backgroundSummary-male-- Returns:
- an instance of the yet created user
- Throws:
UserManagementSystemException
-
createUser
GCubeUser createUser(boolean autoScreenName, String username, String email, String firstName, String middleName, String lastName, String jobTitle, String location_industry, String backgroundSummary, boolean male, String reminderQuestion, String reminderAnswer, boolean sendEmail, boolean forcePasswordReset, int type) throws UserManagementSystemException Create the user and let you choose if you want to send him/her a mail notification and force or not the user to change his/her password.- Parameters:
autoScreenName- set true if you want liferay to auto generate a screename for this user, false otherwiseusername- the username of the user you wantemail- a valid email addressfirstName-middleName-lastName-jobTitle-backgroundSummary-male-- Returns:
- an instance of the yet created user
- Throws:
UserManagementSystemException
-
createUser
GCubeUser createUser(boolean autoScreenName, String username, String email, String firstName, String middleName, String lastName, String jobTitle, String location_industry, String backgroundSummary, boolean male, String reminderQuestion, String reminderAnswer, boolean sendEmail, boolean forcePasswordReset, byte[] portraitBytes, int type) throws UserManagementSystemException Create the user and let you choose if you want to send him/her a mail notification and force or not the user to change his/her password. You can also pass the avatar to set as bytes.- Parameters:
autoScreenName- set true if you want liferay to auto generate a screename for this user, false otherwiseusername- the username of the user you wantemail- a valid email addressfirstName-middleName-lastName-jobTitle-backgroundSummary-male-portraitBytes- the bytes of the avatar to use for the userportraitBytes- the bytes of the avatar to use for the usertype- the type of user- Returns:
- an instance of the yet created user
- Throws:
UserManagementSystemException- if a system exception occurs
-
createUser
GCubeUser createUser(boolean autoScreenName, String username, String email, String firstName, String middleName, String lastName, String jobTitle, String location_industry, String backgroundSummary, boolean male, String reminderQuestion, String reminderAnswer, boolean sendEmail, boolean forcePasswordReset, byte[] portraitBytes, String mySpacesn, String twittersn, String facebooksn, String skypesn, String jabbersn, String aimsn, int type) throws UserManagementSystemException Create the user and let you choose if you want to send him/her a mail notification and force or not the user to change his/her password. You can also pass the avatar to set as bytes. Moreover, contact information can be passed.- Parameters:
autoScreenName-username-email-firstName-middleName-lastName-jobTitle-location_industry-backgroundSummary-male-reminderQuestion-reminderAnswer-sendEmail-forcePasswordReset-portraitBytes-mySpacesn- please note that this field will be used for Linkedin information!!twittersn-facebooksn-skypesn-jabbersn-aimsn-- Returns:
- Throws:
UserManagementSystemException
-
getUserByUsername
GCubeUser getUserByUsername(String username) throws UserManagementSystemException, UserRetrievalFault - Parameters:
username- the username of the user you want to get- Returns:
- the instance of the user
- Throws:
UserManagementSystemExceptionUserRetrievalFault
-
getUserByScreenName
@Deprecated GCubeUser getUserByScreenName(String username) throws UserManagementSystemException, UserRetrievalFault Deprecated.use getUserByUsername- Parameters:
username-- Returns:
- Throws:
UserManagementSystemExceptionUserRetrievalFault
-
getUserByEmail
- Parameters:
email- the email of the user you want to get- Returns:
- the instance of the user
- Throws:
UserManagementSystemException- if a system exception occursUserRetrievalFault- if the user does not exist
-
getUserById
- Parameters:
userId- the LR UserId- Returns:
- the instance of the user
- Throws:
UserManagementSystemExceptionUserRetrievalFault
-
getUserId
- Parameters:
username- the LR screenname- Returns:
- the LR userId associated to this screenname
- Throws:
UserManagementSystemExceptionUserRetrievalFault
-
getUserProfessionalBackground
String getUserProfessionalBackground(long userId) throws UserManagementSystemException, UserRetrievalFault - Parameters:
userId- the LR UserId- Returns:
- the user professional background
- Throws:
UserManagementSystemExceptionUserRetrievalFault
-
setUserProfessionalBackground
void setUserProfessionalBackground(long userId, String summary) throws UserManagementSystemException, UserRetrievalFault Save the user professional background- Parameters:
userId-summary-- Throws:
UserManagementSystemException- if a system exception occursUserRetrievalFault- if the user does not exist
-
listUsers
- Returns:
- a list of all portal active users (using indexed version search) no matter if the belong or not to a VRE, if a user is deactived is not returned
- Throws:
UserManagementSystemException
-
listUsers
Returns a range of all the users. Useful when paginating results. Returns a maximum of end - start instances, 0 refers to the first result in the set.- Parameters:
start- start the lower bound of the range of usersend- end the upper bound of the range of users (not inclusive)- Returns:
- the range of users
- Throws:
UserManagementSystemException
-
getUsersCount
Returns the number of total users.- Returns:
- the number of users
- Throws:
UserManagementSystemException
-
listUsers
- Parameters:
indexed- set to true to use the indexed version search false for a real time query to the DB.- Returns:
- a list of all portal active users no matter if the belong or not to a VRE, if a user is deactived is not returned
- Throws:
UserManagementSystemException
-
searchUsersByGroup
List<GCubeUser> searchUsersByGroup(String keywords, long groupId) throws GroupRetrievalFault, UserRetrievalFault - Parameters:
keywords- the keywords (space separated), which may occur in the user's first name, middle name, last name, username, or email addressgroupId-- Returns:
- all the users who match the keywords ordered by username (Ascendent order)
- Throws:
UserManagementSystemException- if a system exception occursGroupRetrievalFault- if the group does not existUserRetrievalFault- if the user does not exist
-
listUsersByGroup
List<GCubeUser> listUsersByGroup(long groupId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault - Parameters:
groupId- the LR groupId- Returns:
- Throws:
UserManagementSystemExceptionGroupRetrievalFaultUserRetrievalFault
-
listUsersByGroup
List<GCubeUser> listUsersByGroup(long groupId, int start, int end) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault - Parameters:
groupId- the LR groupId- Returns:
- Throws:
UserManagementSystemExceptionGroupRetrievalFaultUserRetrievalFault
-
getGroupUsersCount
Returns the number of users in the group (VRE).- Returns:
- the number of users in the group (VRE).
- Throws:
GroupRetrievalFault
-
listUsersByGlobalRole
Retrieve a list of users having a global role (e.g., Administrator)- Parameters:
roleId-- Returns:
-
listUsersByGroup
List<GCubeUser> listUsersByGroup(long groupId, boolean indexed) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault - Parameters:
groupId- the LR groupIdindexed- set to true to use the indexed version search false for a real time query to the DB.- Returns:
- a list of all portal active users belonging to the given groupid
- Throws:
UserManagementSystemException- if a system exception occursGroupRetrievalFault- if the group does not existUserRetrievalFault- .
-
listUsersByGroupName
List<GCubeUser> listUsersByGroupName(String name) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault - Parameters:
name- the name of the VO or VRE (e.g. devVRE, or gcube etc.)- Returns:
- a list of users
- Throws:
UserManagementSystemException- if a system exception occursGroupRetrievalFaultUserRetrievalFault
-
getUserContactsByGroup
Set<GCubeUser> getUserContactsByGroup(long userId, long scopeGroupId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault - Parameters:
scopeGroupId- the liferay groupid number of the current SiteuserId- the LR userid for which you need to fetch the contacts- Returns:
- a set containing all portal active users that the user can contact/see (depending on the scopeGroupId he/she can see the users a VRE, or the users of all the VREs he/she is subscribed)
- Throws:
UserManagementSystemException- .GroupRetrievalFault- .UserRetrievalFault- .
-
listMembershipRequestsByGroup
List<GCubeMembershipRequest> listMembershipRequestsByGroup(long groupId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault - Parameters:
groupId- the LR groupId- Returns:
- the list of
GCubeMembershipRequestwith their status and users given the LR GroupId (status can be requested, approved or rejected, @seeMembershipRequestStatus - Throws:
UserManagementSystemExceptionGroupRetrievalFaultUserRetrievalFault
-
listPendingMembershipRequestsByGroup
List<GCubeMembershipRequest> listPendingMembershipRequestsByGroup(long groupId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault - Parameters:
groupId- the LR groupId- Returns:
- the list of
GCubeMembershipRequestwith status requested and users given the LR GroupId @seeMembershipRequestStatus - Throws:
UserManagementSystemExceptionGroupRetrievalFaultUserRetrievalFault
-
getMembershipRequestsById
- Parameters:
membershipRequestId- the id of the request- Returns:
- an istance of
GCubeMembershipRequest
-
getMembershipRequests
List<GCubeMembershipRequest> getMembershipRequests(long userId, long groupId, MembershipRequestStatus status) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault - Parameters:
userId- the LR useridgroupId- the LR groupId thestatus- an istance ofMembershipRequestStatus- Returns:
- the list of
GCubeMembershipRequestwith their status and users given the LR GroupId and userId (status can be requested, approved or rejected, @seeMembershipRequestStatus - Throws:
UserManagementSystemExceptionGroupRetrievalFaultUserRetrievalFault
-
requestMembership
GCubeMembershipRequest requestMembership(long userId, long groupId, String comment) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault request the membership to a restricted Site, no further actions are performed (no emails are sent, nor notifications)- Parameters:
userId- the LR useridgroupId- the LR groupId thecomment- a comment to the request must not be null- Throws:
UserManagementSystemExceptionGroupRetrievalFaultUserRetrievalFault
-
acceptMembershipRequest
GCubeMembershipRequest acceptMembershipRequest(long requestUserId, long groupId, boolean addUserToGroup, String replyUsername, String replyComment) throws UserManagementSystemException, GroupRetrievalFault, UserManagementPortalException accept a membership request and optionally add the user to the group- Parameters:
requestUserId- the LR userid of the requestgroupId- the LR groupIdaddUserToGroup- if you want it to also add the user to the groupreplyUsername- the username (screenname) of the user accepting the requestreplyComment- a comment attachd to the reply (must not be null)- Throws:
UserManagementSystemException- if a system exception occursGroupRetrievalFaultUserManagementPortalException
-
rejectMembershipRequest
GCubeMembershipRequest rejectMembershipRequest(long userId, long groupId, String replyUsername, String replyComment) throws UserManagementSystemException, GroupRetrievalFault, UserManagementPortalException rejects a membership request- Parameters:
userId- the LR userid of the requestgroupId- the LR groupIdreplyUsername- the username (screenname) of the user accepting the requestreplyComment- a comment attachd to the reply (must not be null)- Throws:
UserManagementSystemException- if a system exception occursGroupRetrievalFaultUserManagementPortalException
-
listUsersAndRolesByGroup
Map<GCubeUser,List<GCubeRole>> listUsersAndRolesByGroup(long groupId) throws GroupRetrievalFault, UserManagementSystemException, UserRetrievalFault - Parameters:
groupId- the LR groupId- Returns:
- the list of
GCubeUserwith their GCubeRole given the LR GroupId - Throws:
GroupRetrievalFaultUserManagementSystemExceptionUserRetrievalFault
-
listUsersByGroupAndRole
List<GCubeUser> listUsersByGroupAndRole(long groupId, long roleId) throws UserManagementSystemException, RoleRetrievalFault, GroupRetrievalFault, UserRetrievalFault - Parameters:
groupId- the LR groupIdroleId- the LR roleId- Returns:
- the list of
GCubeUserhaving group and role that matches - Throws:
GroupRetrievalFault- if the group does not existUserManagementSystemExceptionUserRetrievalFaultRoleRetrievalFault
-
listUserIdsByGroupAndRole
long[] listUserIdsByGroupAndRole(long groupId, long roleId) - Parameters:
groupId-roleId-- Returns:
- the list of userId having group and role that matches
-
listUsersByTeam
List<GCubeUser> listUsersByTeam(long teamId) throws UserManagementSystemException, TeamRetrievalFault, UserRetrievalFault /**- Parameters:
teamId- the LR teamId- Returns:
- the list of
GCubeUserhaving teamId that matches - Throws:
TeamRetrievalFault- if the team does not existUserManagementSystemExceptionUserRetrievalFault
-
assignUserToGroup
void assignUserToGroup(long groupId, long userId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault, UserManagementPortalException this method assigns the user to the Group and perform other necessary actions (such as adding him to the HL Folder)- Parameters:
groupId- LR groupIduserId- LR userId- Throws:
UserManagementSystemExceptionGroupRetrievalFaultUserRetrievalFaultUserManagementPortalException
-
dismissUserFromGroup
void dismissUserFromGroup(long groupId, long userId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault this method removes the user to the Group and perform other necessary actions (such as removing him from the HL Folder)- Parameters:
groupId- LR groupIduserId- LR userId- Throws:
UserManagementSystemExceptionGroupRetrievalFaultUserRetrievalFault
-
listUnregisteredUsersByGroup
List<GCubeUser> listUnregisteredUsersByGroup(long groupId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault - Parameters:
groupId- LR groupId- Returns:
- all the users of the portal not belonging to the groupId
- Throws:
UserManagementSystemExceptionGroupRetrievalFaultUserRetrievalFault
-
isPasswordChanged
Check if the user changed his/her password from the initial one.- Parameters:
email- the email of the user to consider- Returns:
- true if the password has been changed, false if it has been not or the user doesn't exist.
-
userExistsByEmail
Check if a user with such email exists.- Parameters:
email-- Returns:
- true on success, false otherwise
-
getFullNameFromEmail
Returns the user's full name given his email- Parameters:
email-- Returns:
- null on failure
-
deleteUserByEMail
void deleteUserByEMail(String email) throws UserManagementSystemException, UserManagementPortalException, com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException Delete a user given his mail- Parameters:
email-- Throws:
UserManagementSystemExceptionUserManagementPortalExceptioncom.liferay.portal.kernel.exception.PortalExceptioncom.liferay.portal.kernel.exception.SystemException
-
getUserAvatarBytes
Retrieve user's avatar as bytes -
getUserOpenId
Retrieve user's openId field -
updateContactInformation
boolean updateContactInformation(String screenName, String mySpacesn, String twittersn, String facebooksn, String skypesn, String jabbersn, String aimsn) Update screenName user's contact information- Parameters:
screenName-mySpacesn- used for linkedin contact infotwittersn-facebooksn-skypesn-jabbersn-aimsn-- Returns:
- true on success, false otherwise
-
updateJobTitle
- Parameters:
userId-theJob- the job headline- Returns:
- true if ok
-
readCustomAttr
- Parameters:
attributeKey- the name of the attribute you want to read its value- Returns:
- the attributeKey value if existing, null otherwise
- Throws:
UserRetrievalFault
-
saveCustomAttr
- Parameters:
userId-attributeKey- the name of the attribute you want to savevalue- the value- Throws:
UserRetrievalFault
-
getUserIdsByGroup
Retrieve the list of user identifiers by group id.- Returns:
-