org.apache.turbine.modules.screens

## Class VelocityScreen

- java.lang.Object
- - org.apache.turbine.modules.Assembler
  - - org.apache.turbine.modules.Screen
    - - 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: VelocityScreen.java 1709648 2015-10-20 17:08:10Z tv $
  Author:
    Dave Bryson, Henning P. Schmiedehausen, Peter Courcoux

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected org.apache.commons.configuration.Configuration` | `conf` Injected configuration instance
    `protected TemplateService` | `templateService` Injected service instance
    `protected VelocityService` | `velocity` Injected service instance

    - ### Fields inherited from class org.apache.turbine.modules.screens.TemplateScreen

      `log`

    - ### Fields inherited from class org.apache.turbine.modules.Screen

      `CACHE_SIZE_DEFAULT, CACHE_SIZE_KEY, NAME, PREFIX`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VelocityScreen()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and 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`

    - ### Methods inherited from class org.apache.turbine.modules.Screen

      `build, getLayout, getPrefix, setLayout`

    - ### Methods inherited from class org.apache.turbine.modules.Assembler

      `getRunData`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### velocity

          protected VelocityService velocity

      Injected service instance

    - #### templateService

          protected TemplateService templateService

      Injected service instance

    - #### conf

          protected org.apache.commons.configuration.Configuration conf

      Injected configuration instance

  - ### 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.
        `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 class `TemplateScreen`
      Parameters:
        `pipelineData` - Turbine information.
      Throws:
        `Exception,` - a generic exception.
        `Exception` - A generic exception.

    - #### buildTemplate

          public String buildTemplate(PipelineData pipelineData)
                               throws Exception

      This builds the Velocity template.
      Specified by:
        `buildTemplate` in class `TemplateScreen`
      Parameters:
        `pipelineData` - Turbine information.
      Returns:
        the content of the screen
      Throws:
        `Exception,` - a generic exception.
        `Exception` - A generic exception.

Copyright © 2000-2015 The Apache Software Foundation. All Rights Reserved.