org.apache.cocoon.portal.transformation
Class CopletTransformer

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.xml.AbstractXMLProducer
          extended by org.apache.cocoon.xml.AbstractXMLPipe
              extended by org.apache.cocoon.transformation.AbstractTransformer
                  extended by org.apache.cocoon.transformation.AbstractSAXTransformer
                      extended by org.apache.cocoon.portal.transformation.AbstractCopletTransformer
                          extended by org.apache.cocoon.portal.transformation.CopletTransformer
All Implemented Interfaces:
Poolable, Recyclable, Disposable, Component, Configurable, LogEnabled, Serviceable, SitemapModelComponent, Transformer, XMLPipe, XMLProducer, XMLConsumer, ContentHandler, LexicalHandler

public class CopletTransformer
extends AbstractCopletTransformer

This transformer offers various functions for developing pipeline based coplets. Includes coplet instance data by using JXPath expressions. The transformer searches for tags <coplet:coplet xmlns:coplet="http://apache.org/cocoon/portal/coplet/1.0">. They must have an attribute "select" that contains a valid JXPath expression applying to the coplet instance data.

Example:

<maxpageable xmlns:coplet="http://apache.org/cocoon/portal/coplet/1.0">
        <coplet:coplet select="copletData.maxpageable"/>
 </maxpageable>
The transformer will insert the boolean value specifying whether the coplet is maxpageable or not.
Please see also the documentation of superclass AbstractCopletTransformer for how the coplet instance data are acquired.

Version:
CVS $Id: CopletTransformer.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Carsten Ziegeler, Björn Lütkemeier

Field Summary
protected  List collectedEvents
          The collected list of events
protected  XMLizable content
          The content of the links
static String CONTENT_ELEM
          The content for the links element
static String COPLET_ELEM
          The XML element name to listen for.
protected  boolean insideLinks
          Are we inside a links element?
static String LINK_ELEM
          The XML element name to listen for.
static String LINKS_ELEM
          Create a link containing several events
static String NAMESPACE_URI
          The namespace URI to listen for.
static String PARAMETER_ELEM
          Create a link containing several events
static String SELECT_ATTR
          The attribute containing the JXPath expression.
 
Fields inherited from class org.apache.cocoon.portal.transformation.AbstractCopletTransformer
COPLET_ID_PARAM, portalService
 
Fields inherited from class org.apache.cocoon.transformation.AbstractSAXTransformer
context, defaultNamespaceURI, EMPTY_ATTRIBUTES, emptyAttributes, 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
CopletTransformer()
          Creates new CopletTransformer.
 
Method Summary
 void endTransformingElement(String uri, String name, String raw)
          Overridden from superclass.
protected  void output(String uri, String format, AttributesImpl newAttrs)
          Output the link
 void setupTransforming()
          Setup the transformation of an xml document.
 void startTransformingElement(String uri, String name, String raw, Attributes attr)
          Overridden from superclass.
 
Methods inherited from class org.apache.cocoon.portal.transformation.AbstractCopletTransformer
dispose, getCopletInstanceData, getCopletInstanceData, getPortalService, service
 
Methods inherited from class org.apache.cocoon.transformation.AbstractSAXTransformer
addRecorder, characters, comment, configure, endCDATA, endDocument, endDTD, endElement, endEntity, endParametersRecording, endParametersRecording, endPrefixMapping, endRecording, endSAXRecording, endSerializedXMLRecording, endTextRecording, findPrefixMapping, getMutableAttributes, ignorableWhitespace, processingInstruction, recycle, removeRecorder, sendEndElementEvent, sendEndElementEventNS, sendEndPrefixMapping, sendEvents, sendParametersEvents, sendStartElementEvent, sendStartElementEvent, sendStartElementEventNS, sendStartElementEventNS, sendStartPrefixMapping, sendTextEvent, setDocumentLocator, setup, skippedEntity, startCDATA, startDocument, startDTD, startElement, 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

NAMESPACE_URI

public static final String NAMESPACE_URI
The namespace URI to listen for.

See Also:
Constant Field Values

COPLET_ELEM

public static final String COPLET_ELEM
The XML element name to listen for.

See Also:
Constant Field Values

SELECT_ATTR

public static final String SELECT_ATTR
The attribute containing the JXPath expression.

See Also:
Constant Field Values

LINK_ELEM

public static final String LINK_ELEM
The XML element name to listen for.

See Also:
Constant Field Values

LINKS_ELEM

public static final String LINKS_ELEM
Create a link containing several events

See Also:
Constant Field Values

PARAMETER_ELEM

public static final String PARAMETER_ELEM
Create a link containing several events

See Also:
Constant Field Values

CONTENT_ELEM

public static final String CONTENT_ELEM
The content for the links element

See Also:
Constant Field Values

insideLinks

protected boolean insideLinks
Are we inside a links element?


collectedEvents

protected List collectedEvents
The collected list of events


content

protected XMLizable content
The content of the links

Constructor Detail

CopletTransformer

public CopletTransformer()
Creates new CopletTransformer.

Method Detail

setupTransforming

public void setupTransforming()
                       throws IOException,
                              ProcessingException,
                              SAXException
Description copied from class: AbstractSAXTransformer
Setup the transformation of an xml document. This method is called just before the transformation (sending of sax events) starts. It should be used to initialize setup parameter depending on the object modell.

Overrides:
setupTransforming in class AbstractSAXTransformer
Throws:
IOException
ProcessingException
SAXException

startTransformingElement

public void startTransformingElement(String uri,
                                     String name,
                                     String raw,
                                     Attributes attr)
                              throws ProcessingException,
                                     IOException,
                                     SAXException
Overridden from superclass.

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
Overridden from superclass.

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

output

protected void output(String uri,
                      String format,
                      AttributesImpl newAttrs)
               throws SAXException
Output the link

Throws:
SAXException


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.