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

Overloading the velocimacro field to allow multiple macro files preloaded

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.5.2
    • Fix Version/s: 1.7.1
    • Component/s: Velocity
    • Labels:
      None
    • Similar issues:

      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

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

              Dates

              Created:
              Updated:
              Resolved: