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

See Also:
Constant Field Values

PREFIX

protected static final java.lang.String PREFIX
See Also:
Constant Field Values

COLLECTIONS

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

See Also:
Constant Field Values

QCOLLECTIONS

protected static final java.lang.String QCOLLECTIONS
See Also:
Constant Field Values

RESOURCE_COUNT_ATTR

protected static final java.lang.String RESOURCE_COUNT_ATTR
See Also:
Constant Field Values

COLLECTION_COUNT_ATTR

protected static final java.lang.String COLLECTION_COUNT_ATTR
See Also:
Constant Field Values

COLLECTION

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

See Also:
Constant Field Values

QCOLLECTION

protected static final java.lang.String QCOLLECTION
See Also:
Constant Field Values

RESOURCE

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

See Also:
Constant Field Values

QRESOURCE

protected static final java.lang.String QRESOURCE
See Also:
Constant Field Values

NAME_ATTR

protected static final java.lang.String NAME_ATTR
See Also:
Constant Field Values

RESULTSET

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

See Also:
Constant Field Values

QRESULTSET

protected static final java.lang.String QRESULTSET
See Also:
Constant Field Values

QUERY_ATTR

protected static final java.lang.String QUERY_ATTR
See Also:
Constant Field Values

RESULTS_COUNT_ATTR

protected static final java.lang.String RESULTS_COUNT_ATTR
See Also:
Constant Field Values

RESULT

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

See Also:
Constant Field Values

QRESULT

protected static final java.lang.String QRESULT
See Also:
Constant Field Values

RESULT_DOCID_ATTR

protected static final java.lang.String RESULT_DOCID_ATTR
See Also:
Constant Field Values

RESULT_ID_ATTR

protected static final java.lang.String RESULT_ID_ATTR
See Also:
Constant Field Values

CDATA

protected static final java.lang.String CDATA
See Also:
Constant Field Values
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.
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.

Specified by:
toSAX in interface XMLizable
Specified by:
toSAX in class AbstractSAXSource
org.xml.sax.SAXException
ProcessingException

recycle

public void recycle()

getSystemId

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

Specified by:
getSystemId in interface Source
Specified by:
getSystemId in class AbstractSAXSource


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