cancel
Showing results for 
Search instead for 
Did you mean: 

Apply template output new document instead of preview

ronchan
Champ in-the-making
Champ in-the-making
How do I apply a template to a document and create a new document rather than just previewing the output?

Thanks
4 REPLIES 4

kevinr
Star Contributor
Star Contributor
At the moment there is no function for this. We hope to add an action that can perform this in a later version.

Thanks,

Kevin

bruno_borges
Champ in-the-making
Champ in-the-making
Is this solved already in Alfresco 1.4 ?

If yes, how?

kevinr
Star Contributor
Star Contributor
It is possible to do this using the JavaScript API - which can execute a template and create/modify a document node to set the content. There is not an action explicitly for it, but you can create a javascript action that calls your script. It's not ideal so will still be something we'd like to add explicit support for in a later version.

Thanks,

Kevin

ragnaroek-hh
Champ in-the-making
Champ in-the-making
simply try out:

var template = companyhome.childByNamePath("Daten Verzeichnis/Darstellungsvorlagen/mytemplate.ftl");var outfile=space.createFile( document.properties.name+".html");outfile.content =document.processTemplate(template);outfile.save();‍‍‍‍‍‍‍

you might adopt the path towards your template file