public final class CmsDriverManager extends java.lang.Object implements I_CmsEventListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTR_INIT_OU
Attribute for signaling to the user driver that a specific OU should be initialized by fillDefaults.
|
static java.lang.String |
ATTRIBUTE_LOGIN
Attribute login.
|
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_PROJECT
Value to indicate a project change.
|
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_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_SUBSCRIPTION
"subscription.vfs" 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 |
KEY_CHANGED_AND_DELETED
DBC attribute key needed to fix publishing behavior involving siblings.
|
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 |
PARAM_LOG_TABLE_ENABLED
Name of the configuration parameter to enable/disable logging to the CMS_LOG table.
|
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.
|
EVENT_BEFORE_PUBLISH_PROJECT, EVENT_CLEAR_CACHES, EVENT_CLEAR_OFFLINE_CACHES, EVENT_CLEAR_ONLINE_CACHES, EVENT_CLEAR_PRINCIPAL_CACHES, EVENT_FLEX_CACHE_CLEAR, EVENT_FLEX_PURGE_JSP_REPOSITORY, EVENT_FULLSTATIC_EXPORT, EVENT_GROUP_MODIFIED, EVENT_LOGIN_USER, EVENT_OU_MODIFIED, EVENT_PROJECT_MODIFIED, EVENT_PROPERTY_DEFINITION_CREATED, EVENT_PROPERTY_DEFINITION_MODIFIED, EVENT_PROPERTY_MODIFIED, EVENT_PUBLISH_PROJECT, EVENT_REBUILD_SEARCHINDEXES, EVENT_RESOURCE_AND_PROPERTIES_MODIFIED, EVENT_RESOURCE_COPIED, EVENT_RESOURCE_CREATED, EVENT_RESOURCE_DELETED, EVENT_RESOURCE_MODIFIED, EVENT_RESOURCE_MOVED, EVENT_RESOURCES_AND_PROPERTIES_MODIFIED, EVENT_RESOURCES_MODIFIED, EVENT_SITEMAP_CHANGED, EVENT_UPDATE_EXPORTS, EVENT_USER_MODIFIED, KEY_CHANGE, KEY_DBCONTEXT, KEY_GROUP_ID, KEY_GROUP_NAME, KEY_INDEX_NAMES, KEY_OU_ID, KEY_OU_NAME, KEY_PROJECTID, KEY_PUBLISHID, KEY_PUBLISHLIST, KEY_REPORT, KEY_RESOURCE, KEY_RESOURCES, KEY_USER_ACTION, KEY_USER_ID, KEY_USER_NAME, LISTENERS_FOR_ALL_EVENTS, VALUE_GROUP_MODIFIED_ACTION_CREATE, VALUE_GROUP_MODIFIED_ACTION_DELETE, VALUE_GROUP_MODIFIED_ACTION_WRITE, VALUE_OU_MODIFIED_ACTION_CREATE, VALUE_OU_MODIFIED_ACTION_DELETE, VALUE_USER_MODIFIED_ACTION_ADD_USER_TO_GROUP, VALUE_USER_MODIFIED_ACTION_CREATE_USER, VALUE_USER_MODIFIED_ACTION_DELETE_USER, VALUE_USER_MODIFIED_ACTION_REMOVE_USER_FROM_GROUP, VALUE_USER_MODIFIED_ACTION_RESET_PASSWORD, VALUE_USER_MODIFIED_ACTION_SET_OU, VALUE_USER_MODIFIED_ACTION_WRITE_USER
Modifier and Type | Method and Description |
---|---|
void |
addAlias(CmsDbContext dbc,
CmsProject project,
CmsAlias alias)
Adds an alias entry.
|
protected void |
addOrReplaceUrlNameMapping(CmsDbContext dbc,
java.lang.String name,
CmsUUID structureId,
java.lang.String locale,
boolean replaceOnPublish)
Adds or replaces a new url name mapping in the offline project.
|
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<CmsResource> |
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.
|
protected java.lang.Object |
createDriver(CmsDbContext dbc,
CmsConfigurationManager configManager,
CmsParameterConfiguration config,
java.lang.String driverChainKey,
java.lang.String suffix)
Helper method for creating a driver from configuration data.
|
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<CmsProperty> 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<CmsProperty> 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<CmsProperty> 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<java.lang.String,java.lang.Object> additionalInfos)
Creates a new user.
|
void |
deleteAliases(CmsDbContext dbc,
CmsProject project,
CmsAliasFilter filter)
Deletes aliases indicated by a filter.
|
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 |
deleteLogEntries(CmsDbContext dbc,
CmsLogFilter filter)
Deletes all log entries matching the given filter.
|
void |
deleteOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit organizationalUnit)
Deletes an organizational unit.
|
void |
deleteProject(CmsDbContext dbc,
CmsProject deleteProject)
Deletes a project.
|
void |
deleteProject(CmsDbContext dbc,
CmsProject deleteProject,
boolean resetResources)
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.
|
protected void |
ensureSubResourcesOfMovedFoldersPublished(CmsObject cms,
CmsDbContext dbc,
CmsPublishList pubList)
Tries to add sub-resources of moved folders to the publish list and throws an exception if the publish list still does
not contain some sub-resources of the moved folders.
|
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.
|
protected java.lang.String |
findBestNameForUrlNameMapping(CmsDbContext dbc,
java.util.Iterator<java.lang.String> nameSeq,
CmsUUID structureId,
java.lang.String locale)
Tries to find the best name for an URL name mapping for the given structure id.
|
protected java.lang.String |
findBestNameForUrlNameMapping(CmsDbContext dbc,
java.lang.String name,
CmsUUID structureId)
Helper method for finding the 'best' URL name to use for a new URL name mapping.
|
java.util.List<CmsAccessControlEntry> |
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<CmsAccessControlEntry> |
getAllAccessControlEntries(CmsDbContext dbc)
Reads all access control entries.
|
java.util.List<CmsProject> |
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<CmsHistoryProject> |
getAllHistoricalProjects(CmsDbContext dbc)
Returns a list with all projects from history.
|
java.util.List<CmsProject> |
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<CmsGroup> |
getChildren(CmsDbContext dbc,
CmsGroup group,
boolean includeSubChildren)
Returns all child groups of a group.
|
long |
getDateLastVisitedBy(CmsDbContext dbc,
java.lang.String poolName,
CmsUser user,
CmsResource resource)
Returns the date when the resource was last visited by the user.
|
java.util.List<CmsGroup> |
getGroups(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
boolean includeSubOus,
boolean readRoles)
Returns all groups of the given organizational unit.
|
java.util.List<CmsGroup> |
getGroupsOfUser(CmsDbContext dbc,
java.lang.String username,
boolean readRoles)
Returns the groups of an user filtered by the specified IP address.
|
java.util.List<CmsGroup> |
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<java.lang.String> |
getLockedResources(CmsDbContext dbc,
CmsResource resource,
CmsLockFilter filter)
Returns all locked resources in a given folder.
|
java.util.List<CmsResource> |
getLockedResourcesObjects(CmsDbContext dbc,
CmsResource resource,
CmsLockFilter filter)
Returns all locked resources in a given folder.
|
java.util.List<CmsResource> |
getLockedResourcesObjectsWithCache(CmsDbContext dbc,
CmsResource resource,
CmsLockFilter filter,
java.util.Map<java.lang.String,CmsResource> cache)
Returns all locked resources in a given folder, but uses a cache for resource lookups.
|
protected CmsLockManager |
getLockManager()
Returns the lock manager instance.
|
java.util.List<CmsLogEntry> |
getLogEntries(CmsDbContext dbc,
CmsLogFilter filter)
Returns all log entries matching the given filter.
|
int |
getNextPublishTag(CmsDbContext dbc)
Returns the next publish tag for the published historical resources.
|
protected java.lang.String |
getNumberedName(java.lang.String name,
int number)
Adds a numeric suffix to the end of a string, unless the number passed as a parameter is 0.
|
java.util.List<CmsOrganizationalUnit> |
getOrganizationalUnits(CmsDbContext dbc,
CmsOrganizationalUnit parent,
boolean includeChildren)
Returns all child organizational units of the given parent organizational unit including
hierarchical deeper organization units if needed.
|
java.util.List<CmsOrganizationalUnit> |
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.
|
CmsParameterConfiguration |
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<CmsRelation> |
getRelationsForResource(CmsDbContext dbc,
CmsResource resource,
CmsRelationFilter filter)
Returns all relations for the given resource matching the given filter.
|
java.util.List<CmsOrganizationalUnit> |
getResourceOrgUnits(CmsDbContext dbc,
CmsResource resource)
Returns the list of organizational units the given resource belongs to.
|
java.util.List<CmsResource> |
getResourcesForOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit)
Returns all resources of the given organizational unit.
|
java.util.Set<CmsResource> |
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<CmsRewriteAlias> |
getRewriteAliases(CmsDbContext dbc,
CmsRewriteAliasFilter filter)
Gets the rewrite aliases matching a given filter.
|
java.util.Set<CmsGroup> |
getRoleGroups(CmsDbContext dbc,
java.lang.String roleGroupName,
boolean directUsersOnly)
Collects the groups which constitute a given role.
|
java.util.Set<CmsGroup> |
getRoleGroupsImpl(CmsDbContext dbc,
java.lang.String roleGroupName,
boolean directUsersOnly,
java.util.Map<java.lang.String,java.util.Set<CmsGroup>> accumulator)
Collects the groups which constitute a given role.
|
java.util.List<CmsRole> |
getRolesForResource(CmsDbContext dbc,
CmsUser user,
CmsResource resource)
Returns all roles the given user has for the given resource.
|
java.util.List<CmsRole> |
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_CmsSubscriptionDriver |
getSubscriptionDriver()
Returns the subscription driver of this driver 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<CmsUser> |
getUsers(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
boolean recursive)
Returns all direct users of the given organizational unit.
|
java.util.List<CmsUser> |
getUsersOfGroup(CmsDbContext dbc,
java.lang.String groupname,
boolean includeOtherOuUsers,
boolean directUsersOnly,
boolean readRoles)
Returns a list of users in a group.
|
java.util.List<CmsResource> |
getUsersPubList(CmsDbContext dbc,
CmsUUID userId)
Returns the given user's publish list.
|
java.util.List<CmsUser> |
getUsersWithoutAdditionalInfo(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
boolean recursive)
Returns all direct users of the given organizational unit, without their additional info.
|
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<CmsAccessControlEntry> acEntries)
Writes a vector of access control entries as new access control entries of a given resource.
|
CmsAliasImportResult |
importRewriteAlias(CmsDbContext dbc,
java.lang.String siteRoot,
java.lang.String source,
java.lang.String target,
CmsAliasMode mode)
Imports a rewrite alias.
|
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<java.lang.String,java.lang.Object> additionalInfos)
Creates a new user by import.
|
int |
incrementCounter(CmsDbContext dbc,
java.lang.String name)
Increments a counter and returns its value before incrementing.
|
void |
init(CmsConfigurationManager configurationManager,
I_CmsDbContextFactory dbContextFactory)
Initializes the driver and sets up all required modules and connections.
|
void |
initOrgUnit(CmsDbContext dbc,
CmsOrganizationalUnit ou)
Initializes the organizational unit.
|
boolean |
isInsideCurrentProject(CmsDbContext dbc,
java.lang.String resourcename)
Checks if the specified resource is inside the current project.
|
boolean |
isSubscriptionDriverAvailable()
Checks whether the subscription driver is available.
|
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.
|
void |
log(CmsDbContext dbc,
CmsLogEntry logEntry,
boolean force)
Adds the given log entry to the current user's log.
|
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 |
markResourceAsVisitedBy(CmsDbContext dbc,
java.lang.String poolName,
CmsResource resource,
CmsUser user)
Mark the given resource as visited by the user.
|
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(CmsDbContext dbc,
CmsConfigurationManager configurationManager,
java.lang.String driverName,
java.util.List<java.lang.String> successiveDrivers)
Gets a new driver instance.
|
java.lang.Object |
newDriverInstance(CmsParameterConfiguration configuration,
java.lang.String driverName,
java.lang.String driverPoolUrl)
Method to create a new instance of a driver.
|
static CmsDriverManager |
newInstance(CmsConfigurationManager configurationManager,
CmsSecurityManager securityManager,
I_CmsDbContextFactory runtimeInfoFactory,
CmsPublishEngine publishEngine)
Reads the required configurations from the opencms.properties file and creates
the various drivers to access the cms resources.
|
void |
newPoolInstance(CmsParameterConfiguration 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.
|
void |
publishUrlNameMapping(CmsDbContext dbc,
CmsResource res)
Transfers the new URL name mappings (if any) for a given resource to the online project.
|
CmsAccessControlEntry |
readAccessControlEntry(CmsDbContext dbc,
CmsResource resource,
CmsUUID principal)
Reads an access control entry from the cms.
|
CmsAlias |
readAliasByPath(CmsDbContext dbc,
CmsProject project,
java.lang.String siteRoot,
java.lang.String path)
Finds the alias with a given path.
|
java.util.List<CmsAlias> |
readAliasesBySite(CmsDbContext dbc,
CmsProject currentProject,
java.lang.String siteRoot)
Reads the aliases for a given site root.
|
java.util.List<CmsAlias> |
readAliasesByStructureId(CmsDbContext dbc,
CmsProject project,
CmsUUID structureId)
Reads the aliases which point to a given structure id.
|
java.util.List<I_CmsHistoryResource> |
readAllAvailableVersions(CmsDbContext dbc,
CmsResource resource)
Reads all versions of the given resource.
|
java.util.List<CmsPropertyDefinition> |
readAllPropertyDefinitions(CmsDbContext dbc)
Reads all property definitions for the given mapping type.
|
java.util.List<CmsResource> |
readAllSubscribedResources(CmsDbContext dbc,
java.lang.String poolName,
CmsPrincipal principal)
Returns all resources subscribed by the given user or group.
|
java.lang.String |
readBestUrlName(CmsDbContext dbc,
CmsUUID id,
java.util.Locale locale,
java.util.List<java.util.Locale> defaultLocales)
Selects the best url name for a given resource and locale.
|
java.util.List<CmsResource> |
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,
CmsResourceFilter resourceFilter)
Returns the default file for the given folder.
|
java.util.List<I_CmsHistoryResource> |
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<CmsProperty> |
readHistoryPropertyObjects(CmsDbContext dbc,
I_CmsHistoryResource historyResource)
Reads the list of all
objects that belongs to the given historical resource. |
CmsUUID |
readIdForUrlName(CmsDbContext dbc,
java.lang.String name)
Reads the structure id which is mapped to a given URL name.
|
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.
|
java.lang.String |
readNewestUrlNameForId(CmsDbContext dbc,
CmsUUID id)
Reads the URL name which has been most recently mapped to the given structure id, or null
if no URL name is mapped to the id.
|
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.
|
CmsResource |
readParentFolder(CmsDbContext dbc,
CmsUUID structureId)
Reads the parent folder to a given structure id.
|
java.util.List<CmsResource> |
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<java.lang.String> |
readProjectResources(CmsDbContext dbc,
CmsProject project)
Returns the list of all resource names that define the "view" of the given project.
|
java.util.List<CmsResource> |
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<CmsProperty> |
readPropertyObjects(CmsDbContext dbc,
CmsResource resource,
boolean search)
Reads all property objects mapped to a specified resource from the database.
|
java.util.List<CmsPublishedResource> |
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<CmsPublishJobInfoBean> |
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.
|
java.util.List<CmsResource> |
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<CmsResource> |
readResourcesVisitedBy(CmsDbContext dbc,
java.lang.String poolName,
CmsVisitedByFilter filter)
Returns the resources that were visited by a user set in the filter.
|
java.util.List<CmsResource> |
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<I_CmsPrincipal> |
readResponsiblePrincipals(CmsDbContext dbc,
CmsResource resource)
Returns the set of users that are responsible for a specific resource.
|
java.util.Set<CmsUser> |
readResponsibleUsers(CmsDbContext dbc,
CmsResource resource)
Returns the set of users that are responsible for a specific resource.
|
java.util.List<CmsResource> |
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<java.lang.String> |
readStaticExportResources(CmsDbContext dbc,
int parameterResources,
long timestamp)
Returns a list of all template resources which must be processed during a static export.
|
java.util.List<I_CmsHistoryResource> |
readSubscribedDeletedResources(CmsDbContext dbc,
java.lang.String poolName,
CmsUser user,
java.util.List<CmsGroup> groups,
CmsResource parent,
boolean includeSubFolders,
long deletedFrom)
Returns the subscribed history resources that were deleted.
|
java.util.List<CmsResource> |
readSubscribedResources(CmsDbContext dbc,
java.lang.String poolName,
CmsSubscriptionFilter filter)
Returns the resources that were subscribed by a user or group set in the filter.
|
java.util.List<CmsUrlNameMappingEntry> |
readUrlNameMappingEntries(CmsDbContext dbc,
boolean online,
CmsUrlNameMappingFilter filter)
Reads URL name mapping entries which match the given filter.
|
java.util.List<CmsUrlNameMappingEntry> |
readUrlNameMappings(CmsDbContext dbc,
CmsUrlNameMappingFilter filter)
Reads the URL name mappings matching the given filter.
|
java.util.List<java.lang.String> |
readUrlNamesForAllLocales(CmsDbContext dbc,
CmsUUID id)
Reads the newest URL names of a resource for all locales.
|
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 |
removeResourceFromUsersPubList(CmsDbContext dbc,
CmsUUID userId,
java.util.Collection<CmsUUID> structureIds)
Removes the given resource to the given user's publish list.
|
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<CmsProperty> 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.
|
protected void |
resetResourcesInProject(CmsDbContext dbc,
CmsUUID projectId,
java.util.List<CmsResource> modifiedFiles,
java.util.List<CmsResource> modifiedFolders)
Resets the resources in a project to their online state.
|
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 |
saveAliases(CmsDbContext dbc,
CmsProject project,
CmsUUID structureId,
java.util.List<CmsAlias> aliases)
Saves a list of aliases for the same structure id, replacing any aliases for the same structure id.
|
void |
saveRewriteAliases(CmsDbContext dbc,
java.lang.String siteRoot,
java.util.List<CmsRewriteAlias> newAliases)
Replaces the complete list of rewrite aliases for a given site root.
|
java.util.List<CmsUser> |
searchUsers(CmsDbContext dbc,
CmsUserSearchParameters searchParams)
Searches for users which fit the given criteria.
|
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 |
setSubscribedResourceAsDeleted(CmsDbContext dbc,
java.lang.String poolName,
CmsResource resource)
Marks a subscribed resource as deleted.
|
void |
setUsersOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
CmsUser user)
Moves an user to the given organizational unit.
|
void |
subscribeResourceFor(CmsDbContext dbc,
java.lang.String poolName,
CmsPrincipal principal,
CmsResource resource)
Subscribes the user or group to the resource.
|
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 |
unsubscribeAllDeletedResources(CmsDbContext dbc,
java.lang.String poolName,
long deletedTo)
Unsubscribes all deleted resources that were deleted before the specified time stamp.
|
void |
unsubscribeAllResourcesFor(CmsDbContext dbc,
java.lang.String poolName,
CmsPrincipal principal)
Unsubscribes the principal from all resources.
|
void |
unsubscribeResourceFor(CmsDbContext dbc,
java.lang.String poolName,
CmsPrincipal principal,
CmsResource resource)
Unsubscribes the principal from the resource.
|
void |
unsubscribeResourceForAll(CmsDbContext dbc,
java.lang.String poolName,
CmsResource resource)
Unsubscribes all groups and users from the resource.
|
void |
updateExportPoints(CmsDbContext dbc)
Update the export points.
|
void |
updateLastLoginDate(CmsDbContext dbc,
CmsUser user)
Updates the last login date on the given user to the current time.
|
void |
updateLog(CmsDbContext dbc)
Logs everything that has not been written to DB jet.
|
void |
updateRelationsForResource(CmsDbContext dbc,
CmsResource resource,
java.util.List<CmsLink> 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<java.lang.String,java.util.List<CmsRelation>> |
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 |
writeProjectLastModified(CmsDbContext dbc,
CmsResource resource,
CmsUUID projectId)
Writes a new project into the PROJECT_LASTMODIFIED field of a resource record.
|
void |
writePropertyObject(CmsDbContext dbc,
CmsResource resource,
CmsProperty property)
Writes a property for a specified resource.
|
void |
writePropertyObjects(CmsDbContext dbc,
CmsResource resource,
java.util.List<CmsProperty> 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.
|
java.lang.String |
writeUrlNameMapping(CmsDbContext dbc,
java.util.Iterator<java.lang.String> nameSeq,
CmsUUID structureId,
java.lang.String locale,
boolean replaceOnPublish)
Adds a new url name mapping for a structure id.
|
void |
writeUser(CmsDbContext dbc,
CmsUser user)
Updates the user information.
|
public static final java.lang.String ATTR_INIT_OU
public static final java.lang.String ATTRIBUTE_LOGIN
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_PROJECT
public static final int CHANGED_RESOURCE
public static final int CHANGED_TIMEFRAME
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_SUBSCRIPTION
public static final java.lang.String CONFIGURATION_USER
public static final java.lang.String CONFIGURATION_VFS
public static final java.lang.String KEY_CHANGED_AND_DELETED
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 PARAM_LOG_TABLE_ENABLED
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
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 engineCmsInitException
- if the driver manager couldn't be instantiatedpublic void addAlias(CmsDbContext dbc, CmsProject project, CmsAlias alias) throws CmsException
dbc
- the database contextproject
- the current projectalias
- the alias to addCmsException
- if something goes wrongpublic 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 relationsCmsException
- 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 unitCmsException
- 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 groupsCmsException
- if operation was not successfulCmsDbEntryNotFoundException
- 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 setCmsException
- if something goes wrongCmsSecurityException
- if something goes wrongCmsObject.changeLock(String)
,
I_CmsResourceType.changeLock(CmsObject, CmsSecurityManager, CmsResource)
,
CmsSecurityManager.hasPermissions(CmsRequestContext, CmsResource, CmsPermissionSet, boolean, CmsResourceFilter)
public java.util.List<CmsResource> 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 changedCmsVfsException
- 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 resourceCmsException
- 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 resourceCmsException
- 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 updatedCmsException
- 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 copyCmsException
- if something goes wrongCmsIllegalArgumentException
- 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 toCmsException
- 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 inpublic 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 failedCmsIllegalArgumentException
- 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 resourceCmsOrganizationalUnit
object representing
the newly created organizational unitCmsException
- 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 projectCmsIllegalArgumentException
- if the chosen name
is already used
by the online project, or if the name is not validCmsException
- 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 createCmsException
- if something goes wrongpublic void createPublishJob(CmsDbContext dbc, CmsPublishJobInfoBean publishJob) throws CmsException
dbc
- the current database contextpublishJob
- the publish job to createCmsException
- if something goes wrongpublic CmsResource createResource(CmsDbContext dbc, java.lang.String resourcePath, CmsResource resource, byte[] content, java.util.List<CmsProperty> 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" usageCmsException
- if something goes wrongpublic CmsResource createResource(CmsDbContext dbc, java.lang.String resourcename, int type, byte[] content, java.util.List<CmsProperty> 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 resourceCmsException
- if something goes wrongCmsIllegalArgumentException
- 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<CmsProperty> 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 siblingCmsException
- 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 contextCmsException
- if something goes wrongpublic CmsUser createUser(CmsDbContext dbc, java.lang.String name, java.lang.String password, java.lang.String description, java.util.Map<java.lang.String,java.lang.Object> 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 userCmsException
- if something goes wrongCmsIllegalArgumentException
- if the name for the user is not validCmsObject.createUser(String, String, String, Map)
public void deleteAliases(CmsDbContext dbc, CmsProject project, CmsAliasFilter filter) throws CmsException
dbc
- the current database contextproject
- the current projectfilter
- the filter which describes which aliases to deleteCmsException
- if something goes wrongpublic 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 deletedCmsException
- 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 successfulCmsDataAccessException
- 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 loggingCmsException
- if operation was not successfulpublic void deleteLogEntries(CmsDbContext dbc, CmsLogFilter filter) throws CmsException
dbc
- the current db contextfilter
- the filter to use for deletionCmsException
- if something goes wrongCmsSecurityManager.deleteLogEntries(CmsRequestContext, CmsLogFilter)
public 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 deleteCmsException
- 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 deletedCmsException
- if something goes wrongpublic void deleteProject(CmsDbContext dbc, CmsProject deleteProject, boolean resetResources) throws CmsException
Only the admin or the owner of the project can do this.
dbc
- the current database contextdeleteProject
- the project to be deletedresetResources
- if true, the resources of the project to delete will be reset to their online state, or deleted if they have no online stateCmsException
- 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 deleteCmsException
- if something goes wrongpublic void deletePublishJob(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException
dbc
- the current database contextpublishHistoryId
- the history id identifying the publish jobCmsException
- if something goes wrongpublic void deletePublishList(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException
dbc
- the current database contextpublishHistoryId
- the history id identifying the publish jobCmsException
- 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 deletionCmsException
- 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 resourceCmsException
- 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 resourceCmsException
- 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 forCmsException
- 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 publishedCmsException
- if something goes wrongCmsPublishList
public java.util.List<CmsAccessControlEntry> 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 foldersCmsAccessControlEntry
objects defining all permissions for the given resourceCmsException
- if something goes wrongpublic CmsAccessControlList getAccessControlList(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resourceCmsException
- 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 setCmsException
- if something goes wrongpublic int getActiveConnections(java.lang.String dbPoolUrl) throws CmsDbException
dbPoolUrl
- the url of a poolCmsDbException
- if something goes wrongpublic java.util.List<CmsAccessControlEntry> getAllAccessControlEntries(CmsDbContext dbc) throws CmsException
dbc
- the current database contextCmsException
- if something goes wrongpublic java.util.List<CmsProject> 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 unitsCmsProject
CmsException
- if something goes wrongpublic java.util.List<CmsHistoryProject> getAllHistoricalProjects(CmsDbContext dbc) throws CmsException
dbc
- the current database contextCmsHistoryProject
objects
with all projects from history.CmsException
- if operation was not successfulpublic java.util.List<CmsProject> 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 unitsCmsProject
CmsException
- if operation was not successfulpublic java.util.List<CmsGroup> 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 groupCmsGroup
objectsCmsException
- if operation was not successfulpublic long getDateLastVisitedBy(CmsDbContext dbc, java.lang.String poolName, CmsUser user, CmsResource resource) throws CmsException
dbc
- the database contextpoolName
- the name of the database pool to useuser
- the user to check the dateresource
- the resource to check the dateCmsException
- if something goes wrongpublic java.util.List<CmsGroup> 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 groupsCmsGroup
objects in the organizational unitCmsException
- if operation was not successfulCmsOrgUnitManager.getResourcesForOrganizationalUnit(CmsObject, String)
,
CmsOrgUnitManager.getGroups(CmsObject, String, boolean)
public java.util.List<CmsGroup> 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 groupsCmsGroup
objectsCmsException
- if something goes wrongpublic java.util.List<CmsGroup> 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 listCmsGroup
objectsCmsException
- if operation was not successfulpublic I_CmsHistoryDriver getHistoryDriver()
public I_CmsHistoryDriver getHistoryDriver(CmsDbContext dbc)
dbc
- the database contextpublic int getIdleConnections(java.lang.String dbPoolUrl) throws CmsDbException
dbPoolUrl
- the url of a poolCmsDbException
- if something goes wrongpublic CmsLock getLock(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource to return the lock state forCmsException
- if something goes wrongpublic java.util.List<java.lang.String> getLockedResources(CmsDbContext dbc, CmsResource resource, CmsLockFilter filter) throws CmsException
dbc
- the current database contextresource
- the folder to search infilter
- the lock filterCmsException
- if the current project is lockedpublic java.util.List<CmsResource> getLockedResourcesObjects(CmsDbContext dbc, CmsResource resource, CmsLockFilter filter) throws CmsException
dbc
- the current database contextresource
- the folder to search infilter
- the lock filterCmsException
- if the current project is lockedpublic java.util.List<CmsResource> getLockedResourcesObjectsWithCache(CmsDbContext dbc, CmsResource resource, CmsLockFilter filter, java.util.Map<java.lang.String,CmsResource> cache) throws CmsException
dbc
- the current database contextresource
- the folder to search infilter
- the lock filtercache
- the cache to use for resource lookupsCmsException
- if the current project is lockedpublic java.util.List<CmsLogEntry> getLogEntries(CmsDbContext dbc, CmsLogFilter filter) throws CmsException
dbc
- the current db contextfilter
- the filter to match the log entriesCmsException
- if something goes wrongCmsSecurityManager.getLogEntries(CmsRequestContext, CmsLogFilter)
public int getNextPublishTag(CmsDbContext dbc)
dbc
- the current database contextpublic java.util.List<CmsOrganizationalUnit> 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 returnedCmsOrganizationalUnit
objectsCmsException
- if operation was not successfulCmsOrgUnitManager.getOrganizationalUnits(CmsObject, String, boolean)
public java.util.List<CmsOrganizationalUnit> 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 searchCmsOrganizationalUnit
objectsCmsException
- if something goes wrongpublic CmsGroup getParent(CmsDbContext dbc, java.lang.String groupname) throws CmsException
dbc
- the current database contextgroupname
- the name of the groupnull
CmsException
- if operation was not successfulpublic CmsPermissionSetCustom getPermissions(CmsDbContext dbc, CmsResource resource, CmsUser user) throws CmsException
dbc
- the current database contextresource
- the resourceuser
- the userCmsException
- if something goes wrongpublic I_CmsProjectDriver getProjectDriver()
public I_CmsProjectDriver getProjectDriver(CmsDbContext dbc)
dbc
- the database contextpublic 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 contextpublic CmsUUID getProjectId(CmsDbContext dbc, int id) throws CmsException
TODO: remove this method as soon as possible
dbc
- the current database contextid
- the old project idCmsException
- if something goes wrongpublic CmsParameterConfiguration 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 resourcesCmsException
- if something goes wrongCmsPublishManager.getRelatedResourcesToPublish(CmsObject, CmsPublishList)
public java.util.List<CmsRelation> 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 relationCmsException
- if something goes wrongCmsSecurityManager.getRelationsForResource(CmsRequestContext, CmsResource, CmsRelationFilter)
public java.util.List<CmsOrganizationalUnit> getResourceOrgUnits(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resourceCmsOrganizationalUnit
objectsCmsException
- if something goes wrongpublic java.util.List<CmsResource> getResourcesForOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit) throws CmsException
dbc
- the current db contextorgUnit
- the organizational unit to get all resources forCmsResource
objects in the organizational unitCmsException
- if operation was not successfulCmsOrgUnitManager.getResourcesForOrganizationalUnit(CmsObject, String)
,
CmsOrgUnitManager.getUsers(CmsObject, String, boolean)
,
CmsOrgUnitManager.getGroups(CmsObject, String, boolean)
public java.util.Set<CmsResource> 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 attributesCmsResource
objectsCmsException
- if something goes wrongpublic java.util.List<CmsRewriteAlias> getRewriteAliases(CmsDbContext dbc, CmsRewriteAliasFilter filter) throws CmsException
dbc
- the current database contextfilter
- the filter used for filtering rewrite aliasesCmsException
- if something goes wrongpublic java.util.Set<CmsGroup> getRoleGroups(CmsDbContext dbc, java.lang.String roleGroupName, boolean directUsersOnly) throws CmsException
dbc
- the database contextroleGroupName
- the group related to the roledirectUsersOnly
- if true, only the group belonging to the entry itself wilCmsException
- if something goes wrongpublic java.util.Set<CmsGroup> getRoleGroupsImpl(CmsDbContext dbc, java.lang.String roleGroupName, boolean directUsersOnly, java.util.Map<java.lang.String,java.util.Set<CmsGroup>> accumulator) throws CmsException
dbc
- the database contextroleGroupName
- the group related to the roledirectUsersOnly
- if true, only the group belonging to the entry itself wilaccumulator
- a map for memoizing return values of recursive callsCmsException
- if something goes wrongpublic java.util.List<CmsRole> getRolesForResource(CmsDbContext dbc, CmsUser user, CmsResource resource) throws CmsException
dbc
- the current database contextuser
- the user to checkresource
- the resource to check the roles forCmsRole
objectsCmsException
- if something goes wrongpublic java.util.List<CmsRole> getRolesForUser(CmsDbContext dbc, CmsUser user) throws CmsException
dbc
- the current database contextuser
- the user to checkCmsRole
objectsCmsException
- if something goes wrongpublic CmsSecurityManager getSecurityManager()
public CmsSqlManager getSqlManager()
public I_CmsSubscriptionDriver getSubscriptionDriver()
public I_CmsUserDriver getUserDriver()
public I_CmsUserDriver getUserDriver(CmsDbContext dbc)
dbc
- the database contextpublic 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 founddefaultDriver
if none were foundpublic java.util.List<CmsUser> 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 tooCmsUser
objects in the organizational unitCmsException
- if operation was not successfulCmsOrgUnitManager.getResourcesForOrganizationalUnit(CmsObject, String)
,
CmsOrgUnitManager.getUsers(CmsObject, String, boolean)
public java.util.List<CmsUser> 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 groupsCmsUser
objects in the groupCmsException
- if operation was not successfulpublic java.util.List<CmsResource> getUsersPubList(CmsDbContext dbc, CmsUUID userId) throws CmsDataAccessException
dbc
- the database contextuserId
- the user's idCmsDataAccessException
- if something goes wrongpublic java.util.List<CmsUser> getUsersWithoutAdditionalInfo(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 tooCmsUser
objects in the organizational unitCmsException
- if operation was not successfulCmsOrgUnitManager.getResourcesForOrganizationalUnit(CmsObject, String)
,
CmsOrgUnitManager.getUsers(CmsObject, String, boolean)
public I_CmsVfsDriver getVfsDriver()
public I_CmsVfsDriver getVfsDriver(CmsDbContext dbc)
dbc
- the database contextpublic void importAccessControlEntries(CmsDbContext dbc, CmsResource resource, java.util.List<CmsAccessControlEntry> 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
objectsCmsException
- if something goes wrongpublic CmsAliasImportResult importRewriteAlias(CmsDbContext dbc, java.lang.String siteRoot, java.lang.String source, java.lang.String target, CmsAliasMode mode) throws CmsException
dbc
- the database contextsiteRoot
- the site root of the aliassource
- the source of the aliastarget
- the target of the aliasmode
- the alias modeCmsException
- 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<java.lang.String,java.lang.Object> additionalInfos) throws CmsException
dbc
- the current database contextid
- the id of the username
- the new name for the userpassword
- the new password for the user (already encrypted)firstname
- 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 infosCmsException
- if something goes wrongpublic int incrementCounter(CmsDbContext dbc, java.lang.String name) throws CmsException
dbc
- the current database contextname
- the name of the counter which should be incrementedCmsException
- if something goes wrongpublic void init(CmsConfigurationManager configurationManager, I_CmsDbContextFactory dbContextFactory) throws CmsException, java.lang.Exception
configurationManager
- the configuration managerdbContextFactory
- the db context factoryCmsException
- if something goes wrongjava.lang.Exception
- if something goes wrongpublic void initOrgUnit(CmsDbContext dbc, CmsOrganizationalUnit ou)
dbc
- the DB contextou
- the organizational unitpublic 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 isSubscriptionDriverAvailable()
public boolean isTempfileProject(CmsProject project)
project
- the project to testpublic 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)true
if the flag should be set for the resource, otherwise false
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 resourceCmsException
- 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 lockCmsException
- if something goes wrongCmsObject.lockResource(String)
,
CmsObject.lockResourceTemporary(String)
,
I_CmsResourceType.lockResource(CmsObject, CmsSecurityManager, CmsResource, CmsLockType)
public void log(CmsDbContext dbc, CmsLogEntry logEntry, boolean force)
This operation works only on memory, to get the log entries actually
written to DB you have to call the updateLog(CmsDbContext)
method.
dbc
- the current database contextlogEntry
- the log entry to createforce
- forces the log entry to be counted,
if not only the first log entry in a transaction will be taken into accountpublic 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 requestCmsAuthentificationException
- if the login was not successfulCmsDataAccessException
- in case of errors accessing the databaseCmsPasswordEncryptionException
- 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 lookupnull
public I_CmsPrincipal lookupPrincipal(CmsDbContext dbc, java.lang.String principalName)
dbc
- the current database contextprincipalName
- the name of the principal to lookupnull
public void markResourceAsVisitedBy(CmsDbContext dbc, java.lang.String poolName, CmsResource resource, CmsUser user) throws CmsException
dbc
- the database contextpoolName
- the name of the database pool to useresource
- the resource to mark as visiteduser
- the user that visited the resourceCmsException
- if something goes wrongpublic 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 modifiedCmsException
- 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 performedCmsException
- if something goes wrongCmsIllegalArgumentException
- if the resourcename
argument is null or of length 0CmsObject.moveToLostAndFound(String)
,
CmsObject.getLostAndFoundName(String)
public java.lang.Object newDriverInstance(CmsDbContext dbc, CmsConfigurationManager configurationManager, java.lang.String driverName, java.util.List<java.lang.String> successiveDrivers) throws CmsInitException
dbc
- the database contextconfigurationManager
- the configuration managerdriverName
- the driver namesuccessiveDrivers
- the list of successive driversCmsInitException
- if the selected driver could not be initializedpublic java.lang.Object newDriverInstance(CmsParameterConfiguration configuration, java.lang.String driverName, java.lang.String driverPoolUrl) throws CmsException
configuration
- the configurations from the propertyfiledriverName
- the class name of the driverdriverPoolUrl
- the pool url for the driverCmsException
- if something goes wrongpublic void newPoolInstance(CmsParameterConfiguration configuration, java.lang.String poolName) throws CmsInitException
configuration
- the configurations from the propertyfilepoolName
- the configuration name of the poolCmsInitException
- 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 toCmsException
- 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 messagesCmsException
- if something goes wrongfillPublishList(CmsDbContext, CmsPublishList)
public void publishUrlNameMapping(CmsDbContext dbc, CmsResource res) throws CmsDataAccessException
dbc
- the current database contextres
- the resource whose new URL name mappings should be transferred to the online projectCmsDataAccessException
- if something goes wrongpublic CmsAccessControlEntry readAccessControlEntry(CmsDbContext dbc, CmsResource resource, CmsUUID principal) throws CmsException
The access control entries of a resource are readable by everyone.
dbc
- the current database contextresource
- the resourceprincipal
- the id of a group or a user any other entityCmsException
- if something goes wrongpublic CmsAlias readAliasByPath(CmsDbContext dbc, CmsProject project, java.lang.String siteRoot, java.lang.String path) throws CmsException
If no alias is found, null is returned.
dbc
- the current database contextproject
- the current projectsiteRoot
- the site rootpath
- the path of the aliasCmsException
- if something goes wrongpublic java.util.List<CmsAlias> readAliasesBySite(CmsDbContext dbc, CmsProject currentProject, java.lang.String siteRoot) throws CmsException
dbc
- the current database contextcurrentProject
- the current projectsiteRoot
- the site rootCmsException
- if something goes wrongpublic java.util.List<CmsAlias> readAliasesByStructureId(CmsDbContext dbc, CmsProject project, CmsUUID structureId) throws CmsException
dbc
- the current database contextproject
- the current projectstructureId
- the structure id for which we want to read the aliasesCmsException
- if something goes wrongpublic java.util.List<I_CmsHistoryResource> readAllAvailableVersions(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource to read the history forI_CmsHistoryResource
objectsCmsException
- if something goes wrongpublic java.util.List<CmsPropertyDefinition> readAllPropertyDefinitions(CmsDbContext dbc) throws CmsException
dbc
- the current database contextCmsPropertyDefinition
objects (may be empty)CmsException
- if something goes wrongpublic java.util.List<CmsResource> readAllSubscribedResources(CmsDbContext dbc, java.lang.String poolName, CmsPrincipal principal) throws CmsException
dbc
- the database contextpoolName
- the name of the database pool to useprincipal
- the principal to read the subscribed resourcesCmsException
- if something goes wrongpublic java.lang.String readBestUrlName(CmsDbContext dbc, CmsUUID id, java.util.Locale locale, java.util.List<java.util.Locale> defaultLocales) throws CmsDataAccessException
dbc
- the database contextid
- the resource's structure idlocale
- the requested localedefaultLocales
- the default locales to use if the locale isn't availableCmsDataAccessException
- if the database operation failedpublic java.util.List<CmsResource> 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 permissionsCmsException
- if something goes wrongpublic CmsResource readDefaultFile(CmsDbContext dbc, CmsResource resource, CmsResourceFilter resourceFilter)
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 forresourceFilter
- the resource filterpublic java.util.List<I_CmsHistoryResource> 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 roleI_CmsHistoryResource
objectsCmsException
- 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 readingCmsDataAccessException
- 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 frompublic CmsGroup readGroup(CmsDbContext dbc, CmsUUID groupId) throws CmsException
dbc
- the current database contextgroupId
- the id of the group that is to be readCmsException
- 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 readCmsDataAccessException
- if operation was not successfulpublic CmsHistoryPrincipal readHistoricalPrincipal(CmsDbContext dbc, CmsUUID principalId) throws CmsException
dbc
- the current database contextprincipalId
- the id of the principal to readCmsException
- 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 idCmsException
- if something goes wrongpublic CmsHistoryProject readHistoryProject(CmsDbContext dbc, int publishTag) throws CmsException
dbc
- the current database contextpublishTag
- the publish tag of the projectCmsException
- if something goes wrongpublic java.util.List<CmsProperty> 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 forCmsProperty
objectsCmsException
- if something goes wrongpublic CmsUUID readIdForUrlName(CmsDbContext dbc, java.lang.String name) throws CmsDataAccessException
dbc
- the current database contextname
- the name for which the mapped structure id should be looked upCmsDataAccessException
- if something goes wrongpublic void readLocks(CmsDbContext dbc) throws CmsException
dbc
- the current database contextCmsException
- if something goes wrongpublic CmsGroup readManagerGroup(CmsDbContext dbc, CmsProject project)
dbc
- the current database contextproject
- the project to read frompublic java.lang.String readNewestUrlNameForId(CmsDbContext dbc, CmsUUID id) throws CmsDataAccessException
dbc
- the current database contextid
- a structure idCmsDataAccessException
- if something goes wrongpublic 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 readCmsException
- if something goes wrongpublic CmsUser readOwner(CmsDbContext dbc, CmsProject project) throws CmsException
dbc
- the current database contextproject
- the project to get the owner fromCmsException
- if something goes wrongpublic CmsResource readParentFolder(CmsDbContext dbc, CmsUUID structureId) throws CmsDataAccessException
dbc
- the current database contextstructureId
- the structure id of the childCmsDataAccessException
- if something goes wrongpublic java.util.List<CmsResource> 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
sCmsException
- if something goes wrongpublic CmsProject readProject(CmsDbContext dbc, CmsUUID id) throws CmsDataAccessException
dbc
- the current database contextid
- the id of the projectCmsDataAccessException
- 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 projectCmsException
- if something goes wrongpublic java.util.List<java.lang.String> readProjectResources(CmsDbContext dbc, CmsProject project) throws CmsException
dbc
- the current database contextproject
- the project to get the project resources forString
objects
that define the "view" of the given project.CmsException
- if something goes wrongpublic java.util.List<CmsResource> 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 projectdbc
- the current database contextprojectId
- the id of the project to read the file resources forstate
- the resource state to matchCmsResource
objects matching the filter criteriaCmsException
- 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 readCmsException
- 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 foundCmsException
- if something goes wrongpublic java.util.List<CmsProperty> 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 resourceCmsException
- if something goes wrongCmsObject.readPropertyObjects(String, boolean)
public java.util.List<CmsPublishedResource> readPublishedResources(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException
dbc
- the current database contextpublishHistoryId
- unique int ID to identify each publish task in the publish historyCmsPublishedResource
objectsCmsException
- 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 historyCmsPublishJobInfoBean
CmsException
- if something goes wrongpublic java.util.List<CmsPublishJobInfoBean> 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 timeCmsPublishJobInfoBean
CmsException
- if something goes wrongpublic CmsPublishList readPublishList(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException
dbc
- the current database contextpublishHistoryId
- the history id identifying the publish jobCmsException
- if something goes wrongpublic byte[] readPublishReportContents(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException
dbc
- the current database contextpublishHistoryId
- the history id identifying the publish jobCmsException
- 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 retrieveCmsException
- 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 readingCmsDataAccessException
- 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 readingCmsDataAccessException
- if something goes wrongCmsObject.readResource(String, CmsResourceFilter)
,
CmsObject.readResource(String)
,
CmsObject.readFile(CmsResource)
public java.util.List<CmsResource> 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 subresourcesCmsResource
objects matching the filter criteriaCmsDataAccessException
- if the bare reading of the resources failsCmsException
- if security and permission checks for the resources read failpublic java.util.List<CmsResource> readResourcesVisitedBy(CmsDbContext dbc, java.lang.String poolName, CmsVisitedByFilter filter) throws CmsException
dbc
- the database contextpoolName
- the name of the database pool to usefilter
- the filter that is used to get the visited resourcesCmsException
- if something goes wrongpublic java.util.List<CmsResource> 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 setCmsResource
objects
that have a value set for the specified property.CmsException
- if something goes wrongpublic java.util.Set<I_CmsPrincipal> readResponsiblePrincipals(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource to get the responsible users fromCmsException
- if something goes wrongpublic java.util.Set<CmsUser> readResponsibleUsers(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource to get the responsible users fromCmsException
- if something goes wrongpublic java.util.List<CmsResource> 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 objectCmsResource
Objects that
are siblings to the specified resource,
including the specified resource itselfCmsException
- 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 resourceCmsException
- if something goes wrongpublic java.util.List<java.lang.String> 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 dbString
objectsCmsException
- if something goes wrongpublic java.util.List<I_CmsHistoryResource> readSubscribedDeletedResources(CmsDbContext dbc, java.lang.String poolName, CmsUser user, java.util.List<CmsGroup> groups, CmsResource parent, boolean includeSubFolders, long deletedFrom) throws CmsException
dbc
- the database contextpoolName
- the name of the database pool to useuser
- the user that subscribed to the resourcegroups
- the groups to check subscribed resources forparent
- the parent resource (folder) of the deleted resources, if null
all deleted resources will be returnedincludeSubFolders
- indicates if the sub folders of the specified folder path should be considered, toodeletedFrom
- the time stamp from which the resources should have been deletedCmsException
- if something goes wrongpublic java.util.List<CmsResource> readSubscribedResources(CmsDbContext dbc, java.lang.String poolName, CmsSubscriptionFilter filter) throws CmsException
dbc
- the database contextpoolName
- the name of the database pool to usefilter
- the filter that is used to get the subscribed resourcesCmsException
- if something goes wrongpublic java.util.List<CmsUrlNameMappingEntry> readUrlNameMappingEntries(CmsDbContext dbc, boolean online, CmsUrlNameMappingFilter filter) throws CmsDataAccessException
dbc
- the database contextonline
- if true, read online URL name mappings, else offline onesfilter
- the filter for matching the URL name entriesCmsDataAccessException
- if something goes wrongpublic java.util.List<CmsUrlNameMappingEntry> readUrlNameMappings(CmsDbContext dbc, CmsUrlNameMappingFilter filter) throws CmsDataAccessException
dbc
- the DB context to usefilter
- the filter used to select the mapping entriesCmsDataAccessException
- if something goes wrongpublic java.util.List<java.lang.String> readUrlNamesForAllLocales(CmsDbContext dbc, CmsUUID id) throws CmsDataAccessException
dbc
- the database contextid
- the resource's structure idCmsDataAccessException
- if the database operation failedpublic CmsUser readUser(CmsDbContext dbc, CmsUUID id) throws CmsException
dbc
- the current database contextid
- the id of the user to readCmsException
- 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 readCmsDataAccessException
- 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 readCmsException
- 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 forCmsException
- 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 unitCmsException
- 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 toCmsException
- if something goes wrongCmsObject.copyResourceToProject(String)
,
I_CmsResourceType.copyResourceToProject(CmsObject, CmsSecurityManager, CmsResource)
public void removeResourceFromUsersPubList(CmsDbContext dbc, CmsUUID userId, java.util.Collection<CmsUUID> structureIds) throws CmsDataAccessException
dbc
- the database contextuserId
- the user's idstructureIds
- the collection of structure IDs to removeCmsDataAccessException
- if something goes wrongpublic 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 groupsCmsException
- if operation was not successfulCmsIllegalArgumentException
- if the given user was not member in the given groupCmsDbEntryNotFoundException
- if the given group was not foundCmsSecurityException
- 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 forCmsException
- if something goes wrongpublic void replaceResource(CmsDbContext dbc, CmsResource resource, int type, byte[] content, java.util.List<CmsProperty> 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 resourceCmsException
- 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 passwordCmsException
- if the user data could not be read from the databaseCmsSecurityException
- 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 restoreCmsException
- 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 archiveCmsException
- if something goes wrongCmsObject.restoreResourceVersion(CmsUUID, int)
,
I_CmsResourceType.restoreResource(CmsObject, CmsSecurityManager, CmsResource, int)
public void saveAliases(CmsDbContext dbc, CmsProject project, CmsUUID structureId, java.util.List<CmsAlias> aliases) throws CmsException
dbc
- the current database contextproject
- the current projectstructureId
- the structure id for which the aliases should be savedaliases
- the list of aliases to saveCmsException
- if something goes wrongpublic void saveRewriteAliases(CmsDbContext dbc, java.lang.String siteRoot, java.util.List<CmsRewriteAlias> newAliases) throws CmsException
dbc
- the current database contextsiteRoot
- the site root for which the rewrite aliases should be replacednewAliases
- the new aliases for the given site rootCmsException
- if something goes wrongpublic java.util.List<CmsUser> searchUsers(CmsDbContext dbc, CmsUserSearchParameters searchParams) throws CmsDataAccessException
dbc
- the database contextsearchParams
- the search criteriaCmsDataAccessException
- if something goes wrongpublic 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 resourceCmsDataAccessException
- 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 resourceCmsDataAccessException
- 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 resourceCmsDataAccessException
- 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 successfulCmsDataAccessException
- 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 passwordCmsException
- if operation was not successfulCmsIllegalArgumentException
- if the user with the username
was not foundpublic void setSubscribedResourceAsDeleted(CmsDbContext dbc, java.lang.String poolName, CmsResource resource) throws CmsException
dbc
- the database contextpoolName
- the name of the database pool to useresource
- the subscribed resource to mark as deletedCmsException
- if something goes wrongpublic void setUsersOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsUser user) throws CmsException
dbc
- the current db contextorgUnit
- the organizational unit to add the resource touser
- the user that is to be moved to the organizational unitCmsException
- if something goes wrongCmsOrgUnitManager.setUsersOrganizationalUnit(CmsObject, String, String)
public void subscribeResourceFor(CmsDbContext dbc, java.lang.String poolName, CmsPrincipal principal, CmsResource resource) throws CmsException
dbc
- the database contextpoolName
- the name of the database pool to useprincipal
- the principal that subscribes to the resourceresource
- the resource to subscribe toCmsException
- if something goes wrongpublic void undelete(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the name of the resource to apply this operation toCmsException
- 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 levelCmsException
- 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 locksCmsException
- if something goes wrongCmsObject.unlockResource(String)
,
I_CmsResourceType.unlockResource(CmsObject, CmsSecurityManager, CmsResource)
public void unsubscribeAllDeletedResources(CmsDbContext dbc, java.lang.String poolName, long deletedTo) throws CmsException
dbc
- the database contextpoolName
- the name of the database pool to usedeletedTo
- the time stamp to which the resources have been deletedCmsException
- if something goes wrongpublic void unsubscribeAllResourcesFor(CmsDbContext dbc, java.lang.String poolName, CmsPrincipal principal) throws CmsException
dbc
- the database contextpoolName
- the name of the database pool to useprincipal
- the principal that unsubscribes from all resourcesCmsException
- if something goes wrongpublic void unsubscribeResourceFor(CmsDbContext dbc, java.lang.String poolName, CmsPrincipal principal, CmsResource resource) throws CmsException
dbc
- the database contextpoolName
- the name of the database pool to useprincipal
- the principal that unsubscribes from the resourceresource
- the resource to unsubscribe fromCmsException
- if something goes wrongpublic void unsubscribeResourceForAll(CmsDbContext dbc, java.lang.String poolName, CmsResource resource) throws CmsException
dbc
- the database contextpoolName
- the name of the database pool to useresource
- the resource to unsubscribe all groups and users fromCmsException
- if something goes wrongpublic void updateExportPoints(CmsDbContext dbc)
All files and folders "inside" an export point are written.
dbc
- the current database contextpublic void updateLastLoginDate(CmsDbContext dbc, CmsUser user) throws CmsException
dbc
- the current database contextuser
- the user to be updatedCmsException
- if operation was not successfulpublic void updateLog(CmsDbContext dbc) throws CmsDataAccessException
dbc
- the current db contextCmsDataAccessException
- if something goes wrongpublic void updateRelationsForResource(CmsDbContext dbc, CmsResource resource, java.util.List<CmsLink> links) throws CmsException
dbc
- the db contextresource
- the resource to update the relations forlinks
- the links to consider for updatingCmsException
- 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 groupstrue
, if the user is in the group, false
otherwiseCmsException
- 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 checkedCmsSecurityException
- if the password is not validpublic java.util.Map<java.lang.String,java.util.List<CmsRelation>> 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 toCmsRelation
}
objects)
keyed by root pathsjava.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 writeCmsException
- 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 toCmsException
- 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 writtenCmsException
- 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 publishingCmsDataAccessException
- 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 contextCmsException
- 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 writtenCmsException
- 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 writtenCmsException
- if operation was not successfulpublic void writeProjectLastModified(CmsDbContext dbc, CmsResource resource, CmsUUID projectId) throws CmsDataAccessException
dbc
- the current database contextresource
- the resource which should be modifiedprojectId
- the project id to writeCmsDataAccessException
- if the database access failspublic 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 writeCmsException
- if something goes wrongCmsObject.writePropertyObject(String, CmsProperty)
,
I_CmsResourceType.writePropertyObject(CmsObject, CmsSecurityManager, CmsResource, CmsProperty)
public void writePropertyObjects(CmsDbContext dbc, CmsResource resource, java.util.List<CmsProperty> 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 updatedCmsException
- 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 updateCmsException
- if something goes wrongpublic void writePublishReport(CmsDbContext dbc, CmsPublishJobInfoBean publishJob) throws CmsException
dbc
- the current database contextpublishJob
- the publish jobCmsException
- if something goes wrongpublic void writeResource(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource to writeCmsException
- 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 dbCmsException
- if something goes wrongpublic java.lang.String writeUrlNameMapping(CmsDbContext dbc, java.util.Iterator<java.lang.String> nameSeq, CmsUUID structureId, java.lang.String locale, boolean replaceOnPublish) throws CmsDataAccessException
Instead of taking the name directly, this method takes an iterator of strings which generates candidate URL names on-the-fly. The first generated name which is not already mapped to another structure id will be chosen for the new URL name mapping.
dbc
- the current database contextnameSeq
- the sequence of URL name candidatesstructureId
- the structure id to which the url name should be mappedlocale
- the locale for which the mapping should be writtenreplaceOnPublish
- name mappings for which this is set will replace all other mappings for the same resource on publishingCmsDataAccessException
- 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 updatedCmsException
- if operation was not successfulprotected void addOrReplaceUrlNameMapping(CmsDbContext dbc, java.lang.String name, CmsUUID structureId, java.lang.String locale, boolean replaceOnPublish) throws CmsDataAccessException
dbc
- the current database contextname
- the URL name of the mappingstructureId
- the structure id of the mappinglocale
- the locale of the mappingreplaceOnPublish
- if the mapping shoudl replace previous URL name mappings when publishedCmsDataAccessException
- if something goes wrongprotected CmsFolder convertResourceToFolder(CmsResource resource) throws CmsVfsResourceNotFoundException
resource
- the resource to convertCmsVfsResourceNotFoundException
- if the resource is not a folderprotected java.lang.Object createDriver(CmsDbContext dbc, CmsConfigurationManager configManager, CmsParameterConfiguration config, java.lang.String driverChainKey, java.lang.String suffix)
dbc
- the db contextconfigManager
- the configuration managerconfig
- the configurationdriverChainKey
- the configuration key under which the driver chain is storedsuffix
- the suffix to append to a driver chain entry to get the key for the driver classprotected void deleteRelationsWithSiblings(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc
- the current database contextresource
- the resource to delete the resource forCmsException
- if something goes wrongprotected void ensureSubResourcesOfMovedFoldersPublished(CmsObject cms, CmsDbContext dbc, CmsPublishList pubList) throws CmsException
cms
- the current CMS contextdbc
- the current database contextpubList
- the publish listCmsException
- if something goes wrongprotected java.lang.String findBestNameForUrlNameMapping(CmsDbContext dbc, java.util.Iterator<java.lang.String> nameSeq, CmsUUID structureId, java.lang.String locale) throws CmsDataAccessException
dbc
- the database contextnameSeq
- the sequence of name candidatesstructureId
- the structure id to which an URL name should be mappedlocale
- the locale for which the URL name should be mappedCmsDataAccessException
- if something goes wrongprotected java.lang.String findBestNameForUrlNameMapping(CmsDbContext dbc, java.lang.String name, CmsUUID structureId) throws CmsDataAccessException
Since the name given as a parameter may be already used, this method will try to append numeric suffixes to the name to find a mapping name which is not used.
dbc
- the current database contextname
- the name of the mappingstructureId
- the structure id to which the name is mappedCmsDataAccessException
- if something goes wrongprotected CmsLockManager getLockManager()
protected java.lang.String getNumberedName(java.lang.String name, int number)
name
- the base namenumber
- the number from which to form the suffixprotected void resetResourcesInProject(CmsDbContext dbc, CmsUUID projectId, java.util.List<CmsResource> modifiedFiles, java.util.List<CmsResource> modifiedFolders) throws CmsException, CmsSecurityException, CmsDataAccessException
dbc
- the database contextprojectId
- the project idmodifiedFiles
- the modified filesmodifiedFolders
- the modified foldersCmsException
- if something goes wrongCmsSecurityException
- if we don't have the permissionsCmsDataAccessException
- if something goes wrong with the database