com.stratelia.webactiv.beans.admin
Class GroupManager

java.lang.Object
  extended by com.stratelia.webactiv.beans.admin.GroupManager

public class GroupManager
extends Object


Method Summary
 String addGroup(DomainDriverManager ddManager, Group group, boolean onlyInSilverpeas)
          Add the given group in Silverpeas
 void addUserInGroup(DomainDriverManager ddManager, String sUserId, String sGroupId)
          Add a user to a group
 String deleteGroupById(DomainDriverManager ddManager, Group group, boolean onlyInSilverpeas)
          Delete the group with the given Id The delete is apply recursively to the sub-groups
static GroupManager get()
           
 AdminGroupInst[] getAdminOrganization(DomainDriverManager ddManager)
          Get Silverpeas admin organization
 String[] getAllGroupIds(DomainDriverManager ddManager)
          Get the all the groups id available in Silverpeas
 List<String> getAllGroupsOfUser(DomainDriverManager ddManager, String userId)
          Get all group ids containing a user.
 String[] getAllRootGroupIds(DomainDriverManager ddManager)
          Get the all the root groups id available in Silverpeas
 Group[] getAllRootGroups(DomainDriverManager ddManager)
          Gets all the root user groups in Silverpeas.
 String[] getAllSubGroupIds(DomainDriverManager ddManager, String superGroupId)
          Get the all the direct sub groups id of a given group
 List<String> getAllSubGroupIdsRecursively(String superGroupId)
          Get the all the sub groups id of a given group
 String[] getDirectGroupsOfUser(DomainDriverManager ddManager, String sUserId)
          Get the direct groups id containing a user.
 Group getGroup(DomainDriverManager ddManager, String sGroupId)
          Get group information with the given id from Silverpeas
 Group getGroup(String groupId)
           
 Group getGroupByNameInDomain(DomainDriverManager ddManager, String sGroupName, String sDomainFatherId)
          Get group information with the given group name
 String getGroupIdBySpecificIdAndDomainId(DomainDriverManager ddManager, String sSpecificId, String sDomainId)
          Get the Silverpeas group id of group qualified by given specific Id and domain id
 ListSlice<Group> getGroupsMatchingCriteria(GroupSearchCriteriaForDAO criteria)
          Gets the groups that match the specified criteria.
 Group[] getGroupsOfDomain(DomainDriverManager ddManager, String sDomainId)
          Get the groups of domain
 List<String> getManageableGroupIds(String userId, List<String> groupIds)
           
 int getNBUsersDirectlyInGroup(String groupId)
           
 List<String> getPathToGroup(DomainDriverManager ddManager, String groupId)
          Get the path from root to a given group
 String[] getRootGroupIdsOfDomain(DomainDriverManager ddManager, String sDomainId)
           
 Group[] getRootGroupsOfDomain(DomainDriverManager ddManager, String sDomainId)
           
 Group[] getSynchronizedGroups(DomainDriverManager ddManager)
           
 int getTotalUserCountInGroup(String domainId, String groupId)
          Gets the total number of users in the specified group, that is to say the number of distinct users in the specified group and in its subgroups.
 List<String> getUsersDirectlyInGroup(String groupId)
           
 boolean isGroupExist(DomainDriverManager ddManager, String sName)
          /** Check if the given group exists
 void removeUserFromGroup(DomainDriverManager ddManager, String sUserId, String sGroupId)
          Remove a user from a group
 Group[] searchGroups(DomainDriverManager ddManager, Group modelGroup, boolean isAnd)
           
 String[] searchGroupsIds(DomainDriverManager ddManager, boolean isRootGroup, String componentId, String[] aProfileId, Group modelGroup)
           
 String updateGroup(DomainDriverManager ddManager, Group group, boolean onlyInSilverpeas)
          Update the given group
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static GroupManager get()

getGroupsMatchingCriteria

public ListSlice<Group> getGroupsMatchingCriteria(GroupSearchCriteriaForDAO criteria)
                                           throws AdminException
Gets the groups that match the specified criteria.

Parameters:
criteria - the criteria in searching of user groups.
Returns:
a slice of the list of user groups matching the criteria or an empty list of no ones are found.
Throws:
AdminException - if an error occurs while getting the user groups.

getTotalUserCountInGroup

public int getTotalUserCountInGroup(String domainId,
                                    String groupId)
                             throws AdminException
Gets the total number of users in the specified group, that is to say the number of distinct users in the specified group and in its subgroups.

Parameters:
domainId - the unique identifier to which the group belong.
groupId - the unique identifier of the group.
Returns:
the total users count in the specified group.
Throws:
AdminException - if an error occurs while computing the user count.

addUserInGroup

public void addUserInGroup(DomainDriverManager ddManager,
                           String sUserId,
                           String sGroupId)
                    throws AdminException
Add a user to a group

Parameters:
ddManager -
sUserId -
sGroupId -
Throws:
AdminException

removeUserFromGroup

public void removeUserFromGroup(DomainDriverManager ddManager,
                                String sUserId,
                                String sGroupId)
                         throws AdminException
Remove a user from a group

Parameters:
ddManager -
sUserId -
sGroupId -
Throws:
AdminException

getDirectGroupsOfUser

public String[] getDirectGroupsOfUser(DomainDriverManager ddManager,
                                      String sUserId)
                               throws AdminException
Get the direct groups id containing a user. Groups that the user is linked to by transitivity are not returned.

Parameters:
ddManager -
sUserId -
Returns:
Throws:
AdminException

getAllGroupsOfUser

public List<String> getAllGroupsOfUser(DomainDriverManager ddManager,
                                       String userId)
                                throws AdminException
Get all group ids containing a user. So, groups that the user is linked to by transitivity are returned too (recursive treatment).

Parameters:
ddManager -
userId -
Returns:
Throws:
AdminException

getGroupIdBySpecificIdAndDomainId

public String getGroupIdBySpecificIdAndDomainId(DomainDriverManager ddManager,
                                                String sSpecificId,
                                                String sDomainId)
                                         throws AdminException
Get the Silverpeas group id of group qualified by given specific Id and domain id

Parameters:
ddManager -
sSpecificId -
sDomainId -
Returns:
Throws:
AdminException

getAllGroupIds

public String[] getAllGroupIds(DomainDriverManager ddManager)
                        throws AdminException
Get the all the groups id available in Silverpeas

Parameters:
ddManager -
Returns:
Throws:
AdminException

getAllRootGroupIds

public String[] getAllRootGroupIds(DomainDriverManager ddManager)
                            throws AdminException
Get the all the root groups id available in Silverpeas

Parameters:
ddManager -
Returns:
Throws:
AdminException

getAllRootGroups

public Group[] getAllRootGroups(DomainDriverManager ddManager)
                         throws AdminException
Gets all the root user groups in Silverpeas.

Parameters:
ddManager - the manager of domain drivers in use in Silverpeas.
Returns:
an array of root user groups.
Throws:
AdminException - if an error occurs while getting the root groups.

getAllSubGroupIds

public String[] getAllSubGroupIds(DomainDriverManager ddManager,
                                  String superGroupId)
                           throws AdminException
Get the all the direct sub groups id of a given group

Parameters:
ddManager -
superGroupId -
Returns:
Throws:
AdminException

getPathToGroup

public List<String> getPathToGroup(DomainDriverManager ddManager,
                                   String groupId)
                            throws AdminException
Get the path from root to a given group

Parameters:
ddManager -
groupId -
Returns:
Throws:
AdminException

isGroupExist

public boolean isGroupExist(DomainDriverManager ddManager,
                            String sName)
                     throws AdminException
/** Check if the given group exists

Parameters:
ddManager -
sName -
Returns:
true if a group with the given name
Throws:
AdminException

getGroup

public Group getGroup(String groupId)
               throws AdminException
Throws:
AdminException

getGroup

public Group getGroup(DomainDriverManager ddManager,
                      String sGroupId)
               throws AdminException
Get group information with the given id from Silverpeas

Parameters:
ddManager -
sGroupId -
Returns:
Throws:
AdminException

getAllSubGroupIdsRecursively

public List<String> getAllSubGroupIdsRecursively(String superGroupId)
                                          throws AdminException
Get the all the sub groups id of a given group

Parameters:
superGroupId -
Returns:
Throws:
AdminException

getGroupByNameInDomain

public Group getGroupByNameInDomain(DomainDriverManager ddManager,
                                    String sGroupName,
                                    String sDomainFatherId)
                             throws AdminException
Get group information with the given group name

Parameters:
ddManager -
sGroupName -
sDomainFatherId -
Returns:
Throws:
AdminException

getRootGroupsOfDomain

public Group[] getRootGroupsOfDomain(DomainDriverManager ddManager,
                                     String sDomainId)
                              throws AdminException
Parameters:
ddManager -
sDomainId -
Returns:
Throws:
AdminException

getSynchronizedGroups

public Group[] getSynchronizedGroups(DomainDriverManager ddManager)
                              throws AdminException
Parameters:
ddManager -
Returns:
Throws:
AdminException

getRootGroupIdsOfDomain

public String[] getRootGroupIdsOfDomain(DomainDriverManager ddManager,
                                        String sDomainId)
                                 throws AdminException
Parameters:
ddManager -
sDomainId -
Returns:
Throws:
AdminException

getGroupsOfDomain

public Group[] getGroupsOfDomain(DomainDriverManager ddManager,
                                 String sDomainId)
                          throws AdminException
Get the groups of domain

Parameters:
ddManager -
sDomainId -
Returns:
Throws:
AdminException

searchGroupsIds

public String[] searchGroupsIds(DomainDriverManager ddManager,
                                boolean isRootGroup,
                                String componentId,
                                String[] aProfileId,
                                Group modelGroup)
                         throws AdminException
Throws:
AdminException

searchGroups

public Group[] searchGroups(DomainDriverManager ddManager,
                            Group modelGroup,
                            boolean isAnd)
                     throws AdminException
Parameters:
ddManager -
modelGroup -
isAnd -
Returns:
Throws:
AdminException

addGroup

public String addGroup(DomainDriverManager ddManager,
                       Group group,
                       boolean onlyInSilverpeas)
                throws AdminException
Add the given group in Silverpeas

Parameters:
ddManager -
group -
onlyInSilverpeas -
Returns:
Throws:
AdminException

deleteGroupById

public String deleteGroupById(DomainDriverManager ddManager,
                              Group group,
                              boolean onlyInSilverpeas)
                       throws AdminException
Delete the group with the given Id The delete is apply recursively to the sub-groups

Parameters:
ddManager -
group -
onlyInSilverpeas -
Returns:
Throws:
AdminException

updateGroup

public String updateGroup(DomainDriverManager ddManager,
                          Group group,
                          boolean onlyInSilverpeas)
                   throws AdminException
Update the given group

Parameters:
ddManager -
group -
onlyInSilverpeas -
Returns:
Throws:
AdminException

getAdminOrganization

public AdminGroupInst[] getAdminOrganization(DomainDriverManager ddManager)
                                      throws AdminException
Get Silverpeas admin organization

Parameters:
ddManager -
Returns:
an array of AdminGroupInst containing the organization
Throws:
AdminException

getManageableGroupIds

public List<String> getManageableGroupIds(String userId,
                                          List<String> groupIds)
                                   throws AdminException
Throws:
AdminException

getNBUsersDirectlyInGroup

public int getNBUsersDirectlyInGroup(String groupId)
                              throws AdminException
Throws:
AdminException

getUsersDirectlyInGroup

public List<String> getUsersDirectlyInGroup(String groupId)
                                     throws AdminException
Throws:
AdminException


Copyright © 2016 Silverpeas. All Rights Reserved.