Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-15624

Allow putting velocity in JSRX resources

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 9.11
    • Skin - Skinx
    • 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));
      }
       

      Attachments

        Activity

          People

            Unassigned Unassigned
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: