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.action.wfs;
06:
07: import org.apache.struts.action.ActionForm;
08: import org.apache.struts.action.ActionForward;
09: import org.apache.struts.action.ActionMapping;
10: import org.vfny.geoserver.action.ConfigAction;
11: import org.vfny.geoserver.config.WFSConfig;
12: import org.vfny.geoserver.form.wfs.WFSContentForm;
13: import org.vfny.geoserver.global.UserContainer;
14: import java.io.IOException;
15: import java.net.URL;
16: import javax.servlet.ServletException;
17: import javax.servlet.http.HttpServletRequest;
18: import javax.servlet.http.HttpServletResponse;
19:
20: /**
21: * DOCUMENT ME!
22: *
23: * @author rgould To change the template for this generated type comment go to
24: * Window>Preferences>Java>Code Generation>Code and Comments
25: */
26: public final class WFSContentAction extends ConfigAction {
27: public ActionForward execute(ActionMapping mapping,
28: ActionForm form, UserContainer user,
29: HttpServletRequest request, HttpServletResponse response)
30: throws IOException, ServletException {
31: WFSContentForm contentForm = (WFSContentForm) form;
32:
33: boolean enabled = contentForm.isEnabled();
34:
35: if (contentForm.isEnabledChecked() == false) {
36: enabled = false;
37: }
38:
39: boolean srsXmlStyle = contentForm.isSrsXmlStyle();
40:
41: if (contentForm.isSrsXmlStyleChecked() == false) {
42: srsXmlStyle = false;
43: }
44:
45: boolean citeConformanceHacks = contentForm
46: .getCiteConformanceHacks();
47:
48: if (contentForm.getCiteConformanceHacksChecked() == false) {
49: citeConformanceHacks = false; // deal with the way HTTP works.
50: }
51:
52: boolean featureBounding = contentForm.isFeatureBounding();
53:
54: if (contentForm.isFeatureBoundingChecked() == false) {
55: featureBounding = false;
56: }
57:
58: String onlineResource = contentForm.getOnlineResource();
59: String[] selectedFeatures = contentForm.getSelectedFeatures();
60: String[] features = contentForm.getFeatures();
61:
62: WFSConfig config = getWFSConfig();
63: config.setSrsXmlStyle(srsXmlStyle);
64: config.setEnabled(enabled);
65: config.setOnlineResource(new URL(onlineResource));
66: config.setServiceLevel(contentForm.getServiceLevel());
67: config.setCiteConformanceHacks(citeConformanceHacks);
68: config.setFeatureBounding(featureBounding);
69: getApplicationState().notifyConfigChanged();
70:
71: return mapping.findForward("config");
72: }
73: }
|