1 16 19 20 package org.apache.pluto.portalImpl.core; 21 22 import javax.portlet.PortletMode; 23 import javax.portlet.WindowState; 24 import javax.servlet.ServletConfig ; 25 import javax.servlet.http.HttpServletRequest ; 26 27 import org.apache.pluto.om.window.PortletWindow; 28 import org.apache.pluto.services.information.PortletActionProvider; 29 30 public class PortletActionProviderImpl implements PortletActionProvider { 31 32 33 private HttpServletRequest request; 34 private PortletWindow portletWindow; 35 36 public PortletActionProviderImpl(HttpServletRequest request, 37 ServletConfig config, 38 PortletWindow portletWindow) 39 { 40 this.request = request; 41 this.portletWindow = portletWindow; 42 } 43 44 46 49 public void changePortletMode(PortletMode mode) 50 { 51 PortalEnvironment env = PortalEnvironment.getPortalEnvironment(request); 52 53 PortalURL url = env.getRequestedPortalURL(); 54 PortalControlParameter controlURL = new PortalControlParameter(url); 55 if (!(controlURL.getMode(portletWindow).equals(mode)) && mode != null) { 56 controlURL.setMode(portletWindow, mode); 57 env.changeRequestedPortalURL(url, controlURL); 58 } 59 } 60 61 64 public void changePortletWindowState(WindowState state) 65 { 66 PortalEnvironment env = (PortalEnvironment) request.getAttribute(PortalEnvironment.REQUEST_PORTALENV); 67 68 PortalURL url = env.getRequestedPortalURL(); 69 PortalControlParameter controlURL = new PortalControlParameter(url); 70 71 if (!(controlURL.getState(portletWindow).equals(state)) && state != null) { 72 controlURL.setState(portletWindow, state); 73 env.changeRequestedPortalURL(url, controlURL); 74 } 75 } 76 77 } 78 | Popular Tags |