View Javadoc

1   package com.sri.emo.wizard.wizardgateway;
2   
3   import com.jcorporate.expresso.core.controller.State;
4   import com.jcorporate.expresso.core.dbobj.DBObject;
5   import com.sri.common.controller.AbstractComponentController;
6   import com.sri.emo.EmoSchema;
7   import com.sri.emo.wizard.expressoimpl.WizardController;
8   
9   /***
10   * WizardGatewayControlller provides dispatching and isolation of the various
11   * underlying wizard types by allowing different editors to be hidden underneath
12   * the gateway.
13   *
14   * @author Michael Rimov
15   * @version 1.0
16   */
17  public class WizardGatewayController extends AbstractComponentController {
18  
19      /***
20  	 * 
21  	 */
22  	private static final long serialVersionUID = 1L;
23  
24  	/***
25       * Registers all the state handlers for resolving upon controller request.
26       */
27      public WizardGatewayController() {
28          super(EmoSchema.class);
29  
30          this.addStateHandler(ListWizards.STATE_NAME, ListWizards.STATE_DESCRIPTION, ListWizards.class);
31          this.setInitialState(ListWizards.STATE_NAME);
32  
33          State s = addStateHandler(EditWizard.STATE_NAME, EditWizard.STATE_DESCRIPTION, EditWizard.class);
34          s.addParameter(WizardController.WIZ_PARAMETER_ID, true, DBObject.INT_MASK);
35  
36          s = addStateHandler(PromptDeleteWizard.STATE_NAME, PromptDeleteWizard.STATE_DESCRIPTION,
37                  PromptDeleteWizard.class);
38          s.addParameter(WizardController.WIZ_PARAMETER_ID, true, DBObject.INT_MASK);
39  
40  
41          s = addStateHandler(DoDeleteWizard.STATE_NAME, DoDeleteWizard.STATE_DESCRIPTION, DoDeleteWizard.class);
42          s.addParameter(WizardController.WIZ_PARAMETER_ID, true, DBObject.INT_MASK);
43  
44          s = addStateHandler(PromptAddWizard.STATE_NAME, PromptAddWizard.STATE_DESCRIPTION, PromptAddWizard.class);
45  
46          s = addStateHandler(DoAddWizard.STATE_NAME, DoAddWizard.STATE_DESCRIPTION, DoAddWizard.class);
47          s.addRequiredParameter(AddWizardHandler.PARAM_WIZARD_TYPE);
48  
49          s = addStateHandler(RunWizard.STATE_NAME, RunWizard.STATE_DESCRIPTION, RunWizard.class);
50          s.addParameter(WizardController.WIZ_PARAMETER_ID, true, DBObject.INT_MASK);
51      }
52  
53  
54  }