Package org.exoplatform.forum.common
Class UserHelper
java.lang.Object
org.exoplatform.forum.common.UserHelper
- Version:
- $Revision$
- Author:
- Patrice Lamarque
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcheckValueUser(String values) static List<org.exoplatform.services.organization.User>filter(UserHelper.UserFilter userFilter, org.exoplatform.commons.utils.ListAccess<org.exoplatform.services.organization.User> listUsers, boolean matchGroup) Filter users on ListAccess resultstatic List<org.exoplatform.services.organization.Group>findGroups(org.exoplatform.services.organization.Group group) static Collection<org.exoplatform.services.organization.Membership>findMembershipsByUser(String userId) Get all memberships of user by userIdstatic List<org.exoplatform.services.organization.Group>getAllGroupAndMembershipOfUser(String userId) static Stringstatic StringgetDisplayNameOfOwner(String owner) Get the display name of user or group or membershipstatic StringgetEmailUser(String userName) static org.exoplatform.services.organization.GroupHandlerstatic org.exoplatform.services.organization.MembershipHandlerstatic org.exoplatform.services.organization.OrganizationServicestatic org.exoplatform.services.organization.UsergetUserByUserId(String userId) static String[]static org.exoplatform.services.organization.UserHandlerstatic org.exoplatform.commons.utils.ListAccess<org.exoplatform.services.organization.User>getUserPageListByGroupId(String groupId) Get all users on group by groupIdstatic booleanstatic booleanhasUserInGroup(String groupId, String userId) Check user in groupstatic booleanisAnonim()static booleanisDisabledUser(String userName) Check user disable on system or not.static booleanmatchUser(UserHelper.UserFilter userFilter, org.exoplatform.services.organization.User user) Match user with user filterstatic org.exoplatform.services.organization.QueryqueryFilter(UserHelper.UserFilter userFilter) Build query filter for search userstatic org.exoplatform.commons.utils.ListAccess<org.exoplatform.services.organization.User>searchUser(UserHelper.UserFilter userFilter) Search user by query
-
Constructor Details
-
UserHelper
public UserHelper()
-
-
Method Details
-
getOrganizationService
public static org.exoplatform.services.organization.OrganizationService getOrganizationService() -
getUserHandler
public static org.exoplatform.services.organization.UserHandler getUserHandler() -
getGroupHandler
public static org.exoplatform.services.organization.GroupHandler getGroupHandler() -
getMembershipHandler
public static org.exoplatform.services.organization.MembershipHandler getMembershipHandler() -
getAllGroup
- Throws:
Exception
-
checkValueUser
- Throws:
Exception
-
hasGroupIdAndMembershipId
- Throws:
Exception
-
hasUserInGroup
Check user in group- Parameters:
groupId- The group to checkuserId- The user's id that to check- Returns:
-
getUserPageListByGroupId
public static org.exoplatform.commons.utils.ListAccess<org.exoplatform.services.organization.User> getUserPageListByGroupId(String groupId) throws Exception Get all users on group by groupId- Parameters:
groupId- The group's id- Returns:
- ListAccess of Users.
- Throws:
Exception
-
getUserByUserId
public static org.exoplatform.services.organization.User getUserByUserId(String userId) throws Exception - Throws:
Exception
-
isDisabledUser
Check user disable on system or not.- Parameters:
userName- The user name- Returns:
-
getUserGroups
- Throws:
Exception
-
getAllGroupId
- Throws:
Exception
-
findGroups
public static List<org.exoplatform.services.organization.Group> findGroups(org.exoplatform.services.organization.Group group) throws Exception - Throws:
Exception
-
isAnonim
public static boolean isAnonim() -
findMembershipsByUser
public static Collection<org.exoplatform.services.organization.Membership> findMembershipsByUser(String userId) Get all memberships of user by userId- Parameters:
userId- The user's id- Returns:
- list of memberships
-
getAllGroupAndMembershipOfUser
- Parameters:
userId- userame- Returns:
- list of groups an user belong, and memberships of the user in each group. If userId is null, groups and memberships of the current user will be returned.
-
getEmailUser
- Throws:
Exception
-
getCurrentUser
-
getDisplayNameOfOwner
Get the display name of user or group or membership- Parameters:
owner- The id of user or group or membership- Returns:
- The String value
- Throws:
Exception
-
searchUser
public static org.exoplatform.commons.utils.ListAccess<org.exoplatform.services.organization.User> searchUser(UserHelper.UserFilter userFilter) throws Exception Search user by query- Parameters:
userFilter- The UserFilter- Returns:
- The result is ListAccess of Users
- Throws:
Exception
-
filter
public static List<org.exoplatform.services.organization.User> filter(UserHelper.UserFilter userFilter, org.exoplatform.commons.utils.ListAccess<org.exoplatform.services.organization.User> listUsers, boolean matchGroup) throws Exception Filter users on ListAccess result- Parameters:
userFilter- The user filterlistUsers- The result before filtermatchGroup- Is match group or match user- Returns:
- Throws:
Exception
-
matchUser
public static boolean matchUser(UserHelper.UserFilter userFilter, org.exoplatform.services.organization.User user) Match user with user filter- Parameters:
userFilter- The user filteruser- the user- Returns:
-
queryFilter
public static org.exoplatform.services.organization.Query queryFilter(UserHelper.UserFilter userFilter) Build query filter for search user- Parameters:
userFilter-- Returns:
-