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.wcs;
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.WCSConfig;
12: import org.vfny.geoserver.form.wcs.WCSDescriptionForm;
13: import org.vfny.geoserver.global.UserContainer;
14: import java.io.IOException;
15: import java.util.ArrayList;
16: import java.util.Arrays;
17: import java.util.List;
18: import javax.servlet.ServletException;
19: import javax.servlet.http.HttpServletRequest;
20: import javax.servlet.http.HttpServletResponse;
21:
22: /**
23: * DOCUMENT ME!
24: *
25: * @author $Author: Alessio Fabiani (alessio.fabiani@gmail.com) $ (last modification)
26: * @author $Author: Simone Giannecchini (simboss1@gmail.com) $ (last modification)
27: */
28: public final class WCSDescriptionAction extends ConfigAction {
29: public ActionForward execute(ActionMapping mapping,
30: ActionForm form, UserContainer user,
31: HttpServletRequest request, HttpServletResponse response)
32: throws IOException, ServletException {
33: WCSDescriptionForm descriptionForm = (WCSDescriptionForm) form;
34:
35: String name = descriptionForm.getName();
36: String title = descriptionForm.getTitle();
37: String accessConstraints = descriptionForm
38: .getAccessConstraints();
39: String fees = descriptionForm.getFees();
40: String maintainer = descriptionForm.getMaintainer();
41: String keywords = descriptionForm.getKeywords();
42: String _abstract = descriptionForm.get_abstract();
43:
44: WCSConfig config = getWCSConfig();
45: config.setName(name);
46: config.setTitle(title);
47: config.setAccessConstraints(accessConstraints);
48: config.setFees(fees);
49: config.setMaintainer(maintainer);
50: config.setAbstract(_abstract);
51:
52: List array = (keywords != null) ? Arrays.asList(keywords
53: .split(System.getProperty("line.separator")))
54: : new ArrayList();
55:
56: config.setKeywords(array);
57: getApplicationState().notifyConfigChanged();
58:
59: return mapping.findForward("config");
60: }
61: }
|