| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.struts.action.Action
com.jcorporate.expresso.core.controller.Controller
com.jcorporate.expresso.core.controller.DBController
com.sri.common.controller.AbstractDBController
com.sri.common.controller.AbstractComponentController
com.sri.emo.wizard.expressoimpl.WizardController
public class WizardController
Wizard Controller is basically a thin wrapper over the Wizard domain model which does the actual thinking. The WizardController may be overridden in the case of custom onFinish() behavior.
| Field Summary | |
|---|---|
| static String | CANCEL_STATECancel State. | 
| static String | CURRENT_PAGE_NUMCurrent page number constant. | 
| static String | DISPLAY_STATEDisplay Page State. | 
| static String | FINISH_REQUESTParameter for Wizard's finish to get the ExpressoRequest object. | 
| static String | FINISH_RESPONSEParameter for the Wizard's finish method to get the ExpressoResponse object. | 
| static String | FINISH_STATEFinish State. | 
| static String | NEXT_STATENext State constant. | 
| static String | PREVIOUS_STATEPrevious State. | 
| static String | REQUEST_IDKey for the current wizard in the request. | 
| protected static String | SESSION_STATE_KEY_PREFIXKey for session state for the Wizard. | 
| static String | STATE_BEGINStart state constant. | 
| static String | STATE_JUMP_BACKWARDSState name to allow jumping backwards. | 
| static String | TOTAL_PAGESTotal Pages constant. | 
| static String | WIZ_DATA_IDConstant for what data is sent us. | 
| static String | WIZ_PAGE_PARAMETERCurrent Page ID Parameter name. | 
| static String | WIZ_PARAMETER_IDConstant for the id of the EMO Wizard that is being executed. | 
| static String | WIZ_RESULT_IDWhere the wizard is stored in the request context when finish() is called. | 
| Fields inherited from class com.sri.common.controller.AbstractComponentController | 
|---|
| REQUEST_CONTAINER | 
| 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, 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 | |
|---|---|
| WizardController()Generic wizard controller. | |
| Method Summary | |
|---|---|
| protected  void | addOnFinishWizardParameters(ExpressoRequest request,
                            ExpressoResponse response,
                            Map parameterMap) | 
| protected  void | addPageNumberForSequentialWizards(Wizard wiz,
                                  ExpressoResponse response) | 
| protected  void | addWizardInput(ExpressoResponse response,
               Wizard wiz,
               PageMetadata wp)Adds the wizard page input. | 
| protected  void | afterFinishState(ExpressoRequest request,
                 ExpressoResponse response)Template method. | 
| protected  Serializable | extractPostedWizardData(ExpressoRequest request)Template Method, override in your derived classes if desired. | 
| protected  Transition | getCancelTransition()Location for transition on cancel instances. | 
|  WizardPage | getCurrentPage(ExpressoRequest request,
               Wizard currentWizard)Retrieves the current page as set in the displayed page. | 
|  Wizard | getCurrentWizard(ExpressoRequest request)Retrieves the current wizard from session. | 
| protected  WizardMementoConverter | getMementoConverter()Template Method. | 
| protected  String | getSessionKey(String dataContext,
              Serializable wizardId)Retrieve where a particular wizard is stored in the session. | 
|  String | getTitle()Return the title of this Controller. | 
| protected  void | handleNoEntryErrorInPage(ExpressoRequest request,
                         ExpressoResponse response)Method that handles no-data entry if pages that should have occurred. | 
| protected  boolean | hasNoDataEntryAndShould(Object data,
                        WizardPage currentPage)Function that allows for consistent checking for whether data was entered. | 
| protected  Wizard | newWizard(ExpressoRequest request)Create a new wizard and store it to session. | 
| protected  void | releaseWizard(ExpressoRequest request,
              Wizard wiz)Removes the wizard resources from the session. | 
| protected  void | runBeginState(ExpressoRequest request,
              ExpressoResponse response)Runs the begin state. | 
| protected  void | runCancelState(ExpressoRequest request,
               ExpressoResponse response)Runs the cancel state. | 
| protected  void | runDisplayState(ExpressoRequest request,
                ExpressoResponse response)Displays the result of the wizard. | 
| protected  void | runFinishState(ExpressoRequest request,
               ExpressoResponse response)Run the finish state. | 
| protected  void | runJumpBackwardsState(ExpressoRequest request,
                      ExpressoResponse response)Runs the state that jumps the wizard backwards to some sort of previous page. | 
| protected  void | runNextState(ExpressoRequest request,
             ExpressoResponse response)Runs the next state. | 
| protected  void | runPreviousState(ExpressoRequest request,
                 ExpressoResponse response)Runs the begin state. | 
| protected  void | storeWizInSession(ExpressoRequest request,
                  Wizard toStore,
                  Integer wizId)Stores a new wizard to session. | 
| Methods inherited from class com.sri.common.controller.AbstractComponentController | 
|---|
| addStateHandler, initializeControllerContainer, locate, locator, newExpressoState, postPerform, prePerform | 
| Methods inherited from class com.sri.common.controller.AbstractDBController | 
|---|
| addEmbeddedParameter, addWarning, addWarningList, getActionForwarding, getCheckbox, getPermsTrans, getPrettyXML, getTextArea, getTextArea, getWarningList, isEmbeddedMode, isValidAndPopulated, outputXML, populateDBObject, stateAllowed, str, strTrunc, trimAllTextFields | 
| Methods inherited from class com.jcorporate.expresso.core.controller.DBController | 
|---|
| getString, isAllowed | 
| 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 | 
|---|
public static final String STATE_BEGIN
public static final String NEXT_STATE
public static final String FINISH_STATE
public static final String CANCEL_STATE
public static final String DISPLAY_STATE
public static final String PREVIOUS_STATE
public static final String STATE_JUMP_BACKWARDS
protected static final String SESSION_STATE_KEY_PREFIX
public static final String REQUEST_ID
public static final String WIZ_PARAMETER_ID
public static final String WIZ_DATA_ID
public static final String WIZ_RESULT_ID
public static final String FINISH_REQUEST
public static final String FINISH_RESPONSE
public static final String WIZ_PAGE_PARAMETER
public static final String CURRENT_PAGE_NUM
public static final String TOTAL_PAGES
| Constructor Detail | 
|---|
public WizardController()
| Method Detail | 
|---|
public String getTitle()
getTitle in class Controllerprotected Transition getCancelTransition()
protected String getSessionKey(String dataContext,
                               Serializable wizardId)
wizardId - the current id of the wizard.dataContext - the datacontext for the wizard.
public Wizard getCurrentWizard(ExpressoRequest request)
                        throws ControllerException
request - the current controller request.
ControllerException - if unable to query the session.
public WizardPage getCurrentPage(ExpressoRequest request,
                                 Wizard currentWizard)
                          throws ControllerException
request - ExpressoRequest the controller request object.currentWizard - Wizard the current wizard.
ControllerException - upon error.
protected void storeWizInSession(ExpressoRequest request,
                                 Wizard toStore,
                                 Integer wizId)
                          throws ControllerException
request - the ExpressoRequest objecttoStore - the wizard to store.wizId - the integer id of the wizard.
ControllerException - upon session related error.protected WizardMementoConverter getMementoConverter()
protected Wizard newWizard(ExpressoRequest request)
                    throws WizardException,
                           ControllerException
request - the ExpressoRequest object
WizardException - upon wizard error
ControllerException - upon expresso controller related
                             error.
protected void runBeginState(ExpressoRequest request,
                             ExpressoResponse response)
                      throws ControllerException,
                             NonHandleableException
request - the ExpressoRequest objectresponse - the ExpressoResponse object.
ControllerException - upon error
NonHandleableException - upon fatal error
protected void runCancelState(ExpressoRequest request,
                              ExpressoResponse response)
                       throws ControllerException,
                              NonHandleableException
request - the ExpressoRequest objectresponse - the ExpressoResponse object.
ControllerException - upon error
NonHandleableException - upon fatal error
protected void runDisplayState(ExpressoRequest request,
                               ExpressoResponse response)
                        throws ControllerException,
                               NonHandleableException
REQUEST_ID.  and if the wizard metadata is using
 expresso links, then it dumps the resulting Transitions into the
 ExpressoResponse object. [Although JSTL can certainly
 get the links directly from the REQUEST_ID object's metadata:
 so choose your style.
request - the ExpressoRequest objectresponse - the ExpressoResponse object.
ControllerException - upon error
NonHandleableException - upon fatal error
protected void runFinishState(ExpressoRequest request,
                              ExpressoResponse response)
                       throws ControllerException,
                              NonHandleableException
request - the ExpressoRequest objectresponse - the ExpressoResponse object.
ControllerException - upon error
NonHandleableException - upon fatal error
protected void addOnFinishWizardParameters(ExpressoRequest request,
                                           ExpressoResponse response,
                                           Map parameterMap)
protected void afterFinishState(ExpressoRequest request,
                                ExpressoResponse response)
                         throws ControllerException
request - ExpressoRequest Expresso Request objectresponse - ExpressoResponse ExpressoResponse object
ControllerException - upon errors.
protected void releaseWizard(ExpressoRequest request,
                             Wizard wiz)
                      throws ControllerException,
                             WizardException
request - ExpressoRequest the ExpressoRequest object.wiz - Wizard the Wizard to release.
ControllerException - upon session removal error.
WizardException - upon wizard destruction error.
protected void runNextState(ExpressoRequest request,
                            ExpressoResponse response)
                     throws ControllerException,
                            NonHandleableException
request - the ExpressoRequest objectresponse - the ExpressoResponse object.
ControllerException - upon error
NonHandleableException - upon fatal errorprotected Serializable extractPostedWizardData(ExpressoRequest request)
request - ExpressoRequest
protected void handleNoEntryErrorInPage(ExpressoRequest request,
                                        ExpressoResponse response)
                                 throws NonHandleableException,
                                        ControllerException
request - ExpressoRequestresponse - ExpressoResponse
NonHandleableException - upon transition error.
ControllerException - upon error in substate (Usually Display)
protected boolean hasNoDataEntryAndShould(Object data,
                                          WizardPage currentPage)
data - StringcurrentPage - WizardPage
protected void runPreviousState(ExpressoRequest request,
                                ExpressoResponse response)
                         throws ControllerException,
                                WizardException
request - the ExpressoRequest objectresponse - the ExpressoResponse object.
ControllerException - upon error
NonHandleableException - upon fatal error
WizardException
protected void runJumpBackwardsState(ExpressoRequest request,
                                     ExpressoResponse response)
                              throws ControllerException
request - the ExpressoRequest objectresponse - the ExpressoResponse object.
ControllerException - upon error
protected void addWizardInput(ExpressoResponse response,
                              Wizard wiz,
                              PageMetadata wp)
                       throws ControllerException
response - ExpressoResponsewiz - Wizardwp - PageMetadata
ControllerException
protected void addPageNumberForSequentialWizards(Wizard wiz,
                                                 ExpressoResponse response)
                                          throws ControllerException
ControllerException| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||