Class CmsResourceWrapperModulesNonLazy
- java.lang.Object
-
- org.opencms.file.wrapper.A_CmsResourceWrapper
-
- org.opencms.file.wrapper.CmsResourceWrapperModulesNonLazy
-
- All Implemented Interfaces:
I_CmsResourceWrapper
public class CmsResourceWrapperModulesNonLazy extends A_CmsResourceWrapper
Resource wrapper used to import/export modules by copying them to/from virtual folders.
-
-
Field Summary
Fields Modifier and Type Field 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.-
Fields inherited from class org.opencms.file.wrapper.A_CmsResourceWrapper
m_isWrappedResource
-
-
Constructor Summary
Constructors Constructor Description CmsResourceWrapperModulesNonLazy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class org.opencms.file.wrapper.A_CmsResourceWrapper
configure, copyResource, moveResource, restoreLink, rewriteLink, wrapResource
-
-
-
-
Field Detail
-
BASE_PATH
public static final java.lang.String BASE_PATH
The base folder under which the virtual resources from this resource wrapper are available.- See Also:
- Constant Field Values
-
IMPORT_PATH
public static final java.lang.String IMPORT_PATH
The virtual folder which can be used to import modules.- See Also:
- Constant Field Values
-
EXPORT_PATH
public static final java.lang.String EXPORT_PATH
The virtual folder which can be used to export modules.- See Also:
- Constant Field Values
-
LOG_PATH
public static final java.lang.String LOG_PATH
The virtual folder which can be used to provide logs for module operations.- See Also:
- Constant Field Values
-
FOLDERS
public static final java.util.List<java.lang.String> FOLDERS
List of virtual folders made available by this resource wrapper.
-
-
Constructor Detail
-
CmsResourceWrapperModulesNonLazy
public CmsResourceWrapperModulesNonLazy()
-
-
Method Detail
-
addResourcesToFolder
public java.util.List<CmsResource> addResourcesToFolder(CmsObject cms, java.lang.String resourcename, CmsResourceFilter filter) throws CmsException
Description copied from interface:I_CmsResourceWrapper
Here it is possible to add additional (virtual) child resources to those already existing in the VFS.- Specified by:
addResourcesToFolder
in interfaceI_CmsResourceWrapper
- Overrides:
addResourcesToFolder
in classA_CmsResourceWrapper
- Parameters:
cms
- the current users OpenCms contextresourcename
- the full path of the resource where to add the child resources forfilter
- the resource filter to use- Returns:
- a list of all additionaly child
sCmsResource
- Throws:
CmsException
- if something goes wrong- See Also:
A_CmsResourceWrapper.addResourcesToFolder(org.opencms.file.CmsObject, java.lang.String, org.opencms.file.CmsResourceFilter)
-
createResource
public CmsResource createResource(CmsObject cms, java.lang.String resourcename, int type, byte[] content, java.util.List<CmsProperty> properties) throws CmsException, CmsIllegalArgumentException
Description copied from interface:I_CmsResourceWrapper
Creates a new resource of the given resource type with the provided content and properties.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.
- Specified by:
createResource
in interfaceI_CmsResourceWrapper
- Overrides:
createResource
in classA_CmsResourceWrapper
- Parameters:
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 resource- Returns:
- the created resource or null if not handled by this resource wrapper
- Throws:
CmsException
- if something goes wrongCmsIllegalArgumentException
- if thesource
argument is null or of length 0- See Also:
A_CmsResourceWrapper.createResource(org.opencms.file.CmsObject, java.lang.String, int, byte[], java.util.List)
-
deleteResource
public boolean deleteResource(CmsObject cms, java.lang.String resourcename, CmsResource.CmsResourceDeleteMode siblingMode) throws CmsException
Description copied from interface:I_CmsResourceWrapper
Deletes a resource given its name.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.
- Specified by:
deleteResource
in interfaceI_CmsResourceWrapper
- Overrides:
deleteResource
in classA_CmsResourceWrapper
- Parameters:
cms
- the initialized CmsObjectresourcename
- the name of the resource to deletesiblingMode
- indicates how to handle siblings of the deleted resource- Returns:
- true if the delete action was handled by this resource wrapper otherwise false
- Throws:
CmsException
- if something goes wrong- See Also:
A_CmsResourceWrapper.deleteResource(org.opencms.file.CmsObject, java.lang.String, org.opencms.file.CmsResource.CmsResourceDeleteMode)
-
getLock
public CmsLock getLock(CmsObject cms, CmsResource resource) throws CmsException
Description copied from interface:I_CmsResourceWrapper
Returns the lock for the resource.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.
- Specified by:
getLock
in interfaceI_CmsResourceWrapper
- Overrides:
getLock
in classA_CmsResourceWrapper
- Parameters:
cms
- the initialized CmsObjectresource
- the resource to check the lock for- Returns:
- the lock state of the resource or null if the action couldn't be handled by this resource wrapper
- Throws:
CmsException
- if something goes wrong- See Also:
A_CmsResourceWrapper.getLock(org.opencms.file.CmsObject, org.opencms.file.CmsResource)
-
isWrappedResource
public boolean isWrappedResource(CmsObject cms, CmsResource res)
Description copied from interface:I_CmsResourceWrapper
Is called to check if the given resource is handled by this wrapper.- Parameters:
cms
- the initialized CmsObjectres
- the resource to check- Returns:
- true if the resource will be handled by the wrapper otherwise false
- See Also:
I_CmsResourceWrapper.isWrappedResource(org.opencms.file.CmsObject, org.opencms.file.CmsResource)
-
lockResource
public boolean lockResource(CmsObject cms, java.lang.String resourcename, boolean temporary)
Description copied from interface:I_CmsResourceWrapper
Locks a resource.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.
- Specified by:
lockResource
in interfaceI_CmsResourceWrapper
- Overrides:
lockResource
in classA_CmsResourceWrapper
- Parameters:
cms
- the current users OpenCms contextresourcename
- the name of the resource to lock (full path)temporary
- true if the resource should only be locked temporarily- Returns:
- true if this request could be handled by this wrapper or false if not
- See Also:
A_CmsResourceWrapper.lockResource(org.opencms.file.CmsObject, java.lang.String, boolean)
-
readFile
public CmsFile readFile(CmsObject cms, java.lang.String resourcename, CmsResourceFilter filter) throws CmsException
Description copied from interface:I_CmsResourceWrapper
Reads a file resource (including it's binary content) from the VFS, using the specified resource filter.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.
- Specified by:
readFile
in interfaceI_CmsResourceWrapper
- Overrides:
readFile
in classA_CmsResourceWrapper
- Parameters:
cms
- the current users OpenCms contextresourcename
- the name of the resource to read (full path)filter
- the resource filter to use while reading- Returns:
- the file resource that was read or null if it could not be handled by this resource wrapper
- Throws:
CmsException
- if the file resource could not be read for any reason- See Also:
A_CmsResourceWrapper.readFile(org.opencms.file.CmsObject, java.lang.String, org.opencms.file.CmsResourceFilter)
-
readResource
public CmsResource readResource(CmsObject cms, java.lang.String resourcepath, CmsResourceFilter filter) throws CmsException
Description copied from interface:I_CmsResourceWrapper
Reads a resource from the VFS, using the specified resource filter.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.
- Specified by:
readResource
in interfaceI_CmsResourceWrapper
- Overrides:
readResource
in classA_CmsResourceWrapper
- Parameters:
cms
- the current users OpenCms contextresourcepath
- The name of the resource to read (full path)filter
- the resource filter to use while reading- Returns:
- the resource that was read or null if it could not be handled by this resource wrapper
- Throws:
CmsException
- if the resource could not be read for any reason- See Also:
A_CmsResourceWrapper.readResource(org.opencms.file.CmsObject, java.lang.String, org.opencms.file.CmsResourceFilter)
-
unlockResource
public boolean unlockResource(CmsObject cms, java.lang.String resourcename)
Description copied from interface:I_CmsResourceWrapper
Unlocks a resource.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.
- Specified by:
unlockResource
in interfaceI_CmsResourceWrapper
- Overrides:
unlockResource
in classA_CmsResourceWrapper
- Parameters:
cms
- the current users OpenCms contextresourcename
- the name of the resource to unlock (full path)- Returns:
- true if this request could be handled by this wrapper of false if not
- See Also:
A_CmsResourceWrapper.unlockResource(org.opencms.file.CmsObject, java.lang.String)
-
writeFile
public CmsFile writeFile(CmsObject cms, CmsFile resource) throws CmsException
Description copied from interface:I_CmsResourceWrapper
Writes a resource, including it's content.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.
- Specified by:
writeFile
in interfaceI_CmsResourceWrapper
- Overrides:
writeFile
in classA_CmsResourceWrapper
- Parameters:
cms
- the current cms contextresource
- the resource to apply this operation to- Returns:
- the written resource or null if the action could not be handled by this resource wrapper
- Throws:
CmsException
- if something goes wrong- See Also:
A_CmsResourceWrapper.writeFile(org.opencms.file.CmsObject, org.opencms.file.CmsFile)
-
createFakeBinaryFile
protected CmsResource createFakeBinaryFile(java.lang.String rootPath) throws CmsLoaderException
Creates a fake CmsResource of type 'binary'.- Parameters:
rootPath
- the root path- Returns:
- the fake resource
- Throws:
CmsLoaderException
- if the binary type is missing
-
createFakeBinaryFile
protected CmsResource createFakeBinaryFile(java.lang.String rootPath, long dateLastModified) throws CmsLoaderException
Creates a fake CmsResource of type 'binary'.- Parameters:
rootPath
- the root pathdateLastModified
- the last modification date to use- Returns:
- the fake resource
- Throws:
CmsLoaderException
- if the binary type is missing
-
createFakeFolder
protected CmsResource createFakeFolder(java.lang.String rootPath) throws CmsLoaderException
Creates a fake CmsResource of type 'folder'.- Parameters:
rootPath
- the root path- Returns:
- the fake resource
- Throws:
CmsLoaderException
- if the 'folder' type can not be found
-
-