Class AbstractCopletTransformer

  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
All Implemented Interfaces:
Poolable, Recyclable, Disposable, Component, Configurable, LogEnabled, Serviceable, SitemapModelComponent, Transformer, XMLPipe, XMLProducer, XMLConsumer, ContentHandler, LexicalHandler
Direct Known Subclasses:
CopletTransformer, EventLinkTransformer, HTMLEventLinkTransformer, NewEventLinkTransformer

public abstract class AbstractCopletTransformer
extends AbstractSAXTransformer

Abstract transformer implementation that provides some useful methods and functionality. The portal service is stored in the instance variable portalService and can be used. There are some methods to fetch a coplet instance data. getCopletInstanceData() tries to get the instance associated with the current request and getCopletInstanceData(String) fetches an instance with a given id. If you want to get the coplet instance data associated with the current request, there are three possibilities how the transformer obtains the information required for getting the coplet instance data - or more precisly its id:

1) If it is used within a coplet pipeline and this pipeline is called using the "cocoon:" protocol, all required information is passed automatically.
2) The id can be passed to the transformer as sitemap paremeters in the following way:

<map:transform type="coplet">
            <map:parameter name="copletId" type="examplecoplet"/>
3) Any component can set the id as a string in the object model of the current request. This is the name of the key to be used: Constants.COPLET_ID_KEY.

CVS $Id: AbstractCopletTransformer.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Carsten Ziegeler

Field Summary
static String COPLET_ID_PARAM
          Parameter name for the coplet id.
protected  PortalService portalService
          The portal service.
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
Constructor Summary
Method Summary
 void dispose()
protected  CopletInstanceData getCopletInstanceData()
          Try to get the coplet instance data belonging to the current request
protected  CopletInstanceData getCopletInstanceData(String copletId)
          Try to get the coplet instance data with the given id
protected  PortalService getPortalService()
          Deprecated. Use directly the instance variable.
 void service(ServiceManager manager)
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, endTransformingElement, findPrefixMapping, getMutableAttributes, ignorableWhitespace, processingInstruction, recycle, removeRecorder, sendEndElementEvent, sendEndElementEventNS, sendEndPrefixMapping, sendEvents, sendParametersEvents, sendStartElementEvent, sendStartElementEvent, sendStartElementEventNS, sendStartElementEventNS, sendStartPrefixMapping, sendTextEvent, setDocumentLocator, setup, setupTransforming, skippedEntity, startCDATA, startDocument, startDTD, startElement, startEntity, startParametersRecording, startPrefixMapping, startRecording, startSAXRecording, startSerializedXMLRecording, startTextRecording, startTransformingElement
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

Field Detail


public static final String COPLET_ID_PARAM
Parameter name for the coplet id.

See Also:
Constant Field Values


protected PortalService portalService
The portal service. @since 2.1.8

Constructor Detail


public AbstractCopletTransformer()
Method Detail


protected CopletInstanceData getCopletInstanceData()
                                            throws SAXException
Try to get the coplet instance data belonging to the current request

The coplet instance data
SAXException - If an errors occurs or the instance data is not available


protected PortalService getPortalService()
                                  throws SAXException
Deprecated. Use directly the instance variable.

Get the portal service.



protected CopletInstanceData getCopletInstanceData(String copletId)
                                            throws SAXException
Try to get the coplet instance data with the given id

copletId - The id of the coplet instance or null if this transformer is used inside a coplet pipeline
The coplet instance data or null
SAXException - If an error occurs


public void service(ServiceManager manager)
             throws ServiceException
Specified by:
service in interface Serviceable
service in class AbstractSAXTransformer
See Also:


public void dispose()
Specified by:
dispose in interface Disposable
dispose in class AbstractSAXTransformer
See Also:

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