net.aejase.plugin.wizard
Class WizardFlow

java.lang.Object
  |
  +--net.aejase.plugin.wizard.WizardFlow

public class WizardFlow
extends java.lang.Object

The WizardFlow is the interface between the user and the Wizard API. It allows user to control the Wizard.

Since:
0.5
Version:
0.7
Author:
Thomas Cornet

Field Summary
static int DYNAHELPER
          Helper type : dynamically created object
static int MAPPEDHELPER
          Helper type : WizardBaseHelper
 
Constructor Summary
WizardFlow()
          Constructor
 
Method Summary
static void destroy(javax.servlet.http.HttpServletRequest request)
          Removes the WizardFlow from the current session's context
static org.apache.struts.action.ActionForward findForward(javax.servlet.http.HttpServletRequest request, int index)
          Gets the forward of a specific form
static org.apache.struts.action.ActionForward findForward(javax.servlet.http.HttpServletRequest request, java.lang.String action)
          Gets the forward of a specific form
static int findIndexByAction(javax.servlet.jsp.PageContext pageContext, java.lang.String action)
          Gets the index of the WizardInput which contain specific action's path
 java.lang.String getDisplayStep()
          Returns the value of the current step, usable to display on screen
static java.lang.Object getHelper(javax.servlet.http.HttpServletRequest request, java.lang.String action, int type)
          Gets a form helper
 java.lang.Object getHelperObject(javax.servlet.http.HttpServletRequest request, java.lang.String action, int type)
          Creates and return the helper class for a given action
static org.apache.struts.action.ActionForward getPreviousForward(javax.servlet.http.HttpServletRequest request)
          Gets the forward for the previous form
static java.lang.String getProperty(javax.servlet.http.HttpSession session, java.lang.String property)
          Gets the value of a property of the current wizard
 int getStep()
          Gets the step
static int getStep(javax.servlet.jsp.PageContext pageContext)
          Gets the current step
static void init(javax.servlet.http.HttpServletRequest request)
          Initializes a new WizardFlow
static void processForm(javax.servlet.http.HttpServletRequest request, org.apache.struts.action.ActionForm form)
          What is done to add form's input to the current WizardFlow
static void putHelper(javax.servlet.http.HttpServletRequest request, java.lang.String key, java.lang.String actionPath, int type)
          Puts the page's helper in the request context
 java.lang.String toString()
          Returns a representation of the class
static java.lang.String toString(javax.servlet.http.HttpServletRequest request)
          Returns a representation of the class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DYNAHELPER

public static final int DYNAHELPER
Helper type : dynamically created object

See Also:
Constant Field Values

MAPPEDHELPER

public static final int MAPPEDHELPER
Helper type : WizardBaseHelper

See Also:
Constant Field Values
Constructor Detail

WizardFlow

public WizardFlow()
Constructor

Method Detail

init

public static void init(javax.servlet.http.HttpServletRequest request)
Initializes a new WizardFlow

Parameters:
request - the current request

destroy

public static void destroy(javax.servlet.http.HttpServletRequest request)
Removes the WizardFlow from the current session's context

Parameters:
request - the current request

findIndexByAction

public static int findIndexByAction(javax.servlet.jsp.PageContext pageContext,
                                    java.lang.String action)
Gets the index of the WizardInput which contain specific action's path

Parameters:
pageContext - the current page context
action - the path of the action to search
Returns:
the index of the WizardInput in the Vector
Since:
0.6

toString

public static java.lang.String toString(javax.servlet.http.HttpServletRequest request)
Returns a representation of the class

Parameters:
request - the current request
Returns:
a description

toString

public java.lang.String toString()
Returns a representation of the class

Overrides:
toString in class java.lang.Object
Returns:
the description

getHelper

public static java.lang.Object getHelper(javax.servlet.http.HttpServletRequest request,
                                         java.lang.String action,
                                         int type)
Gets a form helper

Parameters:
action - the action
type - the type of wanted helper
Returns:
the helper

findForward

public static org.apache.struts.action.ActionForward findForward(javax.servlet.http.HttpServletRequest request,
                                                                 java.lang.String action)
                                                          throws FormNotFoundException
Gets the forward of a specific form

Parameters:
request - the current request
Returns:
the forward to the form's page
Throws:
FormNotFoundException - if the name is bad

findForward

public static org.apache.struts.action.ActionForward findForward(javax.servlet.http.HttpServletRequest request,
                                                                 int index)
                                                          throws FormNotFoundException
Gets the forward of a specific form

Parameters:
request - the current request
index - the index of the form
Returns:
the forward to the form's page
Throws:
FormNotFoundException - if the index is bad

getPreviousForward

public static org.apache.struts.action.ActionForward getPreviousForward(javax.servlet.http.HttpServletRequest request)
Gets the forward for the previous form

Parameters:
request - the current request
Returns:
the forward

getDisplayStep

public java.lang.String getDisplayStep()
Returns the value of the current step, usable to display on screen

Returns:
the current step

getProperty

public static java.lang.String getProperty(javax.servlet.http.HttpSession session,
                                           java.lang.String property)
Gets the value of a property of the current wizard

Parameters:
session - the current session
property - the property to get
Returns:
the value of the property

processForm

public static void processForm(javax.servlet.http.HttpServletRequest request,
                               org.apache.struts.action.ActionForm form)
What is done to add form's input to the current WizardFlow

Parameters:
request - the current request
form - the form to add
Since:
0.7

getStep

public static int getStep(javax.servlet.jsp.PageContext pageContext)
Gets the current step

Parameters:
pageContext - PageContext object
Returns:
step
Since:
0.7

getStep

public int getStep()
Gets the step

Returns:
the step
Since:
0.7

putHelper

public static void putHelper(javax.servlet.http.HttpServletRequest request,
                             java.lang.String key,
                             java.lang.String actionPath,
                             int type)
Puts the page's helper in the request context

Parameters:
request - the current request
key - the key to store the helper in
actionPath - the helper's related action
type - the helper's type
Since:
0.7

getHelperObject

public java.lang.Object getHelperObject(javax.servlet.http.HttpServletRequest request,
                                        java.lang.String action,
                                        int type)
Creates and return the helper class for a given action

Parameters:
request - the current request
action - the helper's action path
type - the helper's type
Returns:
the helper (class depends on type)
Since:
0.7