Class AdminController
- java.lang.Object
-
- org.silverpeas.core.admin.service.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AdminController.Result<T>
-
Constructor Summary
Constructors Modifier Constructor Description protected
AdminController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activateUser(String userId)
Activate the given userString
addComponentInst(ComponentInst componentInst)
Add the given component InstanceString
addGroup(GroupDetail group)
Add the given groupString
addProfileInst(ProfileInst profileInst)
Add the given Profile InstanceString
addProfileInst(ProfileInst profileInst, String userId)
String
addSpaceInst(SpaceInst spaceInst)
Add the given space InstanceString
addSpaceProfileInst(SpaceProfileInst spaceProfileInst, String userId)
Add the given Space Profile InstanceString
addUser(UserDetail userDetail)
Add the given uservoid
addUserInGroup(String sUserId, String sGroupId)
Removes the given user from the given groupvoid
assignRightsFromGroupToGroup(RightAssignationContext.MODE operationMode, String sourceGroupId, String targetGroupId, boolean nodeAssignRights, String authorId)
void
assignRightsFromGroupToUser(RightAssignationContext.MODE operationMode, String sourceGroupId, String targetUserId, boolean nodeAssignRights, String authorId)
void
assignRightsFromUserToGroup(RightAssignationContext.MODE operationMode, String sourceUserId, String targetGroupId, boolean nodeAssignRights, String authorId)
void
assignRightsFromUserToUser(RightAssignationContext.MODE operationMode, String sourceUserId, String targetUserId, boolean nodeAssignRights, String authorId)
String
authenticate(String sKey, String sSessionId, boolean isAppInMaintenance)
void
blankDeletedUsers(String targetDomainId, List<String> userIds)
void
blockUser(String userId)
Block the given userString
copyAndPasteComponent(PasteDetail pasteDetail)
String
copyAndPasteSpace(PasteDetail pasteDetail)
void
deactivateUser(String userId)
Deactivate the given uservoid
deleteAllComponentIndexes()
void
deleteAllSpaceIndexes()
String
deleteComponentInst(UserDetail user, String sComponentId, boolean definitive)
Delete the component Instance corresponding to the given component idList<GroupDetail>
deleteGroupById(String sGroupId)
Delete the given groupString
deleteProfileInst(String sProfileId)
Delete the Profile Instance corresponding to the given Profile id.String
deleteProfileInst(String sProfileId, String userId)
String
deleteSpaceInstById(UserDetail user, String sSpaceInstId, boolean definitive)
Delete the space Instance corresponding to the given space idvoid
deleteSpaceProfileInst(String sSpaceProfileId, String userId)
Delete the Space Profile Instance corresponding to the given Space Profile idString
deleteUser(String sUserId)
Delete the given uservoid
disableDataSensitivity(String targetDomainId, List<String> userIds)
Map<String,WAComponent>
getAllComponents()
Return all the components of silverpeas read in the xmlComponent directoryDomain[]
getAllDomains()
Get all domains declared in SilverpeasString[]
getAllProfilesNames(String sComponentName)
Return all the profiles names available for the given profileString[]
getAllRootSpaceIds()
Return all the spaces Id available in SilverpeasString[]
getAllSpaceIds()
Return all the spaces Id available in SilverpeasString[]
getAllSpaceIds(String userId)
Return all the spaces Id available for the given userIdGroup[]
getAllSubGroups(String groupId)
String[]
getAllSubSpaceIds(String sDomainFatherId)
Return all the sub spaces Id available in Silverpeas given the fatherDomainIdString[]
getAllSubSpaceIds(String sDomainFatherId, String userId)
Return all the sub spaces Id available for the given user and the given fatherDomainIdUserDetail[]
getAllUsersOfGroup(String groupId)
Get ALL the users that are in a group or his sub groupsString[]
getAvailCompoIds(String sClientSpaceId, String sUserId)
Return the component ids available for the current user Id in the given space idComponentInst
getComponentInst(String sComponentId)
Return the component Instance corresponding to the given component idComponentInstLight
getComponentInstLight(String sComponentId)
List<UserDetail>
getDeletedUsersInDomain(String domainId)
List<GroupDetail>
getDirectGroupsOfUser(String userId)
Domain
getDomain(String domainId)
Get a domain with given idlong
getDomainActions(String domainId)
Get a domain's possible actionsGroupDetail
getGroupById(String sGroupId)
Return the admin group detail corresponding to the given idGroupDetail
getGroupByNameInDomain(String sGroupName, String sDomainFatherId)
Return the admin group detail corresponding to the given group NameString[]
getGroupManageableSpaceIds(String sGroupId)
The spaces that can be managed by the given groupString
getGroupName(String sGroupId)
Return the group name corresponding to the given group IdGroupProfileInst
getGroupProfile(String groupId)
Return the group profileList<SpaceInstLight>
getPathToComponent(String componentId)
List<String>
getPathToGroup(String groupId)
Return the groupIds from root to groupList<SpaceInstLight>
getPathToSpace(String spaceId, boolean includeTarget)
String[]
getProfileIds(String sUserId)
All the profiles to which the user belongsString[]
getProfileIdsOfGroup(String sGroupId)
All the profiles to which the group belongsProfileInst
getProfileInst(String sProfileId)
Return the profile Instance corresponding to the given profile idString
getProfileLabelByName(String sComponentName, String sProfileName, String lang)
Get the profile label from its nameList<ProfileInst>
getProfilesByObject(ProfiledObjectId objectId, String componentId)
String[]
getProfilesByObjectAndUserId(ProfiledObjectId objectRef, String componentId, String userId)
List<ComponentInstLight>
getRemovedComponents()
List<GroupDetail>
getRemovedGroupsInDomain(String domainId)
List<SpaceInstLight>
getRemovedSpaces()
List<UserDetail>
getRemovedUsersInDomain(String domainId)
GroupDetail[]
getRootGroupsOfDomain(String domainId)
Get ALL the domain's groupsSpaceInst
getSpaceInstById(String sSpaceId)
Return the space Instance corresponding to the given space idSpaceInstLight
getSpaceInstLight(String sSpaceId)
SpaceProfileInst
getSpaceProfileInst(String sSpaceProfileId)
Return the space profile Instance corresponding to the given space profile idList<DomainProperty>
getSpecificPropertiesToImportUsers(String domainId, String language)
UserDetail
getUserDetail(String sId)
Return the admin user detail corresponding to the given idUserDetail[]
getUserDetails(String[] asUserIds)
Return an array of UserDetail corresponding to the given user Id arrayUserFull
getUserFull(String sUserId)
Return the UserFull of the user with the given IdUserFull
getUserFull(String domainId, String specificId)
String
getUserIdByLoginAndDomain(String sLogin, String sDomainId)
String[]
getUserIdsOfDomain(String domainId)
Get ALL the userId of the domainString[]
getUserManageableSpaceClientIds(String sUserId)
Return the space Instance corresponding to the given space id : FORMAT EX : WA123 If user is Admin, return all space IdsString[]
getUserManageableSpaceIds(String sUserId)
Return the space Instance corresponding to the given space id : FORMAT EX : 123UserDetail[]
getUsersOfDomain(String domainId)
Get ALL the domain's usersList<UserDetail>
getUsersWithSensitiveData(String domainId)
void
indexAllGroups()
void
indexAllUsers()
void
indexComponent(String componentId)
void
indexSpace(int spaceId)
boolean
isComponentAvailable(String componentId, String userId)
boolean
isDomainManagerUser(String userId, String domainId)
boolean
isSpaceAvailable(String userId, String spaceId)
Is a user can access the specified space?boolean
isUserByLoginAndDomainExist(String login, String domainId)
void
moveComponentInst(String spaceId, String componentId, String idComponentBefore, ComponentInst[] componentInstances)
Move the component Instance in the given space with the given componentIdvoid
moveSpace(String spaceId, String fatherId)
Move space in the given space with the given fatherIdList<GroupDetail>
removeGroupById(String groupId)
Removes the given groupString
removeUser(String sUserId)
Removes the given uservoid
removeUserFromGroup(String sUserId, String sGroupId)
Removes the given user from the given groupvoid
restoreComponentFromBasket(String componentId)
List<GroupDetail>
restoreGroupById(String groupId)
Restores the given groupvoid
restoreSpaceFromBasket(String spaceId)
String
restoreUser(String sUserId)
Restores the given userList<UserDetail>
searchUsers(String domainId, Map<String,String> query)
void
setComponentPlace(String componentId, String idComponentBefore, ComponentInst[] brothersComponents)
void
setUserSensitiveData(String userId, boolean areSensitive)
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.AdminController.Result<String>
synchronizeImportGroup(String domainId, String groupName)
String
synchronizeImportUser(String domainId, String userLogin)
String
synchronizeRemoveGroup(String groupId)
String
synchronizeRemoveUser(String userId)
String
synchronizeSilverpeasWithDomain(String domainId)
Synchronize users and groups between cache and domain's datastoreString
synchronizeUser(String userId)
void
unblockUser(String userId)
Unblock the given userString
updateComponentInst(ComponentInst componentInst)
Update the component Instance corresponding to the given space component with the given ComponentInstString
updateDomain(Domain theDomain)
update a domainString
updateGroup(GroupDetail group)
Update the given groupvoid
updateGroupProfile(GroupProfileInst profile)
Update the GroupDetail ProfileString
updateProfileInst(ProfileInst profileInst)
Update the Profile Instance corresponding to the given space Profile with the given ProfileInstString
updateProfileInst(ProfileInst profileInst, String userId)
String
updateSpaceInst(SpaceInst spaceInstNew)
Update the space Instance corresponding to the given space name with the given SpaceInstvoid
updateSpaceOrderNum(String sSpaceId, int orderNum)
String
updateSpaceProfileInst(SpaceProfileInst spaceProfileInst, String userId)
Update the Space Profile Instance corresponding to the given space Profile with the given SpaceProfileInstString
updateSynchronizedUser(UserDetail userDetail)
Update the silverpeas specific infos of a synchronized user.String
updateUser(UserDetail userDetail)
Update the given userString
updateUserFull(UserFull userFull)
Update the given user
-
-
-
Method Detail
-
getSpaceInstById
public SpaceInst getSpaceInstById(String sSpaceId)
Return the space Instance corresponding to the given space id
-
getSpaceInstLight
public SpaceInstLight getSpaceInstLight(String sSpaceId)
-
getPathToComponent
public List<SpaceInstLight> getPathToComponent(String componentId)
-
getPathToSpace
public List<SpaceInstLight> getPathToSpace(String spaceId, boolean includeTarget)
-
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
-
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()
-
moveSpace
public void moveSpace(String spaceId, String fatherId) throws AdminException
Move space in the given space with the given fatherId- Throws:
AdminException
-
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
-
getComponentInstLight
public ComponentInstLight getComponentInstLight(String sComponentId)
-
addComponentInst
public String addComponentInst(ComponentInst componentInst) throws QuotaException
Add the given component Instance- Throws:
QuotaException
-
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
-
moveComponentInst
public void moveComponentInst(String spaceId, String componentId, String idComponentBefore, ComponentInst[] componentInstances) throws AdminException
Move the component Instance in the given space with the given componentId- Throws:
AdminException
-
getAvailCompoIds
public String[] getAvailCompoIds(String sClientSpaceId, String sUserId)
Return the component ids available for the current user Id in the given space id
-
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()
-
getRemovedSpaces
public List<SpaceInstLight> getRemovedSpaces()
-
getRemovedComponents
public List<ComponentInstLight> getRemovedComponents()
-
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
-
getProfilesByObject
public List<ProfileInst> getProfilesByObject(ProfiledObjectId objectId, String componentId)
-
getProfilesByObjectAndUserId
public String[] getProfilesByObjectAndUserId(ProfiledObjectId objectRef, String componentId, String userId)
-
addProfileInst
public String addProfileInst(ProfileInst profileInst)
Add the given Profile Instance
-
addProfileInst
public String addProfileInst(ProfileInst profileInst, String userId)
-
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.
-
updateProfileInst
public String updateProfileInst(ProfileInst profileInst)
Update the Profile Instance corresponding to the given space Profile with the given ProfileInst
-
updateProfileInst
public String updateProfileInst(ProfileInst profileInst, String userId)
-
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
-
assignRightsFromUserToUser
public void assignRightsFromUserToUser(RightAssignationContext.MODE operationMode, String sourceUserId, String targetUserId, boolean nodeAssignRights, String authorId) throws AdminException
- Throws:
AdminException
-
assignRightsFromUserToGroup
public void assignRightsFromUserToGroup(RightAssignationContext.MODE operationMode, String sourceUserId, String targetGroupId, boolean nodeAssignRights, String authorId) throws AdminException
- Throws:
AdminException
-
assignRightsFromGroupToUser
public void assignRightsFromGroupToUser(RightAssignationContext.MODE operationMode, String sourceGroupId, String targetUserId, boolean nodeAssignRights, String authorId) throws AdminException
- Throws:
AdminException
-
assignRightsFromGroupToGroup
public void assignRightsFromGroupToGroup(RightAssignationContext.MODE operationMode, String sourceGroupId, String targetGroupId, boolean nodeAssignRights, String authorId) throws AdminException
- Throws:
AdminException
-
getDirectGroupsOfUser
public List<GroupDetail> getDirectGroupsOfUser(String userId)
-
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
-
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
-
getGroupProfile
public GroupProfileInst getGroupProfile(String groupId)
Return the group profile
-
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
-
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
-
addUser
public String addUser(UserDetail userDetail)
Add the given user
-
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)
-
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
-
updateUserFull
public String updateUserFull(UserFull userFull) throws AdminException
Update the given user- Throws:
AdminException
-
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
-
addGroup
public String addGroup(GroupDetail group)
Add the given group
-
getRemovedGroupsInDomain
public List<GroupDetail> getRemovedGroupsInDomain(String domainId) throws AdminException
- Throws:
AdminException
-
restoreGroupById
public List<GroupDetail> restoreGroupById(String groupId)
Restores the given group
-
removeGroupById
public List<GroupDetail> removeGroupById(String groupId)
Removes the given group
-
deleteGroupById
public List<GroupDetail> deleteGroupById(String sGroupId)
Delete 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
-
getSpecificPropertiesToImportUsers
public List<DomainProperty> getSpecificPropertiesToImportUsers(String domainId, String language)
-
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
- 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
-
synchronizeImportGroup
public AdminController.Result<String> synchronizeImportGroup(String domainId, String groupName)
-
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
-
copyAndPasteComponent
public String copyAndPasteComponent(PasteDetail pasteDetail) throws AdminException, QuotaException
- Throws:
AdminException
QuotaException
-
copyAndPasteSpace
public String copyAndPasteSpace(PasteDetail pasteDetail) throws AdminException, QuotaException
- Throws:
AdminException
QuotaException
-
getRemovedUsersInDomain
public List<UserDetail> getRemovedUsersInDomain(String domainId) throws AdminException
- Throws:
AdminException
-
getDeletedUsersInDomain
public List<UserDetail> getDeletedUsersInDomain(String domainId) throws AdminException
- Throws:
AdminException
-
getUsersWithSensitiveData
public List<UserDetail> getUsersWithSensitiveData(String domainId) throws AdminException
- Throws:
AdminException
-
blankDeletedUsers
public void blankDeletedUsers(String targetDomainId, List<String> userIds) throws AdminException
- Throws:
AdminException
-
disableDataSensitivity
public void disableDataSensitivity(String targetDomainId, List<String> userIds) throws AdminException
- Throws:
AdminException
-
-