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.data;
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.CoverageStoreConfig;
12: import org.vfny.geoserver.form.data.CoverageStoresNewForm;
13: import org.vfny.geoserver.global.UserContainer;
14: import java.io.IOException;
15: import javax.servlet.ServletException;
16: import javax.servlet.http.HttpServletRequest;
17: import javax.servlet.http.HttpServletResponse;
18:
19: /**
20: * Create a new CoverageStoreConfig based on user's input.
21: *
22: * <p>
23: * Will need to update the current DataFormatId as stored in session context.
24: * </p>
25: *
26: * @author User, Refractions Research, Inc.
27: * @author dmzwiers
28: * @author $Author: Alessio Fabiani (alessio.fabiani@gmail.com) $ (last modification)
29: * @author $Author: Simone Giannecchini (simboss1@gmail.com) $ (last modification)
30: * @version $Id: CoverageStoresNewAction.java 6326 2007-03-15 18:36:40Z jdeolive $
31: */
32: public final class CoverageStoresNewAction extends ConfigAction {
33: public ActionForward execute(ActionMapping mapping,
34: ActionForm form, UserContainer user,
35: HttpServletRequest request, HttpServletResponse response)
36: throws IOException, ServletException {
37: final CoverageStoresNewForm newForm = (CoverageStoresNewForm) form;
38: final CoverageStoreConfig newFormatConfig;
39: newFormatConfig = new CoverageStoreConfig(newForm
40: .getDataFormatID(), newForm.getSelectedDescription());
41: getUserContainer(request).setDataFormatConfig(newFormatConfig);
42:
43: return mapping.findForward("config.data.format.editor");
44: }
45: }
|