use of org.xwiki.velocity.VelocityManager in project xwiki-platform by xwiki.
the class XWikiDocument method evaluate.
private String evaluate(String content, String name, VelocityContext vcontext, XWikiContext context) {
StringWriter writer = new StringWriter();
try {
VelocityManager velocityManager = Utils.getComponent(VelocityManager.class);
velocityManager.getVelocityEngine().evaluate(vcontext, writer, name, content);
return writer.toString();
} catch (Exception e) {
LOGGER.error("Error while parsing velocity template namespace [{}]", name, e);
Object[] args = { name };
XWikiException xe = new XWikiException(XWikiException.MODULE_XWIKI_RENDERING, XWikiException.ERROR_XWIKI_RENDERING_VELOCITY_EXCEPTION, "Error while parsing velocity page {0}", e, args);
return Util.getHTMLExceptionMessage(xe, context);
}
}
Aggregations