|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.file.wrapper.A_CmsResourceWrapper
org.opencms.file.wrapper.CmsResourceWrapperXmlPage
public class CmsResourceWrapperXmlPage
A resource type wrapper for xml page files, which explodes the xml pages to folders.
Every resource of type "xmlpage" becomes a folder with the same name. That folder contains the locales of the xml page as folders too. In the locale folder there are the elements for that locale as files. The files have the names of the elements with the extension "html". Additionaly there is a file in the root folder of that xml page that contains the controlcode of the xml page. This file has the name "controlcode.xml".
Field Summary |
---|
Fields inherited from class org.opencms.file.wrapper.A_CmsResourceWrapper |
---|
m_isWrappedResource |
Constructor Summary | |
---|---|
CmsResourceWrapperXmlPage()
|
Method Summary | |
---|---|
java.util.List |
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. |
boolean |
copyResource(CmsObject cms,
java.lang.String source,
java.lang.String destination,
CmsResource.CmsResourceCopyMode siblingMode)
Copies a resource. |
CmsResource |
createResource(CmsObject cms,
java.lang.String resourcename,
int type,
byte[] content,
java.util.List 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. |
protected java.lang.String |
getUriStyleSheet(CmsObject cms,
CmsResource res)
Returns the OpenCms VFS uri of the style sheet of the resource. |
protected java.lang.String |
getUriTemplate(CmsObject cms,
CmsResource res)
Returns the OpenCms VFS uri of the template of 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)
Locks a resource. |
boolean |
moveResource(CmsObject cms,
java.lang.String source,
java.lang.String destination)
Moves a resource to the given destination. |
protected java.lang.String |
prepareContent(java.lang.String content,
CmsObject cms,
CmsResource xmlPage,
java.lang.String path)
Prepare the content of a xml page before returning. |
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 res)
Changes the given resource based on the implementation of this wrapper. |
CmsFile |
writeFile(CmsObject cms,
CmsFile resource)
Writes a resource, including it's content. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CmsResourceWrapperXmlPage()
Method Detail |
---|
public java.util.List 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 use
CmsResource
s
CmsException
- if something goes wrongA_CmsResourceWrapper.addResourcesToFolder(CmsObject, String, CmsResourceFilter)
public boolean copyResource(CmsObject cms, java.lang.String source, java.lang.String destination, CmsResource.CmsResourceCopyMode siblingMode) throws CmsException, CmsIllegalArgumentException
I_CmsResourceWrapper
First 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
in interface I_CmsResourceWrapper
copyResource
in class A_CmsResourceWrapper
cms
- 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 copy
CmsException
- if something goes wrong
CmsIllegalArgumentException
- if the destination
argument is null or of length 0A_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 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 resource
CmsException
- if something goes wrong
CmsIllegalArgumentException
- 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 resource
CmsException
- if something goes wrongA_CmsResourceWrapper.deleteResource(CmsObject, 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 for
CmsException
- 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 check
I_CmsResourceWrapper.isWrappedResource(org.opencms.file.CmsObject, org.opencms.file.CmsResource)
public boolean lockResource(CmsObject cms, java.lang.String resourcename) 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 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)
CmsException
- if something goes wrongA_CmsResourceWrapper.lockResource(org.opencms.file.CmsObject, java.lang.String)
public boolean moveResource(CmsObject cms, java.lang.String source, java.lang.String destination) throws CmsException, CmsIllegalArgumentException
I_CmsResourceWrapper
First 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
in interface I_CmsResourceWrapper
moveResource
in class A_CmsResourceWrapper
cms
- the current cms contextsource
- the name of the resource to movedestination
- the destination resource name
CmsException
- if something goes wrong
CmsIllegalArgumentException
- if the source
argument is null or of length 0A_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_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 reading
CmsException
- if the file resource could not be read for any reasonA_CmsResourceWrapper.readFile(CmsObject, String, CmsResourceFilter)
public CmsResource readResource(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.
readResource
in interface I_CmsResourceWrapper
readResource
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 reading
CmsException
- if the resource could not be read for any reasonA_CmsResourceWrapper.readResource(CmsObject, String, CmsResourceFilter)
public java.lang.String restoreLink(CmsObject cms, java.lang.String uri)
I_CmsResourceWrapper
Turns the virtual path into a real path to a resource in the VFS.
restoreLink
in interface I_CmsResourceWrapper
restoreLink
in class A_CmsResourceWrapper
cms
- the initialized CmsObjecturi
- the (virtual) uri to be restored
A_CmsResourceWrapper.restoreLink(org.opencms.file.CmsObject, java.lang.String)
public java.lang.String rewriteLink(CmsObject cms, CmsResource res)
I_CmsResourceWrapper
For 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
in interface I_CmsResourceWrapper
rewriteLink
in class A_CmsResourceWrapper
cms
- the initialized CmsObjectres
- the resource where to rewrite the path
A_CmsResourceWrapper.rewriteLink(CmsObject, CmsResource)
public boolean unlockResource(CmsObject cms, java.lang.String resourcename) 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 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)
CmsException
- if something goes wrongA_CmsResourceWrapper.unlockResource(org.opencms.file.CmsObject, java.lang.String)
public CmsResource wrapResource(CmsObject cms, CmsResource res)
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
in interface I_CmsResourceWrapper
wrapResource
in class A_CmsResourceWrapper
cms
- the current users OpenCms contextres
- the resource to wrap
CmsResource
object or null
to not change the resourceA_CmsResourceWrapper.wrapResource(CmsObject, CmsResource)
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 to
CmsException
- if something goes wrongA_CmsResourceWrapper.writeFile(org.opencms.file.CmsObject, org.opencms.file.CmsFile)
protected java.lang.String getUriStyleSheet(CmsObject cms, CmsResource res)
cms
- the initialized CmsObjectres
- the resource where to read the style sheet for
protected java.lang.String getUriTemplate(CmsObject cms, CmsResource res)
cms
- the initialized CmsObjectres
- the resource where to read the template for
protected java.lang.String prepareContent(java.lang.String content, CmsObject cms, CmsResource xmlPage, java.lang.String path)
Mainly adds the basic html structure and the css style sheet.
content
- the origin content of the xml page elementcms
- the initialized CmsObjectxmlPage
- the xml page resourcepath
- the full path to set as the title in the html head
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |