org.apache.turbine.modules.actions
Class VelocityAction

java.lang.Object
  extended byorg.apache.turbine.modules.Assembler
      extended byorg.apache.turbine.modules.Action
          extended byorg.apache.turbine.modules.ActionEvent
              extended byorg.apache.turbine.util.velocity.VelocityActionEvent
                  extended byorg.apache.turbine.modules.actions.VelocityAction
Direct Known Subclasses:
VelocitySecureAction

public abstract class VelocityAction
extends VelocityActionEvent

This class provides a convenience methods for Velocity Actions to use. Since this class is abstract, it should only be extended and not used directly.

Version:
$Id: VelocityAction.java 534527 2007-05-02 16:10:59Z tv $
Author:
Jon S. Stevens, Jason van Zyl

Field Summary
 
Fields inherited from class org.apache.turbine.modules.ActionEvent
BUTTON, BUTTON_LENGTH, LENGTH, log, METHOD_NAME_LENGTH, METHOD_NAME_PREFIX
 
Constructor Summary
VelocityAction()
           
 
Method Summary
 void doPerform(RunData data)
          You SHOULD NOT override this method and implement it in your action.
abstract  void doPerform(RunData data, org.apache.velocity.context.Context context)
          You SHOULD override this method and implement it in your action.
protected  org.apache.velocity.context.Context getContext(RunData data)
          Return the Context needed by Velocity.
protected  void perform(RunData data)
          Sets up the context and then calls super.perform(); thus, subclasses don't have to worry about getting a context themselves!
 void setTemplate(RunData data, java.lang.String template)
          This method is used when you want to short circuit an Action and change the template that will be executed next.
 
Methods inherited from class org.apache.turbine.util.velocity.VelocityActionEvent
executeEvents
 
Methods inherited from class org.apache.turbine.modules.ActionEvent
considerKey, executeEvents, formatString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VelocityAction

public VelocityAction()
Method Detail

doPerform

public void doPerform(RunData data)
               throws java.lang.Exception
You SHOULD NOT override this method and implement it in your action.

Specified by:
doPerform in class VelocityActionEvent
Parameters:
data - Turbine information.
Throws:
java.lang.Exception - a generic exception.

doPerform

public abstract void doPerform(RunData data,
                               org.apache.velocity.context.Context context)
                        throws java.lang.Exception
You SHOULD override this method and implement it in your action.

Parameters:
data - Turbine information.
context - Context for web pages.
Throws:
java.lang.Exception - a generic exception.

perform

protected void perform(RunData data)
                throws java.lang.Exception
Sets up the context and then calls super.perform(); thus, subclasses don't have to worry about getting a context themselves!

Overrides:
perform in class VelocityActionEvent
Parameters:
data - Turbine information.
Throws:
java.lang.Exception - a generic exception.

setTemplate

public void setTemplate(RunData data,
                        java.lang.String template)
This method is used when you want to short circuit an Action and change the template that will be executed next.

Parameters:
data - Turbine information.
template - The template that will be executed next.

getContext

protected org.apache.velocity.context.Context getContext(RunData data)
Return the Context needed by Velocity.

Parameters:
data - Turbine information.
Returns:
Context, a context for web pages.


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.