Hi, Yes it's possible. If you need to use specific Java classes in your templates, you just have to add this classes in the templates bundle folder You can add ".class" files (in "classes" folder) and ".jar" files in ("lib" folder) In your case you will have to add the following "jar" files in the "lib" folder in the template bundles : - `velocity-tools-generic-3.0.jar` ( contains the "SortTool" class ) and also all the dependencies required by "velocity-tools-generic-3.0.jar" - `slf4j-api-1.7.25.jar` - `commons-beanutils-1.8.3.jar` - `commons-logging-1.1.1.jar` ( all the jar files are available on Maven Central ) See this folders example in a Telosys project : [Templates-Lib](//muut.com/u/telosystools/s1/:telosystools:WOM8:templateslib.png.jpg) Once the class is available you can use it as follow in the template : --- ## Step 1 - New instance of the class "SortTool" #set($sorter = $loader.newInstance("org.apache.velocity.tools.generic.SortTool") ) ## Step 2 - Using the class #foreach( $attribute in $sorter.sort($entity.attributes,"name") ) - $attribute.name #end --- See also the "$loader" object documentation : https://www.telosys.org/templates-doc/objects/loader.html
Great ! work fine, thx a lot