This content has been marked as final.
Show 3 replies
-
1. Re: Layout : show single window without region / bug and pat
antoine_h Mar 11, 2007 8:03 PM (in response to antoine_h)The JIRA is :
http://jira.jboss.com/jira/browse/JBPORTAL-1316
the patch code is :String windowID = null; // we have the windowName (which is the window name), but we need the // window id Map portletContexts = page.getWindowContextMap(); for (Iterator i = portletContexts.keySet().iterator(); i.hasNext();) { windowID = (String) i.next(); WindowContext portletContext = (WindowContext) portletContexts .get(windowID); if (windowName.equals(portletContext.getWindowName())) { if (log.isDebugEnabled()) { log.debug("found the portlet to render: " + windowName); } break; } } if (windowID == null) { log .warn("can't find the window id of the window name on this page. Page [" + page.getPageName() + "] Window [" + windowName + "]. This window won't be shown in page."); return; } if (page.getWindowContext(windowID) == null) { log.warn("no such window on this page. Page [" + page.getPageName() + "] Window name [" + windowName + "]" + "] Window Id [" + windowID + "]"); return; } WindowContext windowContext = page.getWindowContext(windowID); RenderContext renderContext = (RenderContext) request .getAttribute(LayoutConstants.ATTR_RENDERCONTEXT); renderContext = renderContext.getContext(windowContext); try { renderContext.render(); out.write(renderContext.getMarkupFragment().toString()); out.flush(); } catch (RenderException e) { throw new JspException(e); }
(more readable than in the JIRA without code format).
To replace in the PortletTagHandler class from :
if (page.getWindowContext(windowName) == null)
{
log.debug("no such window on this page. Page [" + page.getPageName() + "] Window [" + windowName + "]");
return;
}
.../...
To : the end of the method. -
2. Re: Layout : show a single window without the region / bug a
antoine_h Mar 18, 2007 2:35 PM (in response to antoine_h)a better patch is in the Jira.
avoid to have another window come in the page if the window was not declared in the page. -
3. Re: Layout : show a single window without the region / bug a
theute Mar 19, 2007 5:02 AM (in response to antoine_h)Applied, thanks a lot !