This project has retired. For details please refer to its
Attic page .
AbstractCopletTransformer (Cocoon API 2.1.12-dev [March 20 2012])
org.apache.cocoon.portal.transformation
Class AbstractCopletTransformer
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.xml.AbstractXMLProducer
org.apache.cocoon.xml.AbstractXMLPipe
org.apache.cocoon.transformation.AbstractTransformer
org.apache.cocoon.transformation.AbstractSAXTransformer
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"/>
</map:transform>
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
.
Version:
CVS $Id: AbstractCopletTransformer.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Carsten Ziegeler
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 interface org.apache.cocoon.transformation.Transformer
ROLE
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 java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
COPLET_ID_PARAM
public static final String COPLET_ID_PARAM
Parameter name for the coplet id.
See Also: Constant Field Values
portalService
protected PortalService portalService
The portal service. @since 2.1.8
AbstractCopletTransformer
public AbstractCopletTransformer ()
getCopletInstanceData
protected CopletInstanceData getCopletInstanceData ()
throws SAXException
Try to get the coplet instance data belonging to the current request
Returns: The coplet instance data
Throws:
SAXException
- If an errors occurs or the instance data is not available
getPortalService
protected PortalService getPortalService ()
throws SAXException
Deprecated. Use directly the instance variable.
Get the portal service.
Throws:
SAXException
getCopletInstanceData
protected CopletInstanceData getCopletInstanceData (String copletId)
throws SAXException
Try to get the coplet instance data with the given id
Parameters: copletId
- The id of the coplet instance or null if this transformer
is used inside a coplet pipeline
Returns: The coplet instance data or null
Throws:
SAXException
- If an error occurs
service
public void service (ServiceManager manager)
throws ServiceException
Specified by: service
in interface Serviceable
Overrides: service
in class AbstractSAXTransformer
Throws:
ServiceException
See Also: Serviceable.service(org.apache.avalon.framework.service.ServiceManager)
dispose
public void dispose ()
Specified by: dispose
in interface Disposable
Overrides: dispose
in class AbstractSAXTransformer
See Also: Disposable.dispose()
Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.