org.apache.cocoon.transformation
Class ReadDOMSessionTransformer

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.ReadDOMSessionTransformer
All Implemented Interfaces:
ContentHandler, LexicalHandler, LogEnabled, Poolable, Recyclable, SitemapModelComponent, Transformer, XMLConsumer, XMLConsumer, XMLPipe, XMLProducer

public class ReadDOMSessionTransformer
extends AbstractTransformer

Version:
CVS $Id: ReadDOMSessionTransformer.java 109638 2004-12-03 06:54:28Z crossley $
Author:
Sven Beauprez, Vadim Gritsenko
Cocoon.sitemap.component.documentation:
With this transformer, an object that is stored in the session, can be inserted in the SAX stream at a given position, using usual <xsp:expr> rules. Object can be DOM Node, XMLizable, or any other object supported by <xsp:expr>.
Cocoon.sitemap.component.logger:
sitemap.transformer.readDOMsession With this transformer, an object that is stored in the session, can be inserted in the SAX stream at a given position, using usual <xsp:expr> rules. Object can be DOM Node, XMLizable, or any other object supported by <xsp:expr>. Usage in sitemap:
    <map:transform type="read-session">
      <map:parameter name="attribute-name" value="companyInfo"/>
      <map:parameter name="trigger-element" value="company"/>
      <map:parameter name="position" value="after"/>
    </map:transform>
 
Where:
Cocoon.sitemap.component.name:
readDOMsession

Field Summary
static String ATTRIBUTE_NAME
           
static String POSITION
           
static String TRIGGER_ELEMENT
           
 
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
ReadDOMSessionTransformer()
           
 
Method Summary
 void endElement(String uri, String name, String raw)
          Receive notification of the end of an element.
 void setup(SourceResolver resolver, Map objectModel, String source, Parameters parameters)
          BEGIN SitemapComponent methods
 void startElement(String uri, String name, String raw, Attributes attributes)
          BEGIN SAX ContentHandler handlers
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe
characters, comment, endCDATA, endDocument, endDTD, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
recycle, 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, 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

ATTRIBUTE_NAME

public static final String ATTRIBUTE_NAME
See Also:
Constant Field Values

TRIGGER_ELEMENT

public static final String TRIGGER_ELEMENT
See Also:
Constant Field Values

POSITION

public static final String POSITION
See Also:
Constant Field Values
Constructor Detail

ReadDOMSessionTransformer

public ReadDOMSessionTransformer()
Method Detail

setup

public void setup(SourceResolver resolver,
                  Map objectModel,
                  String source,
                  Parameters parameters)
           throws ProcessingException,
                  SAXException,
                  IOException
BEGIN SitemapComponent methods

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 raw,
                         Attributes attributes)
                  throws SAXException
BEGIN SAX ContentHandler handlers

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.
raw - The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.
attributes - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
Throws:
SAXException

endElement

public void endElement(String uri,
                       String name,
                       String raw)
                throws SAXException
Description copied from class: AbstractXMLPipe
Receive notification of the end of an element.

Specified by:
endElement in interface ContentHandler
Overrides:
endElement 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.
raw - The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.
Throws:
SAXException


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