public class LoadMetadataVocabs
extends java.lang.Object
implements org.xml.sax.ContentHandler
Constructor and Description |
---|
LoadMetadataVocabs()
Constructor for the LoadMetadataVocabs object that does nothing (use
getMetadataVocabs() method to load and retrieve and instance of a vocab).
|
LoadMetadataVocabs(java.lang.String configDir,
java.lang.String configFile,
java.lang.String xmlParserClass,
javax.servlet.ServletContext servletContext,
java.lang.String sqlDriver,
java.lang.String sqlURL,
java.lang.String sqlUser,
java.lang.String sqlPassword,
java.lang.String vocabTextFile)
Constructor for the LoadMetadataVocabs object that loads an instance of a
MetadataVocab object and sets it as a servlet context attribute.
|
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length)
(SAX) Element data (characters between tags)
|
void |
endDocument()
(SAX) Required by SAX, but not used here
|
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
(SAX) Invoked upon closing tag of an XML element
|
void |
endPrefixMapping(java.lang.String prefix)
(SAX) Required by SAX, but not used here
|
java.lang.String |
getConfigFile()
Gets the configFile attribute of the LoadMetadataVocabs object
|
java.lang.String |
getDatabaseURL()
Gets the databaseURL attribute of the LoadMetadataVocabs object
|
java.lang.String |
getMessage()
Gets the message attribute of the LoadMetadataVocabs object
|
java.lang.String |
getVocabTextFile()
Gets the vocabTextFile attribute of the LoadMetadataVocabs object
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
(SAX) Reports any whitespace that is ignored because it falls outside of
the DTD or schema definition--usefull for re-generating the file with
indents intact, though.
|
void |
load()
Load (or reload) the vocabulary
|
void |
processingInstruction(java.lang.String target,
java.lang.String data)
(SAX) Required by SAX, but not used here
|
void |
setDocumentLocator(org.xml.sax.Locator locator)
(SAX) Sets the SAX locator, which indicates the current position of the
parser within the document (line number, column number).
|
void |
skippedEntity(java.lang.String name)
(SAX) Required by SAX, but not used here
|
void |
startDocument()
(SAX) Required by SAX, but not used here
|
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
(SAX) Invoked upon opening tag of an XML element
|
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
(SAX) Required by SAX, but not used here
|
public LoadMetadataVocabs()
public LoadMetadataVocabs(java.lang.String configDir, java.lang.String configFile, java.lang.String xmlParserClass, javax.servlet.ServletContext servletContext, java.lang.String sqlDriver, java.lang.String sqlURL, java.lang.String sqlUser, java.lang.String sqlPassword, java.lang.String vocabTextFile)
configDir
- Base dir of vocab XML filesconfigFile
- XML defining vocabs to be loadedxmlParserClass
- SAX parser class, i.e.
"org.apache.xerces.parsers.SAXParser"servletContext
- The java servlet context in which to store the
loaded vocabulariessqlDriver
- Optional (can be NULL) driver class for SQL access,
i.e. "org.gjt.mm.mysql.Driver"sqlURL
- Optional (can be NULL) URL to SQL access, i.e.
"jdbc:mysql://quake.dpc.ucar.edu:3306/DLESE_Systems"sqlUser
- Optional (can be NULL) username for access to SQL
tablessqlPassword
- Optional (can be NULL) password for access to SQL
tablesvocabTextFile
- Optional (can be NULL) file where vocabs get listed
as text strings (for use by log analysis/reporting)public void load()
public java.lang.String getMessage()
public java.lang.String getConfigFile()
public java.lang.String getVocabTextFile()
public java.lang.String getDatabaseURL()
public void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator
in interface org.xml.sax.ContentHandler
locator
- The new documentLocator valuepublic void startDocument() throws org.xml.sax.SAXException
startDocument
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException
startPrefixMapping
in interface org.xml.sax.ContentHandler
prefix
- uri
- org.xml.sax.SAXException
public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXException
endPrefixMapping
in interface org.xml.sax.ContentHandler
prefix
- org.xml.sax.SAXException
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
namespaceURI
- XML namespacelocalName
- local tag nameqName
- fully qualified tag nameatts
- tag attributesorg.xml.sax.SAXException
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
namespaceURI
- XML namespacelocalName
- local tag nameqName
- fully qualified tag nameorg.xml.sax.SAXException
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
ch
- character arraystart
- starting index of character datalength
- length of character dataorg.xml.sax.SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException
ignorableWhitespace
in interface org.xml.sax.ContentHandler
ch
- start
- length
- org.xml.sax.SAXException
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException
processingInstruction
in interface org.xml.sax.ContentHandler
target
- data
- org.xml.sax.SAXException
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException
skippedEntity
in interface org.xml.sax.ContentHandler
name
- org.xml.sax.SAXException