use of com.revolsys.ui.web.config.JexlHttpServletRequestContext in project com.revolsys.open by revolsys.
the class MenuViewController method bootstrapNavbar.
private void bootstrapNavbar(final HttpServletRequest request, final HttpServletResponse response, final Navbar navBar) throws IOException {
if (navBar != null) {
try (final OutputStream out = response.getOutputStream();
XmlWriter writer = new XmlWriter(out, false)) {
writer.setIndent(false);
final JexlHttpServletRequestContext jexlContext = new JexlHttpServletRequestContext(request);
final List<Menu> menus = new ArrayList<>();
for (final Menu menuItem : navBar.getMenus()) {
if (menuItem.isVisible()) {
menus.add(menuItem);
}
}
final String title = navBar.getTitle();
if (Property.hasValue(title) || !menus.isEmpty()) {
BootstrapUtil.navbarStart(writer, navBar, jexlContext);
bootstrapMenu(writer, menus, 1, jexlContext);
BootstrapUtil.navbarEnd(writer);
}
writer.flush();
}
}
}
Aggregations