Package org.jasig.portal.container.servlet

Examples of org.jasig.portal.container.servlet.ServletRequestImpl


                }
                cd.setUserInfo(userInfo);
            }
           
            // Wrap the request
            ServletRequestImpl wrappedRequest = new ServletRequestImpl(pcs.getHttpServletRequest(), sd.getPerson(), portletDefinition.getInitSecurityRoleRefSet());
            
            // Now create the PortletWindow and hold a reference to it
            PortletWindowImpl portletWindow = new PortletWindowImpl();
            portletWindow.setId(sd.getChannelSubscribeId());
            portletWindow.setPortletEntity(portletEntity);
View Full Code Here


            final PortletWindowImpl portletWindow = (PortletWindowImpl)cd.getPortletWindow();
            final PortletEntity portletEntity = portletWindow.getPortletEntity();
            final PortletDefinition portletDef = portletEntity.getPortletDefinition();
            final HttpServletRequest baseRequest = pcs.getHttpServletRequest();

            HttpServletRequest wrappedRequest = new ServletRequestImpl(baseRequest, sd.getPerson(), portletDef.getInitSecurityRoleRefSet());
           
            //Wrap the request to scope attributes to this portlet instance
            wrappedRequest = new PortletAttributeRequestWrapper(wrappedRequest);
           
            //Set up request attributes (user info, portal session, etc...)
            setupRequestAttributes(wrappedRequest, uid);

            // Put the current runtime data and wrapped request into the portlet window
            portletWindow.setChannelRuntimeData(rd);
            portletWindow.setHttpServletRequest(wrappedRequest);

            // Get the portlet url manager which will analyze the request parameters
            DynamicInformationProvider dip = InformationProviderAccess.getDynamicProvider(wrappedRequest);
            PortletStateManager psm = ((DynamicInformationProviderImpl)dip).getPortletStateManager(portletWindow);
            PortletActionProvider pap = dip.getPortletActionProvider(portletWindow);

            //If portlet is rendering as root, change mode to maximized, otherwise minimized
            WindowState newWindowState = cd.getNewWindowState();
            if (!psm.isAction() && rd.isRenderingAsRoot()) {
                if (WindowState.MINIMIZED.equals(newWindowState)) {
                    pap.changePortletWindowState(WindowState.MINIMIZED);
                }
                else {
                    pap.changePortletWindowState(WindowState.MAXIMIZED);
                }
            } else if (newWindowState != null) {
                pap.changePortletWindowState(newWindowState);
            }
            else if (!psm.isAction()) {
                pap.changePortletWindowState(WindowState.NORMAL);
            }
            cd.setNewWindowState(null);

            //Check for a portlet mode change
            PortletMode newMode = cd.getNewPortletMode();
            if (newMode != null) {
                pap.changePortletMode(newMode);
                PortletStateManager.setMode(portletWindow, newMode);
            }
            cd.setNewPortletMode(null);

            // Process action if this is the targeted channel and the URL is an action URL
            if (rd.isTargeted() && psm.isAction()) {
                //Create a sink to throw out and output (portlets can't output content during an action)
                PrintWriter pw = new PrintWriter(new NullOutputStream());
                HttpServletResponse wrappedResponse = ServletObjectAccess.getStoredServletResponse(pcs.getHttpServletResponse(), pw);

                try {
                    //See if a WindowState change was requested for an ActionURL
                    final String newWindowStateName = wrappedRequest.getParameter(PortletStateManager.UP_WINDOW_STATE);
                    if (newWindowStateName != null) {
                        pap.changePortletWindowState(new WindowState(newWindowStateName));
                    }

                    HttpServletRequest wrappedPortletRequest = new PortletParameterRequestWrapper(wrappedRequest);
View Full Code Here

            final PortletWindowImpl portletWindow = (PortletWindowImpl)cd.getPortletWindow();
            final PortletEntity portletEntity = portletWindow.getPortletEntity();
            final PortletDefinition portletDef = portletEntity.getPortletDefinition();
            final HttpServletRequest baseRequest = pcs.getHttpServletRequest();

            HttpServletRequest wrappedRequest = new ServletRequestImpl(baseRequest, sd.getPerson(), portletDef.getInitSecurityRoleRefSet());
           
            //Wrap the request to scope attributes to this portlet instance
            wrappedRequest = new PortletAttributeRequestWrapper(wrappedRequest);
           
            //Set up request attributes (user info, portal session, etc...)
            setupRequestAttributes(wrappedRequest, uid);

           
            final StringWriter sw = new StringWriter();
            HttpServletResponse wrappedResponse = ServletObjectAccess.getStoredServletResponse(pcs.getHttpServletResponse(), new PrintWriter(sw));
          
                                               
            //Use the parameters from the last request so the portlet maintains it's state
            final ChannelRuntimeData rd = channelState.getRuntimeData();
            final String sessionParamsKey = REQUEST_PARAMS_KEY + "." + uid;
            if (!rd.isTargeted()) {
                final HttpSession portalSession = pcs.getHttpServletRequest().getSession(false);
               
                final Map requestParams;
                if (portalSession != null) {
                    requestParams = (Map)portalSession.getAttribute(sessionParamsKey);
                }
                else {
                    requestParams = null;
                }

                wrappedRequest = new DummyParameterRequestWrapper(wrappedRequest, requestParams);
            }
            //Hide the request parameters if this portlet isn't targeted
            else {
                wrappedRequest = new PortletParameterRequestWrapper(wrappedRequest);

                final HttpSession portalSession = pcs.getHttpServletRequest().getSession(true);
                portalSession.setAttribute(sessionParamsKey, wrappedRequest.getParameterMap());
            }

            portletContainer.renderPortlet(portletWindow, wrappedRequest, wrappedResponse);
           
            //Support for the portlet modifying it's cache timeout
View Full Code Here

            final PortletWindowImpl portletWindow = (PortletWindowImpl)cd.getPortletWindow();
            final PortletEntity portletEntity = portletWindow.getPortletEntity();
            final PortletDefinition portletDef = portletEntity.getPortletDefinition();
            final HttpServletRequest baseRequest = pcs.getHttpServletRequest();

            HttpServletRequest wrappedRequest = new ServletRequestImpl(baseRequest, sd.getPerson(), portletDef.getInitSecurityRoleRefSet());
           
            //Wrap the request to scope attributes to this portlet instance
            wrappedRequest = new PortletAttributeRequestWrapper(wrappedRequest);
           
            //Set up request attributes (user info, portal session, etc...)
View Full Code Here

TOP

Related Classes of org.jasig.portal.container.servlet.ServletRequestImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.