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

Upgrade to Velocity Engine 1.6.2 and Velocity Tools 1.4

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 1.9 M2
    • 1.8 M1
    • Dependency Upgrades
    • None

    Description

      2 reasons:

      • There are some features listed below we want to benefit from in the near future
      • We have some lock issue with some velocity code in Velocity 1.5 on myxwiki.org and we hope (dream?) that the upgrade could fix them...

      Changes in Velocity Engine between 1.6 and 1.6.1:

      • Correct/enhance template name reporting for #include and #parse. Fixes VELOCITY-654 . Thanks to Byron Foster.
      • Removed redundant error message in ASTReference. Fixes VELOCITY-653 . Thanks to Byron Foster.
      • Fix limitation in new macro implementation that resisted #set calls to change references defined as arguments for the macro. Fixes VELOCITY-615 . Thanks to Steve O'Hara.
      • Fix vararg bugs when calling overloaded methods like get(String,String,Object[]) and get(String,List). (e.g. in VelocityStruts' MessageTool) Fixes VELOCITY-651 . Thanks to Stephan Schmid.

      Changes in Velocity Engine between 1.5 and 1.6:

      The Apache Velocity Team announces the immediate availability of the
      of Apache Velocity Engine 1.6. This release is fully compatible with
      the previous release and includes significant improvements in
      performance, stability and features.

      Apache Velocity is well-known in the Java field as a lightweight,
      easy-to-use templating library for creating dynamic web sites and
      performing other text-generation tasks.

      Much work in this release has gone to making significant improvements
      in the memory usage and speed of Velocity. Apart from this, a number
      of small parser bugs were fixed, tempate/line/column information in
      error messages has been corrected and made consistent, and many new
      features were added. Many of the latter are listed below:

      • There are three new directives:
      • #evaluate takes a single string of VTL as an argument and renders it.
      • #define is a cousin of #macro, that lets define a reference that
        represents the body of the directive, which is then evaluated when the
        reference is used.
      • #break lets you exit a #foreach loop early.
      • There are reflection improvements:
      • You may now call JDK 1.5 vararg methods on your tools and other
        references with variable arguments.
      • You can put a static utility class directly into the context and
        be able to call its methods; no instance necessary. (e.g.
        context.put("Math", java.util.Math.class))
      • If you have a reference that is an array, you can now call
        fixed-length list methods on it. (e.g. $array.size() and
        $array.get($index) )
      • There is now support for chaining and linking Uberspect
        implementations to simplify custom introspection.
      • The underlying Velocimacro code has been refactored to allow:
      • Much, much better performance than Velocity 1.5
      • #parse( 'mymacros.vm' ) to work as expected!!
      • macro libraries to be programatically included when calling
        template.merge(...)
      • users to configure a velocimacro.max.depth property (to limit
        recursion et al)
      • CommonsLogLogChute and ServletLogChute are now available without
        including VelocityTools
      • The StringResourceLoader has undergone major refactoring to make it
        much more user-friendly and flexible.
      • There is now an automatic $velocityHasNext reference in #foreach loops
      • You can now configure the connection timeout for URLResourceLoader
        (JDK 1.5+ only)

      Documentation Velocity 1.6 can be found here:
      http://velocity.apache.org/engine/releases/velocity-1.6/

      The change log is here:
      http://velocity.apache.org/engine/releases/velocity-1.6/changes-report.html

      Apache Velocity 1.6 can be downloaded here:
      http://velocity.apache.org/download.cgi

      For the Apache Velocity Team
      Nathan Bubna

      Changes in Velocity Tools from 1.3 to 1.4:

      • Added ability to add current request parameters to LinkTool, including controls for automatically and/or manually ignoring some of those. Thanks to Christopher Schultz. (ndb)
      • VELTOOLS-87: fixed infinite recursion in RenderTool. Thanks to Andrea Bernardo Ciddio. (ndb)
      • Upgraded DVSL version used for documentation to v1.0 (ndb)
      • VELTOOLS-85: Fix order preservation problem in SortTool. Thanks to Tatyana. (ndb)
      • Protect BrowserSniffer from requests without user-agent. (cb)
      • Added support for a MethodExceptionHandler - the TilesTool.get() method now only returns null if one isn't present. (maj)
      • Changed StrutsLinkTool.setForward() to look for forwards local to the action mapping, before looking up global forwards. Thanks to Christopher Schultz. (ndb)
      • Rearrange/refactor/deprecate some internal methods in VelocityViewServlet in preparation for VelocityTools 2.0 upgrades. (ndb)
      • Upgraded Velocity Engine dependency to build and test against v1.5. (NOTE: Velocity Engine 1.5 will be required for VelocityTools 2.0.) (ndb)
      • Added propertyKey() and propertyValue() escaping support to EscapeTool (VELTOOLS-81). Thanks to Phil Cornelius for this patch. (ndb)
      • Fixed bug in request-path restriction when using wildcards. (ndb)
      • Make default locale and format for NumberTool configurable, just as they are in DateTool. (ndb)
      • Add ComparisonDateTool (with some tests and showcase demos) for comparing dates and displaying the comparisons textually. Thanks to Chris Townsen for the initial implementation. (ndb)
      • Add ability to configure default Locale for DateTool and to lock down configure() so it is safe to use in application scope. (ndb)
      • Add better support for dynamic locales in MessageTool. Thanks to Christopher Schultz. (ndb)
      • Use ResourceTool for common text throughout the Showcase example. (ndb)

      Attachments

        Activity

          People

            sdumitriu Sergiu Dumitriu
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: