01: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
02: * This code is licensed under the GPL 2.0 license, availible at the root
03: * application directory.
04: */
05: package org.vfny.geoserver.form.data;
06:
07: import org.apache.struts.action.ActionErrors;
08: import org.apache.struts.action.ActionForm;
09: import org.apache.struts.action.ActionMapping;
10: import org.vfny.geoserver.config.DataConfig;
11: import java.util.Set;
12: import javax.servlet.ServletContext;
13: import javax.servlet.http.HttpServletRequest;
14:
15: /**
16: * DOCUMENT ME!
17: *
18: * @author $Author: Alessio Fabiani (alessio.fabiani@gmail.com) $ (last modification)
19: * @author $Author: Simone Giannecchini (simboss1@gmail.com) $ (last modification)
20: */
21: public class DataCoveragesSelectForm extends ActionForm {
22: /**
23: *
24: */
25: private static final long serialVersionUID = 1300704188707189533L;
26:
27: /**
28: *
29: */
30: private String selectedCoverageName;
31:
32: /**
33: *
34: */
35: private String buttonAction;
36:
37: public void reset(ActionMapping arg0, HttpServletRequest arg1) {
38: super .reset(arg0, arg1);
39: selectedCoverageName = "";
40: }
41:
42: public ActionErrors validate(ActionMapping mapping,
43: HttpServletRequest request) {
44: ActionErrors errors = new ActionErrors();
45:
46: return errors;
47: }
48:
49: /**
50: * DOCUMENT ME!
51: *
52: * @return Returns the selectedCoverageName.
53: */
54: public String getSelectedCoverageName() {
55: return selectedCoverageName;
56: }
57:
58: /**
59: * DOCUMENT ME!
60: *
61: * @param selectedCoverageName The selectedCoverageName to set.
62: */
63: public void setSelectedCoverageName(String selectedCoverageName) {
64: this .selectedCoverageName = selectedCoverageName;
65: }
66:
67: public Set getCoverageNames() {
68: ServletContext context = getServlet().getServletContext();
69: DataConfig config = (DataConfig) context
70: .getAttribute(DataConfig.CONFIG_KEY);
71:
72: return config.getCoverages().keySet();
73: }
74:
75: /**
76: * Access buttonAction property.
77: *
78: * @return Returns the buttonAction.
79: */
80: public String getButtonAction() {
81: return buttonAction;
82: }
83:
84: /**
85: * Set buttonAction to buttonAction.
86: *
87: * @param buttonAction The buttonAction to set.
88: */
89: public void setButtonAction(String buttonAction) {
90: this.buttonAction = buttonAction;
91: }
92: }
|