01: /**
02: * Copyright 2004-2005 jManage.org
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: */package org.jmanage.webui.actions.app;
16:
17: import org.apache.struts.action.ActionForm;
18: import org.apache.struts.action.ActionMapping;
19: import org.apache.struts.action.ActionForward;
20: import org.jmanage.webui.util.WebContext;
21: import org.jmanage.webui.util.Forwards;
22: import org.jmanage.webui.actions.BaseAction;
23: import org.jmanage.core.config.ApplicationConfig;
24: import org.jmanage.core.config.ApplicationConfigManager;
25: import org.jmanage.core.services.AccessController;
26: import org.jmanage.core.util.ACLConstants;
27:
28: import javax.servlet.http.HttpServletResponse;
29: import javax.servlet.http.HttpServletRequest;
30: import java.util.List;
31: import java.util.ArrayList;
32: import java.util.Iterator;
33:
34: /**
35: *
36: * date: Dec 15, 2004
37: * @author Rakesh Kalra
38: */
39: public class AppViewAction extends BaseAction {
40:
41: public ActionForward execute(WebContext context,
42: ActionMapping mapping, ActionForm actionForm,
43: HttpServletRequest request, HttpServletResponse response)
44: throws Exception {
45:
46: ApplicationConfig appConfig = context.getApplicationConfig();
47: AccessController.checkAccess(context.getServiceContext(),
48: ACLConstants.ACL_VIEW_APPLICATIONS);
49: if (appConfig.isCluster()) {
50: return mapping.findForward("cluster");
51: } else {
52: return mapping.findForward("application");
53: }
54: }
55: }
|