01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.geronimo.console.welcome;
17:
18: import java.io.IOException;
19: import java.util.ArrayList;
20: import java.util.List;
21: import java.util.StringTokenizer;
22: import java.util.Map;
23: import java.util.TreeMap;
24:
25: import javax.portlet.ActionRequest;
26: import javax.portlet.ActionResponse;
27: import javax.portlet.PortletConfig;
28: import javax.portlet.PortletException;
29: import javax.portlet.PortletRequestDispatcher;
30: import javax.portlet.RenderRequest;
31: import javax.portlet.RenderResponse;
32: import javax.portlet.WindowState;
33:
34: import org.apache.geronimo.console.BasePortlet;
35: import org.apache.geronimo.console.util.PortletManager;
36:
37: public class WelcomePortlet extends BasePortlet {
38:
39: private static final String NORMALVIEW_JSP = "/WEB-INF/view/welcome/welcomeNormal.jsp";
40:
41: private static final String MAXIMIZEDVIEW_JSP = "/WEB-INF/view/welcome/welcomeMaximized.jsp";
42:
43: private static final String HELPVIEW_JSP = "/WEB-INF/view/welcome/welcomeHelp.jsp";
44:
45: private PortletRequestDispatcher normalView;
46:
47: private PortletRequestDispatcher maximizedView;
48:
49: private PortletRequestDispatcher helpView;
50:
51: public void processAction(ActionRequest actionRequest,
52: ActionResponse actionResponse) throws PortletException,
53: IOException {
54: }
55:
56: protected void doView(RenderRequest renderRequest,
57: RenderResponse renderResponse) throws IOException,
58: PortletException {
59: if (WindowState.MINIMIZED
60: .equals(renderRequest.getWindowState())) {
61: return;
62: }
63:
64: if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
65: normalView.include(renderRequest, renderResponse);
66: } else {
67: maximizedView.include(renderRequest, renderResponse);
68: }
69: }
70:
71: protected void doHelp(RenderRequest renderRequest,
72: RenderResponse renderResponse) throws PortletException,
73: IOException {
74: helpView.include(renderRequest, renderResponse);
75: }
76:
77: public void init(PortletConfig portletConfig)
78: throws PortletException {
79: super .init(portletConfig);
80: normalView = portletConfig.getPortletContext()
81: .getRequestDispatcher(NORMALVIEW_JSP);
82: maximizedView = portletConfig.getPortletContext()
83: .getRequestDispatcher(MAXIMIZEDVIEW_JSP);
84: helpView = portletConfig.getPortletContext()
85: .getRequestDispatcher(HELPVIEW_JSP);
86: }
87:
88: public void destroy() {
89: normalView = null;
90: maximizedView = null;
91: helpView = null;
92: super.destroy();
93: }
94:
95: }
|