|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.db.CmsDriverManager
The OpenCms driver manager.
Field Summary | |
static java.lang.String |
CACHE_ALL_PROPERTIES
Cache key for all properties. |
static java.lang.String |
CONFIGURATION_BACKUP
"driver.backup" string in the configuration-file. |
static java.lang.String |
CONFIGURATION_CACHE
"cache" string in the configuration-file. |
static java.lang.String |
CONFIGURATION_DB
"db" string in the configuration-file. |
static java.lang.String |
CONFIGURATION_PROJECT
"driver.project" string in the configuration-file. |
static java.lang.String |
CONFIGURATION_USER
"driver.user" string in the configuration-file. |
static java.lang.String |
CONFIGURATION_VFS
"driver.vfs" string in the configuration-file. |
static java.lang.String |
CONFIGURATION_WORKFLOW
"driver.workflow" string in the configuration-file. |
static java.lang.String |
LOST_AND_FOUND_FOLDER
The vfs path of the loast and found folder. |
static int |
MAX_VFS_RESOURCE_PATH_LENGTH
The maximum length of a VFS resource path. |
static int |
NOTHING_CHANGED
Key for indicating no changes. |
static java.lang.String |
READ_IGNORE_PARENT
Indicates to ignore the resource path when matching resources. |
static int |
READ_IGNORE_STATE
Indicates to ignore the resource state when matching resources. |
static long |
READ_IGNORE_TIME
Indicates to ignore the time value. |
static int |
READ_IGNORE_TYPE
Indicates to ignore the resource type when matching resources. |
static int |
READMODE_EXCLUDE_STATE
Indicates to match resources NOT having the given state. |
static int |
READMODE_EXCLUDE_TREE
Indicates to match immediate children only. |
static int |
READMODE_EXCLUDE_TYPE
Indicates to match resources NOT having the given type. |
static int |
READMODE_IGNORESTATE
Mode for reading project resources from the db. |
static int |
READMODE_INCLUDE_PROJECT
Indicates to match resources in given project only. |
static int |
READMODE_INCLUDE_TREE
Indicates to match all successors. |
static int |
READMODE_MATCHSTATE
Mode for reading project resources from the db. |
static int |
READMODE_ONLY_FILES
Indicates if only file resources should be read. |
static int |
READMODE_ONLY_FOLDERS
Indicates if only folder resources should be read. |
static int |
READMODE_UNMATCHSTATE
Mode for reading project resources from the db. |
static int |
UPDATE_ALL
Key to indicate complete update. |
static int |
UPDATE_RESOURCE
Key to indicate update of resource record. |
static int |
UPDATE_RESOURCE_STATE
Key to indicate update of resource state. |
static int |
UPDATE_STRUCTURE
Key to indicate update of structure record. |
static int |
UPDATE_STRUCTURE_STATE
Key to indicate update of structure state. |
Method Summary | |
void |
acceptTask(CmsDbContext dbc,
int taskId)
Updates the state of the given task as accepted by the current user. |
void |
addUserToGroup(CmsDbContext dbc,
java.lang.String username,
java.lang.String groupname)
Adds a user to a group. |
CmsUser |
addWebUser(CmsDbContext dbc,
java.lang.String name,
java.lang.String password,
java.lang.String group,
java.lang.String description,
java.util.Map additionalInfos)
Creates a new web user. |
CmsUser |
addWebUser(CmsDbContext dbc,
java.lang.String name,
java.lang.String password,
java.lang.String group,
java.lang.String additionalGroup,
java.lang.String description,
java.util.Map additionalInfos)
Adds a web user to the Cms. |
void |
backupProject(CmsDbContext dbc,
int tagId,
long publishDate)
Creates a backup of the current project. |
void |
changeLastModifiedProjectId(CmsDbContext dbc,
CmsResource resource)
Changes the project id of the resource to the current project, indicating that the resource was last modified in this project. |
void |
changeLock(CmsDbContext dbc,
CmsResource resource)
Changes the lock of a resource to the current user, that is "steals" the lock from another user. |
void |
changeUserType(CmsDbContext dbc,
CmsUser user,
int userType)
Changes the user type of the user. |
void |
changeUserType(CmsDbContext dbc,
CmsUUID userId,
int userType)
Changes the user type of the user. |
void |
changeUserType(CmsDbContext dbc,
java.lang.String username,
int userType)
Changes the user type of the user. |
void |
chflags(CmsDbContext dbc,
CmsResource resource,
int flags)
Changes the resource flags of a resource. |
void |
chtype(CmsDbContext dbc,
CmsResource resource,
int type)
Changes the resource type of a resource. |
void |
cmsEvent(CmsEvent event)
Acknowledge the occurrence of the specified event, implement this method to check for CmsEvents in your class. |
protected CmsFolder |
convertResourceToFolder(CmsResource resource)
Converts a resource to a folder (if possible). |
void |
copyAccessControlEntries(CmsDbContext dbc,
CmsResource source,
CmsResource destination,
boolean updateLastModifiedInfo)
Copies the access control entries of a given resource to a destination resorce. |
void |
copyResource(CmsDbContext dbc,
CmsResource source,
java.lang.String destination,
int siblingMode)
Copies a resource. |
void |
copyResourceToProject(CmsDbContext dbc,
CmsResource resource)
Copies a resource to the current project of the user. |
int |
countLockedResources(CmsDbContext dbc,
java.lang.String foldername)
Counts the locked resources in a given folder. |
int |
countLockedResources(CmsProject project)
Counts the locked resources in this project. |
CmsGroup |
createGroup(CmsDbContext dbc,
CmsUUID id,
java.lang.String name,
java.lang.String description,
int flags,
java.lang.String parent)
Add a new group to the Cms. |
CmsTask |
createProject(CmsDbContext dbc,
java.lang.String projectName,
java.lang.String roleName,
long timeout,
int priority)
Creates a new task for project creation. |
CmsProject |
createProject(CmsDbContext dbc,
java.lang.String name,
java.lang.String description,
java.lang.String groupname,
java.lang.String managergroupname,
int projecttype)
Creates a project. |
CmsPropertyDefinition |
createPropertyDefinition(CmsDbContext dbc,
java.lang.String name)
Creates a property definition. |
CmsResource |
createResource(CmsDbContext dbc,
java.lang.String resourcePath,
CmsResource resource,
byte[] content,
java.util.List properties,
boolean importCase)
Creates a new resource with the provided content and properties. |
CmsResource |
createResource(CmsDbContext dbc,
java.lang.String resourcename,
int type,
byte[] content,
java.util.List properties)
Creates a new resource of the given resource type with the provided content and properties. |
void |
createSibling(CmsDbContext dbc,
CmsResource source,
java.lang.String destination,
java.util.List properties)
Creates a new sibling of the source resource. |
CmsTask |
createTask(CmsDbContext dbc,
CmsUser currentUser,
int projectid,
java.lang.String agentName,
java.lang.String roleName,
java.lang.String taskName,
java.lang.String taskComment,
int taskType,
long timeout,
int priority)
Creates a new task. |
CmsTask |
createTask(CmsDbContext dbc,
java.lang.String agentName,
java.lang.String roleName,
java.lang.String taskname,
long timeout,
int priority)
Creates a new task. |
CmsProject |
createTempfileProject(CmsDbContext dbc)
Creates the project for the temporary workplace files. |
CmsUser |
createUser(CmsDbContext dbc,
java.lang.String name,
java.lang.String password,
java.lang.String description,
java.util.Map additionalInfos)
Creates a new user. |
void |
deleteAllProperties(CmsDbContext dbc,
java.lang.String resourcename)
Deletes all property values of a file or folder. |
void |
deleteAllStaticExportPublishedResources(CmsDbContext dbc,
int linkType)
Deletes all entries in the published resource table. |
void |
deleteBackup(CmsDbContext dbc,
CmsResource res)
Deletes all backup versions of a single resource. |
void |
deleteBackups(CmsDbContext dbc,
long timestamp,
int versions,
I_CmsReport report)
Deletes the versions from the backup tables that are older then the given timestamp and/or number of remaining versions. |
void |
deleteGroup(CmsDbContext dbc,
CmsGroup group,
CmsUUID replacementId)
Deletes a group, where all permissions, users and childs of the group are transfered to a replacement group. |
void |
deleteGroup(CmsDbContext dbc,
java.lang.String name)
Deletes a user group. |
void |
deleteProject(CmsDbContext dbc,
CmsProject deleteProject)
Deletes a project. |
void |
deletePropertyDefinition(CmsDbContext dbc,
java.lang.String name)
Deletes a property definition. |
void |
deleteResource(CmsDbContext dbc,
CmsResource resource,
int siblingMode)
Deletes a resource. |
void |
deleteStaticExportPublishedResource(CmsDbContext dbc,
java.lang.String resourceName,
int linkType,
java.lang.String linkParameter)
Deletes an entry in the published resource table. |
void |
deleteUser(CmsDbContext dbc,
CmsProject project,
java.lang.String username,
java.lang.String replacementUsername)
Deletes a user, where all permissions and resources attributes of the user were transfered to a replacement user, if given. |
void |
deleteWebUser(CmsDbContext dbc,
CmsUUID userId)
Deletes a web user from the Cms. |
void |
destroy()
Destroys this driver manager. |
void |
endTask(CmsDbContext dbc,
int taskid)
Ends a task. |
boolean |
existsResourceId(CmsDbContext dbc,
CmsUUID resourceId)
Tests if a resource with the given resourceId does already exist in the Database. |
CmsPublishList |
fillPublishList(CmsDbContext dbc,
CmsPublishList publishList)
Fills the given publish list with the the VFS resources that actually get published. |
protected void |
finalize()
Releases any allocated resources during garbage collection. |
void |
forwardTask(CmsDbContext dbc,
int taskid,
java.lang.String newRoleName,
java.lang.String newUserName)
Forwards a task to a new user. |
java.util.List |
getAccessControlEntries(CmsDbContext dbc,
CmsResource resource,
boolean getInherited)
Returns the list of access control entries of a resource given its name. |
CmsAccessControlList |
getAccessControlList(CmsDbContext dbc,
CmsResource resource)
Returns the full access control list of a given resource. |
CmsAccessControlList |
getAccessControlList(CmsDbContext dbc,
CmsResource resource,
boolean inheritedOnly)
Returns the access control list of a given resource. |
int |
getActiveConnections(java.lang.String dbPoolUrl)
Returns the number of active connections managed by a pool. |
java.util.List |
getAllAccessibleProjects(CmsDbContext dbc)
Returns all projects which are owned by the current user or which are accessible by the current user. |
java.util.List |
getAllBackupProjects(CmsDbContext dbc)
Returns a Vector with all projects from history. |
java.util.List |
getAllManageableProjects(CmsDbContext dbc)
Returns all projects which are owned by the current user or which are manageable for the group of the user. |
I_CmsBackupDriver |
getBackupDriver()
Returns the backup driver. |
int |
getBackupTagId(CmsDbContext dbc)
Returns the next version id for the published backup resources. |
java.util.List |
getChild(CmsDbContext dbc,
java.lang.String groupname)
Returns all child groups of a group. |
java.util.List |
getChilds(CmsDbContext dbc,
java.lang.String groupname)
Returns all child groups of a group. |
java.util.Map |
getConfigurations()
Method to access the configurations of the properties-file. |
java.util.List |
getDirectGroupsOfUser(CmsDbContext dbc,
java.lang.String username)
Returns the list of groups to which the user directly belongs to. |
java.util.List |
getGroups(CmsDbContext dbc)
Returns all available groups. |
java.util.List |
getGroupsOfUser(CmsDbContext dbc,
java.lang.String username)
Returns the groups of a user. |
java.util.List |
getGroupsOfUser(CmsDbContext dbc,
java.lang.String username,
java.lang.String remoteAddress)
Returns the groups of a Cms user filtered by the specified IP address. |
CmsXmlDocumentLinkValidator |
getHtmlLinkValidator()
Returns the HTML link validator. |
int |
getIdleConnections(java.lang.String dbPoolUrl)
Returns the number of idle connections managed by a pool. |
CmsLock |
getLock(CmsDbContext dbc,
CmsResource resource)
Returns the lock state of a resource. |
CmsGroup |
getParent(CmsDbContext dbc,
java.lang.String groupname)
Returns the parent group of a group. |
CmsPermissionSetCustom |
getPermissions(CmsDbContext dbc,
CmsResource resource,
CmsUser user)
Returns the set of permissions of the current user for a given resource. |
I_CmsProjectDriver |
getProjectDriver()
Returns the project driver. |
java.util.List |
getResourcesForPrincipal(CmsDbContext dbc,
CmsProject project,
CmsUUID principalId,
CmsPermissionSet permissions,
boolean includeAttr)
Returns all resources associated to a given principal via an ACE with the given permissions. |
java.util.List |
getResourcesInTimeRange(CmsDbContext dbc,
java.lang.String folder,
long starttime,
long endtime)
Returns a list with all sub resources of the given parent folder (and all of it's subfolders) that have been modified in the given time range. |
CmsSqlManager |
getSqlManager()
Returns an instance of the common sql manager. |
java.lang.String |
getTaskPar(CmsDbContext dbc,
int taskId,
java.lang.String parName)
Returns the value of the given parameter for the given task. |
int |
getTaskType(CmsDbContext dbc,
java.lang.String taskName)
Returns the template task id for a given taskname. |
I_CmsUserDriver |
getUserDriver()
Returns the user driver. |
java.util.List |
getUsers(CmsDbContext dbc)
Returns all available users. |
java.util.List |
getUsers(CmsDbContext dbc,
int type)
Returns all users from a given type. |
java.util.List |
getUsersOfGroup(CmsDbContext dbc,
java.lang.String groupname)
Returns a list of users in a group. |
I_CmsVfsDriver |
getVfsDriver()
Returns the VFS driver. |
I_CmsWorkflowDriver |
getWorkflowDriver()
Returns the workflow driver. |
void |
importAccessControlEntries(CmsDbContext dbc,
CmsResource resource,
java.util.List acEntries)
Writes a vector of access control entries as new access control entries of a given resource. |
CmsUser |
importUser(CmsDbContext dbc,
java.lang.String id,
java.lang.String name,
java.lang.String password,
java.lang.String description,
java.lang.String firstname,
java.lang.String lastname,
java.lang.String email,
java.lang.String address,
int flags,
int type,
java.util.Map additionalInfos)
Creates a new user by import. |
void |
init(CmsConfigurationManager configurationManager,
java.util.Map configuration,
I_CmsVfsDriver vfsDriver,
I_CmsUserDriver userDriver,
I_CmsProjectDriver projectDriver,
I_CmsWorkflowDriver workflowDriver,
I_CmsBackupDriver backupDriver)
Initializes the driver and sets up all required modules and connections. |
boolean |
isInsideCurrentProject(CmsDbContext dbc,
java.lang.String resourcename)
Checks if the specified resource is inside the current project. |
boolean |
isLocked(CmsDbContext dbc,
CmsResource resource)
Proves if a resource is locked. |
boolean |
isTempfileProject(CmsProject project)
Checks if a project is the tempfile project. |
boolean |
isUser(CmsDbContext dbc)
Determines if the user is a member of the default users group. |
protected boolean |
isWebgroup(CmsDbContext dbc,
CmsGroup group)
Checks if this is a valid group for webusers. |
boolean |
labelResource(CmsDbContext dbc,
CmsResource resource,
java.lang.String newResource,
int action)
Checks if one of the resources (except the resource itself) is a sibling in a "labeled" site folder. |
CmsUser |
lockedBy(CmsDbContext dbc,
CmsResource resource)
Returns the user, who had locked the resource. |
void |
lockResource(CmsDbContext dbc,
CmsResource resource,
int mode)
Locks a resource. |
CmsUser |
loginUser(CmsDbContext dbc,
java.lang.String userName,
java.lang.String password,
java.lang.String remoteAddress,
int userType)
Attempts to authenticate a user into OpenCms with the given password. |
I_CmsPrincipal |
lookupPrincipal(CmsDbContext dbc,
CmsUUID principalId)
Lookup and read the user or group with the given UUID. |
I_CmsPrincipal |
lookupPrincipal(CmsDbContext dbc,
java.lang.String principalName)
Lookup and read the user or group with the given name. |
java.lang.String |
moveToLostAndFound(CmsDbContext dbc,
java.lang.String resourcename,
boolean returnNameOnly)
Moves a resource to the "lost and found" folder. |
java.lang.Object |
newDriverInstance(CmsConfigurationManager configurationManager,
java.lang.String driverName,
java.util.List successiveDrivers)
Gets a new driver instance. |
java.lang.Object |
newDriverInstance(org.apache.commons.collections.ExtendedProperties configuration,
java.lang.String driverName,
java.lang.String driverPoolUrl)
Method to create a new instance of a driver. |
static CmsDriverManager |
newInstance(CmsConfigurationManager configurationManager,
CmsSecurityManager securityManager,
I_CmsDbContextFactory runtimeInfoFactory)
Reads the required configurations from the opencms.properties file and creates the various drivers to access the cms resources. |
void |
newPoolInstance(java.util.Map configuration,
java.lang.String poolName)
Method to create a new instance of a pool. |
void |
publishProject(CmsObject cms,
CmsDbContext dbc,
CmsPublishList publishList,
I_CmsReport report)
Publishes the resources of a specified publish list. |
void |
reactivateTask(CmsDbContext dbc,
int taskId)
Reactivates a task. |
CmsAccessControlEntry |
readAccessControlEntry(CmsDbContext dbc,
CmsResource resource,
CmsUUID principal)
Reads an access control entry from the cms. |
CmsUser |
readAgent(CmsDbContext dbc,
CmsTask task)
Reads the agent of a task. |
java.util.List |
readAllBackupFileHeaders(CmsDbContext dbc,
CmsResource resource)
Reads all file headers of a file. |
java.util.List |
readAllPropertyDefinitions(CmsDbContext dbc)
Reads all property definitions for the given mapping type. |
CmsBackupResource |
readBackupFile(CmsDbContext dbc,
int tagId,
CmsResource resource)
Returns a file from the history. |
CmsBackupProject |
readBackupProject(CmsDbContext dbc,
int tagId)
Returns a backup project. |
java.util.List |
readBackupPropertyObjects(CmsDbContext dbc,
CmsBackupResource resource)
Reads the list of objects that belong the the given backup resource. |
java.util.List |
readChangedResourcesInsideProject(CmsDbContext dbc,
int projectId,
int resourceType)
Reads all resources that are inside and changed in a specified project. |
java.util.List |
readChildResources(CmsDbContext dbc,
CmsResource resource,
CmsResourceFilter filter,
boolean getFolders,
boolean getFiles)
Returns the child resources of a resource, that is the resources contained in a folder. |
CmsFile |
readFile(CmsDbContext dbc,
CmsResource resource,
CmsResourceFilter filter)
Reads a file resource (including it's binary content) from the VFS, using the specified resource filter. |
CmsFolder |
readFolder(CmsDbContext dbc,
java.lang.String resourcename,
CmsResourceFilter filter)
Reads a folder from the VFS, using the specified resource filter. |
java.util.List |
readGivenTasks(CmsDbContext dbc,
int projectId,
java.lang.String ownerName,
int taskType,
java.lang.String orderBy,
java.lang.String sort)
Reads all given tasks from a user for a project. |
CmsGroup |
readGroup(CmsDbContext dbc,
CmsProject project)
Reads the group of a project. |
CmsGroup |
readGroup(CmsDbContext dbc,
CmsTask task)
Reads the group (role) of a task. |
CmsGroup |
readGroup(CmsDbContext dbc,
CmsUUID groupId)
Reads a group based on its id. |
CmsGroup |
readGroup(CmsDbContext dbc,
java.lang.String groupname)
Reads a group based on its name. |
CmsGroup |
readManagerGroup(CmsDbContext dbc,
CmsProject project)
Reads the manager group of a project. |
CmsUser |
readOriginalAgent(CmsDbContext dbc,
CmsTask task)
Reads the original agent of a task. |
CmsUser |
readOwner(CmsDbContext dbc,
CmsProject project)
Reads the owner of a project. |
CmsUser |
readOwner(CmsDbContext dbc,
CmsTask task)
Reads the owner (initiator) of a task. |
CmsUser |
readOwner(CmsDbContext dbc,
CmsTaskLog log)
Reads the owner of a tasklog. |
java.util.List |
readPath(CmsDbContext dbc,
int projectId,
java.lang.String path,
CmsResourceFilter filter)
Builds a list of resources for a given path. |
CmsProject |
readProject(CmsDbContext dbc,
CmsTask task)
Reads a project of a given task. |
CmsProject |
readProject(CmsDbContext dbc,
int id)
Reads a project given the projects id. |
CmsProject |
readProject(CmsDbContext dbc,
java.lang.String name)
Reads a project. |
java.util.List |
readProjectLogs(CmsDbContext dbc,
int projectId)
Reads all task log entries for a project. |
java.util.List |
readProjectResources(CmsDbContext dbc,
CmsProject project)
Returns the list of all resource names that define the "view" of the given project. |
java.util.List |
readProjectView(CmsDbContext dbc,
int projectId,
int state)
Reads all resources of a project that match a given state from the VFS. |
CmsPropertyDefinition |
readPropertyDefinition(CmsDbContext dbc,
java.lang.String name)
Reads a property definition. |
CmsProperty |
readPropertyObject(CmsDbContext dbc,
CmsResource resource,
java.lang.String key,
boolean search)
Reads a property object from a resource specified by a property name. |
java.util.List |
readPropertyObjects(CmsDbContext dbc,
CmsResource resource,
boolean search)
Reads all property objects mapped to a specified resource from the database. |
java.util.List |
readPublishedResources(CmsDbContext dbc,
CmsUUID publishHistoryId)
Reads the resources that were published in a publish task for a given publish history ID. |
java.util.List |
readPublishProjectView(CmsDbContext dbc,
int projectId,
java.lang.String criteria)
Reads all project resources that belong to a given view criteria. |
CmsResource |
readResource(CmsDbContext dbc,
java.lang.String resourcePath,
CmsResourceFilter filter)
Reads a resource from the VFS, using the specified resource filter. |
java.util.List |
readResources(CmsDbContext dbc,
CmsResource parent,
CmsResourceFilter filter,
boolean readTree)
Reads all resources below the given path matching the filter criteria, including the full tree below the path only in case the readTree
parameter is true . |
java.util.List |
readResourcesWithProperty(CmsDbContext dbc,
java.lang.String path,
java.lang.String propertyDefinition)
Reads all resources that have a value set for the specified property (definition) in the given path. |
java.util.List |
readResourcesWithProperty(CmsDbContext dbc,
java.lang.String path,
java.lang.String propertyDefinition,
java.lang.String value)
Reads all resources that have a value (containing the given value string) set for the specified property (definition) in the given path. |
java.util.Set |
readResponsiblePrincipals(CmsDbContext dbc,
CmsResource resource)
Returns the set of users that are responsible for a specific resource. |
java.util.Set |
readResponsibleUsers(CmsDbContext dbc,
CmsResource resource)
Returns the set of users that are responsible for a specific resource. |
java.util.List |
readSiblings(CmsDbContext dbc,
CmsResource resource,
CmsResourceFilter filter)
Returns a List of all siblings of the specified resource, the specified resource being always part of the result set. |
java.lang.String |
readStaticExportPublishedResourceParameters(CmsDbContext dbc,
java.lang.String rfsName)
Returns the parameters of a resource in the table of all published template resources. |
java.util.List |
readStaticExportResources(CmsDbContext dbc,
int parameterResources,
long timestamp)
Returns a list of all template resources which must be processed during a static export. |
CmsTask |
readTask(CmsDbContext dbc,
int id)
Reads the task with the given id. |
java.util.List |
readTaskLogs(CmsDbContext dbc,
int taskid)
Reads log entries for a task. |
java.util.List |
readTasksForProject(CmsDbContext dbc,
int projectId,
int tasktype,
java.lang.String orderBy,
java.lang.String sort)
Reads all tasks for a project. |
java.util.List |
readTasksForRole(CmsDbContext dbc,
int projectId,
java.lang.String roleName,
int tasktype,
java.lang.String orderBy,
java.lang.String sort)
Reads all tasks for a role in a project. |
java.util.List |
readTasksForUser(CmsDbContext dbc,
int projectId,
java.lang.String userName,
int taskType,
java.lang.String orderBy,
java.lang.String sort)
Reads all tasks for a user in a project. |
CmsUser |
readUser(CmsDbContext dbc,
CmsUUID id)
Returns a user object based on the id of a user. |
CmsUser |
readUser(CmsDbContext dbc,
java.lang.String username)
Returns a user object. |
CmsUser |
readUser(CmsDbContext dbc,
java.lang.String username,
int type)
Returns a user object. |
CmsUser |
readUser(CmsDbContext dbc,
java.lang.String username,
java.lang.String password)
Returns a user object if the password for the user is correct. |
CmsUser |
readWebUser(CmsDbContext dbc,
java.lang.String username)
Read a web user from the database. |
CmsUser |
readWebUser(CmsDbContext dbc,
java.lang.String username,
java.lang.String password)
Returns a user object if the password for the user is correct. |
void |
removeAccessControlEntry(CmsDbContext dbc,
CmsResource resource,
CmsUUID principal)
Removes an access control entry for a given resource and principal. |
void |
removeResourceFromProject(CmsDbContext dbc,
CmsResource resource)
Removes a resource from the current project of the user. |
void |
removeUserFromGroup(CmsDbContext dbc,
java.lang.String username,
java.lang.String groupname)
Removes a user from a group. |
void |
replaceResource(CmsDbContext dbc,
CmsResource resource,
int type,
byte[] content,
java.util.List properties)
Replaces the content, type and properties of a resource. |
void |
resetPassword(CmsDbContext dbc,
java.lang.String username,
java.lang.String oldPassword,
java.lang.String newPassword)
Resets the password for a specified user. |
void |
restoreResource(CmsDbContext dbc,
CmsResource resource,
int tag)
Restores a file in the current project with a version from the backup archive. |
void |
setDateExpired(CmsDbContext dbc,
CmsResource resource,
long dateExpired)
Changes the "expire" date of a resource. |
void |
setDateLastModified(CmsDbContext dbc,
CmsResource resource,
long dateLastModified)
Changes the "last modified" timestamp of a resource. |
void |
setDateReleased(CmsDbContext dbc,
CmsResource resource,
long dateReleased)
Changes the "release" date of a resource. |
void |
setName(CmsDbContext dbc,
int taskId,
java.lang.String name)
Set a new name for a task. |
void |
setParentGroup(CmsDbContext dbc,
java.lang.String groupName,
java.lang.String parentGroupName)
Sets a new parent group for an already existing group. |
void |
setPassword(CmsDbContext dbc,
java.lang.String username,
java.lang.String newPassword)
Sets the password for a user. |
void |
setPriority(CmsDbContext dbc,
int taskId,
int priority)
Set priority of a task. |
void |
setTaskPar(CmsDbContext dbc,
int taskId,
java.lang.String parName,
java.lang.String parValue)
Set a Parameter for a task. |
void |
setTimeout(CmsDbContext dbc,
int taskId,
long timeout)
Set the timeout of a task. |
void |
undoChanges(CmsDbContext dbc,
CmsResource resource)
Undos all changes in the resource by restoring the version from the online project to the current offline project. |
void |
unlockProject(CmsProject project)
Unlocks all resources in the given project. |
void |
unlockResource(CmsDbContext dbc,
CmsResource resource)
Unlocks a resource. |
java.util.List |
updateContextDates(CmsDbContext dbc,
java.util.List resourceList)
Updates the context dates with each resource in a list of CmsResources. |
void |
updateExportPoints(CmsDbContext dbc,
I_CmsReport report)
Update the export points. |
boolean |
userInGroup(CmsDbContext dbc,
java.lang.String username,
java.lang.String groupname)
Returns true if a user is member of the given group. |
java.util.Map |
validateHtmlLinks(CmsObject cms,
CmsPublishList publishList,
I_CmsReport report)
Validates the HTML links in the unpublished files of the specified publish list, if a file resource type implements the interface . |
void |
validatePassword(java.lang.String password)
This method checks if a new password follows the rules for new passwords, which are defined by a Class implementing the
interface and configured in the opencms.properties file. |
void |
writeAccessControlEntry(CmsDbContext dbc,
CmsResource resource,
CmsAccessControlEntry ace)
Writes an access control entries to a given resource. |
void |
writeExportPoints(CmsDbContext dbc,
int projectId,
I_CmsReport report,
CmsUUID publishHistoryId)
Writes all export points into the file system for a publish task specified by its publish history ID. |
CmsFile |
writeFile(CmsDbContext dbc,
CmsFile resource)
Writes a resource to the OpenCms VFS, including it's content. |
void |
writeGroup(CmsDbContext dbc,
CmsGroup group)
Writes an already existing group. |
void |
writeProject(CmsDbContext dbc,
CmsProject project)
Writes an already existing project. |
void |
writePropertyObject(CmsDbContext dbc,
CmsResource resource,
CmsProperty property)
Writes a property for a specified resource. |
void |
writePropertyObjects(CmsDbContext dbc,
CmsResource resource,
java.util.List properties)
Writes a list of properties for a specified resource. |
void |
writeResource(CmsDbContext dbc,
CmsResource resource)
Writes a resource to the OpenCms VFS. |
void |
writeStaticExportPublishedResource(CmsDbContext dbc,
java.lang.String resourceName,
int linkType,
java.lang.String linkParameter,
long timestamp)
Inserts an entry in the published resource table. |
void |
writeTaskLog(CmsDbContext dbc,
int taskid,
java.lang.String comment)
Writes a new user tasklog for a task. |
void |
writeTaskLog(CmsDbContext dbc,
int taskId,
java.lang.String comment,
int type)
Writes a new task log entry for a task. |
void |
writeUser(CmsDbContext dbc,
CmsUser user)
Updates the user information. |
void |
writeWebUser(CmsDbContext dbc,
CmsUser user)
Updates the user information of a web user. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CACHE_ALL_PROPERTIES
public static final java.lang.String CONFIGURATION_BACKUP
public static final java.lang.String CONFIGURATION_CACHE
public static final java.lang.String CONFIGURATION_DB
public static final java.lang.String CONFIGURATION_PROJECT
public static final java.lang.String CONFIGURATION_USER
public static final java.lang.String CONFIGURATION_VFS
public static final java.lang.String CONFIGURATION_WORKFLOW
public static final java.lang.String LOST_AND_FOUND_FOLDER
public static final int MAX_VFS_RESOURCE_PATH_LENGTH
public static final int NOTHING_CHANGED
public static final java.lang.String READ_IGNORE_PARENT
public static final int READ_IGNORE_STATE
public static final long READ_IGNORE_TIME
public static final int READ_IGNORE_TYPE
public static final int READMODE_EXCLUDE_STATE
public static final int READMODE_EXCLUDE_TREE
public static final int READMODE_EXCLUDE_TYPE
public static final int READMODE_IGNORESTATE
public static final int READMODE_INCLUDE_PROJECT
public static final int READMODE_INCLUDE_TREE
public static final int READMODE_MATCHSTATE
public static final int READMODE_ONLY_FILES
public static final int READMODE_ONLY_FOLDERS
public static final int READMODE_UNMATCHSTATE
public static final int UPDATE_ALL
public static final int UPDATE_RESOURCE
public static final int UPDATE_RESOURCE_STATE
public static final int UPDATE_STRUCTURE
public static final int UPDATE_STRUCTURE_STATE
Method Detail |
public static CmsDriverManager newInstance(CmsConfigurationManager configurationManager, CmsSecurityManager securityManager, I_CmsDbContextFactory runtimeInfoFactory) throws CmsInitException
The initialization process of the driver manager and its drivers is split into the following phases:
configurationManager
- the configuration managersecurityManager
- the security managerruntimeInfoFactory
- the initialized OpenCms runtime info factory
CmsInitException
- if the driver manager couldn't be instanciatedpublic void acceptTask(CmsDbContext dbc, int taskId) throws CmsException
dbc
- the current database contexttaskId
- the Id of the task to accept
CmsException
- if something goes wrongpublic void addUserToGroup(CmsDbContext dbc, java.lang.String username, java.lang.String groupname) throws CmsException, CmsDbEntryNotFoundException
dbc
- the current database contextusername
- the name of the user that is to be added to the groupgroupname
- the name of the group
CmsException
- if operation was not succesfull
CmsDbEntryNotFoundException
- if the given user or the given group was not foundpublic CmsUser addWebUser(CmsDbContext dbc, java.lang.String name, java.lang.String password, java.lang.String group, java.lang.String description, java.util.Map additionalInfos) throws CmsException, CmsSecurityException, CmsIllegalArgumentException, CmsDbEntryNotFoundException
A web user has no access to the workplace but is able to access personalized
functions controlled by the OpenCms.
Moreover, a web user can be created by any user, the intention being that
a "Guest" user can create a personalized account for himself.
dbc
- the current database contextname
- the new name for the userpassword
- the new password for the usergroup
- the default groupname for the userdescription
- the description for the useradditionalInfos
- a Map
with additional infos for the user
Infos may be stored into the Usertables (depending on the implementation).
CmsException
- if operation was not succesfull
CmsSecurityException
- if the password is not valid
CmsIllegalArgumentException
- if the provided name has an illegal format (length == 0)
CmsDbEntryNotFoundException
- if the user for the given name or the given group was not foundpublic CmsUser addWebUser(CmsDbContext dbc, java.lang.String name, java.lang.String password, java.lang.String group, java.lang.String additionalGroup, java.lang.String description, java.util.Map additionalInfos) throws CmsException, CmsDbEntryNotFoundException, CmsIllegalArgumentException, CmsSecurityException
A web user has no access to the workplace but is able to access personalized functions controlled by the OpenCms.
dbc
- the current database contextname
- the new name for the userpassword
- the new password for the usergroup
- the default groupname for the useradditionalGroup
- an additional group for the userdescription
- the description for the useradditionalInfos
- a Hashtable with additional infos for the user, these
Infos may be stored into the Usertables (depending on the implementation)
CmsException
- if operation was not succesfull
CmsSecurityException
- if the password is not valid
CmsIllegalArgumentException
- if the provided name has an illegal format (length == 0)
CmsDbEntryNotFoundException
- if the user for the given name or the given group was not foundpublic void backupProject(CmsDbContext dbc, int tagId, long publishDate) throws CmsDataAccessException
dbc
- the current database contexttagId
- the version of the backuppublishDate
- the date of publishing
CmsDataAccessException
- if operation was not succesfulpublic void changeLastModifiedProjectId(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- theresource to apply this operation to
CmsException
- if something goes wrongCmsObject.changeLastModifiedProjectId(String)
,
I_CmsResourceType.changeLastModifiedProjectId(CmsObject, CmsSecurityManager, CmsResource)
public void changeLock(CmsDbContext dbc, CmsResource resource) throws CmsException, CmsSecurityException
dbc
- the current database contextresource
- the resource to change the lock for
CmsException
- if something goes wrong
CmsSecurityException
- if something goes wrongCmsObject.changeLock(String)
,
I_CmsResourceType.changeLock(CmsObject, CmsSecurityManager, CmsResource)
,
CmsSecurityManager.hasPermissions(CmsRequestContext, CmsResource, CmsPermissionSet, boolean, CmsResourceFilter)
public void changeUserType(CmsDbContext dbc, CmsUser user, int userType) throws CmsDataAccessException
dbc
- the current database contextuser
- the user to changeuserType
- the new usertype of the user
CmsDataAccessException
- if something goes wrongpublic void changeUserType(CmsDbContext dbc, CmsUUID userId, int userType) throws CmsDataAccessException, CmsDbEntryNotFoundException, CmsDbSqlException
dbc
- the current database contextuserId
- the id of the user to changeuserType
- the new usertype of the user
CmsDataAccessException
- if something goes wrong
CmsDataAccessException
- if an underlying Exception
related to runtime type instantiation (IOException
, ClassCastException
) occurs.
CmsDbSqlException
- if an underlying Exception
related to data retrieval (SQLException
) occurs.
CmsDbEntryNotFoundException
- if the user corresponding to the given id does not exist in the databasepublic void changeUserType(CmsDbContext dbc, java.lang.String username, int userType) throws CmsException
Only the administrator can change the type.
dbc
- the current database contextusername
- the name of the user to changeuserType
- the new usertype of the user
CmsException
- if something goes wrongpublic void chflags(CmsDbContext dbc, CmsResource resource, int flags) throws CmsException
The resource flags are used to indicate various "special" conditions for a resource. Most notably, the "internal only" setting which signals that a resource can not be directly requested with it's URL.
dbc
- the current database contextresource
- the resource to change the flags forflags
- the new resource flags for this resource
CmsException
- if something goes wrongCmsObject.chflags(String, int)
,
I_CmsResourceType.chflags(CmsObject, CmsSecurityManager, CmsResource, int)
public void chtype(CmsDbContext dbc, CmsResource resource, int type) throws CmsException
OpenCms handles resources according to the resource type, not the file suffix. This is e.g. why a JSP in OpenCms can have the suffix ".html" instead of ".jsp" only. Changing the resource type makes sense e.g. if you want to make a plain text file a JSP resource, or a binary file an image, etc.
dbc
- the current database contextresource
- the resource to change the type fortype
- the new resource type for this resource
CmsException
- if something goes wrongCmsObject.chtype(String, int)
,
I_CmsResourceType.chtype(CmsObject, CmsSecurityManager, CmsResource, int)
public void cmsEvent(CmsEvent event)
I_CmsEventListener
cmsEvent
in interface I_CmsEventListener
event
- CmsEvent that has occurredI_CmsEventListener.cmsEvent(org.opencms.main.CmsEvent)
public void copyAccessControlEntries(CmsDbContext dbc, CmsResource source, CmsResource destination, boolean updateLastModifiedInfo) throws CmsException
Already existing access control entries of the destination resource are removed.
dbc
- the current database contextsource
- the resource to copy the access control entries fromdestination
- the resource to which the access control entries are copiedupdateLastModifiedInfo
- if true, user and date "last modified" information on the target resource will be updated
CmsException
- if something goes wrongpublic void copyResource(CmsDbContext dbc, CmsResource source, java.lang.String destination, int siblingMode) throws CmsException, CmsIllegalArgumentException
You must ensure that the destination path is anabsolute, vaild and existing VFS path. Relative paths from the source are currently not supported.
In case the target resource already exists, it is overwritten with the source resource.
The siblingMode
parameter controls how to handle siblings
during the copy operation.
Possible values for this parameter are:
dbc
- the current database contextsource
- the resource to copydestination
- the name of the copy destination with complete pathsiblingMode
- indicates how to handle siblings during copy
CmsException
- if something goes wrong
CmsIllegalArgumentException
- if the source
argument is null or of length 0CmsObject.copyResource(String, String, int)
,
I_CmsResourceType.copyResource(CmsObject, CmsSecurityManager, CmsResource, String, int)
public void copyResourceToProject(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource to apply this operation to
CmsException
- if something goes wrongCmsObject.copyResourceToProject(String)
,
I_CmsResourceType.copyResourceToProject(CmsObject, CmsSecurityManager, CmsResource)
public int countLockedResources(CmsDbContext dbc, java.lang.String foldername) throws CmsLockException
dbc
- the current database contextfoldername
- the folder to search in
CmsLockException
- if the current project is lockedpublic int countLockedResources(CmsProject project) throws CmsLockException
project
- the project to count the locked resources in
CmsLockException
- if the given project itself is lockedpublic CmsGroup createGroup(CmsDbContext dbc, CmsUUID id, java.lang.String name, java.lang.String description, int flags, java.lang.String parent) throws CmsIllegalArgumentException, CmsDataAccessException
Only the admin can do this. Only users, which are in the group "administrators" are granted.
dbc
- the current database contextid
- the id of the new groupname
- the name of the new groupdescription
- the description for the new groupflags
- the flags for the new groupparent
- the name of the parent group (or null)
CmsDataAccessException
- if the creation of the group failed
CmsIllegalArgumentException
- if the length of the given name was below 1public CmsTask createProject(CmsDbContext dbc, java.lang.String projectName, java.lang.String roleName, long timeout, int priority) throws CmsDataAccessException
dbc
- the current database contextprojectName
- name of the projectroleName
- usergroup for the projecttimeout
- time when the Project must finishedpriority
- priority for the Project
CmsDataAccessException
- if something goes wrongpublic CmsProject createProject(CmsDbContext dbc, java.lang.String name, java.lang.String description, java.lang.String groupname, java.lang.String managergroupname, int projecttype) throws CmsIllegalArgumentException, CmsDataAccessException
dbc
- the current database contextname
- the name of the project to createdescription
- the description of the projectgroupname
- the project user group to be setmanagergroupname
- the project manager group to be setprojecttype
- the type of the project
CmsIllegalArgumentException
- if the chosen name
is already used
by the online project
CmsDataAccessException
- if something goes wrongpublic CmsPropertyDefinition createPropertyDefinition(CmsDbContext dbc, java.lang.String name) throws CmsException
Property definitions are valid for all resource types.
dbc
- the current database contextname
- the name of the property definition to create
CmsException
- if something goes wrongpublic CmsResource createResource(CmsDbContext dbc, java.lang.String resourcePath, CmsResource resource, byte[] content, java.util.List properties, boolean importCase) throws CmsException
The content
parameter may be null if the resource id already exists.
If so, the created resource will be made a sibling of the existing resource,
the existing content will remain unchanged.
This is used during file import for import of siblings as the
manifest.xml
only contains one binary copy per file.
If the resource id exists but the content
is not null,
the created resource will be made a sibling of the existing resource,
and both will share the new content.
Note: the id used to identify the content record (pk of the record) is generated on each call of this method (with valid content) !
dbc
- the current database contextresourcePath
- the name of the resource to create (full path)resource
- the new resource to createcontent
- the content for the new resourceproperties
- the properties for the new resourceimportCase
- if true, signals that this operation is done while importing resource,
causing different lock behaviour and potential "lost and found" usage
CmsException
- if something goes wrongpublic CmsResource createResource(CmsDbContext dbc, java.lang.String resourcename, int type, byte[] content, java.util.List properties) throws CmsException, CmsIllegalArgumentException
If the provided content is null and the resource is not a folder, the content will be set to an empty byte array.
dbc
- the current database contextresourcename
- the name of the resource to create (full path)type
- the type of the resource to createcontent
- the content for the new resourceproperties
- the properties for the new resource
CmsException
- if something goes wrong
CmsIllegalArgumentException
- if the resourcename
argument is null or of length 0CmsObject.createResource(String, int, byte[], List)
,
CmsObject.createResource(String, int)
,
I_CmsResourceType.createResource(CmsObject, CmsSecurityManager, String, byte[], List)
public void createSibling(CmsDbContext dbc, CmsResource source, java.lang.String destination, java.util.List properties) throws CmsException
dbc
- the current database contextsource
- the resource to create a sibling fordestination
- the name of the sibling to create with complete pathproperties
- the individual properties for the new sibling
CmsException
- if something goes wrongCmsObject.createSibling(String, String, List)
,
I_CmsResourceType.createSibling(CmsObject, CmsSecurityManager, CmsResource, String, List)
public CmsTask createTask(CmsDbContext dbc, CmsUser currentUser, int projectid, java.lang.String agentName, java.lang.String roleName, java.lang.String taskName, java.lang.String taskComment, int taskType, long timeout, int priority) throws CmsException
dbc
- the current database contextcurrentUser
- the current userprojectid
- the current project idagentName
- user who will edit the taskroleName
- usergroup for the tasktaskName
- name of the tasktaskType
- type of the tasktaskComment
- description of the tasktimeout
- time when the task must finishedpriority
- Id for the priority
CmsException
- if something goes wrongpublic CmsTask createTask(CmsDbContext dbc, java.lang.String agentName, java.lang.String roleName, java.lang.String taskname, long timeout, int priority) throws CmsException
This is just a more limited version of the
method, where: createTask(CmsDbContext, CmsUser, int, String, String, String, String, int, long, int)
dbc
- the current database contextagentName
- the user who will edit the taskroleName
- a usergroup for the tasktaskname
- the name of the tasktimeout
- the time when the task must finishedpriority
- the id for the priority of the task
CmsException
- if something goes wrongpublic CmsProject createTempfileProject(CmsDbContext dbc) throws CmsException
dbc
- the current database context
CmsException
- if something goes wrongpublic CmsUser createUser(CmsDbContext dbc, java.lang.String name, java.lang.String password, java.lang.String description, java.util.Map additionalInfos) throws CmsException, CmsIllegalArgumentException
dbc
- the current database contextname
- the name for the new userpassword
- the password for the new userdescription
- the description for the new useradditionalInfos
- the additional infos for the user
CmsException
- if something goes wrong
CmsIllegalArgumentException
- if the name for the user is not validCmsObject.createUser(String, String, String, Map)
public void deleteAllProperties(CmsDbContext dbc, java.lang.String resourcename) throws CmsException
If there are no other siblings than the specified resource, both the structure and resource property values get deleted. If the specified resource has siblings, only the structure property values get deleted.
dbc
- the current database contextresourcename
- the name of the resource for which all properties should be deleted
CmsException
- if operation was not successfulpublic void deleteAllStaticExportPublishedResources(CmsDbContext dbc, int linkType) throws CmsException
dbc
- the current database contextlinkType
- the type of resource deleted (0= non-paramter, 1=parameter)
CmsException
- if something goes wrongpublic void deleteBackup(CmsDbContext dbc, CmsResource res) throws CmsDataAccessException
dbc
- the current database contextres
- the resource to delete all backups from
CmsDataAccessException
- if operation was not succesfulpublic void deleteBackups(CmsDbContext dbc, long timestamp, int versions, I_CmsReport report) throws CmsException
The number of verions always wins, i.e. if the given timestamp would delete more versions than given in the versions parameter, the timestamp will be ignored.
Deletion will delete file header, content and properties.
dbc
- the current database contexttimestamp
- timestamp which defines the date after which backup resources must be deletedversions
- the number of versions per file which should kept in the systemreport
- the report for output logging
CmsException
- if operation was not succesfulpublic void deleteGroup(CmsDbContext dbc, CmsGroup group, CmsUUID replacementId) throws CmsDataAccessException, CmsException
dbc
- the current request contextgroup
- the id of the group to be deletedreplacementId
- the id of the group to be transfered, can be null
CmsException
- if operation was not succesfull
CmsDataAccessException
- if group to be deleted contains userpublic void deleteGroup(CmsDbContext dbc, java.lang.String name) throws CmsDataAccessException, CmsException
Only groups that contain no subgroups can be deleted.
dbc
- the current database contextname
- the name of the group that is to be deleted
CmsException
- if operation was not succesfull
CmsDataAccessException
- if group to be deleted contains userpublic void deleteProject(CmsDbContext dbc, CmsProject deleteProject) throws CmsException
Only the admin or the owner of the project can do this.
dbc
- the current database contextdeleteProject
- the project to be deleted
CmsException
- if something goes wrongpublic void deletePropertyDefinition(CmsDbContext dbc, java.lang.String name) throws CmsException
dbc
- the current database contextname
- the name of the property definition to delete
CmsException
- if something goes wrongpublic void deleteResource(CmsDbContext dbc, CmsResource resource, int siblingMode) throws CmsException
The siblingMode
parameter controls how to handle siblings
during the delete operation.
Possible values for this parameter are:
dbc
- the current database contextresource
- the name of the resource to delete (full path)siblingMode
- indicates how to handle siblings of the deleted resource
CmsException
- if something goes wrongCmsObject.deleteResource(String, int)
,
I_CmsResourceType.deleteResource(CmsObject, CmsSecurityManager, CmsResource, int)
public void deleteStaticExportPublishedResource(CmsDbContext dbc, java.lang.String resourceName, int linkType, java.lang.String linkParameter) throws CmsException
dbc
- the current database contextresourceName
- The name of the resource to be deleted in the static exportlinkType
- the type of resource deleted (0= non-paramter, 1=parameter)linkParameter
- the parameters ofthe resource
CmsException
- if something goes wrongpublic void deleteUser(CmsDbContext dbc, CmsProject project, java.lang.String username, java.lang.String replacementUsername) throws CmsException
Only users, which are in the group "administrators" are granted.
dbc
- the current database contextproject
- the current projectusername
- the name of the user to be deletedreplacementUsername
- the name of the user to be transfered, can be null
CmsException
- if operation was not succesfullpublic void deleteWebUser(CmsDbContext dbc, CmsUUID userId) throws CmsException
dbc
- the current database contextuserId
- the Id of the user to be deleted
CmsException
- if operation was not succesfullpublic void destroy() throws java.lang.Throwable
java.lang.Throwable
- if something goes wrongpublic void endTask(CmsDbContext dbc, int taskid) throws CmsException
dbc
- the current databsae contexttaskid
- the ID of the task to end
CmsException
- if something goes wrongpublic boolean existsResourceId(CmsDbContext dbc, CmsUUID resourceId) throws CmsException
dbc
- the current database contextresourceId
- the resource id to test for
CmsException
- if something goes wrongpublic CmsPublishList fillPublishList(CmsDbContext dbc, CmsPublishList publishList) throws CmsException
Please refer to the source code of this method for the rules on how to decide whether a
new/changed/deleted
object can be published or not.CmsResource
dbc
- the current database contextpublishList
- must be initialized with basic publish information (Project or direct publish operation)
CmsException
- if something goes wrongCmsPublishList
public void forwardTask(CmsDbContext dbc, int taskid, java.lang.String newRoleName, java.lang.String newUserName) throws CmsException
dbc
- the current database contexttaskid
- the Id of the task to forwardnewRoleName
- the new group name for the tasknewUserName
- the new user who gets the task. if it is empty, a new agent will automatic selected
CmsException
- if something goes wrongpublic java.util.List getAccessControlEntries(CmsDbContext dbc, CmsResource resource, boolean getInherited) throws CmsException
dbc
- the current database contextresource
- the resource to read the access control entries forgetInherited
- true if the result should include all access control entries inherited by parent folders
CmsAccessControlEntry
objects defining all permissions for the given resource
CmsException
- if something goes wrongpublic CmsAccessControlList getAccessControlList(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource
CmsException
- if something goes wrongpublic CmsAccessControlList getAccessControlList(CmsDbContext dbc, CmsResource resource, boolean inheritedOnly) throws CmsException
If inheritedOnly
is set, only inherited access control entries
are returned.
Note: For file resources, *all* permissions set at the immediate parent folder are inherited, not only these marked to inherit.
dbc
- the current database contextresource
- the resourceinheritedOnly
- skip non-inherited entries if set
CmsException
- if something goes wrongpublic int getActiveConnections(java.lang.String dbPoolUrl) throws CmsDbException
dbPoolUrl
- the url of a pool
CmsDbException
- if something goes wrongpublic java.util.List getAllAccessibleProjects(CmsDbContext dbc) throws CmsException
dbc
- the current database context
CmsProject
CmsException
- if something goes wrongpublic java.util.List getAllBackupProjects(CmsDbContext dbc) throws CmsException
dbc
- the current database context
CmsBackupProject
objects
with all projects from history.
CmsException
- if operation was not succesfulpublic java.util.List getAllManageableProjects(CmsDbContext dbc) throws CmsException
dbc
- the current database context
CmsProject
CmsException
- if operation was not succesfulpublic I_CmsBackupDriver getBackupDriver()
public int getBackupTagId(CmsDbContext dbc)
dbc
- the current database context
public java.util.List getChild(CmsDbContext dbc, java.lang.String groupname) throws CmsException
dbc
- the current database contextgroupname
- the name of the group
CmsGroup
objects
CmsException
- if operation was not succesfulpublic java.util.List getChilds(CmsDbContext dbc, java.lang.String groupname) throws CmsException
This method also returns all sub-child groups of the current group.
dbc
- the current database contextgroupname
- the name of the group
CmsGroup
objects or null
CmsException
- if operation was not succesfulpublic java.util.Map getConfigurations()
All users are granted.
public java.util.List getDirectGroupsOfUser(CmsDbContext dbc, java.lang.String username) throws CmsException
dbc
- the current database contextusername
- The name of the user
CmsGroup
objects
CmsException
- Throws CmsException if operation was not succesfulpublic java.util.List getGroups(CmsDbContext dbc) throws CmsException
dbc
- the current database context
CmsGroup
objects
CmsException
- if operation was not succesfulpublic java.util.List getGroupsOfUser(CmsDbContext dbc, java.lang.String username) throws CmsException
dbc
- the current database contextusername
- the name of the user
CmsGroup
objects
CmsException
- if operation was not succesfulpublic java.util.List getGroupsOfUser(CmsDbContext dbc, java.lang.String username, java.lang.String remoteAddress) throws CmsException
dbc
- the current database contextusername
- the name of the userremoteAddress
- the IP address to filter the groups in the result list
CmsGroup
objects
CmsException
- if operation was not succesfulpublic CmsXmlDocumentLinkValidator getHtmlLinkValidator()
CmsXmlDocumentLinkValidator
public int getIdleConnections(java.lang.String dbPoolUrl) throws CmsDbException
dbPoolUrl
- the url of a pool
CmsDbException
- if something goes wrongpublic CmsLock getLock(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource to return the lock state for
CmsException
- if something goes wrongpublic CmsGroup getParent(CmsDbContext dbc, java.lang.String groupname) throws CmsException
dbc
- the current database contextgroupname
- the name of the group
null
CmsException
- if operation was not succesfulpublic CmsPermissionSetCustom getPermissions(CmsDbContext dbc, CmsResource resource, CmsUser user) throws CmsException
dbc
- the current database contextresource
- the resourceuser
- the user
CmsException
- if something goes wrongpublic I_CmsProjectDriver getProjectDriver()
public java.util.List getResourcesForPrincipal(CmsDbContext dbc, CmsProject project, CmsUUID principalId, CmsPermissionSet permissions, boolean includeAttr) throws CmsException
If the includeAttr
flag is set it returns also all resources associated to
a given principal through some of following attributes.
dbc
- the current database contextproject
- the to read the entries fromprincipalId
- the id of the principalpermissions
- a set of permissions to match, can be null
for all ACEsincludeAttr
- a flag to include resources associated by attributes
CmsResource
objects
CmsException
- if something goes wrongpublic java.util.List getResourcesInTimeRange(CmsDbContext dbc, java.lang.String folder, long starttime, long endtime) throws CmsException
The result list is descending sorted (newest resource first).
dbc
- the current database contextfolder
- the folder to get the subresources fromstarttime
- the begin of the time rangeendtime
- the end of the time range
CmsResource
objects
that have been modified in the given time range.
CmsException
- if operation was not succesfulpublic CmsSqlManager getSqlManager()
public java.lang.String getTaskPar(CmsDbContext dbc, int taskId, java.lang.String parName) throws CmsException
dbc
- the current database contexttaskId
- the Id of the taskparName
- name of the parameter
CmsException
- if something goes wrongpublic int getTaskType(CmsDbContext dbc, java.lang.String taskName) throws CmsException
dbc
- the current database contexttaskName
- the name of the task
CmsException
- if operation was not successfulpublic I_CmsUserDriver getUserDriver()
public java.util.List getUsers(CmsDbContext dbc) throws CmsException
dbc
- the current database context
CmsUser
objects
CmsException
- if operation was not succesfulpublic java.util.List getUsers(CmsDbContext dbc, int type) throws CmsException
dbc
- the current database contexttype
- the type of the users
CmsUser
objects of the given type
CmsException
- if operation was not succesfulpublic java.util.List getUsersOfGroup(CmsDbContext dbc, java.lang.String groupname) throws CmsException
dbc
- the current database contextgroupname
- the name of the group to list users from
CmsUser
objects in the group
CmsException
- if operation was not succesfulpublic I_CmsVfsDriver getVfsDriver()
public I_CmsWorkflowDriver getWorkflowDriver()
public void importAccessControlEntries(CmsDbContext dbc, CmsResource resource, java.util.List acEntries) throws CmsException
Already existing access control entries of this resource are removed before. Access is granted, if:
dbc
- the current database contextresource
- the resourceacEntries
- a list of CmsAccessControlEntry
objects
CmsException
- if something goes wrongpublic CmsUser importUser(CmsDbContext dbc, java.lang.String id, java.lang.String name, java.lang.String password, java.lang.String description, java.lang.String firstname, java.lang.String lastname, java.lang.String email, java.lang.String address, int flags, int type, java.util.Map additionalInfos) throws CmsException
dbc
- the current database contextid
- the id of the username
- the new name for the userpassword
- the new password for the userdescription
- the description for the userfirstname
- the firstname of the userlastname
- the lastname of the useremail
- the email of the useraddress
- the address of the userflags
- the flags for a user (for example I_CmsPrincipal.FLAG_ENABLED
)type
- the type of the useradditionalInfos
- the additional user infos
CmsException
- if something goes wrongpublic void init(CmsConfigurationManager configurationManager, java.util.Map configuration, I_CmsVfsDriver vfsDriver, I_CmsUserDriver userDriver, I_CmsProjectDriver projectDriver, I_CmsWorkflowDriver workflowDriver, I_CmsBackupDriver backupDriver) throws CmsException, java.lang.Exception
configurationManager
- the configuration managerconfiguration
- the OpenCms configurationvfsDriver
- the vfsdriveruserDriver
- the userdriverprojectDriver
- the projectdriverworkflowDriver
- the workflowdriverbackupDriver
- the backupdriver
CmsException
- if something goes wrong
java.lang.Exception
- if something goes wrongpublic boolean isInsideCurrentProject(CmsDbContext dbc, java.lang.String resourcename)
The project "view" is determined by a set of path prefixes. If the resource starts with any one of this prefixes, it is considered to be "inside" the project.
dbc
- the current database contextresourcename
- the specified resource name (full path)
true
, if the specified resource is inside the current projectpublic boolean isLocked(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource
CmsException
- if something goes wrongCmsLockManager.isLocked(org.opencms.db.CmsDriverManager, CmsDbContext, CmsResource)
public boolean isTempfileProject(CmsProject project)
project
- the project to test
public boolean isUser(CmsDbContext dbc) throws CmsException
All users are granted.
dbc
- the current database context
CmsException
- if operation was not succesfulpublic boolean labelResource(CmsDbContext dbc, CmsResource resource, java.lang.String newResource, int action) throws CmsDataAccessException
This method is used when creating a new sibling (use the newResource parameter & action = 1) or deleting/importing a resource (call with action = 2).
dbc
- the current database contextresource
- the resourcenewResource
- absolute path for a resource sibling which will be createdaction
- the action which has to be performed (1 = create VFS link, 2 all other actions)
CmsDataAccessException
- if something goes wrongpublic CmsUser lockedBy(CmsDbContext dbc, CmsResource resource) throws CmsException
A user can lock a resource, so he is the only one who can write this resource. This methods checks, if a resource was locked.
dbc
- the current database contextresource
- the resource
CmsException
- will be thrown, if the user has not the rights for this resourcepublic void lockResource(CmsDbContext dbc, CmsResource resource, int mode) throws CmsException
The mode
parameter controls what kind of lock is used.
Possible values for this parameter are:
dbc
- the current database contextresource
- the resource to lockmode
- flag indicating the mode for the lock
CmsException
- if something goes wrongCmsObject.lockResource(String, int)
,
I_CmsResourceType.lockResource(CmsObject, CmsSecurityManager, CmsResource, int)
public CmsUser loginUser(CmsDbContext dbc, java.lang.String userName, java.lang.String password, java.lang.String remoteAddress, int userType) throws CmsAuthentificationException, CmsDataAccessException, CmsPasswordEncryptionException
dbc
- the current database contextuserName
- the name of the user to be logged inpassword
- the password of the userremoteAddress
- the ip address of the requestuserType
- the user type to log in (System user or Web user)
CmsAuthentificationException
- if the login was not successful
CmsDataAccessException
- in case of errors accessing the database
CmsPasswordEncryptionException
- in case of errors encrypting the users passwordpublic I_CmsPrincipal lookupPrincipal(CmsDbContext dbc, CmsUUID principalId)
dbc
- the current database contextprincipalId
- the UUID of the principal to lookup
null
public I_CmsPrincipal lookupPrincipal(CmsDbContext dbc, java.lang.String principalName)
dbc
- the current database contextprincipalName
- the name of the principal to lookup
null
public java.lang.String moveToLostAndFound(CmsDbContext dbc, java.lang.String resourcename, boolean returnNameOnly) throws CmsException, CmsIllegalArgumentException
The method can also be used to check get the name of a resource
in the "lost and found" folder only without actually moving the
the resource. To do this, the returnNameOnly
flag
must be set to true
.
dbc
- the current database contextresourcename
- the name of the resource to apply this operation toreturnNameOnly
- if true
, only the name of the resource in the "lost and found"
folder is returned, the move operation is not really performed
CmsException
- if something goes wrong
CmsIllegalArgumentException
- if the resourcename
argument is null or of length 0CmsObject.moveToLostAndFound(String)
,
CmsObject.getLostAndFoundName(String)
public java.lang.Object newDriverInstance(CmsConfigurationManager configurationManager, java.lang.String driverName, java.util.List successiveDrivers) throws CmsInitException
configurationManager
- the configuration managerdriverName
- the driver namesuccessiveDrivers
- the list of successive drivers
CmsInitException
- if the selected driver could not be initializedpublic java.lang.Object newDriverInstance(org.apache.commons.collections.ExtendedProperties configuration, java.lang.String driverName, java.lang.String driverPoolUrl) throws CmsException
configuration
- the configurations from the propertyfiledriverName
- the class name of the driverdriverPoolUrl
- the pool url for the driver
CmsException
- if something goes wrongpublic void newPoolInstance(java.util.Map configuration, java.lang.String poolName) throws CmsInitException
configuration
- the configurations from the propertyfilepoolName
- the configuration name of the pool
CmsInitException
- if the pools could not be initializedpublic void publishProject(CmsObject cms, CmsDbContext dbc, CmsPublishList publishList, I_CmsReport report) throws CmsException
cms
- the current request contextdbc
- the current database contextpublishList
- a publish listreport
- an instance of I_CmsReport
to print messages
CmsException
- if something goes wrongfillPublishList(CmsDbContext, CmsPublishList)
public void reactivateTask(CmsDbContext dbc, int taskId) throws CmsException
Setting its state to
and
the percentage to zero.CmsTaskService.TASK_STATE_STARTED
dbc
- the current database contexttaskId
- the id of the task to reactivate
CmsException
- if something goes wrongpublic CmsAccessControlEntry readAccessControlEntry(CmsDbContext dbc, CmsResource resource, CmsUUID principal) throws CmsException
The access control entries of a resource are readable by everyone.
dbc
- the current database contextresource
- the resourceprincipal
- the id of a group or a user any other entity
CmsException
- if something goes wrongpublic CmsUser readAgent(CmsDbContext dbc, CmsTask task) throws CmsException
dbc
- the current database contexttask
- the task to read the agent from
CmsException
- if something goes wrongpublic java.util.List readAllBackupFileHeaders(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource to read the backup resources for
CmsBackupResource
objects, read from the Cms
CmsException
- if something goes wrongpublic java.util.List readAllPropertyDefinitions(CmsDbContext dbc) throws CmsException
dbc
- the current database context
CmsPropertyDefinition
objects (may be empty)
CmsException
- if something goes wrongpublic CmsBackupResource readBackupFile(CmsDbContext dbc, int tagId, CmsResource resource) throws CmsException
dbc
- the current database contexttagId
- the desired tag ID of the fileresource
- the resource to read the historic version of
CmsException
- if operation was not succesfulpublic CmsBackupProject readBackupProject(CmsDbContext dbc, int tagId) throws CmsException
dbc
- the current database contexttagId
- the tagId of the project
CmsException
- if something goes wrongpublic java.util.List readBackupPropertyObjects(CmsDbContext dbc, CmsBackupResource resource) throws CmsException
CmsProperty
objects that belong the the given backup resource.
dbc
- the current database contextresource
- the backup resource to read the properties from
CmsProperty
objects that belong the the given backup resource
CmsException
- if something goes wrongpublic java.util.List readChangedResourcesInsideProject(CmsDbContext dbc, int projectId, int resourceType) throws CmsException
dbc
- the current database contextprojectId
- the ID of the projectresourceType
- <0 if files and folders should be read, 0 if only folders should be read, >0 if only files should be read
CmsException
- if somethong goes wrongpublic java.util.List readChildResources(CmsDbContext dbc, CmsResource resource, CmsResourceFilter filter, boolean getFolders, boolean getFiles) throws CmsException
With the parameters getFolders
and getFiles
you can control what type of resources you want in the result list:
files, folders, or both.
This method is mainly used by the workplace explorer.
dbc
- the current database contextresource
- the resource to return the child resources forfilter
- the resource filter to usegetFolders
- if true the child folders are included in the resultgetFiles
- if true the child files are included in the result
CmsException
- if something goes wrongpublic CmsFile readFile(CmsDbContext dbc, CmsResource resource, CmsResourceFilter filter) throws CmsException
In case you do not need the file content,
use
instead.readResource(CmsDbContext, String, CmsResourceFilter)
The specified filter controls what kind of resources should be "found"
during the read operation. This will depend on the application. For example,
using
will only return currently
"valid" resources, while using CmsResourceFilter.DEFAULT
will ignore the date release / date expired information of the resource.CmsResourceFilter.IGNORE_EXPIRATION
dbc
- the current database contextresource
- the base file resource (without content)filter
- the filter object
CmsException
- if operation was not succesfulpublic CmsFolder readFolder(CmsDbContext dbc, java.lang.String resourcename, CmsResourceFilter filter) throws CmsDataAccessException
dbc
- the current database contextresourcename
- the name of the folder to read (full path)filter
- the resource filter to use while reading
CmsDataAccessException
- if something goes wrongreadResource(CmsDbContext, String, CmsResourceFilter)
,
CmsObject.readFolder(String)
,
CmsObject.readFolder(String, CmsResourceFilter)
public java.util.List readGivenTasks(CmsDbContext dbc, int projectId, java.lang.String ownerName, int taskType, java.lang.String orderBy, java.lang.String sort) throws CmsException
The tasktype
parameter will filter the tasks.
The possible values for this parameter are:
CmsTaskService.TASKS_ALL
: Reads all tasksCmsTaskService.TASKS_OPEN
: Reads all open tasksCmsTaskService.TASKS_DONE
: Reads all finished tasksCmsTaskService.TASKS_NEW
: Reads all new tasks
dbc
- the current database contextprojectId
- the id of the project in which the tasks are definedownerName
- the owner of the tasktaskType
- the type of task you want to readorderBy
- specifies how to order the taskssort
- sorting of the tasks
CmsTask
objects for a user for a project
CmsException
- if operation was not successfulpublic CmsGroup readGroup(CmsDbContext dbc, CmsProject project)
dbc
- the current database contextproject
- the project to read from
public CmsGroup readGroup(CmsDbContext dbc, CmsTask task) throws CmsException
dbc
- the current database contexttask
- the task to read from
CmsException
- if operation was not succesfulpublic CmsGroup readGroup(CmsDbContext dbc, CmsUUID groupId) throws CmsException
dbc
- the current database contextgroupId
- the id of the group that is to be read
CmsException
- if operation was not succesfulpublic CmsGroup readGroup(CmsDbContext dbc, java.lang.String groupname) throws CmsDataAccessException
dbc
- the current database contextgroupname
- the name of the group that is to be read
CmsDataAccessException
- if operation was not succesfulpublic CmsGroup readManagerGroup(CmsDbContext dbc, CmsProject project)
dbc
- the current database contextproject
- the project to read from
public CmsUser readOriginalAgent(CmsDbContext dbc, CmsTask task) throws CmsException
dbc
- the current database contexttask
- the task to read the original agent from
CmsException
- if something goes wrongpublic CmsUser readOwner(CmsDbContext dbc, CmsProject project) throws CmsException
dbc
- the current database contextproject
- the project to get the owner from
CmsException
- if something goes wrongpublic CmsUser readOwner(CmsDbContext dbc, CmsTask task) throws CmsException
dbc
- the current database contexttask
- the task to read the owner from
CmsException
- if something goes wrongpublic CmsUser readOwner(CmsDbContext dbc, CmsTaskLog log) throws CmsException
dbc
- the current database contextlog
- the tasklog
CmsException
- if something goes wrongpublic java.util.List readPath(CmsDbContext dbc, int projectId, java.lang.String path, CmsResourceFilter filter) throws CmsException
dbc
- the current database contextprojectId
- the project to lookup the resourcepath
- the requested pathfilter
- a filter object (only "includeDeleted" information is used!)
CmsResource
s
CmsException
- if something goes wrongpublic CmsProject readProject(CmsDbContext dbc, CmsTask task) throws CmsException
dbc
- the current database contexttask
- the task to read the project of
CmsException
- if something goes wrongpublic CmsProject readProject(CmsDbContext dbc, int id) throws CmsDataAccessException
dbc
- the current database contextid
- the id of the project
CmsDataAccessException
- if something goes wrongpublic CmsProject readProject(CmsDbContext dbc, java.lang.String name) throws CmsException
Important: Since a project name can be used multiple times, this is NOT the most efficient
way to read the project. This is only a convenience for front end developing.
Reading a project by name will return the first project with that name.
All core classes must use the id version readProject(CmsDbContext, int)
to ensure the right project is read.
dbc
- the current database contextname
- the name of the project
CmsException
- if something goes wrongpublic java.util.List readProjectLogs(CmsDbContext dbc, int projectId) throws CmsException
dbc
- the current database contextprojectId
- the id of the project for which the tasklog will be read
CmsTaskLog
objects
CmsException
- if something goes wrongpublic java.util.List readProjectResources(CmsDbContext dbc, CmsProject project) throws CmsException
dbc
- the current database contextproject
- the project to get the project resources for
String
objects
that define the "view" of the given project.
CmsException
- if something goes wrongpublic java.util.List readProjectView(CmsDbContext dbc, int projectId, int state) throws CmsException
Possible values for the state
parameter are:
CmsResource.STATE_CHANGED
: Read all "changed" resources in the projectCmsResource.STATE_NEW
: Read all "new" resources in the projectCmsResource.STATE_DELETED
: Read all "deleted" resources in the projectCmsResource.STATE_KEEP
: Read all resources either "changed", "new" or "deleted" in the project
dbc
- the current database contextprojectId
- the id of the project to read the file resources forstate
- the resource state to match
CmsResource
objects matching the filter criteria
CmsException
- if something goes wrongCmsObject.readProjectView(int, int)
public CmsPropertyDefinition readPropertyDefinition(CmsDbContext dbc, java.lang.String name) throws CmsException
If no property definition with the given name is found,
null
is returned.
dbc
- the current database contextname
- the name of the property definition to read
null
if there is no property definition with the given name.
CmsException
- if something goes wrongpublic CmsProperty readPropertyObject(CmsDbContext dbc, CmsResource resource, java.lang.String key, boolean search) throws CmsException
Returns
if the property is not found.CmsProperty.getNullProperty()
dbc
- the current database contextresource
- the resource where the property is read fromkey
- the property key namesearch
- if true
, the property is searched on all parent folders of the resource.
if it's not found attached directly to the resource.
CmsProperty.getNullProperty()
if the property was not found
CmsException
- if something goes wrongpublic java.util.List readPropertyObjects(CmsDbContext dbc, CmsResource resource, boolean search) throws CmsException
All properties in the result List will be in frozen (read only) state, so you can't change the values.
Returns an empty list if no properties are found at all.
dbc
- the current database contextresource
- the resource where the properties are read fromsearch
- true, if the properties should be searched on all parent folders if not found on the resource
CmsException
- if something goes wrongCmsObject.readPropertyObjects(String, boolean)
public java.util.List readPublishedResources(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException
dbc
- the current database contextpublishHistoryId
- unique int ID to identify each publish task in the publish history
CmsPublishedResource
objects
CmsException
- if something goes wrongpublic java.util.List readPublishProjectView(CmsDbContext dbc, int projectId, java.lang.String criteria) throws CmsException
A view criteria can be "new", "changed" and "deleted" and the result contains those resources in the project whose state is equal to the selected value.
dbc
- the current database contextprojectId
- the preoject to read fromcriteria
- the view criteria, can be "new", "changed" or "deleted"
CmsException
- if something goes wrongpublic CmsResource readResource(CmsDbContext dbc, java.lang.String resourcePath, CmsResourceFilter filter) throws CmsDataAccessException
dbc
- the current database contextresourcePath
- the name of the resource to read (full path)filter
- the resource filter to use while reading
CmsDataAccessException
- if something goes wrongCmsObject.readResource(String, CmsResourceFilter)
,
CmsObject.readResource(String)
,
CmsFile.upgrade(CmsResource, CmsObject)
public java.util.List readResources(CmsDbContext dbc, CmsResource parent, CmsResourceFilter filter, boolean readTree) throws CmsException, CmsDataAccessException
readTree
parameter is true
.
dbc
- the current database contextparent
- the parent path to read the resources fromfilter
- the filterreadTree
- true
to read all subresources
CmsResource
objects matching the filter criteria
CmsDataAccessException
- if the bare reading of the resources fails
CmsException
- if security and permission checks for the resources read failpublic java.util.List readResourcesWithProperty(CmsDbContext dbc, java.lang.String path, java.lang.String propertyDefinition) throws CmsException
Both individual and shared properties of a resource are checked.
dbc
- the current database contextpath
- the folder to get the resources with the property frompropertyDefinition
- the name of the property (definition) to check for
CmsResource
objects
that have a value set for the specified property.
CmsException
- if something goes wrongpublic java.util.List readResourcesWithProperty(CmsDbContext dbc, java.lang.String path, java.lang.String propertyDefinition, java.lang.String value) throws CmsException
Both individual and shared properties of a resource are checked.
dbc
- the current database contextpath
- the folder to get the resources with the property frompropertyDefinition
- the name of the property (definition) to check forvalue
- the string to search in the value of the property
CmsResource
objects
that have a value set for the specified property.
CmsException
- if something goes wrongpublic java.util.Set readResponsiblePrincipals(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource to get the responsible users from
CmsException
- if something goes wrongpublic java.util.Set readResponsibleUsers(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource to get the responsible users from
CmsException
- if something goes wrongpublic java.util.List readSiblings(CmsDbContext dbc, CmsResource resource, CmsResourceFilter filter) throws CmsException
The result is a list of
objects.CmsResource
dbc
- the current database contextresource
- the resource to read the siblings forfilter
- a filter object
CmsResource
Objects that
are siblings to the specified resource,
including the specified resource itself
CmsException
- if something goes wrongpublic java.lang.String readStaticExportPublishedResourceParameters(CmsDbContext dbc, java.lang.String rfsName) throws CmsException
dbc
- the current database contextrfsName
- the rfs name of the resource
CmsException
- if something goes wrongpublic java.util.List readStaticExportResources(CmsDbContext dbc, int parameterResources, long timestamp) throws CmsException
dbc
- the current database contextparameterResources
- flag for reading resources with parameters (1) or without (0)timestamp
- for reading the data from the db
String
objects
CmsException
- if something goes wrongpublic CmsTask readTask(CmsDbContext dbc, int id) throws CmsException
dbc
- the current database contextid
- the id for the task to read
CmsException
- if something goes wrongpublic java.util.List readTaskLogs(CmsDbContext dbc, int taskid) throws CmsException
dbc
- the current satabase contexttaskid
- the task for the tasklog to read
CmsTaskLog
objects
CmsException
- if something goes wrongpublic java.util.List readTasksForProject(CmsDbContext dbc, int projectId, int tasktype, java.lang.String orderBy, java.lang.String sort) throws CmsException
The tasktype
parameter will filter the tasks.
The possible values are:
CmsTaskService.TASKS_ALL
: Reads all tasksCmsTaskService.TASKS_OPEN
: Reads all open tasksCmsTaskService.TASKS_DONE
: Reads all finished tasksCmsTaskService.TASKS_NEW
: Reads all new tasks
dbc
- the current database contextprojectId
- the id of the project in which the tasks are defined. Can be null to select all taskstasktype
- the type of task you want to readorderBy
- specifies how to order the taskssort
- sort order: C_SORT_ASC, C_SORT_DESC, or null
CmsTask
objects for the project
CmsException
- if operation was not successfulpublic java.util.List readTasksForRole(CmsDbContext dbc, int projectId, java.lang.String roleName, int tasktype, java.lang.String orderBy, java.lang.String sort) throws CmsException
The tasktype
parameter will filter the tasks.
The possible values for this parameter are:
CmsTaskService.TASKS_ALL
: Reads all tasksCmsTaskService.TASKS_OPEN
: Reads all open tasksCmsTaskService.TASKS_DONE
: Reads all finished tasksCmsTaskService.TASKS_NEW
: Reads all new tasks
dbc
- the current database contextprojectId
- the id of the Project in which the tasks are definedroleName
- the role who has to process the tasktasktype
- the type of task you want to readorderBy
- specifies how to order the taskssort
- sort order C_SORT_ASC, C_SORT_DESC, or null
CmsTask
objects for the role
CmsException
- if operation was not successfulpublic java.util.List readTasksForUser(CmsDbContext dbc, int projectId, java.lang.String userName, int taskType, java.lang.String orderBy, java.lang.String sort) throws CmsException
The tasktype
parameter will filter the tasks.
The possible values for this parameter are:
CmsTaskService.TASKS_ALL
: Reads all tasksCmsTaskService.TASKS_OPEN
: Reads all open tasksCmsTaskService.TASKS_DONE
: Reads all finished tasksCmsTaskService.TASKS_NEW
: Reads all new tasks
dbc
- the current database contextprojectId
- the id of the Project in which the tasks are defineduserName
- the user who has to process the tasktaskType
- the type of task you want to readorderBy
- specifies how to order the taskssort
- sort order C_SORT_ASC, C_SORT_DESC, or null
CmsTask
objects for the user
CmsException
- if operation was not successfulpublic CmsUser readUser(CmsDbContext dbc, CmsUUID id) throws CmsException
dbc
- the current database contextid
- the id of the user to read
CmsException
- if something goes wrongpublic CmsUser readUser(CmsDbContext dbc, java.lang.String username) throws CmsDataAccessException
dbc
- the current database contextusername
- the name of the user that is to be read
CmsDataAccessException
- if operation was not succesfulpublic CmsUser readUser(CmsDbContext dbc, java.lang.String username, int type) throws CmsDataAccessException, CmsDbSqlException, CmsDbEntryNotFoundException
dbc
- the current database contextusername
- the name of the user that is to be readtype
- the type of the user
CmsDataAccessException
- if an underlying Exception
related to runtime type instantiation (IOException
, ClassCastException
) occurs
CmsDbSqlException
- if an underlying Exception
related to data retrieval (SQLException
) occurs
CmsDbEntryNotFoundException
- if the user corresponding to the given id does not exist in the databasepublic CmsUser readUser(CmsDbContext dbc, java.lang.String username, java.lang.String password) throws CmsException
If the user/pwd pair is not valid a
is thrown.CmsException
dbc
- the current database contextusername
- the username of the user that is to be readpassword
- the password of the user that is to be read
CmsException
- if operation was not succesfulpublic CmsUser readWebUser(CmsDbContext dbc, java.lang.String username) throws CmsException
dbc
- the current database contextusername
- the web user to read
CmsException
- if the user could not be read.public CmsUser readWebUser(CmsDbContext dbc, java.lang.String username, java.lang.String password) throws CmsException
If the user/pwd pair is not valid a
is thrown.CmsException
dbc
- the current database contextusername
- the username of the user that is to be readpassword
- the password of the user that is to be read
CmsException
- if operation was not succesfulpublic void removeAccessControlEntry(CmsDbContext dbc, CmsResource resource, CmsUUID principal) throws CmsException
dbc
- the current database contextresource
- the resourceprincipal
- the id of the principal to remove the the access control entry for
CmsException
- if something goes wrongpublic void removeResourceFromProject(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource to apply this operation to
CmsException
- if something goes wrongCmsObject.copyResourceToProject(String)
,
I_CmsResourceType.copyResourceToProject(CmsObject, CmsSecurityManager, CmsResource)
public void removeUserFromGroup(CmsDbContext dbc, java.lang.String username, java.lang.String groupname) throws CmsException, CmsIllegalArgumentException, CmsDbEntryNotFoundException, CmsSecurityException
dbc
- the current database contextusername
- the name of the user that is to be removed from the groupgroupname
- the name of the group
CmsException
- if operation was not succesful
CmsIllegalArgumentException
- if the given user was not member in the given group
CmsDbEntryNotFoundException
- if the given group was not found
CmsSecurityException
- if the given user was read as 'null' from the databasepublic void replaceResource(CmsDbContext dbc, CmsResource resource, int type, byte[] content, java.util.List properties) throws CmsException
dbc
- the current database contextresource
- the name of the resource to apply this operation totype
- the new type of the resourcecontent
- the new content of the resourceproperties
- the new properties of the resource
CmsException
- if something goes wrongCmsObject.replaceResource(String, int, byte[], List)
,
I_CmsResourceType.replaceResource(CmsObject, CmsSecurityManager, CmsResource, int, byte[], List)
public void resetPassword(CmsDbContext dbc, java.lang.String username, java.lang.String oldPassword, java.lang.String newPassword) throws CmsException, CmsSecurityException
dbc
- the current database contextusername
- the name of the useroldPassword
- the old passwordnewPassword
- the new password
CmsException
- if the user data could not be read from the database
CmsSecurityException
- if the specified username and old password could not be verifiedpublic void restoreResource(CmsDbContext dbc, CmsResource resource, int tag) throws CmsException
dbc
- the current database contextresource
- the resource to restore from the archivetag
- the tag (version) id to resource form the archive
CmsException
- if something goes wrongCmsObject.restoreResourceBackup(String, int)
,
I_CmsResourceType.restoreResourceBackup(CmsObject, CmsSecurityManager, CmsResource, int)
public void setDateExpired(CmsDbContext dbc, CmsResource resource, long dateExpired) throws CmsDataAccessException
dbc
- the current database contextresource
- the resource to touchdateExpired
- the new expire date of the resource
CmsDataAccessException
- if something goes wrongCmsObject.setDateExpired(String, long, boolean)
,
I_CmsResourceType.setDateExpired(CmsObject, CmsSecurityManager, CmsResource, long, boolean)
public void setDateLastModified(CmsDbContext dbc, CmsResource resource, long dateLastModified) throws CmsDataAccessException
dbc
- the current database contextresource
- the resource to touchdateLastModified
- the new last modified date of the resource
CmsDataAccessException
- if something goes wrongCmsObject.setDateLastModified(String, long, boolean)
,
I_CmsResourceType.setDateLastModified(CmsObject, CmsSecurityManager, CmsResource, long, boolean)
public void setDateReleased(CmsDbContext dbc, CmsResource resource, long dateReleased) throws CmsDataAccessException
dbc
- the current database contextresource
- the resource to touchdateReleased
- the new release date of the resource
CmsDataAccessException
- if something goes wrongCmsObject.setDateReleased(String, long, boolean)
,
I_CmsResourceType.setDateReleased(CmsObject, CmsSecurityManager, CmsResource, long, boolean)
public void setName(CmsDbContext dbc, int taskId, java.lang.String name) throws CmsException, CmsDataAccessException, CmsIllegalArgumentException
dbc
- the current database contexttaskId
- the Id of the task to set the percentagename
- the new name value
CmsException
- if an error occurs while writing workflow system task logs
CmsDataAccessException
- if an error occurs while reading the task from or writing it to the underlying workflow driver
CmsIllegalArgumentException
- if argument name
is null
or has a length of zeropublic void setParentGroup(CmsDbContext dbc, java.lang.String groupName, java.lang.String parentGroupName) throws CmsException, CmsDataAccessException
dbc
- the current database contextgroupName
- the name of the group that should be writtenparentGroupName
- the name of the parent group to set,
or null
if the parent
group should be deleted.
CmsException
- if operation was not succesfull
CmsDataAccessException
- if the group with groupName
could not be read from VFSpublic void setPassword(CmsDbContext dbc, java.lang.String username, java.lang.String newPassword) throws CmsException, CmsIllegalArgumentException
dbc
- the current database contextusername
- the name of the usernewPassword
- the new password
CmsException
- if operation was not succesfull
CmsIllegalArgumentException
- if the user with the username
was not foundpublic void setPriority(CmsDbContext dbc, int taskId, int priority) throws CmsException, CmsDataAccessException
dbc
- the current database contexttaskId
- the Id of the task to set the percentagepriority
- the priority value
CmsException
- if writing to the system task log failed
CmsDataAccessException
- if reading or writing of the task failedpublic void setTaskPar(CmsDbContext dbc, int taskId, java.lang.String parName, java.lang.String parValue) throws CmsDataAccessException
dbc
- the current database contexttaskId
- the Id of the taskparName
- name of the parameterparValue
- value if the parameter
CmsDataAccessException
- if something goes wrongpublic void setTimeout(CmsDbContext dbc, int taskId, long timeout) throws CmsException, CmsDataAccessException
dbc
- the current database contexttaskId
- the Id of the task to set the percentagetimeout
- new timeout value
CmsException
- if writing to the system task log failed
CmsDataAccessException
- if reading or writing of the task failedpublic void undoChanges(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the name of the resource to apply this operation to
CmsException
- if something goes wrongCmsObject.undoChanges(String, boolean)
,
I_CmsResourceType.undoChanges(CmsObject, CmsSecurityManager, CmsResource, boolean)
public void unlockProject(CmsProject project) throws CmsLockException
project
- the project to unlock the resources in
CmsLockException
- if something goes wrongpublic void unlockResource(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource to unlock
CmsException
- if something goes wrongCmsObject.unlockResource(String)
,
I_CmsResourceType.unlockResource(CmsObject, CmsSecurityManager, CmsResource)
public java.util.List updateContextDates(CmsDbContext dbc, java.util.List resourceList)
dbc
- the current database contextresourceList
- a list of CmsResources
public void updateExportPoints(CmsDbContext dbc, I_CmsReport report)
All files and folders "inside" an export point are written.
dbc
- the current database contextreport
- an I_CmsReport instance to print output message, or null to write messages to the log filepublic boolean userInGroup(CmsDbContext dbc, java.lang.String username, java.lang.String groupname) throws CmsException
true
if a user is member of the given group.
dbc
- the current database contextusername
- the name of the user to checkgroupname
- the name of the group to check
true
, if the user is in the group, false
otherwise
CmsException
- if something goes wrongpublic java.util.Map validateHtmlLinks(CmsObject cms, CmsPublishList publishList, I_CmsReport report) throws java.lang.Exception
I_CmsXmlDocumentLinkValidatable
.
cms
- the current user's Cms objectpublishList
- an OpenCms publish listreport
- a report to write the messages to
String
objects) keyed by resource names
java.lang.Exception
- if something goes wrongfillPublishList(CmsDbContext, CmsPublishList)
public void validatePassword(java.lang.String password) throws CmsSecurityException
I_CmsPasswordHandler
interface and configured in the opencms.properties file.If this method throws no exception the password is valid.
password
- the new password that has to be checked
CmsSecurityException
- if the password is not validpublic void writeAccessControlEntry(CmsDbContext dbc, CmsResource resource, CmsAccessControlEntry ace) throws CmsException
dbc
- the current database contextresource
- the resourceace
- the entry to write
CmsException
- if something goes wrongpublic void writeExportPoints(CmsDbContext dbc, int projectId, I_CmsReport report, CmsUUID publishHistoryId)
dbc
- the current database contextprojectId
- the id of the project that was publishedreport
- an I_CmsReport instance to print output message, or null to write messages to the log filepublishHistoryId
- unique int ID to identify each publish task in the publish historypublic CmsFile writeFile(CmsDbContext dbc, CmsFile resource) throws CmsException
Applies only to resources of type
i.e. resources that have a binary content attached.CmsFile
Certain resource types might apply content validation or transformation rules before the resource is actually written to the VFS. The returned result might therefore be a modified version from the provided original.
dbc
- the current database contextresource
- the resource to apply this operation to
CmsException
- if something goes wrongCmsObject.writeFile(CmsFile)
,
I_CmsResourceType.writeFile(CmsObject, CmsSecurityManager, CmsFile)
public void writeGroup(CmsDbContext dbc, CmsGroup group) throws CmsException
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.
dbc
- the current database contextgroup
- the group that should be written
CmsException
- if operation was not succesfullpublic void writeProject(CmsDbContext dbc, CmsProject project) throws CmsException
The project id has to be a valid OpenCms project id.
The project with the given id will be completely overriden
by the given data.
dbc
- the current database contextproject
- the project that should be written
CmsException
- if operation was not successfulpublic void writePropertyObject(CmsDbContext dbc, CmsResource resource, CmsProperty property) throws CmsException
dbc
- the current database contextresource
- the resource to write the property forproperty
- the property to write
CmsException
- if something goes wrongCmsObject.writePropertyObject(String, CmsProperty)
,
I_CmsResourceType.writePropertyObject(CmsObject, CmsSecurityManager, CmsResource, CmsProperty)
public void writePropertyObjects(CmsDbContext dbc, CmsResource resource, java.util.List properties) throws CmsException
Code calling this method has to ensure that the no properties
a, b
are contained in the specified list so that a.equals(b)
,
otherwise an exception is thrown.
dbc
- the current database contextresource
- the resource to write the properties forproperties
- the list of properties to write
CmsException
- if something goes wrongCmsObject.writePropertyObjects(String, List)
,
I_CmsResourceType.writePropertyObjects(CmsObject, CmsSecurityManager, CmsResource, List)
public void writeResource(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource to write
CmsException
- if something goes wrongpublic void writeStaticExportPublishedResource(CmsDbContext dbc, java.lang.String resourceName, int linkType, java.lang.String linkParameter, long timestamp) throws CmsException
This is done during static export.
dbc
- the current database contextresourceName
- The name of the resource to be added to the static exportlinkType
- the type of resource exported (0= non-paramter, 1=parameter)linkParameter
- the parameters added to the resourcetimestamp
- a timestamp for writing the data into the db
CmsException
- if something goes wrongpublic void writeTaskLog(CmsDbContext dbc, int taskid, java.lang.String comment) throws CmsException
dbc
- the current database contexttaskid
- the Id of the taskcomment
- description for the log
CmsException
- if something goes wrongpublic void writeTaskLog(CmsDbContext dbc, int taskId, java.lang.String comment, int type) throws CmsException
dbc
- the current database contexttaskId
- the Id of the taskcomment
- description for the logtype
- type of the tasklog. User tasktypes must be greater then 100
CmsException
- something goes wrongpublic void writeUser(CmsDbContext dbc, CmsUser user) throws CmsException
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.
dbc
- the current database contextuser
- the user to be updated
CmsException
- if operation was not succesfulpublic void writeWebUser(CmsDbContext dbc, CmsUser user) throws CmsException
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.
dbc
- the current database contextuser
- the user to be updated
CmsException
- if operation was not succesfulprotected CmsFolder convertResourceToFolder(CmsResource resource) throws CmsVfsResourceNotFoundException
resource
- the resource to convert
CmsVfsResourceNotFoundException
- if the resource is not a folderprotected void finalize() throws java.lang.Throwable
java.lang.Throwable
Object.finalize()
protected boolean isWebgroup(CmsDbContext dbc, CmsGroup group) throws CmsException
dbc
- the current database contextgroup
- the group to be checked
CmsException
- if operation was not succesful
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |