protected PortletWindow getPortletWindow() { return requestContext.getPortletWindow(); }
@Override protected IPortletEntity getInitializationContext() { final HttpServletRequest containerRequest = this.portletRequestContext.getContainerRequest(); return this.portletEntityRegistry.getPortletEntity(containerRequest, portletEntityId); }
private boolean isPortletScopeSessionConfigured(PortletRequestContext requestContext) { boolean portletScopeSessionConfigured = false; PortletConfig portletConfig = requestContext.getPortletConfig(); Map<String, String[]> containerRuntimeOptions = portletConfig.getContainerRuntimeOptions(); String[] values = containerRuntimeOptions.get("javax.portlet.servletDefaultSessionScope"); if (values != null && values.length > 0) { portletScopeSessionConfigured = "PORTLET_SCOPE".equals(values[0]); } return portletScopeSessionConfigured; }
txt.append("\nRequest wrapper stack: "); ServletRequest wreq = request; ServletRequest tstreq = requestContext.getServletRequest(); int n = 1; while (wreq instanceof ServletRequestWrapper) { ServletResponse tstresp = requestContext.getServletResponse(); n = 1; while (wresp instanceof ServletResponseWrapper) { HttpServletResponse hresp = requestContext.getServletResponse(); requestContext.init(portletConfig, getServletContext(), hreq, hresp, responseContext); requestContext.setAsyncServletRequest(request); // store original request responseContext.init(portletConfig, hreq, hresp); requestContext.init(portletConfig, getServletContext(), request, response, responseContext); requestContext.setExecutingRequestBody(true); responseContext.init(portletConfig, request, response); PortletWindow window = requestContext.getPortletWindow(); String rh = requestContext.getRenderHeaders(); if (rh != null) { renderRequest.setAttribute(PortletRequest.RENDER_PART, rh); requestContext.setExecutingRequestBody(false); LOG.debug("Async not being processed, releasing resources. executing req body: " + requestContext.isExecutingRequestBody());
String portletWindowId = requestContext.getPortletWindow().getId().getStringId(); session = ServletPortletSessionProxy.createProxy(requestContext.getServletRequest(), portletWindowId); HttpServletPortletRequestWrapper req = getWrappedRequest(requestContext.getServletRequest()); HttpServletPortletResponseWrapper res = getWrappedResponse(requestContext.getServletResponse()); req = new HttpServletPortletRequestWrapper(requestContext.getServletRequest(),session, request); res = new HttpServletPortletResponseWrapper(requestContext.getServletResponse(), request, response, included); boolean executingReqBody = requestContext.isExecutingRequestBody(); requestContext.setExecutingRequestBody(false); request.setAttribute(PortletInvokerService.PORTLET_CONFIG, requestContext.getPortletConfig()); request.setAttribute(PortletInvokerService.PORTLET_REQUEST, request); request.setAttribute(PortletInvokerService.PORTLET_RESPONSE, response); request.removeAttribute(PortletInvokerService.PORTLET_REQUEST); request.removeAttribute(PortletInvokerService.PORTLET_RESPONSE); requestContext.setExecutingRequestBody(executingReqBody); req.endDispatch();
PortletWindowImpl window = (PortletWindowImpl)requestContext.getPortletWindow(); HttpServletRequest request = requestContext.getContainerRequest(); HttpServletResponse response = requestContext.getContainerResponse(); requestContext.init(window.getPortletInstance().getConfig(), this.jetspeedContext, request, response); window.getPortletResponseContext().init(request, response);
@Override public PortletPreferences createPortletPreferences( final PortletRequestContext requestContext, boolean render) { final HttpServletRequest containerRequest = requestContext.getContainerRequest(); final PortletWindow plutoPortletWindow = requestContext.getPortletWindow(); final IPortletWindow portletWindow = portletWindowRegistry.convertPortletWindow(containerRequest, plutoPortletWindow);
this.windowId = requestContext.getPortletWindow().getId().getStringId(); txt.append("requestContext null: ").append(requestContext == null); if (requestContext != null) { txt.append(", portletConfig null: ").append(requestContext.getPortletConfig() == null); Map<String, String[]> options = requestContext.getPortletConfig().getContainerRuntimeOptions(); String[] vals = null; if (options != null) { synchronized (LOCK) { PortletSession ps = requestContext.getPortletSession(true); if (active && ps != null) { sessionData = (SessionData) ps.getAttribute(ATTRIB_NAME);
return requestContext.getServletRequest(); } else if (name.equals("javax.portlet.debug.ServletResponse")) { return requestContext.getServletResponse(); } else if (name.equals("javax.portlet.debug.ServletContext")) { return requestContext.getServletContext(); return requestContext.getAttribute(name);
throws PortletException, IOException PortletWindowImpl window = (PortletWindowImpl)requestContext.getPortletWindow(); PortletDefinition portletDefinition = window.getPortletDefinition(); PortletApplication app = portletDefinition.getApplication(); window.setAttribute(PortalReservedParameters.PORTLET_FILTER_MANAGER_ATTRIBUTE, filter); ServletRequest request = this.requestResponseUnwrapper.unwrapContainerRequest(requestContext.getContainerRequest()); ServletResponse response = this.requestResponseUnwrapper.unwrapContainerResponse(requestContext.getContainerResponse());
public HttpServletRequest getHttpServletRequest(GenericPortlet portlet, PortletRequest request) { PortletWindow window = Jetspeed.getCurrentRequestContext().getCurrentPortletWindow(); HttpServletRequest req = (HttpServletRequest)window.getAttribute(SERVLET_REQUEST); if (req == null) { PortletRequestContext rc = window.getPortletRequestContext(); req = requestDispatcherService.getRequestWrapper(rc.getServletContext(), rc.getServletRequest(), request, null, true, false); req.setAttribute(ContainerConstants.PORTLET_CONFIG, rc.getPortletConfig()); req.setAttribute(ContainerConstants.PORTLET_REQUEST, window.getPortletRequest()); req.setAttribute(ContainerConstants.PORTLET_RESPONSE, window.getPortletResponse()); window.setAttribute(SERVLET_REQUEST, req); } return req; }
public HttpServletPortletRequestWrapper(HttpServletRequest hreq, HttpSession session, PortletRequest preq) { super(hreq); this.preq = preq; this.session = session; reqctx = (PortletRequestContext) preq.getAttribute(PortletInvokerService.REQUEST_CONTEXT); this.mapper = reqctx.getContainer().getContainerServices().getNamespaceMapper(); this.winId = reqctx.getPortletWindow().getId(); this.phase = (String) preq.getAttribute(PortletRequest.LIFECYCLE_PHASE); }
public HttpServletResponse getHttpServletResponse(GenericPortlet portlet, PortletResponse response) { PortletWindow window = Jetspeed.getCurrentRequestContext().getCurrentPortletWindow(); HttpServletResponse res = (HttpServletResponse)window.getAttribute(SERVLET_RESPONSE); if (res == null) { boolean included = window.getAttribute(PortalReservedParameters.PORTLET_CONTAINER_INVOKER_USE_FORWARD) == null; PortletRequestContext rc = window.getPortletRequestContext(); res = requestDispatcherService.getResponseWraper(rc.getServletContext(), rc.getServletResponse(), window.getPortletRequest(), response, included); if (PortletWindow.Action.RENDER == window.getAction() && !included) { res = new HttpServletPortletResourceResponseWrapper(res); } window.setAttribute(SERVLET_RESPONSE, res); } return res; } }
protected HttpServletRequest getServletRequest() { return requestContext.getServletRequest(); }
protected HttpServletResponse getServletResponse() { return requestContext.getServletResponse(); }
callback.cleanup(job.getWindow().getPortletRequestContext().getServletContext(), job.getRequest(), job.getResponse());
PortletConfig portletConfig = portletInstance.getConfig(); window.getPortletRequestContext().init(portletConfig, getServletContext(), request, response); window.getPortletResponseContext().init(request, response);
/** * Returns the portlet session. * <p> * Note that since portlet request instance is created everytime the portlet container receives an incoming request, * the portlet session instance held by the request instance is also re-created for each incoming request. * </p> */ @Override public PortletSession getPortletSession(boolean create) { return requestContext.getPortletSession(create); }
@Override public PortletPreferences createPortletPreferences( final PortletRequestContext requestContext, boolean render) { final HttpServletRequest containerRequest = requestContext.getContainerRequest(); final PortletWindow plutoPortletWindow = requestContext.getPortletWindow(); final IPortletWindow portletWindow = portletWindowRegistry.convertPortletWindow(containerRequest, plutoPortletWindow);
@Override public PortletSession getPortletSession() { return requestContext.getPortletSession(true); }