KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jmanage > webui > actions > config > RemoveGraphAction


1 /**
2  * Copyright 2004-2005 jManage.org
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.jmanage.webui.actions.config;
17
18 import org.jmanage.webui.actions.BaseAction;
19 import org.jmanage.webui.util.WebContext;
20 import org.jmanage.webui.util.Forwards;
21 import org.jmanage.webui.util.RequestParams;
22 import org.jmanage.webui.util.Utils;
23 import org.jmanage.core.config.ApplicationConfig;
24 import org.jmanage.core.config.ApplicationConfigManager;
25 import org.jmanage.core.services.AccessController;
26 import org.apache.struts.action.ActionMapping;
27 import org.apache.struts.action.ActionForm;
28 import org.apache.struts.action.ActionForward;
29
30 import javax.servlet.http.HttpServletRequest JavaDoc;
31 import javax.servlet.http.HttpServletResponse JavaDoc;
32
33 /**
34  * Date: Sep 15, 2005 8:33:40 PM
35  * @author Bhavana
36  */

37 public class RemoveGraphAction extends BaseAction{
38     public ActionForward execute(WebContext context, ActionMapping mapping,
39                                      ActionForm form, HttpServletRequest JavaDoc request,
40                                      HttpServletResponse JavaDoc response)
41             throws Exception JavaDoc {
42         AccessController.checkAccess(Utils.getServiceContext(context),ACL_EDIT_GRAPH);
43         ApplicationConfig appConfig = context.getApplicationConfig();
44         if((appConfig.removeGraph(
45                 request.getParameter(RequestParams.GRAPH_ID))!=null)){
46             ApplicationConfigManager.updateApplication(appConfig);
47
48         }
49         return mapping.findForward(Forwards.SUCCESS);
50     }
51
52 }
53
Popular Tags