|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.xml.page.CmsXmlPageFactory
public final class CmsXmlPageFactory
Provides factory methods to unmarshal (read) an XML page object.
Method Summary | |
---|---|
static org.dom4j.Document |
createDocument(java.util.Locale locale)
Creates a valid XML page document, containing one empty element in the given locale. |
static java.lang.String |
createDocument(java.util.Locale locale,
java.lang.String encoding)
Creates a valid XML page String representation, containing one empty element in the given locale. |
static CmsXmlPage |
unmarshal(byte[] xmlData,
java.lang.String encoding,
org.xml.sax.EntityResolver resolver)
Factory method to unmarshal (read) a XML page instance from a byte array that contains XML data. |
static CmsXmlPage |
unmarshal(CmsObject cms,
CmsFile file)
Factory method to unmarshal (read) a XML page instance from a OpenCms VFS file that contains XML data. |
static CmsXmlPage |
unmarshal(CmsObject cms,
CmsFile file,
boolean keepEncoding)
Factory method to unmarshal (read) a XML page instance from a OpenCms VFS file that contains XML data, using wither the encoding set in the XML file header, or the encoding set in the VFS file property. |
static CmsXmlPage |
unmarshal(CmsObject cms,
CmsResource resource,
javax.servlet.ServletRequest req)
Factory method to unmarshal (read) a XML page instance from a resource, using the request attributes as cache. |
static I_CmsXmlDocument |
unmarshal(CmsObject cms,
java.lang.String filename,
javax.servlet.ServletRequest req)
Factory method to unmarshal (read) a XML document instance from a filename in the VFS, using the request attributes as cache. |
static CmsXmlPage |
unmarshal(java.lang.String xmlData,
java.lang.String encoding,
org.xml.sax.EntityResolver resolver)
Factory method to unmarshal (read) a XML page instance from a String that contains XML data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static org.dom4j.Document createDocument(java.util.Locale locale)
locale
- the locale to create the XML page for
public static java.lang.String createDocument(java.util.Locale locale, java.lang.String encoding)
locale
- the locale to create the XML page forencoding
- the encoding to use when creating the String from the XML
public static CmsXmlPage unmarshal(byte[] xmlData, java.lang.String encoding, org.xml.sax.EntityResolver resolver) throws CmsXmlException
When unmarshalling, the encoding is read directly from the XML header. The given encoding is used only when marshalling the XML again later.
xmlData
- the XML data in a byte arrayencoding
- the encoding to use when marshalling the XML page laterresolver
- the XML entity resolver to use
CmsXmlException
- if something goes wrongpublic static CmsXmlPage unmarshal(CmsObject cms, CmsFile file) throws CmsXmlException
cms
- the current cms objectfile
- the file with the XML data to unmarshal
CmsXmlException
- if something goes wrongpublic static CmsXmlPage unmarshal(CmsObject cms, CmsFile file, boolean keepEncoding) throws CmsXmlException
If you are not sure about the implications of the encoding issues,
use unmarshal(CmsObject, CmsFile)
instead.
cms
- the current OpenCms user contextfile
- the file with the XML data to unmarshalkeepEncoding
- if true, the encoding spefified in the XML header is used,
otherwise the encoding from the VFS file property is used
CmsXmlException
- if something goes wrongpublic static CmsXmlPage unmarshal(CmsObject cms, CmsResource resource, javax.servlet.ServletRequest req) throws CmsException
cms
- the current OpenCms user contextresource
- the resource to unmarshalreq
- the current request
CmsResourceTypeXmlPage
CmsException
- in something goes wrongpublic static I_CmsXmlDocument unmarshal(CmsObject cms, java.lang.String filename, javax.servlet.ServletRequest req) throws CmsException
cms
- the current OpenCms user contextfilename
- the filename of the resource to unmarshalreq
- the current request
null
if the given resource was not of type I_CmsXmlDocument
CmsException
- in something goes wrongpublic static CmsXmlPage unmarshal(java.lang.String xmlData, java.lang.String encoding, org.xml.sax.EntityResolver resolver) throws CmsXmlException
When unmarshalling, the encoding is read directly from the XML header. The given encoding is used only when marshalling the XML again later.
xmlData
- the XML data in a Stringencoding
- the encoding to use when marshalling the XML page laterresolver
- the XML entity resolver to use
CmsXmlException
- if something goes wrong
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |