Java Doc for CmsObject.java in  » Content-Management-System » opencms » org » opencms » file » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » opencms » org.opencms.file 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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



Field Summary
protected  CmsRequestContextm_context
     The request context.
protected  CmsSecurityManagerm_securityManager
     The security manager to access the cms.

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  voidaddRelationToResource(String resourceName, String targetPath, String type)
    
public  voidaddUserToGroup(String username, String groupname)
    
public  CmsUseraddWebUser(String name, String password, String group, String description, Map additionalInfos)
    
public  voidbackupProject(int versionId, long publishDate)
    
public  voidchacc(String resourceName, String principalType, String principalName, int allowedPermissions, int deniedPermissions, int flags)
    
public  voidchacc(String resourceName, String principalType, String principalName, String permissionString)
    
public  voidchangeLock(String resourcename)
    
public  ListchangeResourcesInFolderWithProperty(String resourcename, String property, String oldValue, String newValue, boolean recursive)
    
public  voidcheckPublishPermissions(CmsPublishList publishList)
    
public  voidcheckRole(CmsRole role)
    
public  voidchflags(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  voidchtype(String resourcename, int type)
     Changes the resource type of a resource.

OpenCms handles resources according to the resource type, not the file suffix.

public  voidcopyResource(String source, String destination)
    
public  voidcopyResource(String source, String destination, CmsResource.CmsResourceCopyMode siblingMode)
    
public  voidcopyResource(String source, String destination, int siblingMode)
    
public  voidcopyResourceToProject(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  intcountLockedResources(CmsUUID id)
    
public  intcountLockedResources(int id)
    
public  voidcpacc(String sourceName, String destName)
    
public  CmsGroupcreateGroup(String groupFqn, String description, int flags, String parent)
    
public  CmsProjectcreateProject(String name, String description, String groupname, String managergroupname)
    
public  CmsProjectcreateProject(String name, String description, String groupname, String managergroupname, CmsProject.CmsProjectType projecttype)
    
public  CmsProjectcreateProject(String name, String description, String groupname, String managergroupname, int projecttype)
    
public  CmsPropertyDefinitioncreatePropertyDefinition(String name)
    
public  CmsResourcecreateResource(String resourcename, int type)
    
public  CmsResourcecreateResource(String resourcename, int type, byte[] content, List properties)
    
public  CmsResourcecreateSibling(String source, String destination, List properties)
    
public  CmsProjectcreateTempfileProject()
    
public  CmsUsercreateUser(String userFqn, String password, String description, Map additionalInfos)
    
public  voiddeleteAllStaticExportPublishedResources(int linkType)
    
public  voiddeleteBackups(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  voiddeleteGroup(CmsUUID groupId, CmsUUID replacementId)
    
public  voiddeleteGroup(String group)
    
public  voiddeleteHistoricalVersions(String folderName, int versionsToKeep, int versionsDeleted, long timeDeleted, I_CmsReport report)
    
public  voiddeleteProject(CmsUUID id)
    
public  voiddeleteProject(int id)
    
public  voiddeleteProperty(String resourcename, String key)
    
public  voiddeletePropertyDefinition(String name)
    
public  voiddeleteRelationsFromResource(String resourceName, CmsRelationFilter filter)
    
public  voiddeleteResource(String resourcename, CmsResource.CmsResourceDeleteMode siblingMode)
    
public  voiddeleteResource(String resourcename, int siblingMode)
    
public  voiddeleteStaticExportPublishedResource(String resourceName, int linkType, String linkParameter)
    
public  voiddeleteUser(CmsUUID userId)
    
public  voiddeleteUser(CmsUUID userId, CmsUUID replacementId)
    
public  voiddeleteUser(String username)
    
public  voiddeleteWebUser(CmsUUID userId)
    
public  booleanexistsResource(String resourcename)
    
public  booleanexistsResource(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  ListgetAccessControlEntries(String resourceName)
    
public  ListgetAccessControlEntries(String resourceName, boolean getInherited)
    
public  CmsAccessControlListgetAccessControlList(String resourceName)
    
public  CmsAccessControlListgetAccessControlList(String resourceName, boolean inheritedOnly)
    
public  ListgetAllAccessibleProjects()
    
public  ListgetAllBackupProjects()
    
public  ListgetAllHistoricalProjects()
    
public  ListgetAllManageableProjects()
    
public  intgetBackupTagId()
    
public  ListgetChild(String groupname)
    
public  ListgetChildren(String groupname, boolean includeSubChildren)
    
public  ListgetChilds(String groupname)
    
public  ListgetDirectGroupsOfUser(String username)
    
public  ListgetFilesInFolder(String resourcename)
    
public  ListgetFilesInFolder(String resourcename, CmsResourceFilter filter)
    
public  ListgetGroups()
    
public  ListgetGroupsOfUser(String username)
    
public  ListgetGroupsOfUser(String username, boolean directGroupsOnly)
    
public  ListgetGroupsOfUser(String username, boolean directGroupsOnly, boolean includeOtherOus)
    
public  ListgetGroupsOfUser(String username, boolean directGroupsOnly, boolean includeOtherOus, String remoteAddress)
    
public  ListgetGroupsOfUser(String username, String remoteAddress)
    
public  CmsLockgetLock(CmsResource resource)
    
public  CmsLockgetLock(String resourcename)
    
public  ListgetLockedResources(String foldername, CmsLockFilter filter)
    
public  StringgetLostAndFoundName(String resourcename)
     Returns the name a resource would have if it were moved to the "lost and found" folder.
public  CmsGroupgetParent(String groupname)
    
public  CmsPermissionSetgetPermissions(String resourceName)
    
public  CmsPermissionSetgetPermissions(String resourceName, String userName)
    
public  CmsPublishListgetPublishList()
    
public  CmsPublishListgetPublishList(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  CmsPublishListgetPublishList(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  CmsPublishListgetPublishList(List directPublishResources, boolean directPublishSiblings, boolean publishSubResources)
    
public  ListgetRelationsForResource(String resourceName, CmsRelationFilter filter)
    
public  CmsRequestContextgetRequestContext()
     Returns the current users request context.

This request context is used to authenticate the user for all OpenCms operations.

public  ListgetResourcesForPrincipal(CmsUUID principalId, CmsPermissionSet permissions, boolean includeAttr)
    
public  ListgetResourcesInFolder(String resourcename, CmsResourceFilter filter)
    
public  ListgetResourcesInTimeRange(String folder, long starttime, long endtime)
    
public  StringgetSitePath(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  ListgetSubFolders(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  ListgetSubFolders(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  ListgetUsers()
    
public  ListgetUsersOfGroup(String groupname)
    
public  ListgetUsersOfGroup(String groupname, boolean includeOtherOus)
    
public  booleanhasPermissions(CmsResource resource, CmsPermissionSet requiredPermissions)
    
public  booleanhasPermissions(CmsResource resource, CmsPermissionSet requiredPermissions, boolean checkLock, CmsResourceFilter filter)
    
public  booleanhasPublishPermissions(String resourcename)
    
public  booleanhasRole(CmsRole role)
    
public  voidimportAccessControlEntries(CmsResource resource, List acEntries)
    
public  voidimportRelation(String resourceName, String targetPath, String relationType)
    
public  CmsResourceimportResource(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  CmsUserimportUser(String id, String name, String password, String firstname, String lastname, String email, int flags, long dateCreated, Map additionalInfos)
    
public  CmsUserimportUser(String id, String name, String password, String description, String firstname, String lastname, String email, String address, int flags, Map additionalInfos)
    
public  booleanisAdmin()
    
public  booleanisInsideCurrentProject(String resourcename)
     Checks if the specified resource is inside the current project.

The project "view" is determined by a set of path prefixes.

public  booleanisManagerOfProject()
    
public  voidlockResource(String resourcename)
    
public  voidlockResource(String resourcename, int mode)
    
public  voidlockResourceTemporary(String resourcename)
     Locks a resource temporary.

This will be an exclusive, temporary lock valid only for the current users session.

public  StringloginUser(String username, String password)
    
public  StringloginUser(String username, String password, String remoteAddress)
    
public  StringloginWebUser(String username, String password)
     Logs a web user into the Cms, if the password is correct.
public  I_CmsPrincipallookupPrincipal(CmsUUID principalId)
    
public  I_CmsPrincipallookupPrincipal(String principalName)
    
public  voidmoveResource(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  StringmoveToLostAndFound(String resourcename)
     Moves a resource to the "lost and found" folder.

The "lost and found" folder is a special system folder.

public  CmsUUIDpublishProject()
    
public  CmsUUIDpublishProject(I_CmsReport report)
    
public  CmsUUIDpublishProject(I_CmsReport report, CmsPublishList publishList)
    
public  CmsUUIDpublishProject(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  CmsUUIDpublishResource(String resourcename)
    
public  CmsUUIDpublishResource(String resourcename, boolean publishSiblings, I_CmsReport report)
    
public  ListreadAllAvailableVersions(String resourceName)
    
public  ListreadAllBackupFileHeaders(String filename)
     Reads all file headers of a file.
This method returns a list with the history of all file headers, i.e.
public  ListreadAllPropertyDefinitions()
    
public  CmsFolderreadAncestor(String resourcename, CmsResourceFilter filter)
    
public  CmsFolderreadAncestor(String resourcename, int type)
    
public  I_CmsHistoryResourcereadBackupFile(CmsUUID structureId, int publishTag)
    
public  I_CmsHistoryResourcereadBackupFile(String filename, int publishTag)
    
public  CmsHistoryProjectreadBackupProject(int tagId)
    
public  ListreadBackupPropertyObjects(I_CmsHistoryResource resource)
    
public  CmsResourcereadDefaultFile(String resourceNameOrID)
    
public  ListreadDeletedResources(String resourcename, boolean readTree)
    
public  CmsFilereadFile(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  CmsFilereadFile(String resourcename)
    
public  CmsFilereadFile(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  CmsResourcereadFileHeader(String resourcename)
    
public  CmsFolderreadFolder(String resourcename)
    
public  CmsFolderreadFolder(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  CmsGroupreadGroup(CmsProject project)
    
public  CmsGroupreadGroup(CmsUUID groupId)
    
public  CmsGroupreadGroup(String groupName)
    
public  CmsHistoryPrincipalreadHistoryPrincipal(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  CmsHistoryProjectreadHistoryProject(int publishTag)
    
public  ListreadHistoryPropertyObjects(I_CmsHistoryResource resource)
    
public  CmsGroupreadManagerGroup(CmsProject project)
    
public  CmsUserreadOwner(CmsProject project)
    
public  ListreadPath(String path, CmsResourceFilter filter)
    
public  CmsProjectreadProject(CmsUUID id)
    
public  CmsProjectreadProject(int id)
    
public  CmsProjectreadProject(String name)
    
public  ListreadProjectResources(CmsProject project)
    
public  ListreadProjectView(CmsUUID projectId, CmsResourceState state)
    
public  ListreadProjectView(int projectId, CmsResourceState state)
    
public  ListreadProjectView(int projectId, int state)
    
public  MapreadProperties(String resourcePath)
    
public  MapreadProperties(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  StringreadProperty(String resourcePath, String property)
    
public  StringreadProperty(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  StringreadProperty(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  CmsPropertyDefinitionreadPropertyDefinition(String name)
    
public  CmsPropertyreadPropertyObject(CmsResource resource, String property, boolean search)
    
public  CmsPropertyreadPropertyObject(String resourcePath, String property, boolean search)
    
public  ListreadPropertyObjects(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  ListreadPropertyObjects(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  ListreadPublishedResources(CmsUUID publishHistoryId)
    
public  CmsResourcereadResource(CmsUUID structureID)
     Reads a resource from the VFS, using the CmsResourceFilter.DEFAULT filter.

A resource may be of type CmsFile or CmsFolder .

public  CmsResourcereadResource(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_CmsHistoryResourcereadResource(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  CmsResourcereadResource(String resourcename)
     Reads a resource from the VFS, using the CmsResourceFilter.DEFAULT filter.

A resource may be of type CmsFile or CmsFolder .

public  CmsResourcereadResource(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_CmsHistoryResourcereadResourceByPublishTag(CmsUUID structureId, int publishTag)
    
public  ListreadResources(String resourcename, CmsResourceFilter filter)
    
public  ListreadResources(String resourcename, CmsResourceFilter filter, boolean readTree)
    
public  ListreadResourcesWithProperty(String propertyDefinition)
    
public  ListreadResourcesWithProperty(String path, String propertyDefinition)
    
public  ListreadResourcesWithProperty(String path, String propertyDefinition, String value)
    
public  ListreadResourcesWithProperty(String path, String propertyDefinition, String value, CmsResourceFilter filter)
    
public  SetreadResponsiblePrincipals(CmsResource resource)
    
public  SetreadResponsibleUsers(CmsResource resource)
    
public  ListreadSiblings(String resourcename, CmsResourceFilter filter)
    
public  StringreadStaticExportPublishedResourceParameters(String rfsName)
    
public  ListreadStaticExportResources(int parameterResources, long timestamp)
    
public  CmsUserreadUser(CmsUUID userId)
    
public  CmsUserreadUser(String username)
    
public  CmsUserreadUser(String username, String password)
    
public  CmsUserreadWebUser(String username)
    
public  CmsUserreadWebUser(String username, String password)
    
public  voidremoveResourceFromProject(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  voidremoveUserFromGroup(String username, String groupname)
    
public  voidrenameResource(String source, String destination)
    
public  voidreplaceResource(String resourcename, int type, byte[] content, List properties)
    
public  voidrestoreDeletedResource(CmsUUID structureId)
    
public  voidrestoreResourceBackup(String resourcename, int publishTag)
    
public  voidrestoreResourceVersion(CmsUUID structureId, int version)
    
public  voidrmacc(String resourceName, String principalType, String principalName)
    
public  voidsetDateExpired(String resourcename, long dateExpired, boolean recursive)
    
public  voidsetDateLastModified(String resourcename, long dateLastModified, boolean recursive)
    
public  voidsetDateReleased(String resourcename, long dateReleased, boolean recursive)
    
public  voidsetParentGroup(String groupName, String parentGroupName)
    
public  voidsetPassword(String username, String newPassword)
    
public  voidsetPassword(String username, String oldPassword, String newPassword)
    
public  voidtouch(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  voidundeleteResource(String resourcename)
    
public  voidundeleteResource(String resourcename, boolean recursive)
    
public  voidundoChanges(String resourcename, boolean recursive)
    
public  voidundoChanges(String resourcename, CmsResource.CmsResourceUndoMode mode)
    
public  voidunlockProject(CmsUUID id)
     Unlocks all resources of a project.
public  voidunlockProject(int id)
     Unlocks all resources of a project.
public  voidunlockResource(String resourcename)
    
public  booleanuserInGroup(String username, String groupname)
    
public  voidvalidatePassword(String password)
    
public  CmsFilewriteFile(CmsFile resource)
     Writes a resource to the OpenCms VFS, including it's content.

Applies only to resources of type CmsFile i.e.

public  voidwriteFileHeader(CmsFile file)
    
public  voidwriteGroup(CmsGroup group)
    
public  voidwriteHistoryProject(int publishTag, long publishDate)
    
public  voidwriteProject(CmsProject project)
    
public  voidwriteProperties(String resourceName, Map properties)
     Writes a couple of properties as structure values for a file or folder.
public  voidwriteProperties(String name, Map properties, boolean addDefinition)
     Writes a couple of Properties for a file or folder.
public  voidwriteProperty(String resourceName, String key, String value)
    
public  voidwriteProperty(String resourcename, String key, String value, boolean addDefinition)
    
public  voidwritePropertyObject(String resourcename, CmsProperty property)
    
public  voidwritePropertyObjects(String resourcename, List properties)
    
public  voidwriteResource(CmsResource resource)
    
public  voidwriteStaticExportPublishedResource(String resourceName, int linkType, String linkParameter, long timestamp)
    
public  voidwriteUser(CmsUser user)
     Updates the user information.
public  voidwriteWebUser(CmsUser user)
    

Field Detail
m_context
protected CmsRequestContext m_context(Code)
The request context.



m_securityManager
protected CmsSecurityManager m_securityManager(Code)
The security manager to access the cms.




Constructor Detail
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





Method Detail
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




backupProject
public void backupProject(int versionId, long publishDate) throws CmsException(Code)
Creates a backup of the current project.


Parameters:
  versionId - the version of the backup
Parameters:
  publishDate - the date of publishing
throws:
  CmsException - if operation was not successfulCmsObject.writeHistoryProject(int,long)




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




checkRole
public void checkRole(CmsRole role) throws CmsRoleViolationException(Code)
Checks if the user of this OpenCms context is a member of the given role.

This method can only be used for roles that are not organizational unit dependent.


Parameters:
  role - the role to check
throws:
  CmsRoleViolationException - if the user does not have the required role permissions
See Also:   CmsRole.isOrganizationalUnitIndependentOpenCms.getRoleManager




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) throws CmsException, CmsIllegalArgumentException(Code)
Copies a resource.

The copied resource will always be locked to the current user after the copy operation.

Siblings will be treated according to the org.opencms.file.CmsResource.COPY_PRESERVE_SIBLING mode.


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)
throws:
  CmsException - if something goes wrong
throws:
  CmsIllegalArgumentException - if the destination argument is null or of length 0
See Also:   CmsObject.copyResource(String,String,CmsResource.CmsResourceCopyMode)




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




copyResource
public void copyResource(String source, String destination, int siblingMode) throws CmsException, CmsIllegalArgumentException(Code)
Copies a resource.

The copied resource will always be locked to the current user after the copy operation.


Parameters:
  source - the name of the resource to copy (full path)
Parameters:
  destination - the name of the copy destination (full 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 0CmsObject.copyResource(String,String,CmsResource.CmsResourceCopyMode)




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




countLockedResources
public int countLockedResources(int 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 successfulCmsObject.countLockedResources(CmsUUID)




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




createProject
public CmsProject createProject(String name, String description, String groupname, String managergroupname, int 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 successfulCmsObject.createProject(String,String,String,String,CmsProject.CmsProjectType)




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) throws CmsException, CmsIllegalArgumentException(Code)
Creates a new resource of the given resource type with empty content and no properties.


Parameters:
  resourcename - the name of the resource to create (full current site relative path)
Parameters:
  type - the type of the resource to create the created resource
throws:
  CmsException - if something goes wrong
throws:
  CmsIllegalArgumentException - if the given resourcename is null or of length 0
See Also:   CmsObject.createResource(String,int,byte[],List)




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




deleteProject
public void deleteProject(int 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 successfulCmsObject.deleteProject(CmsUUID)




deleteProperty
public void deleteProperty(String resourcename, String key) throws CmsException(Code)
Deletes a property for a file or folder.


Parameters:
  resourcename - the name of a resource for which the property should be deleted
Parameters:
  key - the name of the property
throws:
  CmsException - if something goes wrongCmsObject.writePropertyObject(String,CmsProperty)




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




deleteResource
public void deleteResource(String resourcename, int siblingMode) throws CmsException(Code)
Deletes a resource given its name.

The siblingMode parameter controls how to handle siblings during the delete operation.

Parameters:
  resourcename - the name of the resource to delete (full path)
Parameters:
  siblingMode - indicates how to handle siblings of the deleted resource
throws:
  CmsException - if something goes wrongCmsObject.deleteResource(String,CmsResource.CmsResourceDeleteMode)




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)(Code)
Checks the availability of a resource in the VFS, using the CmsResourceFilter.DEFAULT filter.

A resource may be of type CmsFile or CmsFolder .

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) true if the resource is available
See Also:   CmsObject.readResource(String)
See Also:   CmsObject.existsResource(String,CmsResourceFilter)




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




getAllBackupProjects
public List getAllBackupProjects() throws CmsException(Code)
Returns a list with all projects from history.

list of CmsHistoryProject objects with all projects from history.
throws:
  CmsException - if operation was not successfulCmsObject.getAllHistoricalProjects()




getAllHistoricalProjects
public List getAllHistoricalProjects() throws CmsException(Code)
Returns a list with all projects from history.

list of CmsHistoryProject objects with all projects from history
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




getChild
public List getChild(String groupname) throws CmsException(Code)
Returns all child groups of a group.


Parameters:
  groupname - the name of the group a list of all child CmsGroup objects or null
throws:
  CmsException - if operation was not successfulCmsObject.getChildren(String,boolean)




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




getChilds
public List getChilds(String groupname) throws CmsException(Code)
Returns all child groups of a group.

This method also returns all sub-child groups of the current group.


Parameters:
  groupname - the name of the group a list of all child CmsGroup objects or null
throws:
  CmsException - if operation was not successfulCmsObject.getChildren(String,boolean)




getDirectGroupsOfUser
public List getDirectGroupsOfUser(String username) throws CmsException(Code)
Returns all groups to which a given user directly belongs.


Parameters:
  username - the name of the user to get all groups for a list of CmsGroup objects
throws:
  CmsException - if operation was not successfulCmsObject.getGroupsOfUser(String,boolean)




getFilesInFolder
public List getFilesInFolder(String resourcename) throws CmsException(Code)
Returns all file 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 a list of all child files as CmsResource objects
throws:
  CmsException - if something goes wrong
See Also:   CmsObject.getFilesInFolder(String,CmsResourceFilter)




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




getGroups
public List getGroups() throws CmsException(Code)
Returns all groups.

a list of all CmsGroup objects
throws:
  CmsException - if operation was not successfulorg.opencms.security.CmsOrgUnitManager.getGroups(CmsObjectStringboolean) OpenCms.getOrgUnitManager().getGroupsForOrganizationalUnit(CmsObject, String, boolean)




getGroupsOfUser
public List getGroupsOfUser(String username) throws CmsException(Code)
Returns all the groups the given user, directly or indirectly, belongs to.


Parameters:
  username - the name of the user a list of CmsGroup objects
throws:
  CmsException - if operation was not successfulCmsObject.getGroupsOfUser(String,boolean)




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




getGroupsOfUser
public List getGroupsOfUser(String username, 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:
  remoteAddress - the IP address to filter the groups in the result list a list of CmsGroup objects filtered by the specified IP address
throws:
  CmsException - if operation was not successfulCmsObject.getGroupsOfUser(String,boolean,boolean,String)




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() throws CmsException(Code)
Returns a publish list with all new/changed/deleted resources of the current (offline) project that actually get published.

a publish list
throws:
  CmsException - if something goes wrongOpenCms.getPublishManagerorg.opencms.publish.CmsPublishManager.getPublishList(CmsObject) getPublishList(CmsObject)




getPublishList
public CmsPublishList getPublishList(CmsResource directPublishResource, boolean directPublishSiblings) 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 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. a publish list
throws:
  CmsException - if something goes wrongOpenCms.getPublishManagerorg.opencms.publish.CmsPublishManager.getPublishList(CmsObjectCmsResourceboolean) getPublishList(CmsObject, CmsResource, boolean)




getPublishList
public CmsPublishList getPublishList(List directPublishResources, boolean directPublishSiblings) 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 resources which will be directly published
Parameters:
  directPublishSiblings - true, if all eventual siblings of the direct published resources should also get published. a publish list
throws:
  CmsException - if something goes wrongOpenCms.getPublishManagerorg.opencms.publish.CmsPublishManager.getPublishList(CmsObjectListboolean) getPublishList(CmsObject, List, boolean)




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)




getRelationsForResource
public List getRelationsForResource(String resourceName, CmsRelationFilter filter) throws CmsException(Code)
Returns all relations for the given resource matching the given filter.

You should have view/read permissions on the given resource.

You may become source and/or target paths to resource you do not have view/read permissions on.


Parameters:
  resourceName - the name of the resource to retrieve the relations for
Parameters:
  filter - the filter to match the relation a List containing all org.opencms.relations.CmsRelation objects for the given resource matching the given filter
throws:
  CmsException - if something goes wrong
See Also:   CmsSecurityManager.getRelationsForResource(CmsRequestContextCmsResourceCmsRelationFilter)




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 CmsResources
throws:
  CmsException - if something goes wrong




getResourcesInTimeRange
public List getResourcesInTimeRange(String folder, long starttime, long endtime) throws CmsException(Code)
Returns a list with all sub resources of the given parent folder (and all of it's subfolders) that have been modified in the given time range.

The result list is descending sorted (newest resource first).


Parameters:
  folder - the folder to get the sub resources from
Parameters:
  starttime - the begin of the time range
Parameters:
  endtime - the end of the time range a list with all CmsResource objects that have been modified in the given time range.
throws:
  CmsException - if operation was not successfulCmsObject.readResources(String,CmsResourceFilter)CmsResourceFilter.IGNORE_EXPIRATIONCmsResourceFilter.addRequireLastModifiedAfter(long)CmsResourceFilter.addRequireLastModifiedBefore(long)




getSitePath
public String getSitePath(CmsResource resource)(Code)
Adjusts the absolute resource root path for the current site.

The full root path of a resource is always available using CmsResource.getRootPath . From this name this method cuts of the current site root using CmsRequestContext.removeSiteRoot(String) .

If the resource root path does not start with the current site root, it is left untouched.


Parameters:
  resource - the resource to get the adjusted site root path for the absolute resource path adjusted for the current site
See Also:   CmsRequestContext.removeSiteRoot(String)
See Also:   CmsRequestContext.getSitePath(CmsResource)
See Also:   CmsResource.getRootPath




getSubFolders
public List getSubFolders(String resourcename) throws CmsException(Code)
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. a list of all child file as CmsResource objects
throws:
  CmsException - if something goes wrong
See Also:   CmsObject.getSubFolders(String,CmsResourceFilter)




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 CmsResources
Parameters:
  filter - the resource filter to use
throws:
  CmsException - if something goes wrong




getUsers
public List getUsers() throws CmsException(Code)
Returns all users.

a list of all CmsUser objects
throws:
  CmsException - if operation was not successfulorg.opencms.security.CmsOrgUnitManager.getUsers(CmsObjectStringboolean) OpenCms.getOrgUnitManager().getUsersForOrganizationalUnit(CmsObject, String, boolean)




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)




isAdmin
public boolean isAdmin()(Code)
Checks if the current user has role access to CmsRole.ROOT_ADMIN .

true, if the current user has role access to CmsRole.ROOT_ADMINCmsObject.hasRole(CmsRole)CmsObject.checkRole(CmsRole)




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




lockResource
public void lockResource(String resourcename, int mode) throws CmsException(Code)
Locks a resource.

The mode parameter controls what kind of lock is used.

Parameters:
  resourcename - the name of the resource to lock (full path)
Parameters:
  mode - flag indicating the mode for the lock
throws:
  CmsException - if something goes wrongCmsObject.lockResource(String)CmsObject.lockResourceTemporary(String)




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)




publishProject
public CmsUUID publishProject() throws Exception(Code)
Publishes the current project, printing messages to a shell report.

the publish history id of the published project
throws:
  Exception - if something goes wrong
See Also:   CmsShellReportOpenCms.getPublishManagerorg.opencms.publish.CmsPublishManager.publishProject(CmsObject) publishProject(CmsObject)




publishProject
public CmsUUID publishProject(I_CmsReport report) throws CmsException(Code)
Publishes the current project.


Parameters:
  report - an instance of I_CmsReport to print messages the publish history id of the published project
throws:
  CmsException - if something goes wrongOpenCms.getPublishManagerorg.opencms.publish.CmsPublishManager.publishProject(CmsObjectI_CmsReport) publishProject(CmsObject, I_CmsReport)




publishProject
public CmsUUID publishProject(I_CmsReport report, CmsPublishList publishList) throws CmsException(Code)
Publishes the resources of a specified publish list.


Parameters:
  report - an instance of I_CmsReport to print messages
Parameters:
  publishList - a publish list the publish history id of the published project
throws:
  CmsException - if something goes wrong
See Also:   CmsObject.getPublishList()
See Also:   CmsObject.getPublishList(CmsResource,boolean)
See Also:   CmsObject.getPublishList(List,boolean)OpenCms.getPublishManagerorg.opencms.publish.CmsPublishManager.publishProject(CmsObjectI_CmsReportCmsPublishList) publishProject(CmsObject, I_CmsReport, CmsPublishList)




publishProject
public CmsUUID publishProject(I_CmsReport report, CmsResource directPublishResource, boolean directPublishSiblings) throws CmsException(Code)
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. the publish history id of the published project
throws:
  CmsException - if something goes wrong
See Also:   CmsObject.publishResource(String)
See Also:   CmsObject.publishResource(String,boolean,I_CmsReport)OpenCms.getPublishManagerorg.opencms.publish.CmsPublishManager.publishProject(CmsObjectI_CmsReportCmsResourceboolean) publishProject(CmsObject, I_CmsReport, CmsResource, boolean)




publishResource
public CmsUUID publishResource(String resourcename) throws Exception(Code)
Publishes a single resource, printing messages to a shell report.

The siblings of the resource will not be published.


Parameters:
  resourcename - the name of the resource to be published the publish history id of the published project
throws:
  Exception - if something goes wrong
See Also:   CmsShellReportOpenCms.getPublishManagerorg.opencms.publish.CmsPublishManager.publishResource(CmsObjectString) publishResource(CmsObject, String)




publishResource
public CmsUUID publishResource(String resourcename, boolean publishSiblings, I_CmsReport report) throws Exception(Code)
Publishes a single resource.


Parameters:
  resourcename - the name of the resource to be published
Parameters:
  publishSiblings - if true, all siblings of the resource are also published
Parameters:
  report - the report to write the progress information to the publish history id of the published project
throws:
  Exception - if something goes wrongOpenCms.getPublishManagerorg.opencms.publish.CmsPublishManager.publishResource(CmsObjectStringbooleanI_CmsReport) publishResource(CmsObject, String, boolean, I_CmsReport)




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)




readAllPropertyDefinitions
public List readAllPropertyDefinitions() throws CmsException(Code)
Reads all property definitions.

a list with the CmsPropertyDefinition objects (may be empty)
throws:
  CmsException - if something goes wrong




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(CmsUUID structureId, int publishTag) throws CmsException(Code)
Returns a file from the history.
The reading includes the file content.


Parameters:
  structureId - the structure id of the file to be read
Parameters:
  publishTag - the tag id of the resource 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.readResourceByPublishTag(CmsUUID,int)CmsObject.readResource(CmsUUID,int)




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)




readBackupProject
public CmsHistoryProject readBackupProject(int tagId) throws CmsException(Code)
Returns a backup project.


Parameters:
  tagId - the tag of the backup project to be read the requested backup project
throws:
  CmsException - if operation was not successfulCmsObject.readHistoryProject(int)




readBackupPropertyObjects
public List readBackupPropertyObjects(I_CmsHistoryResource resource) throws CmsException(Code)
Reads the list of CmsProperty objects that belong the the given backup resource.


Parameters:
  resource - the backup resource to read the properties from the list of CmsProperty objects that belong the the given backup resource
throws:
  CmsException - if something goes wrongCmsObject.readHistoryPropertyObjects(I_CmsHistoryResource)




readDefaultFile
public CmsResource readDefaultFile(String resourceNameOrID) throws CmsException, CmsSecurityException(Code)
Returns the default resource for the given folder.

If the given resource name or id identifies a file, then this file is returned.

Otherwise, in case of a folder:

  1. the CmsPropertyDefinition.PROPERTY_DEFAULT_FILE is checked, and
  2. if still no file could be found, the configured default files in the opencms-vfs.xml configuration are iterated until a match is found, and
  3. if still no file could be found, null is returned

Parameters:
  resourceNameOrID - the name or id of the folder to read the default file for the default file for the given folder
throws:
  CmsException - if something goes wrong
throws:
  CmsSecurityException - if the user has no permissions to read the resulting file
See Also:   CmsSecurityManager.readDefaultFile(CmsRequestContextCmsResource)



readDeletedResources
public List readDeletedResources(String resourcename, boolean readTree) throws CmsException(Code)
Reads all deleted (historical) resources below the given path, including the full tree below the path, if required.

The result list may include resources with the same name of resources (with different id's).

Use in conjunction with the CmsObject.restoreDeletedResource(CmsUUID) method.


Parameters:
  resourcename - the parent path to read the resources from
Parameters:
  readTree - true to read all sub resources a list of I_CmsHistoryResource objects
throws:
  CmsException - if something goes wrong
See Also:   CmsObject.readResource(CmsUUID,int)
See Also:   CmsObject.readResources(String,CmsResourceFilter,boolean)




readFile
public CmsFile readFile(CmsResource resource) throws CmsException(Code)
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. Otherwise the file is read from the VFS.

In case you do not need the file content, use CmsObject.readResource(String) or CmsObject.readResource(String,CmsResourceFilter) instead.

No resource filter is applied when reading the resource, since we already have a full resource instance and assume we just want the content for that instance. In case you need to apply a filter, use CmsObject.readFile(String,CmsResourceFilter) instead.


Parameters:
  resource - the resource to read the file resource that was read
throws:
  CmsException - if the file resource could not be read for any reason
See Also:   CmsObject.readFile(String)
See Also:   CmsObject.readFile(String,CmsResourceFilter)




readFile
public CmsFile readFile(String resourcename) throws CmsException(Code)
Reads a file resource (including it's binary content) from the VFS, using the CmsResourceFilter.DEFAULT filter.

In case you do not need the file content, use CmsObject.readResource(String) instead.


Parameters:
  resourcename - the name of the resource to read (full current site relative path) the file resource that was read
throws:
  CmsException - if the file resource could not be read for any reason
See Also:   CmsObject.readFile(String,CmsResourceFilter)
See Also:   CmsObject.readFile(CmsResource)
See Also:   CmsObject.readResource(String)




readFile
public CmsFile readFile(String resourcename, CmsResourceFilter filter) throws CmsException(Code)
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. 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 file resource that was read
throws:
  CmsException - if the file resource could not be read for any reason
See Also:   CmsObject.readFile(String)
See Also:   CmsObject.readFile(CmsResource)
See Also:   CmsObject.readResource(String,CmsResourceFilter)




readFileHeader
public CmsResource readFileHeader(String resourcename) throws CmsException(Code)
Reads a resource from the VFS, using the CmsResourceFilter.DEFAULT filter.


Parameters:
  resourcename - the name of the resource to read (full current site relative path) the file resource that was read
throws:
  CmsException - if something goes wrongCmsObject.readResource(String,CmsResourceFilter)




readFolder
public CmsFolder readFolder(String resourcename) throws CmsException(Code)
Reads a folder resource from the VFS, using the CmsResourceFilter.DEFAULT filter.


Parameters:
  resourcename - the name of the folder resource to read (full current site relative path) the folder resource that was read
throws:
  CmsException - if the resource could not be read for any reason
See Also:   CmsObject.readResource(String,CmsResourceFilter)
See Also:   CmsObject.readFolder(String,CmsResourceFilter)




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(CmsUUID groupId) throws CmsException(Code)
Reads a group based on its id.


Parameters:
  groupId - the id of the group to be read the group that has the provided id
throws:
  CmsException - if something goes wrong
See Also:   CmsObject.readHistoryPrincipal(CmsUUID)
See Also:    for retrieving deleted groups




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




readHistoryPrincipal
public CmsHistoryPrincipal readHistoryPrincipal(CmsUUID principalId) throws CmsException(Code)
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. org.opencms.db.CmsDbEntryNotFoundException
See Also:   CmsObject.readUser(CmsUUID)
See Also:   CmsObject.readGroup(CmsUUID)




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




readHistoryPropertyObjects
public List readHistoryPropertyObjects(I_CmsHistoryResource resource) throws CmsException(Code)
Reads the list of all CmsProperty objects that belong to the given historical resource version.


Parameters:
  resource - the historical resource version to read the properties for the list of CmsProperty objects
throws:
  CmsException - if something goes wrong




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




readPath
public List readPath(String path, CmsResourceFilter filter) throws CmsException(Code)
Builds a list of resources for a given path.


Parameters:
  path - the requested path
Parameters:
  filter - a filter object (only "includeDeleted" information is used!) list of CmsResources
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(int 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 successfulCmsObject.readProject(CmsUUID)




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 CmsResources of a project that match a given criteria from the VFS
throws:
  CmsException - if something goes wrong




readProjectView
public List readProjectView(int projectId, CmsResourceState state) throws CmsException(Code)

See Also:   CmsObject.readProjectView(CmsUUID,CmsResourceState)
Parameters:
  projectId - the id of the project to read the file resources for
Parameters:
  state - the resource state to match all CmsResources of a project that match a given criteria from the VFS
throws:
  CmsException - if something goes wrongCmsObject.readProjectView(CmsUUID,CmsResourceState)



readProjectView
public List readProjectView(int projectId, int state) throws CmsException(Code)
Reads all resources of a project that match a given state from the VFS.


Parameters:
  projectId - the id of the project to read the file resources for
Parameters:
  state - the resource state to match all CmsResources of a project that match a given criteria from the VFS
throws:
  CmsException - if something goes wrongCmsObject.readProjectView(CmsUUID,CmsResourceState)




readProperties
public Map readProperties(String resourcePath) throws CmsException(Code)
Reads the (compound) values of all properties mapped to a specified resource.


Parameters:
  resourcePath - the resource to look up the property for a map of String objects representing all properties of the resource
throws:
  CmsException - in case there where problems reading the propertiesCmsObject.readPropertyObjects(String,boolean)




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) throws CmsException(Code)
Reads the (compound) value of a property mapped to a specified resource.


Parameters:
  resourcePath - the resource to look up the property for
Parameters:
  property - the name of the property to look up 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) 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) throws CmsException(Code)
Reads a resource from the VFS, using the CmsResourceFilter.DEFAULT 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) .


Parameters:
  structureID - the structure ID of the resource to read the resource that was read
throws:
  CmsException - if the resource could not be read for any reason
See Also:   CmsObject.readFile(String)
See Also:   
See Also:   CmsObject.readResource(CmsUUID,CmsResourceFilter)




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) throws CmsException(Code)
Reads a resource from the VFS, using the CmsResourceFilter.DEFAULT 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) .


Parameters:
  resourcename - the name of the resource to read (full current site relative path) the resource that was read
throws:
  CmsException - if the resource could not be read for any reason
See Also:   CmsObject.readFile(String)
See Also:   
See Also:   CmsObject.readResource(String,CmsResourceFilter)




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)




readResourceByPublishTag
public I_CmsHistoryResource readResourceByPublishTag(CmsUUID structureId, int publishTag) throws CmsException(Code)
Reads an historical resource in the current project with the given publish tag from the historical archive.


Parameters:
  structureId - the structure id of the resource to restore from the archive
Parameters:
  publishTag - the publish tag of the resource the file in the current project with the given publish tag from the historical archive, or CmsVfsResourceNotFoundException if not found
throws:
  CmsException - if something goes wrong
See Also:   CmsObject.readResource(CmsUUID,int)CmsObject.readResource(CmsUUID,int)




readResources
public List readResources(String resourcename, CmsResourceFilter filter) throws CmsException(Code)
Reads all resources below the given path matching the filter criteria, including the full tree below the path.


Parameters:
  resourcename - the parent path to read the resources from
Parameters:
  filter - the filter a list of CmsResource objects matching the filter criteria
throws:
  CmsException - if something goes wrong
See Also:   CmsObject.readResources(String,CmsResourceFilter,boolean)




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 CmsResources 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(CmsUUID userId) throws CmsException(Code)
Reads a user based on its id.


Parameters:
  userId - the id of the user to be read the user with the given id
throws:
  CmsException - if something goes wrong
See Also:   CmsObject.readHistoryPrincipal(CmsUUID)
See Also:    for retrieving data of deleted users




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




restoreDeletedResource
public void restoreDeletedResource(CmsUUID structureId) throws CmsException(Code)
Restores a deleted resource identified by its structure id from the historical archive.

These ids can be obtained from the CmsObject.readDeletedResources(String,boolean) method.


Parameters:
  structureId - the structure id of the resource to restore
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)




undoChanges
public void undoChanges(String resourcename, CmsResource.CmsResourceUndoMode mode) 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
Parameters:
  mode - the undo mode, one of the CmsResource.CmsResourceUndoMode#UNDO_XXX constants
throws:
  CmsException - if something goes wrong
See Also:   CmsResource.UNDO_CONTENT
See Also:   CmsResource.UNDO_CONTENT_RECURSIVE
See Also:   CmsResource.UNDO_MOVE_CONTENT
See Also:   CmsResource.UNDO_MOVE_CONTENT_RECURSIVE




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



unlockProject
public void unlockProject(int 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 successfulCmsObject.unlockProject(CmsUUID)



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




writeFileHeader
public void writeFileHeader(CmsFile file) throws CmsException(Code)
Writes a file-header.


Parameters:
  file - 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.CmsObject.writeResource(CmsResource)




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) throws CmsException(Code)
Writes a property as a structure value 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
throws:
  CmsException - if operation was not successfulCmsObject.writePropertyObject(String,CmsProperty)




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




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.