org.dspace.app.xmlui.opensearch
Class DescriptionOpenSearchGenerator

java.lang.Object
  extended by org.apache.cocoon.util.AbstractLogEnabled
      extended by org.apache.cocoon.xml.AbstractXMLProducer
          extended by org.apache.cocoon.generation.AbstractGenerator
              extended by org.dspace.app.xmlui.opensearch.DescriptionOpenSearchGenerator
All Implemented Interfaces:
org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, org.apache.cocoon.caching.CacheableProcessingComponent, org.apache.cocoon.generation.Generator, org.apache.cocoon.sitemap.SitemapModelComponent, org.apache.cocoon.xml.XMLProducer

public class DescriptionOpenSearchGenerator
extends org.apache.cocoon.generation.AbstractGenerator
implements org.apache.cocoon.caching.CacheableProcessingComponent, org.apache.avalon.excalibur.pool.Recyclable

Generate an OpenSearch-compliant description document for DSpace, based on dspace.cfg configuration properties

Author:
Richard Rodgers, Nestor Oviedo

Field Summary
protected  DSpaceObject scope
          optional search scope (community or collection instance) or null
 
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
DescriptionOpenSearchGenerator()
           
 
Method Summary
 void generate()
          Generate the OpenSearch description document
 Serializable getKey()
          Generate the unique caching key.
 org.apache.excalibur.source.SourceValidity getValidity()
          It's not expected that the OpenSearch's configuration to be changed very frecuently, so we assume this component is always valid (the cache should be cleared to update this component)
 void recycle()
          Recycle
 void setup(org.apache.cocoon.environment.SourceResolver resolver, Map objectModel, String src, org.apache.avalon.framework.parameters.Parameters par)
          Setup configuration for this request.
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
 
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
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

scope

protected DSpaceObject scope
optional search scope (community or collection instance) or null

Constructor Detail

DescriptionOpenSearchGenerator

public DescriptionOpenSearchGenerator()
Method Detail

getKey

public Serializable getKey()
Generate the unique caching key. It includes the class name to ensure uniqueness

Specified by:
getKey in interface org.apache.cocoon.caching.CacheableProcessingComponent

getValidity

public org.apache.excalibur.source.SourceValidity getValidity()
It's not expected that the OpenSearch's configuration to be changed very frecuently, so we assume this component is always valid (the cache should be cleared to update this component)

Specified by:
getValidity in interface org.apache.cocoon.caching.CacheableProcessingComponent

setup

public void setup(org.apache.cocoon.environment.SourceResolver resolver,
                  Map objectModel,
                  String src,
                  org.apache.avalon.framework.parameters.Parameters par)
           throws org.apache.cocoon.ProcessingException,
                  SAXException,
                  IOException
Setup configuration for this request. Parsing of the scope parameter

Specified by:
setup in interface org.apache.cocoon.sitemap.SitemapModelComponent
Overrides:
setup in class org.apache.cocoon.generation.AbstractGenerator
Throws:
org.apache.cocoon.ProcessingException - if the scope param cannot be resolved to a valid Community or Collection
SAXException
IOException

generate

public void generate()
              throws IOException,
                     SAXException,
                     org.apache.cocoon.ProcessingException
Generate the OpenSearch description document

Specified by:
generate in interface org.apache.cocoon.generation.Generator
Throws:
IOException
SAXException
org.apache.cocoon.ProcessingException

recycle

public void recycle()
Recycle

Specified by:
recycle in interface org.apache.avalon.excalibur.pool.Recyclable
Overrides:
recycle in class org.apache.cocoon.generation.AbstractGenerator


Copyright © 2012 DuraSpace. All Rights Reserved.