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

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by com.jcorporate.expresso.core.controller.Controller
          extended by com.jcorporate.expresso.core.controller.DBController
              extended by com.sri.common.controller.AbstractDBController
                  extended by com.sri.emo.controller.EmoAction
                      extended by com.sri.emo.wizard.selection.management.WizardStepController
All Implemented Interfaces:
IFooterStateHandler, IHeaderStateHandler, Serializable

public class WizardStepController
extends EmoAction

Controller that manages Wizard Steps. Due to the nature of the embedded state handlers, in most cases, this controller is nothing more than a Mediator of the state handlers, dispatching requests to the appropriate class.

A controller is a rough model of a finite state machine for a web application. Each state provides user interaction elements that can be rendered in a web page or other medium such as a command line app.

See Also:
Serialized Form

Field Summary
static String PARAM_MODEL_ID
          Constant for parameter name 'model id'.
static String STATE_DO_ADD
          Constant for access to state: Save Add.
static String STATE_DO_DELETE
          Constant for access to state: Delete Step.
static String STATE_DO_EDIT
          Constant for access to state: Save Edit.
static String STATE_DO_SELECT_STEP_TYPE
          Constant for access to state: Do Select Step Type
static String STATE_ORDERDOWN
          Constant for access to state: Order Down.
static String STATE_ORDERUP
          Constant for access to state: Order Up.
static String STATE_PROMPT_DELETE
          Constant for access to state: Prompt Delete.
static String STATE_PROMPT_EDIT
          Constant for access to state: Edit Step.
 
Fields inherited from class com.sri.common.controller.AbstractDBController
COLUMN, COMMON_FOOTER_HANDLER, COMMON_HEADER_HANDLER, DELIMIT, EDIT_GROUP_DISPLAY, EMBEDDED_MODE, FOOTER, MAX_CHARS_OUTPUT, MAX_TEXTAREA_LENGTH, MULTIPLE_TEXTAREA_NUM_LINES, REQUEST_CONTAINER, ROW, ROW_BLOCK, SESSION_CONTAINER, SINGLE_TEXTAREA_NUM_LINES, TEXTAREA_NUM_COLS, WARNING_LIST
 
Fields inherited from class com.jcorporate.expresso.core.controller.DBController
CACHE_NAME
 
Fields inherited from class com.jcorporate.expresso.core.controller.Controller
CONTROLLER_PARAM_KEY, CTL_SUCC_CTL, CTL_SUCC_STATE, CTL_SUCC_TRAN, mLog, NEWSTATE_EXCEPTION_KEY, ORIGINAL_URL_KEY, REQUEST_KEY, RESPONSE_KEY, RETURN_TO_SENDER_TRAN, STATE_ERR_CTL, STATE_ERR_STATE, STATE_ERR_TRAN, STATE_PARAM_KEY, STATE_SUCC_CTL, STATE_SUCC_STATE, STATE_SUCC_TRAN
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
WizardStepController()
          Creates an instance of WizardStepController.
 
Method Summary
 String getTitle()
          Override of Controller.getTitle() to provide a meaningful name to this controller.
protected  void redirectAfterSave(ControllerRequest request, ControllerResponse response, WizStep step)
          Redirects to the list wizard state when a save of a step is complete.
protected  WizStep retrieveWizStep(ExpressoRequest request)
          Helper function to retrieve the WizStep object from the controller request.
protected  void runDoAddState(ServletControllerRequest request, ControllerResponse response)
          Runs the Commit 'Add Step' state.
protected  void runDoDeleteState(ControllerRequest request, ControllerResponse response)
          Runs the Delete Step state.
protected  void runDoEditState(ServletControllerRequest request, ControllerResponse response)
          Runs the Commit 'Edit Step' state.
protected  void runDoSelectStepTypeState(ControllerRequest request, ControllerResponse response)
          Processes the results from the inputs generated by promptSelectStepType handler and transitions to the appropriate state based on the results.
protected  void runOrderDownState(ControllerRequest request, ControllerResponse response)
          Runs the Order Down state.
protected  void runOrderUpState(ControllerRequest request, ControllerResponse response)
          Runs the Order Up state.
protected  void runPromptDeleteState(ExpressoRequest request, ExpressoResponse response)
          Runs the Prompt Delete Step state.
protected  void runPromptEditState(ControllerRequest request, ControllerResponse response)
          Runs the Edit Step state.
protected  void runPromptInstructionsState(ControllerRequest request, ControllerResponse response)
          Dispatches to the PromptInstructions state handler.
protected  void runPromptModelFieldState(ControllerRequest request, ControllerResponse response)
          Selects the model field and etc for use in the step.
protected  void runPromptNodeAttributeState(ControllerRequest request, ControllerResponse response)
          Selects the node attribute to use for a picklist.
protected  void runPromptNodeInstanceState(ControllerRequest request, ControllerResponse response)
          Selects the model instance to use in the step.
protected  void runPromptPicklistState(ControllerRequest request, ControllerResponse response)
          Selects the picklist to use.
protected  void runPromptSelectModelState(ControllerRequest request, ControllerResponse response)
          Selects the model to use for the step.
protected  void runPromptSelectStepTypeState(ControllerRequest request, ControllerResponse response)
          Handles the select step type state.
protected  void runPromptTextEntryState(ControllerRequest request, ControllerResponse response)
          Prompts for Text entry.
 
Methods inherited from class com.sri.emo.controller.EmoAction
addFooter, addHeader, runFooterState, runHeaderState
 
Methods inherited from class com.sri.common.controller.AbstractDBController
addEmbeddedParameter, addWarning, addWarningList, getActionForwarding, getCheckbox, getPermsTrans, getPrettyXML, getTextArea, getTextArea, getWarningList, isEmbeddedMode, isValidAndPopulated, outputXML, populateDBObject, postPerform, prePerform, stateAllowed, str, strTrunc, trimAllTextFields
 
Methods inherited from class com.jcorporate.expresso.core.controller.DBController
getString, isAllowed
 
Methods inherited from class com.jcorporate.expresso.core.controller.Controller
addFinalState, addPromptTransitions, addRegDomainParamtoSession, addRequestedURLtoSession, addState, addStatePairing, endTimer, execute, findControllerForm, generateToken, getActionForward, getControllerChainingTransition, getControllerSecurityTransition, getFinalState, getInitialState, getLogger, getParamValues, getRequestURL, getSchema, getSchemaHierarchy, getSchemaInstance, getSchemaStack, getState, getStates, getString, getString, handleException, instantiate, isFinalState, isHandleState, isPromptState, isTokenValid, loadStateForm, newExpressoState, newState, nextHandleState, nextPromptState, populateStateForm, postPerform, prePerform, previousPromptState, processRequestTransitions, processTransitions, redirectRequest, redirectRequest, remapFromExtension, resetToken, saveToken, setControllerChainingTransition, setControllerSecurityTransition, setCurrentState, setInitialState, setSchema, setSchema, setupDefaultValues, setupReturnToSender, setupSubclassLog, transition, transition, transition, unloadStateForm
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_DO_ADD

public static final String STATE_DO_ADD
Constant for access to state: Save Add.

See Also:
Constant Field Values

STATE_DO_DELETE

public static final String STATE_DO_DELETE
Constant for access to state: Delete Step.

See Also:
Constant Field Values

STATE_ORDERUP

public static final String STATE_ORDERUP
Constant for access to state: Order Up.

See Also:
Constant Field Values

STATE_ORDERDOWN

public static final String STATE_ORDERDOWN
Constant for access to state: Order Down.

See Also:
Constant Field Values

STATE_PROMPT_EDIT

public static final String STATE_PROMPT_EDIT
Constant for access to state: Edit Step.

See Also:
Constant Field Values

STATE_DO_EDIT

public static final String STATE_DO_EDIT
Constant for access to state: Save Edit.

See Also:
Constant Field Values

STATE_PROMPT_DELETE

public static final String STATE_PROMPT_DELETE
Constant for access to state: Prompt Delete.

See Also:
Constant Field Values

STATE_DO_SELECT_STEP_TYPE

public static final String STATE_DO_SELECT_STEP_TYPE
Constant for access to state: Do Select Step Type

See Also:
Constant Field Values

PARAM_MODEL_ID

public static final String PARAM_MODEL_ID
Constant for parameter name 'model id'.

See Also:
Constant Field Values
Constructor Detail

WizardStepController

public WizardStepController()
Creates an instance of WizardStepController. The Controller constructor also defines what states and parameters are officially defined by the Controller.

Method Detail

runDoAddState

protected void runDoAddState(ServletControllerRequest request,
                             ControllerResponse response)
                      throws ControllerException,
                             NonHandleableException,
                             javax.servlet.ServletException,
                             IOException
Runs the Commit 'Add Step' state.

Parameters:
request - The ControllerRequest object handed to us by the framework. The ControllerRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ControllerResponse object handed to us by the framework. The ControllerResponse will be populated with the Inputs/Outputs/Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error
javax.servlet.ServletException - upon Servlet Forward error.
IOException - if client connection was lost.

runDoEditState

protected void runDoEditState(ServletControllerRequest request,
                              ControllerResponse response)
                       throws ControllerException,
                              NonHandleableException,
                              javax.servlet.ServletException,
                              IOException
Runs the Commit 'Edit Step' state.

Parameters:
request - The ControllerRequest object handed to us by the framework. The ControllerRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ControllerResponse object handed to us by the framework. The ControllerResponse will be populated with the Inputs/Outputs/Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error
javax.servlet.ServletException - upon Servlet Forward error.
IOException - if client connection was lost.

redirectAfterSave

protected void redirectAfterSave(ControllerRequest request,
                                 ControllerResponse response,
                                 WizStep step)
                          throws ControllerException,
                                 DBException
Redirects to the list wizard state when a save of a step is complete.

Parameters:
request - the ControllerRequest object
response - the ControllerResponse object
step - the object that we just saved.
Throws:
ControllerException - upon transition error.
DBException - upon database getField() error.

runDoDeleteState

protected void runDoDeleteState(ControllerRequest request,
                                ControllerResponse response)
                         throws ControllerException,
                                NonHandleableException
Runs the Delete Step state.

Parameters:
request - The ControllerRequest object handed to us by the framework. The ControllerRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ControllerResponse object handed to us by the framework. The ControllerResponse will be populated with the Inputs/Outputs/Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error

retrieveWizStep

protected WizStep retrieveWizStep(ExpressoRequest request)
                           throws DBException,
                                  ControllerException
Helper function to retrieve the WizStep object from the controller request.

Parameters:
request - the controller request object
Returns:
instantiated WizStep instance.
Throws:
DBException - upon database retrieval error.
ControllerException - upon controller element related error.

runPromptDeleteState

protected void runPromptDeleteState(ExpressoRequest request,
                                    ExpressoResponse response)
                             throws ControllerException,
                                    NonHandleableException
Runs the Prompt Delete Step state.

Parameters:
request - The ControllerRequest object handed to us by the framework. The ControllerRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ControllerResponse object handed to us by the framework. The ControllerResponse will be populated with the Inputs/Outputs/Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error

runOrderUpState

protected void runOrderUpState(ControllerRequest request,
                               ControllerResponse response)
                        throws ControllerException,
                               NonHandleableException
Runs the Order Up state.

Parameters:
request - The ControllerRequest object handed to us by the framework. The ControllerRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ControllerResponse object handed to us by the framework. The ControllerResponse will be populated with the Inputs/Outputs/Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error

runPromptModelFieldState

protected void runPromptModelFieldState(ControllerRequest request,
                                        ControllerResponse response)
                                 throws ControllerException,
                                        NonHandleableException,
                                        DBException
Selects the model field and etc for use in the step.

Parameters:
request - The ControllerRequest object handed to us by the framework. The ControllerRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ControllerResponse object handed to us by the framework. The ControllerResponse will be populated with the Inputs/Outputs/Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error
DBException - upon database error

runPromptTextEntryState

protected void runPromptTextEntryState(ControllerRequest request,
                                       ControllerResponse response)
                                throws ControllerException,
                                       NonHandleableException,
                                       DBException
Prompts for Text entry.

Parameters:
request - The ControllerRequest object handed to us by the framework. The ControllerRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ControllerResponse object handed to us by the framework. The ControllerResponse will be populated with the Inputs/Outputs/Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error
DBException - upon database error

runPromptNodeInstanceState

protected void runPromptNodeInstanceState(ControllerRequest request,
                                          ControllerResponse response)
                                   throws ControllerException,
                                          NonHandleableException,
                                          DBException
Selects the model instance to use in the step.

Parameters:
request - The ControllerRequest object handed to us by the framework. The ControllerRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ControllerResponse object handed to us by the framework. The ControllerResponse will be populated with the Inputs/Outputs/Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error
DBException - upon database error

runPromptNodeAttributeState

protected void runPromptNodeAttributeState(ControllerRequest request,
                                           ControllerResponse response)
                                    throws ControllerException,
                                           NonHandleableException,
                                           DBException
Selects the node attribute to use for a picklist.

Parameters:
request - The ControllerRequest object handed to us by the framework. The ControllerRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ControllerResponse object handed to us by the framework. The ControllerResponse will be populated with the Inputs/Outputs/Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error
DBException - upon database error

runPromptPicklistState

protected void runPromptPicklistState(ControllerRequest request,
                                      ControllerResponse response)
                               throws ControllerException,
                                      NonHandleableException,
                                      DBException
Selects the picklist to use.

Parameters:
request - The ControllerRequest object handed to us by the framework. The ControllerRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ControllerResponse object handed to us by the framework. The ControllerResponse will be populated with the Inputs/Outputs/Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error
DBException - upon database error

runPromptSelectModelState

protected void runPromptSelectModelState(ControllerRequest request,
                                         ControllerResponse response)
                                  throws ControllerException,
                                         NonHandleableException,
                                         DBException
Selects the model to use for the step.

Parameters:
request - The ControllerRequest object handed to us by the framework. The ControllerRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ControllerResponse object handed to us by the framework. The ControllerResponse will be populated with the Inputs/Outputs/Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error
DBException - upon database error

runOrderDownState

protected void runOrderDownState(ControllerRequest request,
                                 ControllerResponse response)
                          throws ControllerException,
                                 NonHandleableException
Runs the Order Down state.

Parameters:
request - The ControllerRequest object handed to us by the framework. The ControllerRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ControllerResponse object handed to us by the framework. The ControllerResponse will be populated with the Inputs/Outputs/Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error

runPromptEditState

protected void runPromptEditState(ControllerRequest request,
                                  ControllerResponse response)
                           throws ControllerException,
                                  NonHandleableException,
                                  DBException
Runs the Edit Step state. The edit step state is nothing more than a mediator that dispatches to the appropriate editing page.

Parameters:
request - The ControllerRequest object handed to us by the framework. The ControllerRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ControllerResponse object handed to us by the framework. The ControllerResponse will be populated with the Inputs/Outputs/Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error
DBException - upon database error.

runPromptSelectStepTypeState

protected void runPromptSelectStepTypeState(ControllerRequest request,
                                            ControllerResponse response)
                                     throws ControllerException,
                                            DBException,
                                            NonHandleableException
Handles the select step type state.

Parameters:
request - The ControllerRequest object handed to us by the framework. The ControllerRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ControllerResponse object handed to us by the framework. The ControllerResponse will be populated with the Inputs/Outputs/Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
DBException - upon database exception error.
NonHandleableException

runDoSelectStepTypeState

protected void runDoSelectStepTypeState(ControllerRequest request,
                                        ControllerResponse response)
                                 throws ControllerException,
                                        NonHandleableException
Processes the results from the inputs generated by promptSelectStepType handler and transitions to the appropriate state based on the results.

Parameters:
request - The ControllerRequest object handed to us by the framework. The ControllerRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ControllerResponse object handed to us by the framework. The ControllerResponse will be populated with the Inputs/Outputs/Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException

runPromptInstructionsState

protected void runPromptInstructionsState(ControllerRequest request,
                                          ControllerResponse response)
                                   throws DBException,
                                          ControllerException,
                                          NonHandleableException
Dispatches to the PromptInstructions state handler.

Parameters:
request - ControllerRequest the ControllerRequest object.
response - ControllerResponse the ControllerResponse object.
Throws:
DBException - upon error.
ControllerException
NonHandleableException

getTitle

public String getTitle()
Override of Controller.getTitle() to provide a meaningful name to this controller.

Overrides:
getTitle in class EmoAction
Returns:
java.lang.String


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