org.apache.cocoon.portal.generation
Class AbstractCopletGenerator

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.xml.AbstractXMLProducer
          extended by org.apache.cocoon.generation.AbstractGenerator
              extended by org.apache.cocoon.generation.ServiceableGenerator
                  extended by org.apache.cocoon.portal.generation.AbstractCopletGenerator
All Implemented Interfaces:
Poolable, Recyclable, Disposable, Component, LogEnabled, Serviceable, Generator, SitemapModelComponent, XMLProducer
Direct Known Subclasses:
BasketContentGenerator

public abstract class AbstractCopletGenerator
extends ServiceableGenerator

Abstract generator implementation that provides a method getCopletInstanceData(). There are two possibilities how the generator obtains the information required for getting the coplet instance data:

1) If it is used within a coplet pipeline and this pipeline is called using the "cocoon:" protocol, all required information are passed automatically.
2) Otherwise the portal name and the coplet id must be passed to the generator as paremeters in the following way:

<map:generator type="coplet">
        <map:parameter name="portalName" type="exampleportal"/>
        <map:parameter name="copletId" type="examplecoplet"/>
 </map:generator>

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

Field Summary
static String COPLET_ID_PARAM
          Parameter name.
static String PORTAL_NAME_PARAM
          Parameter name.
protected  PortalService portalService
          The portal service.
 
Fields inherited from class org.apache.cocoon.generation.ServiceableGenerator
manager
 
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator
objectModel, parameters, resolver, source
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.generation.Generator
ROLE
 
Constructor Summary
AbstractCopletGenerator()
           
 
Method Summary
 void dispose()
          Release all resources.
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()
          Get the portal service
 void service(ServiceManager manager)
          Set the current ServiceManager instance used by this Serviceable.
 
Methods inherited from class org.apache.cocoon.generation.AbstractGenerator
recycle, setup
 
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.generation.Generator
generate
 
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
 

Field Detail

COPLET_ID_PARAM

public static final String COPLET_ID_PARAM
Parameter name.

See Also:
Constant Field Values

PORTAL_NAME_PARAM

public static final String PORTAL_NAME_PARAM
Parameter name.

See Also:
Constant Field Values

portalService

protected PortalService portalService
The portal service. @since 2.1.8

Constructor Detail

AbstractCopletGenerator

public AbstractCopletGenerator()
Method Detail

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()
Get the portal service


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

dispose

public void dispose()
Description copied from class: ServiceableGenerator
Release all resources.

Specified by:
dispose in interface Disposable
Overrides:
dispose in class ServiceableGenerator
See Also:
Disposable.dispose()

service

public void service(ServiceManager manager)
             throws ServiceException
Description copied from class: ServiceableGenerator
Set the current ServiceManager instance used by this Serviceable.

Specified by:
service in interface Serviceable
Overrides:
service in class ServiceableGenerator
Throws:
ServiceException
See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)


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