org.clazzes.tapestry.ooo.maven
Class OdtTemplate

java.lang.Object
  extended by org.clazzes.tapestry.ooo.maven.OdtTemplate

public class OdtTemplate
extends java.lang.Object

Author:
wglas This class loads an ODT file and replaces the

Constructor Summary
OdtTemplate(org.apache.maven.plugin.logging.Log logger)
          Contruct an Odt template
 
Method Summary
 void readTemplate(java.io.File file)
          Reads an odt file from the filesystem and parses content.xml of the odt files using the Xerces DOM parser.
 void readTemplate(java.lang.String filename)
          Reads an odt file from the filesystem and parses content.xml of the odt files using the Xerces DOM parser.
 void replaceHints()
          Replaces the defined hints with
 void writeTemplate()
          Writes the template to an XML file.
 void writeTemplate(java.io.File file)
          Writes the template to an XML file.
 void writeTemplate(java.lang.String filename)
          Writes the template to an XML file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OdtTemplate

public OdtTemplate(org.apache.maven.plugin.logging.Log logger)
Contruct an Odt template

Method Detail

readTemplate

public void readTemplate(java.lang.String filename)
                  throws java.io.IOException,
                         javax.xml.transform.TransformerException
Reads an odt file from the filesystem and parses content.xml of the odt files using the Xerces DOM parser. Afterwards, the template may be transformed to a tapestry Web Component using replaceHints().

Parameters:
filename - The name of the odt-file to be read.
Throws:
java.io.IOException
javax.xml.transform.TransformerException

readTemplate

public void readTemplate(java.io.File file)
                  throws java.io.IOException,
                         javax.xml.transform.TransformerException
Reads an odt file from the filesystem and parses content.xml of the odt files using the Xerces DOM parser. Afterwards, the template may be transformed to a tapestry Web Component using replaceHints().

Parameters:
file - The odt-file to be read.
Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.transform.TransformerException

replaceHints

public void replaceHints()
                  throws java.io.IOException
Replaces the defined hints with tapestry components. Supported components:

Throws:
java.io.IOException

writeTemplate

public void writeTemplate()
                   throws java.io.IOException,
                          javax.xml.transform.TransformerException
Writes the template to an XML file. The filename is the filename of the odt-file specified in readTemplate() with the odt extension replaced by xml.

Throws:
java.io.IOException
javax.xml.transform.TransformerException

writeTemplate

public void writeTemplate(java.lang.String filename)
                   throws java.io.IOException,
                          javax.xml.transform.TransformerException
Writes the template to an XML file.

Throws:
java.io.IOException
javax.xml.transform.TransformerException

writeTemplate

public void writeTemplate(java.io.File file)
                   throws java.io.IOException,
                          javax.xml.transform.TransformerException
Writes the template to an XML file.

Throws:
java.io.IOException
javax.xml.transform.TransformerException


Copyright © 2008. All Rights Reserved.