| java.lang.Object org.opencms.db.CmsDriverManager
CmsDriverManager | final public class CmsDriverManager implements I_CmsEventListener(Code) | | The OpenCms driver manager.
author: Alexander Kandzior author: Thomas Weckert author: Carsten Weinholz author: Michael Emmerich author: Michael Moossen since: 6.0.0 |
Method Summary | |
public void | addRelationToResource(CmsDbContext dbc, CmsResource resource, CmsResource target, CmsRelationType type, boolean importCase) | public void | addResourceToOrgUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsResource resource) | public void | addUserToGroup(CmsDbContext dbc, String username, String groupname, boolean readRoles) | public void | changeLock(CmsDbContext dbc, CmsResource resource, CmsLockType lockType) | public List | changeResourcesInFolderWithProperty(CmsDbContext dbc, CmsResource resource, String propertyDefinition, String oldValue, 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.
Parameters: dbc - the current database context Parameters: resource - the resource on which property definition values are changed Parameters: propertyDefinition - the name of the propertydefinition to change the value Parameters: oldValue - the old value of the propertydefinition Parameters: newValue - the new value of the propertydefinition Parameters: recursive - if true, change recursively all property values on sub-resources (only for folders) a list with the CmsResource 's where the property value has been changed throws: CmsVfsException - for now only when the search for the oldvalue failed. | public void | chflags(CmsDbContext dbc, CmsResource resource, int flags) Changes the resource flags of a resource.
The resource flags are used to indicate various "special" conditions
for a resource. | public void | chtype(CmsDbContext dbc, CmsResource resource, int type) Changes the resource type of a resource.
OpenCms handles resources according to the resource type,
not the file suffix. | public void | cmsEvent(CmsEvent event) | protected CmsFolder | convertResourceToFolder(CmsResource resource) | public void | copyAccessControlEntries(CmsDbContext dbc, CmsResource source, CmsResource destination, boolean updateLastModifiedInfo) | public void | copyResource(CmsDbContext dbc, CmsResource source, String destination, CmsResource.CmsResourceCopyMode siblingMode) Copies a resource.
You must ensure that the destination path is an absolute, valid and
existing VFS path. | public void | copyResourceToProject(CmsDbContext dbc, CmsResource resource) | public int | countLockedResources(CmsProject project) | public CmsGroup | createGroup(CmsDbContext dbc, CmsUUID id, String name, String description, int flags, String parent) Add a new group to the Cms.
Only the admin can do this. | public CmsOrganizationalUnit | createOrganizationalUnit(CmsDbContext dbc, String ouFqn, String description, int flags, CmsResource resource) | public CmsProject | createProject(CmsDbContext dbc, String name, String description, String groupname, String managergroupname, CmsProject.CmsProjectType projecttype) | public CmsPropertyDefinition | createPropertyDefinition(CmsDbContext dbc, String name) | public void | createPublishJob(CmsDbContext dbc, CmsPublishJobInfoBean publishJob) | public synchronized CmsResource | createResource(CmsDbContext dbc, String resourcePath, CmsResource resource, byte[] content, List properties, boolean importCase) Creates a new resource with the provided content and properties.
The content parameter may be null if the resource id
already exists. | public CmsResource | createResource(CmsDbContext dbc, String resourcename, int type, byte[] content, List properties) | public CmsResource | createSibling(CmsDbContext dbc, CmsResource source, String destination, List properties) | public CmsProject | createTempfileProject(CmsDbContext dbc) | public CmsUser | createUser(CmsDbContext dbc, String name, String password, String description, Map additionalInfos) | public void | deleteAllProperties(CmsDbContext dbc, String resourcename) Deletes all property values of a file or folder.
If there are no other siblings than the specified resource,
both the structure and resource property values get deleted. | public void | deleteAllStaticExportPublishedResources(CmsDbContext dbc, int linkType) | public void | deleteGroup(CmsDbContext dbc, CmsGroup group, CmsUUID replacementId) | public void | deleteHistoricalVersions(CmsDbContext dbc, CmsFolder folder, int versionsToKeep, int versionsDeleted, long timeDeleted, I_CmsReport report) | public void | deleteOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit organizationalUnit) | public void | deleteProject(CmsDbContext dbc, CmsProject deleteProject) Deletes a project.
Only the admin or the owner of the project can do this. | public void | deletePropertyDefinition(CmsDbContext dbc, String name) | public void | deletePublishJob(CmsDbContext dbc, CmsUUID publishHistoryId) | public void | deletePublishList(CmsDbContext dbc, CmsUUID publishHistoryId) | public void | deleteRelationsForResource(CmsDbContext dbc, CmsResource resource, CmsRelationFilter filter) | protected void | deleteRelationsWithSiblings(CmsDbContext dbc, CmsResource resource) | public void | deleteResource(CmsDbContext dbc, CmsResource resource, CmsResource.CmsResourceDeleteMode siblingMode) Deletes a resource.
The siblingMode parameter controls how to handle siblings
during the delete operation. | public void | deleteStaticExportPublishedResource(CmsDbContext dbc, String resourceName, int linkType, String linkParameter) | public void | deleteUser(CmsDbContext dbc, CmsProject project, String username, String replacementUsername) | public void | destroy() | public boolean | existsResourceId(CmsDbContext dbc, CmsUUID resourceId) | public void | fillPublishList(CmsDbContext dbc, CmsPublishList publishList) | public List | getAccessControlEntries(CmsDbContext dbc, CmsResource resource, boolean getInherited) | public CmsAccessControlList | getAccessControlList(CmsDbContext dbc, CmsResource resource) | public CmsAccessControlList | getAccessControlList(CmsDbContext dbc, CmsResource resource, boolean inheritedOnly) Returns the access control list of a given resource.
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. | public int | getActiveConnections(String dbPoolUrl) | public List | getAllAccessibleProjects(CmsDbContext dbc) | public List | getAllHistoricalProjects(CmsDbContext dbc) | public List | getAllManageableProjects(CmsDbContext dbc) | public List | getChildren(CmsDbContext dbc, CmsGroup group, boolean includeSubChildren) | public List | getGroups(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean includeSubOus, boolean readRoles) | public List | getGroupsOfUser(CmsDbContext dbc, String username, boolean readRoles) | public List | getGroupsOfUser(CmsDbContext dbc, String username, String ouFqn, boolean includeChildOus, boolean readRoles, boolean directGroupsOnly, String remoteAddress) | public I_CmsHistoryDriver | getHistoryDriver() | public int | getIdleConnections(String dbPoolUrl) | public CmsLock | getLock(CmsDbContext dbc, CmsResource resource) | protected CmsLockManager | getLockManager() | public List | getLockedResources(CmsDbContext dbc, CmsResource resource, CmsLockFilter filter) | public int | getNextPublishTag(CmsDbContext dbc) | public List | getOrgUnitsForRole(CmsDbContext dbc, CmsRole role, boolean includeSubOus) | public List | getOrganizationalUnits(CmsDbContext dbc, CmsOrganizationalUnit parent, boolean includeChildren) | public CmsGroup | getParent(CmsDbContext dbc, String groupname) | public CmsPermissionSetCustom | getPermissions(CmsDbContext dbc, CmsResource resource, CmsUser user) | public I_CmsProjectDriver | getProjectDriver() | public CmsUUID | getProjectId(CmsDbContext dbc, int id) | public ExtendedProperties | getPropertyConfiguration() | public CmsPublishList | getRelatedResourcesToPublish(CmsDbContext dbc, CmsPublishList publishList, CmsRelationFilter filter) | public List | getRelationsForResource(CmsDbContext dbc, CmsResource resource, CmsRelationFilter filter) | public List | getResourcesForOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit) | public List | getResourcesForPrincipal(CmsDbContext dbc, CmsProject project, CmsUUID principalId, CmsPermissionSet permissions, boolean includeAttr) | public List | getRolesForResource(CmsDbContext dbc, CmsUser user, CmsResource resource) | public List | getRolesForUser(CmsDbContext dbc, CmsUser user) | public CmsSecurityManager | getSecurityManager() | public CmsSqlManager | getSqlManager() | public I_CmsUserDriver | getUserDriver() | public List | getUsers(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean recursive) | public List | getUsersOfGroup(CmsDbContext dbc, String groupname, boolean includeOtherOuUsers, boolean directUsersOnly, boolean readRoles) Returns a list of users in a group.
Parameters: dbc - the current database context Parameters: groupname - the name of the group to list users from Parameters: includeOtherOuUsers - include users of other organizational units Parameters: directUsersOnly - if set only the direct assigned users will be returned, if not also indirect users, ie. | public I_CmsVfsDriver | getVfsDriver() | public void | importAccessControlEntries(CmsDbContext dbc, CmsResource resource, List acEntries) Writes a vector of access control entries as new access control entries of a given resource.
Already existing access control entries of this resource are removed before. | public CmsUser | importUser(CmsDbContext dbc, String id, String name, String password, String firstname, String lastname, String email, int flags, long dateCreated, Map additionalInfos) | public void | init(CmsConfigurationManager configurationManager) | public boolean | isInsideCurrentProject(CmsDbContext dbc, String resourcename) Checks if the specified resource is inside the current project.
The project "view" is determined by a set of path prefixes. | public boolean | isTempfileProject(CmsProject project) | public boolean | labelResource(CmsDbContext dbc, CmsResource resource, String newResource, int action) | public void | lockResource(CmsDbContext dbc, CmsResource resource, CmsLockType type) | public CmsUser | lockedBy(CmsDbContext dbc, CmsResource resource) Returns the user, who had locked the resource.
A user can lock a resource, so he is the only one who can write this
resource. | public CmsUser | loginUser(CmsDbContext dbc, String userName, String password, String remoteAddress) | public I_CmsPrincipal | lookupPrincipal(CmsDbContext dbc, CmsUUID principalId) | public I_CmsPrincipal | lookupPrincipal(CmsDbContext dbc, String principalName) | public void | moveResource(CmsDbContext dbc, CmsResource source, String destination, boolean internal) Moves a resource.
You must ensure that the parent of the destination path is an absolute, valid and
existing VFS path. | public String | moveToLostAndFound(CmsDbContext dbc, CmsResource resource, boolean returnNameOnly) Moves a resource to the "lost and found" folder.
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. | public Object | newDriverInstance(CmsConfigurationManager configurationManager, String driverName, List successiveDrivers) | public Object | newDriverInstance(ExtendedProperties configuration, String driverName, String driverPoolUrl) | public static CmsDriverManager | newInstance(CmsConfigurationManager configurationManager, CmsSecurityManager securityManager, I_CmsDbContextFactory runtimeInfoFactory, CmsPublishEngine publishEngine) | public void | newPoolInstance(Map configuration, String poolName) | public void | publishJob(CmsObject cms, CmsDbContext dbc, CmsPublishList publishList, I_CmsReport report) | public synchronized void | publishProject(CmsObject cms, CmsDbContext dbc, CmsPublishList publishList, I_CmsReport report) | public CmsAccessControlEntry | readAccessControlEntry(CmsDbContext dbc, CmsResource resource, CmsUUID principal) Reads an access control entry from the cms.
The access control entries of a resource are readable by everyone. | public List | readAllAvailableVersions(CmsDbContext dbc, CmsResource resource) Reads all versions of the given resource.
This method returns a list with the history of the given resource, i.e. | public List | readAllPropertyDefinitions(CmsDbContext dbc) | public List | readChildResources(CmsDbContext dbc, CmsResource resource, CmsResourceFilter filter, boolean getFolders, boolean getFiles, boolean checkPermissions) | public CmsResource | readDefaultFile(CmsDbContext dbc, CmsResource resource) | public List | readDeletedResources(CmsDbContext dbc, CmsResource resource, boolean readTree, boolean isVfsManager) | public CmsFile | readFile(CmsDbContext dbc, CmsResource resource) Reads a file resource (including it's binary content) from the VFS,
using the specified resource filter.
In case you do not need the file content,
use
CmsDriverManager.readResource(CmsDbContext,String,CmsResourceFilter) instead.
The specified filter controls what kind of resources should be "found"
during the read operation. | public CmsFolder | readFolder(CmsDbContext dbc, String resourcename, CmsResourceFilter filter) | public CmsGroup | readGroup(CmsDbContext dbc, CmsProject project) | public CmsGroup | readGroup(CmsDbContext dbc, CmsUUID groupId) | public CmsGroup | readGroup(CmsDbContext dbc, String groupname) | public CmsHistoryPrincipal | readHistoricalPrincipal(CmsDbContext dbc, CmsUUID principalId) Reads a principal (an user or group) from the historical archive based on its ID.
Parameters: dbc - the current database context Parameters: principalId - the id of the principal to read the historical principal entry with the given id throws: CmsException - if something goes wrong, ie. | public CmsHistoryProject | readHistoryProject(CmsDbContext dbc, int publishTag) | public List | readHistoryPropertyObjects(CmsDbContext dbc, I_CmsHistoryResource historyResource) | public void | readLocks(CmsDbContext dbc) | public CmsGroup | readManagerGroup(CmsDbContext dbc, CmsProject project) | public CmsOrganizationalUnit | readOrganizationalUnit(CmsDbContext dbc, String ouFqn) | public CmsUser | readOwner(CmsDbContext dbc, CmsProject project) | public List | readPath(CmsDbContext dbc, CmsUUID projectId, String path, CmsResourceFilter filter) | public CmsProject | readProject(CmsDbContext dbc, CmsUUID id) | public CmsProject | readProject(CmsDbContext dbc, String name) Reads a project.
Important: Since a project name can be used multiple times, this is NOT the most efficient
way to read the project. | public List | readProjectResources(CmsDbContext dbc, CmsProject project) | public List | readProjectView(CmsDbContext dbc, CmsUUID projectId, CmsResourceState state) | public CmsPropertyDefinition | readPropertyDefinition(CmsDbContext dbc, String name) | public CmsProperty | readPropertyObject(CmsDbContext dbc, CmsResource resource, String key, boolean search) Reads a property object from a resource specified by a property name.
Returns
CmsProperty.getNullProperty if the property is not found.
Parameters: dbc - the current database context Parameters: resource - the resource where the property is read from Parameters: key - the property key name Parameters: search - if true , the property is searched on all parent folders of the resource. | public List | readPropertyObjects(CmsDbContext dbc, CmsResource resource, boolean search) | public CmsPublishJobInfoBean | readPublishJob(CmsDbContext dbc, CmsUUID publishHistoryId) | public List | readPublishJobs(CmsDbContext dbc, long startTime, long endTime) | public CmsPublishList | readPublishList(CmsDbContext dbc, CmsUUID publishHistoryId) | public byte[] | readPublishReportContents(CmsDbContext dbc, CmsUUID publishHistoryId) | public List | readPublishedResources(CmsDbContext dbc, CmsUUID publishHistoryId) | public I_CmsHistoryResource | readResource(CmsDbContext dbc, CmsResource resource, int version) | public CmsResource | readResource(CmsDbContext dbc, CmsUUID structureID, CmsResourceFilter filter) | public CmsResource | readResource(CmsDbContext dbc, String resourcePath, CmsResourceFilter filter) | public I_CmsHistoryResource | readResourceForPublishTag(CmsDbContext dbc, CmsResource resource, int publishTag) | public List | readResources(CmsDbContext dbc, CmsResource parent, CmsResourceFilter filter, boolean readTree) | public List | readResourcesWithProperty(CmsDbContext dbc, CmsResource folder, String propertyDefinition, String value, CmsResourceFilter filter) | public Set | readResponsiblePrincipals(CmsDbContext dbc, CmsResource resource) | public Set | readResponsibleUsers(CmsDbContext dbc, CmsResource resource) | public List | readSiblings(CmsDbContext dbc, CmsResource resource, CmsResourceFilter filter) | public String | readStaticExportPublishedResourceParameters(CmsDbContext dbc, String rfsName) | public List | readStaticExportResources(CmsDbContext dbc, int parameterResources, long timestamp) | public CmsUser | readUser(CmsDbContext dbc, CmsUUID id) | public CmsUser | readUser(CmsDbContext dbc, String username) | public CmsUser | readUser(CmsDbContext dbc, String username, String password) | public void | removeAccessControlEntry(CmsDbContext dbc, CmsResource resource, CmsUUID principal) | public void | removeResourceFromOrgUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsResource resource) | public void | removeResourceFromProject(CmsDbContext dbc, CmsResource resource) | public void | removeUserFromGroup(CmsDbContext dbc, String username, String groupname, boolean readRoles) | public void | replaceResource(CmsDbContext dbc, CmsResource resource, int type, byte[] content, List properties) | public void | resetPassword(CmsDbContext dbc, String username, String oldPassword, String newPassword) | public void | restoreDeletedResource(CmsDbContext dbc, CmsUUID structureId) | public void | restoreResource(CmsDbContext dbc, CmsResource resource, int version) | public void | setDateExpired(CmsDbContext dbc, CmsResource resource, long dateExpired) | public void | setDateLastModified(CmsDbContext dbc, CmsResource resource, long dateLastModified) | public void | setDateReleased(CmsDbContext dbc, CmsResource resource, long dateReleased) | public void | setParentGroup(CmsDbContext dbc, String groupName, String parentGroupName) | public void | setPassword(CmsDbContext dbc, String username, String newPassword) | public void | setUsersOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsUser user) | public void | undelete(CmsDbContext dbc, CmsResource resource) | public void | undoChanges(CmsDbContext dbc, CmsResource resource, CmsResource.CmsResourceUndoMode mode) | public void | unlockProject(CmsProject project) | public void | unlockResource(CmsDbContext dbc, CmsResource resource, boolean force, boolean removeSystemLock) | public void | updateExportPoints(CmsDbContext dbc) | public void | updateRelationsForResource(CmsDbContext dbc, CmsResource resource, List links) | public boolean | userInGroup(CmsDbContext dbc, String username, String groupname, boolean readRoles) | public void | validatePassword(String password) | public Map | validateRelations(CmsDbContext dbc, CmsPublishList publishList, I_CmsReport report) | public void | writeAccessControlEntry(CmsDbContext dbc, CmsResource resource, CmsAccessControlEntry ace) | public void | writeExportPoints(CmsDbContext dbc, I_CmsReport report, CmsUUID publishHistoryId) | public CmsFile | writeFile(CmsDbContext dbc, CmsFile resource) Writes a resource to the OpenCms VFS, including it's content.
Applies only to resources of type
CmsFile
i.e. | public void | writeGroup(CmsDbContext dbc, CmsGroup group) | public void | writeHistoryProject(CmsDbContext dbc, int publishTag, long publishDate) | public void | writeLocks(CmsDbContext dbc) | public void | writeOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit organizationalUnit) | public void | writeProject(CmsDbContext dbc, CmsProject project) | public void | writePropertyObject(CmsDbContext dbc, CmsResource resource, CmsProperty property) | public void | writePropertyObjects(CmsDbContext dbc, CmsResource resource, List properties, boolean updateState) | public void | writePublishJob(CmsDbContext dbc, CmsPublishJobInfoBean publishJob) | public void | writePublishReport(CmsDbContext dbc, CmsPublishJobInfoBean publishJob) | public void | writeResource(CmsDbContext dbc, CmsResource resource) | public void | writeStaticExportPublishedResource(CmsDbContext dbc, String resourceName, int linkType, String linkParameter, long timestamp) | public void | writeUser(CmsDbContext dbc, CmsUser user) Updates the user information. |
CACHE_ALL_PROPERTIES | final public static String CACHE_ALL_PROPERTIES(Code) | | Cache key for all properties.
|
CHANGED_ACCESSCONTROL | final public static int CHANGED_ACCESSCONTROL(Code) | | Value to indicate a change in access control entries of a resource.
|
CHANGED_CONTENT | final public static int CHANGED_CONTENT(Code) | | Value to indicate a content change.
|
CHANGED_LASTMODIFIED | final public static int CHANGED_LASTMODIFIED(Code) | | Value to indicate a change in the lastmodified settings of a resource.
|
CHANGED_RESOURCE | final public static int CHANGED_RESOURCE(Code) | | Value to indicate a change in the resource data.
|
CHANGED_TIMEFRAME | final public static int CHANGED_TIMEFRAME(Code) | | Value to indicate a change in the availability timeframe.
|
CONFIGURATION_CACHE | final public static String CONFIGURATION_CACHE(Code) | | "cache" string in the configuration-file.
|
CONFIGURATION_DB | final public static String CONFIGURATION_DB(Code) | | "db" string in the configuration-file.
|
CONFIGURATION_HISTORY | final public static String CONFIGURATION_HISTORY(Code) | | "driver.history" string in the configuration-file.
|
CONFIGURATION_PROJECT | final public static String CONFIGURATION_PROJECT(Code) | | "driver.project" string in the configuration-file.
|
CONFIGURATION_USER | final public static String CONFIGURATION_USER(Code) | | "driver.user" string in the configuration-file.
|
CONFIGURATION_VFS | final public static String CONFIGURATION_VFS(Code) | | "driver.vfs" string in the configuration-file.
|
LOST_AND_FOUND_FOLDER | final public static String LOST_AND_FOUND_FOLDER(Code) | | The vfs path of the loast and found folder.
|
MAX_VFS_RESOURCE_PATH_LENGTH | final public static int MAX_VFS_RESOURCE_PATH_LENGTH(Code) | | The maximum length of a VFS resource path.
|
NOTHING_CHANGED | final public static int NOTHING_CHANGED(Code) | | Key for indicating no changes.
|
READMODE_EXCLUDE_STATE | final public static int READMODE_EXCLUDE_STATE(Code) | | Indicates to match resources NOT having the given state.
|
READMODE_EXCLUDE_TREE | final public static int READMODE_EXCLUDE_TREE(Code) | | Indicates to match immediate children only.
|
READMODE_EXCLUDE_TYPE | final public static int READMODE_EXCLUDE_TYPE(Code) | | Indicates to match resources NOT having the given type.
|
READMODE_IGNORESTATE | final public static int READMODE_IGNORESTATE(Code) | | Mode for reading project resources from the db.
|
READMODE_INCLUDE_PROJECT | final public static int READMODE_INCLUDE_PROJECT(Code) | | Indicates to match resources in given project only.
|
READMODE_INCLUDE_TREE | final public static int READMODE_INCLUDE_TREE(Code) | | Indicates to match all successors.
|
READMODE_MATCHSTATE | final public static int READMODE_MATCHSTATE(Code) | | Mode for reading project resources from the db.
|
READMODE_ONLY_FILES | final public static int READMODE_ONLY_FILES(Code) | | Indicates if only file resources should be read.
|
READMODE_ONLY_FOLDERS | final public static int READMODE_ONLY_FOLDERS(Code) | | Indicates if only folder resources should be read.
|
READMODE_UNMATCHSTATE | final public static int READMODE_UNMATCHSTATE(Code) | | Mode for reading project resources from the db.
|
READ_IGNORE_PARENT | final public static String READ_IGNORE_PARENT(Code) | | Indicates to ignore the resource path when matching resources.
|
READ_IGNORE_TIME | final public static long READ_IGNORE_TIME(Code) | | Indicates to ignore the time value.
|
READ_IGNORE_TYPE | final public static int READ_IGNORE_TYPE(Code) | | Indicates to ignore the resource type when matching resources.
|
TEMP_FILE_PREFIX | final public static String TEMP_FILE_PREFIX(Code) | | Prefix char for temporary files in the VFS.
|
UPDATE_ALL | final public static int UPDATE_ALL(Code) | | Key to indicate complete update.
|
UPDATE_RESOURCE | final public static int UPDATE_RESOURCE(Code) | | Key to indicate update of resource record.
|
UPDATE_RESOURCE_PROJECT | final public static int UPDATE_RESOURCE_PROJECT(Code) | | Key to indicate update of last modified project reference.
|
UPDATE_RESOURCE_STATE | final public static int UPDATE_RESOURCE_STATE(Code) | | Key to indicate update of resource state.
|
UPDATE_RESOURCE_STATE_CONTENT | final public static int UPDATE_RESOURCE_STATE_CONTENT(Code) | | Key to indicate update of resource state including the content date.
|
UPDATE_STRUCTURE | final public static int UPDATE_STRUCTURE(Code) | | Key to indicate update of structure record.
|
UPDATE_STRUCTURE_STATE | final public static int UPDATE_STRUCTURE_STATE(Code) | | Key to indicate update of structure state.
|
addRelationToResource | public void addRelationToResource(CmsDbContext dbc, CmsResource resource, CmsResource target, CmsRelationType type, boolean importCase) throws CmsException(Code) | | Adds a new relation to the given resource.
Parameters: dbc - the database context Parameters: resource - the resource to add the relation to Parameters: target - the target of the relation Parameters: type - the type of the relation Parameters: importCase - if importing relations throws: CmsException - if something goes wrong |
changeResourcesInFolderWithProperty | public List changeResourcesInFolderWithProperty(CmsDbContext dbc, CmsResource resource, String propertyDefinition, String oldValue, String newValue, boolean recursive) throws CmsVfsException, CmsException(Code) | | 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.
Parameters: dbc - the current database context Parameters: resource - the resource on which property definition values are changed Parameters: propertyDefinition - the name of the propertydefinition to change the value Parameters: oldValue - the old value of the propertydefinition Parameters: newValue - the new value of the propertydefinition Parameters: recursive - if true, change recursively all property values on sub-resources (only for folders) a list with the CmsResource 's where the property value has been changed throws: CmsVfsException - for now only when the search for the oldvalue failed. throws: CmsException - if operation was not successful |
chtype | public void chtype(CmsDbContext dbc, CmsResource resource, int type) throws CmsException(Code) | | Changes the resource type of a resource.
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.
Parameters: dbc - the current database context Parameters: resource - the resource to change the type for Parameters: type - the new resource type for this resource throws: CmsException - if something goes wrong See Also: CmsObject.chtype(Stringint) See Also: I_CmsResourceType.chtype(CmsObjectCmsSecurityManagerCmsResourceint) |
copyAccessControlEntries | public void copyAccessControlEntries(CmsDbContext dbc, CmsResource source, CmsResource destination, boolean updateLastModifiedInfo) throws CmsException(Code) | | Copies the access control entries of a given resource to a destination resorce.
Already existing access control entries of the destination resource are removed.
Parameters: dbc - the current database context Parameters: source - the resource to copy the access control entries from Parameters: destination - the resource to which the access control entries are copied Parameters: updateLastModifiedInfo - if true, user and date "last modified" information on the target resource will be updated throws: CmsException - if something goes wrong |
countLockedResources | public int countLockedResources(CmsProject project)(Code) | | Counts the locked resources in this project.
Parameters: project - the project to count the locked resources in the amount of locked resources in this project |
createGroup | public CmsGroup createGroup(CmsDbContext dbc, CmsUUID id, String name, String description, int flags, String parent) throws CmsIllegalArgumentException, CmsException(Code) | | Add a new group to the Cms.
Only the admin can do this.
Only users, which are in the group "administrators" are granted.
Parameters: dbc - the current database context Parameters: id - the id of the new group Parameters: name - the name of the new group Parameters: description - the description for the new group Parameters: flags - the flags for the new group Parameters: parent - the name of the parent group (or null ) new created group throws: CmsException - if the creation of the group failed throws: CmsIllegalArgumentException - if the length of the given name was below 1 |
createPropertyDefinition | public CmsPropertyDefinition createPropertyDefinition(CmsDbContext dbc, String name) throws CmsException(Code) | | Creates a property definition.
Property definitions are valid for all resource types.
Parameters: dbc - the current database context Parameters: name - the name of the property definition to create the created property definition throws: CmsException - if something goes wrong |
createResource | public synchronized CmsResource createResource(CmsDbContext dbc, String resourcePath, CmsResource resource, byte[] content, List properties, boolean importCase) throws CmsException(Code) | | Creates a new resource with the provided content and properties.
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.
Parameters: dbc - the current database context Parameters: resourcePath - the name of the resource to create (full path) Parameters: resource - the new resource to create Parameters: content - the content for the new resource Parameters: properties - the properties for the new resource Parameters: importCase - if true , signals that this operation is done while importing resource, causing different lock behavior and potential "lost and found" usage the created resource throws: CmsException - if something goes wrong |
createTempfileProject | public CmsProject createTempfileProject(CmsDbContext dbc) throws CmsException(Code) | | Creates the project for the temporary workplace files.
Parameters: dbc - the current database context the created project for the temporary workplace files throws: CmsException - if something goes wrong |
deleteAllProperties | public void deleteAllProperties(CmsDbContext dbc, String resourcename) throws CmsException(Code) | | Deletes all property values of a file or folder.
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.
Parameters: dbc - the current database context Parameters: resourcename - the name of the resource for which all properties should be deleted throws: CmsException - if operation was not successful |
deleteAllStaticExportPublishedResources | public void deleteAllStaticExportPublishedResources(CmsDbContext dbc, int linkType) throws CmsException(Code) | | Deletes all entries in the published resource table.
Parameters: dbc - the current database context Parameters: linkType - the type of resource deleted (0= non-paramter, 1=parameter) throws: CmsException - if something goes wrong |
deleteGroup | public void deleteGroup(CmsDbContext dbc, CmsGroup group, CmsUUID replacementId) throws CmsDataAccessException, CmsException(Code) | | Deletes a group, where all permissions, users and children of the group
are transfered to a replacement group.
Parameters: dbc - the current request context Parameters: group - the id of the group to be deleted Parameters: replacementId - the id of the group to be transfered, can be null throws: CmsException - if operation was not successful throws: CmsDataAccessException - if group to be deleted contains user |
deleteHistoricalVersions | public void deleteHistoricalVersions(CmsDbContext dbc, CmsFolder folder, int versionsToKeep, int versionsDeleted, long timeDeleted, I_CmsReport report) throws CmsException(Code) | | Deletes the versions from the history tables, keeping the given number of versions per resource.
if the cleanUp option is set, additionally versions of deleted resources will be removed.
Parameters: dbc - the current database context Parameters: folder - the folder (with subresources) to delete historical versions for Parameters: versionsToKeep - number of versions to keep, is ignored if negative Parameters: versionsDeleted - number of versions to keep for deleted resources, is ignored if negative Parameters: timeDeleted - deleted resources older than this will also be deleted, is ignored if negative Parameters: report - the report for output logging throws: CmsException - if operation was not successful |
deleteProject | public void deleteProject(CmsDbContext dbc, CmsProject deleteProject) throws CmsException(Code) | | Deletes a project.
Only the admin or the owner of the project can do this.
Parameters: dbc - the current database context Parameters: deleteProject - the project to be deleted throws: CmsException - if something goes wrong |
deletePropertyDefinition | public void deletePropertyDefinition(CmsDbContext dbc, String name) throws CmsException(Code) | | Deletes a property definition.
Parameters: dbc - the current database context Parameters: name - the name of the property definition to delete throws: CmsException - if something goes wrong |
deletePublishJob | public void deletePublishJob(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException(Code) | | Deletes a publish job identified by its history id.
Parameters: dbc - the current database context Parameters: publishHistoryId - the history id identifying the publish job throws: CmsException - if something goes wrong |
deletePublishList | public void deletePublishList(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException(Code) | | Deletes the publish list assigned to a publish job.
Parameters: dbc - the current database context Parameters: publishHistoryId - the history id identifying the publish job throws: CmsException - if something goes wrong |
deleteRelationsWithSiblings | protected void deleteRelationsWithSiblings(CmsDbContext dbc, CmsResource resource) throws CmsException(Code) | | Deletes all relations for the given resource and all its siblings.
Parameters: dbc - the current database context Parameters: resource - the resource to delete the resource for throws: CmsException - if something goes wrong |
deleteStaticExportPublishedResource | public void deleteStaticExportPublishedResource(CmsDbContext dbc, String resourceName, int linkType, String linkParameter) throws CmsException(Code) | | Deletes an entry in the published resource table.
Parameters: dbc - the current database context Parameters: resourceName - The name of the resource to be deleted in the static export Parameters: linkType - the type of resource deleted (0= non-parameter, 1=parameter) Parameters: linkParameter - the parameters of the resource throws: CmsException - if something goes wrong |
deleteUser | public void deleteUser(CmsDbContext dbc, CmsProject project, String username, String replacementUsername) throws CmsException(Code) | | Deletes a user, where all permissions and resources attributes of the user
were transfered to a replacement user, if given.
Only users, which are in the group "administrators" are granted.
Parameters: dbc - the current database context Parameters: project - the current project Parameters: username - the name of the user to be deleted Parameters: replacementUsername - the name of the user to be transfered, can be null throws: CmsException - if operation was not successful |
destroy | public void destroy()(Code) | | Destroys this driver manager and releases all allocated resources.
|
existsResourceId | public boolean existsResourceId(CmsDbContext dbc, CmsUUID resourceId) throws CmsException(Code) | | Tests if a resource with the given resourceId does already exist in the Database.
Parameters: dbc - the current database context Parameters: resourceId - the resource id to test for true if a resource with the given id was found, false otherweise throws: CmsException - if something goes wrong |
fillPublishList | public void fillPublishList(CmsDbContext dbc, CmsPublishList publishList) throws CmsException(Code) | | Fills the given publish list with the the VFS resources that actually get published.
Please refer to the source code of this method for the rules on how to decide whether a
new/changed/deleted
CmsResource object can be published or not.
Parameters: dbc - the current database context Parameters: publishList - must be initialized with basic publish information (Project or direct publish operation),the given publish list will be filled with all new/changed/deleted files from the current (offline) project that will be actually published throws: CmsException - if something goes wrong See Also: org.opencms.db.CmsPublishList |
getAccessControlEntries | public List getAccessControlEntries(CmsDbContext dbc, CmsResource resource, boolean getInherited) throws CmsException(Code) | | Returns the list of access control entries of a resource given its name.
Parameters: dbc - the current database context Parameters: resource - the resource to read the access control entries for Parameters: getInherited - true if the result should include all access control entries inherited by parent folders a list of CmsAccessControlEntry objects defining all permissions for the given resource throws: CmsException - if something goes wrong |
getAccessControlList | public CmsAccessControlList getAccessControlList(CmsDbContext dbc, CmsResource resource, boolean inheritedOnly) throws CmsException(Code) | | Returns the access control list of a given resource.
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.
Parameters: dbc - the current database context Parameters: resource - the resource Parameters: inheritedOnly - skip non-inherited entries if set the access control list of the resource throws: CmsException - if something goes wrong |
getActiveConnections | public int getActiveConnections(String dbPoolUrl) throws CmsDbException(Code) | | Returns the number of active connections managed by a pool.
Parameters: dbPoolUrl - the url of a pool the number of active connections throws: CmsDbException - if something goes wrong |
getAllAccessibleProjects | public List getAllAccessibleProjects(CmsDbContext dbc) throws CmsException(Code) | | Returns all projects which are owned by the current user or which are
accessible by the current user.
Parameters: dbc - the current database context a list of objects of type CmsProject throws: CmsException - if something goes wrong |
getAllHistoricalProjects | public List getAllHistoricalProjects(CmsDbContext dbc) throws CmsException(Code) | | Returns a list with all projects from history.
Parameters: dbc - the current database context list of CmsHistoryProject objects with all projects from history. throws: CmsException - if operation was not successful |
getAllManageableProjects | public List getAllManageableProjects(CmsDbContext dbc) throws CmsException(Code) | | Returns all projects which are owned by the current user or which are manageable
for the group of the user.
Parameters: dbc - the current database context a list of objects of type CmsProject throws: CmsException - if operation was not successful |
getChildren | public List getChildren(CmsDbContext dbc, CmsGroup group, boolean includeSubChildren) throws CmsException(Code) | | Returns all child groups of a group.
Parameters: dbc - the current database context Parameters: group - the group to get the child for Parameters: includeSubChildren - if set also returns all sub-child groups of the given group a list of all child CmsGroup objects throws: CmsException - if operation was not successful |
getGroupsOfUser | public List getGroupsOfUser(CmsDbContext dbc, String username, boolean readRoles) throws CmsException(Code) | | Returns the groups of an user filtered by the specified IP address.
Parameters: dbc - the current database context Parameters: username - the name of the user Parameters: readRoles - if to read roles or groups the groups of the given user, as a list of CmsGroup objects throws: CmsException - if something goes wrong |
getGroupsOfUser | public List getGroupsOfUser(CmsDbContext dbc, String username, String ouFqn, boolean includeChildOus, boolean readRoles, boolean directGroupsOnly, String remoteAddress) throws CmsException(Code) | | Returns the groups of an user filtered by the specified IP address.
Parameters: dbc - the current database context Parameters: username - the name of the user Parameters: ouFqn - the fully qualified name of the organizational unit to restrict the result set for Parameters: includeChildOus - include groups of child organizational units Parameters: readRoles - if to read roles or groups Parameters: directGroupsOnly - if set only the direct assigned groups will be returned, if not also indirect groups Parameters: remoteAddress - the IP address to filter the groups in the result list a list of CmsGroup objects throws: CmsException - if operation was not successful |
getIdleConnections | public int getIdleConnections(String dbPoolUrl) throws CmsDbException(Code) | | Returns the number of idle connections managed by a pool.
Parameters: dbPoolUrl - the url of a pool the number of idle connections throws: CmsDbException - if something goes wrong |
getLock | public CmsLock getLock(CmsDbContext dbc, CmsResource resource) throws CmsException(Code) | | Returns the lock state of a resource.
Parameters: dbc - the current database context Parameters: resource - the resource to return the lock state for the lock state of the resource throws: CmsException - if something goes wrong |
getLockManager | protected CmsLockManager getLockManager()(Code) | | Returns the lock manager instance.
the lock manager instance |
getLockedResources | public List getLockedResources(CmsDbContext dbc, CmsResource resource, CmsLockFilter filter) throws CmsException(Code) | | Returns all locked resources in a given folder.
Parameters: dbc - the current database context Parameters: resource - the folder to search in Parameters: filter - the lock filter a list of locked resource paths (relative to current site) throws: CmsException - if the current project is locked |
getNextPublishTag | public int getNextPublishTag(CmsDbContext dbc)(Code) | | Returns the next publish tag for the published historical resources.
Parameters: dbc - the current database context the next available publish tag |
getOrgUnitsForRole | public List getOrgUnitsForRole(CmsDbContext dbc, CmsRole role, boolean includeSubOus) throws CmsException(Code) | | Returns all the organizational units for which the current user has the given role.
Parameters: dbc - the current database context Parameters: role - the role to check Parameters: includeSubOus - if sub organizational units should be included in the search a list of org.opencms.security.CmsOrganizationalUnit objects throws: CmsException - if something goes wrong |
getParent | public CmsGroup getParent(CmsDbContext dbc, String groupname) throws CmsException(Code) | | Returns the parent group of a group.
Parameters: dbc - the current database context Parameters: groupname - the name of the group group the parent group or null throws: CmsException - if operation was not successful |
getProjectId | public CmsUUID getProjectId(CmsDbContext dbc, int id) throws CmsException(Code) | | Returns the uuid id for the given id.
TODO: remove this method as soon as possible
Parameters: dbc - the current database context Parameters: id - the old project id the new uuid for the given id throws: CmsException - if something goes wrong |
getPropertyConfiguration | public ExtendedProperties getPropertyConfiguration()(Code) | | Returns the configuration read from the opencms.properties file.
the configuration read from the opencms.properties file |
getResourcesForPrincipal | public List getResourcesForPrincipal(CmsDbContext dbc, CmsProject project, CmsUUID principalId, CmsPermissionSet permissions, boolean includeAttr) throws CmsException(Code) | | Returns all resources associated to a given principal via an ACE with the given permissions.
If the includeAttr flag is set it returns also all resources associated to
a given principal through some of following attributes.
- User Created
- User Last Modified
Parameters: dbc - the current database context Parameters: project - the to read the entries from Parameters: principalId - the id of the principal Parameters: permissions - a set of permissions to match, can be null for all ACEs Parameters: includeAttr - a flag to include resources associated by attributes a list of CmsResource objects throws: CmsException - if something goes wrong |
getRolesForResource | public List getRolesForResource(CmsDbContext dbc, CmsUser user, CmsResource resource) throws CmsException(Code) | | Returns all roles the given user has for the given resource.
Parameters: dbc - the current database context Parameters: user - the user to check Parameters: resource - the resource to check the roles for a list of CmsRole objects throws: CmsException - if something goes wrong |
getRolesForUser | public List getRolesForUser(CmsDbContext dbc, CmsUser user) throws CmsException(Code) | | Returns all roles the given user has independent of the resource.
Parameters: dbc - the current database context Parameters: user - the user to check a list of CmsRole objects throws: CmsException - if something goes wrong |
getSecurityManager | public CmsSecurityManager getSecurityManager()(Code) | | Returns the security manager this driver manager belongs to.
the security manager this driver manager belongs to |
getSqlManager | public CmsSqlManager getSqlManager()(Code) | | Returns an instance of the common sql manager.
an instance of the common sql manager |
getUsersOfGroup | public List getUsersOfGroup(CmsDbContext dbc, String groupname, boolean includeOtherOuUsers, boolean directUsersOnly, boolean readRoles) throws CmsException(Code) | | Returns a list of users in a group.
Parameters: dbc - the current database context Parameters: groupname - the name of the group to list users from Parameters: includeOtherOuUsers - include users of other organizational units Parameters: directUsersOnly - 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 roles Parameters: readRoles - if to read roles or groups all CmsUser objects in the group throws: CmsException - if operation was not successful |
importAccessControlEntries | public void importAccessControlEntries(CmsDbContext dbc, CmsResource resource, List acEntries) throws CmsException(Code) | | Writes a vector of access control entries as new access control entries of a given resource.
Already existing access control entries of this resource are removed before.
Access is granted, if:
- the current user has control permission on the resource
Parameters: dbc - the current database context Parameters: resource - the resource Parameters: acEntries - a list of CmsAccessControlEntry objects throws: CmsException - if something goes wrong |
importUser | public CmsUser importUser(CmsDbContext dbc, String id, String name, String password, String firstname, String lastname, String email, int flags, long dateCreated, Map additionalInfos) throws CmsException(Code) | | Creates a new user by import.
Parameters: dbc - the current database context Parameters: id - the id of the user Parameters: name - the new name for the user Parameters: password - the new password for the user Parameters: firstname - the firstname of the user Parameters: lastname - the lastname of the user Parameters: email - the email of the user Parameters: flags - the flags for a user (for example I_CmsPrincipal.FLAG_ENABLED ) Parameters: dateCreated - the creation date Parameters: additionalInfos - the additional user infos the imported user throws: CmsException - if something goes wrong |
isInsideCurrentProject | public boolean isInsideCurrentProject(CmsDbContext dbc, String resourcename)(Code) | | Checks if the specified resource is inside the current project.
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.
Parameters: dbc - the current database context Parameters: resourcename - the specified resource name (full path) true , if the specified resource is inside the current project |
isTempfileProject | public boolean isTempfileProject(CmsProject project)(Code) | | Checks if a project is the tempfile project.
Parameters: project - the project to test true if the project is the tempfile project |
labelResource | public boolean labelResource(CmsDbContext dbc, CmsResource resource, String newResource, int action) throws CmsDataAccessException(Code) | | Checks if one of the resources (except the resource itself)
is a sibling in a "labeled" site folder.
This method is used when creating a new sibling
(use the newResource parameter & action = 1)
or deleting/importing a resource (call with action = 2).
Parameters: dbc - the current database context Parameters: resource - the resource Parameters: newResource - absolute path for a resource sibling which will be created Parameters: action - 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 throws: CmsDataAccessException - if something goes wrong |
lockedBy | public CmsUser lockedBy(CmsDbContext dbc, CmsResource resource) throws CmsException(Code) | | Returns the user, who had locked the resource.
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.
Parameters: dbc - the current database context Parameters: resource - the resource the user, who had locked the resource throws: CmsException - will be thrown, if the user has not the rights for this resource |
lookupPrincipal | public I_CmsPrincipal lookupPrincipal(CmsDbContext dbc, CmsUUID principalId)(Code) | | Lookup and read the user or group with the given UUID.
Parameters: dbc - the current database context Parameters: principalId - the UUID of the principal to lookup the principal (group or user) if found, otherwise null |
lookupPrincipal | public I_CmsPrincipal lookupPrincipal(CmsDbContext dbc, String principalName)(Code) | | Lookup and read the user or group with the given name.
Parameters: dbc - the current database context Parameters: principalName - the name of the principal to lookup the principal (group or user) if found, otherwise null |
moveResource | public void moveResource(CmsDbContext dbc, CmsResource source, String destination, boolean internal) throws CmsException(Code) | | Moves a resource.
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.
Parameters: dbc - the current database context Parameters: source - the resource to move Parameters: destination - the name of the move destination with complete path Parameters: internal - if set nothing more than the path is modified throws: CmsException - if something goes wrong See Also: CmsSecurityManager.moveResource(CmsRequestContextCmsResourceString) |
moveToLostAndFound | public String moveToLostAndFound(CmsDbContext dbc, CmsResource resource, boolean returnNameOnly) throws CmsException, CmsIllegalArgumentException(Code) | | Moves a resource to the "lost and found" folder.
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 .
Parameters: dbc - the current database context Parameters: resource - the resource to apply this operation to Parameters: returnNameOnly - if true , only the name of the resource in the "lost and found" folder is returned, the move operation is not really performed the name of the resource inside the "lost and found" folder throws: CmsException - if something goes wrong throws: CmsIllegalArgumentException - if the resourcename argument is null or of length 0 See Also: CmsObject.moveToLostAndFound(String) See Also: CmsObject.getLostAndFoundName(String) |
newDriverInstance | public Object newDriverInstance(CmsConfigurationManager configurationManager, String driverName, List successiveDrivers) throws CmsInitException(Code) | | Gets a new driver instance.
Parameters: configurationManager - the configuration manager Parameters: driverName - the driver name Parameters: successiveDrivers - the list of successive drivers the driver object throws: CmsInitException - if the selected driver could not be initialized |
newDriverInstance | public Object newDriverInstance(ExtendedProperties configuration, String driverName, String driverPoolUrl) throws CmsException(Code) | | Method to create a new instance of a driver.
Parameters: configuration - the configurations from the propertyfile Parameters: driverName - the class name of the driver Parameters: driverPoolUrl - the pool url for the driver an initialized instance of the driver throws: CmsException - if something goes wrong |
newInstance | public static CmsDriverManager newInstance(CmsConfigurationManager configurationManager, CmsSecurityManager securityManager, I_CmsDbContextFactory runtimeInfoFactory, CmsPublishEngine publishEngine) throws CmsInitException(Code) | | Reads the required configurations from the opencms.properties file and creates
the various drivers to access the cms resources.
The initialization process of the driver manager and its drivers is split into
the following phases:
- the database pool configuration is read
- a plain and empty driver manager instance is created
- an instance of each driver is created
- the driver manager is passed to each driver during initialization
- finally, the driver instances are passed to the driver manager during initialization
Parameters: configurationManager - the configuration manager Parameters: securityManager - the security manager Parameters: runtimeInfoFactory - the initialized OpenCms runtime info factory Parameters: publishEngine - the publish engine CmsDriverManager the instantiated driver manager throws: CmsInitException - if the driver manager couldn't be instantiated |
newPoolInstance | public void newPoolInstance(Map configuration, String poolName) throws CmsInitException(Code) | | Method to create a new instance of a pool.
Parameters: configuration - the configurations from the propertyfile Parameters: poolName - the configuration name of the pool throws: CmsInitException - if the pools could not be initialized |
publishJob | public void publishJob(CmsObject cms, CmsDbContext dbc, CmsPublishList publishList, I_CmsReport report) throws CmsException(Code) | | Publishes the given publish job.
Parameters: cms - the cms context Parameters: dbc - the db context Parameters: publishList - the list of resources to publish Parameters: report - the report to write to throws: CmsException - if something goes wrong |
readAccessControlEntry | public CmsAccessControlEntry readAccessControlEntry(CmsDbContext dbc, CmsResource resource, CmsUUID principal) throws CmsException(Code) | | Reads an access control entry from the cms.
The access control entries of a resource are readable by everyone.
Parameters: dbc - the current database context Parameters: resource - the resource Parameters: principal - the id of a group or a user any other entity an access control entry that defines the permissions of the entity for the given resource throws: CmsException - if something goes wrong |
readAllAvailableVersions | public List readAllAvailableVersions(CmsDbContext dbc, CmsResource resource) throws CmsException(Code) | | Reads all versions of the given resource.
This method returns a list with the history of the given resource, i.e.
the historical resource entries, independent of the project they were attached to.
The reading excludes the file content.
Parameters: dbc - the current database context Parameters: resource - the resource to read the history for a list of file headers, as I_CmsHistoryResource objects throws: CmsException - if something goes wrong |
readChildResources | public List readChildResources(CmsDbContext dbc, CmsResource resource, CmsResourceFilter filter, boolean getFolders, boolean getFiles, boolean checkPermissions) throws CmsException(Code) | | Returns the child resources of a resource, that is the resources
contained in a folder.
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.
Parameters: dbc - the current database context Parameters: resource - the resource to return the child resources for Parameters: filter - the resource filter to use Parameters: getFolders - if true the child folders are included in the result Parameters: getFiles - if true the child files are included in the result Parameters: checkPermissions - if the resources should be filtered with the current user permissions a list of all child resources throws: CmsException - if something goes wrong |
readGroup | public CmsGroup readGroup(CmsDbContext dbc, CmsProject project)(Code) | | Reads the group of a project.
Parameters: dbc - the current database context Parameters: project - the project to read from the group of a resource |
readGroup | public CmsGroup readGroup(CmsDbContext dbc, CmsUUID groupId) throws CmsException(Code) | | Reads a group based on its id.
Parameters: dbc - the current database context Parameters: groupId - the id of the group that is to be read the requested group throws: CmsException - if operation was not successful |
readHistoryProject | public CmsHistoryProject readHistoryProject(CmsDbContext dbc, int publishTag) throws CmsException(Code) | | Returns a historical project entry.
Parameters: dbc - the current database context Parameters: publishTag - the publish tag of the project the requested historical project entry throws: CmsException - if something goes wrong |
readHistoryPropertyObjects | public List readHistoryPropertyObjects(CmsDbContext dbc, I_CmsHistoryResource historyResource) throws CmsException(Code) | | Reads the list of all
CmsProperty objects that belongs to the given historical resource.
Parameters: dbc - the current database context Parameters: historyResource - the historical resource to read the properties for the list of CmsProperty objects throws: CmsException - if something goes wrong |
readLocks | public void readLocks(CmsDbContext dbc) throws CmsException(Code) | | Reads the locks that were saved to the database in the previous run of OpenCms.
Parameters: dbc - the current database context throws: CmsException - if something goes wrong |
readManagerGroup | public CmsGroup readManagerGroup(CmsDbContext dbc, CmsProject project)(Code) | | Reads the manager group of a project.
Parameters: dbc - the current database context Parameters: project - the project to read from the group of a resource |
readOrganizationalUnit | public CmsOrganizationalUnit readOrganizationalUnit(CmsDbContext dbc, String ouFqn) throws CmsException(Code) | | Reads an organizational Unit based on its fully qualified name.
Parameters: dbc - the current db context Parameters: ouFqn - the fully qualified name of the organizational Unit to be read the organizational Unit that with the provided fully qualified name throws: CmsException - if something goes wrong |
readOwner | public CmsUser readOwner(CmsDbContext dbc, CmsProject project) throws CmsException(Code) | | Reads the owner of a project.
Parameters: dbc - the current database context Parameters: project - the project to get the owner from the owner of a resource throws: CmsException - if something goes wrong |
readPath | public List readPath(CmsDbContext dbc, CmsUUID projectId, String path, CmsResourceFilter filter) throws CmsException(Code) | | Builds a list of resources for a given path.
Parameters: dbc - the current database context Parameters: projectId - the project to lookup the resource Parameters: path - the requested path Parameters: filter - a filter object (only "includeDeleted" information is used!) list of CmsResource s throws: CmsException - if something goes wrong |
readProject | public CmsProject readProject(CmsDbContext dbc, String name) throws CmsException(Code) | | Reads a project.
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
CmsDriverManager.readProject(CmsDbContext,CmsUUID) to ensure the right project is read.
Parameters: dbc - the current database context Parameters: name - the name of the project the project read throws: CmsException - if something goes wrong |
readProjectResources | public List readProjectResources(CmsDbContext dbc, CmsProject project) throws CmsException(Code) | | Returns the list of all resource names that define the "view" of the given project.
Parameters: dbc - the current database context Parameters: project - the project to get the project resources for the list of all resources, as String objects that define the "view" of the given project. throws: CmsException - if something goes wrong |
readPropertyDefinition | public CmsPropertyDefinition readPropertyDefinition(CmsDbContext dbc, String name) throws CmsException(Code) | | Reads a property definition.
If no property definition with the given name is found,
null is returned.
Parameters: dbc - the current database context Parameters: name - the name of the property definition to read the property definition that was read, or null if there is no property definition with the given name. throws: CmsException - if something goes wrong |
readPropertyObject | public CmsProperty readPropertyObject(CmsDbContext dbc, CmsResource resource, String key, boolean search) throws CmsException(Code) | | Reads a property object from a resource specified by a property name.
Returns
CmsProperty.getNullProperty if the property is not found.
Parameters: dbc - the current database context Parameters: resource - the resource where the property is read from Parameters: key - the property key name Parameters: search - if true , the property is searched on all parent folders of the resource. if it's not found attached directly to the resource. the required property, or CmsProperty.getNullProperty if the property was not found throws: CmsException - if something goes wrong |
readPropertyObjects | public List readPropertyObjects(CmsDbContext dbc, CmsResource resource, boolean search) throws CmsException(Code) | | Reads all property objects mapped to a specified resource from the database.
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.
Parameters: dbc - the current database context Parameters: resource - the resource where the properties are read from Parameters: search - true, if the properties should be searched on all parent folders if not found on the resource a list of CmsProperty objects containing the structure and/or resource value throws: CmsException - if something goes wrong See Also: CmsObject.readPropertyObjects(Stringboolean) |
readPublishJobs | public List readPublishJobs(CmsDbContext dbc, long startTime, long endTime) throws CmsException(Code) | | Reads all available publish jobs.
Parameters: dbc - the current database context Parameters: startTime - the start of the time range for finish time Parameters: endTime - the end of the time range for finish time a list of objects of type CmsPublishJobInfoBean throws: CmsException - if something goes wrong |
readPublishList | public CmsPublishList readPublishList(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException(Code) | | Reads the publish list assigned to a publish job.
Parameters: dbc - the current database context Parameters: publishHistoryId - the history id identifying the publish job the assigned publish list throws: CmsException - if something goes wrong |
readPublishReportContents | public byte[] readPublishReportContents(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException(Code) | | Reads the publish report assigned to a publish job.
Parameters: dbc - the current database context Parameters: publishHistoryId - the history id identifying the publish job the content of the assigned publish report throws: CmsException - if something goes wrong |
readPublishedResources | public List readPublishedResources(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException(Code) | | Reads the resources that were published in a publish task for a given publish history ID.
Parameters: dbc - the current database context Parameters: publishHistoryId - unique int ID to identify each publish task in the publish history a list of org.opencms.db.CmsPublishedResource objects throws: CmsException - if something goes wrong |
readResources | public List readResources(CmsDbContext dbc, CmsResource parent, CmsResourceFilter filter, boolean readTree) throws CmsException, CmsDataAccessException(Code) | | 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 .
Parameters: dbc - the current database context Parameters: parent - the parent path to read the resources from Parameters: filter - the filter Parameters: readTree - true to read all subresources a list of CmsResource objects matching the filter criteria throws: CmsDataAccessException - if the bare reading of the resources fails throws: CmsException - if security and permission checks for the resources read fail |
readResourcesWithProperty | public List readResourcesWithProperty(CmsDbContext dbc, CmsResource folder, String propertyDefinition, String value, CmsResourceFilter filter) throws CmsException(Code) | | Reads all resources that have a value (containing the given value string) set
for the specified property (definition) in the given path.
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.
Parameters: dbc - the current database context Parameters: folder - the folder to get the resources with the property from Parameters: propertyDefinition - the name of the property (definition) to check for Parameters: value - the string to search in the value of the property Parameters: filter - the resource filter to apply to the result set a list of all CmsResource objects that have a value set for the specified property. throws: CmsException - if something goes wrong |
readResponsiblePrincipals | public Set readResponsiblePrincipals(CmsDbContext dbc, CmsResource resource) throws CmsException(Code) | | Returns the set of users that are responsible for a specific resource.
Parameters: dbc - the current database context Parameters: resource - the resource to get the responsible users from the set of users that are responsible for a specific resource throws: CmsException - if something goes wrong |
readResponsibleUsers | public Set readResponsibleUsers(CmsDbContext dbc, CmsResource resource) throws CmsException(Code) | | Returns the set of users that are responsible for a specific resource.
Parameters: dbc - the current database context Parameters: resource - the resource to get the responsible users from the set of users that are responsible for a specific resource throws: CmsException - if something goes wrong |
readSiblings | public List readSiblings(CmsDbContext dbc, CmsResource resource, CmsResourceFilter filter) throws CmsException(Code) | | Returns a List of all siblings of the specified resource,
the specified resource being always part of the result set.
The result is a list of
CmsResource objects.
Parameters: dbc - the current database context Parameters: resource - the resource to read the siblings for Parameters: filter - a filter object a list of CmsResource Objects that are siblings to the specified resource, including the specified resource itself throws: CmsException - if something goes wrong |
readStaticExportPublishedResourceParameters | public String readStaticExportPublishedResourceParameters(CmsDbContext dbc, String rfsName) throws CmsException(Code) | | Returns the parameters of a resource in the table of all published template resources.
Parameters: dbc - the current database context Parameters: rfsName - the rfs name of the resource the parameter string of the requested resource throws: CmsException - if something goes wrong |
readStaticExportResources | public List readStaticExportResources(CmsDbContext dbc, int parameterResources, long timestamp) throws CmsException(Code) | | Returns a list of all template resources which must be processed during a static export.
Parameters: dbc - the current database context Parameters: parameterResources - flag for reading resources with parameters (1) or without (0) Parameters: timestamp - for reading the data from the db a list of template resources as String objects throws: CmsException - if something goes wrong |
readUser | public CmsUser readUser(CmsDbContext dbc, CmsUUID id) throws CmsException(Code) | | Returns a user object based on the id of a user.
Parameters: dbc - the current database context Parameters: id - the id of the user to read the user read throws: CmsException - if something goes wrong |
readUser | public CmsUser readUser(CmsDbContext dbc, String username, String password) throws CmsException(Code) | | Returns a user object if the password for the user is correct.
If the user/pwd pair is not valid a
CmsException is thrown.
Parameters: dbc - the current database context Parameters: username - the username of the user that is to be read Parameters: password - the password of the user that is to be read user read throws: CmsException - if operation was not successful |
removeAccessControlEntry | public void removeAccessControlEntry(CmsDbContext dbc, CmsResource resource, CmsUUID principal) throws CmsException(Code) | | Removes an access control entry for a given resource and principal.
Parameters: dbc - the current database context Parameters: resource - the resource Parameters: principal - the id of the principal to remove the the access control entry for throws: CmsException - if something goes wrong |
resetPassword | public void resetPassword(CmsDbContext dbc, String username, String oldPassword, String newPassword) throws CmsException, CmsSecurityException(Code) | | Resets the password for a specified user.
Parameters: dbc - the current database context Parameters: username - the name of the user Parameters: oldPassword - the old password Parameters: newPassword - the new password throws: CmsException - if the user data could not be read from the database throws: CmsSecurityException - if the specified username and old password could not be verified |
setParentGroup | public void setParentGroup(CmsDbContext dbc, String groupName, String parentGroupName) throws CmsException, CmsDataAccessException(Code) | | Sets a new parent group for an already existing group.
Parameters: dbc - the current database context Parameters: groupName - the name of the group that should be written Parameters: parentGroupName - the name of the parent group to set, or null if the parentgroup should be deleted. throws: CmsException - if operation was not successful throws: CmsDataAccessException - if the group with groupName could not be read from VFS |
unlockProject | public void unlockProject(CmsProject project)(Code) | | Unlocks all resources in the given project.
Parameters: project - the project to unlock the resources in |
updateExportPoints | public void updateExportPoints(CmsDbContext dbc)(Code) | | Update the export points.
All files and folders "inside" an export point are written.
Parameters: dbc - the current database context |
userInGroup | public boolean userInGroup(CmsDbContext dbc, String username, String groupname, boolean readRoles) throws CmsException(Code) | | Returns true if a user is member of the given group.
Parameters: dbc - the current database context Parameters: username - the name of the user to check Parameters: groupname - the name of the group to check Parameters: readRoles - if to read roles or groups true , if the user is in the group, false otherwise throws: CmsException - if something goes wrong |
validatePassword | public void validatePassword(String password) throws CmsSecurityException(Code) | | This method checks if a new password follows the rules for
new passwords, which are defined by a Class implementing the
org.opencms.security.I_CmsPasswordHandler
interface and configured in the opencms.properties file.
If this method throws no exception the password is valid.
Parameters: password - the new password that has to be checked throws: CmsSecurityException - if the password is not valid |
validateRelations | public Map validateRelations(CmsDbContext dbc, CmsPublishList publishList, I_CmsReport report) throws Exception(Code) | | Validates the relations for the given resources.
Parameters: dbc - the database context Parameters: publishList - the resources to validate during publishing Parameters: report - a report to write the messages to a map with lists of invalid links (org.opencms.relations.CmsRelation} objects) keyed by root paths throws: Exception - if something goes wrong |
writeExportPoints | public void writeExportPoints(CmsDbContext dbc, I_CmsReport report, CmsUUID publishHistoryId)(Code) | | Writes all export points into the file system for the publish task
specified by trhe given publish history ID.
Parameters: dbc - the current database context Parameters: report - an I_CmsReport instance to print output message, or null to write messages to the log file Parameters: publishHistoryId - ID to identify the publish task in the publish history |
writeFile | public CmsFile writeFile(CmsDbContext dbc, CmsFile resource) throws CmsException(Code) | | Writes a resource to the OpenCms VFS, including it's content.
Applies only to resources of type
CmsFile
i.e. resources that have a binary content attached.
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.
Parameters: dbc - the current database context Parameters: resource - the resource to apply this operation to the written resource (may have been modified) throws: CmsException - if something goes wrong See Also: CmsObject.writeFile(CmsFile) See Also: I_CmsResourceType.writeFile(CmsObjectCmsSecurityManagerCmsFile) |
writeGroup | public void writeGroup(CmsDbContext dbc, CmsGroup group) throws CmsException(Code) | | Writes an already existing group.
The group id has to be a valid OpenCms group id.
The group with the given id will be completely overridden
by the given data.
Parameters: dbc - the current database context Parameters: group - the group that should be written throws: CmsException - if operation was not successful |
writeHistoryProject | public void writeHistoryProject(CmsDbContext dbc, int publishTag, long publishDate) throws CmsDataAccessException(Code) | | Creates an historical entry of the current project.
Parameters: dbc - the current database context Parameters: publishTag - the version Parameters: publishDate - the date of publishing throws: CmsDataAccessException - if operation was not successful |
writeLocks | public void writeLocks(CmsDbContext dbc) throws CmsException(Code) | | Writes the locks that are currently stored in-memory to the database to allow restoring them
in future server startups.
This overwrites the locks previously stored in the underlying database table.
Parameters: dbc - the current database context throws: CmsException - if something goes wrong |
writeProject | public void writeProject(CmsDbContext dbc, CmsProject project) throws CmsException(Code) | | Writes an already existing project.
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.
Parameters: dbc - the current database context Parameters: project - the project that should be written throws: CmsException - if operation was not successful |
writeResource | public void writeResource(CmsDbContext dbc, CmsResource resource) throws CmsException(Code) | | Writes a resource to the OpenCms VFS.
Parameters: dbc - the current database context Parameters: resource - the resource to write throws: CmsException - if something goes wrong |
writeStaticExportPublishedResource | public void writeStaticExportPublishedResource(CmsDbContext dbc, String resourceName, int linkType, String linkParameter, long timestamp) throws CmsException(Code) | | Inserts an entry in the published resource table.
This is done during static export.
Parameters: dbc - the current database context Parameters: resourceName - The name of the resource to be added to the static export Parameters: linkType - the type of resource exported (0= non-parameter, 1=parameter) Parameters: linkParameter - the parameters added to the resource Parameters: timestamp - a time stamp for writing the data into the db throws: CmsException - if something goes wrong |
writeUser | public void writeUser(CmsDbContext dbc, CmsUser user) throws CmsException(Code) | | Updates the user information.
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.
Parameters: dbc - the current database context Parameters: user - the user to be updated throws: CmsException - if operation was not successful |
|
|