|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.db.generic.CmsUserDriver
public class CmsUserDriver
Generic (ANSI-SQL) database server implementation of the user driver methods.
Field Summary | |
---|---|
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. |
Fields inherited from interface org.opencms.db.I_CmsUserDriver |
---|
DRIVER_TYPE_ID |
Fields inherited from interface org.opencms.db.I_CmsDriver |
---|
AND_CONDITION, BEGIN_CONDITION, BEGIN_EXCLUDE_CONDITION, BEGIN_INCLUDE_CONDITION, END_CONDITION, OR_CONDITION |
Constructor Summary | |
---|---|
CmsUserDriver()
|
Method Summary | |
---|---|
void |
addResourceToOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
CmsResource resource)
Adds a resource to the given organizational unit. |
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 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 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)
Deprecated. use removeAccessControlEntries(CmsDbContext, CmsProject, CmsUUID) instead |
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 |
getGroups(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
boolean includeSubOus,
boolean readRoles)
Returns all groups of the given organizational unit. |
java.util.List |
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 |
getResourcesForOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit)
Returns all resources of the given organizational unit. |
CmsSqlManager |
getSqlManager()
Returns the SqlManager of this driver. |
java.util.List |
getUsers(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
boolean recursive)
Returns all users of the given organizational unit. |
void |
init(CmsDbContext dbc,
CmsConfigurationManager configurationManager,
java.util.List successiveDrivers,
CmsDriverManager driverManager)
Initializes the driver. |
CmsSqlManager |
initSqlManager(java.lang.String classname)
Initializes the SQL manager for this driver. |
protected CmsAccessControlEntry |
internalCreateAce(java.sql.ResultSet res)
Internal helper method to create an access control entry from a database record. |
protected CmsAccessControlEntry |
internalCreateAce(java.sql.ResultSet res,
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(java.sql.ResultSet res)
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,
java.sql.ResultSet res)
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 |
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 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 |
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 |
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 |
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 |
readUserInfos(CmsDbContext dbc,
CmsUUID userId)
Reads the user additional information map. |
java.util.List |
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. |
void |
setDriverManager(CmsDriverManager driverManager)
Sets the driver manager for this driver. |
void |
setSqlManager(CmsSqlManager sqlManager)
Sets the SQL manager for this driver. |
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 class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.opencms.db.I_CmsDriver |
---|
toString |
Field Detail |
---|
public static final java.lang.String ORGUNIT_BASE_FOLDER
public static final java.lang.String REQ_ATTR_DONT_DIGEST_PASSWORD
protected CmsDriverManager m_driverManager
protected CmsSqlManager m_sqlManager
Constructor Detail |
---|
public CmsUserDriver()
Method Detail |
---|
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 unit
CmsDataAccessException
- if something goes wrongI_CmsUserDriver.addResourceToOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, org.opencms.file.CmsResource)
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
- flags
CmsDataAccessException
- 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 resource
CmsOrganizationalUnit
object representing
the newly created organizational unit
CmsDataAccessException
- 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 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 infos
CmsDataAccessException
- 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 group
CmsDataAccessException
- 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
removeAccessControlEntries(CmsDbContext, CmsProject, CmsUUID)
instead
I_CmsUserDriver
deleteAccessControlEntries
in interface I_CmsUserDriver
dbc
- the current database contextproject
- the project to delete the ACEs inresource
- the id of the resource to delete the ACEs from
CmsDataAccessException
- if something goes wrongI_CmsUserDriver.deleteAccessControlEntries(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID)
public 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 deleted
CmsDataAccessException
- 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 delete
CmsDataAccessException
- 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 delete
CmsDataAccessException
- 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 update
CmsDataAccessException
- 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 group
CmsDataAccessException
- 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 checked
true
, if a group with the specified name exists, false
otherwise
CmsDataAccessException
- 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 checked
CmsDataAccessException
- 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 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 groups
CmsGroup
objects in the organizational unit
CmsDataAccessException
- if operation was not successfulI_CmsUserDriver.getGroups(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean, boolean)
public java.util.List 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 returned
CmsOrganizationalUnit
objects
CmsDataAccessException
- if operation was not successfulI_CmsUserDriver.getOrganizationalUnits(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean)
public java.util.List 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 for
CmsResource
objects in the organizational unit
CmsDataAccessException
- 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 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 too
CmsUser
objects in the organizational unit
CmsDataAccessException
- if operation was not successfulI_CmsUserDriver.getUsers(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean)
public void init(CmsDbContext dbc, CmsConfigurationManager configurationManager, java.util.List 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 manager
I_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 id
CmsDataAccessException
- 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 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 returned
CmsAccessControlEntry
objects defining all permissions for the given resource
CmsDataAccessException
- 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 principal
CmsDataAccessException
- 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 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 from
CmsGroup
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 read
CmsDataAccessException
- 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 read
CmsDataAccessException
- if something goes wrongI_CmsUserDriver.readGroup(org.opencms.db.CmsDbContext, java.lang.String)
public java.util.List 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 groups
CmsGroup
objects
CmsDataAccessException
- 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 read
CmsDataAccessException
- 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 read
CmsDataAccessException
- 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 read
CmsDataAccessException
- 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 wrong
CmsPasswordEncryptionException
- 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 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 update
CmsDataAccessException
- if something goes wrongI_CmsUserDriver.readUserInfos(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)
public java.util.List 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 units
CmsUser
objects in the group
CmsDataAccessException
- 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 resource
CmsDataAccessException
- 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 principal
CmsDataAccessException
- 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 principal
CmsDataAccessException
- 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 unit
CmsDataAccessException
- if something goes wrongI_CmsUserDriver.removeResourceFromOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, CmsResource)
public void setDriverManager(CmsDriverManager driverManager)
driverManager
- the new driver managerpublic void setSqlManager(CmsSqlManager sqlManager)
sqlManager
- the new SQL managerpublic 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 unit
CmsDataAccessException
- 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 write
CmsDataAccessException
- 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 update
CmsDataAccessException
- 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 written
CmsDataAccessException
- 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 set
CmsDataAccessException
- if something goes wrong
CmsPasswordEncryptionException
- 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 update
CmsDataAccessException
- 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 write
CmsDataAccessException
- if something goes wrongI_CmsUserDriver.writeUserInfo(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, java.lang.String, java.lang.Object)
protected 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 selected
protected CmsAccessControlEntry internalCreateAce(java.sql.ResultSet res) throws java.sql.SQLException
res
- resultset of the current query
CmsAccessControlEntry
initialized with the values from the current database record
java.sql.SQLException
- if something goes wrongprotected CmsAccessControlEntry internalCreateAce(java.sql.ResultSet res, CmsUUID newId) throws java.sql.SQLException
res
- resultset of the current querynewId
- the id of the new access control entry
CmsAccessControlEntry
initialized with the values from the current database record
java.sql.SQLException
- if something goes wrongprotected 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 flag
CmsException
- if something goes wrongprotected CmsGroup internalCreateGroup(java.sql.ResultSet res) throws java.sql.SQLException
CmsGroup
instance from a JDBC result set.
res
- the JDBC ResultSet
java.sql.SQLException
- in case the result set does not include a requested table attributeprotected CmsOrganizationalUnit internalCreateOrgUnitFromResource(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current db contextresource
- the resource that represents an organizational unit
CmsException
- 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 flags
CmsException
- if something goes wrongprotected CmsUser internalCreateUser(CmsDbContext dbc, java.sql.ResultSet res) throws CmsDataAccessException, java.sql.SQLException
CmsUser
instance from a JDBC result set.
dbc
- the current database contextres
- the JDBC ResultSet
java.sql.SQLException
- in case the result set does not include a requested table attribute
CmsDataAccessException
- if there is an error in deserializing the user infoprotected void internalDeleteOrgUnitResource(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource to delete
CmsException
- 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 delete
CmsDataAccessException
- 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 for
CmsException
- if something goes wrongprotected java.util.List internalResourcesForOrgUnit(CmsDbContext dbc, CmsResource ouResource) throws CmsException
dbc
- the current db contextouResource
- the resource that represents the organizational unit to get the resources for
CmsException
- 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 group
CmsDataAccessException
- 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 info
CmsDataAccessException
- 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 check
CmsException
- 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 check
CmsDataAccessException
- 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 write
CmsException
- 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 info
CmsDataAccessException
- if something goes wrongprotected void internalWriteUserInfos(CmsDbContext dbc, CmsUUID userId, java.util.Map additionalInfo) throws CmsDataAccessException
dbc
- the current database contextuserId
- the id of the user to updateadditionalInfo
- the info to write
CmsDataAccessException
- if user data could not be written
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |