org.bibop.xml.xforge.components.xmldb
Class XMLDBComponent

java.lang.Object
  |
  +--org.bibop.xml.xforge.components.AbstractXForgeComponent
        |
        +--org.bibop.xml.xforge.components.AbstractXForgePoolableComponent
              |
              +--org.bibop.xml.xforge.components.xmldb.XMLDBComponent
All Implemented Interfaces:
org.apache.avalon.framework.component.Component, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.excalibur.pool.Poolable, PrefixesMonitor, XForgeComponent, XMLProducer

public class XMLDBComponent
extends AbstractXForgePoolableComponent
implements org.apache.avalon.framework.configuration.Configurable

This component acts as a frontend to an XML:DB enabled database. It allows to get documents and/or collection or to perform XPath queries

Author:
Gianugo Rabellino

Field Summary
protected  java.lang.String action
           
protected  org.xmldb.api.base.Collection collection
           
protected  org.xmldb.api.base.Database database
           
protected  java.lang.String driver
           
protected  java.lang.String fileName
           
protected  boolean handleErrorsInternally
           
protected  java.lang.String url
           
protected  java.lang.String xpath
           
 
Fields inherited from class org.bibop.xml.xforge.components.AbstractXForgeComponent
contentHandler, context, lexicalHandler, log, parameters, po
 
Constructor Summary
XMLDBComponent()
           
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration config)
          Configure the component given a driver, a URL and an action (get|xpath)
 void setup()
          Prepare the initial environment
 void toSax()
          Query the database and output the result
 
Methods inherited from class org.bibop.xml.xforge.components.AbstractXForgeComponent
enableLogging, getActivePrefixes, output, output, setConsumer, setContentHandler, setLexicalHandler, setParameters, setParentPrefixesMonitor, setProcessingOptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

database

protected org.xmldb.api.base.Database database

collection

protected org.xmldb.api.base.Collection collection

driver

protected java.lang.String driver

url

protected java.lang.String url

action

protected java.lang.String action

xpath

protected java.lang.String xpath

fileName

protected java.lang.String fileName

handleErrorsInternally

protected boolean handleErrorsInternally
Constructor Detail

XMLDBComponent

public XMLDBComponent()
Method Detail

configure

public void configure(org.apache.avalon.framework.configuration.Configuration config)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Configure the component given a driver, a URL and an action (get|xpath)

Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Overrides:
configure in class AbstractXForgeComponent
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

setup

public void setup()
           throws java.lang.Exception
Prepare the initial environment

Throws:
java.lang.Exception

toSax

public void toSax()
           throws org.xml.sax.SAXException
Query the database and output the result

Specified by:
toSax in interface XForgeComponent
Throws:
org.xml.sax.SAXException


Copyright © 2003 Bibop Research International. All Rights Reserved.