|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.db.CmsDriverManager
public final class CmsDriverManager
The OpenCms driver manager.
Field Summary | |
---|---|
static java.lang.String |
ATTRIBUTE_LOGIN
Attribute login. |
static java.lang.String |
ATTRIBUTE_USERADDINFO
Attribute WRITE USER_ADDINFO. |
static java.lang.String |
ATTRIBUTE_USERADDINFO_VALUE_DELETE
Attribute WRITE USER_ADDINFO value delete. |
static java.lang.String |
ATTRIBUTE_USERADDINFO_VALUE_INSERT
Attribute WRITE USER_ADDINFO value insert. |
static java.lang.String |
ATTRIBUTE_USERADDINFO_VALUE_UPDATE
Attribute WRITE USER_ADDINFO value insert. |
static java.lang.String |
CACHE_ALL_PROPERTIES
Cache key for all properties. |
static int |
CHANGED_ACCESSCONTROL
Value to indicate a change in access control entries of a resource. |
static int |
CHANGED_CONTENT
Value to indicate a content change. |
static int |
CHANGED_LASTMODIFIED
Value to indicate a change in the lastmodified settings of a resource. |
static int |
CHANGED_RESOURCE
Value to indicate a change in the resource data. |
static int |
CHANGED_TIMEFRAME
Value to indicate a change in the availability timeframe. |
static java.lang.String |
CONFIGURATION_BACKUP
Deprecated. use CONFIGURATION_HISTORY instead |
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_HISTORY
"driver.history" 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 |
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 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 java.lang.String |
TEMP_FILE_PREFIX
Prefix char for temporary files in the VFS. |
static int |
UPDATE_ALL
Key to indicate complete update. |
static int |
UPDATE_RESOURCE
Key to indicate update of resource record. |
static int |
UPDATE_RESOURCE_PROJECT
Key to indicate update of last modified project reference. |
static int |
UPDATE_RESOURCE_STATE
Key to indicate update of resource state. |
static int |
UPDATE_RESOURCE_STATE_CONTENT
Key to indicate update of resource state including the content date. |
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 |
addRelationToResource(CmsDbContext dbc,
CmsResource resource,
CmsResource target,
CmsRelationType type,
boolean importCase)
Adds a new relation to the given resource. |
void |
addResourceToOrgUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
CmsResource resource)
Adds a resource to the given organizational unit. |
void |
addUserToGroup(CmsDbContext dbc,
java.lang.String username,
java.lang.String groupname,
boolean readRoles)
Adds a user to a group. |
void |
changeLock(CmsDbContext dbc,
CmsResource resource,
CmsLockType lockType)
Changes the lock of a resource to the current user, that is "steals" the lock from another user. |
java.util.List |
changeResourcesInFolderWithProperty(CmsDbContext dbc,
CmsResource resource,
java.lang.String propertyDefinition,
java.lang.String oldValue,
java.lang.String newValue,
boolean recursive)
Returns a list with all sub resources of a given folder that have set the given property, matching the current property's value with the given old value and replacing it by a given new value. |
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 resource. |
void |
copyResource(CmsDbContext dbc,
CmsResource source,
java.lang.String destination,
CmsResource.CmsResourceCopyMode siblingMode)
Copies a resource. |
void |
copyResourceToProject(CmsDbContext dbc,
CmsResource resource)
Copies a resource to the current project of the user. |
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. |
CmsOrganizationalUnit |
createOrganizationalUnit(CmsDbContext dbc,
java.lang.String ouFqn,
java.lang.String description,
int flags,
CmsResource resource)
Creates a new organizational unit. |
CmsProject |
createProject(CmsDbContext dbc,
java.lang.String name,
java.lang.String description,
java.lang.String groupname,
java.lang.String managergroupname,
CmsProject.CmsProjectType projecttype)
Creates a project. |
CmsPropertyDefinition |
createPropertyDefinition(CmsDbContext dbc,
java.lang.String name)
Creates a property definition. |
void |
createPublishJob(CmsDbContext dbc,
CmsPublishJobInfoBean publishJob)
Creates a new publish job. |
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. |
CmsResource |
createSibling(CmsDbContext dbc,
CmsResource source,
java.lang.String destination,
java.util.List properties)
Creates a new sibling of the source resource. |
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 |
deleteGroup(CmsDbContext dbc,
CmsGroup group,
CmsUUID replacementId)
Deletes a group, where all permissions, users and children of the group are transfered to a replacement group. |
void |
deleteHistoricalVersions(CmsDbContext dbc,
int versionsToKeep,
int versionsDeleted,
long timeDeleted,
I_CmsReport report)
Deletes the versions from the history tables, keeping the given number of versions per resource. |
void |
deleteOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit organizationalUnit)
Deletes an organizational unit. |
void |
deleteProject(CmsDbContext dbc,
CmsProject deleteProject)
Deletes a project. |
void |
deletePropertyDefinition(CmsDbContext dbc,
java.lang.String name)
Deletes a property definition. |
void |
deletePublishJob(CmsDbContext dbc,
CmsUUID publishHistoryId)
Deletes a publish job identified by its history id. |
void |
deletePublishList(CmsDbContext dbc,
CmsUUID publishHistoryId)
Deletes the publish list assigned to a publish job. |
void |
deleteRelationsForResource(CmsDbContext dbc,
CmsResource resource,
CmsRelationFilter filter)
Deletes all relations for the given resource matching the given filter. |
protected void |
deleteRelationsWithSiblings(CmsDbContext dbc,
CmsResource resource)
Deletes all relations for the given resource and all its siblings. |
void |
deleteResource(CmsDbContext dbc,
CmsResource resource,
CmsResource.CmsResourceDeleteMode 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 |
destroy()
Destroys this driver manager and releases all allocated resources. |
boolean |
existsResourceId(CmsDbContext dbc,
CmsUUID resourceId)
Tests if a resource with the given resourceId does already exist in the Database. |
void |
fillPublishList(CmsDbContext dbc,
CmsPublishList publishList)
Fills the given publish list with the the VFS resources that actually get published. |
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,
CmsOrganizationalUnit orgUnit,
boolean includeSubOus)
Returns all projects which are owned by the current user or which are accessible by the current user. |
java.util.List |
getAllHistoricalProjects(CmsDbContext dbc)
Returns a list with all projects from history. |
java.util.List |
getAllManageableProjects(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
boolean includeSubOus)
Returns all projects which are owned by the current user or which are manageable for the group of the user. |
java.util.List |
getChildren(CmsDbContext dbc,
CmsGroup group,
boolean includeSubChildren)
Returns all child groups of a group. |
java.util.List |
getGroups(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
boolean includeSubOus,
boolean readRoles)
Returns all groups of the given organizational unit. |
java.util.List |
getGroupsOfUser(CmsDbContext dbc,
java.lang.String username,
boolean readRoles)
Returns the groups of an user filtered by the specified IP address. |
java.util.List |
getGroupsOfUser(CmsDbContext dbc,
java.lang.String username,
java.lang.String ouFqn,
boolean includeChildOus,
boolean readRoles,
boolean directGroupsOnly,
java.lang.String remoteAddress)
Returns the groups of an user filtered by the specified IP address. |
I_CmsHistoryDriver |
getHistoryDriver()
Returns the history driver. |
I_CmsHistoryDriver |
getHistoryDriver(CmsDbContext dbc)
Returns the history driver for a given database context. |
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. |
java.util.List |
getLockedResources(CmsDbContext dbc,
CmsResource resource,
CmsLockFilter filter)
Returns all locked resources in a given folder. |
protected CmsLockManager |
getLockManager()
Returns the lock manager instance. |
int |
getNextPublishTag(CmsDbContext dbc)
Returns the next publish tag for the published historical resources. |
java.util.List |
getOrganizationalUnits(CmsDbContext dbc,
CmsOrganizationalUnit parent,
boolean includeChildren)
Returns all child organizational units of the given parent organizational unit including hierarchical deeper organization units if needed. |
java.util.List |
getOrgUnitsForRole(CmsDbContext dbc,
CmsRole role,
boolean includeSubOus)
Returns all the organizational units for which the current user has the given role. |
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. |
I_CmsProjectDriver |
getProjectDriver(CmsDbContext dbc)
Returns the project driver for a given DB context. |
I_CmsProjectDriver |
getProjectDriver(CmsDbContext dbc,
I_CmsProjectDriver defaultDriver)
Returns either the project driver for the DB context (if it has one) or a default project driver. |
CmsUUID |
getProjectId(CmsDbContext dbc,
int id)
Returns the uuid id for the given id. |
org.apache.commons.collections.ExtendedProperties |
getPropertyConfiguration()
Returns the configuration read from the opencms.properties file. |
CmsPublishList |
getRelatedResourcesToPublish(CmsDbContext dbc,
CmsPublishList publishList,
CmsRelationFilter filter)
Returns a new publish list that contains the unpublished resources related to all resources in the given publish list, the related resources exclude all resources in the given publish list and also locked (by other users) resources. |
java.util.List |
getRelationsForResource(CmsDbContext dbc,
CmsResource resource,
CmsRelationFilter filter)
Returns all relations for the given resource matching the given filter. |
java.util.List |
getResourceOrgUnits(CmsDbContext dbc,
CmsResource resource)
Returns the list of organizational units the given resource belongs to. |
java.util.List |
getResourcesForOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit)
Returns all resources of the given organizational unit. |
java.util.Set |
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 |
getRolesForResource(CmsDbContext dbc,
CmsUser user,
CmsResource resource)
Returns all roles the given user has for the given resource. |
java.util.List |
getRolesForUser(CmsDbContext dbc,
CmsUser user)
Returns all roles the given user has independent of the resource. |
CmsSecurityManager |
getSecurityManager()
Returns the security manager this driver manager belongs to. |
CmsSqlManager |
getSqlManager()
Returns an instance of the common sql manager. |
I_CmsUserDriver |
getUserDriver()
Returns the user driver. |
I_CmsUserDriver |
getUserDriver(CmsDbContext dbc)
Returns the user driver for a given database context. |
I_CmsUserDriver |
getUserDriver(CmsDbContext dbc,
I_CmsUserDriver defaultDriver)
Returns either the user driver for the given DB context (if it has one) or a default value instead. |
java.util.List |
getUsers(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
boolean recursive)
Returns all direct users of the given organizational unit. |
java.util.List |
getUsersOfGroup(CmsDbContext dbc,
java.lang.String groupname,
boolean includeOtherOuUsers,
boolean directUsersOnly,
boolean readRoles)
Returns a list of users in a group. |
I_CmsVfsDriver |
getVfsDriver()
Returns the VFS driver. |
I_CmsVfsDriver |
getVfsDriver(CmsDbContext dbc)
Returns the VFS driver for the given database context. |
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 firstname,
java.lang.String lastname,
java.lang.String email,
int flags,
long dateCreated,
java.util.Map additionalInfos)
Creates a new user by import. |
void |
init(CmsConfigurationManager configurationManager)
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 |
isTempfileProject(CmsProject project)
Checks if a project is the tempfile project. |
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,
CmsLockType type)
Locks a resource. |
CmsUser |
loginUser(CmsDbContext dbc,
java.lang.String userName,
java.lang.String password,
java.lang.String remoteAddress)
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. |
void |
moveResource(CmsDbContext dbc,
CmsResource source,
java.lang.String destination,
boolean internal)
Moves a resource. |
java.lang.String |
moveToLostAndFound(CmsDbContext dbc,
CmsResource resource,
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. |
static CmsDriverManager |
newInstance(CmsConfigurationManager configurationManager,
CmsSecurityManager securityManager,
I_CmsDbContextFactory runtimeInfoFactory,
CmsPublishEngine publishEngine)
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 |
publishJob(CmsObject cms,
CmsDbContext dbc,
CmsPublishList publishList,
I_CmsReport report)
Publishes the given publish job. |
void |
publishProject(CmsObject cms,
CmsDbContext dbc,
CmsPublishList publishList,
I_CmsReport report)
Publishes the resources of a specified publish list. |
CmsAccessControlEntry |
readAccessControlEntry(CmsDbContext dbc,
CmsResource resource,
CmsUUID principal)
Reads an access control entry from the cms. |
java.util.List |
readAllAvailableVersions(CmsDbContext dbc,
CmsResource resource)
Reads all versions of the given resource. |
java.util.List |
readAllPropertyDefinitions(CmsDbContext dbc)
Reads all property definitions for the given mapping type. |
java.util.List |
readChildResources(CmsDbContext dbc,
CmsResource resource,
CmsResourceFilter filter,
boolean getFolders,
boolean getFiles,
boolean checkPermissions)
Returns the child resources of a resource, that is the resources contained in a folder. |
CmsResource |
readDefaultFile(CmsDbContext dbc,
CmsResource resource)
Returns the default file for the given folder. |
java.util.List |
readDeletedResources(CmsDbContext dbc,
CmsResource resource,
boolean readTree,
boolean isVfsManager)
Reads all deleted (historical) resources below the given path, including the full tree below the path, if required. |
CmsFile |
readFile(CmsDbContext dbc,
CmsResource resource)
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. |
CmsGroup |
readGroup(CmsDbContext dbc,
CmsProject project)
Reads the group of a project. |
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. |
CmsHistoryPrincipal |
readHistoricalPrincipal(CmsDbContext dbc,
CmsUUID principalId)
Reads a principal (an user or group) from the historical archive based on its ID. |
CmsHistoryProject |
readHistoryProject(CmsDbContext dbc,
CmsUUID projectId)
Returns the latest historical project entry with the given id. |
CmsHistoryProject |
readHistoryProject(CmsDbContext dbc,
int publishTag)
Returns a historical project entry. |
java.util.List |
readHistoryPropertyObjects(CmsDbContext dbc,
I_CmsHistoryResource historyResource)
Reads the list of all objects that belongs to the given historical resource. |
void |
readLocks(CmsDbContext dbc)
Reads the locks that were saved to the database in the previous run of OpenCms. |
CmsGroup |
readManagerGroup(CmsDbContext dbc,
CmsProject project)
Reads the manager group of a project. |
CmsOrganizationalUnit |
readOrganizationalUnit(CmsDbContext dbc,
java.lang.String ouFqn)
Reads an organizational Unit based on its fully qualified name. |
CmsUser |
readOwner(CmsDbContext dbc,
CmsProject project)
Reads the owner of a project. |
java.util.List |
readPath(CmsDbContext dbc,
java.lang.String path,
CmsResourceFilter filter)
Builds a list of resources for a given path. |
CmsProject |
readProject(CmsDbContext dbc,
CmsUUID id)
Reads a project given the projects id. |
CmsProject |
readProject(CmsDbContext dbc,
java.lang.String name)
Reads 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,
CmsUUID projectId,
CmsResourceState 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. |
CmsPublishJobInfoBean |
readPublishJob(CmsDbContext dbc,
CmsUUID publishHistoryId)
Reads a single publish job identified by its publish history id. |
java.util.List |
readPublishJobs(CmsDbContext dbc,
long startTime,
long endTime)
Reads all available publish jobs. |
CmsPublishList |
readPublishList(CmsDbContext dbc,
CmsUUID publishHistoryId)
Reads the publish list assigned to a publish job. |
byte[] |
readPublishReportContents(CmsDbContext dbc,
CmsUUID publishHistoryId)
Reads the publish report assigned to a publish job. |
I_CmsHistoryResource |
readResource(CmsDbContext dbc,
CmsResource resource,
int version)
Reads an historical resource entry for the given resource and with the given version number. |
CmsResource |
readResource(CmsDbContext dbc,
CmsUUID structureID,
CmsResourceFilter filter)
Reads a resource from the VFS, using the specified resource filter. |
CmsResource |
readResource(CmsDbContext dbc,
java.lang.String resourcePath,
CmsResourceFilter filter)
Reads a resource from the VFS, using the specified resource filter. |
I_CmsHistoryResource |
readResourceForPublishTag(CmsDbContext dbc,
CmsResource resource,
int publishTag)
Deprecated. use readResource(CmsDbContext, CmsResource, int) instead
but notice that the publishTag != version |
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,
CmsResource folder,
java.lang.String propertyDefinition,
java.lang.String value,
CmsResourceFilter filter)
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. |
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,
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 |
removeResourceFromOrgUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
CmsResource resource)
Removes a resource from the given organizational unit. |
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,
boolean readRoles)
Removes a user from a group. |
void |
repairCategories(CmsDbContext dbc,
CmsUUID projectId,
CmsResource resource)
Repairs broken categories. |
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 |
restoreDeletedResource(CmsDbContext dbc,
CmsUUID structureId)
Restores a deleted resource identified by its structure id from the historical archive. |
void |
restoreResource(CmsDbContext dbc,
CmsResource resource,
int version)
Restores a resource in the current project with a version from the historical 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 |
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 |
setUsersOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
CmsUser user)
Moves an user to the given organizational unit. |
void |
undelete(CmsDbContext dbc,
CmsResource resource)
Undelete the resource. |
void |
undoChanges(CmsDbContext dbc,
CmsResource resource,
CmsResource.CmsResourceUndoMode mode)
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,
boolean force,
boolean removeSystemLock)
Unlocks a resource. |
void |
updateExportPoints(CmsDbContext dbc)
Update the export points. |
void |
updateRelationsForResource(CmsDbContext dbc,
CmsResource resource,
java.util.List links)
Updates/Creates the given relations for the given resource. |
boolean |
userInGroup(CmsDbContext dbc,
java.lang.String username,
java.lang.String groupname,
boolean readRoles)
Returns true if a user is member of the given group. |
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. |
java.util.Map |
validateRelations(CmsDbContext dbc,
CmsPublishList publishList,
I_CmsReport report)
Validates the relations for the given resources. |
void |
writeAccessControlEntry(CmsDbContext dbc,
CmsResource resource,
CmsAccessControlEntry ace)
Writes an access control entries to a given resource. |
void |
writeExportPoints(CmsDbContext dbc,
I_CmsReport report,
CmsUUID publishHistoryId)
Writes all export points into the file system for the publish task specified by trhe given 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 |
writeHistoryProject(CmsDbContext dbc,
int publishTag,
long publishDate)
Creates an historical entry of the current project. |
void |
writeLocks(CmsDbContext dbc)
Writes the locks that are currently stored in-memory to the database to allow restoring them in future server startups. |
void |
writeOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit organizationalUnit)
Writes an already existing organizational unit. |
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,
boolean updateState)
Writes a list of properties for a specified resource. |
void |
writePublishJob(CmsDbContext dbc,
CmsPublishJobInfoBean publishJob)
Updates a publish job. |
void |
writePublishReport(CmsDbContext dbc,
CmsPublishJobInfoBean publishJob)
Writes the publish report for a publish job. |
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 |
writeUser(CmsDbContext dbc,
CmsUser user)
Updates the user information. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ATTRIBUTE_LOGIN
public static final java.lang.String ATTRIBUTE_USERADDINFO
public static final java.lang.String ATTRIBUTE_USERADDINFO_VALUE_DELETE
public static final java.lang.String ATTRIBUTE_USERADDINFO_VALUE_INSERT
public static final java.lang.String ATTRIBUTE_USERADDINFO_VALUE_UPDATE
public static final java.lang.String CACHE_ALL_PROPERTIES
public static final int CHANGED_ACCESSCONTROL
public static final int CHANGED_CONTENT
public static final int CHANGED_LASTMODIFIED
public static final int CHANGED_RESOURCE
public static final int CHANGED_TIMEFRAME
public static final java.lang.String CONFIGURATION_BACKUP
CONFIGURATION_HISTORY
instead
public static final java.lang.String CONFIGURATION_CACHE
public static final java.lang.String CONFIGURATION_DB
public static final java.lang.String CONFIGURATION_HISTORY
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 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 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 java.lang.String TEMP_FILE_PREFIX
public static final int UPDATE_ALL
public static final int UPDATE_RESOURCE
public static final int UPDATE_RESOURCE_PROJECT
public static final int UPDATE_RESOURCE_STATE
public static final int UPDATE_RESOURCE_STATE_CONTENT
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, CmsPublishEngine publishEngine) 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 factorypublishEngine
- the publish engine
CmsInitException
- if the driver manager couldn't be instantiatedpublic void addRelationToResource(CmsDbContext dbc, CmsResource resource, CmsResource target, CmsRelationType type, boolean importCase) throws CmsException
dbc
- the database contextresource
- the resource to add the relation totarget
- the target of the relationtype
- the type of the relationimportCase
- if importing relations
CmsException
- if something goes wrongpublic void addResourceToOrgUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsResource resource) throws CmsException
dbc
- the current db contextorgUnit
- the organizational unit to add the resource toresource
- the resource that is to be added to the organizational unit
CmsException
- if something goes wrongCmsOrgUnitManager.addResourceToOrgUnit(CmsObject, String, String)
,
CmsOrgUnitManager.addResourceToOrgUnit(CmsObject, String, String)
public void addUserToGroup(CmsDbContext dbc, java.lang.String username, java.lang.String groupname, boolean readRoles) 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 groupreadRoles
- if reading roles or groups
CmsException
- if operation was not successful
CmsDbEntryNotFoundException
- if the given user or the given group was not foundremoveUserFromGroup(CmsDbContext, String, String, boolean)
public void changeLock(CmsDbContext dbc, CmsResource resource, CmsLockType lockType) throws CmsException, CmsSecurityException
dbc
- the current database contextresource
- the resource to change the lock forlockType
- the new lock type to set
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 java.util.List changeResourcesInFolderWithProperty(CmsDbContext dbc, CmsResource resource, java.lang.String propertyDefinition, java.lang.String oldValue, java.lang.String newValue, boolean recursive) throws CmsVfsException, CmsException
dbc
- the current database contextresource
- the resource on which property definition values are changedpropertyDefinition
- the name of the propertydefinition to change the valueoldValue
- the old value of the propertydefinitionnewValue
- the new value of the propertydefinitionrecursive
- if true, change the property value on the resource and recursively all property values on
sub-resources (only for folders)
CmsResource
's where the property value has been changed
CmsVfsException
- for now only when the search for the oldvalue failed.
CmsException
- if operation was not successfulpublic 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, CmsResource.CmsResourceCopyMode siblingMode) throws CmsException, CmsIllegalArgumentException
You must ensure that the destination path is an absolute, valid 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
CmsObject.copyResource(String, String, CmsResource.CmsResourceCopyMode)
,
I_CmsResourceType.copyResource(CmsObject, CmsSecurityManager, CmsResource, String, CmsResource.CmsResourceCopyMode)
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(CmsProject project)
project
- the project to count the locked resources in
public CmsGroup createGroup(CmsDbContext dbc, CmsUUID id, java.lang.String name, java.lang.String description, int flags, java.lang.String parent) throws CmsIllegalArgumentException, CmsException
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
)
CmsException
- if the creation of the group failed
CmsIllegalArgumentException
- if the length of the given name was below 1public CmsOrganizationalUnit createOrganizationalUnit(CmsDbContext dbc, java.lang.String ouFqn, java.lang.String description, int flags, CmsResource resource) throws CmsException
dbc
- the current db contextouFqn
- the fully qualified name of the new organizational unitdescription
- the description of the new organizational unitflags
- the flags for the new organizational unitresource
- the first associated resource
CmsOrganizationalUnit
object representing
the newly created organizational unit
CmsException
- if operation was not successfulCmsOrgUnitManager.createOrganizationalUnit(CmsObject, String, String, int, String)
public CmsProject createProject(CmsDbContext dbc, java.lang.String name, java.lang.String description, java.lang.String groupname, java.lang.String managergroupname, CmsProject.CmsProjectType projecttype) throws CmsIllegalArgumentException, CmsException
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, or if the name is not valid
CmsException
- 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 void createPublishJob(CmsDbContext dbc, CmsPublishJobInfoBean publishJob) throws CmsException
dbc
- the current database contextpublishJob
- the publish job 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 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.
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 behavior 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 CmsResource 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 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 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 successful
CmsDataAccessException
- if group to be deleted contains userpublic void deleteHistoricalVersions(CmsDbContext dbc, int versionsToKeep, int versionsDeleted, long timeDeleted, I_CmsReport report) throws CmsException
if the cleanUp
option is set, additionally versions of deleted resources will be removed.
dbc
- the current database contextversionsToKeep
- number of versions to keep, is ignored if negativeversionsDeleted
- number of versions to keep for deleted resources, is ignored if negativetimeDeleted
- deleted resources older than this will also be deleted, is ignored if negativereport
- the report for output logging
CmsException
- if operation was not successfulpublic void deleteOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit organizationalUnit) throws CmsException
Only organizational units that contain no suborganizational unit can be deleted.
The organizational unit can not be delete if it is used in the request context, or if the current user belongs to it.
All users and groups in the given organizational unit will be deleted.
dbc
- the current db contextorganizationalUnit
- the organizational unit to delete
CmsException
- if operation was not successfulCmsOrgUnitManager.deleteOrganizationalUnit(CmsObject, String)
public 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 deletePublishJob(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException
dbc
- the current database contextpublishHistoryId
- the history id identifying the publish job
CmsException
- if something goes wrongpublic void deletePublishList(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException
dbc
- the current database contextpublishHistoryId
- the history id identifying the publish job
CmsException
- if something goes wrongpublic void deleteRelationsForResource(CmsDbContext dbc, CmsResource resource, CmsRelationFilter filter) throws CmsException
dbc
- the current db contextresource
- the resource to delete the relations forfilter
- the filter to use for deletion
CmsException
- if something goes wrongCmsSecurityManager.deleteRelationsForResource(CmsRequestContext, CmsResource, CmsRelationFilter)
public void deleteResource(CmsDbContext dbc, CmsResource resource, CmsResource.CmsResourceDeleteMode 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, CmsResource.CmsResourceDeleteMode)
,
I_CmsResourceType.deleteResource(CmsObject, CmsSecurityManager, CmsResource, CmsResource.CmsResourceDeleteMode)
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-parameter, 1=parameter)linkParameter
- the parameters of the 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 successfulpublic void destroy()
public boolean existsResourceId(CmsDbContext dbc, CmsUUID resourceId) throws CmsException
dbc
- the current database contextresourceId
- the resource id to test for
CmsException
- if something goes wrongpublic void 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),
the given publish list will be filled with all new/changed/deleted files from the current
(offline) project that will be actually published
CmsException
- if something goes wrongCmsPublishList
public 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, CmsOrganizationalUnit orgUnit, boolean includeSubOus) throws CmsException
dbc
- the current database contextorgUnit
- the organizational unit to search project inincludeSubOus
- if to include sub organizational units
CmsProject
CmsException
- if something goes wrongpublic java.util.List getAllHistoricalProjects(CmsDbContext dbc) throws CmsException
dbc
- the current database context
CmsHistoryProject
objects
with all projects from history.
CmsException
- if operation was not successfulpublic java.util.List getAllManageableProjects(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean includeSubOus) throws CmsException
dbc
- the current database contextorgUnit
- the organizational unit to search project inincludeSubOus
- if to include sub organizational units
CmsProject
CmsException
- if operation was not successfulpublic java.util.List getChildren(CmsDbContext dbc, CmsGroup group, boolean includeSubChildren) throws CmsException
dbc
- the current database contextgroup
- the group to get the child forincludeSubChildren
- if set also returns all sub-child groups of the given group
CmsGroup
objects
CmsException
- if operation was not successfulpublic java.util.List getGroups(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean includeSubOus, boolean readRoles) throws CmsException
dbc
- the current db contextorgUnit
- the organizational unit to get the groups forincludeSubOus
- if all groups of sub-organizational units should be retrieved tooreadRoles
- if to read roles or groups
CmsGroup
objects in the organizational unit
CmsException
- if operation was not successfulCmsOrgUnitManager.getResourcesForOrganizationalUnit(CmsObject, String)
,
CmsOrgUnitManager.getGroups(CmsObject, String, boolean)
public java.util.List getGroupsOfUser(CmsDbContext dbc, java.lang.String username, boolean readRoles) throws CmsException
dbc
- the current database contextusername
- the name of the userreadRoles
- if to read roles or groups
CmsGroup
objects
CmsException
- if something goes wrongpublic java.util.List getGroupsOfUser(CmsDbContext dbc, java.lang.String username, java.lang.String ouFqn, boolean includeChildOus, boolean readRoles, boolean directGroupsOnly, java.lang.String remoteAddress) throws CmsException
dbc
- the current database contextusername
- the name of the userouFqn
- the fully qualified name of the organizational unit to restrict the result set forincludeChildOus
- include groups of child organizational unitsreadRoles
- if to read roles or groupsdirectGroupsOnly
- if set only the direct assigned groups will be returned, if not also indirect groupsremoteAddress
- the IP address to filter the groups in the result list
CmsGroup
objects
CmsException
- if operation was not successfulpublic I_CmsHistoryDriver getHistoryDriver()
public I_CmsHistoryDriver getHistoryDriver(CmsDbContext dbc)
dbc
- the database context
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 java.util.List getLockedResources(CmsDbContext dbc, CmsResource resource, CmsLockFilter filter) throws CmsException
dbc
- the current database contextresource
- the folder to search infilter
- the lock filter
CmsException
- if the current project is lockedpublic int getNextPublishTag(CmsDbContext dbc)
dbc
- the current database context
public java.util.List getOrganizationalUnits(CmsDbContext dbc, CmsOrganizationalUnit parent, boolean includeChildren) throws CmsException
dbc
- the current db contextparent
- the parent organizational unit, or null
for the rootincludeChildren
- if hierarchical deeper organization units should also be returned
CmsOrganizationalUnit
objects
CmsException
- if operation was not successfulCmsOrgUnitManager.getOrganizationalUnits(CmsObject, String, boolean)
public java.util.List getOrgUnitsForRole(CmsDbContext dbc, CmsRole role, boolean includeSubOus) throws CmsException
dbc
- the current database contextrole
- the role to checkincludeSubOus
- if sub organizational units should be included in the search
CmsOrganizationalUnit
objects
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 successfulpublic 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 I_CmsProjectDriver getProjectDriver(CmsDbContext dbc)
dbc
- the database context
public I_CmsProjectDriver getProjectDriver(CmsDbContext dbc, I_CmsProjectDriver defaultDriver)
dbc
- the DB contextdefaultDriver
- the driver which should be returned if there is no project driver for the DB context
public CmsUUID getProjectId(CmsDbContext dbc, int id) throws CmsException
TODO: remove this method as soon as possible
dbc
- the current database contextid
- the old project id
CmsException
- if something goes wrongpublic org.apache.commons.collections.ExtendedProperties getPropertyConfiguration()
opencms.properties
file.
opencms.properties
filepublic CmsPublishList getRelatedResourcesToPublish(CmsDbContext dbc, CmsPublishList publishList, CmsRelationFilter filter) throws CmsException
dbc
- the current database contextpublishList
- the publish list to exclude from resultfilter
- the relation filter to use to get the related resources
CmsException
- if something goes wrongCmsPublishManager.getRelatedResourcesToPublish(CmsObject, CmsPublishList)
public java.util.List getRelationsForResource(CmsDbContext dbc, CmsResource resource, CmsRelationFilter filter) throws CmsException
dbc
- the current db contextresource
- the resource to retrieve the relations forfilter
- the filter to match the relation
CmsRelation
objects for the given resource matching the given filter
CmsException
- if something goes wrongCmsSecurityManager.getRelationsForResource(CmsRequestContext, CmsResource, CmsRelationFilter)
public java.util.List getResourceOrgUnits(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource
CmsOrganizationalUnit
objects
CmsException
- if something goes wrongpublic java.util.List getResourcesForOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit) throws CmsException
dbc
- the current db contextorgUnit
- the organizational unit to get all resources for
CmsResource
objects in the organizational unit
CmsException
- if operation was not successfulCmsOrgUnitManager.getResourcesForOrganizationalUnit(CmsObject, String)
,
CmsOrgUnitManager.getUsers(CmsObject, String, boolean)
,
CmsOrgUnitManager.getGroups(CmsObject, String, boolean)
public java.util.Set 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 getRolesForResource(CmsDbContext dbc, CmsUser user, CmsResource resource) throws CmsException
dbc
- the current database contextuser
- the user to checkresource
- the resource to check the roles for
CmsRole
objects
CmsException
- if something goes wrongpublic java.util.List getRolesForUser(CmsDbContext dbc, CmsUser user) throws CmsException
dbc
- the current database contextuser
- the user to check
CmsRole
objects
CmsException
- if something goes wrongpublic CmsSecurityManager getSecurityManager()
public CmsSqlManager getSqlManager()
public I_CmsUserDriver getUserDriver()
public I_CmsUserDriver getUserDriver(CmsDbContext dbc)
dbc
- the database context
public I_CmsUserDriver getUserDriver(CmsDbContext dbc, I_CmsUserDriver defaultDriver)
dbc
- the DB contextdefaultDriver
- the driver that should be returned if no driver for the DB context was found
defaultDriver
if none were foundpublic java.util.List getUsers(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean recursive) throws CmsException
dbc
- the current db contextorgUnit
- the organizational unit to get all users forrecursive
- if all groups of sub-organizational units should be retrieved too
CmsUser
objects in the organizational unit
CmsException
- if operation was not successfulCmsOrgUnitManager.getResourcesForOrganizationalUnit(CmsObject, String)
,
CmsOrgUnitManager.getUsers(CmsObject, String, boolean)
public java.util.List getUsersOfGroup(CmsDbContext dbc, java.lang.String groupname, boolean includeOtherOuUsers, boolean directUsersOnly, boolean readRoles) throws CmsException
dbc
- the current database contextgroupname
- the name of the group to list users fromincludeOtherOuUsers
- include users of other organizational unitsdirectUsersOnly
- if set only the direct assigned users will be returned,
if not also indirect users, ie. members of parent roles,
this parameter only works with rolesreadRoles
- if to read roles or groups
CmsUser
objects in the group
CmsException
- if operation was not successfulpublic I_CmsVfsDriver getVfsDriver()
public I_CmsVfsDriver getVfsDriver(CmsDbContext dbc)
dbc
- the database context
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 firstname, java.lang.String lastname, java.lang.String email, int flags, long dateCreated, 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 userfirstname
- the firstname of the userlastname
- the lastname of the useremail
- the email of the userflags
- the flags for a user (for example I_CmsPrincipal.FLAG_ENABLED
)dateCreated
- the creation dateadditionalInfos
- the additional user infos
CmsException
- if something goes wrongpublic void init(CmsConfigurationManager configurationManager) throws CmsException, java.lang.Exception
configurationManager
- the configuration manager
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 isTempfileProject(CmsProject project)
project
- the project to test
public 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, CmsLockType type) throws CmsException
The type
parameter controls what kind of lock is used.
Possible values for this parameter are:
dbc
- the current database contextresource
- the resource to locktype
- type of the lock
CmsException
- if something goes wrongCmsObject.lockResource(String)
,
CmsObject.lockResourceTemporary(String)
,
I_CmsResourceType.lockResource(CmsObject, CmsSecurityManager, CmsResource, CmsLockType)
public CmsUser loginUser(CmsDbContext dbc, java.lang.String userName, java.lang.String password, java.lang.String remoteAddress) 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 request
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 void moveResource(CmsDbContext dbc, CmsResource source, java.lang.String destination, boolean internal) throws CmsException
You must ensure that the parent of the destination path is an absolute, valid and existing VFS path. Relative paths from the source are not supported.
The moved resource will always be locked to the current user after the move operation.
In case the target resource already exists, it will be overwritten with the source resource if possible.
dbc
- the current database contextsource
- the resource to movedestination
- the name of the move destination with complete pathinternal
- if set nothing more than the path is modified
CmsException
- if something goes wrongCmsSecurityManager.moveResource(CmsRequestContext, CmsResource, String)
public java.lang.String moveToLostAndFound(CmsDbContext dbc, CmsResource resource, 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 contextresource
- 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 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 publishJob(CmsObject cms, CmsDbContext dbc, CmsPublishList publishList, I_CmsReport report) throws CmsException
cms
- the cms contextdbc
- the db contextpublishList
- the list of resources to publishreport
- the report to write to
CmsException
- if something goes wrongpublic 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 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 java.util.List readAllAvailableVersions(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource to read the history for
I_CmsHistoryResource
objects
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 java.util.List readChildResources(CmsDbContext dbc, CmsResource resource, CmsResourceFilter filter, boolean getFolders, boolean getFiles, boolean checkPermissions) 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 resultcheckPermissions
- if the resources should be filtered with the current user permissions
CmsException
- if something goes wrongpublic CmsResource readDefaultFile(CmsDbContext dbc, CmsResource resource)
If the given resource is a file, then this file is returned.
Otherwise, in case of a folder:
CmsPropertyDefinition.PROPERTY_DEFAULT_FILE
is checked, and
opencms-vfs.xml
configuration are iterated until a match is
found, and
null
is retuned
dbc
- the database contextresource
- the folder to get the default file for
CmsObject.readDefaultFile(String)
,
readDefaultFile(CmsDbContext, CmsResource)
public java.util.List readDeletedResources(CmsDbContext dbc, CmsResource resource, boolean readTree, boolean isVfsManager) throws CmsException
dbc
- the current db contextresource
- the parent resource to read the resources fromreadTree
- true
to read all subresourcesisVfsManager
- true
if the current user has the vfs manager role
I_CmsHistoryResource
objects
CmsException
- if something goes wrongCmsObject.readResource(CmsUUID, int)
,
CmsObject.readResources(String, CmsResourceFilter, boolean)
,
CmsObject.readDeletedResources(String, boolean)
public CmsFile readFile(CmsDbContext dbc, CmsResource resource) 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)
CmsException
- if operation was not successfulpublic 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 CmsGroup readGroup(CmsDbContext dbc, CmsProject project)
dbc
- the current database contextproject
- the project to read from
public 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 successfulpublic 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 successfulpublic CmsHistoryPrincipal readHistoricalPrincipal(CmsDbContext dbc, CmsUUID principalId) throws CmsException
dbc
- the current database contextprincipalId
- the id of the principal to read
CmsException
- if something goes wrong, ie. CmsDbEntryNotFoundException
CmsObject.readUser(CmsUUID)
,
CmsObject.readGroup(CmsUUID)
,
CmsObject.readHistoryPrincipal(CmsUUID)
public CmsHistoryProject readHistoryProject(CmsDbContext dbc, CmsUUID projectId) throws CmsException
dbc
- the current database contextprojectId
- the project id
CmsException
- if something goes wrongpublic CmsHistoryProject readHistoryProject(CmsDbContext dbc, int publishTag) throws CmsException
dbc
- the current database contextpublishTag
- the publish tag of the project
CmsException
- if something goes wrongpublic java.util.List readHistoryPropertyObjects(CmsDbContext dbc, I_CmsHistoryResource historyResource) throws CmsException
CmsProperty
objects that belongs to the given historical resource.
dbc
- the current database contexthistoryResource
- the historical resource to read the properties for
CmsProperty
objects
CmsException
- if something goes wrongpublic void readLocks(CmsDbContext dbc) throws CmsException
dbc
- the current database context
CmsException
- if something goes wrongpublic CmsGroup readManagerGroup(CmsDbContext dbc, CmsProject project)
dbc
- the current database contextproject
- the project to read from
public CmsOrganizationalUnit readOrganizationalUnit(CmsDbContext dbc, java.lang.String ouFqn) throws CmsException
dbc
- the current db contextouFqn
- the fully qualified name of the organizational Unit to be read
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 java.util.List readPath(CmsDbContext dbc, java.lang.String path, CmsResourceFilter filter) throws CmsException
dbc
- the current database contextpath
- the requested pathfilter
- a filter object (only "includeDeleted" information is used!)
CmsResource
s
CmsException
- if something goes wrongpublic CmsProject readProject(CmsDbContext dbc, CmsUUID 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, CmsUUID)
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 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, CmsUUID projectId, CmsResourceState 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(CmsUUID, CmsResourceState)
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
CmsException
- a CmsDbEntryNotFoundException is thrown if the property definition does not existpublic 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 CmsPublishJobInfoBean readPublishJob(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException
dbc
- the current database contextpublishHistoryId
- unique id to identify the publish job in the publish history
CmsPublishJobInfoBean
CmsException
- if something goes wrongpublic java.util.List readPublishJobs(CmsDbContext dbc, long startTime, long endTime) throws CmsException
dbc
- the current database contextstartTime
- the start of the time range for finish timeendTime
- the end of the time range for finish time
CmsPublishJobInfoBean
CmsException
- if something goes wrongpublic CmsPublishList readPublishList(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException
dbc
- the current database contextpublishHistoryId
- the history id identifying the publish job
CmsException
- if something goes wrongpublic byte[] readPublishReportContents(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException
dbc
- the current database contextpublishHistoryId
- the history id identifying the publish job
CmsException
- if something goes wrongpublic I_CmsHistoryResource readResource(CmsDbContext dbc, CmsResource resource, int version) throws CmsException
dbc
- the current db contextresource
- the resource to be readversion
- the version number to retrieve
CmsException
- if the resource could not be read for any reasonCmsObject.restoreResourceVersion(CmsUUID, int)
,
CmsObject.readResource(CmsUUID, int)
public CmsResource readResource(CmsDbContext dbc, CmsUUID structureID, CmsResourceFilter filter) throws CmsDataAccessException
dbc
- the current database contextstructureID
- the structure id of the resource to readfilter
- the resource filter to use while reading
CmsDataAccessException
- if something goes wrongCmsObject.readResource(CmsUUID, CmsResourceFilter)
,
CmsObject.readResource(CmsUUID)
public 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)
,
CmsObject.readFile(CmsResource)
public I_CmsHistoryResource readResourceForPublishTag(CmsDbContext dbc, CmsResource resource, int publishTag) throws CmsException
readResource(CmsDbContext, CmsResource, int)
instead
but notice that the publishTag != version
dbc
- the current db contextresource
- the resource to restore from the archivepublishTag
- the publish tag of the resource
CmsVfsResourceNotFoundException
if not found
CmsException
- if something goes wrongCmsObject.readResource(CmsUUID, int)
,
CmsObject.readResourceByPublishTag(CmsUUID, int)
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, CmsResource folder, java.lang.String propertyDefinition, java.lang.String value, CmsResourceFilter filter) throws CmsException
Both individual and shared properties of a resource are checked.
If the value
parameter is null
, all resources having the
given property set are returned.
dbc
- the current database contextfolder
- 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 propertyfilter
- the resource filter to apply to the result set
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 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 successfulpublic 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 successfulpublic 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 removeResourceFromOrgUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsResource resource) throws CmsException
dbc
- the current db contextorgUnit
- the organizational unit to remove the resource fromresource
- the resource that is to be removed from the organizational unit
CmsException
- if something goes wrongCmsOrgUnitManager.addResourceToOrgUnit(CmsObject, String, String)
,
CmsOrgUnitManager.addResourceToOrgUnit(CmsObject, String, String)
public 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, boolean readRoles) 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 groupreadRoles
- if to read roles or groups
CmsException
- if operation was not successful
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 databaseaddUserToGroup(CmsDbContext, String, String, boolean)
public void repairCategories(CmsDbContext dbc, CmsUUID projectId, CmsResource resource) throws CmsException
dbc
- the database contextprojectId
- the project idresource
- the resource to repair the categories for
CmsException
- if something goes wrongpublic 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 restoreDeletedResource(CmsDbContext dbc, CmsUUID structureId) throws CmsException
dbc
- the current database contextstructureId
- the structure id of the resource to restore
CmsException
- if something goes wrongCmsObject.restoreDeletedResource(CmsUUID)
public void restoreResource(CmsDbContext dbc, CmsResource resource, int version) throws CmsException
dbc
- the current database contextresource
- the resource to restore from the archiveversion
- the version number to restore from the archive
CmsException
- if something goes wrongCmsObject.restoreResourceVersion(CmsUUID, int)
,
I_CmsResourceType.restoreResource(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 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 successful
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 successful
CmsIllegalArgumentException
- if the user with the username
was not foundpublic void setUsersOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsUser user) throws CmsException
dbc
- the current db contextorgUnit
- the organizational unit to move the user touser
- the user that is to be moved to the organizational unit
CmsException
- if something goes wrongCmsOrgUnitManager.setUsersOrganizationalUnit(CmsObject, String, String)
public void undelete(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.undeleteResource(String, boolean)
,
I_CmsResourceType.undelete(CmsObject, CmsSecurityManager, CmsResource, boolean)
public void undoChanges(CmsDbContext dbc, CmsResource resource, CmsResource.CmsResourceUndoMode mode) throws CmsException
dbc
- the current database contextresource
- the name of the resource to apply this operation tomode
- the undo mode, one of the CmsResource.CmsResourceUndoMode
#UNDO_XXX
constants
please note that the recursive flag is ignored at this level
CmsException
- if something goes wrongCmsObject.undoChanges(String, CmsResource.CmsResourceUndoMode)
,
I_CmsResourceType.undoChanges(CmsObject, CmsSecurityManager, CmsResource, CmsResource.CmsResourceUndoMode)
public void unlockProject(CmsProject project)
project
- the project to unlock the resources inpublic void unlockResource(CmsDbContext dbc, CmsResource resource, boolean force, boolean removeSystemLock) throws CmsException
dbc
- the current database contextresource
- the resource to unlockforce
- true
, if a resource is forced to get unlocked, no matter by which user and in which project the resource is currently lockedremoveSystemLock
- true
, if you also want to remove system locks
CmsException
- if something goes wrongCmsObject.unlockResource(String)
,
I_CmsResourceType.unlockResource(CmsObject, CmsSecurityManager, CmsResource)
public void updateExportPoints(CmsDbContext dbc)
All files and folders "inside" an export point are written.
dbc
- the current database contextpublic void updateRelationsForResource(CmsDbContext dbc, CmsResource resource, java.util.List links) throws CmsException
dbc
- the db contextresource
- the resource to update the relations forlinks
- the links to consider for updating
CmsException
- if something goes wrongCmsSecurityManager.updateRelationsForResource(CmsRequestContext, CmsResource, List)
public boolean userInGroup(CmsDbContext dbc, java.lang.String username, java.lang.String groupname, boolean readRoles) 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 checkreadRoles
- if to read roles or groups
true
, if the user is in the group, false
otherwise
CmsException
- if something goes wrongpublic 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 java.util.Map validateRelations(CmsDbContext dbc, CmsPublishList publishList, I_CmsReport report) throws java.lang.Exception
dbc
- the database contextpublishList
- the resources to validate during publishingreport
- a report to write the messages to
CmsRelation
}
objects)
keyed by root paths
java.lang.Exception
- if something goes wrongpublic 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, I_CmsReport report, CmsUUID publishHistoryId)
dbc
- the current database contextreport
- an I_CmsReport instance to print output message, or null to write messages to the log filepublishHistoryId
- ID to identify the 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 overridden
by the given data.
dbc
- the current database contextgroup
- the group that should be written
CmsException
- if operation was not successfulpublic void writeHistoryProject(CmsDbContext dbc, int publishTag, long publishDate) throws CmsDataAccessException
dbc
- the current database contextpublishTag
- the versionpublishDate
- the date of publishing
CmsDataAccessException
- if operation was not successfulpublic void writeLocks(CmsDbContext dbc) throws CmsException
This overwrites the locks previously stored in the underlying database table.
dbc
- the current database context
CmsException
- if something goes wrongpublic void writeOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit organizationalUnit) throws CmsException
The organizational unit id has to be a valid OpenCms organizational unit id.
The organizational unit with the given id will be completely overridden
by the given data.
dbc
- the current db contextorganizationalUnit
- the organizational unit that should be written
CmsException
- if operation was not successfulCmsOrgUnitManager.writeOrganizationalUnit(CmsObject, CmsOrganizationalUnit)
public 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 overridden
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, boolean updateState) 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 writeupdateState
- if true
the state of the resource will be updated
CmsException
- if something goes wrongCmsObject.writePropertyObjects(String, List)
,
I_CmsResourceType.writePropertyObjects(CmsObject, CmsSecurityManager, CmsResource, List)
public void writePublishJob(CmsDbContext dbc, CmsPublishJobInfoBean publishJob) throws CmsException
dbc
- the current database contextpublishJob
- the publish job to update
CmsException
- if something goes wrongpublic void writePublishReport(CmsDbContext dbc, CmsPublishJobInfoBean publishJob) throws CmsException
dbc
- the current database contextpublishJob
- the publish job
CmsException
- if something goes wrongpublic 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-parameter, 1=parameter)linkParameter
- the parameters added to the resourcetimestamp
- a time stamp for writing the data into the db
CmsException
- if 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 overridden
by the given data.
dbc
- the current database contextuser
- the user to be updated
CmsException
- if operation was not successfulprotected CmsFolder convertResourceToFolder(CmsResource resource) throws CmsVfsResourceNotFoundException
resource
- the resource to convert
CmsVfsResourceNotFoundException
- if the resource is not a folderprotected void deleteRelationsWithSiblings(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource to delete the resource for
CmsException
- if something goes wrongprotected CmsLockManager getLockManager()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |