PortalRequestContext portalEnv = PortalRequestContext.getContext(
(HttpServletRequest) pageContext.getRequest());
PortalURL portalURL = portalEnv.getRequestedPortalURL();
// Retrieve the portlet container from servlet context.
PortletContainer container = (PortletContainer)
servletContext.getAttribute(AttributeKeys.PORTLET_CONTAINER);
// Create the portlet window to render.
PortletWindow window = null;
try {
window = new PortletWindowImpl(container, windowConfig, portalURL);
} catch(RuntimeException e) // FIXME: Prose a change to anything else, handle it.
{
if (LOG.isDebugEnabled()) {
LOG.debug("The portlet " + windowConfig.getPortletName() + " is not available. Is already deployed?");
}
}
// Create portal servlet response to wrap the original
// HTTP servlet response.
PortalServletResponse portalResponse = new PortalServletResponse(
(HttpServletResponse) pageContext.getResponse());
if(window!=null)
{
// Check if someone else is maximized. If yes, don't show content.
Map windowStates = portalURL.getWindowStates();
for (Iterator it = windowStates.keySet().iterator(); it.hasNext(); ) {
String windowId = (String) it.next();
WindowState windowState = (WindowState) windowStates.get(windowId);
if (WindowState.MAXIMIZED.equals(windowState)
&& !window.getId().getStringId().equals(windowId)) {
return SKIP_BODY;
}
}
}
// Render the portlet and cache the response.
try {
container.doRender(window, (HttpServletRequest)pageContext.getRequest(), portalResponse);
response = portalResponse;
status = SUCCESS;
} catch (Throwable th) {
status = FAILED;
throwable = th;