gov.lanl.Web
Class CSV2CORBA

java.lang.Object
  |
  +--gov.lanl.Web.CSV2CORBA

public class CSV2CORBA
extends java.lang.Object

Translate CSV data to CORBA. the CSV data can come from a file or from an sql query.

Version:
$Id: CSV2CORBA.java,v 1.17 2003/02/12 22:04:20 dwforslund Exp $
Author:
$Author: dwforslund $

Constructor Summary
CSV2CORBA(gov.lanl.Utility.ConfigProperties props)
           
 
Method Summary
 void applyTypes(org.w3c.dom.Node node, java.util.HashMap types)
          Recursive method to add type attributes to a DOM hierarchy, using the given map to indicate the attribute value to use for each Element of a given name.
 org.w3c.dom.Document csvRead(java.lang.String[] input, java.util.HashMap typesMap)
          Read in CSV data from String arrays
 org.w3c.dom.Document csvRead(java.lang.String input, java.util.HashMap typesMap)
          Read in the CSV file to a DOM Document
 org.w3c.dom.Document getDocument()
          get the XML Document being processed
 void IDTransform(java.lang.String key, org.w3c.dom.Document doc)
          Append the date to the key field which identifies the record this then is used to determine the creation date of the record.
 void init(java.lang.String input)
          initialize the object
static void main(java.lang.String[] args)
          Main program to transform from CSV to CORBA
 void postTransform(org.w3c.dom.Document document, java.lang.String code)
          Transform the document with Java code instead of just XSL This finds the target code and adds a category to it.
 void preTransform(java.lang.String id, java.lang.String code)
          Transform the document with Java code instead of just XSL This is used to transform the object before converting to the COAS model
 void process()
          Set up the class for running from a thread.
 void processCOAS(java.lang.String coasProps, java.lang.String coasXSL)
          Process the COAS XSL transform
 java.util.HashMap readTypes(java.lang.String typesFilename)
          initialize types definitions.
 void setDocument(org.w3c.dom.Document doc)
          set the Document to be processed
 org.w3c.dom.Document tableRead(java.util.List input, java.util.HashMap typesMap)
          Read in CSV data from String arrays
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSV2CORBA

public CSV2CORBA(gov.lanl.Utility.ConfigProperties props)
Method Detail

init

public void init(java.lang.String input)
          throws java.text.ParseException
initialize the object

java.text.ParseException

main

public static void main(java.lang.String[] args)
Main program to transform from CSV to CORBA

Parameters:
args -

process

public void process()
Set up the class for running from a thread.


setDocument

public void setDocument(org.w3c.dom.Document doc)
set the Document to be processed

Parameters:
doc -

getDocument

public org.w3c.dom.Document getDocument()
get the XML Document being processed

Returns:

csvRead

public org.w3c.dom.Document csvRead(java.lang.String input,
                                    java.util.HashMap typesMap)
Read in the CSV file to a DOM Document

Parameters:
input -
typesMap -
Returns:

csvRead

public org.w3c.dom.Document csvRead(java.lang.String[] input,
                                    java.util.HashMap typesMap)
Read in CSV data from String arrays

Parameters:
input -
typesMap -
Returns:

tableRead

public org.w3c.dom.Document tableRead(java.util.List input,
                                      java.util.HashMap typesMap)
Read in CSV data from String arrays

Parameters:
input -
typesMap -
Returns:

processCOAS

public void processCOAS(java.lang.String coasProps,
                        java.lang.String coasXSL)
                 throws java.io.IOException
Process the COAS XSL transform

Parameters:
coasProps -
coasXSL -
Throws:
java.io.IOException

applyTypes

public void applyTypes(org.w3c.dom.Node node,
                       java.util.HashMap types)
Recursive method to add type attributes to a DOM hierarchy, using the given map to indicate the attribute value to use for each Element of a given name.

Parameters:
node - Base node to alter.
types - Map of element names to type attributes to add.

readTypes

public java.util.HashMap readTypes(java.lang.String typesFilename)
initialize types definitions. The type may control the XSL style sheet for further translation


preTransform

public void preTransform(java.lang.String id,
                         java.lang.String code)
Transform the document with Java code instead of just XSL This is used to transform the object before converting to the COAS model

Parameters:
id - is the id to be encrypted
code - is the field to be used to determine the category

IDTransform

public void IDTransform(java.lang.String key,
                        org.w3c.dom.Document doc)
Append the date to the key field which identifies the record this then is used to determine the creation date of the record.

Parameters:
doc -

postTransform

public void postTransform(org.w3c.dom.Document document,
                          java.lang.String code)
Transform the document with Java code instead of just XSL This finds the target code and adds a category to it.

Parameters:
document - object to be transformed
code - is the object to be modified.


Copyright © 2000 University of California. All Rights Reserved.