1 package com.jcorporate.expresso.services.controller.configuration; 2 3 66 67 import com.jcorporate.expresso.core.controller.ControllerException; 68 import com.jcorporate.expresso.core.controller.ControllerRequest; 69 import com.jcorporate.expresso.core.controller.ControllerResponse; 70 import com.jcorporate.expresso.core.controller.ErrorCollection; 71 import com.jcorporate.expresso.core.controller.Output; 72 import com.jcorporate.expresso.core.controller.Transition; 73 import com.jcorporate.expresso.kernel.RootContainerInterface; 74 import com.jcorporate.expresso.services.controller.Configuration; 75 76 77 86 87 public class ShowComponent extends ConfigurationBase { 88 89 public ShowComponent() { 90 super(Configuration.STATE_SHOW_COMPONENT, "Show Component"); 91 } 92 93 public void run(ControllerRequest request, ControllerResponse response) 94 throws com.jcorporate.expresso.core.controller.NonHandleableException, 95 com.jcorporate.expresso.core.controller.ControllerException { 96 super.run(request, response); 97 response.setTitle("Show Component"); 98 99 RootContainerInterface root = this.getRuntime(request); 100 101 if (root == null) { 102 displayNoRuntime(request, response); 103 return; 104 } 105 106 } 107 108 public void displayNoRuntime(ControllerRequest requset, ControllerResponse response) 109 throws ControllerException { 110 111 ErrorCollection ec = new ErrorCollection(); 112 ec.addError("There is no runtime available by this name"); 113 response.saveErrors(ec); 114 115 response.add(new Output("title", "Need Expresso Runtime Created")); 116 response.add(new Output("message", "There are no Expresso runtimes " + 117 "currently installed in the system. Please run the 'Create Settings Wizard'" 118 + "to create a runtime that can be configured")); 119 120 Transition t = new Transition("startWiz", "Run Create Settings Wizard", 121 com.jcorporate.expresso.services.controller.configuration.CreateSettingsWizard.class, 122 "start"); 123 response.add(t); 124 response.setStyle("noruntime"); 125 } 126 } | Popular Tags |