org.apache.cocoon.acting
Class ServerPagesAction

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.cocoon.acting.AbstractAction
              |
              +--org.apache.cocoon.acting.AbstractConfigurableAction
                    |
                    +--org.apache.cocoon.acting.ConfigurableComposerAction
                          |
                          +--org.apache.cocoon.acting.ServerPagesAction
All Implemented Interfaces:
Action, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.logger.Loggable, org.apache.avalon.excalibur.logger.LogKitManageable, org.apache.avalon.framework.thread.ThreadSafe

public class ServerPagesAction
extends ConfigurableComposerAction
implements org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.thread.ThreadSafe, org.apache.avalon.excalibur.logger.LogKitManageable

Allows actions to be written in XSP. This allows to use XSP to produce XML fragments that are later reused in generators.
This action works in concert with the "action" logicheet, that offers actions-related services such as redirect or result map access, and the "capture" logicsheet that allows to capture parts of XSP-generated XML either as an XMLizable containing serialized SAX events, or as a DOM Node.
As for generators, the XSP file name is set using the "src" attribute.
This action accepts a single parameter, "output-attribute", which names the request attribute where the XSP-generated document will be stored (as an XMLizable). If this parameter is omitted, the XSP result is discarded (often the case when inner fragments are captured with the "capture" logicsheet").
When "output-attribute" is set, the action status defaults to "success", meaning child sitemap statements are executed. This allows to use an existing XSP without modification with this action.
When "output-attribute" isn't set, the action status defaults to "failure". The XSP must then use the "action" logicsheet to set its status.
Example :

   <action type="xsp-action" src="myAction.xsp">
     <map:param name="output-attribute" value="xsp-action-result"/>
     ...
   </action>
 

Version:
CVS $Id: ServerPagesAction.java,v 1.6.2.1 2002/06/07 09:34:23 cziegeler Exp $
Author:
Sylvain Wallez

Field Summary
static java.lang.String ACTION_RESULT_OBJECT
           
static java.lang.String ACTION_SUCCESS_OBJECT
           
static java.lang.String REDIRECTOR_OBJECT
           
 
Fields inherited from class org.apache.cocoon.acting.ConfigurableComposerAction
manager
 
Fields inherited from class org.apache.cocoon.acting.AbstractConfigurableAction
settings
 
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
 
Fields inherited from interface org.apache.cocoon.acting.Action
ROLE
 
Constructor Summary
ServerPagesAction()
           
 
Method Summary
 java.util.Map act(Redirector redirector, SourceResolver resolver, java.util.Map objectModel, java.lang.String source, org.apache.avalon.framework.parameters.Parameters parameters)
          Controls the processing against some values of the Dictionary objectModel and returns a Map object with values used in subsequent sitemap substitution patterns.
 void configure(org.apache.avalon.framework.configuration.Configuration conf)
          Configures the Action.
 void dispose()
           
 void setLogKitManager(org.apache.avalon.excalibur.logger.LogKitManager logKitManager)
           
 
Methods inherited from class org.apache.cocoon.acting.ConfigurableComposerAction
compose
 
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
 

Field Detail

REDIRECTOR_OBJECT

public static final java.lang.String REDIRECTOR_OBJECT

ACTION_RESULT_OBJECT

public static final java.lang.String ACTION_RESULT_OBJECT

ACTION_SUCCESS_OBJECT

public static final java.lang.String ACTION_SUCCESS_OBJECT
Constructor Detail

ServerPagesAction

public ServerPagesAction()
Method Detail

configure

public void configure(org.apache.avalon.framework.configuration.Configuration conf)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Description copied from class: AbstractConfigurableAction
Configures the Action. Takes the children from the Configuration and stores them them as key (configuration name) and value (configuration value) in settings.
This automates parsing of flat string-only configurations. For nested configurations, override this function in your action.
Overrides:
configure in class AbstractConfigurableAction

setLogKitManager

public void setLogKitManager(org.apache.avalon.excalibur.logger.LogKitManager logKitManager)
Specified by:
setLogKitManager in interface org.apache.avalon.excalibur.logger.LogKitManageable

dispose

public void dispose()
Specified by:
dispose in interface org.apache.avalon.framework.activity.Disposable

act

public java.util.Map act(Redirector redirector,
                         SourceResolver resolver,
                         java.util.Map objectModel,
                         java.lang.String source,
                         org.apache.avalon.framework.parameters.Parameters parameters)
                  throws java.lang.Exception
Description copied from interface: Action
Controls the processing against some values of the Dictionary objectModel and returns a Map object with values used in subsequent sitemap substitution patterns. NOTE: This interface is designed so that implentations can be ThreadSafe. When an action is ThreadSafe, only one instance serves all requests : this reduces memory usage and avoids pooling.
Following copied from interface: org.apache.cocoon.acting.Action
Parameters:
resolver - The SourceResolver in charge
objectModel - The Map with object of the calling environment which can be used to select values this controller may need (ie Request, Response).
source - A source String to the Action
parameters - The Parameters for this invocation
Returns:
Map The returned Map object with sitemap substitution values which can be used in subsequent elements attributes like src= using a xpath like expression: src="mydir/{myval}/foo" If the return value is null the processing inside the element of the sitemap will be skipped.
Throws:
java.lang.Exception - Indicates something is totally wrong


Copyright � 1999-2002 Apache Software Foundation. All Rights Reserved.