KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jmanage > webui > actions > app > GraphViewAction


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.app;
17
18 import org.apache.struts.action.ActionForm;
19 import org.apache.struts.action.ActionMapping;
20 import org.apache.struts.action.ActionForward;
21 import org.jmanage.webui.util.WebContext;
22 import org.jmanage.webui.util.RequestAttributes;
23 import org.jmanage.webui.actions.BaseAction;
24 import org.jmanage.core.config.ApplicationConfig;
25 import org.jmanage.core.config.GraphConfig;
26 import org.jmanage.core.services.AccessController;
27 import org.jmanage.core.util.ACLConstants;
28
29 import javax.servlet.http.HttpServletResponse JavaDoc;
30 import javax.servlet.http.HttpServletRequest JavaDoc;
31
32 /**
33  * Action class for the graph view page. This page contains the applet
34  * which pulls attriute values via MBeanAttributeValuesAction.
35  *
36  * @see MBeanAttributeValuesAction
37  *
38  * Date: Jun 12, 2005
39  * @author Rakesh Kalra
40  */

41 public class GraphViewAction extends BaseAction {
42
43     public ActionForward execute(WebContext context,
44                                  ActionMapping mapping,
45                                  ActionForm actionForm,
46                                  HttpServletRequest JavaDoc request,
47                                  HttpServletResponse JavaDoc response)
48         throws Exception JavaDoc{
49
50         ApplicationConfig appConfig = context.getApplicationConfig();
51         // graphs at cluster level are not yet supported
52
assert !appConfig.isCluster();
53
54         // todo: do we need access control for graphs? probably not.
55
//AccessController.checkAccess(context.getServiceContext(),
56
// ACLConstants.ACL_VIEW_APPLICATIONS);
57

58         GraphConfig graphConfig =
59                 appConfig.findGraph(request.getParameter("graphId"));
60         assert graphConfig != null;
61         request.setAttribute("graphConfig", graphConfig);
62
63         /*set current page for navigation*/
64         request.setAttribute(RequestAttributes.NAV_CURRENT_PAGE,
65                 graphConfig.getName());
66
67         return mapping.findForward("success");
68     }
69 }
70
Popular Tags