cancel
Showing results for 
Search instead for 
Did you mean: 

Generate model in Javascript?

stevegreenbaum
Champ in-the-making
Champ in-the-making
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).
2 REPLIES 2

loftux
Star Contributor
Star Contributor
Have a look at processTemplate http://wiki.alfresco.com/wiki/3.4_JavaScript_API#Transformation_API
If you need to find out how to create javascript behaviours a good start is to look at the test script found in source

stevegreenbaum
Champ in-the-making
Champ in-the-making
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.