01: /*
02: * Created on Jan 22, 2004
03: *
04: * To change the template for this generated file go to
05: * Window - Preferences - Java - Code Generation - Code and Comments
06: */
07: package org.vfny.geoserver.form.validation;
08:
09: import org.apache.struts.action.ActionErrors;
10: import org.apache.struts.action.ActionForm;
11: import org.apache.struts.action.ActionMapping;
12: import org.vfny.geoserver.config.validation.TestSuiteConfig;
13: import org.vfny.geoserver.config.validation.ValidationConfig;
14: import java.util.SortedSet;
15: import java.util.TreeSet;
16: import javax.servlet.ServletContext;
17: import javax.servlet.http.HttpServletRequest;
18:
19: /**
20: * ValidationTestSelectForm purpose.
21: * <p>
22: * Description of ValidationTestSelectForm ...
23: * </p>
24: *
25: * @author rgould, Refractions Research, Inc.
26: * @author $Author: jive $ (last modification)
27: * @version $Id: ValidationTestSelectForm.java 6177 2007-02-19 10:11:27Z aaime $
28: */
29: public class ValidationTestSelectForm extends ActionForm {
30: private String selectedTest;
31: private String buttonAction;
32: private HttpServletRequest request;
33:
34: public void reset(ActionMapping arg0, HttpServletRequest request) {
35: super .reset(arg0, request);
36: selectedTest = "";
37: buttonAction = "";
38: this .request = request;
39: }
40:
41: public ActionErrors validate(ActionMapping mapping,
42: HttpServletRequest request) {
43: ActionErrors errors = new ActionErrors();
44:
45: return errors;
46: }
47:
48: public SortedSet getTests() {
49: ServletContext context = this .getServlet().getServletContext();
50: ValidationConfig validationConfig = (ValidationConfig) context
51: .getAttribute(ValidationConfig.CONFIG_KEY);
52: TestSuiteConfig suiteConfig = (TestSuiteConfig) request
53: .getSession().getAttribute(
54: TestSuiteConfig.CURRENTLY_SELECTED_KEY);
55:
56: return new TreeSet(suiteConfig.getTests().keySet());
57: }
58:
59: /**
60: * Access selectedTest property.
61: *
62: * @return Returns the selectedTest.
63: */
64: public String getSelectedTest() {
65: return selectedTest;
66: }
67:
68: /**
69: * Set selectedTest to selectedTest.
70: *
71: * @param selectedTest The selectedTest to set.
72: */
73: public void setSelectedTest(String selectedTest) {
74: this .selectedTest = selectedTest;
75: }
76:
77: /**
78: * Access buttonAction property.
79: *
80: * @return Returns the buttonAction.
81: */
82: public String getButtonAction() {
83: return buttonAction;
84: }
85:
86: /**
87: * Set buttonAction to buttonAction.
88: *
89: * @param buttonAction The buttonAction to set.
90: */
91: public void setButtonAction(String buttonAction) {
92: this.buttonAction = buttonAction;
93: }
94: }
|