com.instantbank.lettertemplate.control.web
Class ScreenFlowManager

java.lang.Object
  |
  +--com.instantbank.lettertemplate.control.web.ScreenFlowManager
All Implemented Interfaces:
java.io.Serializable

public class ScreenFlowManager
extends java.lang.Object
implements java.io.Serializable

Looks at the Request URL and maps the request to the screen (page) for the web-templating mechanism.

Author:
Instant-bank (Consuelo Franky)
See Also:
Serialized Form

Field Summary
private  Debug debug
           
private  java.lang.String defaultScreen
           
private  java.util.HashMap screenDefinitionMappings
           
private  java.util.HashMap screens
           
private  java.util.HashMap urlMappings
           
 
Constructor Summary
ScreenFlowManager()
          Constructor for the ScreenFlowManager object
 
Method Summary
 java.lang.String getCurrentScreen(javax.servlet.http.HttpSession session)
          get the name of current screen from a web session variable
 void getNextScreen(javax.servlet.http.HttpServletRequest request, java.lang.Object answer, javax.servlet.ServletContext context)
          Using the information we have in the request along with The url map for the current url we will insure that the propper current screen is selected based on the settings in both the screendefinitions.xml file and requestmappings.xml files.
 Parameter getParameter(java.lang.String key, javax.servlet.http.HttpSession session)
          Gets the required parameter for the current screen This method is used by the insert tag to get the parameters needed to build a page.
 java.util.HashMap getScreens(java.util.Locale locale)
          Get the screens for the specified language.
 java.lang.String getTemplate(java.util.Locale locale)
          Get the template (JSP) for the specified language.
 URLMapping getURLMapping(java.lang.String urlPattern)
          The UrlMapping object contains information that will match a url to a mapping object that contains information about the current screen, the handler class that is needed to process a request, and the flow handler class that is needed to insure that the propper screen is displayed.
 void init(javax.servlet.ServletContext context)
          build structures of definition of screens and of its transitions from xml files
 void setDefaultScreen(java.lang.String defaultScreen)
          set default output screen (example: INDEX)
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

screens

private java.util.HashMap screens

urlMappings

private java.util.HashMap urlMappings

screenDefinitionMappings

private java.util.HashMap screenDefinitionMappings

debug

private Debug debug

defaultScreen

private java.lang.String defaultScreen
Constructor Detail

ScreenFlowManager

public ScreenFlowManager()
Constructor for the ScreenFlowManager object
Method Detail

init

public void init(javax.servlet.ServletContext context)
build structures of definition of screens and of its transitions from xml files
Parameters:
context - web context

getScreens

public java.util.HashMap getScreens(java.util.Locale locale)
Get the screens for the specified language.
Parameters:
locale - Description of the Parameter
Returns:
The screens value

getTemplate

public java.lang.String getTemplate(java.util.Locale locale)
Get the template (JSP) for the specified language.
Parameters:
locale - Description of the Parameter
Returns:
The template value

getURLMapping

public URLMapping getURLMapping(java.lang.String urlPattern)
The UrlMapping object contains information that will match a url to a mapping object that contains information about the current screen, the handler class that is needed to process a request, and the flow handler class that is needed to insure that the propper screen is displayed.
Parameters:
urlPattern - url associated to user request
Returns:
The URLMapping value

getNextScreen

public void getNextScreen(javax.servlet.http.HttpServletRequest request,
                          java.lang.Object answer,
                          javax.servlet.ServletContext context)
                   throws LetterTemplateEventException
Using the information we have in the request along with The url map for the current url we will insure that the propper current screen is selected based on the settings in both the screendefinitions.xml file and requestmappings.xml files.
Parameters:
request - Http request
answer - answer to event corresponding to user request
context - web context
Throws:
LetterTemplateEventException -  

getParameter

public Parameter getParameter(java.lang.String key,
                              javax.servlet.http.HttpSession session)
Gets the required parameter for the current screen This method is used by the insert tag to get the parameters needed to build a page. If a language is not set then the default properties will be loaded.
Parameters:
key - name of Parameter
session - web session
Returns:
The parameter value

setDefaultScreen

public void setDefaultScreen(java.lang.String defaultScreen)
set default output screen (example: INDEX)
Parameters:
defaultScreen - The new defaultScreen value

getCurrentScreen

public java.lang.String getCurrentScreen(javax.servlet.http.HttpSession session)
get the name of current screen from a web session variable
Parameters:
session - web session
Returns:
The currentScreen value