org.apache.cocoon.generation
Class XMLDBCollectionGenerator

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.xml.AbstractXMLProducer
          extended by org.apache.cocoon.generation.AbstractGenerator
              extended by org.apache.cocoon.generation.ServiceableGenerator
                  extended by org.apache.cocoon.generation.XMLDBCollectionGenerator
All Implemented Interfaces:
Poolable, Recyclable, Disposable, Initializable, Component, Configurable, LogEnabled, Serviceable, CacheableProcessingComponent, Generator, SitemapModelComponent, XMLProducer

Deprecated. Use the XML:DB pseudo protocol instead.

public class XMLDBCollectionGenerator
extends ServiceableGenerator
implements CacheableProcessingComponent, Configurable, Initializable

This class implements generation of a XML:DB collection contents as a directory listing.

 <driver>
   (a valid DB:XML compliant driver)
 </driver>
 <base>
   xmldb:yourdriver://host/an/optional/path/to/be/prepended
 </base>
 
NOTE: the driver can be any DB:XML compliant driver (although this component has been tested only with dbXML, and the trailing slash in the base tag is important!

Version:
CVS $Id: XMLDBCollectionGenerator.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Gianugo Rabellino

Field Summary
protected  AttributesImpl attributes
          Deprecated.  
protected  String base
          Deprecated.  
protected  String col
          Deprecated.  
protected  org.xmldb.api.base.Collection collection
          Deprecated.  
protected static String COLLECTION
          Deprecated.  
protected static String COLLECTION_COUNT_ATTR
          Deprecated.  
protected  org.xmldb.api.base.Database database
          Deprecated.  
protected  String driver
          Deprecated.  
protected static String PREFIX
          Deprecated.  
protected static String QCOLLECTION
          Deprecated.  
protected static String QRESOURCE
          Deprecated.  
protected static String RESOURCE
          Deprecated.  
protected static String RESOURCE_COUNT_ATTR
          Deprecated.  
protected static String URI
          Deprecated.  
 
Fields inherited from class org.apache.cocoon.generation.ServiceableGenerator
manager
 
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator
objectModel, parameters, resolver, source
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.generation.Generator
ROLE
 
Constructor Summary
XMLDBCollectionGenerator()
          Deprecated.  
 
Method Summary
 void collectionToSAX(org.xmldb.api.base.Collection collection)
          Deprecated. Output SAX events listing the collection.
 void configure(Configuration conf)
          Deprecated. Configure the component.
 void generate()
          Deprecated. Parse the requested URI, connect to the XML:DB database and fetch the requested resource.
 Serializable getKey()
          Deprecated. The component isn't cached (yet)
 SourceValidity getValidity()
          Deprecated. The component isn't cached (yet)
 void initialize()
          Deprecated. Initialize the component getting a database instance.
 void recycle()
          Deprecated. Recycle the component, keep only the configuration variables and the database instance for reuse.
 void setup(SourceResolver resolver, Map objectModel, String src, Parameters par)
          Deprecated. Set the SourceResolver, object model Map, the source and sitemap Parameters used to process the request.
 
Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator
dispose, service
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
 

Field Detail

URI

protected static final String URI
Deprecated. 
See Also:
Constant Field Values

PREFIX

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

RESOURCE_COUNT_ATTR

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

COLLECTION_COUNT_ATTR

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

COLLECTION

protected static final String COLLECTION
Deprecated. 
See Also:
Constant Field Values

QCOLLECTION

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

RESOURCE

protected static final String RESOURCE
Deprecated. 
See Also:
Constant Field Values

QRESOURCE

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

driver

protected String driver
Deprecated. 

base

protected String base
Deprecated. 

col

protected String col
Deprecated. 

database

protected org.xmldb.api.base.Database database
Deprecated. 

collection

protected org.xmldb.api.base.Collection collection
Deprecated. 

attributes

protected final AttributesImpl attributes
Deprecated. 
Constructor Detail

XMLDBCollectionGenerator

public XMLDBCollectionGenerator()
Deprecated. 
Method Detail

recycle

public void recycle()
Deprecated. 
Recycle the component, keep only the configuration variables and the database instance for reuse.

Specified by:
recycle in interface Recyclable
Overrides:
recycle in class AbstractGenerator

configure

public void configure(Configuration conf)
               throws ConfigurationException
Deprecated. 
Configure the component. This class is expecting a configuration like the following one:
 <driver>org.dbxml.client.xmldb.DatabaseImpl</driver>
 <base>xmldb:dbxml:///db/</base>
 
NOTE: the driver can be any DB:XML compliant driver (although this component has been tested only with dbXML, and the trailing slash in the base tag is important!

Specified by:
configure in interface Configurable
Throws:
ConfigurationException - (configuration invalid or missing)

initialize

public void initialize()
                throws Exception
Deprecated. 
Initialize the component getting a database instance.

Specified by:
initialize in interface Initializable
Throws:
Exception - if an error occurs

setup

public void setup(SourceResolver resolver,
                  Map objectModel,
                  String src,
                  Parameters par)
           throws ProcessingException,
                  SAXException,
                  IOException
Deprecated. 
Description copied from class: AbstractGenerator
Set the SourceResolver, object model Map, the source and sitemap Parameters used to process the request.

Specified by:
setup in interface SitemapModelComponent
Overrides:
setup in class AbstractGenerator
Throws:
ProcessingException
SAXException
IOException

getValidity

public SourceValidity getValidity()
Deprecated. 
The component isn't cached (yet)

Specified by:
getValidity in interface CacheableProcessingComponent
Returns:
The generated validity object or null if the component is currently not cacheable.

getKey

public Serializable getKey()
Deprecated. 
The component isn't cached (yet)

Specified by:
getKey in interface CacheableProcessingComponent
Returns:
The generated key or null if the component is currently not cacheable.

generate

public void generate()
              throws IOException,
                     SAXException,
                     ProcessingException
Deprecated. 
Parse the requested URI, connect to the XML:DB database and fetch the requested resource.

Specified by:
generate in interface Generator
Throws:
ProcessingException - something unexpected happened with the DB
IOException
SAXException

collectionToSAX

public void collectionToSAX(org.xmldb.api.base.Collection collection)
                     throws SAXException
Deprecated. 
Output SAX events listing the collection.

Throws:
SAXException


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.