Class AdminController

  • All Implemented Interfaces:
    Serializable

    @Service
    public class AdminController
    extends Object
    implements Serializable
    This object is used by all the admin jsp such as SpaceManagement, UserManagement, etc... It provides access functions to query and modify the domains as well as the company organization It should be used only by a client that has the administrator rights
    See Also:
    Serialized Form
    • Constructor Detail

      • AdminController

        protected AdminController()
    • Method Detail

      • getSpaceInstById

        public SpaceInst getSpaceInstById​(String sSpaceId)
        Return the space Instance corresponding to the given space id
      • getUserManageableSpaceIds

        public String[] getUserManageableSpaceIds​(String sUserId)
        Return the space Instance corresponding to the given space id : FORMAT EX : 123
      • getUserManageableSpaceClientIds

        public String[] getUserManageableSpaceClientIds​(String sUserId)
        Return the space Instance corresponding to the given space id : FORMAT EX : WA123 If user is Admin, return all space Ids
        Returns:
        an array of space identifiers
      • addSpaceInst

        public String addSpaceInst​(SpaceInst spaceInst)
        Add the given space Instance
      • deleteSpaceInstById

        public String deleteSpaceInstById​(UserDetail user,
                                          String sSpaceInstId,
                                          boolean definitive)
        Delete the space Instance corresponding to the given space id
      • updateSpaceInst

        public String updateSpaceInst​(SpaceInst spaceInstNew)
        Update the space Instance corresponding to the given space name with the given SpaceInst
      • getAllRootSpaceIds

        public String[] getAllRootSpaceIds()
        Return all the spaces Id available in Silverpeas
      • getAllSpaceIds

        public String[] getAllSpaceIds()
        Return all the spaces Id available in Silverpeas
      • getAllSpaceIds

        public String[] getAllSpaceIds​(String userId)
        Return all the spaces Id available for the given userId
      • getAllSubSpaceIds

        public String[] getAllSubSpaceIds​(String sDomainFatherId)
        Return all the sub spaces Id available in Silverpeas given the fatherDomainId
      • getAllSubSpaceIds

        public String[] getAllSubSpaceIds​(String sDomainFatherId,
                                          String userId)
        Return all the sub spaces Id available for the given user and the given fatherDomainId
      • updateSpaceOrderNum

        public void updateSpaceOrderNum​(String sSpaceId,
                                        int orderNum)
      • indexSpace

        public void indexSpace​(int spaceId)
      • deleteAllSpaceIndexes

        public void deleteAllSpaceIndexes()
      • getAllComponents

        public Map<String,​WAComponent> getAllComponents()
        Return all the components of silverpeas read in the xmlComponent directory
      • getComponentInst

        public ComponentInst getComponentInst​(String sComponentId)
        Return the component Instance corresponding to the given component id
      • deleteComponentInst

        public String deleteComponentInst​(UserDetail user,
                                          String sComponentId,
                                          boolean definitive)
        Delete the component Instance corresponding to the given component id
      • updateComponentInst

        public String updateComponentInst​(ComponentInst componentInst)
        Update the component Instance corresponding to the given space component with the given ComponentInst
      • getAvailCompoIds

        public String[] getAvailCompoIds​(String sClientSpaceId,
                                         String sUserId)
        Return the component ids available for the current user Id in the given space id
      • isComponentAvailable

        public boolean isComponentAvailable​(String componentId,
                                            String userId)
      • isSpaceAvailable

        public boolean isSpaceAvailable​(String userId,
                                        String spaceId)
        Is a user can access the specified space?
        Parameters:
        userId - the user id.
        spaceId - the space id.
        Returns:
        true if the space is accessible - false otherwise.
      • setComponentPlace

        public void setComponentPlace​(String componentId,
                                      String idComponentBefore,
                                      ComponentInst[] brothersComponents)
      • indexComponent

        public void indexComponent​(String componentId)
      • deleteAllComponentIndexes

        public void deleteAllComponentIndexes()
      • restoreSpaceFromBasket

        public void restoreSpaceFromBasket​(String spaceId)
      • restoreComponentFromBasket

        public void restoreComponentFromBasket​(String componentId)
      • getAllProfilesNames

        public String[] getAllProfilesNames​(String sComponentName)
        Return all the profiles names available for the given profile
      • getProfileInst

        public ProfileInst getProfileInst​(String sProfileId)
        Return the profile Instance corresponding to the given profile id
      • addProfileInst

        public String addProfileInst​(ProfileInst profileInst)
        Add the given Profile Instance
      • deleteProfileInst

        public String deleteProfileInst​(String sProfileId)
        Delete the Profile Instance corresponding to the given Profile id.
        Parameters:
        sProfileId - the identifier of the role profile.
        Returns:
        the identifier of the deleted role profile.
      • deleteProfileInst

        public String deleteProfileInst​(String sProfileId,
                                        String userId)
      • updateProfileInst

        public String updateProfileInst​(ProfileInst profileInst)
        Update the Profile Instance corresponding to the given space Profile with the given ProfileInst
      • getProfileLabelByName

        public String getProfileLabelByName​(String sComponentName,
                                            String sProfileName,
                                            String lang)
        Get the profile label from its name
      • getProfileIds

        public String[] getProfileIds​(String sUserId)
        All the profiles to which the user belongs
        Returns:
        an array of profile IDs
      • getProfileIdsOfGroup

        public String[] getProfileIdsOfGroup​(String sGroupId)
        All the profiles to which the group belongs
        Returns:
        an array of profile IDs
      • updateDomain

        public String updateDomain​(Domain theDomain)
        update a domain
      • getDomain

        public Domain getDomain​(String domainId)
        Get a domain with given id
      • getDomainActions

        public long getDomainActions​(String domainId)
        Get a domain's possible actions
      • getRootGroupsOfDomain

        public GroupDetail[] getRootGroupsOfDomain​(String domainId)
        Get ALL the domain's groups
      • getAllUsersOfGroup

        public UserDetail[] getAllUsersOfGroup​(String groupId)
        Get ALL the users that are in a group or his sub groups
      • getUsersOfDomain

        public UserDetail[] getUsersOfDomain​(String domainId)
        Get ALL the domain's users
      • getUserIdsOfDomain

        public String[] getUserIdsOfDomain​(String domainId)
        Get ALL the userId of the domain
      • getAllDomains

        public Domain[] getAllDomains()
        Get all domains declared in Silverpeas
      • getSpaceProfileInst

        public SpaceProfileInst getSpaceProfileInst​(String sSpaceProfileId)
        Return the space profile Instance corresponding to the given space profile id
      • addSpaceProfileInst

        public String addSpaceProfileInst​(SpaceProfileInst spaceProfileInst,
                                          String userId)
        Add the given Space Profile Instance
      • deleteSpaceProfileInst

        public void deleteSpaceProfileInst​(String sSpaceProfileId,
                                           String userId)
        Delete the Space Profile Instance corresponding to the given Space Profile id
      • updateSpaceProfileInst

        public String updateSpaceProfileInst​(SpaceProfileInst spaceProfileInst,
                                             String userId)
        Update the Space Profile Instance corresponding to the given space Profile with the given SpaceProfileInst
      • getAllSubGroups

        public Group[] getAllSubGroups​(String groupId)
      • getGroupName

        public String getGroupName​(String sGroupId)
        Return the group name corresponding to the given group Id
      • getGroupManageableSpaceIds

        public String[] getGroupManageableSpaceIds​(String sGroupId)
        The spaces that can be managed by the given group
        Returns:
        the array of space IDs
      • updateGroupProfile

        public void updateGroupProfile​(GroupProfileInst profile)
        Update the GroupDetail Profile
      • getUserDetail

        public UserDetail getUserDetail​(String sId)
        Return the admin user detail corresponding to the given id
      • getUserFull

        public UserFull getUserFull​(String sUserId)
        Return the UserFull of the user with the given Id
      • getUserIdByLoginAndDomain

        public String getUserIdByLoginAndDomain​(String sLogin,
                                                String sDomainId)
      • isUserByLoginAndDomainExist

        public boolean isUserByLoginAndDomainExist​(String login,
                                                   String domainId)
      • getUserDetails

        public UserDetail[] getUserDetails​(String[] asUserIds)
        Return an array of UserDetail corresponding to the given user Id array
      • blockUser

        public void blockUser​(String userId)
        Block the given user
      • unblockUser

        public void unblockUser​(String userId)
        Unblock the given user
      • deactivateUser

        public void deactivateUser​(String userId)
        Deactivate the given user
      • activateUser

        public void activateUser​(String userId)
        Activate the given user
      • setUserSensitiveData

        public void setUserSensitiveData​(String userId,
                                         boolean areSensitive)
      • deleteUser

        public String deleteUser​(String sUserId)
        Delete the given user
      • restoreUser

        public String restoreUser​(String sUserId)
        Restores the given user
      • removeUser

        public String removeUser​(String sUserId)
        Removes the given user
      • updateUser

        public String updateUser​(UserDetail userDetail)
        Update the given user
      • updateSynchronizedUser

        public String updateSynchronizedUser​(UserDetail userDetail)
        Update the silverpeas specific infos of a synchronized user. For the moment : same as updateUser
      • authenticate

        public String authenticate​(String sKey,
                                   String sSessionId,
                                   boolean isAppInMaintenance)
      • indexAllUsers

        public void indexAllUsers()
      • getGroupById

        public GroupDetail getGroupById​(String sGroupId)
        Return the admin group detail corresponding to the given id
      • getPathToGroup

        public List<String> getPathToGroup​(String groupId)
        Return the groupIds from root to group
      • getGroupByNameInDomain

        public GroupDetail getGroupByNameInDomain​(String sGroupName,
                                                  String sDomainFatherId)
        Return the admin group detail corresponding to the given group Name
      • restoreGroupById

        public List<GroupDetail> restoreGroupById​(String groupId)
        Restores the given group
      • updateGroup

        public String updateGroup​(GroupDetail group)
        Update the given group
      • indexAllGroups

        public void indexAllGroups()
      • synchronizeSilverpeasWithDomain

        public String synchronizeSilverpeasWithDomain​(String domainId)
        Synchronize users and groups between cache and domain's datastore
        Parameters:
        domainId - Id of domain to synchronize
        Returns:
        String to show as the report of synchronization
      • synchronizeUser

        public String synchronizeUser​(String userId)
      • synchronizeImportUser

        public String synchronizeImportUser​(String domainId,
                                            String userLogin)
      • synchronizeRemoveUser

        public String synchronizeRemoveUser​(String userId)
      • synchronizeGroup

        public String synchronizeGroup​(String groupId)
        Synchronizes the users of the group represented by the given identifier.
        Two types of synchronization are possible:
        • when the group is synchronized from an LDAP domain, it is synchronized directly with the LDAP
        • otherwise, the synchronization is done from the rule defined for the group
        It is no guarantee that this treatment behavior is right if it is called out of the two previous cases.
        Parameters:
        groupId - the identifier of the group to process.
        Returns:
        • in case of success, the identifier of the group (a number)
        • in case of error about the synchronization rule expression syntax, the key of the error from PrefixedNotationExpressionEngine (it can be used for bundles for example)
        • in case of error about the ground rule syntax, the key of the error and the ground rule as string both separated by '|' character (it can be used for bundles for example)
        • an empty value otherwise
      • synchronizeRemoveGroup

        public String synchronizeRemoveGroup​(String groupId)
      • removeUserFromGroup

        public void removeUserFromGroup​(String sUserId,
                                        String sGroupId)
        Removes the given user from the given group
      • addUserInGroup

        public void addUserInGroup​(String sUserId,
                                   String sGroupId)
        Removes the given user from the given group
      • isDomainManagerUser

        public boolean isDomainManagerUser​(String userId,
                                           String domainId)