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.SortedSet;
12: import java.util.TreeSet;
13: import javax.servlet.http.HttpServletRequest;
14:
15: /**
16: * DataCoveragesNewForm purpose.
17: *
18: * @author rgould, Refractions Research, Inc.
19: * @author dmzwiers
20: * @author $Author: Alessio Fabiani (alessio.fabiani@gmail.com) $ (last modification)
21: * @author $Author: Simone Giannecchini (simboss1@gmail.com) $ (last modification)
22: */
23: public class DataCoveragesNewForm extends ActionForm {
24: /**
25: *
26: */
27: private static final long serialVersionUID = 2866636958005021322L;
28:
29: /**
30: *
31: */
32: String selectedNewCoverage;
33:
34: /**
35: *
36: */
37: HttpServletRequest request;
38:
39: public SortedSet getNewCoverages() {
40: DataConfig dataConfig = (DataConfig) request.getSession()
41: .getServletContext()
42: .getAttribute(DataConfig.CONFIG_KEY);
43:
44: TreeSet out = new TreeSet(dataConfig
45: .getCoverageIdentifiers(getServlet()
46: .getServletContext()));
47: out.removeAll(dataConfig.getCoverages().keySet());
48:
49: return out;
50: }
51:
52: public void reset(ActionMapping arg0, HttpServletRequest request) {
53: super .reset(arg0, request);
54: this .request = request;
55:
56: selectedNewCoverage = "";
57: }
58:
59: public ActionErrors validate(ActionMapping mapping,
60: HttpServletRequest request) {
61: ActionErrors errors = new ActionErrors();
62:
63: return errors;
64: }
65:
66: /**
67: * Access selectedNewCoverage property.
68: *
69: * @return Returns the selectedNewCoverage.
70: */
71: public String getSelectedNewCoverage() {
72: return selectedNewCoverage;
73: }
74:
75: /**
76: * Set selectedNewCoverage to selectedNewCoverage.
77: *
78: * @param selectedNewCoverage The selectedNewCoverage to set.
79: */
80: public void setSelectedNewCoverage(String selectedNewCoverage) {
81: this.selectedNewCoverage = selectedNewCoverage;
82: }
83: }
|