| org.apache.turbine.modules.Screen org.apache.turbine.modules.screens.TemplateScreen
All known Subclasses: org.apache.turbine.modules.screens.BaseJspScreen, org.apache.turbine.modules.screens.VelocityScreen,
TemplateScreen | abstract public class TemplateScreen extends Screen (Code) | | Template Screen.
Base Template Screens should extend this class and override the
buildTemplate() method. Users of the particular service can then
override the doBuildTemplate() for any specific pre-processing.
You can also override the doBuild() method in order to add extra
functionality to your system, but you need to make sure to at least
duplicate the existing functionality in order for things to work.
Look at the code for the doBuild() method to get an idea of what is
going on there (it is quite simple really).
author: Dave Bryson author: Henning P. Schmiedehausen version: $Id: TemplateScreen.java 534527 2007-05-02 16:10:59Z tv $ |
Field Summary | |
protected Log | log |
Method Summary | |
abstract public ConcreteElement | buildTemplate(RunData data) This method should be implemented by Base template classes. | protected ConcreteElement | doBuild(RunData data) This method is called by the Screenloader to construct the
Screen.
Parameters: data - Turbine information. | abstract protected void | doBuildTemplate(RunData data) This method should be overidden by subclasses that wish to add
specific business logic. | protected void | doPostBuildTemplate(RunData data) | public void | doRedirect(RunData data, String screen, String template) You can call this within a Screen to cause an internal redirect
to happen. | public void | doRedirect(RunData data, String template) You can call this within a Screen to cause an internal redirect
to happen. | public static void | setTemplate(RunData data, String template) This method is used when you want to short circuit a Screen and
change the template that will be executed next. |
log | protected Log log(Code) | | Logging
|
buildTemplate | abstract public ConcreteElement buildTemplate(RunData data) throws Exception(Code) | | This method should be implemented by Base template classes. It
should contain the specific template service code to generate
the template.
Parameters: data - Turbine information. A ConcreteElement. exception: Exception - A generic exception. |
doBuild | protected ConcreteElement doBuild(RunData data) throws Exception(Code) | | This method is called by the Screenloader to construct the
Screen.
Parameters: data - Turbine information. A ConcreteElement. exception: Exception - A generic exception. |
doBuildTemplate | abstract protected void doBuildTemplate(RunData data) throws Exception(Code) | | This method should be overidden by subclasses that wish to add
specific business logic.
Parameters: data - Turbine information. exception: Exception - A generic exception. |
doPostBuildTemplate | protected void doPostBuildTemplate(RunData data)(Code) | | This method can be overridden to write code that executes when
the template has been built (called from a finally clause, so
executes regardless of whether an exception is thrown or not)
|
doRedirect | public void doRedirect(RunData data, String screen, String template) throws Exception(Code) | | You can call this within a Screen to cause an internal redirect
to happen. It essentially allows you to stop execution in one
Screen and instantly execute another Screen. Don't worry, this
does not do a HTTP redirect and also if you have anything added
in the Context, it will get carried over.
This class is useful if you have a Screen that submits to
another Screen and you want it to do error validation before
executing the other Screen. If there is an error, you can
doRedirect() back to the original Screen.
Parameters: data - Turbine information. Parameters: screen - Name of screen to redirect to. Parameters: template - Name of template. exception: Exception - A generic exception. |
doRedirect | public void doRedirect(RunData data, String template) throws Exception(Code) | | You can call this within a Screen to cause an internal redirect
to happen. It essentially allows you to stop execution in one
Screen and instantly execute another Screen. Don't worry, this
does not do a HTTP redirect and also if you have anything added
in the Context, it will get carried over.
This class is useful if you have a Screen that submits to
another Screen and you want it to do error validation before
executing the other Screen. If there is an error, you can
doRedirect() back to the original Screen.
Parameters: data - Turbine information. Parameters: template - Name of template. exception: Exception - A generic exception. |
setTemplate | public static void setTemplate(RunData data, String template)(Code) | | This method is used when you want to short circuit a Screen and
change the template that will be executed next. Note that the current
context will be applied to the next template that is executed.
If you want to have the context executed for the next screen,
to be the same one as the next screen, then you should use the
TemplateScreen.doRedirect() method.
Parameters: data - Turbine information. Parameters: template - The name of the next template. |
|
|