Class VelocityScreen
- java.lang.Object
-
- org.apache.turbine.modules.screens.TemplateScreen
-
- org.apache.turbine.modules.screens.VelocityScreen
-
- Direct Known Subclasses:
LegacyVelocityScreen
,VelocityCachedScreen
,VelocityDirectScreen
,VelocityErrorScreen
,VelocitySecureScreen
public class VelocityScreen extends TemplateScreen
Base Velocity Screen. The buildTemplate() assumes the template parameter has been set in the PipelineData 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$
- Author:
- Dave Bryson, Henning P. Schmiedehausen, Peter Courcoux
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
prefix
The prefix for lookup up screen pagesprotected String
templateError
protected TemplateService
templateService
Injected service instanceprotected VelocityService
velocity
Injected service instance-
Fields inherited from class org.apache.turbine.modules.screens.TemplateScreen
log
-
Fields inherited from interface org.apache.turbine.modules.Screen
CACHE_SIZE_DEFAULT, CACHE_SIZE_KEY, NAME, PREFIX
-
-
Constructor Summary
Constructors Constructor Description VelocityScreen()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
buildTemplate(PipelineData pipelineData)
This builds the Velocity template.protected void
doBuildTemplate(PipelineData pipelineData)
Needs to be implemented to make TemplateScreen like us.protected void
doBuildTemplate(PipelineData pipelineData, org.apache.velocity.context.Context context)
Velocity Screens extending this class should override this method to perform any particular business logic and add information to the context.-
Methods inherited from class org.apache.turbine.modules.screens.TemplateScreen
doBuild, doPostBuildTemplate, doRedirect, doRedirect, setTemplate
-
-
-
-
Field Detail
-
prefix
protected static final String prefix
The prefix for lookup up screen pages- See Also:
- Constant Field Values
-
velocity
protected VelocityService velocity
Injected service instance
-
templateService
protected TemplateService templateService
Injected service instance
-
templateError
protected String templateError
-
-
Constructor Detail
-
VelocityScreen
public VelocityScreen()
-
-
Method Detail
-
doBuildTemplate
protected void doBuildTemplate(PipelineData pipelineData, org.apache.velocity.context.Context context) throws Exception
Velocity Screens extending this class should override this method to perform any particular business logic and add information to the context.- Parameters:
pipelineData
- Turbine information.context
- Context for web pages.- Throws:
Exception
- a generic exception.
-
doBuildTemplate
protected void doBuildTemplate(PipelineData pipelineData) throws 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 classTemplateScreen
- Parameters:
pipelineData
- Turbine information.- Throws:
Exception
- a generic exception.
-
buildTemplate
public String buildTemplate(PipelineData pipelineData) throws Exception
This builds the Velocity template.- Specified by:
buildTemplate
in classTemplateScreen
- Parameters:
pipelineData
- Turbine information.- Returns:
- the content of the screen
- Throws:
Exception
- a generic exception.
-
-