public abstract class A_CmsResourceWrapper extends java.lang.Object implements I_CmsResourceWrapper
I_CmsResourceWrapper.This class returns for all methods that the action is not handled by the resource wrapper.
Subclasses can only implement those methods where they want to change the default behaviour.
| 限定符和类型 | 字段和说明 |
|---|---|
protected boolean |
m_isWrappedResource
Is handled by this resource wrapper.
|
| 构造器和说明 |
|---|
A_CmsResourceWrapper() |
| 限定符和类型 | 方法和说明 |
|---|---|
java.util.List<CmsResource> |
addResourcesToFolder(CmsObject cms,
java.lang.String resourcename,
CmsResourceFilter filter)
Here it is possible to add additional (virtual) child resources to those already existing
in the VFS.
|
void |
configure(java.lang.String configString)
If there is a configuration string for the wrapper, this method will be called with the configuration string
before it is used.
|
boolean |
copyResource(CmsObject cms,
java.lang.String source,
java.lang.String destination,
CmsResourceCopyMode siblingMode)
Copies a resource.
|
CmsResource |
createResource(CmsObject cms,
java.lang.String resourcename,
int type,
byte[] content,
java.util.List<CmsProperty> properties)
Creates a new resource of the given resource type
with the provided content and properties.
|
boolean |
deleteResource(CmsObject cms,
java.lang.String resourcename,
CmsResourceDeleteMode siblingMode)
Deletes a resource given its name.
|
CmsLock |
getLock(CmsObject cms,
CmsResource resource)
Returns the lock for the resource.
|
boolean |
lockResource(CmsObject cms,
java.lang.String resourcename,
boolean temporary)
Locks a resource.
|
boolean |
moveResource(CmsObject cms,
java.lang.String source,
java.lang.String destination)
Moves a resource to the given destination.
|
CmsFile |
readFile(CmsObject cms,
java.lang.String resourcename,
CmsResourceFilter filter)
Reads a file resource (including it's binary content) from the VFS,
using the specified resource filter.
|
CmsResource |
readResource(CmsObject cms,
java.lang.String resourcename,
CmsResourceFilter filter)
Reads a resource from the VFS, using the specified resource filter.
|
java.lang.String |
restoreLink(CmsObject cms,
java.lang.String uri)
Returns the link to a existing resource in the VFS for the uri.
|
java.lang.String |
rewriteLink(CmsObject cms,
CmsResource res)
Returns the link how it is for the resource after using this resource wrapper.
|
boolean |
unlockResource(CmsObject cms,
java.lang.String resourcename)
Unlocks a resource.
|
CmsResource |
wrapResource(CmsObject cms,
CmsResource resource)
Changes the given resource based on the implementation of this wrapper.
|
CmsFile |
writeFile(CmsObject cms,
CmsFile resource)
Writes a resource, including it's content.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisWrappedResourceprotected boolean m_isWrappedResource
public java.util.List<CmsResource> addResourcesToFolder(CmsObject cms, java.lang.String resourcename, CmsResourceFilter filter) throws CmsException
I_CmsResourceWrapperaddResourcesToFolder 在接口中 I_CmsResourceWrappercms - the current users OpenCms contextresourcename - the full path of the resource where to add the child resources forfilter - the resource filter to useCmsResourcesCmsException - if something goes wrongI_CmsResourceWrapper.addResourcesToFolder(org.opencms.file.CmsObject, java.lang.String, org.opencms.file.CmsResourceFilter)public void configure(java.lang.String configString)
I_CmsResourceWrapperOtherwise, it will not be called.
configure 在接口中 I_CmsResourceWrapperconfigString - the configuration string for the wrapperI_CmsResourceWrapper.configure(java.lang.String)public boolean copyResource(CmsObject cms, java.lang.String source, java.lang.String destination, CmsResourceCopyMode siblingMode) throws CmsException, CmsIllegalArgumentException
I_CmsResourceWrapperFirst should be a check if the source and/or the destination are handled by this resource wrapper.
It is possible that the path in the source or in the destination are virtual paths and so has to be translated into valid paths existing in the VFS to copy the resource.
copyResource 在接口中 I_CmsResourceWrappercms - the initialized CmsObjectsource - the name of the resource to copydestination - the name of the copy destination with complete pathsiblingMode - indicates how to handle siblings during copyCmsException - if something goes wrongCmsIllegalArgumentException - if the destination argument is null or of length 0org.opencms.file.wrapper.I_CmsResourceWrapper#copyResource(org.opencms.file.CmsObject, java.lang.String, java.lang.String, org.opencms.file.CmsResource.CmsResourceCopyMode)public CmsResource createResource(CmsObject cms, java.lang.String resourcename, int type, byte[] content, java.util.List<CmsProperty> properties) throws CmsException, CmsIllegalArgumentException
I_CmsResourceWrapperFirst should be a check if the resourcename is handled by this resource wrapper.
It is possible that the path in the resourcename is a virtual path and so has to be translated into a valid path existing in the VFS to create the resource.
createResource 在接口中 I_CmsResourceWrappercms - the initialized CmsObjectresourcename - the name of the resource to create (full path)type - the type of the resource to createcontent - the content for the new resourceproperties - the properties for the new resourceCmsException - if something goes wrongCmsIllegalArgumentException - if the source argument is null or of length 0I_CmsResourceWrapper.createResource(org.opencms.file.CmsObject, java.lang.String, int, byte[], java.util.List)public boolean deleteResource(CmsObject cms, java.lang.String resourcename, CmsResourceDeleteMode siblingMode) throws CmsException
I_CmsResourceWrapperFirst should be a check if the resourcename is handled by this resource wrapper.
It is possible that the path in the resourcename is a virtual path and so has to be translated into a valid path existing in the VFS to delete the resource.
deleteResource 在接口中 I_CmsResourceWrappercms - the initialized CmsObjectresourcename - the name of the resource to deletesiblingMode - indicates how to handle siblings of the deleted resourceCmsException - if something goes wrongorg.opencms.file.wrapper.I_CmsResourceWrapper#deleteResource(org.opencms.file.CmsObject, java.lang.String, org.opencms.file.CmsResource.CmsResourceDeleteMode)public CmsLock getLock(CmsObject cms, CmsResource resource) throws CmsException
I_CmsResourceWrapperFirst should be a check if the resource is handled by this resource wrapper.
It is possible that the path in the resource is a virtual path and so has to be translated into a valid path existing in the VFS to get the lock for the resource.
getLock 在接口中 I_CmsResourceWrappercms - the initialized CmsObjectresource - the resource to check the lock forCmsException - if something goes wrongI_CmsResourceWrapper.getLock(org.opencms.file.CmsObject, org.opencms.file.CmsResource)public boolean lockResource(CmsObject cms, java.lang.String resourcename, boolean temporary) throws CmsException
I_CmsResourceWrapperFirst should be a check if the resourcename is handled by this resource wrapper.
It is possible that the path in the resourcename is a virtual path and so has to be translated into a valid path existing in the VFS to lock the resource.
lockResource 在接口中 I_CmsResourceWrappercms - the current users OpenCms contextresourcename - the name of the resource to lock (full path)temporary - true if the resource should only be locked temporarilyCmsException - if something goes wrongI_CmsResourceWrapper.lockResource(org.opencms.file.CmsObject, java.lang.String, boolean)public boolean moveResource(CmsObject cms, java.lang.String source, java.lang.String destination) throws CmsException, CmsIllegalArgumentException
I_CmsResourceWrapperFirst should be a check if the source and/or the destination are handled by this resource wrapper.
It is possible that the path in the source or in the destination are virtual paths and so has to be translated into valid paths existing in the VFS to move the resource.
moveResource 在接口中 I_CmsResourceWrappercms - the current cms contextsource - the name of the resource to movedestination - the destination resource nameCmsException - if something goes wrongCmsIllegalArgumentException - if the source argument is null or of length 0I_CmsResourceWrapper.moveResource(org.opencms.file.CmsObject, java.lang.String, java.lang.String)public CmsFile readFile(CmsObject cms, java.lang.String resourcename, CmsResourceFilter filter) throws CmsException
I_CmsResourceWrapperFirst should be a check if the resourcename is handled by this resource wrapper.
It is possible that the path in the resourcename is a virtual path and so has to be translated into a valid path existing in the VFS to read the resource.
readFile 在接口中 I_CmsResourceWrappercms - the current users OpenCms contextresourcename - the name of the resource to read (full path)filter - the resource filter to use while readingCmsException - if the file resource could not be read for any reasonI_CmsResourceWrapper.readFile(org.opencms.file.CmsObject, java.lang.String, org.opencms.file.CmsResourceFilter)public CmsResource readResource(CmsObject cms, java.lang.String resourcename, CmsResourceFilter filter) throws CmsException
I_CmsResourceWrapperFirst should be a check if the resourcename is handled by this resource wrapper.
It is possible that the path in the resourcename is a virtual path and so has to be translated into a valid path existing in the VFS to read the resource.
readResource 在接口中 I_CmsResourceWrappercms - the current users OpenCms contextresourcename - The name of the resource to read (full path)filter - the resource filter to use while readingCmsException - if the resource could not be read for any reasonI_CmsResourceWrapper.readResource(org.opencms.file.CmsObject, java.lang.String, org.opencms.file.CmsResourceFilter)public java.lang.String restoreLink(CmsObject cms, java.lang.String uri)
I_CmsResourceWrapperTurns the virtual path into a real path to a resource in the VFS.
restoreLink 在接口中 I_CmsResourceWrappercms - the initialized CmsObjecturi - the (virtual) uri to be restoredI_CmsResourceWrapper.restoreLink(org.opencms.file.CmsObject, java.lang.String)public java.lang.String rewriteLink(CmsObject cms, CmsResource res)
I_CmsResourceWrapperFor example: in the VFS: "/sites/default/index.html" and this resource wrapper adds the extension "jsp" then link returned should be "/sites/default/index.html.jsp".
rewriteLink 在接口中 I_CmsResourceWrappercms - the initialized CmsObjectres - the resource where to rewrite the pathI_CmsResourceWrapper.rewriteLink(CmsObject, CmsResource)public boolean unlockResource(CmsObject cms, java.lang.String resourcename) throws CmsException
I_CmsResourceWrapperFirst should be a check if the resourcename is handled by this resource wrapper.
It is possible that the path in the resourcename is a virtual path and so has to be translated into a valid path existing in the VFS to unlock the resource.
unlockResource 在接口中 I_CmsResourceWrappercms - the current users OpenCms contextresourcename - the name of the resource to unlock (full path)CmsException - if something goes wrongI_CmsResourceWrapper.unlockResource(CmsObject, String)public CmsResource wrapResource(CmsObject cms, CmsResource resource)
I_CmsResourceWrapper
For example, some resource types like CmsResourceTypeJsp
just get a .jsp extension, while other types like
CmsResourceTypeXmlPage are "exploded" into a folder /
file structure.
wrapResource 在接口中 I_CmsResourceWrappercms - the current users OpenCms contextresource - the resource to wrapCmsResource object or null to not change the resourceI_CmsResourceWrapper.wrapResource(org.opencms.file.CmsObject, org.opencms.file.CmsResource)public CmsFile writeFile(CmsObject cms, CmsFile resource) throws CmsException
I_CmsResourceWrapperFirst should be a check if the resource is handled by this resource wrapper.
It is possible that the path in the resource is a virtual path and so has to be translated into a valid path existing in the VFS to write the resource.
writeFile 在接口中 I_CmsResourceWrappercms - the current cms contextresource - the resource to apply this operation toCmsException - if something goes wrongI_CmsResourceWrapper.writeFile(org.opencms.file.CmsObject, org.opencms.file.CmsFile)