com.sri.emo.wizard.selection.management
Class AbstractStepHandler

java.lang.Object
  extended by com.sri.emo.wizard.selection.management.AbstractStepHandler
Direct Known Subclasses:
EditFinalState, PromptNodeInstance, PromptSelectModel, PromptStepType, StepDefinition

public abstract class AbstractStepHandler
extends Object

Abstract base class for the step handler. Includes the ability to tell its derived classes whether we're editing or not. This will affect the rendering of the pages.

Author:
Michael Rimov

Field Summary
static Boolean ADD_MODE
          Constant for indication that the handler is adding a step.
static String ATTRIBUTE_SESSION_KEY
          Constant in the session where attributes are stored.
static Boolean EDIT_MODE
          Constant for indication that the handler is editing a step.
static String PARAM_RETURN_URL
          Parameter for Reference URL
 
Constructor Summary
AbstractStepHandler(String wizId, String stepId)
          Constructor that takes a wizard id and a step id and forms its internal state, allowing for easy retrieval of database objects from subclasses.
 
Method Summary
protected  Transition buildCancelTransition()
          Builds a cancel transition to allow easy exiting while in any State of editing the wizard step.
protected  WizDefinition getDefinition()
          Retreives the definition associated with the step.
protected  WizStep getStep()
          Retreieves the step based on the id given to us.
protected  WizStep getStepFromParameters(ExpressoRequest request, ErrorCollection ec)
          Function that delegates to the StepParameterParser class.
protected  String getStepName()
          Retrieve the step name
protected  String getStepTitle()
          Retrieve the title of the current step.
protected  String getWizardTitle()
          Retrieves the wizard title.
 boolean isEditing()
          Returns true if we're in editing mode for a particular page.
protected  Map parseStepAttributes(ExpressoRequest request)
          Parses the appropriate attributes from the controller request and saves it to the session for 'save' retrieval.
protected  void setEditing(Boolean value)
          Allows definition of whether the state is editing a current wizard.
protected  void transitionOnError(Class controllerClass, String state, ExpressoRequest request, ExpressoResponse response)
          Transitions to another class, usually on error.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EDIT_MODE

public static final Boolean EDIT_MODE
Constant for indication that the handler is editing a step.


ADD_MODE

public static final Boolean ADD_MODE
Constant for indication that the handler is adding a step.


ATTRIBUTE_SESSION_KEY

public static final String ATTRIBUTE_SESSION_KEY
Constant in the session where attributes are stored.


PARAM_RETURN_URL

public static final String PARAM_RETURN_URL
Parameter for Reference URL

See Also:
Constant Field Values
Constructor Detail

AbstractStepHandler

public AbstractStepHandler(String wizId,
                           String stepId)
                    throws DBException
Constructor that takes a wizard id and a step id and forms its internal state, allowing for easy retrieval of database objects from subclasses.

Parameters:
wizId - The Wizard ID (usually an integer)
stepId - The Step Id. May be null if there is no step definition.
Throws:
DBException - upon error.
Method Detail

isEditing

public boolean isEditing()
Returns true if we're in editing mode for a particular page.

Returns:
boolean true.

setEditing

protected void setEditing(Boolean value)
Allows definition of whether the state is editing a current wizard.

Parameters:
value - Boolean

getStep

protected WizStep getStep()
                   throws DBException
Retreieves the step based on the id given to us.

Returns:
WizStep constructed WizStep as either stored in the database or with default values populated.
Throws:
DBException - upon error.

getStepFromParameters

protected WizStep getStepFromParameters(ExpressoRequest request,
                                        ErrorCollection ec)
                                 throws DBException
Function that delegates to the StepParameterParser class.

Parameters:
request - ExpressoRequest the ExpressoRequest object
ec - ErrorCollection [in/out] the error collection that gets populated with notes if the parameters are invalid.
Returns:
WizStep constructed and populated with available parameters.
Throws:
DBException - upon error

getDefinition

protected WizDefinition getDefinition()
                               throws DBException
Retreives the definition associated with the step.

Returns:
WizDefinition wizard definition.
Throws:
DBException - upon error.

getStepTitle

protected String getStepTitle()
                       throws DBException
Retrieve the title of the current step. where we extract the necessary parameters to build the title.

Returns:
String the step title.
Throws:
DBException

getWizardTitle

protected String getWizardTitle()
                         throws DBException
Retrieves the wizard title.

Returns:
String
Throws:
DBException

getStepName

protected String getStepName()
                      throws DBException
Retrieve the step name

Returns:
String
Throws:
DBException

buildCancelTransition

protected Transition buildCancelTransition()
                                    throws DBException
Builds a cancel transition to allow easy exiting while in any State of editing the wizard step.

Returns:
Transition The cancel transition.
Throws:
DBException - upon database access error.

transitionOnError

protected void transitionOnError(Class controllerClass,
                                 String state,
                                 ExpressoRequest request,
                                 ExpressoResponse response)
                          throws ControllerException
Transitions to another class, usually on error.

Parameters:
controllerClass - Class
state - String
request - ExpressoRequest
response - ExpressoResponse
Throws:
ControllerException

parseStepAttributes

protected Map parseStepAttributes(ExpressoRequest request)
                           throws ControllerException
Parses the appropriate attributes from the controller request and saves it to the session for 'save' retrieval.

Parameters:
request - ExpressoRequest the ExpressoRequest object
Returns:
Map the Map
Throws:
ControllerException - upon error.


Copyright © 2004-2006 Codeguild, Inc.. All Rights Reserved.