org.apache.cocoon.transformation
Class AugmentTransformer

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.cocoon.xml.AbstractXMLProducer
          extended byorg.apache.cocoon.xml.AbstractXMLPipe
              extended byorg.apache.cocoon.transformation.AbstractTransformer
                  extended byorg.apache.cocoon.transformation.AugmentTransformer
All Implemented Interfaces:
ContentHandler, LexicalHandler, LogEnabled, Poolable, Recyclable, SitemapModelComponent, Transformer, XMLConsumer, XMLConsumer, XMLPipe, XMLProducer

public class AugmentTransformer
extends AbstractTransformer

Since:
October 10, 2001
Version:
CVS $Id: AugmentTransformer.java 30941 2004-07-29 19:56:58Z vgritsenko $
Author:
Ovidiu Predescu
Cocoon.sitemap.component.documentation:
Augments all href attributes with the full path to the request. You can optionally specify the mount parameter.
Cocoon.sitemap.component.logger:
sitemap.transformer.augment
Cocoon.sitemap.component.name:
augment

Field Summary
protected  String baseURI
           
protected  Map objectModel
           
protected  Request request
           
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.transformation.Transformer
ROLE
 
Constructor Summary
AugmentTransformer()
           
 
Method Summary
 void recycle()
          Recyclable
 void setup(SourceResolver resolver, Map objectModel, String source, Parameters parameters)
          The Sitemap will call the setup() method to prepare the component for use.
 void startElement(String uri, String name, String qname, Attributes attrs)
          Receive notification of the beginning of an element.
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe
characters, comment, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping
 
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.xml.sax.ContentHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
 
Methods inherited from interface org.xml.sax.ext.LexicalHandler
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity
 
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
 

Field Detail

objectModel

protected Map objectModel

request

protected Request request

baseURI

protected String baseURI
Constructor Detail

AugmentTransformer

public AugmentTransformer()
Method Detail

setup

public void setup(SourceResolver resolver,
                  Map objectModel,
                  String source,
                  Parameters parameters)
           throws ProcessingException,
                  SAXException,
                  IOException
Description copied from interface: SitemapModelComponent
The Sitemap will call the setup() method to prepare the component for use. This is where you start the process of getting your information ready to generate your results. See ObjectModelHelper for help with the objectModel.

Parameters:
resolver - The SourceResolver to find resources within your context.
objectModel - A java.util.Map that contains the request and session information.
source - The value of the "src" attribute in the sitemap.
parameters - The sitemap parameters passed into your component.
Throws:
ProcessingException - if there is any other unexpected problem.
IOException - if there is a problem reading files.
SAXException - if there is a problem reading a SAX stream.

startElement

public void startElement(String uri,
                         String name,
                         String qname,
                         Attributes attrs)
                  throws SAXException
Description copied from class: AbstractXMLPipe
Receive notification of the beginning of an element.

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class AbstractXMLPipe
Parameters:
uri - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
name - The local name (without prefix), or the empty string if Namespace processing is not being performed.
qname - The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.
attrs - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
Throws:
SAXException

recycle

public void recycle()
Recyclable

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


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.