org.opencms.db
Interface I_CmsUserDriver

All Superinterfaces:
I_CmsDriver
All Known Implementing Classes:
CmsUserDriver, CmsUserDriver, CmsUserDriver, CmsUserDriver, CmsUserDriver, CmsUserDriver, CmsUserDriver, CmsUserDriver, CmsUserDriver

public interface I_CmsUserDriver
extends I_CmsDriver

Definitions of all required user driver methods.

Since:
6.0.0
Version:
$Revision: 1.65 $
Author:
Thomas Weckert, Michael Emmerich

Field Summary
static int DRIVER_TYPE_ID
          The type ID to identify user driver implementations.
 
Fields inherited from interface org.opencms.db.I_CmsDriver
AND_CONDITION, BEGIN_CONDITION, BEGIN_EXCLUDE_CONDITION, BEGIN_INCLUDE_CONDITION, END_CONDITION, OR_CONDITION
 
Method Summary
 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 parentGroupName)
          Creates a new group.
 CmsOrganizationalUnit createOrganizationalUnit(CmsDbContext dbc, java.lang.String name, java.lang.String description, int flags, CmsOrganizationalUnit parent, java.lang.String associationRootPath)
          Creates a new organizational unit.
 void createRootOrganizationalUnit(CmsDbContext dbc)
          Creates the default root organizational unit.
 CmsUser createUser(CmsDbContext dbc, CmsUUID id, java.lang.String userFqn, java.lang.String password, java.lang.String firstname, java.lang.String lastname, java.lang.String email, long lastlogin, int flags, long dateCreated, java.util.Map 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<CmsGroup> getGroups(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean includeSubOus, boolean readRoles)
          Returns all groups of the given organizational unit.
 java.util.List<CmsOrganizationalUnit> getOrganizationalUnits(CmsDbContext dbc, CmsOrganizationalUnit parent, boolean includeChildren)
          Returns all child organizational units of the given parent organizational unit including hierarchical deeper organization units if needed.
 java.util.List getResourcesForOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit)
          Returns all resources of the given organizational unit.
 CmsSqlManager getSqlManager()
          Returns the SqlManager of this driver.
 java.util.List<CmsUser> getUsers(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean recursive)
          Returns all users of the given organizational unit.
 CmsSqlManager initSqlManager(java.lang.String classname)
          Initializes the SQL manager for this driver.
 void publishAccessControlEntries(CmsDbContext dbc, CmsProject offlineProject, CmsProject onlineProject, CmsUUID offlineId, CmsUUID onlineId)
          Publish all access control entries of a resource from the given offline project to the online project.
 java.util.List<CmsAccessControlEntry> readAccessControlEntries(CmsDbContext dbc, CmsProject project, CmsUUID resource, boolean inheritedOnly)
          Reads all relevant access control entries for a given resource.
 CmsAccessControlEntry readAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsUUID resource, CmsUUID principal)
          Reads an access control entry for a given principal that is attached to a resource.
 java.util.List<CmsGroup> readChildGroups(CmsDbContext dbc, java.lang.String groupFqn)
          Reads all child groups of a group.
 CmsGroup readGroup(CmsDbContext dbc, CmsUUID groupId)
          Reads a group based on the group id.
 CmsGroup readGroup(CmsDbContext dbc, java.lang.String groupFqn)
          Reads a group based on the group name.
 java.util.List<CmsGroup> readGroupsOfUser(CmsDbContext dbc, CmsUUID userId, java.lang.String ouFqn, boolean includeChildOus, java.lang.String remoteAddress, boolean readRoles)
          Reads all groups the given user is a member in.
 CmsOrganizationalUnit readOrganizationalUnit(CmsDbContext dbc, java.lang.String ouFqn)
          Reads an organizational Unit based on its fully qualified name.
 CmsUser readUser(CmsDbContext dbc, CmsUUID id)
          Reads a user based on the user id.
 CmsUser readUser(CmsDbContext dbc, java.lang.String userFqn)
          Reads a user based in the user fully qualified name.
 CmsUser readUser(CmsDbContext dbc, java.lang.String userFqn, java.lang.String password, java.lang.String remoteAddress)
          Reads a user from the database, only if the password is correct.
 java.util.Map<java.lang.String,java.lang.Object> readUserInfos(CmsDbContext dbc, CmsUUID userId)
          Reads the user additional information map.
 java.util.List<CmsUser> readUsersOfGroup(CmsDbContext dbc, java.lang.String groupFqn, boolean includeOtherOuUsers)
          Reads all users that are members of the given group.
 void removeAccessControlEntries(CmsDbContext dbc, CmsProject project, CmsUUID resource)
          Removes all access control entries belonging to a resource.
 void removeAccessControlEntriesForPrincipal(CmsDbContext dbc, CmsProject project, CmsProject onlineProject, CmsUUID principal)
          Removes all access control entries belonging to a principal.
 void removeAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsUUID resource, CmsUUID principal)
          Removes an access control entry.
 void removeResourceFromOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsResource resource)
          Removes a resource from the given organizational unit.
 void setUsersOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsUser user)
          Moves an user to the given organizational unit.
 void writeAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsAccessControlEntry acEntry)
          Writes an access control entry.
 void writeGroup(CmsDbContext dbc, CmsGroup group)
          Writes an already existing group.
 void writeOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit organizationalUnit)
          Writes an already existing organizational unit.
 void writePassword(CmsDbContext dbc, java.lang.String userFqn, java.lang.String oldPassword, java.lang.String newPassword)
          Sets a new password for a user.
 void writeUser(CmsDbContext dbc, CmsUser user)
          Updates the user information.
 void writeUserInfo(CmsDbContext dbc, CmsUUID userId, java.lang.String key, java.lang.Object value)
          Writes an user additional information entry.
 
Methods inherited from interface org.opencms.db.I_CmsDriver
init, toString
 

Field Detail

DRIVER_TYPE_ID

static final int DRIVER_TYPE_ID
The type ID to identify user driver implementations.

See Also:
Constant Field Values
Method Detail

addResourceToOrganizationalUnit

void addResourceToOrganizationalUnit(CmsDbContext dbc,
                                     CmsOrganizationalUnit orgUnit,
                                     CmsResource resource)
                                     throws CmsDataAccessException
Adds a resource to the given organizational unit.

Parameters:
dbc - the current db 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

createAccessControlEntry

void createAccessControlEntry(CmsDbContext dbc,
                              CmsProject project,
                              CmsUUID resource,
                              CmsUUID principal,
                              int allowed,
                              int denied,
                              int flags)
                              throws CmsDataAccessException
Creates an access control entry.

Parameters:
dbc - the current database 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

createGroup

CmsGroup createGroup(CmsDbContext dbc,
                     CmsUUID groupId,
                     java.lang.String groupFqn,
                     java.lang.String description,
                     int flags,
                     java.lang.String parentGroupName)
                     throws CmsDataAccessException
Creates a new group.

Parameters:
dbc - the current database 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
parentGroupName - the name of the parent group (or null if the group has no parent)
Returns:
the created group
Throws:
CmsDataAccessException - if something goes wrong

createOrganizationalUnit

CmsOrganizationalUnit createOrganizationalUnit(CmsDbContext dbc,
                                               java.lang.String name,
                                               java.lang.String description,
                                               int flags,
                                               CmsOrganizationalUnit parent,
                                               java.lang.String associationRootPath)
                                               throws CmsDataAccessException
Creates a new organizational unit.

Parameters:
dbc - the current db 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)
associationRootPath - the first associated resource
Returns:
a CmsOrganizationalUnit object representing the newly created organizational unit
Throws:
CmsDataAccessException - if operation was not successful

createRootOrganizationalUnit

void createRootOrganizationalUnit(CmsDbContext dbc)
Creates the default root organizational unit.

Parameters:
dbc - the current database context

createUser

CmsUser createUser(CmsDbContext dbc,
                   CmsUUID id,
                   java.lang.String userFqn,
                   java.lang.String password,
                   java.lang.String firstname,
                   java.lang.String lastname,
                   java.lang.String email,
                   long lastlogin,
                   int flags,
                   long dateCreated,
                   java.util.Map additionalInfos)
                   throws CmsDataAccessException
Creates a new user.

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

createUserInGroup

void createUserInGroup(CmsDbContext dbc,
                       CmsUUID userid,
                       CmsUUID groupid)
                       throws CmsDataAccessException
Adds a user to a group.

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

deleteAccessControlEntries

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

Deletes all access control entries (ACEs) belonging to a resource.

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

deleteGroup

void deleteGroup(CmsDbContext dbc,
                 java.lang.String groupFqn)
                 throws CmsDataAccessException
Deletes a group.

Only groups that contain no subgroups can be deleted.

Parameters:
dbc - the current database context
groupFqn - the fully qualified name of the group that is to be deleted
Throws:
CmsDataAccessException - if something goes wrong

deleteOrganizationalUnit

void deleteOrganizationalUnit(CmsDbContext dbc,
                              CmsOrganizationalUnit organizationalUnit)
                              throws CmsDataAccessException
Deletes an organizational unit.

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

Parameters:
dbc - the current db context
organizationalUnit - the organizational unit to delete
Throws:
CmsDataAccessException - if operation was not successful

deleteUser

void deleteUser(CmsDbContext dbc,
                java.lang.String userFqn)
                throws CmsDataAccessException
Deletes a user.

Parameters:
dbc - the current database context
userFqn - the fully qualified name of the user to delete
Throws:
CmsDataAccessException - if something goes wrong

deleteUserInfos

void deleteUserInfos(CmsDbContext dbc,
                     CmsUUID userId)
                     throws CmsDataAccessException
Deletes the user additional information table.

Parameters:
dbc - the current database context
userId - the id of the user to update
Throws:
CmsDataAccessException - if something goes wrong

deleteUserInGroup

void deleteUserInGroup(CmsDbContext dbc,
                       CmsUUID userId,
                       CmsUUID groupId)
                       throws CmsDataAccessException
Removes a user from a group.

Parameters:
dbc - the current database 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

destroy

void destroy()
             throws java.lang.Throwable
Destroys this driver.

Throws:
java.lang.Throwable - if something goes wrong

existsGroup

boolean existsGroup(CmsDbContext dbc,
                    java.lang.String groupFqn)
                    throws CmsDataAccessException
Tests if a group with the specified name exists.

Parameters:
dbc - the current database 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

existsUser

boolean existsUser(CmsDbContext dbc,
                   java.lang.String userFqn)
                   throws CmsDataAccessException
Tests if a user with the specified name exists.

Parameters:
dbc - the current database 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

fillDefaults

void fillDefaults(CmsDbContext dbc)
                  throws CmsInitException
Initializes the default organizational units, users and groups.

Parameters:
dbc - the current database context, be aware that this dbc has no runtime data!
Throws:
CmsInitException - if something goes wrong

getGroups

java.util.List<CmsGroup> getGroups(CmsDbContext dbc,
                                   CmsOrganizationalUnit orgUnit,
                                   boolean includeSubOus,
                                   boolean readRoles)
                                   throws CmsDataAccessException
Returns all groups of the given organizational unit.

Parameters:
dbc - the current db 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

getOrganizationalUnits

java.util.List<CmsOrganizationalUnit> getOrganizationalUnits(CmsDbContext dbc,
                                                             CmsOrganizationalUnit parent,
                                                             boolean includeChildren)
                                                             throws CmsDataAccessException
Returns all child organizational units of the given parent organizational unit including hierarchical deeper organization units if needed.

Parameters:
dbc - the current db 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

getResourcesForOrganizationalUnit

java.util.List getResourcesForOrganizationalUnit(CmsDbContext dbc,
                                                 CmsOrganizationalUnit orgUnit)
                                                 throws CmsDataAccessException
Returns all resources of the given organizational unit.

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

getSqlManager

CmsSqlManager getSqlManager()
Returns the SqlManager of this driver.

Returns:
the SqlManager of this driver

getUsers

java.util.List<CmsUser> getUsers(CmsDbContext dbc,
                                 CmsOrganizationalUnit orgUnit,
                                 boolean recursive)
                                 throws CmsDataAccessException
Returns all users of the given organizational unit.

Parameters:
dbc - the current db 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

initSqlManager

CmsSqlManager initSqlManager(java.lang.String classname)
Initializes the SQL manager for this driver.

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

Parameters:
classname - the classname of the SQL manager
Returns:
the SQL manager for this driver

publishAccessControlEntries

void publishAccessControlEntries(CmsDbContext dbc,
                                 CmsProject offlineProject,
                                 CmsProject onlineProject,
                                 CmsUUID offlineId,
                                 CmsUUID onlineId)
                                 throws CmsDataAccessException
Publish all access control entries of a resource from the given offline project to the online project.

Within the given project, the resource is identified by its offlineId, in the online project, it is identified by the given onlineId.

Parameters:
dbc - the current database 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

readAccessControlEntries

java.util.List<CmsAccessControlEntry> readAccessControlEntries(CmsDbContext dbc,
                                                               CmsProject project,
                                                               CmsUUID resource,
                                                               boolean inheritedOnly)
                                                               throws CmsDataAccessException
Reads all relevant access control entries for a given resource.

Parameters:
dbc - the current database 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

readAccessControlEntry

CmsAccessControlEntry readAccessControlEntry(CmsDbContext dbc,
                                             CmsProject project,
                                             CmsUUID resource,
                                             CmsUUID principal)
                                             throws CmsDataAccessException
Reads an access control entry for a given principal that is attached to a resource.

Parameters:
dbc - the current database 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

readChildGroups

java.util.List<CmsGroup> readChildGroups(CmsDbContext dbc,
                                         java.lang.String groupFqn)
                                         throws CmsDataAccessException
Reads all child groups of a group.

Parameters:
dbc - the current database context
groupFqn - 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

readGroup

CmsGroup readGroup(CmsDbContext dbc,
                   CmsUUID groupId)
                   throws CmsDataAccessException
Reads a group based on the group id.

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

readGroup

CmsGroup readGroup(CmsDbContext dbc,
                   java.lang.String groupFqn)
                   throws CmsDataAccessException
Reads a group based on the group name.

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

readGroupsOfUser

java.util.List<CmsGroup> readGroupsOfUser(CmsDbContext dbc,
                                          CmsUUID userId,
                                          java.lang.String ouFqn,
                                          boolean includeChildOus,
                                          java.lang.String remoteAddress,
                                          boolean readRoles)
                                          throws CmsDataAccessException
Reads all groups the given user is a member in.

Parameters:
dbc - the current database 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

readOrganizationalUnit

CmsOrganizationalUnit readOrganizationalUnit(CmsDbContext dbc,
                                             java.lang.String ouFqn)
                                             throws CmsDataAccessException
Reads an organizational Unit based on its fully qualified name.

Parameters:
dbc - the current db 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

readUser

CmsUser readUser(CmsDbContext dbc,
                 CmsUUID id)
                 throws CmsDataAccessException
Reads a user based on the user id.

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

readUser

CmsUser readUser(CmsDbContext dbc,
                 java.lang.String userFqn)
                 throws CmsDataAccessException
Reads a user based in the user fully qualified name.

Parameters:
dbc - the current database context
userFqn - the fully qualified name of the user to read
Returns:
the user that was read
Throws:
CmsDataAccessException - if something goes wrong

readUser

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

Parameters:
dbc - the current database 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

readUserInfos

java.util.Map<java.lang.String,java.lang.Object> readUserInfos(CmsDbContext dbc,
                                                               CmsUUID userId)
                                                               throws CmsDataAccessException
Reads the user additional information map.

Parameters:
dbc - the current database context
userId - the id of the user to update
Returns:
the user additional information map
Throws:
CmsDataAccessException - if something goes wrong

readUsersOfGroup

java.util.List<CmsUser> readUsersOfGroup(CmsDbContext dbc,
                                         java.lang.String groupFqn,
                                         boolean includeOtherOuUsers)
                                         throws CmsDataAccessException
Reads all users that are members of the given group.

Parameters:
dbc - the current database 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

removeAccessControlEntries

void removeAccessControlEntries(CmsDbContext dbc,
                                CmsProject project,
                                CmsUUID resource)
                                throws CmsDataAccessException
Removes all access control entries belonging to a resource.

Parameters:
dbc - the current database context
project - the project to write the entry
resource - the id of the resource
Throws:
CmsDataAccessException - if something goes wrong

removeAccessControlEntriesForPrincipal

void removeAccessControlEntriesForPrincipal(CmsDbContext dbc,
                                            CmsProject project,
                                            CmsProject onlineProject,
                                            CmsUUID principal)
                                            throws CmsDataAccessException
Removes all access control entries belonging to a principal.

Parameters:
dbc - the current database context
project - the project to write the entry
onlineProject - the online project
principal - the id of the principal
Throws:
CmsDataAccessException - if something goes wrong

removeAccessControlEntry

void removeAccessControlEntry(CmsDbContext dbc,
                              CmsProject project,
                              CmsUUID resource,
                              CmsUUID principal)
                              throws CmsDataAccessException
Removes an access control entry.

Parameters:
dbc - the current database 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

removeResourceFromOrganizationalUnit

void removeResourceFromOrganizationalUnit(CmsDbContext dbc,
                                          CmsOrganizationalUnit orgUnit,
                                          CmsResource resource)
                                          throws CmsDataAccessException
Removes a resource from the given organizational unit.

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

setUsersOrganizationalUnit

void setUsersOrganizationalUnit(CmsDbContext dbc,
                                CmsOrganizationalUnit orgUnit,
                                CmsUser user)
                                throws CmsDataAccessException
Moves an user to the given organizational unit.

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

writeAccessControlEntry

void writeAccessControlEntry(CmsDbContext dbc,
                             CmsProject project,
                             CmsAccessControlEntry acEntry)
                             throws CmsDataAccessException
Writes an access control entry.

Parameters:
dbc - the current database context
project - the project to write the entry
acEntry - the entry to write
Throws:
CmsDataAccessException - if something goes wrong

writeGroup

void writeGroup(CmsDbContext dbc,
                CmsGroup group)
                throws CmsDataAccessException
Writes an already existing group.

The group id has to be a valid OpenCms group id.
The group with the given id will be completely overriden by the given data.

Parameters:
dbc - the current database context
group - the group to update
Throws:
CmsDataAccessException - if something goes wrong

writeOrganizationalUnit

void writeOrganizationalUnit(CmsDbContext dbc,
                             CmsOrganizationalUnit organizationalUnit)
                             throws CmsDataAccessException
Writes an already existing organizational unit.

The organizational unit id has to be a valid OpenCms organizational unit id.
The organizational unit with the given id will be completely overriden by the given data.

Parameters:
dbc - the current db context
organizationalUnit - the organizational unit that should be written
Throws:
CmsDataAccessException - if operation was not successful

writePassword

void writePassword(CmsDbContext dbc,
                   java.lang.String userFqn,
                   java.lang.String oldPassword,
                   java.lang.String newPassword)
                   throws CmsDataAccessException,
                          CmsPasswordEncryptionException
Sets a new password for a user.

Parameters:
dbc - the current database 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

writeUser

void writeUser(CmsDbContext dbc,
               CmsUser user)
               throws CmsDataAccessException
Updates the user information.

The user id has to be a valid OpenCms user id.

The user with the given id will be completely overriden by the given data.

Parameters:
dbc - the current database context
user - the user to update
Throws:
CmsDataAccessException - if something goes wrong

writeUserInfo

void writeUserInfo(CmsDbContext dbc,
                   CmsUUID userId,
                   java.lang.String key,
                   java.lang.Object value)
                   throws CmsDataAccessException
Writes an user additional information entry.

Parameters:
dbc - the current database 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