org.apache.turbine.modules.screens
Class VelocitySecureScreen

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
                  extended byorg.apache.turbine.modules.screens.VelocitySecureScreen

public abstract class VelocitySecureScreen
extends VelocityScreen

VelocitySecureScreen Always performs a Security Check that you've defined before executing the doBuildTemplate(). You should extend this class and add the specific security check needed. If you have a number of screens that need to perform the same check, you could make a base screen by extending this class and implementing the isAuthorized(). Then each screen that needs to perform the same check could extend your base screen.

Version:
$Id: VelocitySecureScreen.java 536036 2007-05-08 00:44:53Z seade $
Author:
Dave Bryson

Field Summary
 
Fields inherited from class org.apache.turbine.modules.screens.TemplateScreen
log
 
Constructor Summary
VelocitySecureScreen()
           
 
Method Summary
protected  void doBuildTemplate(RunData data)
          This method overrides the method in VelocityScreen to perform a security check first.
protected abstract  void doBuildTemplate(RunData data, org.apache.velocity.context.Context context)
          Implement this to add information to the context.
protected abstract  boolean isAuthorized(RunData data)
          Implement this method to perform the security check needed.
 
Methods inherited from class org.apache.turbine.modules.screens.VelocityScreen
buildTemplate, getContext
 
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

VelocitySecureScreen

public VelocitySecureScreen()
Method Detail

doBuildTemplate

protected abstract void doBuildTemplate(RunData data,
                                        org.apache.velocity.context.Context context)
                                 throws java.lang.Exception
Implement this to add information to the context.

Overrides:
doBuildTemplate in class VelocityScreen
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
This method overrides the method in VelocityScreen to perform a security check first.

Overrides:
doBuildTemplate in class VelocityScreen
Parameters:
data - Turbine information.
Throws:
Exception, - a generic exception.
java.lang.Exception

isAuthorized

protected abstract boolean isAuthorized(RunData data)
                                 throws java.lang.Exception
Implement this method to perform the security check needed. You should set the template in this method that you want the user to be sent to if they're unauthorized.

Parameters:
data - Turbine information.
Returns:
True if the user is authorized to access the screen.
Throws:
Exception, - a generic exception.
java.lang.Exception


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