oracle.forms.util.xmltools
Class XML2Forms

java.lang.Object
  |
  +--oracle.forms.util.xmltools.XML2Forms

public class XML2Forms
extends java.lang.Object

This class takes an XML Form representation and converts it back to a module and using the Jdapi. It can be used in two ways
1) As a stand alone program which can be called from the command line.
2) As a utility called from another java class which returns the module as an object of class oracle.forms.jdapi.JdapiModule.

This class is the counterpart to Forms2XML.

The XML is first validated against the Forms XML Schema, using the oracle.forms.util.xmltools.XMLValidator class then parsed using the Oracle XDK and converted into an module of appropriate type.

To use this tool the user will need the Forms Jdapi (Java Design-time API) on their classpath.


Constructor Summary
XML2Forms(java.net.URL xmlIn)
          Constructor - Takes the URL of the XML ready for parsing.
 
Method Summary
 void commandLine(java.lang.Boolean printTree)
          Lets the tool know that it's been invoked from the command line, it therefore outputs progress indicators to the System.out.
 void connectToDatabase(java.lang.String dbConnectString)
          Connects to a database with the given connection string.
 oracle.forms.jdapi.JdapiModule createModule()
          Parses the XML at the URL given to the Constructor and returns the module.
 void endElement(oracle.xml.parser.v2.XMLElement element)
          This method is excuted by the parser after every XML element.
static void main(java.lang.String[] args)
          Takes an XML filename or set of filenames to process.
 void parseXML()
          This method is excuted by the parser to start the parsing process.
 void startElement(oracle.xml.parser.v2.XMLElement element)
          This method is excuted by the parser at the start of every XML element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XML2Forms

public XML2Forms(java.net.URL xmlIn)
Constructor - Takes the URL of the XML ready for parsing.
Parameters:
xmlIn - the URL of the XML
Method Detail

commandLine

public void commandLine(java.lang.Boolean printTree)
Lets the tool know that it's been invoked from the command line, it therefore outputs progress indicators to the System.out. The method takes a boolean telling the tool whether or not to print out a tree of the forms objects as it creates them.
Parameters:
printTree - the tool prints an object tree if true.

connectToDatabase

public void connectToDatabase(java.lang.String dbConnectString)
Connects to a database with the given connection string. If you are using the tool manually (ie. not using the main method) you must connect to a database for the creation of any Record Groups in you module.
Parameters:
dbConnectString - user/pass@database

createModule

public oracle.forms.jdapi.JdapiModule createModule()
                                            throws oracle.xml.parser.v2.XMLParseException,
                                                   oracle.xml.parser.schema.XSDException,
                                                   org.xml.sax.SAXException,
                                                   java.io.IOException
Parses the XML at the URL given to the Constructor and returns the module.
Returns:
JdapiModule
Throws:
java.io.IOException - if the URL isn't valid.
org.xml.sax.SAXException - if the XML isn't valid.
java.io.UTFDataFormatException - if the XML isn't a valid format.
oracle.xml.parser.v2.XMLParseException - if the XML isn't valid.
oracle.xml.parser.schema.XSDException - if there was an error in the Schema Builder.

parseXML

public void parseXML()
              throws java.io.UTFDataFormatException,
                     oracle.xml.parser.v2.XMLParseException,
                     org.xml.sax.SAXException,
                     java.io.IOException,
                     oracle.xml.parser.schema.XSDException
This method is excuted by the parser to start the parsing process. Use createModule() to parse the XML and return the JdapiModule, not this method.
Throws:
java.io.IOException - if the URL isn't valid.
org.xml.sax.SAXException - if the XML isn't valid.
java.io.UTFDataFormatException - if the XML isn't a valid format.
oracle.xml.parser.v2.XMLParseException - if the XML isn't valid.
oracle.xml.parser.schema.XSDException - if there was an error in the Schema Builder.

startElement

public void startElement(oracle.xml.parser.v2.XMLElement element)
This method is excuted by the parser at the start of every XML element.

endElement

public void endElement(oracle.xml.parser.v2.XMLElement element)
This method is excuted by the parser after every XML element.

main

public static void main(java.lang.String[] args)
Takes an XML filename or set of filenames to process. Each file is parsed and converted into its appropriate Forms Module (.fmb, .olb or .mmb).
Parameters:
args - command line arguments