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

java.lang.Object
  extended by com.sri.emo.wizard.selection.management.AbstractStepHandler
      extended by com.sri.emo.wizard.selection.management.EditFinalState
Direct Known Subclasses:
PromptInstructions, PromptModelField, PromptNodeAttribute, PromptPicklist, PromptTextEntry

public class EditFinalState
extends AbstractStepHandler

Combines common controls into a step editor.

Author:
Michael Rimov

Field Summary
static String ATTRIBUTE_SESSION_KEY
          Constant in the session where attributes are stored.
static String PARAM_DIRECTIVE
          Constant for directive field.
static String PARAM_HELPTEXT
          Constant for helptext field.
static String PARAM_TITLE
          Constant for title field.
static String REQUEST_ATTRIBUTES
          Constant for where attributes are stored in the Request context.
static String TRANSITION_EDIT
          Name of the edit transition.
static String TRANSITION_SAVE
          Name of the save transition.
 
Fields inherited from class com.sri.emo.wizard.selection.management.AbstractStepHandler
ADD_MODE, EDIT_MODE, PARAM_RETURN_URL
 
Constructor Summary
EditFinalState(String wizId, String stepId)
          Default constructor.
 
Method Summary
protected  void addStepTypeLabel(ExpressoResponse response, WizStep step)
          Creates output for the text label of what type of step we're dealing with.
protected  Map buildAndStoreStepAttributes(ExpressoRequest request)
          Parses the appropriate attributes from the controller request and saves it to the session for 'save' retrieval.
protected  Transition buildEditTypeTransition(WizStep stepDefinition)
          Constructs a transition that determines the 'step type'.
protected  Transition buildSaveAndReturnTransition(WizStep step)
          Constructs the 'save and return' transition.
protected  boolean isNeedTransitionOnError(ErrorCollection ec, ExpressoResponse response)
          Returns true if we didn't try to save and we got an error collection.
protected  Block renderCommonControls(WizStep stepDefinition, ExpressoRequest request, ExpressoResponse response)
          Renders the controls that are common to each of the 'last definition' steps.
 
Methods inherited from class com.sri.emo.wizard.selection.management.AbstractStepHandler
buildCancelTransition, getDefinition, getStep, getStepFromParameters, getStepName, getStepTitle, getWizardTitle, isEditing, parseStepAttributes, setEditing, transitionOnError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_TITLE

public static final String PARAM_TITLE
Constant for title field.

See Also:
Constant Field Values

PARAM_DIRECTIVE

public static final String PARAM_DIRECTIVE
Constant for directive field.

See Also:
Constant Field Values

PARAM_HELPTEXT

public static final String PARAM_HELPTEXT
Constant for helptext field.

See Also:
Constant Field Values

TRANSITION_SAVE

public static final String TRANSITION_SAVE
Name of the save transition.

See Also:
Constant Field Values

TRANSITION_EDIT

public static final String TRANSITION_EDIT
Name of the edit transition.

See Also:
Constant Field Values

ATTRIBUTE_SESSION_KEY

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


REQUEST_ATTRIBUTES

public static final String REQUEST_ATTRIBUTES
Constant for where attributes are stored in the Request context.

See Also:
Constant Field Values
Constructor Detail

EditFinalState

public EditFinalState(String wizId,
                      String stepId)
               throws DBException
Default constructor.

Parameters:
wizId - The wizard id.
stepId - The Step Id.
Throws:
DBException - upon error.
Method Detail

renderCommonControls

protected Block renderCommonControls(WizStep stepDefinition,
                                     ExpressoRequest request,
                                     ExpressoResponse response)
                              throws ControllerException,
                                     DBException
Renders the controls that are common to each of the 'last definition' steps. These are Title Helptext Directive

Parameters:
stepDefinition - WizStep
request - ExpressoRequest
response - ExpressoResponse
Returns:
block instance containing input variables.
Throws:
ControllerException - upon Input rendering error.
DBException - upon DataObject.getField() error.

isNeedTransitionOnError

protected boolean isNeedTransitionOnError(ErrorCollection ec,
                                          ExpressoResponse response)
Returns true if we didn't try to save and we got an error collection. Then we should jump back once in the workflow.

Parameters:
ec - ErrorCollection to examine if we need to transition
response - ExpressoResponse the ExpressoResponse object.
Returns:
boolean true if we need to transition to some other prompt state.

buildAndStoreStepAttributes

protected Map buildAndStoreStepAttributes(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.

buildSaveAndReturnTransition

protected Transition buildSaveAndReturnTransition(WizStep step)
                                           throws DBException
Constructs the 'save and return' transition. Sub classes will need to add their own parameters to this transition because some edit pages have gone through different workflows and will have additional data attached to them. All WizStep fields to be modified should be sent with this parameter.

Parameters:
step - WizStep
Returns:
Transition that might be needed to have extra parameters if needed from other steps.
Throws:
DBException - upon getField() error.

buildEditTypeTransition

protected Transition buildEditTypeTransition(WizStep stepDefinition)
                                      throws ControllerException,
                                             DBException
Constructs a transition that determines the 'step type'.

Parameters:
stepDefinition - WizStep
Returns:
Transition
Throws:
DBException - upon DBObject.getField() Error
ControllerException - upon response.add() error.

addStepTypeLabel

protected void addStepTypeLabel(ExpressoResponse response,
                                WizStep step)
                         throws DBException,
                                ControllerException
Creates output for the text label of what type of step we're dealing with. Saves the output to the name "stepType"

Parameters:
response - ExpressoResponse the response to add the output to.
step - WizStep the step we're working with.
Throws:
DBException - upon database error.
ControllerException - upon controller error.


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