org.apache.turbine.util.velocity
Class VelocityActionEvent

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
Direct Known Subclasses:
VelocityAction

public abstract class VelocityActionEvent
extends ActionEvent

If you are using VelocitySite stuff, then your Action's should extend this class instead of extending the ActionEvent class. The difference between this class and the ActionEvent class is that this class will first attempt to execute one of your doMethod's with a constructor like this:

doEvent(RunData data, Context context)

It gets the context from the TemplateInfo.getTemplateContext() method. If it can't find a method like that, then it will try to execute the method without the Context in it.

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

Field Summary
 
Fields inherited from class org.apache.turbine.modules.ActionEvent
BUTTON, BUTTON_LENGTH, LENGTH, log, METHOD_NAME_LENGTH, METHOD_NAME_PREFIX
 
Constructor Summary
VelocityActionEvent()
           
 
Method Summary
abstract  void doPerform(RunData data)
          You need to implement this in your classes that extend this class.
 void executeEvents(RunData data, org.apache.velocity.context.Context context)
          This method should be called to execute the event based system.
protected  void perform(RunData data)
          This overrides the default Action.perform() to execute the doEvent() method.
 
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

VelocityActionEvent

public VelocityActionEvent()
Method Detail

doPerform

public abstract void doPerform(RunData data)
                        throws java.lang.Exception
You need to implement this in your classes that extend this class.

Specified by:
doPerform in class ActionEvent
Parameters:
data - A Turbine RunData object.
Throws:
java.lang.Exception - a generic exception.

perform

protected void perform(RunData data)
                throws java.lang.Exception
This overrides the default Action.perform() to execute the doEvent() method. If that fails, then it will execute the doPerform() method instead.

Overrides:
perform in class ActionEvent
Parameters:
data - A Turbine RunData object.
Throws:
java.lang.Exception - a generic exception.

executeEvents

public void executeEvents(RunData data,
                          org.apache.velocity.context.Context context)
                   throws java.lang.Exception
This method should be called to execute the event based system.

Parameters:
data - A Turbine RunData object.
context - Velocity context information.
Throws:
java.lang.Exception - a generic exception.


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