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.DataStoreConfig;
12: import org.vfny.geoserver.form.data.DataDataStoresNewForm;
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 DataStoreConfig based on user's input.
21: *
22: * <p>
23: * Will need to update the current DataStoreId as stored in session context.
24: * </p>
25: *
26: * @author User, Refractions Research, Inc.
27: * @author $Author: dmzwiers $ (last modification)
28: * @version $Id: DataDataStoresNewAction.java 6326 2007-03-15 18:36:40Z jdeolive $
29: */
30: public class DataDataStoresNewAction extends ConfigAction {
31: public ActionForward execute(ActionMapping mapping,
32: ActionForm form, UserContainer user,
33: HttpServletRequest request, HttpServletResponse response)
34: throws IOException, ServletException {
35: DataDataStoresNewForm newForm = (DataDataStoresNewForm) form;
36: DataStoreConfig newDataStoreConfig;
37:
38: newDataStoreConfig = new DataStoreConfig(newForm
39: .getDataStoreID(), newForm.getSelectedDescription());
40:
41: getUserContainer(request)
42: .setDataStoreConfig(newDataStoreConfig);
43:
44: return mapping.findForward("config.data.store.editor");
45: }
46: }
|