org.apache.cocoon.webapps.session.transformation
Class SessionPreTransformer

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.AbstractSAXTransformer
                      extended byorg.apache.cocoon.webapps.session.transformation.AbstractSessionTransformer
                          extended byorg.apache.cocoon.webapps.session.transformation.SessionPreTransformer
All Implemented Interfaces:
Configurable, ContentHandler, Disposable, LexicalHandler, LogEnabled, Poolable, Recyclable, Serviceable, SitemapModelComponent, Transformer, XMLConsumer, XMLConsumer, XMLPipe, XMLProducer
Direct Known Subclasses:
SessionPostTransformer

public class SessionPreTransformer
extends AbstractSessionTransformer

This is the session pre transformer. It does all the getting and creation commands. This transformer should be the first in the pipeline.

Version:
CVS $Id: SessionPreTransformer.java 47047 2004-09-22 12:27:27Z vgritsenko $
Author:
Carsten Ziegeler

Field Summary
static String CONTEXT_URL_ELEMENT
          The contexturl element.
static String CREATECONTEXT_ELEMENT
           
static String CREATECONTEXT_LOAD_ATTRIBUTE
           
static String CREATECONTEXT_NAME_ATTRIBUTE
           
static String CREATECONTEXT_SAVE_ATTRIBUTE
           
static String GETXML_CONTEXT_ATTRIBUTE
           
static String GETXML_ELEMENT
           
static String GETXML_PATH_ATTRIBUTE
           
static String LOADCONTEXT_CONTEXT_ATTRIBUTE
           
static String LOADCONTEXT_ELEMENT
           
static String LOADCONTEXT_PATH_ATTRIBUTE
           
protected  int processingGetXML
          Are we inside a getxml?
 
Fields inherited from class org.apache.cocoon.transformation.AbstractSAXTransformer
context, defaultNamespaceURI, EMPTY_ATTRIBUTES, ignoreEmptyCharacters, ignoreEventsCount, ignoreHooksCount, ignoreWhitespaces, manager, namespaceURI, objectModel, parameters, recorderStack, request, resolver, response, source, stack
 
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
SessionPreTransformer()
          Constructor.
 
Method Summary
 void endElement(String uri, String name, String raw)
          Process the SAX event.
 void endTransformingElement(String uri, String name, String raw)
          Start processing elements of our namespace.
 void setup(SourceResolver resolver, Map objectModel, String src, Parameters par)
          Setup the next round.
 void startElement(String uri, String name, String raw, Attributes attr)
          Process the SAX event.
 void startTransformingElement(String uri, String name, String raw, Attributes attr)
          This is the real implementation of the startElement event for the transformer The event is checked for a valid element and the corresponding command is executed.
 
Methods inherited from class org.apache.cocoon.webapps.session.transformation.AbstractSessionTransformer
getContextManager, getFormManager, getSession, getSessionManager, recycle
 
Methods inherited from class org.apache.cocoon.transformation.AbstractSAXTransformer
addRecorder, characters, comment, configure, dispose, endCDATA, endDocument, endDTD, endEntity, endParametersRecording, endParametersRecording, endPrefixMapping, endRecording, endSAXRecording, endSerializedXMLRecording, endTextRecording, findPrefixMapping, getMutableAttributes, ignorableWhitespace, processingInstruction, removeRecorder, sendEndElementEvent, sendEndElementEventNS, sendEndPrefixMapping, sendEvents, sendParametersEvents, sendStartElementEvent, sendStartElementEvent, sendStartElementEventNS, sendStartElementEventNS, sendStartPrefixMapping, sendTextEvent, service, setDocumentLocator, setupTransforming, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startParametersRecording, startPrefixMapping, startRecording, startSAXRecording, startSerializedXMLRecording, startTextRecording
 
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.apache.cocoon.xml.XMLProducer
setConsumer
 

Field Detail

CREATECONTEXT_ELEMENT

public static final String CREATECONTEXT_ELEMENT
See Also:
Constant Field Values

CREATECONTEXT_NAME_ATTRIBUTE

public static final String CREATECONTEXT_NAME_ATTRIBUTE
See Also:
Constant Field Values

CREATECONTEXT_SAVE_ATTRIBUTE

public static final String CREATECONTEXT_SAVE_ATTRIBUTE
See Also:
Constant Field Values

CREATECONTEXT_LOAD_ATTRIBUTE

public static final String CREATECONTEXT_LOAD_ATTRIBUTE
See Also:
Constant Field Values

GETXML_ELEMENT

public static final String GETXML_ELEMENT
See Also:
Constant Field Values

GETXML_CONTEXT_ATTRIBUTE

public static final String GETXML_CONTEXT_ATTRIBUTE
See Also:
Constant Field Values

GETXML_PATH_ATTRIBUTE

public static final String GETXML_PATH_ATTRIBUTE
See Also:
Constant Field Values

LOADCONTEXT_ELEMENT

public static final String LOADCONTEXT_ELEMENT
See Also:
Constant Field Values

LOADCONTEXT_CONTEXT_ATTRIBUTE

public static final String LOADCONTEXT_CONTEXT_ATTRIBUTE
See Also:
Constant Field Values

LOADCONTEXT_PATH_ATTRIBUTE

public static final String LOADCONTEXT_PATH_ATTRIBUTE
See Also:
Constant Field Values

CONTEXT_URL_ELEMENT

public static final String CONTEXT_URL_ELEMENT
The contexturl element.

See Also:
Constant Field Values

processingGetXML

protected int processingGetXML
Are we inside a getxml?

Constructor Detail

SessionPreTransformer

public SessionPreTransformer()
Constructor. Set the namespace.

Method Detail

setup

public void setup(SourceResolver resolver,
                  Map objectModel,
                  String src,
                  Parameters par)
           throws ProcessingException,
                  SAXException,
                  IOException
Setup the next round. The instance variables are initialised.

Specified by:
setup in interface SitemapModelComponent
Overrides:
setup in class AbstractSAXTransformer
Parameters:
resolver - The current SourceResolver
objectModel - The objectModel of the environment.
src - The value of the src attribute in the sitemap.
par - The parameters from the sitemap.
Throws:
ProcessingException
SAXException
IOException

endElement

public void endElement(String uri,
                       String name,
                       String raw)
                throws SAXException
Process the SAX event. The namespace of the event is checked. If it is the defined namespace for this transformer the endTransformingElement() hook is called.

Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class AbstractSAXTransformer
Throws:
SAXException
See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

startElement

public void startElement(String uri,
                         String name,
                         String raw,
                         Attributes attr)
                  throws SAXException
Process the SAX event. The namespace of the event is checked. If it is the defined namespace for this transformer the endTransformingElement() hook is called.

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class AbstractSAXTransformer
Throws:
SAXException
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

startTransformingElement

public void startTransformingElement(String uri,
                                     String name,
                                     String raw,
                                     Attributes attr)
                              throws ProcessingException,
                                     IOException,
                                     SAXException
This is the real implementation of the startElement event for the transformer The event is checked for a valid element and the corresponding command is executed.

Overrides:
startTransformingElement in class AbstractSAXTransformer
Parameters:
uri - The namespace of the element.
name - The local name of the element.
raw - The qualified name of the element.
attr - The attributes of the element.
Throws:
ProcessingException
IOException
SAXException

endTransformingElement

public void endTransformingElement(String uri,
                                   String name,
                                   String raw)
                            throws ProcessingException,
                                   IOException,
                                   SAXException
Description copied from class: AbstractSAXTransformer
Start processing elements of our namespace. This hook is invoked for each sax event with our namespace.

Overrides:
endTransformingElement in class AbstractSAXTransformer
Parameters:
uri - The namespace of the element.
name - The local name of the element.
raw - The qualified name of the element.
Throws:
ProcessingException
IOException
SAXException


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