edu.ucsb.nceas.metacat
Class Eml210SAXHandler

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byedu.ucsb.nceas.metacat.DBSAXHandler
          extended byedu.ucsb.nceas.metacat.Eml210SAXHandler
All Implemented Interfaces:
AccessControlInterface, org.xml.sax.ContentHandler, org.xml.sax.ext.DeclHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.ext.LexicalHandler, java.lang.Runnable

public class Eml210SAXHandler
extends DBSAXHandler
implements AccessControlInterface

A database aware Class implementing callback bethods for the SAX parser to call when processing the XML stream and generating events


Field Summary
static java.lang.String INLINE
           
 
Fields inherited from class edu.ucsb.nceas.metacat.DBSAXHandler
action, atFirstElement, connection, currentDocument, docid, docname, doctype, ECOGRID, endNodeId, groups, hitTextNode, INDEXDELAY, MAXDATACHARS, namespaces, nodeIndex, nodeStack, processingDTD, pub, revision, rootNode, serverCode, systemid, textBuffer, textBufferStack, user, xmlIndex
 
Fields inherited from interface edu.ucsb.nceas.metacat.AccessControlInterface
ACCESS, ACLID, ALL, ALLOW, ALLOWFIRST, ALLSTRING, CHMOD, CHMODSTRING, DENY, DENYFIRST, PERMISSION, PRINCIPAL, PUBLIC, READ, READSTRING, WRITE, WRITESTRING
 
Constructor Summary
Eml210SAXHandler(DBConnection conn, java.lang.String action, java.lang.String docid, java.lang.String revision, java.lang.String user, java.lang.String[] groups, java.lang.String pub, int serverCode)
          Construct an instance of the handler class In this constructor, user can specify the version need to upadate
 
Method Summary
 void characters(char[] cbuf, int start, int len)
          SAX Handler that is called for each XML text node
 void comment(char[] ch, int start, int length)
          SAX Handler that receives notification of comments in the DTD
 boolean compareInlineDataFiles(java.lang.String oldFileName, java.lang.String newFileName)
           
 void deleteInlineFiles()
           
 void endDocument()
          SAX Handler that receives notification of end of the document
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
          SAX Handler that is called at the end of each XML element
 void ignorableWhitespace(char[] cbuf, int start, int len)
          SAX Handler that is called for each XML text node that is Ignorable white space
 void processingInstruction(java.lang.String target, java.lang.String data)
          SAX Handler called once for each processing instruction found: node that PI may occur before or after the root element.
static java.io.Reader readInlineDataFromFileSystem(java.lang.String fileName)
           
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
          SAX Handler that is called at the start of each XML element
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
          SAX Handler that is called at the start of Namespace
 
Methods inherited from class edu.ucsb.nceas.metacat.DBSAXHandler
attributeDecl, elementDecl, endCDATA, endDTD, endEntity, error, externalEntityDecl, fatalError, getDocname, internalEntityDecl, processingDTD, run, startCDATA, startDocument, startDTD, startEntity, warning, writeTextForDBSAXNode
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, notationDecl, resolveEntity, setDocumentLocator, skippedEntity, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INLINE

public static final java.lang.String INLINE
See Also:
Constant Field Values
Constructor Detail

Eml210SAXHandler

public Eml210SAXHandler(DBConnection conn,
                        java.lang.String action,
                        java.lang.String docid,
                        java.lang.String revision,
                        java.lang.String user,
                        java.lang.String[] groups,
                        java.lang.String pub,
                        int serverCode)
                 throws org.xml.sax.SAXException
Construct an instance of the handler class In this constructor, user can specify the version need to upadate

Parameters:
conn - the JDBC connection to which information is written
action - - "INSERT" or "UPDATE"
docid - to be inserted or updated into JDBC connection
user - the user connected to MetaCat servlet and owns the document
groups - the groups to which user belongs
pub - flag for public "read" access on document
serverCode - the serverid from xml_replication on which this document resides.
Method Detail

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
SAX Handler that is called at the start of each XML element

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class DBSAXHandler
Throws:
org.xml.sax.SAXException

characters

public void characters(char[] cbuf,
                       int start,
                       int len)
                throws org.xml.sax.SAXException
SAX Handler that is called for each XML text node

Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class DBSAXHandler
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
SAX Handler that is called at the end of each XML element

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class DBSAXHandler
Throws:
org.xml.sax.SAXException

comment

public void comment(char[] ch,
                    int start,
                    int length)
             throws org.xml.sax.SAXException
SAX Handler that receives notification of comments in the DTD

Specified by:
comment in interface org.xml.sax.ext.LexicalHandler
Overrides:
comment in class DBSAXHandler
Throws:
org.xml.sax.SAXException

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
SAX Handler called once for each processing instruction found: node that PI may occur before or after the root element.

Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Overrides:
processingInstruction in class DBSAXHandler
Throws:
org.xml.sax.SAXException

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException
SAX Handler that is called at the start of Namespace

Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Overrides:
startPrefixMapping in class DBSAXHandler
Throws:
org.xml.sax.SAXException

ignorableWhitespace

public void ignorableWhitespace(char[] cbuf,
                                int start,
                                int len)
                         throws org.xml.sax.SAXException
SAX Handler that is called for each XML text node that is Ignorable white space

Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler
Overrides:
ignorableWhitespace in class DBSAXHandler
Throws:
org.xml.sax.SAXException

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
SAX Handler that receives notification of end of the document

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class DBSAXHandler
Throws:
org.xml.sax.SAXException

compareInlineDataFiles

public boolean compareInlineDataFiles(java.lang.String oldFileName,
                                      java.lang.String newFileName)
                               throws McdbException
Throws:
McdbException

deleteInlineFiles

public void deleteInlineFiles()

readInlineDataFromFileSystem

public static java.io.Reader readInlineDataFromFileSystem(java.lang.String fileName)
                                                   throws McdbException
Throws:
McdbException


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.