pt.digitalis.dif.presentation.views.jsp.entities
Class AbstractWizardStage

java.lang.Object
  extended by pt.digitalis.dif.presentation.views.jsp.entities.AbstractWizardStage
Direct Known Subclasses:
AbstractWizardDemo2

public abstract class AbstractWizardStage
extends Object

A wizard stage base class. Implements all the necessary wizard logic, to help create the wizard base stages.

Author:
Pedro Viegas pviegas@digitalis.pt
Created on:
Jan 26, 2009

Field Summary
protected  pt.digitalis.utils.config.IConfigurations config
          The configurations resource
protected  pt.digitalis.dif.controller.interfaces.IDIFContext context
          The current stage context
protected  pt.digitalis.dif.dem.objects.parameters.errors.ParameterErrors errors
          Injects the parameter error report
 
Constructor Summary
AbstractWizardStage()
           
 
Method Summary
protected  pt.digitalis.dif.dem.objects.ViewObject cancel(pt.digitalis.dif.controller.interfaces.IDIFContext context, int currentStep)
          Cancel operation execution method.
protected  boolean canFinish()
          Validates custom rules for enabling the finish option.
 pt.digitalis.dif.dem.objects.ViewObject execute()
          The stage execution logic method.
protected abstract  pt.digitalis.dif.dem.objects.ViewObject finish(pt.digitalis.dif.controller.interfaces.IDIFContext context, int currentStep)
          Finish wizard execution method.
protected  WizardStepItem getActiveStep()
           
protected  WizardStepItem getStep(int step)
           
protected  int getTotalSteps()
           
 WizardDefinition getWizardDefinition()
           
protected  boolean hasIndexStep()
           
protected abstract  WizardDefinition initializeWizardDefinition(WizardDefinition def)
           
protected  boolean isCurrentStepSubmit()
           
protected  boolean isStepAccessible(int stepNumber)
          Validates custom rules for displaying a given step as accessible.
protected  boolean isStepEnabled(int stepNumber)
          Validates custom rules enabling a specific step.
protected  pt.digitalis.dif.dem.objects.ViewObject wizardStepEnter(pt.digitalis.dif.controller.interfaces.IDIFContext context, int currentStep)
          Should be implemented with the current wizard step execution logic.
protected abstract  pt.digitalis.dif.dem.objects.ViewObject wizardStepSubmit(pt.digitalis.dif.controller.interfaces.IDIFContext context, int currentStep)
          Should be implemented with the current wizard step execution logic.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected pt.digitalis.utils.config.IConfigurations config
The configurations resource


context

protected pt.digitalis.dif.controller.interfaces.IDIFContext context
The current stage context


errors

protected pt.digitalis.dif.dem.objects.parameters.errors.ParameterErrors errors
Injects the parameter error report

Constructor Detail

AbstractWizardStage

public AbstractWizardStage()
Method Detail

cancel

protected pt.digitalis.dif.dem.objects.ViewObject cancel(pt.digitalis.dif.controller.interfaces.IDIFContext context,
                                                         int currentStep)
Cancel operation execution method.

Parameters:
context - the current stage context
currentStep - the wizards current execution step
Returns:
the resulting view or null for default

canFinish

protected boolean canFinish()
Validates custom rules for enabling the finish option. By default it is enabled with the current step is the last one.

Returns:
T if is accessible, F otherwise

isCurrentStepSubmit

protected final boolean isCurrentStepSubmit()
Returns:
T if the current stage execution represents a current stage step data submit, F is it is a normal redirect from another step.

execute

public final pt.digitalis.dif.dem.objects.ViewObject execute()
The stage execution logic method.

Returns:
the resulting view or null for default

finish

protected abstract pt.digitalis.dif.dem.objects.ViewObject finish(pt.digitalis.dif.controller.interfaces.IDIFContext context,
                                                                  int currentStep)
Finish wizard execution method.

Parameters:
context - the current stage context
currentStep - the wizards current execution step
Returns:
the resulting view or null for default

getActiveStep

protected final WizardStepItem getActiveStep()
Returns:
the currently active wizard step definition

getStep

protected final WizardStepItem getStep(int step)
Parameters:
step - the desired step
Returns:
the currently active wizard step definition, or null if inexistent

getTotalSteps

protected final int getTotalSteps()
Returns:
the number of registered wizard steps

getWizardDefinition

public final WizardDefinition getWizardDefinition()
Returns:
the wizard definition object

hasIndexStep

protected final boolean hasIndexStep()
Returns:
T if the current wizard has an index page

initializeWizardDefinition

protected abstract WizardDefinition initializeWizardDefinition(WizardDefinition def)
Parameters:
def - the WizardDefinition object to initialize
Returns:
the wizard definition with all specific steps information

isStepAccessible

protected boolean isStepAccessible(int stepNumber)
Validates custom rules for displaying a given step as accessible.

Parameters:
stepNumber - the step to validate access to
Returns:
T if is accessible, F otherwise

isStepEnabled

protected boolean isStepEnabled(int stepNumber)
Validates custom rules enabling a specific step.

Parameters:
stepNumber - the step to validate access to
Returns:
T if is accessible, F otherwise

wizardStepEnter

protected pt.digitalis.dif.dem.objects.ViewObject wizardStepEnter(pt.digitalis.dif.controller.interfaces.IDIFContext context,
                                                                  int currentStep)
Should be implemented with the current wizard step execution logic. This is called when the user enters this step, not when it submit's it. All validation should have already occurred and execution is validated

Parameters:
context - the current stage context
currentStep - the wizards current execution step
Returns:
the resulting view or null for default

wizardStepSubmit

protected abstract pt.digitalis.dif.dem.objects.ViewObject wizardStepSubmit(pt.digitalis.dif.controller.interfaces.IDIFContext context,
                                                                            int currentStep)
Should be implemented with the current wizard step execution logic. This is called when the user submit's this step, not when he enters it. All validation should have already occurred and execution is validated

Parameters:
context - the current stage context
currentStep - the wizards current execution step
Returns:
the resulting view or null for default


Copyright © 2009 Digitalis Informática Lda. All Rights Reserved.