edu.ucsb.nceas.metacat
Class DBTransform

java.lang.Object
  |
  +--edu.ucsb.nceas.metacat.DBTransform

public class DBTransform
extends java.lang.Object

A Class that transforms XML documents utitlizing XSL style sheets


Constructor Summary
DBTransform(java.sql.Connection conn)
          construct a DBTransform instance.
 
Method Summary
 void dbg(int position)
           
 java.lang.String getSystemId(java.lang.String objecttype, java.lang.String sourcetype, java.lang.String targettype)
          Lookup a stylesheet reference from the db catalog
static void main(java.lang.String[] args)
          the main routine used to test the transform utility.
 void transformXMLDocument(java.lang.String doc, java.lang.String sourcetype, java.lang.String targettype, java.io.PrintWriter pw)
          Transform an XML document using the stylesheet reference from the db
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBTransform

public DBTransform(java.sql.Connection conn)
            throws java.io.IOException,
                   java.sql.SQLException,
                   java.lang.ClassNotFoundException
construct a DBTransform instance. Generally, one calls transformXMLDocument() after constructing the instance
Parameters:
conn - the database connection from which to lookup the public ids
Method Detail

transformXMLDocument

public void transformXMLDocument(java.lang.String doc,
                                 java.lang.String sourcetype,
                                 java.lang.String targettype,
                                 java.io.PrintWriter pw)
Transform an XML document using the stylesheet reference from the db
Parameters:
doc - the document to be transformed
sourcetype - the document type of the source
targettype - the target document type

getSystemId

public java.lang.String getSystemId(java.lang.String objecttype,
                                    java.lang.String sourcetype,
                                    java.lang.String targettype)
Lookup a stylesheet reference from the db catalog
Parameters:
objecttype - the type of the object we want to retrieve
sourcetype - the document type of the source
targettype - the document type of the target

main

public static void main(java.lang.String[] args)
the main routine used to test the transform utility. Usage: java transform [dbstring]
Parameters:
user - the username to use for the database connection
password - the password to use for the database connection
dbstring - the connection info to use for the database connection

dbg

public void dbg(int position)