6.7 how to register the velocity value parser

Is there a way in the workbench to register additional velocity tools? I see that this is in the jar but it is not available in the workbench. What velocity version is 6.7(no patches) running because I see 2 jars 1.4 and 1.6 but in the velocity log it states that the system is using v1.4.

In 1.6 the tool I want to use is the ConversionTool and in 1.4 the tool is ValueParser and an example is as follows of what I want to do:

$tools.parser.setStringsDelimiter(",")
#set($rangeList = $tools.parser.parseStringList(“3,4,5”))

Wow, I was actually searching for this last night. What a coincidence?! Have you tried modifying the tools.xml in <PATH TO RHYTHMYX>/AppServer/server/rx/deploy/rxapp.ear/rxapp.war/WEB-INF/config/velocity/ ?

It is in the tools.xml file I just can’t seem to access the methods setStringDelimiter or parseStringsList. Some of the other methods are listed just not these that I want to use. When I put them in velocity they are not processed instead they render as typed in as static text. Are you able to?

Haven’t attempted. Waiting for access to the file system. :slight_smile:

Bumping this topic. Did either of you get an answer to adding Velocity tools? Anyone? I’d like this option as well.

No I never heard back on how to do this from anyone. Maybe someone from Percussion can add their two cents?

Just thinking aloud, but you might be able to add them as a custom extension…of course the problem would be you probably wouldn’t be able to use them everywhere the $tools would be (ie notifications templates) available… Having an official Percussion response would be great, as I have come across other tools (ie the LinkTool) that would be nice to have…

First to address the version question. The CMServer uses version 1.6 of the velocity engine, but version 1.4 of the velocity tools (which is why there are two different numbered jars present. Apache has not kept the version numbering consistent between the two projects. In fact, the tools jumped from 1.4 to 2.0 (a very different implementation which has deprecated most of the 1.4 classes).

As for why the methods you’re trying to call aren’t exposed (or properly evaluated if specified), they’re protected methods. Only the Public Methods are available. If you would like to use the methods in question you’d need to create a custom JEXL expression which exposes those methods.

M.