org.dspace.app.xmlui.opensearch
Class StandardOpenSearchGenerator

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.AbstractOpenSearchGenerator
                  extended by org.dspace.app.xmlui.opensearch.StandardOpenSearchGenerator
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 StandardOpenSearchGenerator
extends AbstractOpenSearchGenerator
implements org.apache.cocoon.caching.CacheableProcessingComponent, org.apache.avalon.excalibur.pool.Recyclable

Generate an OpenSearch compliant search results document for DSpace, either scoped by a collection, a community or the whole repository. This class implements the generate() method in order to issue a search using the Discovery search service (Solr based search) Search params are parsed by AbstractOpenSearchGenerator class. I18N: Feed's are internationalized, meaning that they may contain references to messages contained in the global messages.xml file using cocoon's i18n schema. However the library used to build the feeds does not understand this schema to work around this limitation I created a little hack. It basically works like this, when text that needs to be localized is put into the feed it is always mangled such that a prefix is added to the messages's key. Thus if the key were "xmlui.feed.text" then the resulting text placed into the feed would be "I18N:xmlui.feed.text". After the library is finished and produced it's final result the output is traversed to find these occurrences and replace them with proper cocoon i18n elements.

Author:
Richard Rodgers, Nestor Oviedo

Field Summary
 
Fields inherited from class org.dspace.app.xmlui.opensearch.AbstractOpenSearchGenerator
DEFAULT_RPP, format, MAX_RPP, query, resultsDoc, rpp, scope, sort, sortOrder, start
 
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
StandardOpenSearchGenerator()
           
 
Method Summary
 void generate()
          Generate the search results document.
 
Methods inherited from class org.dspace.app.xmlui.opensearch.AbstractOpenSearchGenerator
getKey, getValidity, recycle, setup
 
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.caching.CacheableProcessingComponent
getKey, getValidity
 
Methods inherited from interface org.apache.avalon.excalibur.pool.Recyclable
recycle
 
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
 

Constructor Detail

StandardOpenSearchGenerator

public StandardOpenSearchGenerator()
Method Detail

generate

public void generate()
              throws IOException,
                     SAXException,
                     org.apache.cocoon.ProcessingException
Generate the search results document. Params have been parsed in superclass's setup() method

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


Copyright © 2012 DuraSpace. All Rights Reserved.