org.dspace.app.xmlui.cocoon
Class AspectGenerator

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.apache.cocoon.generation.ServiceableGenerator
                  extended by org.apache.cocoon.generation.FileGenerator
                      extended by org.dspace.app.xmlui.cocoon.AspectGenerator
All Implemented Interfaces:
org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.service.Serviceable, org.apache.cocoon.caching.CacheableProcessingComponent, org.apache.cocoon.generation.Generator, org.apache.cocoon.sitemap.SitemapModelComponent, org.apache.cocoon.xml.XMLProducer

public class AspectGenerator
extends org.apache.cocoon.generation.FileGenerator
implements org.apache.cocoon.caching.CacheableProcessingComponent

This Cocoon generator will generate an internal cocoon request for the next DRI Aspect in the chain. The first time this generator is called it will issue a request for Aspect 2, while it dose this it will store the aspect number in the request object. Every time after the initial use the aspect number is increased and used to generate the next Aspect url. This class extends the FileGenerator and simple intercepts the setup method ignoring anything passed in as the generators source and determines it's own source based upon the current Aspect state.

Author:
Scott Phillips

Field Summary
static String ASPECT_ID
          The name of the Aspect_ID attribute
static String PREFIX
          The URI Prefix of all aspect URIs
static String PROTOCOL
          The Protocol to use, in this case an internal cocoon request
 
Fields inherited from class org.apache.cocoon.generation.FileGenerator
inputSource, parser
 
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
AspectGenerator()
           
 
Method Summary
 void setup(org.apache.cocoon.environment.SourceResolver resolver, Map objectModel, String src, org.apache.avalon.framework.parameters.Parameters par)
          Setup the AspectGenerator.
 
Methods inherited from class org.apache.cocoon.generation.FileGenerator
generate, getKey, getValidity, recycle, setParser
 
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.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.cocoon.xml.XMLProducer
setConsumer
 

Field Detail

PREFIX

public static final String PREFIX
The URI Prefix of all aspect URIs

See Also:
Constant Field Values

PROTOCOL

public static final String PROTOCOL
The Protocol to use, in this case an internal cocoon request

See Also:
Constant Field Values

ASPECT_ID

public static final String ASPECT_ID
The name of the Aspect_ID attribute

See Also:
Constant Field Values
Constructor Detail

AspectGenerator

public AspectGenerator()
Method Detail

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 the AspectGenerator.

Specified by:
setup in interface org.apache.cocoon.sitemap.SitemapModelComponent
Overrides:
setup in class org.apache.cocoon.generation.FileGenerator
Throws:
org.apache.cocoon.ProcessingException
SAXException
IOException


Copyright © 2012 DuraSpace. All Rights Reserved.