Package org.jasig.portal.portlet.rendering.worker

Examples of org.jasig.portal.portlet.rendering.worker.IPortletRenderExecutionWorker


  @Override
  public boolean isPortletRenderHeaderRequested(
      IPortletWindowId portletWindowId, HttpServletRequest request,
      HttpServletResponse response) {
    final Map<IPortletWindowId, IPortletRenderExecutionWorker> portletRenderingMap = this.getPortletHeaderRenderingMap(request);
        final IPortletRenderExecutionWorker tracker = portletRenderingMap.get(portletWindowId);
       
        return tracker != null;
  }
View Full Code Here


     * @see org.jasig.portal.portlet.rendering.IPortletExecutionManager#isPortletRenderRequested(org.jasig.portal.portlet.om.IPortletWindowId, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
     */
    @Override
    public boolean isPortletRenderRequested(IPortletWindowId portletWindowId, HttpServletRequest request, HttpServletResponse response) {
        final Map<IPortletWindowId, IPortletRenderExecutionWorker> portletRenderingMap = this.getPortletRenderingMap(request);
        final IPortletRenderExecutionWorker tracker = portletRenderingMap.get(portletWindowId);
       
        return tracker != null;
    }
View Full Code Here

   */
    @Override
    public String getPortletHeadOutput(IPortletWindowId portletWindowId,
        HttpServletRequest request, HttpServletResponse response) {
      if(doesPortletNeedHeaderWorker(portletWindowId, request)) {
        final IPortletRenderExecutionWorker tracker = getRenderedPortletHeaderWorker(portletWindowId, request, response);
        final long timeout = getPortletRenderTimeout(portletWindowId, request);
        try {
          final String output = tracker.getOutput(timeout);
          return output == null ? "" : output;
        } catch (Exception e) {
          logger.error("failed to render header output for " + portletWindowId, e);
          return "";
        }
View Full Code Here

    /* (non-Javadoc)
     * @see org.jasig.portal.portlet.rendering.IPortletExecutionManager#getPortletOutput(org.jasig.portal.portlet.om.IPortletWindowId, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
     */
    @Override
    public String getPortletOutput(IPortletWindowId portletWindowId, HttpServletRequest request, HttpServletResponse response) {
      final IPortletRenderExecutionWorker tracker = getRenderedPortletBodyWorker(portletWindowId, request, response);
        final long timeout = getPortletRenderTimeout(portletWindowId, request);

    try {
      final String output = tracker.getOutput(timeout);
      return output == null ? "" : output;
    } catch (Exception e) {
        final IPortletFailureExecutionWorker failureWorker = this.portletWorkerFactory.createFailureWorker(request, response, portletWindowId, e);
        // TODO publish portlet error event?
        try {
View Full Code Here

        return parentPortletEntity.getPortletDefinition();
    }

    protected IPortletRenderExecutionWorker getRenderedPortletHeaderWorker(IPortletWindowId portletWindowId, HttpServletRequest request, HttpServletResponse response) {
      final Map<IPortletWindowId, IPortletRenderExecutionWorker> portletHeaderRenderingMap = this.getPortletHeaderRenderingMap(request);
      IPortletRenderExecutionWorker portletHeaderRenderWorker = portletHeaderRenderingMap.get(portletWindowId);
      if (portletHeaderRenderWorker == null) {
            portletHeaderRenderWorker = this.startPortletHeaderRenderInternal(portletWindowId, request, response);
        }
        return portletHeaderRenderWorker;
    }
View Full Code Here

        return portletHeaderRenderWorker;
    }
   
    protected IPortletRenderExecutionWorker getRenderedPortletBodyWorker(IPortletWindowId portletWindowId, HttpServletRequest request, HttpServletResponse response) {
        final Map<IPortletWindowId, IPortletRenderExecutionWorker> portletRenderingMap = this.getPortletRenderingMap(request);
        IPortletRenderExecutionWorker tracker = portletRenderingMap.get(portletWindowId);
        if (tracker == null) {
            tracker = this.startPortletRenderInternal(portletWindowId, request, response);
           
        }
        return tracker;
View Full Code Here

     * @return The PortletRenderResult from the portlet's execution
     * @throws TimeoutException If the portlet's timeout was hit before a result was returned
     * @throws Exception The exception thrown by the portlet during execution
     */
    protected PortletRenderResult getPortletRenderResult(IPortletWindowId portletWindowId, HttpServletRequest request, HttpServletResponse response) throws Exception {
        final IPortletRenderExecutionWorker tracker = getRenderedPortletBodyWorker(portletWindowId, request, response);
        final long timeout = getPortletRenderTimeout(portletWindowId, request);
        return tracker.get(timeout);
    }
View Full Code Here

     * @param request
     * @param response
     * @return
     */
    protected IPortletRenderExecutionWorker startPortletHeaderRenderInternal(IPortletWindowId portletWindowId, HttpServletRequest request, HttpServletResponse response) {
      IPortletRenderExecutionWorker portletHeaderRenderWorker = this.portletWorkerFactory.createRenderHeaderWorker(request, response, portletWindowId);
      portletHeaderRenderWorker.submit();
     
      final Map<IPortletWindowId, IPortletRenderExecutionWorker> portletHeaderRenderingMap = this.getPortletHeaderRenderingMap(request);
      portletHeaderRenderingMap.put(portletWindowId, portletHeaderRenderWorker);
          
        return portletHeaderRenderWorker;
View Full Code Here

    protected IPortletRenderExecutionWorker startPortletRenderInternal(IPortletWindowId portletWindowId, HttpServletRequest request, HttpServletResponse response) {
      // first check to see if there is a Throwable in the session for this IPortletWindowId
      final Map<IPortletWindowId, Exception> portletFailureMap = getPortletErrorMap(request);
      final Exception cause = portletFailureMap.remove(portletWindowId);
     
      final IPortletRenderExecutionWorker portletRenderExecutionWorker;
      if (null != cause) {
        // previous action failed, dispatch to errorPortlet immediately
        portletRenderExecutionWorker = this.portletWorkerFactory.createFailureWorker(request, response, portletWindowId, cause);
      } else {
            IPortletWindow portletWindow = portletWindowRegistry.getPortletWindow(request, portletWindowId);
            IPortletDefinition portletDef = portletWindow.getPortletEntity().getPortletDefinition();
            if (portletDef.getLifecycleState().equals(PortletLifecycleState.MAINTENANCE)) {
                // Prevent the portlet from rendering;  replace with a helpful "Out of Service" message
                portletRenderExecutionWorker = this.portletWorkerFactory.createFailureWorker(request, response, portletWindowId, new MaintenanceModeException());
            } else {
                // Happy path
                portletRenderExecutionWorker = this.portletWorkerFactory.createRenderWorker(request, response, portletWindowId);
            }
      }
     
      portletRenderExecutionWorker.submit();
     
        final Map<IPortletWindowId, IPortletRenderExecutionWorker> portletRenderingMap = this.getPortletRenderingMap(request);
        portletRenderingMap.put(portletWindowId, portletRenderExecutionWorker);
       
        return portletRenderExecutionWorker;
View Full Code Here

TOP

Related Classes of org.jasig.portal.portlet.rendering.worker.IPortletRenderExecutionWorker

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.