Package org.silverpeas.core.admin.user
Class ProfileInstManager
- java.lang.Object
-
- org.silverpeas.core.admin.user.ProfileInstManager
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROFILE
static String
PROFILES_OF_USER
-
Constructor Summary
Constructors Modifier Constructor Description protected
ProfileInstManager()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
createProfileInst(ProfileInst profileInst, int fatherCompLocalId)
Create a new user access profile instance into the database.void
deleteProfileInst(ProfileInst profileInst)
Deletes the specified profile instance.String[]
getAllComponentObjectProfileIdsOfGroup(String groupId)
Gets the identifiers all the profiles of nodes related to the given group of users.String[]
getAllComponentObjectProfileIdsOfUser(String sUserId, List<String> groupIds)
Gets the identifiers of all the profiles of a component related to the given user and/or groups of users.ProfileInst
getInheritedProfileInst(int instanceLocalId, String roleName)
String[]
getProfileIdsOfGroup(String sGroupId)
Gets the identifiers of all the profiles related to the specified group of users.String[]
getProfileIdsOfUser(String sUserId, List<String> groupIds)
Gets the identifiers of all the profiles related to the specified user and to the groups of users.ProfileInst
getProfileInst(String sProfileId, boolean includeRemovedUsersAndGroups)
Get Profile information from database with the given id and creates a new Profile instanceString[]
getProfileNamesOfUser(String userId, List<String> groupIds, int componentLocalId)
Map<Integer,Set<String>>
getProfileNamesOfUser(String userId, List<String> groupIds, Collection<Integer> componentLocalIds)
String
updateProfileInst(ProfileInst profileInstNew)
Updates the specified profile instance.
-
-
-
Field Detail
-
PROFILES_OF_USER
public static final String PROFILES_OF_USER
- See Also:
- Constant Field Values
-
PROFILE
public static final String PROFILE
- See Also:
- Constant Field Values
-
-
Method Detail
-
createProfileInst
public String createProfileInst(ProfileInst profileInst, int fatherCompLocalId) throws AdminException
Create a new user access profile instance into the database.- Parameters:
profileInst
- the profile instance ot persist.fatherCompLocalId
- the unique identifier of the resource on which the profile is about.- Returns:
- the unique identifier of the profile once persisted.
- Throws:
AdminException
- if an error occurs while creating the profile instance.
-
getProfileInst
public ProfileInst getProfileInst(String sProfileId, boolean includeRemovedUsersAndGroups) throws AdminException
Get Profile information from database with the given id and creates a new Profile instance- Parameters:
sProfileId
- identifier of the profile.includeRemovedUsersAndGroups
- true to take into account removed groups and removed users.- Returns:
- the corresponding
ProfileInst
if any, null otherwise. - Throws:
AdminException
- if an error occurred.
-
getInheritedProfileInst
public ProfileInst getInheritedProfileInst(int instanceLocalId, String roleName) throws AdminException
- Throws:
AdminException
-
deleteProfileInst
public void deleteProfileInst(ProfileInst profileInst) throws AdminException
Deletes the specified profile instance.- Parameters:
profileInst
- the profile instance to delete.- Throws:
AdminException
- if an error occurs while deleting the profile instance in Silverpeas.
-
updateProfileInst
public String updateProfileInst(ProfileInst profileInstNew) throws AdminException
Updates the specified profile instance. The method takes into account the access rights on nodes of the users or groups of users in the profile.- Parameters:
profileInstNew
- the profile instance from which its persisted counterpart will be updated in the database.- Throws:
AdminException
- if an error occurs while updating the profile instance.
-
getProfileIdsOfUser
public String[] getProfileIdsOfUser(String sUserId, List<String> groupIds) throws AdminException
Gets the identifiers of all the profiles related to the specified user and to the groups of users.- Parameters:
sUserId
- the unique identifier of a user.groupIds
- a list of identifiers of groups of users.- Returns:
- an array with the identifiers of the profiles matching the request.
- Throws:
AdminException
- if an error occurs while getting the profile identifiers.
-
getAllComponentObjectProfileIdsOfUser
public String[] getAllComponentObjectProfileIdsOfUser(String sUserId, List<String> groupIds) throws AdminException
Gets the identifiers of all the profiles of a component related to the given user and/or groups of users.- Parameters:
sUserId
- the unique identifier of a user.groupIds
- a list of unique identifiers of groups of users.- Returns:
- an array with the identifiers of the profiles matching the request.
- Throws:
AdminException
- if an error occurs while getting the profiles of a component.
-
getProfileNamesOfUser
public String[] getProfileNamesOfUser(String userId, List<String> groupIds, int componentLocalId) throws AdminException
- Throws:
AdminException
-
getProfileNamesOfUser
public Map<Integer,Set<String>> getProfileNamesOfUser(String userId, List<String> groupIds, Collection<Integer> componentLocalIds) throws AdminException
- Throws:
AdminException
-
getProfileIdsOfGroup
public String[] getProfileIdsOfGroup(String sGroupId) throws AdminException
Gets the identifiers of all the profiles related to the specified group of users.- Parameters:
sGroupId
- the unique identifier of a group of user.- Returns:
- an array with the identifiers of the profiles matching the request.
- Throws:
AdminException
- if an error occurs while getting the profiles.
-
getAllComponentObjectProfileIdsOfGroup
public String[] getAllComponentObjectProfileIdsOfGroup(String groupId) throws AdminException
Gets the identifiers all the profiles of nodes related to the given group of users.- Parameters:
groupId
- the unique identifier of a group.- Returns:
- an array with the identifiers of the profiles matching the request.
- Throws:
AdminException
- if an error occurs while getting the profiles matching the request.
-
-