| java.lang.Object org.opencms.file.CmsObject
CmsObject | final public class CmsObject (Code) | | This pivotal class provides all authorized access to the OpenCms VFS resources.
It encapsulates user identification and permissions.
Think of it as an initialized "shell" to access the OpenCms VFS.
Every call to a method here will be checked for user permissions
according to the
org.opencms.file.CmsRequestContext this CmsObject instance was created with.
From a JSP page running in OpenCms, use
org.opencms.jsp.CmsJspBean.getCmsObject to gain
access to the current users CmsObject. Usually this is done with a
org.opencms.jsp.CmsJspActionElement .
To generate a new instance of this class in your application, use
org.opencms.main.OpenCms.initCmsObject(String) . The argument String should be
the name of the guest user, usually "Guest" and more formally obtained by
org.opencms.db.CmsDefaultUsers.getUserGuest .
This will give you an initialized context with guest user permissions.
Then use
CmsObject.loginUser(StringString) to log in the user you want.
Obviously you need the password for the new user.
You should never try to create an instance of this class using the constructor,
this is reserved for internal operation only.
author: Alexander Kandzior author: Thomas Weckert author: Carsten Weinholz author: Andreas Zahner author: Michael Moossen version: $Revision: 1.158 $ since: 6.0.0 |
Constructor Summary | |
public | CmsObject(CmsSecurityManager securityManager, CmsRequestContext context) Connects an OpenCms user context to a running database.
Please note: This constructor is internal to OpenCms and not for public use. |
Method Summary | |
public void | addRelationToResource(String resourceName, String targetPath, String type) | public void | addUserToGroup(String username, String groupname) | public CmsUser | addWebUser(String name, String password, String group, String description, Map additionalInfos) | public void | backupProject(int versionId, long publishDate) | public void | chacc(String resourceName, String principalType, String principalName, int allowedPermissions, int deniedPermissions, int flags) | public void | chacc(String resourceName, String principalType, String principalName, String permissionString) | public void | changeLock(String resourcename) | public List | changeResourcesInFolderWithProperty(String resourcename, String property, String oldValue, String newValue, boolean recursive) | public void | checkPublishPermissions(CmsPublishList publishList) | public void | checkRole(CmsRole role) | public void | chflags(String resourcename, 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(String resourcename, int type) Changes the resource type of a resource.
OpenCms handles resources according to the resource type,
not the file suffix. | public void | copyResource(String source, String destination) | public void | copyResource(String source, String destination, CmsResource.CmsResourceCopyMode siblingMode) | public void | copyResource(String source, String destination, int siblingMode) | public void | copyResourceToProject(String resourcename) Copies a resource to the current project of the user.
This is used to extend the current users project with the
specified resource, in case that the resource is not yet part of the project. | public int | countLockedResources(CmsUUID id) | public int | countLockedResources(int id) | public void | cpacc(String sourceName, String destName) | public CmsGroup | createGroup(String groupFqn, String description, int flags, String parent) | public CmsProject | createProject(String name, String description, String groupname, String managergroupname) | public CmsProject | createProject(String name, String description, String groupname, String managergroupname, CmsProject.CmsProjectType projecttype) | public CmsProject | createProject(String name, String description, String groupname, String managergroupname, int projecttype) | public CmsPropertyDefinition | createPropertyDefinition(String name) | public CmsResource | createResource(String resourcename, int type) | public CmsResource | createResource(String resourcename, int type, byte[] content, List properties) | public CmsResource | createSibling(String source, String destination, List properties) | public CmsProject | createTempfileProject() | public CmsUser | createUser(String userFqn, String password, String description, Map additionalInfos) | public void | deleteAllStaticExportPublishedResources(int linkType) | public void | deleteBackups(long timestamp, int versions, I_CmsReport report) Deletes the versions from the backup tables that are older then the given time stamp
and/or number of remaining versions.
The number of versions always wins, i.e. | public void | deleteGroup(CmsUUID groupId, CmsUUID replacementId) | public void | deleteGroup(String group) | public void | deleteHistoricalVersions(String folderName, int versionsToKeep, int versionsDeleted, long timeDeleted, I_CmsReport report) | public void | deleteProject(CmsUUID id) | public void | deleteProject(int id) | public void | deleteProperty(String resourcename, String key) | public void | deletePropertyDefinition(String name) | public void | deleteRelationsFromResource(String resourceName, CmsRelationFilter filter) | public void | deleteResource(String resourcename, CmsResource.CmsResourceDeleteMode siblingMode) | public void | deleteResource(String resourcename, int siblingMode) | public void | deleteStaticExportPublishedResource(String resourceName, int linkType, String linkParameter) | public void | deleteUser(CmsUUID userId) | public void | deleteUser(CmsUUID userId, CmsUUID replacementId) | public void | deleteUser(String username) | public void | deleteWebUser(CmsUUID userId) | public boolean | existsResource(String resourcename) | public boolean | existsResource(String resourcename, CmsResourceFilter filter) Checks the availability of a resource in the VFS,
using the
CmsResourceFilter.DEFAULT filter.
A resource may be of type
CmsFile or
CmsFolder .
The specified filter controls what kind of resources should be "found"
during the read operation. | public List | getAccessControlEntries(String resourceName) | public List | getAccessControlEntries(String resourceName, boolean getInherited) | public CmsAccessControlList | getAccessControlList(String resourceName) | public CmsAccessControlList | getAccessControlList(String resourceName, boolean inheritedOnly) | public List | getAllAccessibleProjects() | public List | getAllBackupProjects() | public List | getAllHistoricalProjects() | public List | getAllManageableProjects() | public int | getBackupTagId() | public List | getChild(String groupname) | public List | getChildren(String groupname, boolean includeSubChildren) | public List | getChilds(String groupname) | public List | getDirectGroupsOfUser(String username) | public List | getFilesInFolder(String resourcename) | public List | getFilesInFolder(String resourcename, CmsResourceFilter filter) | public List | getGroups() | public List | getGroupsOfUser(String username) | public List | getGroupsOfUser(String username, boolean directGroupsOnly) | public List | getGroupsOfUser(String username, boolean directGroupsOnly, boolean includeOtherOus) | public List | getGroupsOfUser(String username, boolean directGroupsOnly, boolean includeOtherOus, String remoteAddress) | public List | getGroupsOfUser(String username, String remoteAddress) | public CmsLock | getLock(CmsResource resource) | public CmsLock | getLock(String resourcename) | public List | getLockedResources(String foldername, CmsLockFilter filter) | public String | getLostAndFoundName(String resourcename) Returns the name a resource would have if it were moved to the
"lost and found" folder. | public CmsGroup | getParent(String groupname) | public CmsPermissionSet | getPermissions(String resourceName) | public CmsPermissionSet | getPermissions(String resourceName, String userName) | public CmsPublishList | getPublishList() | public CmsPublishList | getPublishList(CmsResource directPublishResource, boolean directPublishSiblings) Returns a publish list with all new/changed/deleted resources of the current (offline)
project that actually get published for a direct publish of a single resource.
Parameters: directPublishResource - the resource which will be directly published Parameters: directPublishSiblings - true , if all eventual siblings of the direct published resource should also get published. | public CmsPublishList | getPublishList(List directPublishResources, boolean directPublishSiblings) Returns a publish list with all new/changed/deleted resources of the current (offline)
project that actually get published for a direct publish of a List of resources.
Parameters: directPublishResources - the resources which will be directly published Parameters: directPublishSiblings - true , if all eventual siblings of the direct published resources should also get published. | public CmsPublishList | getPublishList(List directPublishResources, boolean directPublishSiblings, boolean publishSubResources) | public List | getRelationsForResource(String resourceName, CmsRelationFilter filter) | public CmsRequestContext | getRequestContext() Returns the current users request context.
This request context is used to authenticate the user for all
OpenCms operations. | public List | getResourcesForPrincipal(CmsUUID principalId, CmsPermissionSet permissions, boolean includeAttr) | public List | getResourcesInFolder(String resourcename, CmsResourceFilter filter) | public List | getResourcesInTimeRange(String folder, long starttime, long endtime) | public String | getSitePath(CmsResource resource) Adjusts the absolute resource root path for the current site.
The full root path of a resource is always available using
CmsResource.getRootPath . | public List | getSubFolders(String resourcename) Returns all folder resources contained in a folder.
The result is filtered according to the rules of
the
CmsResourceFilter.DEFAULT filter.
Parameters: resourcename - the full current site relative path of the resource to return the child resources for. | public List | getSubFolders(String resourcename, CmsResourceFilter filter) Returns all folder resources contained in a folder.
With the
CmsResourceFilter provided as parameter
you can control if you want to include deleted, invisible or
time-invalid resources in the result.
Parameters: resourcename - the full current site relative path of the resource to return the child resources for. | public List | getUsers() | public List | getUsersOfGroup(String groupname) | public List | getUsersOfGroup(String groupname, boolean includeOtherOus) | public boolean | hasPermissions(CmsResource resource, CmsPermissionSet requiredPermissions) | public boolean | hasPermissions(CmsResource resource, CmsPermissionSet requiredPermissions, boolean checkLock, CmsResourceFilter filter) | public boolean | hasPublishPermissions(String resourcename) | public boolean | hasRole(CmsRole role) | public void | importAccessControlEntries(CmsResource resource, List acEntries) | public void | importRelation(String resourceName, String targetPath, String relationType) | public CmsResource | importResource(String resourcename, CmsResource resource, byte[] content, List properties) Imports a resource to the OpenCms VFS.
If a resource already exists in the VFS (i.e. | public CmsUser | importUser(String id, String name, String password, String firstname, String lastname, String email, int flags, long dateCreated, Map additionalInfos) | public CmsUser | importUser(String id, String name, String password, String description, String firstname, String lastname, String email, String address, int flags, Map additionalInfos) | public boolean | isAdmin() | public boolean | isInsideCurrentProject(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 | isManagerOfProject() | public void | lockResource(String resourcename) | public void | lockResource(String resourcename, int mode) | public void | lockResourceTemporary(String resourcename) Locks a resource temporary.
This will be an exclusive, temporary lock valid only for the current users session. | public String | loginUser(String username, String password) | public String | loginUser(String username, String password, String remoteAddress) | public String | loginWebUser(String username, String password) Logs a web user into the Cms, if the password is correct. | public I_CmsPrincipal | lookupPrincipal(CmsUUID principalId) | public I_CmsPrincipal | lookupPrincipal(String principalName) | public void | moveResource(String source, String destination) Moves a resource to the given destination.
A move operation in OpenCms is always a copy (as sibling) followed by a delete,
this is a result of the online/offline structure of the
OpenCms VFS. | public String | moveToLostAndFound(String resourcename) Moves a resource to the "lost and found" folder.
The "lost and found" folder is a special system folder. | public CmsUUID | publishProject() | public CmsUUID | publishProject(I_CmsReport report) | public CmsUUID | publishProject(I_CmsReport report, CmsPublishList publishList) | public CmsUUID | publishProject(I_CmsReport report, CmsResource directPublishResource, boolean directPublishSiblings) Direct publishes a specified resource.
Parameters: report - an instance of I_CmsReport to print messages Parameters: directPublishResource - a CmsResource that gets directly published; or null if an entire project gets published. Parameters: directPublishSiblings - if a CmsResource that should get published directly is provided as an argument, all eventual siblings of this resource get publish too, if this flag is true . | public CmsUUID | publishResource(String resourcename) | public CmsUUID | publishResource(String resourcename, boolean publishSiblings, I_CmsReport report) | public List | readAllAvailableVersions(String resourceName) | public List | readAllBackupFileHeaders(String filename) Reads all file headers of a file.
This method returns a list with the history of all file headers, i.e. | public List | readAllPropertyDefinitions() | public CmsFolder | readAncestor(String resourcename, CmsResourceFilter filter) | public CmsFolder | readAncestor(String resourcename, int type) | public I_CmsHistoryResource | readBackupFile(CmsUUID structureId, int publishTag) | public I_CmsHistoryResource | readBackupFile(String filename, int publishTag) | public CmsHistoryProject | readBackupProject(int tagId) | public List | readBackupPropertyObjects(I_CmsHistoryResource resource) | public CmsResource | readDefaultFile(String resourceNameOrID) | public List | readDeletedResources(String resourcename, boolean readTree) | public CmsFile | readFile(CmsResource resource) Reads a file resource (including it's binary content) from the VFS,
for the given resource (this may also be an historical version of the resource).
In case the input
CmsResource object already is a
CmsFile with contents
available, it is casted to a file and returned unchanged. | public CmsFile | readFile(String resourcename) | public CmsFile | readFile(String resourcename, CmsResourceFilter filter) 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
CmsObject.readResource(String,CmsResourceFilter) instead.
The specified filter controls what kind of resources should be "found"
during the read operation. | public CmsResource | readFileHeader(String resourcename) | public CmsFolder | readFolder(String resourcename) | public CmsFolder | readFolder(String resourcename, CmsResourceFilter filter) Reads a folder resource from the VFS,
using the specified resource filter.
The specified filter controls what kind of resources should be "found"
during the read operation. | public CmsGroup | readGroup(CmsProject project) | public CmsGroup | readGroup(CmsUUID groupId) | public CmsGroup | readGroup(String groupName) | public CmsHistoryPrincipal | readHistoryPrincipal(CmsUUID principalId) Reads a principal (an user or group) from the historical archive based on its ID.
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(int publishTag) | public List | readHistoryPropertyObjects(I_CmsHistoryResource resource) | public CmsGroup | readManagerGroup(CmsProject project) | public CmsUser | readOwner(CmsProject project) | public List | readPath(String path, CmsResourceFilter filter) | public CmsProject | readProject(CmsUUID id) | public CmsProject | readProject(int id) | public CmsProject | readProject(String name) | public List | readProjectResources(CmsProject project) | public List | readProjectView(CmsUUID projectId, CmsResourceState state) | public List | readProjectView(int projectId, CmsResourceState state) | public List | readProjectView(int projectId, int state) | public Map | readProperties(String resourcePath) | public Map | readProperties(String resourcePath, boolean search) Reads the (compound) values of all properties mapped to a specified resource
with optional direcory upward cascading.
Parameters: resourcePath - the resource to look up the property for Parameters: search - if true , the properties will also be looked up on all parent folders and the results will be merged, if false not (ie. | public String | readProperty(String resourcePath, String property) | public String | readProperty(String resourcePath, String property, boolean search) Reads the (compound) value of a property mapped to a specified resource
with optional direcory upward cascading.
Parameters: resourcePath - the resource to look up the property for Parameters: property - the name of the property to look up Parameters: search - if true , the property will be looked up on all parent folders if it is not attached to the the resource, if false not (ie. | public String | readProperty(String resourcePath, String property, boolean search, String propertyDefault) Reads the (compound) value of a property mapped to a specified resource
with optional directory upward cascading, a default value will be returned if the property
is not found on the resource (or it's parent folders in case search is set to true ).
Parameters: resourcePath - the resource to look up the property for Parameters: property - the name of the property to look up Parameters: search - if true , the property will be looked up on all parent folders if it is not attached to the the resource, if false not (ie. | public CmsPropertyDefinition | readPropertyDefinition(String name) | public CmsProperty | readPropertyObject(CmsResource resource, String property, boolean search) | public CmsProperty | readPropertyObject(String resourcePath, String property, boolean search) | public List | readPropertyObjects(CmsResource resource, boolean search) Reads all property objects from a resource.
Returns an empty list if no properties are found.
This method is more efficient then using
CmsObject.readPropertyObjects(Stringboolean)
if you already have an instance of the resource to look up the property from.
If the search parameter is true , the properties of all
parent folders of the resource are also read. | public List | readPropertyObjects(String resourcePath, boolean search) Reads all property objects from a resource.
Returns an empty list if no properties are found.
All properties in the result List will be in frozen (read only) state, so you can't change the values.
If the search parameter is true , the properties of all
parent folders of the resource are also read. | public List | readPublishedResources(CmsUUID publishHistoryId) | public CmsResource | readResource(CmsUUID structureID) Reads a resource from the VFS,
using the
CmsResourceFilter.DEFAULT filter.
A resource may be of type
CmsFile or
CmsFolder . | public CmsResource | readResource(CmsUUID structureID, CmsResourceFilter filter) Reads a resource from the VFS,
using the specified resource filter.
A resource may be of type
CmsFile or
CmsFolder . | public I_CmsHistoryResource | readResource(CmsUUID structureID, int version) Reads the historical resource with the given version for the resource given
the given structure id.
A resource may be of type
CmsFile or
CmsFolder . | public CmsResource | readResource(String resourcename) Reads a resource from the VFS,
using the
CmsResourceFilter.DEFAULT filter.
A resource may be of type
CmsFile or
CmsFolder . | public CmsResource | readResource(String resourcename, CmsResourceFilter filter) Reads a resource from the VFS,
using the specified resource filter.
A resource may be of type
CmsFile or
CmsFolder . | public I_CmsHistoryResource | readResourceByPublishTag(CmsUUID structureId, int publishTag) | public List | readResources(String resourcename, CmsResourceFilter filter) | public List | readResources(String resourcename, CmsResourceFilter filter, boolean readTree) | public List | readResourcesWithProperty(String propertyDefinition) | public List | readResourcesWithProperty(String path, String propertyDefinition) | public List | readResourcesWithProperty(String path, String propertyDefinition, String value) | public List | readResourcesWithProperty(String path, String propertyDefinition, String value, CmsResourceFilter filter) | public Set | readResponsiblePrincipals(CmsResource resource) | public Set | readResponsibleUsers(CmsResource resource) | public List | readSiblings(String resourcename, CmsResourceFilter filter) | public String | readStaticExportPublishedResourceParameters(String rfsName) | public List | readStaticExportResources(int parameterResources, long timestamp) | public CmsUser | readUser(CmsUUID userId) | public CmsUser | readUser(String username) | public CmsUser | readUser(String username, String password) | public CmsUser | readWebUser(String username) | public CmsUser | readWebUser(String username, String password) | public void | removeResourceFromProject(String resourcename) Removes a resource from the current project of the user.
This is used to reduce the current users project with the
specified resource, in case that the resource is already part of the project. | public void | removeUserFromGroup(String username, String groupname) | public void | renameResource(String source, String destination) | public void | replaceResource(String resourcename, int type, byte[] content, List properties) | public void | restoreDeletedResource(CmsUUID structureId) | public void | restoreResourceBackup(String resourcename, int publishTag) | public void | restoreResourceVersion(CmsUUID structureId, int version) | public void | rmacc(String resourceName, String principalType, String principalName) | public void | setDateExpired(String resourcename, long dateExpired, boolean recursive) | public void | setDateLastModified(String resourcename, long dateLastModified, boolean recursive) | public void | setDateReleased(String resourcename, long dateReleased, boolean recursive) | public void | setParentGroup(String groupName, String parentGroupName) | public void | setPassword(String username, String newPassword) | public void | setPassword(String username, String oldPassword, String newPassword) | public void | touch(String resourcename, long dateLastModified, long dateReleased, long dateExpired, boolean recursive) Changes the time stamp information of a resource.
This method is used to set the "last modified" date
of a resource, the "release" date of a resource,
and also the "expire" date of a resource.
Parameters: resourcename - the name of the resource to change (full current site relative path) Parameters: dateLastModified - time stamp the new time stamp of the changed resource Parameters: dateReleased - the new release date of the changed resource, set it to CmsResource.TOUCH_DATE_UNCHANGED to keep it unchanged. Parameters: dateExpired - the new expire date of the changed resource. | public void | undeleteResource(String resourcename) | public void | undeleteResource(String resourcename, boolean recursive) | public void | undoChanges(String resourcename, boolean recursive) | public void | undoChanges(String resourcename, CmsResource.CmsResourceUndoMode mode) | public void | unlockProject(CmsUUID id) Unlocks all resources of a project. | public void | unlockProject(int id) Unlocks all resources of a project. | public void | unlockResource(String resourcename) | public boolean | userInGroup(String username, String groupname) | public void | validatePassword(String password) | public CmsFile | writeFile(CmsFile resource) Writes a resource to the OpenCms VFS, including it's content.
Applies only to resources of type
CmsFile
i.e. | public void | writeFileHeader(CmsFile file) | public void | writeGroup(CmsGroup group) | public void | writeHistoryProject(int publishTag, long publishDate) | public void | writeProject(CmsProject project) | public void | writeProperties(String resourceName, Map properties) Writes a couple of properties as structure values for a file or folder. | public void | writeProperties(String name, Map properties, boolean addDefinition) Writes a couple of Properties for a file or folder. | public void | writeProperty(String resourceName, String key, String value) | public void | writeProperty(String resourcename, String key, String value, boolean addDefinition) | public void | writePropertyObject(String resourcename, CmsProperty property) | public void | writePropertyObjects(String resourcename, List properties) | public void | writeResource(CmsResource resource) | public void | writeStaticExportPublishedResource(String resourceName, int linkType, String linkParameter, long timestamp) | public void | writeUser(CmsUser user) Updates the user information. | public void | writeWebUser(CmsUser user) |
CmsObject | public CmsObject(CmsSecurityManager securityManager, CmsRequestContext context)(Code) | | Connects an OpenCms user context to a running database.
Please note: This constructor is internal to OpenCms and not for public use.
If you want to create a new instance of a
CmsObject in your application,
use
org.opencms.main.OpenCms.initCmsObject(String) .
Parameters: securityManager - the security manager Parameters: context - the request context that contains the user authentication |
addRelationToResource | public void addRelationToResource(String resourceName, String targetPath, String type) throws CmsException(Code) | | Adds a new relation to the given resource.
Parameters: resourceName - the name of the source resource Parameters: targetPath - the path of the target resource Parameters: type - the type of the relation throws: CmsException - if something goes wrong |
addUserToGroup | public void addUserToGroup(String username, String groupname) throws CmsException(Code) | | Adds a user to a group.
Parameters: username - the name of the user that is to be added to the group Parameters: groupname - the name of the group throws: CmsException - if something goes wrong |
addWebUser | public CmsUser addWebUser(String name, String password, String group, String description, Map additionalInfos) throws CmsException(Code) | | Creates a new web user.
A web user has no access to the workplace but is able to access personalized
functions controlled by the OpenCms.
Moreover, a web user can be created by any user, the intention being that
a "Guest" user can create a personalized account for himself.
Parameters: name - the name for the new web user Parameters: password - the password for the user Parameters: group - the default group name for the user Parameters: description - the description for the user Parameters: additionalInfos - a Map with additional infos for the user the newly created user throws: CmsException - if something goes wrong |
chacc | public void chacc(String resourceName, String principalType, String principalName, int allowedPermissions, int deniedPermissions, int flags) throws CmsException(Code) | | Changes the access control for a given resource and a given principal(user/group).
Parameters: resourceName - name of the resource Parameters: principalType - the type of the principal (currently group or user): Parameters: principalName - name of the principal Parameters: allowedPermissions - bit set of allowed permissions Parameters: deniedPermissions - bit set of denied permissions Parameters: flags - additional flags of the access control entry throws: CmsException - if something goes wrong |
chacc | public void chacc(String resourceName, String principalType, String principalName, String permissionString) throws CmsException(Code) | | Changes the access control for a given resource and a given principal(user/group).
Parameters: resourceName - name of the resource Parameters: principalType - the type of the principal (group or user): Parameters: principalName - name of the principal Parameters: permissionString - the permissions in the format ((+|-)(r|w|v|c|i|o))* throws: CmsException - if something goes wrong |
changeLock | public void changeLock(String resourcename) throws CmsException(Code) | | Changes the lock of a resource to the current user,
that is "steals" the lock from another user.
This is the "steal lock" operation.
Parameters: resourcename - the name of the resource to change the lock with complete path throws: CmsException - if something goes wrong |
changeResourcesInFolderWithProperty | public List changeResourcesInFolderWithProperty(String resourcename, String property, String oldValue, String newValue, boolean recursive) throws 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: resourcename - the name of the resource to change the property value Parameters: property - the name of the property to change the value Parameters: oldValue - the old value of the property, can be a regular expression Parameters: newValue - the new value of the property 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: CmsException - if operation was not successful |
checkPublishPermissions | public void checkPublishPermissions(CmsPublishList publishList) throws CmsException(Code) | | Checks if the given base publish list can be published by the current user.
Parameters: publishList - the base publish list to check throws: CmsException - in case the publish permissions are not granted |
chflags | public void chflags(String resourcename, int flags) throws CmsException(Code) | | Changes the resource flags of a resource.
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.
Parameters: resourcename - the name of the resource to change the flags for (full current site relative path) Parameters: flags - the new flags for this resource throws: CmsException - if something goes wrong |
chtype | public void chtype(String resourcename, 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: resourcename - the name of the resource to change the type for (full current site relative path) Parameters: type - the new resource type for this resource throws: CmsException - if something goes wrong |
copyResource | public void copyResource(String source, String destination, CmsResource.CmsResourceCopyMode siblingMode) throws CmsException, CmsIllegalArgumentException(Code) | | Copies a resource.
The copied resource will always be locked to the current user
after the copy operation.
The siblingMode parameter controls how to handle siblings
during the copy operation.
Possible values for this parameter are:
Parameters: source - the name of the resource to copy (full current site relative path) Parameters: destination - the name of the copy destination (full current site relative path) Parameters: siblingMode - indicates how to handle siblings during copy throws: CmsException - if something goes wrong throws: CmsIllegalArgumentException - if the destination argument is null or of length 0 |
copyResourceToProject | public void copyResourceToProject(String resourcename) throws CmsException(Code) | | Copies a resource to the current project of the user.
This is used to extend the current users project with the
specified resource, in case that the resource is not yet part of the project.
The resource is not really copied like in a regular copy operation,
it is in fact only "enabled" in the current users project.
Parameters: resourcename - the name of the resource to copy to the current project (full current site relative path) throws: CmsException - if something goes wrong |
countLockedResources | public int countLockedResources(CmsUUID id) throws CmsException(Code) | | Counts the locked resources in a project.
Parameters: id - the id of the project the number of locked resources in this project throws: CmsException - if operation was not successful |
cpacc | public void cpacc(String sourceName, String destName) throws CmsException(Code) | | Copies access control entries of a given resource to another resource.
Already existing access control entries of the destination resource are removed.
Parameters: sourceName - the name of the resource of which the access control entries are copied Parameters: destName - the name of the resource to which the access control entries are applied throws: CmsException - if something goes wrong |
createGroup | public CmsGroup createGroup(String groupFqn, String description, int flags, String parent) throws CmsException(Code) | | Creates a new user group.
Parameters: groupFqn - the name of the new group Parameters: description - the description of the new group Parameters: flags - the flags for the new group Parameters: parent - the parent group (or null ) a CmsGroup object representing the newly created group throws: CmsException - if operation was not successful |
createProject | public CmsProject createProject(String name, String description, String groupname, String managergroupname) throws CmsException(Code) | | Creates a new project.
Parameters: name - the name of the project to create Parameters: description - the description for the new project Parameters: groupname - the name of the project user group Parameters: managergroupname - the name of the project manager group the created project throws: CmsException - if something goes wrong |
createProject | public CmsProject createProject(String name, String description, String groupname, String managergroupname, CmsProject.CmsProjectType projecttype) throws CmsException(Code) | | Creates a new project.
Parameters: name - the name of the project to create Parameters: description - the description for the new project Parameters: groupname - the name of the project user group Parameters: managergroupname - the name of the project manager group Parameters: projecttype - the type of the project (normal or temporary) the created project throws: CmsException - if operation was not successful |
createPropertyDefinition | public CmsPropertyDefinition createPropertyDefinition(String name) throws CmsException(Code) | | Creates a property definition.
Property definitions are valid for all resource types.
Parameters: name - the name of the property definition to create the created property definition throws: CmsException - if something goes wrong |
createResource | public CmsResource createResource(String resourcename, int type, byte[] content, List properties) throws CmsException, CmsIllegalArgumentException(Code) | | Creates a new resource of the given resource type
with the provided content and properties.
Parameters: resourcename - the name of the resource to create (full current site relative path) Parameters: type - the type of the resource to create Parameters: content - the contents for the new resource Parameters: properties - the properties for the new resource the created resource throws: CmsException - if something goes wrong throws: CmsIllegalArgumentException - if the resourcename argument is null or of length 0 |
createSibling | public CmsResource createSibling(String source, String destination, List properties) throws CmsException(Code) | | Creates a new sibling of the source resource.
Parameters: source - the name of the resource to create a sibling for with complete path Parameters: destination - the name of the sibling to create with complete path Parameters: properties - the individual properties for the new sibling the new created sibling throws: CmsException - if something goes wrong |
createTempfileProject | public CmsProject createTempfileProject() throws CmsException(Code) | | Creates the project for the temporary workplace files.
the created project for the temporary workplace files throws: CmsException - if something goes wrong |
createUser | public CmsUser createUser(String userFqn, String password, String description, Map additionalInfos) throws CmsException(Code) | | Creates a new user.
Parameters: userFqn - the name for the new user Parameters: password - the password for the new user Parameters: description - the description for the new user Parameters: additionalInfos - the additional infos for the user the created user throws: CmsException - if something goes wrong |
deleteAllStaticExportPublishedResources | public void deleteAllStaticExportPublishedResources(int linkType) throws CmsException(Code) | | Deletes all published resource entries.
Parameters: linkType - the type of resource deleted (0= non-parameter, 1=parameter) throws: CmsException - if something goes wrong |
deleteBackups | public void deleteBackups(long timestamp, int versions, I_CmsReport report) throws CmsException(Code) | | Deletes the versions from the backup tables that are older then the given time stamp
and/or number of remaining versions.
The number of versions always wins, i.e. if the given time stamp would delete more versions
than given in the versions parameter, the time stamp will be ignored.
Deletion will delete file header, content and properties.
Parameters: timestamp - time stamp which defines the date after which backup resources must be deleted.This parameter must be 0 if the backup should be deleted by number of version Parameters: versions - the number of versions per file which should kept in the system. Parameters: report - the report for output logging throws: CmsException - if something goes wrongCmsObject.deleteHistoricalVersions(String,int,int,long,I_CmsReport) |
deleteGroup | public void deleteGroup(CmsUUID groupId, CmsUUID replacementId) throws CmsException(Code) | | Deletes a group, where all permissions, users and children of the group
are transfered to a replacement group.
Parameters: groupId - 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 |
deleteGroup | public void deleteGroup(String group) throws CmsException(Code) | | Deletes a user group.
Only groups that contain no subgroups can be deleted.
Parameters: group - the name of the group throws: CmsException - if operation was not successful |
deleteHistoricalVersions | public void deleteHistoricalVersions(String folderName, 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.
Parameters: folderName - the name of the folder (with sub resources) 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(CmsUUID id) throws CmsException(Code) | | Deletes a project.
All resources inside the project have to be be reset to their online state.
Parameters: id - the id of the project to delete throws: CmsException - if operation was not successful |
deletePropertyDefinition | public void deletePropertyDefinition(String name) throws CmsException(Code) | | Deletes a property definition.
Parameters: name - the name of the property definition to delete throws: CmsException - if something goes wrong |
deleteRelationsFromResource | public void deleteRelationsFromResource(String resourceName, CmsRelationFilter filter) throws CmsException(Code) | | Deletes the relations to a given resource.
Parameters: resourceName - the resource to delete the relations from Parameters: filter - the filter to use for deleting the relations throws: CmsException - if something goes wrong |
deleteResource | public void deleteResource(String resourcename, CmsResource.CmsResourceDeleteMode siblingMode) throws CmsException(Code) | | Deletes a resource given its name.
The siblingMode parameter controls how to handle siblings
during the delete operation.
Possible values for this parameter are:
Parameters: resourcename - the name of the resource to delete (full current site relative path) Parameters: siblingMode - indicates how to handle siblings of the deleted resource throws: CmsException - if something goes wrong |
deleteStaticExportPublishedResource | public void deleteStaticExportPublishedResource(String resourceName, int linkType, String linkParameter) throws CmsException(Code) | | Deletes a published resource entry.
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(CmsUUID userId) throws CmsException(Code) | | Deletes a user.
Parameters: userId - the id of the user to be deleted throws: CmsException - if operation was not successful |
deleteUser | public void deleteUser(CmsUUID userId, CmsUUID replacementId) throws CmsException(Code) | | Deletes a user, where all permissions and resources attributes of the user
were transfered to a replacement user.
Parameters: userId - the id of the user to be deleted Parameters: replacementId - the id of the user to be transfered, can be null throws: CmsException - if operation was not successful |
deleteUser | public void deleteUser(String username) throws CmsException(Code) | | Deletes a user.
Parameters: username - the name of the user to be deleted throws: CmsException - if operation was not successful |
deleteWebUser | public void deleteWebUser(CmsUUID userId) throws CmsException(Code) | | Deletes a web user.
Parameters: userId - the id of the user to be deleted throws: CmsException - if operation was not successful |
existsResource | public boolean existsResource(String resourcename, CmsResourceFilter filter)(Code) | | Checks the availability of a resource in the VFS,
using the
CmsResourceFilter.DEFAULT filter.
A resource may be of type
CmsFile or
CmsFolder .
The specified filter controls what kind of resources should be "found"
during the read operation. This will depend on the application. For example,
using
CmsResourceFilter.DEFAULT will only return currently
"valid" resources, while using
CmsResourceFilter.IGNORE_EXPIRATION
will ignore the date release / date expired information of the resource.
This method also takes into account the user permissions, so if
the given resource exists, but the current user has not the required
permissions, then this method will return false .
Parameters: resourcename - the name of the resource to check (full current site relative path) Parameters: filter - the resource filter to use while checking true if the resource is available See Also: CmsObject.readResource(String) See Also: CmsObject.readResource(String,CmsResourceFilter) |
getAccessControlEntries | public List getAccessControlEntries(String resourceName) throws CmsException(Code) | | Returns the list of access control entries of a resource given its name.
Parameters: resourceName - the name of the resource a list of CmsAccessControlEntry objects throws: CmsException - if something goes wrong |
getAccessControlEntries | public List getAccessControlEntries(String resourceName, boolean getInherited) throws CmsException(Code) | | Returns the list of access control entries of a resource given its name.
Parameters: resourceName - the name of the resource Parameters: getInherited - true , if inherited access control entries should be returned, too a list of CmsAccessControlEntry objects defining all permissions for the given resource throws: CmsException - if something goes wrong |
getAccessControlList | public CmsAccessControlList getAccessControlList(String resourceName) throws CmsException(Code) | | Returns the access control list (summarized access control entries) of a given resource.
Parameters: resourceName - the name of the resource the access control list of the resource throws: CmsException - if something goes wrong |
getAccessControlList | public CmsAccessControlList getAccessControlList(String resourceName, boolean inheritedOnly) throws CmsException(Code) | | Returns the access control list (summarized access control entries) of a given resource.
If inheritedOnly is set, only inherited access control entries are returned.
Parameters: resourceName - the name of the resource Parameters: inheritedOnly - if set, the non-inherited entries are skipped the access control list of the resource throws: CmsException - if something goes wrong |
getAllAccessibleProjects | public List getAllAccessibleProjects() throws CmsException(Code) | | Returns all projects which are owned by the current user or which are
accessible for the group of the user.
a list of objects of type CmsProject throws: CmsException - if operation was not successful |
getAllManageableProjects | public List getAllManageableProjects() throws CmsException(Code) | | Returns all projects which are owned by the current user or which are manageable
for the group of the user.
a list of objects of type CmsProject throws: CmsException - if operation was not successful |
getBackupTagId | public int getBackupTagId() throws CmsException(Code) | | Returns the next version id for the published backup resources.
int the new version id throws: CmsException - if operation was not successful |
getChildren | public List getChildren(String groupname, boolean includeSubChildren) throws CmsException(Code) | | Returns all child groups of a group.
Parameters: groupname - the name of the group Parameters: includeSubChildren - if set also returns all sub-child groups of the given group a list of all child CmsGroup objects or null throws: CmsException - if operation was not successful |
getFilesInFolder | public List getFilesInFolder(String resourcename, CmsResourceFilter filter) throws CmsException(Code) | | Returns all file resources contained in a folder.
With the
CmsResourceFilter provided as parameter
you can control if you want to include deleted, invisible or
time-invalid resources in the result.
Parameters: resourcename - the full path of the resource to return the child resources for Parameters: filter - the resource filter to use a list of all child file as CmsResource objects throws: CmsException - if something goes wrong |
getGroupsOfUser | public List getGroupsOfUser(String username, boolean directGroupsOnly) throws CmsException(Code) | | Returns all the groups the given user belongs to.
Parameters: username - the name of the user Parameters: directGroupsOnly - if set only the direct assigned groups will be returned, if not also indirect roles a list of CmsGroup objects throws: CmsException - if operation was not successful |
getGroupsOfUser | public List getGroupsOfUser(String username, boolean directGroupsOnly, boolean includeOtherOus) throws CmsException(Code) | | Returns all the groups the given user belongs to.
Parameters: username - the name of the user Parameters: directGroupsOnly - if set only the direct assigned groups will be returned, if not also indirect roles Parameters: includeOtherOus - if to include groups of other organizational units a list of CmsGroup objects throws: CmsException - if operation was not successful |
getGroupsOfUser | public List getGroupsOfUser(String username, boolean directGroupsOnly, boolean includeOtherOus, String remoteAddress) throws CmsException(Code) | | Returns the groups of a user filtered by the specified IP address.
Parameters: username - the name of the user Parameters: directGroupsOnly - if set only the direct assigned groups will be returned, if not also indirect roles Parameters: remoteAddress - the IP address to filter the groups in the result list Parameters: includeOtherOus - if to include groups of other organizational units a list of CmsGroup objects filtered by the specified IP address throws: CmsException - if operation was not successful |
getLock | public CmsLock getLock(CmsResource resource) throws CmsException(Code) | | Returns the edition lock state for a specified resource.
If the resource is waiting to be publish you might get a lock of type
CmsLockType.PUBLISH .
Parameters: resource - the resource to return the edition lock state for the edition lock state for the specified resource throws: CmsException - if something goes wrong |
getLock | public CmsLock getLock(String resourcename) throws CmsException(Code) | | Returns the lock state for a specified resource name.
If the resource is waiting to be publish you might get a lock of type
CmsLockType.PUBLISH .
Parameters: resourcename - the name if the resource to get the lock state for (full current site relative path) the lock state for the specified resource throws: CmsException - if something goes wrong |
getLockedResources | public List getLockedResources(String foldername, CmsLockFilter filter) throws CmsException(Code) | | Returns all locked resources within a folder.
Parameters: foldername - the name of the folder Parameters: filter - the lock filter a list of locked resource paths (relative to current site) throws: CmsException - if operation was not successful |
getLostAndFoundName | public String getLostAndFoundName(String resourcename) throws CmsException(Code) | | Returns the name a resource would have if it were moved to the
"lost and found" folder.
In general, it is the same name as the given resource has, the only exception is
if a resource in the "lost and found" folder with the same name already exists.
In such case, a counter is added to the resource name.
Parameters: resourcename - the name of the resource to get the "lost and found" name for (full current site relative path) the tentative name of the resource inside the "lost and found" folder throws: CmsException - if something goes wrong See Also: CmsObject.moveToLostAndFound(String) |
getParent | public CmsGroup getParent(String groupname) throws CmsException(Code) | | Returns the parent group of a group.
Parameters: groupname - the name of the group group the parent group or null throws: CmsException - if operation was not successful |
getPermissions | public CmsPermissionSet getPermissions(String resourceName) throws CmsException(Code) | | Returns the set of permissions of the current user for a given resource.
Parameters: resourceName - the name of the resource the bit set of the permissions of the current user throws: CmsException - if something goes wrong |
getPermissions | public CmsPermissionSet getPermissions(String resourceName, String userName) throws CmsException(Code) | | Returns the set of permissions of a given user for a given resource.
Parameters: resourceName - the name of the resource Parameters: userName - the name of the user the current permissions on this resource throws: CmsException - if something goes wrong |
getPublishList | public CmsPublishList getPublishList(List directPublishResources, boolean directPublishSiblings, boolean publishSubResources) throws CmsException(Code) | | Returns a publish list with all new/changed/deleted resources of the current (offline)
project that actually get published for a direct publish of a List of resources.
Parameters: directPublishResources - the CmsResource objects which will be directly published Parameters: directPublishSiblings - true , if all eventual siblings of the direct published resources should also get published. Parameters: publishSubResources - indicates if sub-resources in folders should be published (for direct publish only) a publish list throws: CmsException - if something goes wrongOpenCms.getPublishManagerorg.opencms.publish.CmsPublishManager.getPublishList(CmsObjectListbooleanboolean) getPublishList(CmsObject, List, boolean) |
getRequestContext | public CmsRequestContext getRequestContext()(Code) | | Returns the current users request context.
This request context is used to authenticate the user for all
OpenCms operations. It also contains the request runtime settings, e.g.
about the current site this request was made on.
the current users request context |
getResourcesForPrincipal | public List getResourcesForPrincipal(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: 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 |
getResourcesInFolder | public List getResourcesInFolder(String resourcename, CmsResourceFilter filter) throws CmsException(Code) | | Returns all child resources of a resource, that is the resources
contained in a folder.
With the
CmsResourceFilter provided as parameter
you can control if you want to include deleted, invisible or
time-invalid resources in the result.
This method is mainly used by the workplace explorer.
Parameters: resourcename - the full current site relative path of the resource to return the child resources for Parameters: filter - the resource filter to use a list of all child CmsResource s throws: CmsException - if something goes wrong |
getSubFolders | public List getSubFolders(String resourcename, CmsResourceFilter filter) throws CmsException(Code) | | Returns all folder resources contained in a folder.
With the
CmsResourceFilter provided as parameter
you can control if you want to include deleted, invisible or
time-invalid resources in the result.
Parameters: resourcename - the full current site relative path of the resource to return the child resources for. a list of all child folder CmsResource s Parameters: filter - the resource filter to use throws: CmsException - if something goes wrong |
getUsersOfGroup | public List getUsersOfGroup(String groupname) throws CmsException(Code) | | Returns all direct users of a given group.
Users that are "indirectly" in the group are not returned in the result.
Parameters: groupname - the name of the group to get all users for all CmsUser objects in the group throws: CmsException - if operation was not successful |
getUsersOfGroup | public List getUsersOfGroup(String groupname, boolean includeOtherOus) throws CmsException(Code) | | Returns all direct users of a given group.
Users that are "indirectly" in the group are not returned in the result.
Parameters: groupname - the name of the group to get all users for Parameters: includeOtherOus - if the result should include users of other ous all CmsUser objects in the group throws: CmsException - if operation was not successful |
hasPermissions | public boolean hasPermissions(CmsResource resource, CmsPermissionSet requiredPermissions) throws CmsException(Code) | | Checks if the current user has required permissions to access a given resource.
Parameters: resource - the resource to check the permissions for Parameters: requiredPermissions - the set of permissions to check for true if the required permissions are satisfied throws: CmsException - if something goes wrong |
hasPermissions | public boolean hasPermissions(CmsResource resource, CmsPermissionSet requiredPermissions, boolean checkLock, CmsResourceFilter filter) throws CmsException(Code) | | Checks if the current user has required permissions to access a given resource.
Parameters: resource - the resource to check the permissions for Parameters: requiredPermissions - the set of permissions to check for Parameters: checkLock - if true , a lock for the current user is required for all write operations, if false it's ok to write as long as the resourceis not locked by another user. Parameters: filter - the resource filter to use true if the required permissions are satisfied throws: CmsException - if something goes wrong |
hasPublishPermissions | public boolean hasPublishPermissions(String resourcename)(Code) | | Checks if the given resource or the current project can be published by the current user
using his current OpenCms context.
If the resource parameter is null , then the current project is checked,
otherwise the resource is checked for direct publish permissions.
Parameters: resourcename - the direct publish resource name (optional, if null only the current project is checked) true , if the current user can direct publish the given resource in his current context |
hasRole | public boolean hasRole(CmsRole role)(Code) | | Checks if the user of the current OpenCms context
is a member of at last one of the roles in the given role set.
Parameters: role - the role to check true if the user of the current OpenCms context is at a member of at last one of the roles in the given role setOpenCms.getRoleManager |
importAccessControlEntries | public void importAccessControlEntries(CmsResource resource, List acEntries) throws CmsException(Code) | | Writes a list of access control entries as new access control entries of a given resource.
Already existing access control entries of this resource are removed before.
Parameters: resource - the resource to attach the control entries to Parameters: acEntries - a list of CmsAccessControlEntry objects throws: CmsException - if something goes wrong |
importRelation | public void importRelation(String resourceName, String targetPath, String relationType) throws CmsException(Code) | | Imports a new relation to the given resource.
Parameters: resourceName - the name of the source resource Parameters: targetPath - the path of the target resource Parameters: relationType - the type of the relation throws: CmsException - if something goes wrong |
importResource | public CmsResource importResource(String resourcename, CmsResource resource, byte[] content, List properties) throws CmsException(Code) | | Imports a resource to the OpenCms VFS.
If a resource already exists in the VFS (i.e. has the same name and
same id) it is replaced by the imported resource.
If a resource with the same name but a different id exists,
the imported resource is (usually) moved to the "lost and found" folder.
Parameters: resourcename - the name for the resource after import (full current site relative path) Parameters: resource - the resource object to be imported Parameters: content - the content of the resource Parameters: properties - the properties of the resource the imported resource throws: CmsException - if something goes wrong See Also: CmsObject.moveToLostAndFound(String) |
importUser | public CmsUser importUser(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: 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 first name of the user Parameters: lastname - the last name 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 |
importUser | public CmsUser importUser(String id, String name, String password, String description, String firstname, String lastname, String email, String address, int flags, Map additionalInfos) throws CmsException(Code) | | Creates a new user by import.
Parameters: id - the id of the user Parameters: name - the new name for the user Parameters: password - the new password for the user Parameters: description - the description for the user Parameters: firstname - the first name of the user Parameters: lastname - the last name of the user Parameters: email - the email of the user Parameters: address - the address of the user Parameters: flags - the flags for a user (for example I_CmsPrincipal.FLAG_ENABLED ) Parameters: additionalInfos - the additional user infos the imported user throws: CmsException - if something goes wrongCmsObject.importUser(String,String,String,String,String,String,int,long,Map) |
isInsideCurrentProject | public boolean isInsideCurrentProject(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: resourcename - the specified resource name (full current site relative path) true , if the specified resource is inside the current project |
isManagerOfProject | public boolean isManagerOfProject()(Code) | | Checks if the current user has management access to the current project.
true , if the user has management access to the current project |
lockResource | public void lockResource(String resourcename) throws CmsException(Code) | | Locks a resource.
This will be an exclusive, persistent lock that is removed only if the user unlocks it.
Parameters: resourcename - the name of the resource to lock (full current site relative path) throws: CmsException - if something goes wrong |
lockResourceTemporary | public void lockResourceTemporary(String resourcename) throws CmsException(Code) | | Locks a resource temporary.
This will be an exclusive, temporary lock valid only for the current users session.
Usually this should not be used directly, this method is intended for the OpenCms workplace only.
Parameters: resourcename - the name of the resource to lock (full current site relative path) throws: CmsException - if something goes wrong See Also: CmsObject.lockResource(String) |
loginUser | public String loginUser(String username, String password) throws CmsException(Code) | | Logs a user into the Cms, if the password is correct.
Parameters: username - the name of the user Parameters: password - the password of the user the name of the logged in user throws: CmsException - if the login was not successful |
loginUser | public String loginUser(String username, String password, String remoteAddress) throws CmsException(Code) | | Logs a user with a given ip address into the Cms, if the password is correct.
Parameters: username - the name of the user Parameters: password - the password of the user Parameters: remoteAddress - the ip address the name of the logged in user throws: CmsException - if the login was not successful |
loginWebUser | public String loginWebUser(String username, String password) throws CmsException(Code) | | Logs a web user into the Cms, if the password is correct.
Parameters: username - the name of the user Parameters: password - the password of the user the name of the logged in user throws: CmsException - if the login was not successful |
lookupPrincipal | public I_CmsPrincipal lookupPrincipal(CmsUUID principalId)(Code) | | Lookups and reads the user or group with the given UUID.
Parameters: principalId - the uuid of a user or group the user or group with the given UUID |
lookupPrincipal | public I_CmsPrincipal lookupPrincipal(String principalName)(Code) | | Lookups and reads the user or group with the given name.
Parameters: principalName - the name of the user or group the user or group with the given name |
moveResource | public void moveResource(String source, String destination) throws CmsException(Code) | | Moves a resource to the given destination.
A move operation in OpenCms is always a copy (as sibling) followed by a delete,
this is a result of the online/offline structure of the
OpenCms VFS. This way you can see the deleted files/folders in the offline
project, and you will be unable to undelete them.
Parameters: source - the name of the resource to move (full current site relative path) Parameters: destination - the destination resource name (full current site relative path) throws: CmsException - if something goes wrong See Also: CmsObject.renameResource(String,String) |
moveToLostAndFound | public String moveToLostAndFound(String resourcename) throws CmsException(Code) | | Moves a resource to the "lost and found" folder.
The "lost and found" folder is a special system folder.
This operation is used e.g. during import of resources
when a resource with the same name but a different resource ID
already exists in the VFS. In this case, the imported resource is
moved to the "lost and found" folder.
Parameters: resourcename - the name of the resource to move to "lost and found" (full current site relative path) the name of the resource inside the "lost and found" folder throws: CmsException - if something goes wrong See Also: CmsObject.getLostAndFoundName(String) |
readAllAvailableVersions | public List readAllAvailableVersions(String resourceName) throws CmsException(Code) | | Reads all historical versions of a resource.
The reading excludes the file content, if the resource is a file.
Parameters: resourceName - the name of the resource to be read a list of historical resources, as I_CmsHistoryResource objects throws: CmsException - if operation was not successful |
readAllBackupFileHeaders | public List readAllBackupFileHeaders(String filename) throws CmsException(Code) | | Reads all file headers of a file.
This method returns a list with the history of all file headers, i.e.
the file headers of a file, independent of the project they were attached to.
The reading excludes the file content.
Parameters: filename - the name of the file to be read a list of file headers, as I_CmsHistoryResource objects, read from the Cms throws: CmsException - if operation was not successfulCmsObject.readAllAvailableVersions(String) |
readAncestor | public CmsFolder readAncestor(String resourcename, CmsResourceFilter filter) throws CmsException(Code) | | Returns the first ancestor folder matching the filter criteria.
If no folder matching the filter criteria is found, null is returned.
Parameters: resourcename - the name of the resource to start (full current site relative path) Parameters: filter - the resource filter to match while reading the ancestors the first ancestor folder matching the filter criteria or null if no folder was found throws: CmsException - if something goes wrong |
readAncestor | public CmsFolder readAncestor(String resourcename, int type) throws CmsException(Code) | | Returns the first ancestor folder matching the resource type.
If no folder with the requested resource type is found, null is returned.
Parameters: resourcename - the name of the resource to start (full current site relative path) Parameters: type - the resource type of the folder to match the first ancestor folder matching the filter criteria or null if no folder was found throws: CmsException - if something goes wrong |
readBackupFile | public I_CmsHistoryResource readBackupFile(String filename, int publishTag) throws CmsException(Code) | | Returns a resource from the historical archive.
The reading includes the file content, if the resource is a file.
Parameters: filename - the path of the file to be read Parameters: publishTag - the publish tag the file read throws: CmsException - if the user has not the rights to read the file, or if the file couldn't be read.CmsObject.readResource(CmsUUID,int) |
readFolder | public CmsFolder readFolder(String resourcename, CmsResourceFilter filter) throws CmsException(Code) | | Reads a folder resource from the VFS,
using the specified resource filter.
The specified filter controls what kind of resources should be "found"
during the read operation. This will depend on the application. For example,
using
CmsResourceFilter.DEFAULT will only return currently
"valid" resources, while using
CmsResourceFilter.IGNORE_EXPIRATION
will ignore the date release / date expired information of the resource.
Parameters: resourcename - the name of the folder resource to read (full current site relative path) Parameters: filter - the resource filter to use while reading the folder resource that was read throws: CmsException - if the resource could not be read for any reason See Also: CmsObject.readResource(String,CmsResourceFilter) |
readGroup | public CmsGroup readGroup(CmsProject project)(Code) | | Reads the group of a project.
Parameters: project - the project to read the group from the group of the given project |
readGroup | public CmsGroup readGroup(String groupName) throws CmsException(Code) | | Reads a group based on its name.
Parameters: groupName - the name of the group to be read the group that has the provided name throws: CmsException - if something goes wrong |
readHistoryProject | public CmsHistoryProject readHistoryProject(int publishTag) throws CmsException(Code) | | Returns a historical project entry.
Parameters: publishTag - publish tag of the project the requested historical project entry throws: CmsException - if operation was not successful |
readManagerGroup | public CmsGroup readManagerGroup(CmsProject project)(Code) | | Returns the project manager group of a project.
Parameters: project - the project the manager group of the project |
readOwner | public CmsUser readOwner(CmsProject project) throws CmsException(Code) | | Reads the owner of a project.
Parameters: project - the project to read the owner from the owner of the project throws: CmsException - if something goes wrong |
readProject | public CmsProject readProject(CmsUUID id) throws CmsException(Code) | | Reads the project with the given id.
Parameters: id - the id of the project the project with the given id throws: CmsException - if operation was not successful |
readProject | public CmsProject readProject(String name) throws CmsException(Code) | | Reads the project with the given name.
Parameters: name - the name of the project the project with the given name throws: CmsException - if operation was not successful |
readProjectResources | public List readProjectResources(CmsProject project) throws CmsException(Code) | | Returns the list of all resource names that define the "view" of the given project.
Parameters: project - the project to get the project resources for the list of all resource names, as String objects that define the "view" of the given project. throws: CmsException - if something goes wrong |
readProjectView | public List readProjectView(CmsUUID projectId, CmsResourceState state) throws CmsException(Code) | | Reads all resources of a project that match a given state from the VFS.
Possible values for the state parameter are:
Parameters: projectId - the id of the project to read the file resources for Parameters: state - the resource state to match all CmsResource s of a project that match a given criteria from the VFS throws: CmsException - if something goes wrong |
readProperties | public Map readProperties(String resourcePath, boolean search) throws CmsException(Code) | | Reads the (compound) values of all properties mapped to a specified resource
with optional direcory upward cascading.
Parameters: resourcePath - the resource to look up the property for Parameters: search - if true , the properties will also be looked up on all parent folders and the results will be merged, if false not (ie. normal property lookup) Map of String objects representing all properties of the resource throws: CmsException - in case there where problems reading the propertiesCmsObject.readPropertyObjects(String,boolean) |
readProperty | public String readProperty(String resourcePath, String property, boolean search) throws CmsException(Code) | | Reads the (compound) value of a property mapped to a specified resource
with optional direcory upward cascading.
Parameters: resourcePath - the resource to look up the property for Parameters: property - the name of the property to look up Parameters: search - if true , the property will be looked up on all parent folders if it is not attached to the the resource, if false not (ie. normal property lookup) the value of the property found, null if nothing was found throws: CmsException - in case there where problems reading the property See Also: CmsProperty.getValueCmsObject.readPropertyObject(String,String,boolean) |
readProperty | public String readProperty(String resourcePath, String property, boolean search, String propertyDefault) throws CmsException(Code) | | Reads the (compound) value of a property mapped to a specified resource
with optional directory upward cascading, a default value will be returned if the property
is not found on the resource (or it's parent folders in case search is set to true ).
Parameters: resourcePath - the resource to look up the property for Parameters: property - the name of the property to look up Parameters: search - if true , the property will be looked up on all parent folders if it is not attached to the the resource, if false not (ie. normal property lookup) Parameters: propertyDefault - a default value that will be returned if the property was not found on the selected resource the value of the property found, if nothing was found the value of the propertyDefault parameter is returned throws: CmsException - in case there where problems reading the property See Also: CmsProperty.getValueCmsObject.readPropertyObject(String,String,boolean) |
readPropertyDefinition | public CmsPropertyDefinition readPropertyDefinition(String name) throws CmsException(Code) | | Reads a property definition.
If no property definition with the given name is found,
null is returned.
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(CmsResource resource, String property, 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.
This method is more efficient then using
CmsObject.readPropertyObject(StringStringboolean)
if you already have an instance of the resource to look up the property from.
Parameters: resource - the resource where the property is attached to Parameters: property - the property 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 |
readPropertyObject | public CmsProperty readPropertyObject(String resourcePath, String property, 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: resourcePath - the name of resource where the property is attached to Parameters: property - the property 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(CmsResource resource, boolean search) throws CmsException(Code) | | Reads all property objects from a resource.
Returns an empty list if no properties are found.
This method is more efficient then using
CmsObject.readPropertyObjects(Stringboolean)
if you already have an instance of the resource to look up the property from.
If the search parameter is true , the properties of all
parent folders of the resource are also read. The results are merged with the
properties directly attached to the resource. While merging, a property
on a parent folder that has already been found will be ignored.
So e.g. if a resource has a property "Title" attached, and it's parent folder
has the same property attached but with a different value, the result list will
contain only the property with the value from the resource, not form the parent folder(s).
Parameters: resource - the resource where the property is mapped to Parameters: search - if true , the properties of all parent folders of the resource are merged with the resource properties. a list of CmsProperty objects throws: CmsException - if something goes wrong |
readPropertyObjects | public List readPropertyObjects(String resourcePath, boolean search) throws CmsException(Code) | | Reads all property objects from a resource.
Returns an empty list if no properties are found.
All properties in the result List will be in frozen (read only) state, so you can't change the values.
If the search parameter is true , the properties of all
parent folders of the resource are also read. The results are merged with the
properties directly attached to the resource. While merging, a property
on a parent folder that has already been found will be ignored.
So e.g. if a resource has a property "Title" attached, and it's parent folder
has the same property attached but with a different value, the result list will
contain only the property with the value from the resource, not form the parent folder(s).
Parameters: resourcePath - the name of resource where the property is mapped to Parameters: search - if true , the properties of all parent folders of the resource are merged with the resource properties. a list of CmsProperty objects throws: CmsException - if something goes wrong |
readPublishedResources | public List readPublishedResources(CmsUUID publishHistoryId) throws CmsException(Code) | | Reads the resources that were published in a publish task for a given publish history ID.
Parameters: publishHistoryId - unique ID to identify each publish task in the publish history a list of org.opencms.db.CmsPublishedResource objects throws: CmsException - if something goes wrong |
readResource | public CmsResource readResource(CmsUUID structureID, CmsResourceFilter filter) throws CmsException(Code) | | Reads a resource from the VFS,
using the specified resource filter.
A resource may be of type
CmsFile or
CmsFolder . In case of
a file, the resource will not contain the binary file content. Since reading
the binary content is a cost-expensive database operation, it's recommended
to work with resources if possible, and only read the file content when absolutely
required. To "upgrade" a resource to a file,
use
CmsObject.readFile(CmsResource) .
The specified filter controls what kind of resources should be "found"
during the read operation. This will depend on the application. For example,
using
CmsResourceFilter.DEFAULT will only return currently
"valid" resources, while using
CmsResourceFilter.IGNORE_EXPIRATION
will ignore the date release / date expired information of the resource.
Parameters: structureID - the structure ID of the resource to read Parameters: filter - the resource filter to use while reading the resource that was read throws: CmsException - if the resource could not be read for any reason See Also: CmsObject.readFile(String,CmsResourceFilter) See Also: CmsObject.readFolder(String,CmsResourceFilter) |
readResource | public I_CmsHistoryResource readResource(CmsUUID structureID, int version) throws CmsException, CmsVfsResourceNotFoundException(Code) | | Reads the historical resource with the given version for the resource given
the given structure id.
A resource may be of type
CmsFile or
CmsFolder . In case of a file, the resource will not
contain the binary file content. Since reading the binary content is a
cost-expensive database operation, it's recommended to work with resources
if possible, and only read the file content when absolutely required. To
"upgrade" a resource to a file, use
CmsObject.readFile(CmsResource) .
Please note that historical versions are just generated during publishing,
so the first version with version number 1 is generated during publishing
of a new resource (exception is a new sibling, that may also contain some
relevant versions of already published siblings) and the last version
available is the version of the current online resource.
Parameters: structureID - the structure ID of the resource to read Parameters: version - the version number you want to retrieve the resource that was read throws: CmsException - if the resource could not be read for any reason throws: CmsVfsResourceNotFoundException - if the version does not exists See Also: CmsObject.restoreResourceVersion(CmsUUID,int) |
readResource | public CmsResource readResource(String resourcename, CmsResourceFilter filter) throws CmsException(Code) | | Reads a resource from the VFS,
using the specified resource filter.
A resource may be of type
CmsFile or
CmsFolder . In case of
a file, the resource will not contain the binary file content. Since reading
the binary content is a cost-expensive database operation, it's recommended
to work with resources if possible, and only read the file content when absolutely
required. To "upgrade" a resource to a file,
use
CmsObject.readFile(CmsResource) .
The specified filter controls what kind of resources should be "found"
during the read operation. This will depend on the application. For example,
using
CmsResourceFilter.DEFAULT will only return currently
"valid" resources, while using
CmsResourceFilter.IGNORE_EXPIRATION
will ignore the date release / date expired information of the resource.
Parameters: resourcename - the name of the resource to read (full current site relative path) Parameters: filter - the resource filter to use while reading the resource that was read throws: CmsException - if the resource could not be read for any reason See Also: CmsObject.readFile(String,CmsResourceFilter) See Also: CmsObject.readFolder(String,CmsResourceFilter) |
readResources | public List readResources(String resourcename, CmsResourceFilter filter, boolean readTree) throws CmsException(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: resourcename - the parent path to read the resources from Parameters: filter - the filter Parameters: readTree - true to read all sub resources a list of CmsResource objects matching the filter criteria throws: CmsException - if something goes wrong |
readResourcesWithProperty | public List readResourcesWithProperty(String propertyDefinition) throws CmsException(Code) | | Reads all resources that have a value set for the specified property.
Both individual and shared properties of a resource are checked.
Will use the
CmsResourceFilter.ALL resource filter.
Parameters: propertyDefinition - the name of the property to check for a list of all CmsResource objects that have a value set for the specified property. throws: CmsException - if something goes wrong |
readResourcesWithProperty | public List readResourcesWithProperty(String path, String propertyDefinition) throws CmsException(Code) | | Reads all resources that have a value set for the specified property in the given path.
Both individual and shared properties of a resource are checked.
Will use the
CmsResourceFilter.ALL resource filter.
Parameters: path - the folder to get the resources with the property from Parameters: propertyDefinition - the name of the property to check for all CmsResource objects that have a value set for the specified property in the given path. throws: CmsException - if something goes wrong |
readResourcesWithProperty | public List readResourcesWithProperty(String path, String propertyDefinition, String value) throws CmsException(Code) | | Reads all resources that have a value (containing the specified value) set
for the specified property 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.
Will use the
CmsResourceFilter.ALL resource filter.
Parameters: path - the folder to get the resources with the property from Parameters: propertyDefinition - the name of the property to check for Parameters: value - the string to search in the value of the property all CmsResource objects that have a value set for the specified property in the given path. throws: CmsException - if something goes wrong |
readResourcesWithProperty | public List readResourcesWithProperty(String path, String propertyDefinition, String value, CmsResourceFilter filter) throws CmsException(Code) | | Reads all resources that have a value (containing the specified value) set
for the specified property 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.
Will use the given resource filter.
Parameters: path - the folder to get the resources with the property from Parameters: propertyDefinition - the name of the property 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 all CmsResource objects that have a value set for the specified property in the given path. throws: CmsException - if something goes wrong |
readResponsiblePrincipals | public Set readResponsiblePrincipals(CmsResource resource) throws CmsException(Code) | | Returns a set of principals that are responsible for a specific resource.
Parameters: resource - the resource to get the responsible principals from the set of principals that are responsible for a specific resource throws: CmsException - if something goes wrong |
readResponsibleUsers | public Set readResponsibleUsers(CmsResource resource) throws CmsException(Code) | | Returns a set of users that are responsible for a specific resource.
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(String resourcename, 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.
Parameters: resourcename - the name of the specified resource Parameters: filter - a resource filter a list of CmsResource s that are siblings to the specified resource, including the specified resource itself. throws: CmsException - if something goes wrong |
readStaticExportPublishedResourceParameters | public String readStaticExportPublishedResourceParameters(String rfsName) throws CmsException(Code) | | Returns the parameters of a resource in the list of all published template resources.
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(int parameterResources, long timestamp) throws CmsException(Code) | | Returns a list of all template resources which must be processed during a static export.
Parameters: parameterResources - flag for reading resources with parameters (1) or without (0) Parameters: timestamp - a time stamp 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(String username) throws CmsException(Code) | | Reads a user based on its name.
Parameters: username - the name of the user to be read the user with the given name throws: CmsException - if something goes wrong |
readUser | public CmsUser readUser(String username, String password) throws CmsException(Code) | | Returns a user, if the password is correct.
If the user/pwd pair is not valid a
CmsException is thrown.
Parameters: username - the name of the user to be returned Parameters: password - the password of the user to be returned the validated user throws: CmsException - if operation was not successful |
readWebUser | public CmsUser readWebUser(String username) throws CmsException(Code) | | Returns a web user.
Parameters: username - the user name of the web user that is to be read the web user throws: CmsException - if operation was not successful |
readWebUser | public CmsUser readWebUser(String username, String password) throws CmsException(Code) | | Returns a web user if the password for the user is correct.
If the user/password pair is not valid a
CmsException is thrown.
Parameters: username - the user name of the user that is to be read Parameters: password - the password of the user that is to be read a web user throws: CmsException - if something goes wrong |
removeResourceFromProject | public void removeResourceFromProject(String resourcename) throws CmsException(Code) | | Removes a resource from the current project of the user.
This is used to reduce the current users project with the
specified resource, in case that the resource is already part of the project.
The resource is not really removed like in a regular copy operation,
it is in fact only "disabled" in the current users project.
Parameters: resourcename - the name of the resource to remove to the current project (full current site relative path) throws: CmsException - if something goes wrong |
removeUserFromGroup | public void removeUserFromGroup(String username, String groupname) throws CmsException(Code) | | Removes a user from a group.
Parameters: username - the name of the user that is to be removed from the group Parameters: groupname - the name of the group throws: CmsException - if operation was not successful |
renameResource | public void renameResource(String source, String destination) throws CmsException(Code) | | Renames a resource to the given destination name,
this is identical to a move operation.
Parameters: source - the name of the resource to rename (full current site relative path) Parameters: destination - the new resource name (full path) throws: CmsException - if something goes wrong See Also: CmsObject.moveResource(String,String) |
replaceResource | public void replaceResource(String resourcename, int type, byte[] content, List properties) throws CmsException(Code) | | Replaces the content, type and properties of a resource.
Parameters: resourcename - the name of the resource to replace (full current site relative path) Parameters: type - the new type of the resource Parameters: content - the new content of the resource Parameters: properties - the new properties of the resource throws: CmsException - if something goes wrong |
restoreResourceBackup | public void restoreResourceBackup(String resourcename, int publishTag) throws CmsException(Code) | | Restores a file in the current project with a version from the backup archive.
Parameters: resourcename - the name of the resource to restore from the archive (full current site relative path) Parameters: publishTag - the desired tag ID of the resource throws: CmsException - if something goes wrongCmsObject.restoreResourceVersion(CmsUUID,int) |
restoreResourceVersion | public void restoreResourceVersion(CmsUUID structureId, int version) throws CmsException(Code) | | Restores a resource in the current project with a version from the historical archive.
Parameters: structureId - the structure id of the resource to restore from the archive Parameters: version - the desired version of the resource to be restored throws: CmsException - if something goes wrong See Also: CmsObject.readResource(CmsUUID,int) |
rmacc | public void rmacc(String resourceName, String principalType, String principalName) throws CmsException(Code) | | Removes an access control entry of a given principal from a given resource.
Parameters: resourceName - name of the resource Parameters: principalType - the type of the principal (currently group or user) Parameters: principalName - the name of the principal throws: CmsException - if something goes wrong |
setDateExpired | public void setDateExpired(String resourcename, long dateExpired, boolean recursive) throws CmsException(Code) | | Changes the "expire" date of a resource.
Parameters: resourcename - the name of the resource to change (full current site relative path) Parameters: dateExpired - the new expire date of the changed resource Parameters: recursive - if this operation is to be applied recursively to all resources in a folder throws: CmsException - if something goes wrong |
setDateLastModified | public void setDateLastModified(String resourcename, long dateLastModified, boolean recursive) throws CmsException(Code) | | Changes the "last modified" time stamp of a resource.
Parameters: resourcename - the name of the resource to change (full current site relative path) Parameters: dateLastModified - time stamp the new time stamp of the changed resource Parameters: recursive - if this operation is to be applied recursively to all resources in a folder throws: CmsException - if something goes wrong |
setDateReleased | public void setDateReleased(String resourcename, long dateReleased, boolean recursive) throws CmsException(Code) | | Changes the "release" date of a resource.
Parameters: resourcename - the name of the resource to change (full current site relative path) Parameters: dateReleased - the new release date of the changed resource Parameters: recursive - if this operation is to be applied recursively to all resources in a folder throws: CmsException - if something goes wrong |
setParentGroup | public void setParentGroup(String groupName, String parentGroupName) throws CmsException(Code) | | Sets a new parent-group for an already existing group.
Parameters: groupName - the name of the group that should be updated 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 |
setPassword | public void setPassword(String username, String newPassword) throws CmsException(Code) | | Sets the password for a user.
Parameters: username - the name of the user Parameters: newPassword - the new password throws: CmsException - if operation was not successful |
setPassword | public void setPassword(String username, String oldPassword, String newPassword) throws CmsException(Code) | | Sets the password for a specified user.
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 |
touch | public void touch(String resourcename, long dateLastModified, long dateReleased, long dateExpired, boolean recursive) throws CmsException(Code) | | Changes the time stamp information of a resource.
This method is used to set the "last modified" date
of a resource, the "release" date of a resource,
and also the "expire" date of a resource.
Parameters: resourcename - the name of the resource to change (full current site relative path) Parameters: dateLastModified - time stamp the new time stamp of the changed resource Parameters: dateReleased - the new release date of the changed resource, set it to CmsResource.TOUCH_DATE_UNCHANGED to keep it unchanged. Parameters: dateExpired - the new expire date of the changed resource. set it to CmsResource.TOUCH_DATE_UNCHANGED to keep it unchanged. Parameters: recursive - if this operation is to be applied recursively to all resources in a folderCmsObject.setDateLastModified(String,long,boolean)CmsObject.setDateReleased(String,long,boolean)CmsObject.setDateExpired(String,long,boolean) throws: CmsException - if something goes wrong |
undeleteResource | public void undeleteResource(String resourcename) throws CmsException(Code) | | Undeletes a resource (this is the same operation as "undo changes").
Only resources that have already been published once can be undeleted,
if a "new" resource is deleted it can not be undeleted.
Internally, this method undoes all changes to a resource by restoring
the version from the online project, that is to the state of last
publishing.
Parameters: resourcename - the name of the resource to undelete (full path) throws: CmsException - if something goes wrongCmsObject.undeleteResource(String,boolean) |
undeleteResource | public void undeleteResource(String resourcename, boolean recursive) throws CmsException(Code) | | Undeletes a resource.
Only resources that have already been published once can be undeleted,
if a "new" resource is deleted it can not be undeleted.
Parameters: resourcename - the name of the resource to undelete Parameters: recursive - if this operation is to be applied recursively to all resources in a folder throws: CmsException - if something goes wrong See Also: CmsObject.undoChanges(StringCmsResource.CmsResourceUndoMode) |
undoChanges | public void undoChanges(String resourcename, boolean recursive) throws CmsException(Code) | | Undoes all changes to a resource by restoring the version from the
online project to the current offline project.
Parameters: resourcename - the name of the resource to undo the changes for (full path) Parameters: recursive - if this operation is to be applied recursively to all resources in a folder throws: CmsException - if something goes wrongCmsObject.undoChanges(String,CmsResource.CmsResourceUndoMode) |
unlockProject | public void unlockProject(CmsUUID id) throws CmsException(Code) | | Unlocks all resources of a project.
Parameters: id - the id of the project to be unlocked throws: CmsException - if operation was not successful |
unlockResource | public void unlockResource(String resourcename) throws CmsException(Code) | | Unlocks a resource.
Parameters: resourcename - the name of the resource to unlock (full current site relative path) throws: CmsException - if something goes wrong |
userInGroup | public boolean userInGroup(String username, String groupname) throws CmsException(Code) | | Tests if a user is member of the given group.
Parameters: username - the name of the user to test Parameters: groupname - the name of the group to test true , if the user is in the group; or false otherwise throws: CmsException - if operation was not successful |
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 |
writeFile | public CmsFile writeFile(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: resource - the resource to write the written resource (may have been modified) throws: CmsException - if something goes wrong |
writeGroup | public void writeGroup(CmsGroup group) throws CmsException(Code) | | Writes an already existing group.
The group has to be a valid OpenCms group.
The group will be completely overridden by the given data.
Parameters: group - the group that should be written throws: CmsException - if operation was not successful |
writeHistoryProject | public void writeHistoryProject(int publishTag, long publishDate) throws CmsException(Code) | | Creates a historical entry of the current project.
Parameters: publishTag - the correlative publish tag Parameters: publishDate - the date of publishing throws: CmsException - if operation was not successful |
writeProject | public void writeProject(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: project - the project that should be written throws: CmsException - if operation was not successful |
writeProperties | public void writeProperties(String resourceName, Map properties) throws CmsException(Code) | | Writes a couple of properties as structure values for a file or folder.
Parameters: resourceName - the resource-name of which the Property has to be set Parameters: properties - a map with property-definitions and property values as Strings throws: CmsException - if operation was not successfulCmsObject.writePropertyObjects(String,List) |
writeProperties | public void writeProperties(String name, Map properties, boolean addDefinition) throws CmsException(Code) | | Writes a couple of Properties for a file or folder.
Parameters: name - the resource-name of which the Property has to be set Parameters: properties - a map with property-definitions and property values as Strings Parameters: addDefinition - flag to indicate if unknown definitions should be added throws: CmsException - if operation was not successfulCmsObject.writePropertyObjects(String,List) |
writeProperty | public void writeProperty(String resourcename, String key, String value, boolean addDefinition) throws CmsException(Code) | | Writes a property for a file or folder.
Parameters: resourcename - the resource-name for which the property will be set Parameters: key - the property-definition name Parameters: value - the value for the property to be set Parameters: addDefinition - flag to indicate if unknown definitions should be added throws: CmsException - if operation was not successfulCmsObject.writePropertyObject(String,CmsProperty) |
writePropertyObject | public void writePropertyObject(String resourcename, CmsProperty property) throws CmsException(Code) | | Writes a property for a specified resource.
Parameters: resourcename - the name of resource with complete path Parameters: property - the property to write throws: CmsException - if something goes wrong |
writePropertyObjects | public void writePropertyObjects(String resourcename, List properties) throws CmsException(Code) | | Writes a list of properties for a specified resource.
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.
Parameters: resourcename - the name of resource with complete path Parameters: properties - the list of properties to write throws: CmsException - if something goes wrong |
writeResource | public void writeResource(CmsResource resource) throws CmsException(Code) | | Writes a resource.
Parameters: resource - the file to write throws: CmsException - if resource type is set to folder, orif the user has not the rights to write the file header. |
writeStaticExportPublishedResource | public void writeStaticExportPublishedResource(String resourceName, int linkType, String linkParameter, long timestamp) throws CmsException(Code) | | Writes a published resource entry.
This is done during static export.
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(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 overriden
by the given data.
Parameters: user - the user to be written throws: CmsException - if operation was not successful |
writeWebUser | public void writeWebUser(CmsUser user) throws CmsException(Code) | | Updates the user information of a web user.
Only a web user can be updated this way.
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: user - the user to be written throws: CmsException - if operation was not successful |
|
|