public class CmsResourceWrapperModules extends A_CmsResourceWrapper
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BASE_PATH
The base folder under which the virtual resources from this resource wrapper are available.
|
static java.lang.String |
EXPORT_PATH
The virtual folder which can be used to export modules.
|
static java.util.List<java.lang.String> |
FOLDERS
List of virtual folders made available by this resource wrapper.
|
static java.lang.String |
IMPORT_PATH
The virtual folder which can be used to import modules.
|
static java.lang.String |
LOG_PATH
The virtual folder which can be used to provide logs for module operations.
|
m_isWrappedResource
Constructor and Description |
---|
CmsResourceWrapperModules() |
Modifier and Type | Method and Description |
---|---|
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.
|
protected CmsResource |
createFakeBinaryFile(java.lang.String rootPath)
Creates a fake CmsResource of type 'binary'.
|
protected CmsResource |
createFakeBinaryFile(java.lang.String rootPath,
long dateLastModified)
Creates a fake CmsResource of type 'binary'.
|
protected CmsResource |
createFakeFolder(java.lang.String rootPath)
Creates a fake CmsResource of type 'folder'.
|
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,
CmsResource.CmsResourceDeleteMode siblingMode)
Deletes a resource given its name.
|
CmsLock |
getLock(CmsObject cms,
CmsResource resource)
Returns the lock for the resource.
|
boolean |
isWrappedResource(CmsObject cms,
CmsResource res)
Is called to check if the given resource is handled by this wrapper.
|
boolean |
lockResource(CmsObject cms,
java.lang.String resourcename,
boolean temporary)
Locks a resource.
|
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 resourcepath,
CmsResourceFilter filter)
Reads a resource from the VFS, using the specified resource filter.
|
boolean |
unlockResource(CmsObject cms,
java.lang.String resourcename)
Unlocks a resource.
|
CmsFile |
writeFile(CmsObject cms,
CmsFile resource)
Writes a resource, including it's content.
|
configure, copyResource, moveResource, restoreLink, rewriteLink, wrapResource
public static final java.lang.String BASE_PATH
public static final java.lang.String IMPORT_PATH
public static final java.lang.String EXPORT_PATH
public static final java.lang.String LOG_PATH
public static final java.util.List<java.lang.String> FOLDERS
public CmsResourceWrapperModules()
public java.util.List<CmsResource> addResourcesToFolder(CmsObject cms, java.lang.String resourcename, CmsResourceFilter filter) throws CmsException
I_CmsResourceWrapper
addResourcesToFolder
in interface I_CmsResourceWrapper
addResourcesToFolder
in class A_CmsResourceWrapper
cms
- the current users OpenCms contextresourcename
- the full path of the resource where to add the child resources forfilter
- the resource filter to useCmsResource
sCmsException
- if something goes wrongA_CmsResourceWrapper.addResourcesToFolder(org.opencms.file.CmsObject, java.lang.String, org.opencms.file.CmsResourceFilter)
public CmsResource createResource(CmsObject cms, java.lang.String resourcename, int type, byte[] content, java.util.List<CmsProperty> properties) throws CmsException, CmsIllegalArgumentException
I_CmsResourceWrapper
First 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
in interface I_CmsResourceWrapper
createResource
in class A_CmsResourceWrapper
cms
- 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 0A_CmsResourceWrapper.createResource(org.opencms.file.CmsObject, java.lang.String, int, byte[], java.util.List)
public boolean deleteResource(CmsObject cms, java.lang.String resourcename, CmsResource.CmsResourceDeleteMode siblingMode) throws CmsException
I_CmsResourceWrapper
First 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
in interface I_CmsResourceWrapper
deleteResource
in class A_CmsResourceWrapper
cms
- the initialized CmsObjectresourcename
- the name of the resource to deletesiblingMode
- indicates how to handle siblings of the deleted resourceCmsException
- if something goes wrongA_CmsResourceWrapper.deleteResource(org.opencms.file.CmsObject, java.lang.String, org.opencms.file.CmsResource.CmsResourceDeleteMode)
public CmsLock getLock(CmsObject cms, CmsResource resource) throws CmsException
I_CmsResourceWrapper
First 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
in interface I_CmsResourceWrapper
getLock
in class A_CmsResourceWrapper
cms
- the initialized CmsObjectresource
- the resource to check the lock forCmsException
- if something goes wrongA_CmsResourceWrapper.getLock(org.opencms.file.CmsObject, org.opencms.file.CmsResource)
public boolean isWrappedResource(CmsObject cms, CmsResource res)
I_CmsResourceWrapper
cms
- the initialized CmsObjectres
- the resource to checkI_CmsResourceWrapper.isWrappedResource(org.opencms.file.CmsObject, org.opencms.file.CmsResource)
public boolean lockResource(CmsObject cms, java.lang.String resourcename, boolean temporary)
I_CmsResourceWrapper
First 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
in interface I_CmsResourceWrapper
lockResource
in class A_CmsResourceWrapper
cms
- the current users OpenCms contextresourcename
- the name of the resource to lock (full path)temporary
- true if the resource should only be locked temporarilyA_CmsResourceWrapper.lockResource(org.opencms.file.CmsObject, java.lang.String, boolean)
public CmsFile readFile(CmsObject cms, java.lang.String resourcename, CmsResourceFilter filter) throws CmsException
I_CmsResourceWrapper
First 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
in interface I_CmsResourceWrapper
readFile
in class A_CmsResourceWrapper
cms
- 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 reasonA_CmsResourceWrapper.readFile(org.opencms.file.CmsObject, java.lang.String, org.opencms.file.CmsResourceFilter)
public CmsResource readResource(CmsObject cms, java.lang.String resourcepath, CmsResourceFilter filter) throws CmsException
I_CmsResourceWrapper
First 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
in interface I_CmsResourceWrapper
readResource
in class A_CmsResourceWrapper
cms
- the current users OpenCms contextresourcepath
- 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 reasonA_CmsResourceWrapper.readResource(org.opencms.file.CmsObject, java.lang.String, org.opencms.file.CmsResourceFilter)
public boolean unlockResource(CmsObject cms, java.lang.String resourcename)
I_CmsResourceWrapper
First 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
in interface I_CmsResourceWrapper
unlockResource
in class A_CmsResourceWrapper
cms
- the current users OpenCms contextresourcename
- the name of the resource to unlock (full path)A_CmsResourceWrapper.unlockResource(org.opencms.file.CmsObject, java.lang.String)
public CmsFile writeFile(CmsObject cms, CmsFile resource) throws CmsException
I_CmsResourceWrapper
First 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
in interface I_CmsResourceWrapper
writeFile
in class A_CmsResourceWrapper
cms
- the current cms contextresource
- the resource to apply this operation toCmsException
- if something goes wrongA_CmsResourceWrapper.writeFile(org.opencms.file.CmsObject, org.opencms.file.CmsFile)
protected CmsResource createFakeBinaryFile(java.lang.String rootPath) throws CmsLoaderException
rootPath
- the root pathCmsLoaderException
- if the binary type is missingprotected CmsResource createFakeBinaryFile(java.lang.String rootPath, long dateLastModified) throws CmsLoaderException
rootPath
- the root pathdateLastModified
- the last modification date to useCmsLoaderException
- if the binary type is missingprotected CmsResource createFakeFolder(java.lang.String rootPath) throws CmsLoaderException
rootPath
- the root pathCmsLoaderException
- if the 'folder' type can not be found