org.mmbase.util.xml.applicationdata
Class ApplicationWriter

java.lang.Object
  extended by org.mmbase.util.xml.DocumentReader
      extended by org.mmbase.util.xml.DocumentWriter
          extended by org.mmbase.util.xml.applicationdata.ApplicationWriter

public class ApplicationWriter
extends DocumentWriter

Version:
$Id: ApplicationWriter.java 34900 2009-05-01 16:29:42Z michiel $
Author:
Daniel Ockeloen
Javadoc:

Field Summary
protected  MMBase mmbase
           
protected  ApplicationReader reader
           
 
Fields inherited from class org.mmbase.util.xml.DocumentReader
document, DTD_ERROR, DTD_ERROR_1_0, FILENOTFOUND, PUBLIC_ID_ERROR, PUBLIC_ID_ERROR_1_0
 
Constructor Summary
ApplicationWriter(ApplicationReader reader, MMBase mmbase)
          Constructs the document writer.
 
Method Summary
protected  void addAllowedRelationList(Element root)
           
protected  void addContextSourceList(Element root)
           
protected  void addDataSourceList(Element root)
           
protected  void addNeededBuilderList(Element root)
           
protected  void addNeededRelDefList(Element root)
           
protected  void addRelationSourceList(Element root)
           
protected  void addRequirements(Element root)
           
protected  void generate()
          Generates the document.
 boolean writeApplicationToFile(String filepath, String path)
           
 boolean writeBuilderToFile(String filepath, String path)
           
 void writeToPath(String targetPath, Logger logger)
          Generates the documents for this application and store it as a set of files in the given path.
 
Methods inherited from class org.mmbase.util.xml.DocumentWriter
addComment, addComment, addComment, addContentElement, generateDocument, getDocument, getMessage, getMessage, getMessage, getMessage, getMessageRetriever, includeComments, setIncludeComments, write, writeToFile, writeToStream, writeToString
 
Methods inherited from class org.mmbase.util.xml.DocumentReader
appendChild, getAttribute, getChildElements, getChildElements, getChildElements, getChildElements, getDocumentBuilder, getDocumentBuilder, getDocumentBuilder, getDocumentBuilder, getElementAttributeValue, getElementAttributeValue, getElementByPath, getElementByPath, getElementName, getElementValue, getElementValue, getNodeTextValue, getNodeTextValue, getRootElement, getSystemId, hasAttribute, main, registerPublicIDs, setNodeTextValue, setPrefix, setSystemId, toDocument, validate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reader

protected ApplicationReader reader

mmbase

protected MMBase mmbase
Constructor Detail

ApplicationWriter

public ApplicationWriter(ApplicationReader reader,
                         MMBase mmbase)
                  throws DOMException
Constructs the document writer. The constructor calls its super to create a basic document, based on the application document type.

Parameters:
reader - the reader for the original application
mmbase - the mmbase instance to get the application data from
Throws:
DOMException - When failed to parse xml or write
Method Detail

generate

protected void generate()
                 throws DOMException
Generates the document. Can only be called once.

Specified by:
generate in class DocumentWriter
Throws:
DOMException - when an error occurred during generation

addRequirements

protected void addRequirements(Element root)

addNeededBuilderList

protected void addNeededBuilderList(Element root)

addNeededRelDefList

protected void addNeededRelDefList(Element root)

addAllowedRelationList

protected void addAllowedRelationList(Element root)

addDataSourceList

protected void addDataSourceList(Element root)

addRelationSourceList

protected void addRelationSourceList(Element root)

addContextSourceList

protected void addContextSourceList(Element root)

writeToPath

public void writeToPath(String targetPath,
                        Logger logger)
                 throws IOException,
                        SAXException,
                        SearchQueryException
Generates the documents for this application and store it as a set of files in the given path.

Parameters:
targetPath - the filepath (directory) where the configuration is to be stored
logger - This thing must receive the errors
Throws:
SAXException - if one or more documents are malformed
IOException - if one or more files cannot be written
SearchQueryException - if data could not be obtained from the database

writeApplicationToFile

public boolean writeApplicationToFile(String filepath,
                                      String path)

writeBuilderToFile

public boolean writeBuilderToFile(String filepath,
                                  String path)


MMBase 2.0-SNAPSHOT - null