Class UserHelper

java.lang.Object
org.exoplatform.forum.common.UserHelper

public class UserHelper extends Object
Version:
$Revision$
Author:
Patrice Lamarque
  • 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

      public static List<org.exoplatform.services.organization.Group> getAllGroup() throws Exception
      Throws:
      Exception
    • checkValueUser

      public static String checkValueUser(String values) throws Exception
      Throws:
      Exception
    • hasGroupIdAndMembershipId

      public static boolean hasGroupIdAndMembershipId(String str) throws Exception
      Throws:
      Exception
    • hasUserInGroup

      public static boolean hasUserInGroup(String groupId, String userId)
      Check user in group
      Parameters:
      groupId - The group to check
      userId - 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

      public static boolean isDisabledUser(String userName)
      Check user disable on system or not.
      Parameters:
      userName - The user name
      Returns:
    • getUserGroups

      public static String[] getUserGroups() throws Exception
      Throws:
      Exception
    • getAllGroupId

      public static List<String> getAllGroupId() throws Exception
      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

      public static List<String> getAllGroupAndMembershipOfUser(String userId)
      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

      public static String getEmailUser(String userName) throws Exception
      Throws:
      Exception
    • getCurrentUser

      public static String getCurrentUser()
    • getDisplayNameOfOwner

      public static String getDisplayNameOfOwner(String owner) throws Exception
      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 filter
      listUsers - The result before filter
      matchGroup - 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 filter
      user - the user
      Returns:
    • queryFilter

      public static org.exoplatform.services.organization.Query queryFilter(UserHelper.UserFilter userFilter)
      Build query filter for search user
      Parameters:
      userFilter -
      Returns: