4.7.6. Velocity settings

In MetaFactory the template engine Velocity can be used (though Freemarker is recommended). With this tool you can add links to the velocity files that are loaded by the Velocity Engine, thus making all macros available to other velocity files in the pattern.

Eye S Links to these velocity files are relative to the snippetFolders that are defined in the MetaFactory project.

If a velocity library cannot be found during loading of a pattern, an error message is given immediately and the process stops (Fail Fast).

Usage

In the example below 2 velocity libraries are defined:

Listing 4.42 <velocity settings/> example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
<?xml version="1.0" encoding="UTF-8"?>
<pattern xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://www.firstbase.nl/xsd/personaliom/pattern"
         xsi:schemaLocation="http://www.firstbase.nl/xsd/personaliom/pattern
                             http://www.firstbase.nl/xsd/personaliom/pattern.xsd">

        ...
<velocity>
        <velocityLibrary>relative path to a velocity file with macro's</velocityLibrary>
        <velocityLibrary>some other path</velocityLibrary>
</velocity>
        ...
</pattern>