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

Overloading the velocimacro field to allow multiple macro files preloaded

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 1.7.1
    • 1.5.2
    • Velocity
    • None

    Description

      Since XWiki 1.5 it is not possible anymore to configure the list of macro files to be loaded. This used to be possible in velocity.properties.

      Here is a patch proposal which uses an xwiki.cfg xwiki.render.velocity.macrolist parameter

      ===================================================================
      — src/main/java/com/xpn/xwiki/render/DefaultVelocityManager.java (revision 12117)
      +++ src/main/java/com/xpn/xwiki/render/DefaultVelocityManager.java (revision 12126)
      @@ -184,7 +184,10 @@
      } else {
      // Gather the global Velocity macros that we want to have. These are skin dependent.
      Properties properties = new Properties();

      • String macroList = "/templates/macros.vm" + (cacheKey.equals("default") ? "" : "," + cacheKey);
        + String macroList = xcontext.getWiki().Param("xwiki.render.velocity.macrolist", "");
        + if (macroList.equals("")) { + macroList = "/templates/macros.vm" + (cacheKey.equals("default") ? "" : "," + cacheKey); + }

        properties.put(RuntimeConstants.VM_LIBRARY, macroList);
        velocityEngine = velocityFactory.createVelocityEngine(cacheKey, properties);
        }

      Attachments

        Activity

          People

            ludovic Ludovic Dubost
            ludovic Ludovic Dubost
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: