Is it possible using the Javascript API to create a "model" – something like Map root = new HashMap(), that can be processed against a Freemarker template – processTemplate? I want to do this within a behavior, not as part of a web script. I want to calculate some values in the javascript and then pass them to a Freemarker template – something like var result = mygeneratedmodel.processTemplate(mytemplate).
The reference to the transformation api looks to be exactly what I was looking for, thanks! The templating api wiki seemed to indicate that the use of args was limited to only templating servlet, but this shows otherwise. Much appreciated.