Search in sources :

Example 6 with IPortletRenderExecutionWorker

use of org.apereo.portal.portlet.rendering.worker.IPortletRenderExecutionWorker in project uPortal by Jasig.

the class PortletExecutionManager method getRenderedPortletBodyWorker.

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;
}
Also used : IPortletRenderExecutionWorker(org.apereo.portal.portlet.rendering.worker.IPortletRenderExecutionWorker) IPortletWindowId(org.apereo.portal.portlet.om.IPortletWindowId)

Example 7 with IPortletRenderExecutionWorker

use of org.apereo.portal.portlet.rendering.worker.IPortletRenderExecutionWorker in project uPortal by Jasig.

the class PortletExecutionManager method isPortletRenderHeaderRequested.

/* (non-Javadoc)
     * @see org.apereo.portal.portlet.rendering.IPortletExecutionManager#isPortletHeaderRenderRequested(org.apereo.portal.portlet.om.IPortletWindowId, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
     */
@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;
}
Also used : IPortletRenderExecutionWorker(org.apereo.portal.portlet.rendering.worker.IPortletRenderExecutionWorker) IPortletWindowId(org.apereo.portal.portlet.om.IPortletWindowId)

Example 8 with IPortletRenderExecutionWorker

use of org.apereo.portal.portlet.rendering.worker.IPortletRenderExecutionWorker in project uPortal by Jasig.

the class PortletExecutionManager method afterCompletion.

@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
    final Map<IPortletWindowId, IPortletRenderExecutionWorker> portletHeaderRenderingMap = this.getPortletHeaderRenderingMap(request);
    for (final IPortletRenderExecutionWorker portletRenderExecutionWorker : portletHeaderRenderingMap.values()) {
        checkWorkerCompletion(request, portletRenderExecutionWorker);
    }
    final Map<IPortletWindowId, IPortletRenderExecutionWorker> portletRenderingMap = this.getPortletRenderingMap(request);
    for (final IPortletRenderExecutionWorker portletRenderExecutionWorker : portletRenderingMap.values()) {
        checkWorkerCompletion(request, portletRenderExecutionWorker);
    }
}
Also used : IPortletRenderExecutionWorker(org.apereo.portal.portlet.rendering.worker.IPortletRenderExecutionWorker) IPortletWindowId(org.apereo.portal.portlet.om.IPortletWindowId)

Example 9 with IPortletRenderExecutionWorker

use of org.apereo.portal.portlet.rendering.worker.IPortletRenderExecutionWorker in project uPortal by Jasig.

the class PortletExecutionManager method isPortletRenderRequested.

/* (non-Javadoc)
     * @see org.apereo.portal.portlet.rendering.IPortletExecutionManager#isPortletRenderRequested(org.apereo.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;
}
Also used : IPortletRenderExecutionWorker(org.apereo.portal.portlet.rendering.worker.IPortletRenderExecutionWorker) IPortletWindowId(org.apereo.portal.portlet.om.IPortletWindowId)

Example 10 with IPortletRenderExecutionWorker

use of org.apereo.portal.portlet.rendering.worker.IPortletRenderExecutionWorker in project uPortal by Jasig.

the class PortletExecutionManager method getPortletHeadOutput.

/* (non-Javadoc)
     * @see org.apereo.portal.portlet.rendering.IPortletExecutionManager#getPortletHeadOutput(org.apereo.portal.portlet.om.IPortletWindowId, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
     */
@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 "";
        }
    }
    logger.debug(portletWindowId + " does not produce output for header");
    return "";
}
Also used : IPortletRenderExecutionWorker(org.apereo.portal.portlet.rendering.worker.IPortletRenderExecutionWorker) IOException(java.io.IOException) MaintenanceModeException(org.apereo.portal.portlets.error.MaintenanceModeException)

Aggregations

IPortletRenderExecutionWorker (org.apereo.portal.portlet.rendering.worker.IPortletRenderExecutionWorker)10 IPortletWindowId (org.apereo.portal.portlet.om.IPortletWindowId)7 IOException (java.io.IOException)3 MaintenanceModeException (org.apereo.portal.portlets.error.MaintenanceModeException)3 IPortletDefinition (org.apereo.portal.portlet.om.IPortletDefinition)1 IPortletWindow (org.apereo.portal.portlet.om.IPortletWindow)1 IPortletFailureExecutionWorker (org.apereo.portal.portlet.rendering.worker.IPortletFailureExecutionWorker)1