com.opencms.template
Interface I_CmsXmlContent

All Superinterfaces:
Cloneable, I_CmsContent
All Known Implementing Classes:
A_CmsXmlContent

public interface I_CmsXmlContent
extends I_CmsContent

Common interface for OpenCms XML content classes. Classes for each customized content type have to be implemtented.

Version:
$Revision: 1.10 $ $Date: 2003/01/20 23:59:21 $
Author:
Alexander Lucas

Method Summary
 Object clone()
          Creates a clone of this object.
 String getAbsoluteFilename()
          Gets the absolute filename of the XML file represented by this content class
 String getFilename()
          Gets a short filename (without path) of the XML file represented by this content class of the template file.
 String getXmlText()
          Prints the XML parsed content to a String
 String getXmlText(Node n)
          Prints the XML parsed content of a given node and its subnodes to a String
 void getXmlText(Writer out)
          Prints the XML parsed content of this template file to the given Writer.
 void getXmlText(Writer out, Node n)
          Prints the XML parsed content of the given Node and its subnodes to the given Writer.
 void init(CmsObject cms, CmsFile file)
          Initialize the XML content class.
 void init(CmsObject cms, Document content, String filename)
          Initialize the class with the given parsed XML DOM document.
 void init(CmsObject cms, String filename)
          Initialize the XML content class.
 A_CmsXmlContent readIncludeFile(String filename)
          Parses the given file and stores it in the internal list of included files and appends the relevant data structures of the new file to its own structures.
 void write()
          Writes the XML document back to the OpenCms system.
 

Method Detail

clone

public Object clone()
             throws CloneNotSupportedException
Creates a clone of this object.

Returns:
cloned object
Throws:
CloneNotSupportedException

getAbsoluteFilename

public String getAbsoluteFilename()
Gets the absolute filename of the XML file represented by this content class

Returns:
Absolute filename

getFilename

public String getFilename()
Gets a short filename (without path) of the XML file represented by this content class of the template file.

Returns:
filename

getXmlText

public String getXmlText()
Prints the XML parsed content to a String

Returns:
String with XML content

getXmlText

public void getXmlText(Writer out)
Prints the XML parsed content of this template file to the given Writer.

Parameters:
out - Writer to print to.

getXmlText

public void getXmlText(Writer out,
                       Node n)
Prints the XML parsed content of the given Node and its subnodes to the given Writer.

Parameters:
out - Writer to print to.
n - Node that should be printed.

getXmlText

public String getXmlText(Node n)
Prints the XML parsed content of a given node and its subnodes to a String

Parameters:
n - Node that should be printed.
Returns:
String with XML content

init

public void init(CmsObject cms,
                 CmsFile file)
          throws CmsException
Initialize the XML content class. Load and parse the content of the given CmsFile object.

Parameters:
cms - CmsObject Object for accessing resources.
file - CmsFile object of the file to be loaded and parsed.
Throws:
CmsException

init

public void init(CmsObject cms,
                 String filename)
          throws CmsException
Initialize the XML content class. Load and parse the file given by filename,

Parameters:
cms - CmsObject Object for accessing resources.
filename - Filename of the file to be loaded.
Throws:
CmsException

init

public void init(CmsObject cms,
                 Document content,
                 String filename)
          throws CmsException
Initialize the class with the given parsed XML DOM document.

Parameters:
cms - CmsObject Object for accessing system resources.
filename - OpenCms filename of the XML file.
Throws:
CmsException

readIncludeFile

public A_CmsXmlContent readIncludeFile(String filename)
                                throws CmsException
Parses the given file and stores it in the internal list of included files and appends the relevant data structures of the new file to its own structures.

Throws:
CmsException

write

public void write()
           throws CmsException
Writes the XML document back to the OpenCms system.

Throws:
CmsException