org.apache.cocoon.components.modules.output
Class AbstractOutputModule

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.components.modules.output.AbstractOutputModule
All Implemented Interfaces:
Configurable, Disposable, org.apache.cocoon.components.modules.output.OutputModule

public abstract class AbstractOutputModule
extends org.apache.cocoon.util.AbstractLogEnabled
implements org.apache.cocoon.components.modules.output.OutputModule, Configurable, Disposable

AbstractOutputModule gives you the infrastructure for easily deploying more output modules.

In order to get at the logger, use getLogger().

Version:
$Id: AbstractOutputModule.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Field Summary
protected  org.apache.cocoon.util.HashMap settings
          Stores (global) configuration parameters as key / value pairs.
 
Fields inherited from interface org.apache.cocoon.components.modules.output.OutputModule
ROLE
 
Constructor Summary
AbstractOutputModule()
           
 
Method Summary
protected  boolean attributeExists(Map objectModel, String trans_place, String name)
          Returns a whether an transient attribute already exists.
 void configure(Configuration conf)
          Configures the module.
 void dispose()
          Dispose
protected  Map prepareCommit(Map objectModel, String trans_place)
          Returns a map containing all transient attributes and remove them i.e.
protected  void rollback(Map objectModel, String trans_place)
          Clears all uncommitted transient attributes.
protected  void transientSetAttribute(Map objectModel, String trans_place, String name, Object value)
          Utility method to store parameters in a map as request attribute until either rollback(Map, String) or prepareCommit(Map, String) is called.
 
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
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.components.modules.output.OutputModule
commit, rollback, setAttribute
 

Field Detail

settings

protected org.apache.cocoon.util.HashMap settings
Stores (global) configuration parameters as key / value pairs.

Constructor Detail

AbstractOutputModule

public AbstractOutputModule()
Method Detail

configure

public void configure(Configuration conf)
               throws ConfigurationException
Configures the module.

Takes all elements nested in component declaration and stores them as key-value pairs in settings. Nested configuration option are not catered for. This way global configuration options can be used.

For nested configurations override this function.

Specified by:
configure in interface Configurable
Throws:
ConfigurationException

dispose

public void dispose()
Dispose

Specified by:
dispose in interface Disposable

transientSetAttribute

protected void transientSetAttribute(Map objectModel,
                                     String trans_place,
                                     String name,
                                     Object value)
Utility method to store parameters in a map as request attribute until either rollback(Map, String) or prepareCommit(Map, String) is called.

Parameters:
objectModel - - the objectModel
trans_place - - request attribute name used for the transient data
name - - name of the attribute to set
value - - attribute value

rollback

protected void rollback(Map objectModel,
                        String trans_place)
Clears all uncommitted transient attributes.

Parameters:
objectModel - - the objectModel
trans_place - - request attribute name used for the transient data

attributeExists

protected boolean attributeExists(Map objectModel,
                                  String trans_place,
                                  String name)
Returns a whether an transient attribute already exists. transientSetAttribute(Map, String, String, Object) since the last call to rollback(Map, String) or prepareCommit(Map, String)

Parameters:
objectModel - - the objectModel
trans_place - - request attribute name used for the transient data

prepareCommit

protected Map prepareCommit(Map objectModel,
                            String trans_place)
Returns a map containing all transient attributes and remove them i.e. attributes set with transientSetAttribute(Map, String, String, Object) since the last call to rollback(Map, String) or prepareCommit(Map, String)

Parameters:
objectModel - - the objectModel
trans_place - - request attribute name used for the transient data


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.