use of org.broadleafcommerce.presentation.model.BroadleafTemplateElement in project BroadleafCommerce by BroadleafCommerce.
the class UncacheableDataProcessor method getReplacementModel.
@Override
public BroadleafTemplateModel getReplacementModel(String tagName, Map<String, String> tagAttributes, BroadleafTemplateContext context) {
StringBuffer sb = new StringBuffer();
sb.append("<SCRIPT>\n");
sb.append(" var params = \n ");
sb.append(buildContentMap(context)).append(";\n ");
sb.append(getUncacheableDataFunction(context, tagAttributes));
sb.append("</SCRIPT>");
// Add contentNode to the document
BroadleafTemplateModel model = context.createModel();
BroadleafTemplateElement script = context.createTextElement(sb.toString());
model.addElement(script);
return model;
}
Aggregations