/** * * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.geronimo.console.welcome; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; import java.util.Map; import java.util.TreeMap; import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; import javax.portlet.PortletConfig; import javax.portlet.PortletException; import javax.portlet.PortletRequestDispatcher; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import javax.portlet.WindowState; import org.apache.geronimo.console.BasePortlet; import org.apache.geronimo.console.util.PortletManager; public class WelcomePortlet extends BasePortlet { private static final String NORMALVIEW_JSP = "/WEB-INF/view/welcome/welcomeNormal.jsp"; private static final String MAXIMIZEDVIEW_JSP = "/WEB-INF/view/welcome/welcomeMaximized.jsp"; private static final String HELPVIEW_JSP = "/WEB-INF/view/welcome/welcomeHelp.jsp"; private PortletRequestDispatcher normalView; private PortletRequestDispatcher maximizedView; private PortletRequestDispatcher helpView; public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException, IOException { } protected void doView(RenderRequest renderRequest, RenderResponse renderResponse) throws IOException, PortletException { if (WindowState.MINIMIZED.equals(renderRequest.getWindowState())) { return; } if (WindowState.NORMAL.equals(renderRequest.getWindowState())) { normalView.include(renderRequest, renderResponse); } else { maximizedView.include(renderRequest, renderResponse); } } protected void doHelp(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException { helpView.include(renderRequest, renderResponse); } public void init(PortletConfig portletConfig) throws PortletException { super.init(portletConfig); normalView = portletConfig.getPortletContext().getRequestDispatcher( NORMALVIEW_JSP); maximizedView = portletConfig.getPortletContext().getRequestDispatcher( MAXIMIZEDVIEW_JSP); helpView = portletConfig.getPortletContext().getRequestDispatcher( HELPVIEW_JSP); } public void destroy() { normalView = null; maximizedView = null; helpView = null; super.destroy(); } }