fr.gouv.culture.sdx.pipeline
Class AbstractTransformation

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLoggable
      extended byorg.apache.cocoon.xml.AbstractXMLProducer
          extended byorg.apache.cocoon.xml.AbstractXMLPipe
              extended byfr.gouv.culture.sdx.pipeline.AbstractTransformation
All Implemented Interfaces:
org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.logger.Loggable, org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, Transformation, org.apache.cocoon.xml.XMLConsumer, org.apache.cocoon.xml.XMLPipe, org.apache.cocoon.xml.XMLProducer
Direct Known Subclasses:
DeleteResultsTransformation, ElementCountTransformation, FieldExpansionTransformation, GetDocumentsTransformation, GroupInformationInserter, TagFilter, XSLTTransformation

public abstract class AbstractTransformation
extends org.apache.cocoon.xml.AbstractXMLPipe
implements Transformation

An abstract transformation for basic operations.

This abstract class properly handle the logger and the parameters.


Field Summary
protected  java.lang.String id
          The id for this Transformation
protected  org.apache.avalon.framework.logger.Logger logger
          Avalon logger to write information.
protected  org.apache.avalon.framework.component.ComponentManager manager
          The component manager.
protected static java.lang.String PARAMETER_NAME_DISABLE
           
protected static java.lang.String PARAMETER_NAME_ENABLE
           
protected  org.apache.avalon.framework.parameters.Parameters parameters
          The parameters for this transformation provided by the pipeline via the setParameters() method.
protected  java.util.Hashtable props
          The Transformation's properties.
protected  org.apache.avalon.framework.parameters.Parameters transParameters
          The parameters for this transformation provided by the Parameteriable interface's parameterize method.
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, lexicalHandler, xmlConsumer
 
Fields inherited from interface fr.gouv.culture.sdx.pipeline.Transformation
ATTRIBUTE_ID, ATTRIBUTE_KEEP, ATTRIBUTE_SRC, ATTRIBUTE_TH, ATTRIBUTE_TYPE, CLASS_NAME_SUFFIX, ELEMENT_NAME_TRANSFORMATION, PACKAGE_QUALNAME
 
Constructor Summary
AbstractTransformation()
           
 
Method Summary
 void compose(org.apache.avalon.framework.component.ComponentManager manager)
          Sets the pipeline's ComponentManager.
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
          Loads base configuration common to all transformations.
 void enableLogging(org.apache.avalon.framework.logger.Logger logger)
          Set's the logger for the transformation.
 java.lang.String getId()
          Returns the Transformations id.
 org.apache.avalon.framework.parameters.Parameters getParameters()
          The parameters for this transformation.
protected  boolean isStepEnabled()
          Returns a boolean indicating whether this transformation is enabled first check the tranformations parameters secondly checking the parameters passed from the containing pipeline
 void recycle()
          Recycles the contentHandler, lexicalHandler, and xmlConsumer for the transformation
 void setParameters(org.apache.avalon.framework.parameters.Parameters p)
          Sets some parameters from a pipeline.
 void setProperties(java.util.Hashtable props)
          Sets Properties for the subclasses.
 boolean shouldKeepResult()
          Indicates wheter the results of this transfomation should be retained
protected  void verifyConfigurationParameters(org.apache.avalon.framework.parameters.Parameters params)
           
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe
characters, comment, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable
getLogger, setLogger, 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.xml.sax.ContentHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
 
Methods inherited from interface org.xml.sax.ext.LexicalHandler
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity
 
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
 

Field Detail

PARAMETER_NAME_DISABLE

protected static final java.lang.String PARAMETER_NAME_DISABLE
See Also:
Constant Field Values

PARAMETER_NAME_ENABLE

protected static final java.lang.String PARAMETER_NAME_ENABLE
See Also:
Constant Field Values

parameters

protected org.apache.avalon.framework.parameters.Parameters parameters
The parameters for this transformation provided by the pipeline via the setParameters() method.

See Also:
this.setParameters()

transParameters

protected org.apache.avalon.framework.parameters.Parameters transParameters
The parameters for this transformation provided by the Parameteriable interface's parameterize method.

See Also:
this.parameterize();

logger

protected org.apache.avalon.framework.logger.Logger logger
Avalon logger to write information.


id

protected java.lang.String id
The id for this Transformation


props

protected java.util.Hashtable props
The Transformation's properties.


manager

protected org.apache.avalon.framework.component.ComponentManager manager
The component manager.

Constructor Detail

AbstractTransformation

public AbstractTransformation()
Method Detail

setProperties

public void setProperties(java.util.Hashtable props)
Sets Properties for the subclasses.

Specified by:
setProperties in interface Transformation
Parameters:
props - A Properties object containing path information for an instance of an application.

enableLogging

public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
Set's the logger for the transformation.

Specified by:
enableLogging in interface org.apache.avalon.framework.logger.LogEnabled
Parameters:
logger - The logger to use for this transformation.

compose

public void compose(org.apache.avalon.framework.component.ComponentManager manager)
             throws org.apache.avalon.framework.component.ComponentException
Sets the pipeline's ComponentManager.

Specified by:
compose in interface org.apache.avalon.framework.component.Composable
Parameters:
manager - The ComponentManager to use.
Throws:
org.apache.avalon.framework.component.ComponentException

getParameters

public org.apache.avalon.framework.parameters.Parameters getParameters()
Description copied from interface: Transformation
The parameters for this transformation.

Specified by:
getParameters in interface Transformation

setParameters

public void setParameters(org.apache.avalon.framework.parameters.Parameters p)
Sets some parameters from a pipeline.

Specified by:
setParameters in interface Transformation
Parameters:
p - The parameters

recycle

public void recycle()
Recycles the contentHandler, lexicalHandler, and xmlConsumer for the transformation

Specified by:
recycle in interface Transformation

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Loads base configuration common to all transformations. Currently loads the id from the configuraion object. It will eventually load the optional "keep" parameter which is used to specify that the results of the transformation should be retained.

Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Parameters:
configuration - The configuration object
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

verifyConfigurationParameters

protected void verifyConfigurationParameters(org.apache.avalon.framework.parameters.Parameters params)

getId

public java.lang.String getId()
Description copied from interface: Transformation
Returns the Transformations id.

Specified by:
getId in interface Transformation

shouldKeepResult

public boolean shouldKeepResult()
Indicates wheter the results of this transfomation should be retained

Specified by:
shouldKeepResult in interface Transformation

isStepEnabled

protected boolean isStepEnabled()
Returns a boolean indicating whether this transformation is enabled first check the tranformations parameters secondly checking the parameters passed from the containing pipeline



Copyright © 2000-2004 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.