public class CmsUserDriver extends java.lang.Object implements I_CmsUserDriver
Modifier and Type | Field and Description |
---|---|
protected java.security.MessageDigest |
m_digest
A digest to encrypt the passwords.
|
protected java.lang.String |
m_digestAlgorithm
The algorithm used to encode passwords.
|
protected java.lang.String |
m_digestFileEncoding
The file.encoding to code passwords after encryption with digest.
|
protected CmsDriverManager |
m_driverManager
The driver manager.
|
protected CmsSqlManager |
m_sqlManager
The SQL manager.
|
static java.lang.String |
ORGUNIT_BASE_FOLDER
The root path for organizational units.
|
static java.lang.String |
REQ_ATTR_DONT_DIGEST_PASSWORD
The internal request attribute to indicate that the password has not to be digested.
|
DRIVER_TYPE_ID
AND_CONDITION, BEGIN_CONDITION, BEGIN_EXCLUDE_CONDITION, BEGIN_INCLUDE_CONDITION, END_CONDITION, OR_CONDITION
Constructor and Description |
---|
CmsUserDriver() |
Modifier and Type | Method and 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 parentGroupFqn)
Creates a new group.
|
CmsOrganizationalUnit |
createOrganizationalUnit(CmsDbContext dbc,
java.lang.String name,
java.lang.String description,
int flags,
CmsOrganizationalUnit parent,
java.lang.String associatedResource)
Creates a new organizational unit.
|
protected javax.persistence.Query |
createQueryFromStringAndParams(java.lang.String queryString,
java.util.List<java.lang.Object> queryParams)
Creates a query from the given parameters.
|
protected java.lang.String |
createRoleQuery(java.lang.String mainQuery,
boolean includeSubOus,
boolean readRoles)
Returns a sql query to select groups.
|
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 |
deleteAccessControlEntries(CmsDbContext dbc,
CmsProject project,
CmsUUID resource)
Possibly there is no need for this method.
|
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.
|
void |
init(CmsDbContext dbc,
CmsConfigurationManager configurationManager,
java.util.List<java.lang.String> successiveDrivers,
CmsDriverManager driverManager)
Initializes the driver.
|
CmsSqlManager |
initSqlManager(java.lang.String classname)
Initializes the SQL manager for this driver.
|
protected CmsAccessControlEntry |
internalCreateAce(I_CmsDAOAccessControl ac)
Internal helper method to create an access control entry from a database record.
|
protected CmsAccessControlEntry |
internalCreateAce(I_CmsDAOAccessControl ac,
CmsUUID newId)
Internal helper method to create an access control entry from a database record.
|
protected void |
internalCreateDefaultGroups(CmsDbContext dbc,
java.lang.String ouFqn,
java.lang.String ouDescription,
boolean webuser)
Creates the default groups and user for the given organizational unit.
|
protected CmsGroup |
internalCreateGroup(CmsDAOGroups g)
Semi-constructor to create a
CmsGroup instance from a JDBC result set. |
protected CmsOrganizationalUnit |
internalCreateOrgUnitFromResource(CmsDbContext dbc,
CmsResource resource)
Returns the organizational unit represented by the given resource.
|
protected CmsResource |
internalCreateResourceForOrgUnit(CmsDbContext dbc,
java.lang.String path,
int flags)
Creates a folder with the given path an properties, offline AND online.
|
protected CmsUser |
internalCreateUser(CmsDbContext dbc,
CmsDAOUsers u)
Semi-constructor to create a
CmsUser instance from a JDBC result set. |
protected void |
internalDeleteOrgUnitResource(CmsDbContext dbc,
CmsResource resource)
Deletes a resource representing a organizational unit, offline AND online.
|
protected void |
internalDeleteUserInfo(CmsDbContext dbc,
CmsUUID userId,
java.lang.String key)
Deletes an additional user info.
|
protected CmsResource |
internalOrgUnitFolder(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit)
Returns the folder for the given organizational units, or the base folder if
null . |
protected java.util.List<java.lang.String> |
internalResourcesForOrgUnit(CmsDbContext dbc,
CmsResource ouResource)
Returns the list of root paths associated to the organizational unit represented by the given resource.
|
protected void |
internalUpdateRoleGroup(CmsDbContext dbc,
java.lang.String groupName,
CmsRole role)
Updates a group to a virtual group.
|
protected void |
internalUpdateUserInfo(CmsDbContext dbc,
CmsUUID userId,
java.lang.String key,
java.lang.Object value)
Updates additional user info.
|
protected void |
internalValidateResourceForOrgUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
java.lang.String rootPath)
Validates the given root path to be in the scope of the resources of the given organizational unit.
|
protected boolean |
internalValidateUserInGroup(CmsDbContext dbc,
CmsUUID userId,
CmsUUID groupId)
Checks if a user is member of a group.
|
protected void |
internalWriteOrgUnitProperty(CmsDbContext dbc,
CmsResource resource,
CmsProperty property)
Writes a property for an organizational unit resource, online AND offline.
|
protected void |
internalWriteUserInfo(CmsDbContext dbc,
CmsUUID userId,
java.lang.String key,
java.lang.Object value)
Writes a new additional user info.
|
protected void |
internalWriteUserInfos(CmsDbContext dbc,
CmsUUID userId,
java.util.Map<java.lang.String,java.lang.Object> additionalInfo)
Updates the user additional information map.
|
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 parentGroupFqn)
Reads all child groups of a group.
|
CmsGroup |
readGroup(CmsDbContext dbc,
CmsUUID groupId)
Reads a group based on the group id.
|
CmsGroup |
readGroup(CmsDbContext dbc,
java.lang.String groupFqn)
Reads a group based on the group name.
|
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,
CmsUUID id)
Reads a user based on the user id.
|
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.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toString
public static final java.lang.String ORGUNIT_BASE_FOLDER
public static final java.lang.String REQ_ATTR_DONT_DIGEST_PASSWORD
protected java.security.MessageDigest m_digest
protected java.lang.String m_digestAlgorithm
protected java.lang.String m_digestFileEncoding
protected CmsDriverManager m_driverManager
protected CmsSqlManager m_sqlManager
public CmsUserDriver()
public void addResourceToOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsResource resource) throws CmsDataAccessException
I_CmsUserDriver
addResourceToOrganizationalUnit
in interface I_CmsUserDriver
dbc
- the current db contextorgUnit
- the organizational unit to add the resource toresource
- the resource that is to be added to the organizational unitCmsDataAccessException
- if something goes wrongI_CmsUserDriver.addResourceToOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, org.opencms.file.CmsResource)
public long countUsers(CmsDbContext dbc, CmsUserSearchParameters searchParams) throws CmsDataAccessException
I_CmsUserDriver
countUsers
in interface I_CmsUserDriver
dbc
- the database contextsearchParams
- the search criteriaCmsDataAccessException
- if something goes wrongI_CmsUserDriver.countUsers(org.opencms.db.CmsDbContext, org.opencms.file.CmsUserSearchParameters)
public void createAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsUUID resource, CmsUUID principal, int allowed, int denied, int flags) throws CmsDataAccessException
I_CmsUserDriver
createAccessControlEntry
in interface I_CmsUserDriver
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
- flagsCmsDataAccessException
- if something goes wrongI_CmsUserDriver.createAccessControlEntry(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID, int, int, int)
public CmsGroup createGroup(CmsDbContext dbc, CmsUUID groupId, java.lang.String groupFqn, java.lang.String description, int flags, java.lang.String parentGroupFqn) throws CmsDataAccessException
I_CmsUserDriver
createGroup
in interface I_CmsUserDriver
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 groupparentGroupFqn
- the name of the parent group (or null if the group has no parent)CmsDataAccessException
- if something goes wrongI_CmsUserDriver.createGroup(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, java.lang.String, java.lang.String, int, java.lang.String)
public CmsOrganizationalUnit createOrganizationalUnit(CmsDbContext dbc, java.lang.String name, java.lang.String description, int flags, CmsOrganizationalUnit parent, java.lang.String associatedResource) throws CmsDataAccessException
I_CmsUserDriver
createOrganizationalUnit
in interface I_CmsUserDriver
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 (or null
)associatedResource
- the first associated resourceCmsOrganizationalUnit
object representing
the newly created organizational unitCmsDataAccessException
- if operation was not successfulI_CmsUserDriver.createOrganizationalUnit(org.opencms.db.CmsDbContext, java.lang.String, java.lang.String, int, org.opencms.security.CmsOrganizationalUnit, String)
public void createRootOrganizationalUnit(CmsDbContext dbc)
I_CmsUserDriver
createRootOrganizationalUnit
in interface I_CmsUserDriver
dbc
- the current database contextI_CmsUserDriver.createRootOrganizationalUnit(org.opencms.db.CmsDbContext)
public 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
I_CmsUserDriver
createUser
in interface I_CmsUserDriver
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 infosCmsDataAccessException
- if something goes wrongI_CmsUserDriver.createUser(CmsDbContext, CmsUUID, String, String, String, String, String, long, int, long, Map)
public void createUserInGroup(CmsDbContext dbc, CmsUUID userId, CmsUUID groupId) throws CmsDataAccessException
I_CmsUserDriver
createUserInGroup
in interface I_CmsUserDriver
dbc
- the current database contextuserId
- the id of the user that is to be added to the groupgroupId
- the id of the groupCmsDataAccessException
- if operation was not successfulI_CmsUserDriver.createUserInGroup(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)
public void deleteAccessControlEntries(CmsDbContext dbc, CmsProject project, CmsUUID resource) throws CmsDataAccessException
TODO: check if this method is used somewhere TODO: remove this method
dbc
- the db contextproject
- the projectresource
- the resource's UUIDCmsDataAccessException
- if something goes wrongpublic void deleteGroup(CmsDbContext dbc, java.lang.String groupFqn) throws CmsDataAccessException
I_CmsUserDriver
Only groups that contain no subgroups can be deleted.
deleteGroup
in interface I_CmsUserDriver
dbc
- the current database contextgroupFqn
- the fully qualified name of the group that is to be deletedCmsDataAccessException
- if something goes wrongI_CmsUserDriver.deleteGroup(org.opencms.db.CmsDbContext, java.lang.String)
public void deleteOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit organizationalUnit) throws CmsDataAccessException
I_CmsUserDriver
Only organizational units that contain no suborganizational unit can be deleted.
deleteOrganizationalUnit
in interface I_CmsUserDriver
dbc
- the current db contextorganizationalUnit
- the organizational unit to deleteCmsDataAccessException
- if operation was not successfulI_CmsUserDriver.deleteOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit)
public void deleteUser(CmsDbContext dbc, java.lang.String userFqn) throws CmsDataAccessException
I_CmsUserDriver
deleteUser
in interface I_CmsUserDriver
dbc
- the current database contextuserFqn
- the fully qualified name of the user to deleteCmsDataAccessException
- if something goes wrongI_CmsUserDriver.deleteUser(org.opencms.db.CmsDbContext, java.lang.String)
public void deleteUserInfos(CmsDbContext dbc, CmsUUID userId) throws CmsDataAccessException
I_CmsUserDriver
deleteUserInfos
in interface I_CmsUserDriver
dbc
- the current database contextuserId
- the id of the user to updateCmsDataAccessException
- if something goes wrongI_CmsUserDriver.deleteUserInfos(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)
public void deleteUserInGroup(CmsDbContext dbc, CmsUUID userId, CmsUUID groupId) throws CmsDataAccessException
I_CmsUserDriver
deleteUserInGroup
in interface I_CmsUserDriver
dbc
- the current database contextuserId
- the id of the user that is to be removed from the groupgroupId
- the id of the groupCmsDataAccessException
- if something goes wrongI_CmsUserDriver.deleteUserInGroup(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)
public void destroy() throws java.lang.Throwable
I_CmsUserDriver
destroy
in interface I_CmsUserDriver
java.lang.Throwable
- if something goes wrongI_CmsUserDriver.destroy()
public boolean existsGroup(CmsDbContext dbc, java.lang.String groupFqn) throws CmsDataAccessException
I_CmsUserDriver
existsGroup
in interface I_CmsUserDriver
dbc
- the current database contextgroupFqn
- the fully qualified group name to be checkedtrue
, if a group with the specified name exists, false
otherwiseCmsDataAccessException
- if something goes wrongI_CmsUserDriver.existsGroup(org.opencms.db.CmsDbContext, java.lang.String)
public boolean existsUser(CmsDbContext dbc, java.lang.String userFqn) throws CmsDataAccessException
I_CmsUserDriver
existsUser
in interface I_CmsUserDriver
dbc
- the current database contextuserFqn
- the fully qualified name of the user to be checkedCmsDataAccessException
- if something goes wrongI_CmsUserDriver.existsUser(org.opencms.db.CmsDbContext, java.lang.String)
public void fillDefaults(CmsDbContext dbc) throws CmsInitException
I_CmsUserDriver
fillDefaults
in interface I_CmsUserDriver
dbc
- the current database context, be aware that this dbc has no runtime data!CmsInitException
- if something goes wrongI_CmsUserDriver.fillDefaults(org.opencms.db.CmsDbContext)
public java.util.List<CmsGroup> getGroups(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean includeSubOus, boolean readRoles) throws CmsDataAccessException
I_CmsUserDriver
getGroups
in interface I_CmsUserDriver
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 groupsCmsGroup
objects in the organizational unitCmsDataAccessException
- if operation was not successfulI_CmsUserDriver.getGroups(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean, boolean)
public java.util.List<CmsOrganizationalUnit> getOrganizationalUnits(CmsDbContext dbc, CmsOrganizationalUnit parent, boolean includeChildren) throws CmsDataAccessException
I_CmsUserDriver
getOrganizationalUnits
in interface I_CmsUserDriver
dbc
- the current db contextparent
- the parent organizational unit, or null
for the rootincludeChildren
- if hierarchical deeper organization units should also be returnedCmsOrganizationalUnit
objectsCmsDataAccessException
- if operation was not succesfulI_CmsUserDriver.getOrganizationalUnits(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean)
public java.util.List<CmsResource> getResourcesForOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit) throws CmsDataAccessException
I_CmsUserDriver
getResourcesForOrganizationalUnit
in interface I_CmsUserDriver
dbc
- the current db contextorgUnit
- the organizational unit to get all resources forCmsResource
objects in the organizational unitCmsDataAccessException
- if operation was not successfulI_CmsUserDriver.getResourcesForOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit)
public CmsSqlManager getSqlManager()
I_CmsUserDriver
getSqlManager
in interface I_CmsUserDriver
I_CmsUserDriver.getSqlManager()
public java.util.List<CmsUser> getUsers(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean recursive) throws CmsDataAccessException
I_CmsUserDriver
getUsers
in interface I_CmsUserDriver
dbc
- the current db contextorgUnit
- the organizational unit to get all users forrecursive
- flag to signalize the retrieval of users of sub-organizational units tooCmsUser
objects in the organizational unitCmsDataAccessException
- if operation was not successfulI_CmsUserDriver.getUsers(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean)
public java.util.List<CmsUser> getUsersWithoutAdditionalInfo(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean recursive) throws CmsDataAccessException
I_CmsUserDriver
getUsersWithoutAdditionalInfo
in interface I_CmsUserDriver
dbc
- the current db contextorgUnit
- the organizational unit to get all users forrecursive
- flag to signalize the retrieval of users of sub-organizational units tooCmsUser
objects in the organizational unitCmsDataAccessException
- if operation was not successfulI_CmsUserDriver.getUsersWithoutAdditionalInfo(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean)
public void init(CmsDbContext dbc, CmsConfigurationManager configurationManager, java.util.List<java.lang.String> successiveDrivers, CmsDriverManager driverManager)
I_CmsDriver
init
in interface I_CmsDriver
dbc
- the current database contextconfigurationManager
- the configuration managersuccessiveDrivers
- a list of successive drivers to be initializeddriverManager
- the initialized OpenCms driver managerI_CmsDriver.init(org.opencms.db.CmsDbContext, org.opencms.configuration.CmsConfigurationManager, java.util.List, org.opencms.db.CmsDriverManager)
public CmsSqlManager initSqlManager(java.lang.String classname)
I_CmsUserDriver
To obtain JDBC connections from different pools, further {online|offline|history} pool Urls have to be specified.
initSqlManager
in interface I_CmsUserDriver
classname
- the classname of the SQL managerI_CmsUserDriver.initSqlManager(String)
public void publishAccessControlEntries(CmsDbContext dbc, CmsProject offlineProject, CmsProject onlineProject, CmsUUID offlineId, CmsUUID onlineId) throws CmsDataAccessException
I_CmsUserDriver
Within the given project, the resource is identified by its offlineId, in the online project, it is identified by the given onlineId.
publishAccessControlEntries
in interface I_CmsUserDriver
dbc
- the current database contextofflineProject
- an offline projectonlineProject
- the onlie projectofflineId
- the offline resource idonlineId
- the online resource idCmsDataAccessException
- if something goes wrongI_CmsUserDriver.publishAccessControlEntries(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.file.CmsProject, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)
public java.util.List<CmsAccessControlEntry> readAccessControlEntries(CmsDbContext dbc, CmsProject project, CmsUUID resource, boolean inheritedOnly) throws CmsDataAccessException
I_CmsUserDriver
readAccessControlEntries
in interface I_CmsUserDriver
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 returnedCmsAccessControlEntry
objects defining all permissions for the given resourceCmsDataAccessException
- if something goes wrongI_CmsUserDriver.readAccessControlEntries(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID, boolean)
public CmsAccessControlEntry readAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsUUID resource, CmsUUID principal) throws CmsDataAccessException
I_CmsUserDriver
readAccessControlEntry
in interface I_CmsUserDriver
dbc
- the current database contextproject
- the project to write the entryresource
- the id of the resourceprincipal
- the id of the principalCmsDataAccessException
- if something goes wrongI_CmsUserDriver.readAccessControlEntry(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)
public java.util.List<CmsGroup> readChildGroups(CmsDbContext dbc, java.lang.String parentGroupFqn) throws CmsDataAccessException
I_CmsUserDriver
readChildGroups
in interface I_CmsUserDriver
dbc
- the current database contextparentGroupFqn
- the fully qualified name of the group to read the child groups fromCmsGroup
objects or null
CmsDataAccessException
- if operation was not succesfulI_CmsUserDriver.readChildGroups(org.opencms.db.CmsDbContext, java.lang.String)
public CmsGroup readGroup(CmsDbContext dbc, CmsUUID groupId) throws CmsDataAccessException
I_CmsUserDriver
readGroup
in interface I_CmsUserDriver
dbc
- the current database contextgroupId
- the id of the group that is to be readCmsDataAccessException
- if something goes wrongI_CmsUserDriver.readGroup(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)
public CmsGroup readGroup(CmsDbContext dbc, java.lang.String groupFqn) throws CmsDataAccessException
I_CmsUserDriver
readGroup
in interface I_CmsUserDriver
dbc
- the current database contextgroupFqn
- the fully qualified name of the group that is to be readCmsDataAccessException
- if something goes wrongI_CmsUserDriver.readGroup(org.opencms.db.CmsDbContext, java.lang.String)
public java.util.List<CmsGroup> readGroupsOfUser(CmsDbContext dbc, CmsUUID userId, java.lang.String ouFqn, boolean includeChildOus, java.lang.String remoteAddress, boolean readRoles) throws CmsDataAccessException
I_CmsUserDriver
readGroupsOfUser
in interface I_CmsUserDriver
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 groupsCmsGroup
objectsCmsDataAccessException
- if something goes wrongI_CmsUserDriver.readGroupsOfUser(CmsDbContext, CmsUUID, String, boolean, String, boolean)
public CmsOrganizationalUnit readOrganizationalUnit(CmsDbContext dbc, java.lang.String ouFqn) throws CmsDataAccessException
I_CmsUserDriver
readOrganizationalUnit
in interface I_CmsUserDriver
dbc
- the current db contextouFqn
- the fully qualified name of the organizational Unit to be readCmsDataAccessException
- if something goes wrongI_CmsUserDriver.readOrganizationalUnit(org.opencms.db.CmsDbContext, String)
public CmsUser readUser(CmsDbContext dbc, CmsUUID id) throws CmsDataAccessException
I_CmsUserDriver
readUser
in interface I_CmsUserDriver
dbc
- the current database contextid
- the id of the user to readCmsDataAccessException
- if something goes wrongI_CmsUserDriver.readUser(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)
public CmsUser readUser(CmsDbContext dbc, java.lang.String userFqn) throws CmsDataAccessException
I_CmsUserDriver
readUser
in interface I_CmsUserDriver
dbc
- the current database contextuserFqn
- the fully qualified name of the user to readCmsDataAccessException
- if something goes wrongI_CmsUserDriver.readUser(org.opencms.db.CmsDbContext, java.lang.String)
public CmsUser readUser(CmsDbContext dbc, java.lang.String userFqn, java.lang.String password, java.lang.String remoteAddress) throws CmsDataAccessException, CmsPasswordEncryptionException
I_CmsUserDriver
readUser
in interface I_CmsUserDriver
dbc
- the current database contextuserFqn
- the name of the userpassword
- the password of the userremoteAddress
- the remote address of the request, may be null
CmsDataAccessException
- if something goes wrongCmsPasswordEncryptionException
- if the password of the user could not be encryptedI_CmsUserDriver.readUser(org.opencms.db.CmsDbContext, java.lang.String, java.lang.String, String)
public java.util.Map<java.lang.String,java.lang.Object> readUserInfos(CmsDbContext dbc, CmsUUID userId) throws CmsDataAccessException
I_CmsUserDriver
readUserInfos
in interface I_CmsUserDriver
dbc
- the current database contextuserId
- the id of the user to updateCmsDataAccessException
- if something goes wrongI_CmsUserDriver.readUserInfos(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)
public java.util.List<CmsUser> readUsersOfGroup(CmsDbContext dbc, java.lang.String groupFqn, boolean includeOtherOuUsers) throws CmsDataAccessException
I_CmsUserDriver
readUsersOfGroup
in interface I_CmsUserDriver
dbc
- the current database contextgroupFqn
- the fully qualified name of the group to read the users fromincludeOtherOuUsers
- include users of other organizational unitsCmsUser
objects in the groupCmsDataAccessException
- if something goes wrongI_CmsUserDriver.readUsersOfGroup(CmsDbContext, String, boolean)
public void removeAccessControlEntries(CmsDbContext dbc, CmsProject project, CmsUUID resource) throws CmsDataAccessException
I_CmsUserDriver
removeAccessControlEntries
in interface I_CmsUserDriver
dbc
- the current database contextproject
- the project to write the entryresource
- the id of the resourceCmsDataAccessException
- if something goes wrongI_CmsUserDriver.removeAccessControlEntries(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID)
public void removeAccessControlEntriesForPrincipal(CmsDbContext dbc, CmsProject project, CmsProject onlineProject, CmsUUID principal) throws CmsDataAccessException
I_CmsUserDriver
removeAccessControlEntriesForPrincipal
in interface I_CmsUserDriver
dbc
- the current database contextproject
- the project to write the entryonlineProject
- the online projectprincipal
- the id of the principalCmsDataAccessException
- if something goes wrongI_CmsUserDriver.removeAccessControlEntriesForPrincipal(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.file.CmsProject, org.opencms.util.CmsUUID)
public void removeAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsUUID resource, CmsUUID principal) throws CmsDataAccessException
I_CmsUserDriver
removeAccessControlEntry
in interface I_CmsUserDriver
dbc
- the current database contextproject
- the project to write the entryresource
- the id of the resourceprincipal
- the id of the principalCmsDataAccessException
- if something goes wrongI_CmsUserDriver.removeAccessControlEntry(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)
public void removeResourceFromOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsResource resource) throws CmsDataAccessException
I_CmsUserDriver
removeResourceFromOrganizationalUnit
in interface I_CmsUserDriver
dbc
- the current db contextorgUnit
- the organizational unit to remove the resource fromresource
- the resource that is to be removed from the organizational unitCmsDataAccessException
- if something goes wrongI_CmsUserDriver.removeResourceFromOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, CmsResource)
public java.util.List<CmsUser> searchUsers(CmsDbContext dbc, CmsUserSearchParameters searchParams) throws CmsDataAccessException
I_CmsUserDriver
searchUsers
in interface I_CmsUserDriver
dbc
- the database contextsearchParams
- the search criteriaCmsDataAccessException
- if something goes wrongI_CmsUserDriver.searchUsers(org.opencms.db.CmsDbContext, org.opencms.file.CmsUserSearchParameters)
public void setDriverManager(CmsDriverManager driverManager)
I_CmsUserDriver
setDriverManager
in interface I_CmsUserDriver
driverManager
- the new driver managerI_CmsUserDriver.setDriverManager(org.opencms.db.CmsDriverManager)
public void setSqlManager(CmsSqlManager sqlManager)
I_CmsUserDriver
setSqlManager
in interface I_CmsUserDriver
sqlManager
- the new SQL managerI_CmsUserDriver.setSqlManager(org.opencms.db.CmsSqlManager)
public void setUsersOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsUser user) throws CmsDataAccessException
I_CmsUserDriver
setUsersOrganizationalUnit
in interface I_CmsUserDriver
dbc
- the current db contextorgUnit
- the organizational unit to move the user touser
- the user that is to be moved to the given organizational unitCmsDataAccessException
- if something goes wrongI_CmsUserDriver.setUsersOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, org.opencms.file.CmsUser)
public void writeAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsAccessControlEntry acEntry) throws CmsDataAccessException
I_CmsUserDriver
writeAccessControlEntry
in interface I_CmsUserDriver
dbc
- the current database contextproject
- the project to write the entryacEntry
- the entry to writeCmsDataAccessException
- if something goes wrongI_CmsUserDriver.writeAccessControlEntry(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.security.CmsAccessControlEntry)
public void writeGroup(CmsDbContext dbc, CmsGroup group) throws CmsDataAccessException
I_CmsUserDriver
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.
writeGroup
in interface I_CmsUserDriver
dbc
- the current database contextgroup
- the group to updateCmsDataAccessException
- if something goes wrongI_CmsUserDriver.writeGroup(org.opencms.db.CmsDbContext, org.opencms.file.CmsGroup)
public void writeOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit organizationalUnit) throws CmsDataAccessException
I_CmsUserDriver
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.
writeOrganizationalUnit
in interface I_CmsUserDriver
dbc
- the current db contextorganizationalUnit
- the organizational unit that should be writtenCmsDataAccessException
- if operation was not successfulI_CmsUserDriver.writeOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit)
public void writePassword(CmsDbContext dbc, java.lang.String userFqn, java.lang.String oldPassword, java.lang.String newPassword) throws CmsDataAccessException, CmsPasswordEncryptionException
I_CmsUserDriver
writePassword
in interface I_CmsUserDriver
dbc
- the current database contextuserFqn
- the fullyqualified name of the user to set the password foroldPassword
- the current passwordnewPassword
- the password to setCmsDataAccessException
- if something goes wrongCmsPasswordEncryptionException
- if the (new) password could not be encryptedI_CmsUserDriver.writePassword(org.opencms.db.CmsDbContext, java.lang.String, java.lang.String, java.lang.String)
public void writeUser(CmsDbContext dbc, CmsUser user) throws CmsDataAccessException
I_CmsUserDriver
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.
writeUser
in interface I_CmsUserDriver
dbc
- the current database contextuser
- the user to updateCmsDataAccessException
- if something goes wrongI_CmsUserDriver.writeUser(org.opencms.db.CmsDbContext, org.opencms.file.CmsUser)
public void writeUserInfo(CmsDbContext dbc, CmsUUID userId, java.lang.String key, java.lang.Object value) throws CmsDataAccessException
I_CmsUserDriver
writeUserInfo
in interface I_CmsUserDriver
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 writeCmsDataAccessException
- if something goes wrongI_CmsUserDriver.writeUserInfo(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, java.lang.String, java.lang.Object)
protected javax.persistence.Query createQueryFromStringAndParams(java.lang.String queryString, java.util.List<java.lang.Object> queryParams)
queryString
- the query stringqueryParams
- the parametersprotected java.lang.String createRoleQuery(java.lang.String mainQuery, boolean includeSubOus, boolean readRoles)
mainQuery
- the main select sql queryincludeSubOus
- if groups in sub-ous should be included in the selectionreadRoles
- if groups or roles whould be selectedprotected CmsAccessControlEntry internalCreateAce(I_CmsDAOAccessControl ac)
ac
- the access controlCmsAccessControlEntry
initialized with the values from the current database recordprotected CmsAccessControlEntry internalCreateAce(I_CmsDAOAccessControl ac, CmsUUID newId)
ac
- the access controlnewId
- the id of the new access control entryCmsAccessControlEntry
initialized with the values from the current database recordprotected void internalCreateDefaultGroups(CmsDbContext dbc, java.lang.String ouFqn, java.lang.String ouDescription, boolean webuser) throws CmsException
dbc
- the database contextouFqn
- the fully qualified name of the organizational unit to create the principals forouDescription
- the description of the given organizational unitwebuser
- the webuser ou flagCmsException
- if something goes wrongprotected CmsGroup internalCreateGroup(CmsDAOGroups g)
CmsGroup
instance from a JDBC result set.g
- the groupprotected CmsOrganizationalUnit internalCreateOrgUnitFromResource(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current db contextresource
- the resource that represents an organizational unitCmsException
- if something goes wrongprotected CmsResource internalCreateResourceForOrgUnit(CmsDbContext dbc, java.lang.String path, int flags) throws CmsException
dbc
- the current database contextpath
- the path to create the folderflags
- the resource flagsCmsException
- if something goes wrongprotected CmsUser internalCreateUser(CmsDbContext dbc, CmsDAOUsers u) throws CmsDataAccessException
CmsUser
instance from a JDBC result set.dbc
- the current database contextu
- the userCmsDataAccessException
- if there is an error in de-serializing the user infoprotected void internalDeleteOrgUnitResource(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource to deleteCmsException
- if something goes wrongprotected void internalDeleteUserInfo(CmsDbContext dbc, CmsUUID userId, java.lang.String key) throws CmsDataAccessException
dbc
- the current dbcuserId
- the user to delete additional info fromkey
- the additional info to deleteCmsDataAccessException
- if something goes wrongprotected CmsResource internalOrgUnitFolder(CmsDbContext dbc, CmsOrganizationalUnit orgUnit) throws CmsException
null
.The base folder will be created if it does not exist.
dbc
- the current db contextorgUnit
- the organizational unit to get the folder forCmsException
- if something goes wrongprotected java.util.List<java.lang.String> internalResourcesForOrgUnit(CmsDbContext dbc, CmsResource ouResource) throws CmsException
dbc
- the current db contextouResource
- the resource that represents the organizational unit to get the resources forCmsException
- if something goes wrongprotected void internalUpdateRoleGroup(CmsDbContext dbc, java.lang.String groupName, CmsRole role) throws CmsDataAccessException
dbc
- the database contextgroupName
- the name of the group to updaterole
- the role for this groupCmsDataAccessException
- if something goes wrongprotected void internalUpdateUserInfo(CmsDbContext dbc, CmsUUID userId, java.lang.String key, java.lang.Object value) throws CmsDataAccessException
dbc
- the current dbcuserId
- the user id to add the user info forkey
- the name of the additional user infovalue
- the value of the additional user infoCmsDataAccessException
- if something goes wrongprotected void internalValidateResourceForOrgUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, java.lang.String rootPath) throws CmsException
dbc
- the current db contextorgUnit
- the organizational unitrootPath
- the root path to checkCmsException
- if something goes wrongprotected boolean internalValidateUserInGroup(CmsDbContext dbc, CmsUUID userId, CmsUUID groupId) throws CmsDataAccessException
dbc
- the database contextuserId
- the id of the user to checkgroupId
- the id of the group to checkCmsDataAccessException
- if operation was not succesfulprotected void internalWriteOrgUnitProperty(CmsDbContext dbc, CmsResource resource, CmsProperty property) throws CmsException
dbc
- the current database contextresource
- the resource representing the organizational unitproperty
- the property to writeCmsException
- if something goes wrongprotected void internalWriteUserInfo(CmsDbContext dbc, CmsUUID userId, java.lang.String key, java.lang.Object value) throws CmsDataAccessException
dbc
- the current dbcuserId
- the user id to add the user info forkey
- the name of the additional user infovalue
- the value of the additional user infoCmsDataAccessException
- if something goes wrongprotected void internalWriteUserInfos(CmsDbContext dbc, CmsUUID userId, java.util.Map<java.lang.String,java.lang.Object> additionalInfo) throws CmsDataAccessException
dbc
- the current database contextuserId
- the id of the user to updateadditionalInfo
- the info to writeCmsDataAccessException
- if user data could not be written