org.apache.torque.task
Class TorqueMergeXMLDoc

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.torque.task.TorqueMergeXMLDoc

public class TorqueMergeXMLDoc
extends org.apache.tools.ant.Task

This ant task will merge the schema-desc.xml with schema.xml, if schema-description.xml exists

Author:
Kuali Rice Team (kuali-rice@googlegroups.com)

Field Summary
private static String COLUMN_ELEMENT
           
private  File dbSchema
           
private  Document dbSchemaDoc
           
private  String dbSchemaString
           
private static String DESCRIPTION_ATTR
           
private static String JAVA_NAME_ATTR
           
private static String NAME_ATTR
           
private  File schemaWithDesc
           
private  Document schemaWithDescDoc
           
private  String schemaWithDescString
           
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
TorqueMergeXMLDoc()
           
 
Method Summary
 Document createNewXML(Document dbSchemaDoc, Document schemaWithDescDoc)
          merges the two xml document.
 void execute()
           
 File getDbSchema()
           
 void mergeSchemas(File schemaWithDesc, File dbSchema)
          performs the merge operation by taking two input files as input and then merges the file with description into the existing schema.xml file
 void setDbSchema(String dbSchemaString)
           
 void setDbSchemaString(String dbSchemaString)
           
static Document setDocument(File file)
          creates a document object from an input file
 void setSchemaWithDesc(String schemaWithDescString)
           
 void setSchemaWithDescString(String schemaWithDescString)
           
 void writeXMLToFile(Document newXMLDocument)
          writes the document object to an output file
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DESCRIPTION_ATTR

private static final String DESCRIPTION_ATTR
See Also:
Constant Field Values

JAVA_NAME_ATTR

private static final String JAVA_NAME_ATTR
See Also:
Constant Field Values

NAME_ATTR

private static final String NAME_ATTR
See Also:
Constant Field Values

COLUMN_ELEMENT

private static final String COLUMN_ELEMENT
See Also:
Constant Field Values

schemaWithDesc

private File schemaWithDesc

dbSchema

private File dbSchema

schemaWithDescString

private String schemaWithDescString

dbSchemaString

private String dbSchemaString

schemaWithDescDoc

private Document schemaWithDescDoc

dbSchemaDoc

private Document dbSchemaDoc
Constructor Detail

TorqueMergeXMLDoc

public TorqueMergeXMLDoc()
Method Detail

setDbSchemaString

public void setDbSchemaString(String dbSchemaString)

setSchemaWithDescString

public void setSchemaWithDescString(String schemaWithDescString)

getDbSchema

public File getDbSchema()

setSchemaWithDesc

public void setSchemaWithDesc(String schemaWithDescString)

setDbSchema

public void setDbSchema(String dbSchemaString)

setDocument

public static Document setDocument(File file)
                            throws ParserConfigurationException,
                                   SAXException,
                                   IOException
creates a document object from an input file

Parameters:
file -
Returns:
Document object
Throws:
ParserConfigurationException
SAXException
IOException

mergeSchemas

public void mergeSchemas(File schemaWithDesc,
                         File dbSchema)
                  throws Exception
performs the merge operation by taking two input files as input and then merges the file with description into the existing schema.xml file

Parameters:
schemaWithDesc -
dbSchema -
Throws:
Exception

createNewXML

public Document createNewXML(Document dbSchemaDoc,
                             Document schemaWithDescDoc)
                      throws Exception
merges the two xml document. The resulting document will be same as schema.xml except it will have a description attribute for all its tables and columns.

Throws:
Exception

writeXMLToFile

public void writeXMLToFile(Document newXMLDocument)
                    throws Exception
writes the document object to an output file

Parameters:
newXMLDocument - output xml document
Throws:
Exception

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.