I found this code to create a file from a template
// Data to fill in the template var num = "42"; var buyer = "Acme, Inc"; var sum = "700$"; // Get template file var tempFile = search.findNode( "workspace://SpacesStore/262981fb-e141-43bd-ac63-9b8199eb1077" ); // Get target folder var folder = search.findNode( "workspace://SpacesStore/ef296491-90ff-4427-a06a-31fd4abf4245" ); // Name of new file to be created var name = "Invoice " + num; // Create string with data to fill the template. // Parameters names (number, company, amount) match the names in the template. var data = jsonUtils.toJSONString( {"Number": num, "CustomerName": buyer, "Amount": sum} ); // Create new file template.generate( tempFile, folder, name, data );
But it does not work says not foundjsonUtils andtemplate.generate
Tell me how to fix this or how to create a file from the template correctly
where is the script with this snippet? what version of alfresco are you using?
I'm new in alfresco. I try to write such a script, but it does not work.Im using 5.2 version.I want to create file with template at ui of process
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.