Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
9.11
-
None
-
Unknown
-
Description
Right now jsfx support velocity, and JSX xobjects too.
It would be good to allow jsrx (ie. resources pulled from the classloader) to contain velocity too.
Implementation details: The following code from SxDocumentSource could easily be ported to SxResourceSource:
try { StringWriter writer = new StringWriter(); VelocityManager velocityManager = Utils.getComponent(VelocityManager.class); VelocityContext vcontext = velocityManager.getVelocityContext(); velocityManager.getVelocityEngine().evaluate(vcontext, writer, this.document.getPrefixedFullName(), sxContent); sxContent = writer.toString(); } catch (XWikiVelocityException ex) { LOGGER.warn("Velocity errors while parsing skin extension [{}] with content [{}]: ", this.document.getPrefixedFullName(), sxContent, ExceptionUtils.getRootCauseMessage(ex)); }