com.sri.emo.wizard
Interface Wizard

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractWizard, BranchingWizard, ChainedSelectionWizard, EmoCompletionWizard, EmoCreationWizard, EmoCreationWizardOld, EmoSelectionWizard, SequentialWizard

public interface Wizard
extends Serializable

The interface for generic wizards. Often the actual operation of the wizard will be performed by another controller. The wizard provides more of a domain model for traversing a series of steps.

Author:
Michael Rimov

Method Summary
 WizardPage backupToPage(Serializable pageId)
          Allows programmatic rewinding to a previous page.
 WizardPage begin()
          Retrieve the first wizard page and initialize any special data for the Wizard.
 void destroy()
          De-initialize all data for the wizard.
 Map getAllData()
          Retrieve all the data for the wizard keyed by page id.
 WizardPage getCurrentPage()
          Retrieves a pointer to the current page in the wizard.
 Object getId()
          Retrieve the id of the Wizard.
 WizardPage getPageById(Serializable s)
          Retrieve a page by a given id.
 List getStepHistory()
          Retrieve all Pages in the order that the person has stepped through them.
 String getSummary()
          Retrieve the text summary of the wizard.
 String getTitle()
          Retrieve the title of the wizard.
 WizardPage next(WizardPage src, Serializable newData)
          Execute the next page in the wizard.
 WizardPage previous()
          Retrieve the first wizard page and initialize any special data for the Wizard.
 Object processFinish(WizardPage src, Serializable data, Map additonalParams)
          Processes the final finish and returns some sort of data that can be whatever is desired.
 

Method Detail

begin

WizardPage begin()
                 throws WizardException
Retrieve the first wizard page and initialize any special data for the Wizard.

Returns:
WizardPage instance.
Throws:
WizardException - upon error.

getCurrentPage

WizardPage getCurrentPage()
Retrieves a pointer to the current page in the wizard.

Returns:
Wizard Page instance
Throws:
IllegalStateException - if this is called before begin() is ever invoked.

getPageById

WizardPage getPageById(Serializable s)
Retrieve a page by a given id. The id is different dependong on the implementation.

Parameters:
s - Serializable the page key.
Returns:
WizardPage as defined.
Throws:
IllegalArgumentException - if s is null or the page given doesn't exist.

backupToPage

WizardPage backupToPage(Serializable pageId)
Allows programmatic rewinding to a previous page.

Parameters:
pageId - Serializable the page key.
Returns:
WizardPage the resulting page.

next

WizardPage next(WizardPage src,
                Serializable newData)
                throws WizardException
Execute the next page in the wizard.

Parameters:
newData - the data to post to the Wizard.
src - the source page of the next event.
Returns:
WizardPage instance.
Throws:
WizardException - upon error.

previous

WizardPage previous()
                    throws WizardException
Retrieve the first wizard page and initialize any special data for the Wizard.

Returns:
WizardPage instance.
Throws:
WizardException - upon error.

processFinish

Object processFinish(WizardPage src,
                     Serializable data,
                     Map additonalParams)
                     throws WizardException
Processes the final finish and returns some sort of data that can be whatever is desired. If using a web environment, the WizardController will put the object on the request context with the name "WizardResult"

Parameters:
src - WizardPage the source of the event.
data - Serializable the data given during wht wizard post.
additonalParams - anything that the underlying wizard needs. The values are set by the Application Controller.
Returns:
Object: whatever object the wizard returns after processing.
Throws:
WizardException - upon error.

destroy

void destroy()
             throws WizardException
De-initialize all data for the wizard.

Throws:
WizardException - upon destruction error.

getAllData

Map getAllData()
               throws WizardException
Retrieve all the data for the wizard keyed by page id.

Returns:
Map keyed by id.
Throws:
WizardException - upon error

getStepHistory

List getStepHistory()
                    throws WizardException
Retrieve all Pages in the order that the person has stepped through them.

Returns:
List of WizardPage objects.
Throws:
WizardException - if unable to query history.

getTitle

String getTitle()
Retrieve the title of the wizard.

Returns:
java.lang.String.

getSummary

String getSummary()
Retrieve the text summary of the wizard. May return null since summary attribute is optional.

Returns:
String or null if none is defined.

getId

Object getId()
Retrieve the id of the Wizard. Implementations may return null if they do not differentiate wizards by any id.

Returns:
Object any particular object.


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