org.opencms.db.generic
Class CmsUserDriver

java.lang.Object
  extended by org.opencms.db.generic.CmsUserDriver
All Implemented Interfaces:
I_CmsDriver, I_CmsUserDriver
Direct Known Subclasses:
CmsUserDriver, CmsUserDriver, CmsUserDriver, CmsUserDriver, CmsUserDriver, CmsUserDriver, CmsUserDriver

public class CmsUserDriver
extends java.lang.Object
implements I_CmsDriver, I_CmsUserDriver

Generic (ANSI-SQL) database server implementation of the user driver methods.

Since:
6.0.0
Version:
$Revision: 1.140 $
Author:
Thomas Weckert, Carsten Weinholz, Michael Emmerich, Michael Moossen

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

ORGUNIT_BASE_FOLDER

public static final java.lang.String ORGUNIT_BASE_FOLDER
The root path for organizational units.

See Also:
Constant Field Values

REQ_ATTR_DONT_DIGEST_PASSWORD

public static final java.lang.String REQ_ATTR_DONT_DIGEST_PASSWORD
The internal request attribute to indicate that the password has not to be digested.

See Also:
Constant Field Values

m_driverManager

protected CmsDriverManager m_driverManager
The driver manager.


m_sqlManager

protected CmsSqlManager m_sqlManager
The SQL manager.

Constructor Detail

CmsUserDriver

public CmsUserDriver()
Method Detail

addResourceToOrganizationalUnit

public void addResourceToOrganizationalUnit(CmsDbContext dbc,
                                            CmsOrganizationalUnit orgUnit,
                                            CmsResource resource)
                                     throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Adds a resource to the given organizational unit.

Specified by:
addResourceToOrganizationalUnit in interface I_CmsUserDriver
Parameters:
dbc - the current db context
orgUnit - the organizational unit to add the resource to
resource - the resource that is to be added to the organizational unit
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.addResourceToOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, org.opencms.file.CmsResource)

createAccessControlEntry

public void createAccessControlEntry(CmsDbContext dbc,
                                     CmsProject project,
                                     CmsUUID resource,
                                     CmsUUID principal,
                                     int allowed,
                                     int denied,
                                     int flags)
                              throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Creates an access control entry.

Specified by:
createAccessControlEntry in interface I_CmsUserDriver
Parameters:
dbc - the current database context
project - the project to write the entry
resource - the id of the resource
principal - the id of the principal (user or group)
allowed - the bitset of allowed permissions
denied - the bitset of denied permissions
flags - flags
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.createAccessControlEntry(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID, int, int, int)

createGroup

public CmsGroup createGroup(CmsDbContext dbc,
                            CmsUUID groupId,
                            java.lang.String groupFqn,
                            java.lang.String description,
                            int flags,
                            java.lang.String parentGroupFqn)
                     throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Creates a new group.

Specified by:
createGroup in interface I_CmsUserDriver
Parameters:
dbc - the current database context
groupId - the id of the new group
groupFqn - the fully qualified name of the new group
description - The description for the new group
flags - the flags for the new group
parentGroupFqn - the name of the parent group (or null if the group has no parent)
Returns:
the created group
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.createGroup(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, java.lang.String, java.lang.String, int, java.lang.String)

createOrganizationalUnit

public CmsOrganizationalUnit createOrganizationalUnit(CmsDbContext dbc,
                                                      java.lang.String name,
                                                      java.lang.String description,
                                                      int flags,
                                                      CmsOrganizationalUnit parent,
                                                      java.lang.String associatedResource)
                                               throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Creates a new organizational unit.

Specified by:
createOrganizationalUnit in interface I_CmsUserDriver
Parameters:
dbc - the current db context
name - the name of the new organizational unit
description - the description of the new organizational unit
flags - the flags for the new organizational unit
parent - the parent organizational unit (or null)
associatedResource - the first associated resource
Returns:
a CmsOrganizationalUnit object representing the newly created organizational unit
Throws:
CmsDataAccessException - if operation was not successful
See Also:
I_CmsUserDriver.createOrganizationalUnit(org.opencms.db.CmsDbContext, java.lang.String, java.lang.String, int, org.opencms.security.CmsOrganizationalUnit, String)

createRootOrganizationalUnit

public void createRootOrganizationalUnit(CmsDbContext dbc)
Description copied from interface: I_CmsUserDriver
Creates the default root organizational unit.

Specified by:
createRootOrganizationalUnit in interface I_CmsUserDriver
Parameters:
dbc - the current database context
See Also:
I_CmsUserDriver.createRootOrganizationalUnit(org.opencms.db.CmsDbContext)

createUser

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
Description copied from interface: I_CmsUserDriver
Creates a new user.

Specified by:
createUser in interface I_CmsUserDriver
Parameters:
dbc - the current database context
id - the id of the user
userFqn - the fully qualified name of the new user
password - the already encripted user password
firstname - the user firstname
lastname - the user lastname
email - the user email
lastlogin - the user lastlogin time
flags - the user flags
dateCreated - the creation date
additionalInfos - the user additional infos
Returns:
the created user
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.createUser(CmsDbContext, CmsUUID, String, String, String, String, String, long, int, long, Map)

createUserInGroup

public void createUserInGroup(CmsDbContext dbc,
                              CmsUUID userId,
                              CmsUUID groupId)
                       throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Adds a user to a group.

Specified by:
createUserInGroup in interface I_CmsUserDriver
Parameters:
dbc - the current database context
userId - the id of the user that is to be added to the group
groupId - the id of the group
Throws:
CmsDataAccessException - if operation was not successful
See Also:
I_CmsUserDriver.createUserInGroup(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)

deleteAccessControlEntries

public void deleteAccessControlEntries(CmsDbContext dbc,
                                       CmsProject project,
                                       CmsUUID resource)
                                throws CmsDataAccessException
Deprecated. use removeAccessControlEntries(CmsDbContext, CmsProject, CmsUUID) instead

Description copied from interface: I_CmsUserDriver
Deletes all access control entries (ACEs) belonging to a resource.

Specified by:
deleteAccessControlEntries in interface I_CmsUserDriver
Parameters:
dbc - the current database context
project - the project to delete the ACEs in
resource - the id of the resource to delete the ACEs from
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.deleteAccessControlEntries(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID)

deleteGroup

public void deleteGroup(CmsDbContext dbc,
                        java.lang.String groupFqn)
                 throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Deletes a group.

Only groups that contain no subgroups can be deleted.

Specified by:
deleteGroup in interface I_CmsUserDriver
Parameters:
dbc - the current database context
groupFqn - the fully qualified name of the group that is to be deleted
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.deleteGroup(org.opencms.db.CmsDbContext, java.lang.String)

deleteOrganizationalUnit

public void deleteOrganizationalUnit(CmsDbContext dbc,
                                     CmsOrganizationalUnit organizationalUnit)
                              throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Deletes an organizational unit.

Only organizational units that contain no suborganizational unit can be deleted.

Specified by:
deleteOrganizationalUnit in interface I_CmsUserDriver
Parameters:
dbc - the current db context
organizationalUnit - the organizational unit to delete
Throws:
CmsDataAccessException - if operation was not successful
See Also:
I_CmsUserDriver.deleteOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit)

deleteUser

public void deleteUser(CmsDbContext dbc,
                       java.lang.String userFqn)
                throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Deletes a user.

Specified by:
deleteUser in interface I_CmsUserDriver
Parameters:
dbc - the current database context
userFqn - the fully qualified name of the user to delete
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.deleteUser(org.opencms.db.CmsDbContext, java.lang.String)

deleteUserInfos

public void deleteUserInfos(CmsDbContext dbc,
                            CmsUUID userId)
                     throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Deletes the user additional information table.

Specified by:
deleteUserInfos in interface I_CmsUserDriver
Parameters:
dbc - the current database context
userId - the id of the user to update
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.deleteUserInfos(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)

deleteUserInGroup

public void deleteUserInGroup(CmsDbContext dbc,
                              CmsUUID userId,
                              CmsUUID groupId)
                       throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Removes a user from a group.

Specified by:
deleteUserInGroup in interface I_CmsUserDriver
Parameters:
dbc - the current database context
userId - the id of the user that is to be removed from the group
groupId - the id of the group
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.deleteUserInGroup(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)

destroy

public void destroy()
             throws java.lang.Throwable
Description copied from interface: I_CmsUserDriver
Destroys this driver.

Specified by:
destroy in interface I_CmsUserDriver
Throws:
java.lang.Throwable - if something goes wrong
See Also:
I_CmsUserDriver.destroy()

existsGroup

public boolean existsGroup(CmsDbContext dbc,
                           java.lang.String groupFqn)
                    throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Tests if a group with the specified name exists.

Specified by:
existsGroup in interface I_CmsUserDriver
Parameters:
dbc - the current database context
groupFqn - 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
See Also:
I_CmsUserDriver.existsGroup(org.opencms.db.CmsDbContext, java.lang.String)

existsUser

public boolean existsUser(CmsDbContext dbc,
                          java.lang.String userFqn)
                   throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Tests if a user with the specified name exists.

Specified by:
existsUser in interface I_CmsUserDriver
Parameters:
dbc - the current database context
userFqn - 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
See Also:
I_CmsUserDriver.existsUser(org.opencms.db.CmsDbContext, java.lang.String)

fillDefaults

public void fillDefaults(CmsDbContext dbc)
                  throws CmsInitException
Description copied from interface: I_CmsUserDriver
Initializes the default organizational units, users and groups.

Specified by:
fillDefaults in interface I_CmsUserDriver
Parameters:
dbc - the current database context, be aware that this dbc has no runtime data!
Throws:
CmsInitException - if something goes wrong
See Also:
I_CmsUserDriver.fillDefaults(org.opencms.db.CmsDbContext)

getGroups

public java.util.List getGroups(CmsDbContext dbc,
                                CmsOrganizationalUnit orgUnit,
                                boolean includeSubOus,
                                boolean readRoles)
                         throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Returns all groups of the given organizational unit.

Specified by:
getGroups in interface I_CmsUserDriver
Parameters:
dbc - the current db context
orgUnit - the organizational unit to get all groups for
includeSubOus - flag to signalize the retrieval of groups of sub-organizational units too
readRoles - if to read roles or groups
Returns:
all CmsGroup objects in the organizational unit
Throws:
CmsDataAccessException - if operation was not successful
See Also:
I_CmsUserDriver.getGroups(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean, boolean)

getOrganizationalUnits

public java.util.List getOrganizationalUnits(CmsDbContext dbc,
                                             CmsOrganizationalUnit parent,
                                             boolean includeChildren)
                                      throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Returns all child organizational units of the given parent organizational unit including hierarchical deeper organization units if needed.

Specified by:
getOrganizationalUnits in interface I_CmsUserDriver
Parameters:
dbc - the current db context
parent - the parent organizational unit, or null for the root
includeChildren - if hierarchical deeper organization units should also be returned
Returns:
a list of CmsOrganizationalUnit objects
Throws:
CmsDataAccessException - if operation was not successful
See Also:
I_CmsUserDriver.getOrganizationalUnits(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean)

getResourcesForOrganizationalUnit

public java.util.List getResourcesForOrganizationalUnit(CmsDbContext dbc,
                                                        CmsOrganizationalUnit orgUnit)
                                                 throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Returns all resources of the given organizational unit.

Specified by:
getResourcesForOrganizationalUnit in interface I_CmsUserDriver
Parameters:
dbc - the current db context
orgUnit - the organizational unit to get all resources for
Returns:
all CmsResource objects in the organizational unit
Throws:
CmsDataAccessException - if operation was not successful
See Also:
I_CmsUserDriver.getResourcesForOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit)

getSqlManager

public CmsSqlManager getSqlManager()
Description copied from interface: I_CmsUserDriver
Returns the SqlManager of this driver.

Specified by:
getSqlManager in interface I_CmsUserDriver
Returns:
the SqlManager of this driver
See Also:
I_CmsUserDriver.getSqlManager()

getUsers

public java.util.List getUsers(CmsDbContext dbc,
                               CmsOrganizationalUnit orgUnit,
                               boolean recursive)
                        throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Returns all users of the given organizational unit.

Specified by:
getUsers in interface I_CmsUserDriver
Parameters:
dbc - the current db context
orgUnit - the organizational unit to get all users for
recursive - flag to signalize the retrieval of users of sub-organizational units too
Returns:
all CmsUser objects in the organizational unit
Throws:
CmsDataAccessException - if operation was not successful
See Also:
I_CmsUserDriver.getUsers(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean)

init

public void init(CmsDbContext dbc,
                 CmsConfigurationManager configurationManager,
                 java.util.List successiveDrivers,
                 CmsDriverManager driverManager)
Description copied from interface: I_CmsDriver
Initializes the driver.

Specified by:
init in interface I_CmsDriver
Parameters:
dbc - the current database context
configurationManager - the configuration manager
successiveDrivers - a list of successive drivers to be initialized
driverManager - the initialized OpenCms driver manager
See Also:
I_CmsDriver.init(org.opencms.db.CmsDbContext, org.opencms.configuration.CmsConfigurationManager, java.util.List, org.opencms.db.CmsDriverManager)

initSqlManager

public CmsSqlManager initSqlManager(java.lang.String classname)
Description copied from interface: I_CmsUserDriver
Initializes the SQL manager for this driver.

To obtain JDBC connections from different pools, further {online|offline|history} pool Urls have to be specified.

Specified by:
initSqlManager in interface I_CmsUserDriver
Parameters:
classname - the classname of the SQL manager
Returns:
the SQL manager for this driver
See Also:
I_CmsUserDriver.initSqlManager(String)

publishAccessControlEntries

public void publishAccessControlEntries(CmsDbContext dbc,
                                        CmsProject offlineProject,
                                        CmsProject onlineProject,
                                        CmsUUID offlineId,
                                        CmsUUID onlineId)
                                 throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
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.

Specified by:
publishAccessControlEntries in interface I_CmsUserDriver
Parameters:
dbc - the current database context
offlineProject - an offline project
onlineProject - the onlie project
offlineId - the offline resource id
onlineId - the online resource id
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.publishAccessControlEntries(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.file.CmsProject, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)

readAccessControlEntries

public java.util.List readAccessControlEntries(CmsDbContext dbc,
                                               CmsProject project,
                                               CmsUUID resource,
                                               boolean inheritedOnly)
                                        throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Reads all relevant access control entries for a given resource.

Specified by:
readAccessControlEntries in interface I_CmsUserDriver
Parameters:
dbc - the current database context
project - the project to write the entry
resource - the id of the resource
inheritedOnly - flag to indicate that only inherited entries should be returned
Returns:
a list of CmsAccessControlEntry objects defining all permissions for the given resource
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.readAccessControlEntries(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID, boolean)

readAccessControlEntry

public CmsAccessControlEntry readAccessControlEntry(CmsDbContext dbc,
                                                    CmsProject project,
                                                    CmsUUID resource,
                                                    CmsUUID principal)
                                             throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Reads an access control entry for a given principal that is attached to a resource.

Specified by:
readAccessControlEntry in interface I_CmsUserDriver
Parameters:
dbc - the current database context
project - the project to write the entry
resource - the id of the resource
principal - 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
See Also:
I_CmsUserDriver.readAccessControlEntry(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)

readChildGroups

public java.util.List readChildGroups(CmsDbContext dbc,
                                      java.lang.String parentGroupFqn)
                               throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Reads all child groups of a group.

Specified by:
readChildGroups in interface I_CmsUserDriver
Parameters:
dbc - the current database context
parentGroupFqn - the fully qualified name of the group to read the child groups from
Returns:
a list of all child CmsGroup objects or null
Throws:
CmsDataAccessException - if operation was not succesful
See Also:
I_CmsUserDriver.readChildGroups(org.opencms.db.CmsDbContext, java.lang.String)

readGroup

public CmsGroup readGroup(CmsDbContext dbc,
                          CmsUUID groupId)
                   throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Reads a group based on the group id.

Specified by:
readGroup in interface I_CmsUserDriver
Parameters:
dbc - the current database context
groupId - the id of the group that is to be read
Returns:
the group that was read
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.readGroup(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)

readGroup

public CmsGroup readGroup(CmsDbContext dbc,
                          java.lang.String groupFqn)
                   throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Reads a group based on the group name.

Specified by:
readGroup in interface I_CmsUserDriver
Parameters:
dbc - the current database context
groupFqn - the fully qualified name of the group that is to be read
Returns:
the group that was read
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.readGroup(org.opencms.db.CmsDbContext, java.lang.String)

readGroupsOfUser

public java.util.List readGroupsOfUser(CmsDbContext dbc,
                                       CmsUUID userId,
                                       java.lang.String ouFqn,
                                       boolean includeChildOus,
                                       java.lang.String remoteAddress,
                                       boolean readRoles)
                                throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Reads all groups the given user is a member in.

Specified by:
readGroupsOfUser in interface I_CmsUserDriver
Parameters:
dbc - the current database context
userId - the id of the user
ouFqn - the fully qualified name of the organizational unit to restrict the result set for
includeChildOus - include groups of child organizational units
remoteAddress - the IP address to filter the groups in the result list
readRoles - if to read roles or groups
Returns:
a list of CmsGroup objects
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.readGroupsOfUser(CmsDbContext, CmsUUID, String, boolean, String, boolean)

readOrganizationalUnit

public CmsOrganizationalUnit readOrganizationalUnit(CmsDbContext dbc,
                                                    java.lang.String ouFqn)
                                             throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Reads an organizational Unit based on its fully qualified name.

Specified by:
readOrganizationalUnit in interface I_CmsUserDriver
Parameters:
dbc - the current db context
ouFqn - 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
See Also:
I_CmsUserDriver.readOrganizationalUnit(org.opencms.db.CmsDbContext, String)

readUser

public CmsUser readUser(CmsDbContext dbc,
                        CmsUUID id)
                 throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Reads a user based on the user id.

Specified by:
readUser in interface I_CmsUserDriver
Parameters:
dbc - the current database context
id - the id of the user to read
Returns:
the user that was read
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.readUser(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)

readUser

public CmsUser readUser(CmsDbContext dbc,
                        java.lang.String userFqn)
                 throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Reads a user based in the user fully qualified name.

Specified by:
readUser in interface I_CmsUserDriver
Parameters:
dbc - the current database context
userFqn - the fully qualified name of the user to read
Returns:
the user that was read
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.readUser(org.opencms.db.CmsDbContext, java.lang.String)

readUser

public CmsUser readUser(CmsDbContext dbc,
                        java.lang.String userFqn,
                        java.lang.String password,
                        java.lang.String remoteAddress)
                 throws CmsDataAccessException,
                        CmsPasswordEncryptionException
Description copied from interface: I_CmsUserDriver
Reads a user from the database, only if the password is correct.

Specified by:
readUser in interface I_CmsUserDriver
Parameters:
dbc - the current database context
userFqn - the name of the user
password - the password of the user
remoteAddress - the remote address of the request, may be null
Returns:
the user that was read
Throws:
CmsDataAccessException - if something goes wrong
CmsPasswordEncryptionException - if the password of the user could not be encrypted
See Also:
I_CmsUserDriver.readUser(org.opencms.db.CmsDbContext, java.lang.String, java.lang.String, String)

readUserInfos

public java.util.Map readUserInfos(CmsDbContext dbc,
                                   CmsUUID userId)
                            throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Reads the user additional information map.

Specified by:
readUserInfos in interface I_CmsUserDriver
Parameters:
dbc - the current database context
userId - the id of the user to update
Returns:
the user additional information map
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.readUserInfos(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)

readUsersOfGroup

public java.util.List readUsersOfGroup(CmsDbContext dbc,
                                       java.lang.String groupFqn,
                                       boolean includeOtherOuUsers)
                                throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Reads all users that are members of the given group.

Specified by:
readUsersOfGroup in interface I_CmsUserDriver
Parameters:
dbc - the current database context
groupFqn - the fully qualified name of the group to read the users from
includeOtherOuUsers - include users of other organizational units
Returns:
all CmsUser objects in the group
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.readUsersOfGroup(CmsDbContext, String, boolean)

removeAccessControlEntries

public void removeAccessControlEntries(CmsDbContext dbc,
                                       CmsProject project,
                                       CmsUUID resource)
                                throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Removes all access control entries belonging to a resource.

Specified by:
removeAccessControlEntries in interface I_CmsUserDriver
Parameters:
dbc - the current database context
project - the project to write the entry
resource - the id of the resource
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.removeAccessControlEntries(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID)

removeAccessControlEntriesForPrincipal

public void removeAccessControlEntriesForPrincipal(CmsDbContext dbc,
                                                   CmsProject project,
                                                   CmsProject onlineProject,
                                                   CmsUUID principal)
                                            throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Removes all access control entries belonging to a principal.

Specified by:
removeAccessControlEntriesForPrincipal in interface I_CmsUserDriver
Parameters:
dbc - the current database context
project - the project to write the entry
onlineProject - the online project
principal - the id of the principal
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.removeAccessControlEntriesForPrincipal(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.file.CmsProject, org.opencms.util.CmsUUID)

removeAccessControlEntry

public void removeAccessControlEntry(CmsDbContext dbc,
                                     CmsProject project,
                                     CmsUUID resource,
                                     CmsUUID principal)
                              throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Removes an access control entry.

Specified by:
removeAccessControlEntry in interface I_CmsUserDriver
Parameters:
dbc - the current database context
project - the project to write the entry
resource - the id of the resource
principal - the id of the principal
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.removeAccessControlEntry(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)

removeResourceFromOrganizationalUnit

public void removeResourceFromOrganizationalUnit(CmsDbContext dbc,
                                                 CmsOrganizationalUnit orgUnit,
                                                 CmsResource resource)
                                          throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Removes a resource from the given organizational unit.

Specified by:
removeResourceFromOrganizationalUnit in interface I_CmsUserDriver
Parameters:
dbc - the current db context
orgUnit - the organizational unit to remove the resource from
resource - the resource that is to be removed from the organizational unit
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.removeResourceFromOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, CmsResource)

setDriverManager

public void setDriverManager(CmsDriverManager driverManager)
Sets the driver manager for this driver.

Parameters:
driverManager - the new driver manager

setSqlManager

public void setSqlManager(CmsSqlManager sqlManager)
Sets the SQL manager for this driver.

Parameters:
sqlManager - the new SQL manager

setUsersOrganizationalUnit

public void setUsersOrganizationalUnit(CmsDbContext dbc,
                                       CmsOrganizationalUnit orgUnit,
                                       CmsUser user)
                                throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Moves an user to the given organizational unit.

Specified by:
setUsersOrganizationalUnit in interface I_CmsUserDriver
Parameters:
dbc - the current db context
orgUnit - the organizational unit to move the user to
user - the user that is to be moved to the given organizational unit
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.setUsersOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, org.opencms.file.CmsUser)

writeAccessControlEntry

public void writeAccessControlEntry(CmsDbContext dbc,
                                    CmsProject project,
                                    CmsAccessControlEntry acEntry)
                             throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Writes an access control entry.

Specified by:
writeAccessControlEntry in interface I_CmsUserDriver
Parameters:
dbc - the current database context
project - the project to write the entry
acEntry - the entry to write
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.writeAccessControlEntry(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.security.CmsAccessControlEntry)

writeGroup

public void writeGroup(CmsDbContext dbc,
                       CmsGroup group)
                throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
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.

Specified by:
writeGroup in interface I_CmsUserDriver
Parameters:
dbc - the current database context
group - the group to update
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.writeGroup(org.opencms.db.CmsDbContext, org.opencms.file.CmsGroup)

writeOrganizationalUnit

public void writeOrganizationalUnit(CmsDbContext dbc,
                                    CmsOrganizationalUnit organizationalUnit)
                             throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
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.

Specified by:
writeOrganizationalUnit in interface I_CmsUserDriver
Parameters:
dbc - the current db context
organizationalUnit - the organizational unit that should be written
Throws:
CmsDataAccessException - if operation was not successful
See Also:
I_CmsUserDriver.writeOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit)

writePassword

public void writePassword(CmsDbContext dbc,
                          java.lang.String userFqn,
                          java.lang.String oldPassword,
                          java.lang.String newPassword)
                   throws CmsDataAccessException,
                          CmsPasswordEncryptionException
Description copied from interface: I_CmsUserDriver
Sets a new password for a user.

Specified by:
writePassword in interface I_CmsUserDriver
Parameters:
dbc - the current database context
userFqn - the fullyqualified name of the user to set the password for
oldPassword - the current password
newPassword - the password to set
Throws:
CmsDataAccessException - if something goes wrong
CmsPasswordEncryptionException - if the (new) password could not be encrypted
See Also:
I_CmsUserDriver.writePassword(org.opencms.db.CmsDbContext, java.lang.String, java.lang.String, java.lang.String)

writeUser

public void writeUser(CmsDbContext dbc,
                      CmsUser user)
               throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
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.

Specified by:
writeUser in interface I_CmsUserDriver
Parameters:
dbc - the current database context
user - the user to update
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.writeUser(org.opencms.db.CmsDbContext, org.opencms.file.CmsUser)

writeUserInfo

public void writeUserInfo(CmsDbContext dbc,
                          CmsUUID userId,
                          java.lang.String key,
                          java.lang.Object value)
                   throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Writes an user additional information entry.

Specified by:
writeUserInfo in interface I_CmsUserDriver
Parameters:
dbc - the current database context
userId - the id of the user to update
key - the key of the info to write
value - the value of the info to write
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.writeUserInfo(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, java.lang.String, java.lang.Object)

createRoleQuery

protected java.lang.String createRoleQuery(java.lang.String mainQuery,
                                           boolean includeSubOus,
                                           boolean readRoles)
Returns a sql query to select groups.

Parameters:
mainQuery - the main select sql query
includeSubOus - if groups in sub-ous should be included in the selection
readRoles - if groups or roles whould be selected
Returns:
a sql query to select groups

internalCreateAce

protected CmsAccessControlEntry internalCreateAce(java.sql.ResultSet res)
                                           throws java.sql.SQLException
Internal helper method to create an access control entry from a database record.

Parameters:
res - resultset of the current query
Returns:
a new CmsAccessControlEntry initialized with the values from the current database record
Throws:
java.sql.SQLException - if something goes wrong

internalCreateAce

protected CmsAccessControlEntry internalCreateAce(java.sql.ResultSet res,
                                                  CmsUUID newId)
                                           throws java.sql.SQLException
Internal helper method to create an access control entry from a database record.

Parameters:
res - resultset of the current query
newId - the id of the new access control entry
Returns:
a new CmsAccessControlEntry initialized with the values from the current database record
Throws:
java.sql.SQLException - if something goes wrong

internalCreateDefaultGroups

protected void internalCreateDefaultGroups(CmsDbContext dbc,
                                           java.lang.String ouFqn,
                                           java.lang.String ouDescription,
                                           boolean webuser)
                                    throws CmsException
Creates the default groups and user for the given organizational unit.

Parameters:
dbc - the database context
ouFqn - the fully qualified name of the organizational unit to create the principals for
ouDescription - the description of the given organizational unit
webuser - the webuser ou flag
Throws:
CmsException - if something goes wrong

internalCreateGroup

protected CmsGroup internalCreateGroup(java.sql.ResultSet res)
                                throws java.sql.SQLException
Semi-constructor to create a CmsGroup instance from a JDBC result set.

Parameters:
res - the JDBC ResultSet
Returns:
CmsGroup the new CmsGroup object
Throws:
java.sql.SQLException - in case the result set does not include a requested table attribute

internalCreateOrgUnitFromResource

protected CmsOrganizationalUnit internalCreateOrgUnitFromResource(CmsDbContext dbc,
                                                                  CmsResource resource)
                                                           throws CmsException
Returns the organizational unit represented by the given resource.

Parameters:
dbc - the current db context
resource - the resource that represents an organizational unit
Returns:
the organizational unit represented by the given resource
Throws:
CmsException - if something goes wrong

internalCreateResourceForOrgUnit

protected CmsResource internalCreateResourceForOrgUnit(CmsDbContext dbc,
                                                       java.lang.String path,
                                                       int flags)
                                                throws CmsException
Creates a folder with the given path an properties, offline AND online.

Parameters:
dbc - the current database context
path - the path to create the folder
flags - the resource flags
Returns:
the new created offline folder
Throws:
CmsException - if something goes wrong

internalCreateUser

protected CmsUser internalCreateUser(CmsDbContext dbc,
                                     java.sql.ResultSet res)
                              throws CmsDataAccessException,
                                     java.sql.SQLException
Semi-constructor to create a CmsUser instance from a JDBC result set.

Parameters:
dbc - the current database context
res - the JDBC ResultSet
Returns:
the new CmsUser object
Throws:
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 info

internalDeleteOrgUnitResource

protected void internalDeleteOrgUnitResource(CmsDbContext dbc,
                                             CmsResource resource)
                                      throws CmsException
Deletes a resource representing a organizational unit, offline AND online.

Parameters:
dbc - the current database context
resource - the resource to delete
Throws:
CmsException - if something goes wrong

internalDeleteUserInfo

protected void internalDeleteUserInfo(CmsDbContext dbc,
                                      CmsUUID userId,
                                      java.lang.String key)
                               throws CmsDataAccessException
Deletes an additional user info.

Parameters:
dbc - the current dbc
userId - the user to delete additional info from
key - the additional info to delete
Throws:
CmsDataAccessException - if something goes wrong

internalOrgUnitFolder

protected CmsResource internalOrgUnitFolder(CmsDbContext dbc,
                                            CmsOrganizationalUnit orgUnit)
                                     throws CmsException
Returns the folder for the given organizational units, or the base folder if null.

The base folder will be created if it does not exist.

Parameters:
dbc - the current db context
orgUnit - the organizational unit to get the folder for
Returns:
the base folder for organizational units
Throws:
CmsException - if something goes wrong

internalResourcesForOrgUnit

protected java.util.List internalResourcesForOrgUnit(CmsDbContext dbc,
                                                     CmsResource ouResource)
                                              throws CmsException
Returns the list of root paths associated to the organizational unit represented by the given resource.

Parameters:
dbc - the current db context
ouResource - the resource that represents the organizational unit to get the resources for
Returns:
the list of associated resource names
Throws:
CmsException - if something goes wrong

internalUpdateRoleGroup

protected void internalUpdateRoleGroup(CmsDbContext dbc,
                                       java.lang.String groupName,
                                       CmsRole role)
                                throws CmsDataAccessException
Updates a group to a virtual group.

Parameters:
dbc - the database context
groupName - the name of the group to update
role - the role for this group
Throws:
CmsDataAccessException - if something goes wrong

internalUpdateUserInfo

protected void internalUpdateUserInfo(CmsDbContext dbc,
                                      CmsUUID userId,
                                      java.lang.String key,
                                      java.lang.Object value)
                               throws CmsDataAccessException
Updates additional user info.

Parameters:
dbc - the current dbc
userId - the user id to add the user info for
key - the name of the additional user info
value - the value of the additional user info
Throws:
CmsDataAccessException - if something goes wrong

internalValidateResourceForOrgUnit

protected void internalValidateResourceForOrgUnit(CmsDbContext dbc,
                                                  CmsOrganizationalUnit orgUnit,
                                                  java.lang.String rootPath)
                                           throws CmsException
Validates the given root path to be in the scope of the resources of the given organizational unit.

Parameters:
dbc - the current db context
orgUnit - the organizational unit
rootPath - the root path to check
Throws:
CmsException - if something goes wrong

internalValidateUserInGroup

protected boolean internalValidateUserInGroup(CmsDbContext dbc,
                                              CmsUUID userId,
                                              CmsUUID groupId)
                                       throws CmsDataAccessException
Checks if a user is member of a group.

Parameters:
dbc - the database context
userId - the id of the user to check
groupId - the id of the group to check
Returns:
true if user is member of group
Throws:
CmsDataAccessException - if operation was not succesful

internalWriteOrgUnitProperty

protected void internalWriteOrgUnitProperty(CmsDbContext dbc,
                                            CmsResource resource,
                                            CmsProperty property)
                                     throws CmsException
Writes a property for an organizational unit resource, online AND offline.

Parameters:
dbc - the current database context
resource - the resource representing the organizational unit
property - the property to write
Throws:
CmsException - if something goes wrong

internalWriteUserInfo

protected void internalWriteUserInfo(CmsDbContext dbc,
                                     CmsUUID userId,
                                     java.lang.String key,
                                     java.lang.Object value)
                              throws CmsDataAccessException
Writes a new additional user info.

Parameters:
dbc - the current dbc
userId - the user id to add the user info for
key - the name of the additional user info
value - the value of the additional user info
Throws:
CmsDataAccessException - if something goes wrong

internalWriteUserInfos

protected void internalWriteUserInfos(CmsDbContext dbc,
                                      CmsUUID userId,
                                      java.util.Map additionalInfo)
                               throws CmsDataAccessException
Updates the user additional information map.

Parameters:
dbc - the current database context
userId - the id of the user to update
additionalInfo - the info to write
Throws:
CmsDataAccessException - if user data could not be written