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: * DataFeatureTypesNewForm purpose.
17: *
18: * @author rgould, Refractions Research, Inc.
19: * @author $Author: dmzwiers $ (last modification)
20: * @version $Id: DataFeatureTypesNewForm.java 6326 2007-03-15 18:36:40Z jdeolive $
21: */
22: public class DataFeatureTypesNewForm extends ActionForm {
23: String selectedNewFeatureType;
24: HttpServletRequest request;
25:
26: public SortedSet getNewFeatureTypes() {
27: DataConfig dataConfig = (DataConfig) request.getSession()
28: .getServletContext()
29: .getAttribute(DataConfig.CONFIG_KEY);
30:
31: TreeSet out = new TreeSet(dataConfig
32: .getFeatureTypeIdentifiers(getServlet()
33: .getServletContext()));
34: out.removeAll(dataConfig.getFeaturesTypes().keySet());
35:
36: return out;
37: }
38:
39: public void reset(ActionMapping arg0, HttpServletRequest request) {
40: super .reset(arg0, request);
41: this .request = request;
42:
43: selectedNewFeatureType = "";
44: }
45:
46: public ActionErrors validate(ActionMapping mapping,
47: HttpServletRequest request) {
48: ActionErrors errors = new ActionErrors();
49:
50: return errors;
51: }
52:
53: /**
54: * Access selectedNewFeatureType property.
55: *
56: * @return Returns the selectedNewFeatureType.
57: */
58: public String getSelectedNewFeatureType() {
59: return selectedNewFeatureType;
60: }
61:
62: /**
63: * Set selectedNewFeatureType to selectedNewFeatureType.
64: *
65: * @param selectedNewFeatureType The selectedNewFeatureType to set.
66: */
67: public void setSelectedNewFeatureType(String selectedNewFeatureType) {
68: this.selectedNewFeatureType = selectedNewFeatureType;
69: }
70: }
|