From version < 3.1 >
edited by Thomas Mortagne
on 2020/01/20
To version < 4.1
edited by Alex Cotiugă
on 2020/07/01
<
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.ThomasMortagne
1 +XWiki.acotiuga
ReleaseNotes.Code.ChangesClass[0]
Short Description
... ... @@ -14,11 +14,11 @@
14 14  ** check for emptiness after explicit conversion methods:
15 15  *** return whether the result of getAsString() is empty (and false for a null result) if it exists.
16 16  *** return whether the result of getAsNumber() strictly equals zero (and false for a null result) if it exists.
17 -* support $array.empty, as for $list.empty
18 -* fix parsing of $obj._method()
19 -* have #foreach honnor the Closeable interface on the iterator
17 +* Support $array.empty, as for $list.empty
18 +* Fix parsing of $obj._method()
19 +* Have #foreach honnor the Closeable interface on the iterator
20 20  * Fix regression: #set<tab>left-paren no longer valid grammar
21 -* fix parser for '$map{key}' text rendering
21 +* Fix parser for '$map{key}' text rendering
22 22  * #foreach should work over any Iterable class
23 23  * Method arguments can now be expressions
24 24  * Fixed quotes escaping so that doubling single quotes only works when enclosing quotes are single quotes (and same behaviour for double quotes)

After 9 years Velocity finally got a update. You can see a detailed changelog on https://velocity.apache.org/engine/2.2/changes.html but here are the important new things from XWiki script authors:

  • Allow expressions inside []: $foo[$bar + 1]
  • New strategy for reference boolean evaluation:
    • return false for a null object
    • return its value for a Boolean object, or the result of the getAsBoolean() method if it exists.
    • if directive.if.emptycheck is false (true by default), stop here and return true.
    • check for emptiness:
      • return whether an array is empty.
      • return whether isEmpty() is false (covers String and all Collection classes).
      • return whether length() is zero (covers CharSequence classes other than String).
      • returns whether size() is zero.
      • return whether a Number strictly equals zero.
    • check for emptiness after explicit conversion methods:
      • return whether the result of getAsString() is empty (and false for a null result) if it exists.
      • return whether the result of getAsNumber() strictly equals zero (and false for a null result) if it exists.
  • support $array.empty, as for $list.empty
  • Support $array.empty, as for $list.empty
  • fix parsing of $obj._method()
  • Fix parsing of $obj._method()
  • have #foreach honnor the Closeable interface on the iterator
  • Have #foreach honnor the Closeable interface on the iterator
  • Fix regression: #setleft-paren no longer valid grammar
  • fix parser for '$map{key}' text rendering
  • Fix parser for '$map{key}' text rendering
  • #foreach should work over any Iterable class
  • Method arguments can now be expressions
  • Fixed quotes escaping so that doubling single quotes only works when enclosing quotes are single quotes (and same behaviour for double quotes)
  • Add ability to specify default values for macro parameters, e.g.; #macro(foo bar=1)
  • Add ability to place line comments next to macro parameter definitions
  • Block directives no longer require parenthesis so #@foo #end is now allowed. Also, brackets now work with Block Macros so #{@foo}bar#end works
  • Default block for empty loops: #foreach($i in []) loop block #else empty #end
  • Rendering of arrays should display their content, as for lists
  • New generic $collectiontool which replaces and enhances the former SortTool
  • New generic $logtool

Get Connected