com.sri.emo.controller
Class ModelXMLWriter

java.lang.Object
  extended by com.sri.emo.controller.ModelXMLWriter

public class ModelXMLWriter
extends Object

Extraction of XML writing to a separate class.

Author:
Michael Rimov

Field Summary
static String DATA_NODES
          The key of the node id used to separate Entities from their respective Nodes.
static String DELIMITER
           
 
Constructor Summary
ModelXMLWriter()
          Default constructor.
 
Method Summary
protected  void addPicklists(org.dom4j.Element xml, ArrayList alreadyIncluded)
          Loop through nodes and add all picklists (just once) section to xml
 org.dom4j.Document renderEntityAsXml(NodeType entity)
          Render an entity as an XML document.
 org.dom4j.Document renderEntityAsXml(NodeType entity, ExpressoRequest request, boolean renderNodes)
          Renders the entity and nodes as XML.
 org.dom4j.Document renderNodeAsXml(Node querynode, ExpressoRequest request)
          Converts a particular node to XML.
 org.dom4j.Element[] renderNodesAsXml(Node[] allNodes, ExpressoRequest request)
          Similar to the above list, but renders an array of XML nodes in succession to the resulting document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATA_NODES

public static final String DATA_NODES
The key of the node id used to separate Entities from their respective Nodes.

See Also:
Constant Field Values

DELIMITER

public static final String DELIMITER
See Also:
Constant Field Values
Constructor Detail

ModelXMLWriter

public ModelXMLWriter()
Default constructor.

Method Detail

renderEntityAsXml

public org.dom4j.Document renderEntityAsXml(NodeType entity,
                                            ExpressoRequest request,
                                            boolean renderNodes)
                                     throws DBException,
                                            ControllerException
Renders the entity and nodes as XML.

Parameters:
entity - NodeType the entity to render
request - ControllerRequest the ControllerRequest object
renderNodes - true if you want the individual nodes rendered as well.
Returns:
Document the resulting document.
Throws:
DBException - upon database error,
ControllerException - upon rendering error.

renderNodeAsXml

public org.dom4j.Document renderNodeAsXml(Node querynode,
                                          ExpressoRequest request)
                                   throws ControllerException
Converts a particular node to XML.

Parameters:
querynode - Node
request - ControllerRequest
Returns:
String
Throws:
ControllerException

renderEntityAsXml

public org.dom4j.Document renderEntityAsXml(NodeType entity)
                                     throws DBException
Render an entity as an XML document.

Parameters:
entity - NodeType the node type to render
Returns:
Document the document.
Throws:
DBException - upon database access error.

renderNodesAsXml

public org.dom4j.Element[] renderNodesAsXml(Node[] allNodes,
                                            ExpressoRequest request)
                                     throws ControllerException
Similar to the above list, but renders an array of XML nodes in succession to the resulting document.

Parameters:
allNodes - Node[] an array of nodes.
request - ControllerRequest
Returns:
Document
Throws:
ControllerException

addPicklists

protected void addPicklists(org.dom4j.Element xml,
                            ArrayList alreadyIncluded)
                     throws DBException
Loop through nodes and add all picklists (just once) section to xml

Parameters:
xml - the XML DOM Element fragment root
alreadyIncluded - ArrayList
Throws:
DBException - upon error.


Copyright © 2004-2006 Codeguild, Inc.. All Rights Reserved.