For those of you maintaining JPublish sites developed with Velocity or
FreeMarker using the newly added StringTemplate renderer is not an
easy option, especially if those sites are in production. So what can
you do if you want to use ST?
Don't worry, you can render StringTemplate syntax in Velocity/
FreeMarker driven pages by using the StringTemplate component that I
just added to the JPublish component family.
Using it is very simple.
Build the ST Component from SVN (http://jpublish.googlecode.com/svn/
trunk/components/jpStringTemplate/) and load it in jpublish.xml:
<component-manager>
<components>
<component id="JPST"
classname="ca.flop.jpublish.components.JPSTComponent">
<stringtemplate-groups>
<group name="default" relative-root-dir="/st_content"
refresh-interval="15"
lexer="org.antlr.stringtemplate.language.DefaultTemplateLexer"/>
<group name="menus" relative-root-dir="/st_menus"/>
</stringtemplate-groups>
</component>
</components>
</component-manager>
and then use it wherever ST is required, for example in a Velocity
page:
$components.JPST.renderPath("menus:main_menu"), and the contents of
the main_menu.st file will be rendered in-line.
I will add more details in the Wiki, meanwhile you can find the code
and a demo web application in our SVN.
Have fun!
-florin