edu.wpi.cs.DSRG.xmldb.XMLRDBMSUpdate
Class LoadXML

java.lang.Object
  |
  +--edu.wpi.cs.DSRG.xmldb.XMLRDBMSUpdate.LoadXML

public class LoadXML
extends java.lang.Object

LoadXML.java takes the URI of an XML document and loads its data into the respective data schema created by referencing the DTDM to which the document conformed to. Parses an XML document into a DOM tree using depth first traverse to load data into data tables.

Since:
1/19/2000

Field Summary
(package private)  JDBCClient client
           
(package private)  int currID
           
(package private)  java.lang.String dtdID
           
(package private)  edu.wpi.cs.DSRG.xmldb.XMLRDBMSUpdate.DOMParser parser
           
(package private)  UniqueID unique_id
           
 
Constructor Summary
LoadXML(JDBCClient client, UniqueID generator)
          This constructor takes an already established JDBC client connection and a unique id generator.
LoadXML(java.lang.String URI, java.lang.String username, java.lang.String password, UniqueID generator)
          This constructor that takes in all the arguments necessary to create a new JDBC connection as well as a unique id generator.
 
Method Summary
protected  void addToCatalog(java.lang.String XML)
          The method addToCatalog() adds an XML page and its corresponding DTD's internal id to the XML catalog
 void load(java.lang.String XML)
          The method load() invokes the loading process for an XML document.
 void visitNode(edu.wpi.cs.DSRG.xmldb.XMLRDBMSUpdate.Node cur, int pid, int position)
          The method visitNode() visits a node in the DOM parsed tree and load the node's information, and recursion to this method through DOM tree's hierarchy.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

client

JDBCClient client

unique_id

UniqueID unique_id

currID

int currID

dtdID

java.lang.String dtdID

parser

edu.wpi.cs.DSRG.xmldb.XMLRDBMSUpdate.DOMParser parser
Constructor Detail

LoadXML

public LoadXML(JDBCClient client,
               UniqueID generator)
This constructor takes an already established JDBC client connection and a unique id generator. Creates a new DOM parser and sets this parser to be able to get the XML-Schema.
Parameters:
client - JDBCClient connection already established
generator - UniqueID generator for unique ids

LoadXML

public LoadXML(java.lang.String URI,
               java.lang.String username,
               java.lang.String password,
               UniqueID generator)
This constructor that takes in all the arguments necessary to create a new JDBC connection as well as a unique id generator. It then calls the other contructor to create a parser
Parameters:
URI - String URI of the database to connect to
username - String username of to which to establish a connection
password - String password to the username
generator - UniqueID unique id
Method Detail

visitNode

public void visitNode(edu.wpi.cs.DSRG.xmldb.XMLRDBMSUpdate.Node cur,
                      int pid,
                      int position)
The method visitNode() visits a node in the DOM parsed tree and load the node's information, and recursion to this method through DOM tree's hierarchy. This method terminates upon reaching a leaf node.
Parameters:
cur - Node the current node in concern in tree
pid - int the parent ID of the current tree node
position - int position of the current node with respect to its siblings

addToCatalog

protected void addToCatalog(java.lang.String XML)
                     throws java.lang.Exception
The method addToCatalog() adds an XML page and its corresponding DTD's internal id to the XML catalog
Parameters:
XML - String URI for the XML document

load

public void load(java.lang.String XML)
          throws java.lang.Exception
The method load() invokes the loading process for an XML document. This method parses the XML documents into the DOM tree and invokes the visitNode method for the root.
Parameters:
XML - String URI for the XML document to load