org.apache.cocoon.components.source
Class XMLDBSource

java.lang.Object
  |
  +--org.apache.cocoon.components.source.AbstractSAXSource
        |
        +--org.apache.cocoon.components.source.XMLDBSource
All Implemented Interfaces:
org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, Source, XMLizable

public class XMLDBSource
extends AbstractSAXSource

This class implements the xmldb:// pseudo-protocol and allows to get XML content from an XML:DB enabled XML database.

Version:
CVS $Id: XMLDBSource.java,v 1.7.2.1 2002/08/03 16:44:13 vgritsenko Exp $
Author:
Gianugo Rabellino, Vadim Gritsenko

Field Summary
protected static java.lang.String CDATA
           
protected static java.lang.String COLLECTION
          Element <collection>
protected static java.lang.String COLLECTION_COUNT_ATTR
           
protected static java.lang.String COLLECTIONS
          Root element <collections>
protected static java.lang.String NAME_ATTR
           
protected static java.lang.String PREFIX
           
protected static java.lang.String QCOLLECTION
           
protected static java.lang.String QCOLLECTIONS
           
protected static java.lang.String QRESOURCE
           
protected static java.lang.String QRESULT
           
protected static java.lang.String QRESULTSET
           
protected  java.lang.String query
          The part of URL after # sign
protected static java.lang.String QUERY_ATTR
           
protected static java.lang.String RESOURCE
          Element <resource>
protected static java.lang.String RESOURCE_COUNT_ATTR
           
protected static java.lang.String RESULT
          Element <result>
protected static java.lang.String RESULT_DOCID_ATTR
           
protected static java.lang.String RESULT_ID_ATTR
           
protected static java.lang.String RESULTS_COUNT_ATTR
           
protected static java.lang.String RESULTSET
          Root element <results>
protected  java.lang.String systemId
          The System ID
protected static java.lang.String URI
          Static Strings used for XML Collection representation
protected  java.lang.String url
          The requested URL
 
Fields inherited from class org.apache.cocoon.components.source.AbstractSAXSource
log, manager
 
Constructor Summary
XMLDBSource(Environment environment, org.apache.avalon.framework.component.ComponentManager manager, org.apache.log.Logger logger, java.lang.String url)
          The constructor.
 
Method Summary
 java.lang.String getSystemId()
          Implement this method to set the unique identifier.
 void recycle()
           
 void toSAX(org.xml.sax.ContentHandler handler)
          Stream SAX events to a given ContentHandler.
 
Methods inherited from class org.apache.cocoon.components.source.AbstractSAXSource
getContentLength, getInputSource, getInputStream, getLastModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

url

protected java.lang.String url
The requested URL

query

protected java.lang.String query
The part of URL after # sign

systemId

protected java.lang.String systemId
The System ID

URI

protected static final java.lang.String URI
Static Strings used for XML Collection representation

PREFIX

protected static final java.lang.String PREFIX

COLLECTIONS

protected static final java.lang.String COLLECTIONS
Root element <collections>

QCOLLECTIONS

protected static final java.lang.String QCOLLECTIONS

RESOURCE_COUNT_ATTR

protected static final java.lang.String RESOURCE_COUNT_ATTR

COLLECTION_COUNT_ATTR

protected static final java.lang.String COLLECTION_COUNT_ATTR

COLLECTION

protected static final java.lang.String COLLECTION
Element <collection>

QCOLLECTION

protected static final java.lang.String QCOLLECTION

RESOURCE

protected static final java.lang.String RESOURCE
Element <resource>

QRESOURCE

protected static final java.lang.String QRESOURCE

NAME_ATTR

protected static final java.lang.String NAME_ATTR

RESULTSET

protected static final java.lang.String RESULTSET
Root element <results>

QRESULTSET

protected static final java.lang.String QRESULTSET

QUERY_ATTR

protected static final java.lang.String QUERY_ATTR

RESULTS_COUNT_ATTR

protected static final java.lang.String RESULTS_COUNT_ATTR

RESULT

protected static final java.lang.String RESULT
Element <result>

QRESULT

protected static final java.lang.String QRESULT

RESULT_DOCID_ATTR

protected static final java.lang.String RESULT_DOCID_ATTR

RESULT_ID_ATTR

protected static final java.lang.String RESULT_ID_ATTR

CDATA

protected static final java.lang.String CDATA
Constructor Detail

XMLDBSource

public XMLDBSource(Environment environment,
                   org.apache.avalon.framework.component.ComponentManager manager,
                   org.apache.log.Logger logger,
                   java.lang.String url)
The constructor.
Parameters:
environment - the Cocoon Environment.
url - the URL being queried.
driver - the XML:DB driver class name.
Method Detail

toSAX

public void toSAX(org.xml.sax.ContentHandler handler)
           throws org.xml.sax.SAXException,
                  ProcessingException
Stream SAX events to a given ContentHandler. If the requested resource is a collection, build an XML view of it.
Overrides:
toSAX in class AbstractSAXSource

recycle

public void recycle()

getSystemId

public java.lang.String getSystemId()
Description copied from class: AbstractSAXSource
Implement this method to set the unique identifier.
Overrides:
getSystemId in class AbstractSAXSource


Copyright � 1999-2002 Apache Software Foundation. All Rights Reserved.