Interface I_CmsUserDriver
-
- All Superinterfaces:
I_CmsDriver
- All Known Implementing Classes:
CmsUserDriver
,CmsUserDriver
,CmsUserDriver
,CmsUserDriver
,CmsUserDriver
,CmsUserDriver
,CmsUserDriver
,CmsUserDriver
public interface I_CmsUserDriver extends I_CmsDriver
Definitions of all required user driver methods.- Since:
- 6.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static int
DRIVER_TYPE_ID
The type ID to identify user driver implementations.-
Fields inherited from interface org.opencms.db.I_CmsDriver
AND_CONDITION, BEGIN_CONDITION, BEGIN_EXCLUDE_CONDITION, BEGIN_INCLUDE_CONDITION, END_CONDITION, OR_CONDITION
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addResourceToOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsResource resource)
Adds a resource to the given organizational unit.long
countUsers(CmsDbContext dbc, CmsUserSearchParameters searchParams)
Counts the total number of users which match the given search criteria.void
createAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsUUID resource, CmsUUID principal, int allowed, int denied, int flags)
Creates an access control entry.CmsGroup
createGroup(CmsDbContext dbc, CmsUUID groupId, java.lang.String groupFqn, java.lang.String description, int flags, java.lang.String parentGroupName)
Creates a new group.CmsOrganizationalUnit
createOrganizationalUnit(CmsDbContext dbc, java.lang.String name, java.lang.String description, int flags, CmsOrganizationalUnit parent, java.lang.String associationRootPath)
Creates a new organizational unit.void
createRootOrganizationalUnit(CmsDbContext dbc)
Creates the default root organizational unit.CmsUser
createUser(CmsDbContext dbc, CmsUUID id, java.lang.String userFqn, java.lang.String password, java.lang.String firstname, java.lang.String lastname, java.lang.String email, long lastlogin, int flags, long dateCreated, java.util.Map<java.lang.String,java.lang.Object> additionalInfos)
Creates a new user.void
createUserInGroup(CmsDbContext dbc, CmsUUID userid, CmsUUID groupid)
Adds a user to a group.void
deleteGroup(CmsDbContext dbc, java.lang.String groupFqn)
Deletes a group.void
deleteOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit organizationalUnit)
Deletes an organizational unit.void
deleteUser(CmsDbContext dbc, java.lang.String userFqn)
Deletes a user.void
deleteUserInfos(CmsDbContext dbc, CmsUUID userId)
Deletes the user additional information table.void
deleteUserInGroup(CmsDbContext dbc, CmsUUID userId, CmsUUID groupId)
Removes a user from a group.void
destroy()
Destroys this driver.boolean
existsGroup(CmsDbContext dbc, java.lang.String groupFqn)
Tests if a group with the specified name exists.boolean
existsUser(CmsDbContext dbc, java.lang.String userFqn)
Tests if a user with the specified name exists.void
fillDefaults(CmsDbContext dbc)
Initializes the default organizational units, users and groups.java.util.List<CmsGroup>
getGroups(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean includeSubOus, boolean readRoles)
Returns all groups of the given organizational unit.java.util.List<CmsOrganizationalUnit>
getOrganizationalUnits(CmsDbContext dbc, CmsOrganizationalUnit parent, boolean includeChildren)
Returns all child organizational units of the given parent organizational unit including hierarchical deeper organization units if needed.java.util.List<CmsResource>
getResourcesForOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit)
Returns all resources of the given organizational unit.CmsSqlManager
getSqlManager()
Returns the SqlManager of this driver.java.util.List<CmsUser>
getUsers(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean recursive)
Returns all users of the given organizational unit.java.util.List<CmsUser>
getUsersWithoutAdditionalInfo(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean recursive)
Returns all users of the given organizational unit, without reading their additional infos.CmsSqlManager
initSqlManager(java.lang.String classname)
Initializes the SQL manager for this driver.void
publishAccessControlEntries(CmsDbContext dbc, CmsProject offlineProject, CmsProject onlineProject, CmsUUID offlineId, CmsUUID onlineId)
Publish all access control entries of a resource from the given offline project to the online project.java.util.List<CmsAccessControlEntry>
readAccessControlEntries(CmsDbContext dbc, CmsProject project, CmsUUID resource, boolean inheritedOnly)
Reads all relevant access control entries for a given resource.CmsAccessControlEntry
readAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsUUID resource, CmsUUID principal)
Reads an access control entry for a given principal that is attached to a resource.java.util.List<CmsGroup>
readChildGroups(CmsDbContext dbc, java.lang.String groupFqn)
Reads all child groups of a group.CmsGroup
readGroup(CmsDbContext dbc, java.lang.String groupFqn)
Reads a group based on the group name.CmsGroup
readGroup(CmsDbContext dbc, CmsUUID groupId)
Reads a group based on the group id.java.util.List<CmsGroup>
readGroupsOfUser(CmsDbContext dbc, CmsUUID userId, java.lang.String ouFqn, boolean includeChildOus, java.lang.String remoteAddress, boolean readRoles)
Reads all groups the given user is a member in.CmsOrganizationalUnit
readOrganizationalUnit(CmsDbContext dbc, java.lang.String ouFqn)
Reads an organizational Unit based on its fully qualified name.CmsUser
readUser(CmsDbContext dbc, java.lang.String userFqn)
Reads a user based in the user fully qualified name.CmsUser
readUser(CmsDbContext dbc, java.lang.String userFqn, java.lang.String password, java.lang.String remoteAddress)
Reads a user from the database, only if the password is correct.CmsUser
readUser(CmsDbContext dbc, CmsUUID id)
Reads a user based on the user id.java.util.Map<java.lang.String,java.lang.Object>
readUserInfos(CmsDbContext dbc, CmsUUID userId)
Reads the user additional information map.java.util.List<CmsUser>
readUsersOfGroup(CmsDbContext dbc, java.lang.String groupFqn, boolean includeOtherOuUsers)
Reads all users that are members of the given group.void
removeAccessControlEntries(CmsDbContext dbc, CmsProject project, CmsUUID resource)
Removes all access control entries belonging to a resource.void
removeAccessControlEntriesForPrincipal(CmsDbContext dbc, CmsProject project, CmsProject onlineProject, CmsUUID principal)
Removes all access control entries belonging to a principal.void
removeAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsUUID resource, CmsUUID principal)
Removes an access control entry.void
removeResourceFromOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsResource resource)
Removes a resource from the given organizational unit.java.util.List<CmsUser>
searchUsers(CmsDbContext dbc, CmsUserSearchParameters searchParams)
Searches for users which match the given search criteria.void
setDriverManager(CmsDriverManager driverManager)
Sets the driver manager for this driver if possible.void
setSqlManager(CmsSqlManager sqlManager)
Sets the SQL manager for this driver if possible.void
setUsersOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsUser user)
Moves an user to the given organizational unit.void
writeAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsAccessControlEntry acEntry)
Writes an access control entry.void
writeGroup(CmsDbContext dbc, CmsGroup group)
Writes an already existing group.void
writeOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit organizationalUnit)
Writes an already existing organizational unit.void
writePassword(CmsDbContext dbc, java.lang.String userFqn, java.lang.String oldPassword, java.lang.String newPassword)
Sets a new password for a user.void
writeUser(CmsDbContext dbc, CmsUser user)
Updates the user information.void
writeUserInfo(CmsDbContext dbc, CmsUUID userId, java.lang.String key, java.lang.Object value)
Writes an user additional information entry.-
Methods inherited from interface org.opencms.db.I_CmsDriver
init, toString
-
-
-
-
Field Detail
-
DRIVER_TYPE_ID
static final int DRIVER_TYPE_ID
The type ID to identify user driver implementations.- See Also:
- Constant Field Values
-
-
Method Detail
-
addResourceToOrganizationalUnit
void addResourceToOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsResource resource) throws CmsDataAccessException
Adds a resource to the given organizational unit.- Parameters:
dbc
- the current db contextorgUnit
- the organizational unit to add the resource toresource
- the resource that is to be added to the organizational unit- Throws:
CmsDataAccessException
- if something goes wrong
-
countUsers
long countUsers(CmsDbContext dbc, CmsUserSearchParameters searchParams) throws CmsDataAccessException
Counts the total number of users which match the given search criteria.- Parameters:
dbc
- the database contextsearchParams
- the search criteria- Returns:
- the number of users which match the search criteria
- Throws:
CmsDataAccessException
- if something goes wrong
-
createAccessControlEntry
void createAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsUUID resource, CmsUUID principal, int allowed, int denied, int flags) throws CmsDataAccessException
Creates an access control entry.- Parameters:
dbc
- the current database contextproject
- the project to write the entryresource
- the id of the resourceprincipal
- the id of the principal (user or group)allowed
- the bitset of allowed permissionsdenied
- the bitset of denied permissionsflags
- flags- Throws:
CmsDataAccessException
- if something goes wrong
-
createGroup
CmsGroup createGroup(CmsDbContext dbc, CmsUUID groupId, java.lang.String groupFqn, java.lang.String description, int flags, java.lang.String parentGroupName) throws CmsDataAccessException
Creates a new group.- Parameters:
dbc
- the current database contextgroupId
- the id of the new groupgroupFqn
- the fully qualified name of the new groupdescription
- The description for the new groupflags
- the flags for the new groupparentGroupName
- the name of the parent group (or null if the group has no parent)- Returns:
- the created group
- Throws:
CmsDataAccessException
- if something goes wrong
-
createOrganizationalUnit
CmsOrganizationalUnit createOrganizationalUnit(CmsDbContext dbc, java.lang.String name, java.lang.String description, int flags, CmsOrganizationalUnit parent, java.lang.String associationRootPath) throws CmsDataAccessException
Creates a new organizational unit.- Parameters:
dbc
- the current db contextname
- the name of the new organizational unitdescription
- the description of the new organizational unitflags
- the flags for the new organizational unitparent
- the parent organizational unit (ornull
)associationRootPath
- the first associated resource- Returns:
- a
object representing the newly created organizational unitCmsOrganizationalUnit
- Throws:
CmsDataAccessException
- if operation was not successful
-
createRootOrganizationalUnit
void createRootOrganizationalUnit(CmsDbContext dbc)
Creates the default root organizational unit.- Parameters:
dbc
- the current database context
-
createUser
CmsUser createUser(CmsDbContext dbc, CmsUUID id, java.lang.String userFqn, java.lang.String password, java.lang.String firstname, java.lang.String lastname, java.lang.String email, long lastlogin, int flags, long dateCreated, java.util.Map<java.lang.String,java.lang.Object> additionalInfos) throws CmsDataAccessException
Creates a new user.- Parameters:
dbc
- the current database contextid
- the id of the useruserFqn
- the fully qualified name of the new userpassword
- the already encripted user passwordfirstname
- the user firstnamelastname
- the user lastnameemail
- the user emaillastlogin
- the user lastlogin timeflags
- the user flagsdateCreated
- the creation dateadditionalInfos
- the user additional infos- Returns:
- the created user
- Throws:
CmsDataAccessException
- if something goes wrong
-
createUserInGroup
void createUserInGroup(CmsDbContext dbc, CmsUUID userid, CmsUUID groupid) throws CmsDataAccessException
Adds a user to a group.- Parameters:
dbc
- the current database contextuserid
- the id of the user that is to be added to the groupgroupid
- the id of the group- Throws:
CmsDataAccessException
- if operation was not successful
-
deleteGroup
void deleteGroup(CmsDbContext dbc, java.lang.String groupFqn) throws CmsDataAccessException
Deletes a group.Only groups that contain no subgroups can be deleted.
- Parameters:
dbc
- the current database contextgroupFqn
- the fully qualified name of the group that is to be deleted- Throws:
CmsDataAccessException
- if something goes wrong
-
deleteOrganizationalUnit
void deleteOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit organizationalUnit) throws CmsDataAccessException
Deletes an organizational unit.Only organizational units that contain no suborganizational unit can be deleted.
- Parameters:
dbc
- the current db contextorganizationalUnit
- the organizational unit to delete- Throws:
CmsDataAccessException
- if operation was not successful
-
deleteUser
void deleteUser(CmsDbContext dbc, java.lang.String userFqn) throws CmsDataAccessException
Deletes a user.- Parameters:
dbc
- the current database contextuserFqn
- the fully qualified name of the user to delete- Throws:
CmsDataAccessException
- if something goes wrong
-
deleteUserInfos
void deleteUserInfos(CmsDbContext dbc, CmsUUID userId) throws CmsDataAccessException
Deletes the user additional information table.- Parameters:
dbc
- the current database contextuserId
- the id of the user to update- Throws:
CmsDataAccessException
- if something goes wrong
-
deleteUserInGroup
void deleteUserInGroup(CmsDbContext dbc, CmsUUID userId, CmsUUID groupId) throws CmsDataAccessException
Removes a user from a group.- Parameters:
dbc
- the current database contextuserId
- the id of the user that is to be removed from the groupgroupId
- the id of the group- Throws:
CmsDataAccessException
- if something goes wrong
-
destroy
void destroy() throws java.lang.Throwable
Destroys this driver.- Throws:
java.lang.Throwable
- if something goes wrong
-
existsGroup
boolean existsGroup(CmsDbContext dbc, java.lang.String groupFqn) throws CmsDataAccessException
Tests if a group with the specified name exists.- Parameters:
dbc
- the current database contextgroupFqn
- the fully qualified group name to be checked- Returns:
true
, if a group with the specified name exists,false
otherwise- Throws:
CmsDataAccessException
- if something goes wrong
-
existsUser
boolean existsUser(CmsDbContext dbc, java.lang.String userFqn) throws CmsDataAccessException
Tests if a user with the specified name exists.- Parameters:
dbc
- the current database contextuserFqn
- the fully qualified name of the user to be checked- Returns:
- true, if a user with the specified name exists, false otherwise
- Throws:
CmsDataAccessException
- if something goes wrong
-
fillDefaults
void fillDefaults(CmsDbContext dbc) throws CmsInitException
Initializes the default organizational units, users and groups.- Parameters:
dbc
- the current database context, be aware that this dbc has no runtime data!- Throws:
CmsInitException
- if something goes wrong
-
getGroups
java.util.List<CmsGroup> getGroups(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean includeSubOus, boolean readRoles) throws CmsDataAccessException
Returns all groups of the given organizational unit.- Parameters:
dbc
- the current db contextorgUnit
- the organizational unit to get all groups forincludeSubOus
- flag to signalize the retrieval of groups of sub-organizational units tooreadRoles
- if to read roles or groups- Returns:
- all
objects in the organizational unitCmsGroup
- Throws:
CmsDataAccessException
- if operation was not successful
-
getOrganizationalUnits
java.util.List<CmsOrganizationalUnit> getOrganizationalUnits(CmsDbContext dbc, CmsOrganizationalUnit parent, boolean includeChildren) throws CmsDataAccessException
Returns all child organizational units of the given parent organizational unit including hierarchical deeper organization units if needed.- Parameters:
dbc
- the current db contextparent
- the parent organizational unit, ornull
for the rootincludeChildren
- if hierarchical deeper organization units should also be returned- Returns:
- a list of
objectsCmsOrganizationalUnit
- Throws:
CmsDataAccessException
- if operation was not succesful
-
getResourcesForOrganizationalUnit
java.util.List<CmsResource> getResourcesForOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit) throws CmsDataAccessException
Returns all resources of the given organizational unit.- Parameters:
dbc
- the current db contextorgUnit
- the organizational unit to get all resources for- Returns:
- all
objects in the organizational unitCmsResource
- Throws:
CmsDataAccessException
- if operation was not successful
-
getSqlManager
CmsSqlManager getSqlManager()
Returns the SqlManager of this driver.- Returns:
- the SqlManager of this driver
-
getUsers
java.util.List<CmsUser> getUsers(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean recursive) throws CmsDataAccessException
Returns all users of the given organizational unit.- Parameters:
dbc
- the current db contextorgUnit
- the organizational unit to get all users forrecursive
- flag to signalize the retrieval of users of sub-organizational units too- Returns:
- all
objects in the organizational unitCmsUser
- Throws:
CmsDataAccessException
- if operation was not successful
-
getUsersWithoutAdditionalInfo
java.util.List<CmsUser> getUsersWithoutAdditionalInfo(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean recursive) throws CmsDataAccessException
Returns all users of the given organizational unit, without reading their additional infos.- Parameters:
dbc
- the current db contextorgUnit
- the organizational unit to get all users forrecursive
- flag to signalize the retrieval of users of sub-organizational units too- Returns:
- all
objects in the organizational unitCmsUser
- Throws:
CmsDataAccessException
- if operation was not successful
-
initSqlManager
CmsSqlManager initSqlManager(java.lang.String classname)
Initializes the SQL manager for this driver.To obtain JDBC connections from different pools, further {online|offline|history} pool Urls have to be specified.
- Parameters:
classname
- the classname of the SQL manager- Returns:
- the SQL manager for this driver
-
publishAccessControlEntries
void publishAccessControlEntries(CmsDbContext dbc, CmsProject offlineProject, CmsProject onlineProject, CmsUUID offlineId, CmsUUID onlineId) throws CmsDataAccessException
Publish all access control entries of a resource from the given offline project to the online project.Within the given project, the resource is identified by its offlineId, in the online project, it is identified by the given onlineId.
- Parameters:
dbc
- the current database contextofflineProject
- an offline projectonlineProject
- the onlie projectofflineId
- the offline resource idonlineId
- the online resource id- Throws:
CmsDataAccessException
- if something goes wrong
-
readAccessControlEntries
java.util.List<CmsAccessControlEntry> readAccessControlEntries(CmsDbContext dbc, CmsProject project, CmsUUID resource, boolean inheritedOnly) throws CmsDataAccessException
Reads all relevant access control entries for a given resource.- Parameters:
dbc
- the current database contextproject
- the project to write the entryresource
- the id of the resourceinheritedOnly
- flag to indicate that only inherited entries should be returned- Returns:
- a list of
objects defining all permissions for the given resourceCmsAccessControlEntry
- Throws:
CmsDataAccessException
- if something goes wrong
-
readAccessControlEntry
CmsAccessControlEntry readAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsUUID resource, CmsUUID principal) throws CmsDataAccessException
Reads an access control entry for a given principal that is attached to a resource.- Parameters:
dbc
- the current database contextproject
- the project to write the entryresource
- the id of the resourceprincipal
- the id of the principal- Returns:
- an access control entry that defines the permissions of the principal for the given resource
- Throws:
CmsDataAccessException
- if something goes wrong
-
readChildGroups
java.util.List<CmsGroup> readChildGroups(CmsDbContext dbc, java.lang.String groupFqn) throws CmsDataAccessException
Reads all child groups of a group.- Parameters:
dbc
- the current database contextgroupFqn
- the fully qualified name of the group to read the child groups from- Returns:
- a list of all child
objects orCmsGroup
null
- Throws:
CmsDataAccessException
- if operation was not succesful
-
readGroup
CmsGroup readGroup(CmsDbContext dbc, CmsUUID groupId) throws CmsDataAccessException
Reads a group based on the group id.- Parameters:
dbc
- the current database contextgroupId
- the id of the group that is to be read- Returns:
- the group that was read
- Throws:
CmsDataAccessException
- if something goes wrong
-
readGroup
CmsGroup readGroup(CmsDbContext dbc, java.lang.String groupFqn) throws CmsDataAccessException
Reads a group based on the group name.- Parameters:
dbc
- the current database contextgroupFqn
- the fully qualified name of the group that is to be read- Returns:
- the group that was read
- Throws:
CmsDataAccessException
- if something goes wrong
-
readGroupsOfUser
java.util.List<CmsGroup> readGroupsOfUser(CmsDbContext dbc, CmsUUID userId, java.lang.String ouFqn, boolean includeChildOus, java.lang.String remoteAddress, boolean readRoles) throws CmsDataAccessException
Reads all groups the given user is a member in.- Parameters:
dbc
- the current database contextuserId
- the id of the userouFqn
- the fully qualified name of the organizational unit to restrict the result set forincludeChildOus
- include groups of child organizational unitsremoteAddress
- the IP address to filter the groups in the result listreadRoles
- if to read roles or groups- Returns:
- a list of
objectsCmsGroup
- Throws:
CmsDataAccessException
- if something goes wrong
-
readOrganizationalUnit
CmsOrganizationalUnit readOrganizationalUnit(CmsDbContext dbc, java.lang.String ouFqn) throws CmsDataAccessException
Reads an organizational Unit based on its fully qualified name.- Parameters:
dbc
- the current db contextouFqn
- the fully qualified name of the organizational Unit to be read- Returns:
- the organizational Unit with the provided fully qualified name
- Throws:
CmsDataAccessException
- if something goes wrong
-
readUser
CmsUser readUser(CmsDbContext dbc, CmsUUID id) throws CmsDataAccessException
Reads a user based on the user id.- Parameters:
dbc
- the current database contextid
- the id of the user to read- Returns:
- the user that was read
- Throws:
CmsDataAccessException
- if something goes wrong
-
readUser
CmsUser readUser(CmsDbContext dbc, java.lang.String userFqn) throws CmsDataAccessException
Reads a user based in the user fully qualified name.- Parameters:
dbc
- the current database contextuserFqn
- the fully qualified name of the user to read- Returns:
- the user that was read
- Throws:
CmsDataAccessException
- if something goes wrong
-
readUser
CmsUser readUser(CmsDbContext dbc, java.lang.String userFqn, java.lang.String password, java.lang.String remoteAddress) throws CmsDataAccessException, CmsPasswordEncryptionException
Reads a user from the database, only if the password is correct.- Parameters:
dbc
- the current database contextuserFqn
- the name of the userpassword
- the password of the userremoteAddress
- the remote address of the request, may benull
- Returns:
- the user that was read
- Throws:
CmsDataAccessException
- if something goes wrongCmsPasswordEncryptionException
- if the password of the user could not be encrypted
-
readUserInfos
java.util.Map<java.lang.String,java.lang.Object> readUserInfos(CmsDbContext dbc, CmsUUID userId) throws CmsDataAccessException
Reads the user additional information map.- Parameters:
dbc
- the current database contextuserId
- the id of the user to update- Returns:
- the user additional information map
- Throws:
CmsDataAccessException
- if something goes wrong
-
readUsersOfGroup
java.util.List<CmsUser> readUsersOfGroup(CmsDbContext dbc, java.lang.String groupFqn, boolean includeOtherOuUsers) throws CmsDataAccessException
Reads all users that are members of the given group.- Parameters:
dbc
- the current database contextgroupFqn
- the fully qualified name of the group to read the users fromincludeOtherOuUsers
- include users of other organizational units- Returns:
- all
objects in the groupCmsUser
- Throws:
CmsDataAccessException
- if something goes wrong
-
removeAccessControlEntries
void removeAccessControlEntries(CmsDbContext dbc, CmsProject project, CmsUUID resource) throws CmsDataAccessException
Removes all access control entries belonging to a resource.- Parameters:
dbc
- the current database contextproject
- the project to write the entryresource
- the id of the resource- Throws:
CmsDataAccessException
- if something goes wrong
-
removeAccessControlEntriesForPrincipal
void removeAccessControlEntriesForPrincipal(CmsDbContext dbc, CmsProject project, CmsProject onlineProject, CmsUUID principal) throws CmsDataAccessException
Removes all access control entries belonging to a principal.- Parameters:
dbc
- the current database contextproject
- the project to write the entryonlineProject
- the online projectprincipal
- the id of the principal- Throws:
CmsDataAccessException
- if something goes wrong
-
removeAccessControlEntry
void removeAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsUUID resource, CmsUUID principal) throws CmsDataAccessException
Removes an access control entry.- Parameters:
dbc
- the current database contextproject
- the project to write the entryresource
- the id of the resourceprincipal
- the id of the principal- Throws:
CmsDataAccessException
- if something goes wrong
-
removeResourceFromOrganizationalUnit
void removeResourceFromOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsResource resource) throws CmsDataAccessException
Removes a resource from the given organizational unit.- Parameters:
dbc
- the current db contextorgUnit
- the organizational unit to remove the resource fromresource
- the resource that is to be removed from the organizational unit- Throws:
CmsDataAccessException
- if something goes wrong
-
searchUsers
java.util.List<CmsUser> searchUsers(CmsDbContext dbc, CmsUserSearchParameters searchParams) throws CmsDataAccessException
Searches for users which match the given search criteria.- Parameters:
dbc
- the database contextsearchParams
- the search criteria- Returns:
- the users which match the given criteria
- Throws:
CmsDataAccessException
- if something goes wrong
-
setDriverManager
void setDriverManager(CmsDriverManager driverManager)
Sets the driver manager for this driver if possible.- Parameters:
driverManager
- the new driver manager
-
setSqlManager
void setSqlManager(CmsSqlManager sqlManager)
Sets the SQL manager for this driver if possible.- Parameters:
sqlManager
- the new SQL manager
-
setUsersOrganizationalUnit
void setUsersOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsUser user) throws CmsDataAccessException
Moves an user to the given organizational unit.- Parameters:
dbc
- the current db contextorgUnit
- the organizational unit to move the user touser
- the user that is to be moved to the given organizational unit- Throws:
CmsDataAccessException
- if something goes wrong
-
writeAccessControlEntry
void writeAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsAccessControlEntry acEntry) throws CmsDataAccessException
Writes an access control entry.- Parameters:
dbc
- the current database contextproject
- the project to write the entryacEntry
- the entry to write- Throws:
CmsDataAccessException
- if something goes wrong
-
writeGroup
void writeGroup(CmsDbContext dbc, CmsGroup group) throws CmsDataAccessException
Writes an already existing group.The group id has to be a valid OpenCms group id.
The group with the given id will be completely overriden by the given data.- Parameters:
dbc
- the current database contextgroup
- the group to update- Throws:
CmsDataAccessException
- if something goes wrong
-
writeOrganizationalUnit
void writeOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit organizationalUnit) throws CmsDataAccessException
Writes an already existing organizational unit.The organizational unit id has to be a valid OpenCms organizational unit id.
The organizational unit with the given id will be completely overriden by the given data.- Parameters:
dbc
- the current db contextorganizationalUnit
- the organizational unit that should be written- Throws:
CmsDataAccessException
- if operation was not successful
-
writePassword
void writePassword(CmsDbContext dbc, java.lang.String userFqn, java.lang.String oldPassword, java.lang.String newPassword) throws CmsDataAccessException, CmsPasswordEncryptionException
Sets a new password for a user.- Parameters:
dbc
- the current database contextuserFqn
- the fullyqualified name of the user to set the password foroldPassword
- the current passwordnewPassword
- the password to set- Throws:
CmsDataAccessException
- if something goes wrongCmsPasswordEncryptionException
- if the (new) password could not be encrypted
-
writeUser
void writeUser(CmsDbContext dbc, CmsUser user) throws CmsDataAccessException
Updates the user information.The user id has to be a valid OpenCms user id.
The user with the given id will be completely overriden by the given data.
- Parameters:
dbc
- the current database contextuser
- the user to update- Throws:
CmsDataAccessException
- if something goes wrong
-
writeUserInfo
void writeUserInfo(CmsDbContext dbc, CmsUUID userId, java.lang.String key, java.lang.Object value) throws CmsDataAccessException
Writes an user additional information entry.- Parameters:
dbc
- the current database contextuserId
- the id of the user to updatekey
- the key of the info to writevalue
- the value of the info to write- Throws:
CmsDataAccessException
- if something goes wrong
-
-