org.apache.turbine.modules.screens
Class VelocityScreen

java.lang.Object
  extended byorg.apache.turbine.modules.Assembler
      extended byorg.apache.turbine.modules.Screen
          extended byorg.apache.turbine.modules.screens.TemplateScreen
              extended byorg.apache.turbine.modules.screens.VelocityScreen
Direct Known Subclasses:
VelocityDirectScreen, VelocityErrorScreen, VelocitySecureScreen

public class VelocityScreen
extends TemplateScreen

Base Velocity Screen. The buildTemplate() assumes the template parameter has been set in the RunData object. This provides the ability to execute several templates from one Screen.

If you need more specific behavior in your application, extend this class and override the doBuildTemplate() method.

Version:
$Id: VelocityScreen.java 534527 2007-05-02 16:10:59Z tv $
Author:
Dave Bryson, Henning P. Schmiedehausen

Field Summary
 
Fields inherited from class org.apache.turbine.modules.screens.TemplateScreen
log
 
Constructor Summary
VelocityScreen()
           
 
Method Summary
 org.apache.ecs.ConcreteElement buildTemplate(RunData data)
          This builds the Velocity template.
protected  void doBuildTemplate(RunData data)
          Needs to be implemented to make TemplateScreen like us.
protected  void doBuildTemplate(RunData data, org.apache.velocity.context.Context context)
          Velocity Screens extending this class should overide this method to perform any particular business logic and add information to the context.
static org.apache.velocity.context.Context getContext(RunData data)
          Deprecated. Use TurbineVelocity.getContext(data)
 
Methods inherited from class org.apache.turbine.modules.screens.TemplateScreen
doBuild, doPostBuildTemplate, doRedirect, doRedirect, setTemplate
 
Methods inherited from class org.apache.turbine.modules.Screen
build, getLayout, prepareText, prepareTextMinimum, setLayout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VelocityScreen

public VelocityScreen()
Method Detail

doBuildTemplate

protected void doBuildTemplate(RunData data,
                               org.apache.velocity.context.Context context)
                        throws java.lang.Exception
Velocity Screens extending this class should overide this method to perform any particular business logic and add information to the context.

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

doBuildTemplate

protected void doBuildTemplate(RunData data)
                        throws java.lang.Exception
Needs to be implemented to make TemplateScreen like us. The actual method that you should override is the one with the context in the parameter list.

Specified by:
doBuildTemplate in class TemplateScreen
Parameters:
data - Turbine information.
Throws:
Exception, - a generic exception.
java.lang.Exception - A generic exception.

buildTemplate

public org.apache.ecs.ConcreteElement buildTemplate(RunData data)
                                             throws java.lang.Exception
This builds the Velocity template.

Specified by:
buildTemplate in class TemplateScreen
Parameters:
data - Turbine information.
Returns:
A ConcreteElement.
Throws:
Exception, - a generic exception.
java.lang.Exception - A generic exception.

getContext

public static org.apache.velocity.context.Context getContext(RunData data)
Deprecated. Use TurbineVelocity.getContext(data)

Return the Context needed by Velocity.

Parameters:
data - Turbine information.
Returns:
A Context.


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