String preview = (String) pageContext.getRequest().getAttribute("org.jboss.dashboard.ui.taglib.RegionTag.preview");
if (preview != null && preview.trim().equalsIgnoreCase("true")) {
//PREVIEW
String layoutId = (String) pageContext.getRequest().getAttribute("org.jboss.dashboard.ui.taglib.RegionTag.layout");
Layout layout = (Layout) UIServices.lookup().getLayoutsManager().getAvailableElement(layoutId);
LayoutRegion layoutRegion = layout.getRegion(region);
String pageStr = "/section/render_region.jsp";
int dotIndex = pageStr.lastIndexOf('.');
pageStr = pageStr.substring(0, dotIndex) + "_preview" + pageStr.substring(dotIndex, pageStr.length());
pageContext.getRequest().setAttribute("layoutRegion", layoutRegion);
pageContext.include(pageStr);
pageContext.getRequest().removeAttribute("layoutRegion");
} else {
// NORMAL DISPLAY
Section section = NavigationManager.lookup().getCurrentSection();
if (section != null) {
LayoutRegion layoutRegion = section.getLayout().getRegion(getRegion());
if (layoutRegion != null) {
String pageStr = displayConfiguration.getProperty("regionRenderPage");
log.debug("REGION TAG: INCLUDING (" + layoutRegion.getId() + ") " + pageStr);
pageContext.include(pageStr);
}
}
}
}}.execute();