Upgrading Velocity to 1.7

Out-of-the-box CM System version 6.7 includes Velocity version 1.6.2 and VelocityTools version 1.4.

Here is a link to the 1.6.2 Velocity Template Language (VTL) reference sheet

If you’re interested in the new features of VTL 1.7, you can download the velocity 1.7 jar and replace the older velocity file in your “AppServer\server\rx\deploy\rxapp.ear\rxapp.war\WEB-INF\lib” directory.

CAVEAT

There is a bug in 1.7 that causes comments at the end of a line directly following a velocity directive with no parentheses (#end##, for example) to output as text. You will need to modify the System Velocity Macros file and to either enclose these directives in curly-braces (this is “formal notation” : #{end}##) or remove the superfluous comments (#end) since velocity directives at the end of a line do not output the newline unless there are other intervening characters (like spaces) between the end of the directive and the EOL.

If you’ve defined user macros, or use the single-line comment to hide end-of-lines in your code, you may want to verify that all your templates still output as expected.

Another note: the built-in Velocity syntax highlighting is still based on Velocity 1.4 and does not recognize curly-brace-enclosed directive names. So, expect visual warnings in the editor that work just fine when the templates are executed. I think it might be possible to update the velocity version that the workbench uses on client machines to version 1.5 but the veloeclipse plugin that handles this hasn’t been updated on sourceforge for over 2 years, so although slightly newer, it still wouldn’t be that helpful.