use of fi.otavanopisto.muikku.model.widgets.LocatedWidget in project muikku by otavanopisto.
the class IncludeWidgetsTagHandler method includeWidget.
private void includeWidget(FaceletContext context, UIComponent parent) throws IOException {
StringBuilder jsfBuilder = new StringBuilder();
List<LocatedWidget> widgets = getWidgets(context);
jsfBuilder.append("<ui:composition xmlns:m=\"http://www.ofw.fi/xml/2013/muikku/components-taglib.xsd\" xmlns:ui=\"http://java.sun.com/jsf/facelets\">");
for (LocatedWidget widget : widgets) {
appendWidgetJsf(jsfBuilder, widget.getWidget());
}
jsfBuilder.append("</ui:composition>");
VariableMapper orig = context.getVariableMapper();
context.setVariableMapper(new VariableMapperWrapper(orig));
try {
this.nextHandler.apply(context, parent);
context.includeFacelet(parent, new URL(null, "data://text/plain;base64," + Base64.encodeBase64String(jsfBuilder.toString().getBytes("UTF-8")), new DataStreamHandler()));
} finally {
context.setVariableMapper(orig);
}
}
Aggregations