<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Correct use of processTemplate in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/correct-use-of-processtemplate/m-p/303367#M256497</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hallo&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have an RTF freemarker template which I fill with some arbitrary data, and then save into a folder different than origin.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The file saves correctly but without any modification - just the original template.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Moreover, I don't understand the meaning of the node against which I am expected to call the method, the "node" of "node.processTemplate" syntax.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;var template = search.findNode("workspace://SpacesStore/027f4dd7-1d03-4fb2-95bd-80a2d48f6af0");&lt;BR /&gt;var node = search.findNode("workspace://SpacesStore/0c1b9534-17a8-41e6-9352-43af7f9f0b69"); // which should it be?&lt;BR /&gt;var destDir = search.findNode("workspace://SpacesStore/79302af2-abb2-493a-87ed-885cfe5dd20e");&lt;BR /&gt;&lt;BR /&gt;var args = new Array();&lt;BR /&gt;&lt;BR /&gt;args["certiq"] = "Some text here";&lt;BR /&gt;var result = node.processTemplate(template, args);&lt;BR /&gt;&lt;BR /&gt;var outputFile = destDir.createFile("output.rtf");&lt;BR /&gt;outputFile.content = result;&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;In the template there are occurrences both of ${args["certiq"]} (double quotes, as of Freemarker documentation) and ${args['certiq']} (single quotes, as of Alfresco Wiki Javascript API Cookbook samples).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help will be greatly appreciated!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Feb 2014 01:08:41 GMT</pubDate>
    <dc:creator>lordzoster</dc:creator>
    <dc:date>2014-02-20T01:08:41Z</dc:date>
    <item>
      <title>Correct use of processTemplate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/correct-use-of-processtemplate/m-p/303367#M256497</link>
      <description>HalloI have an RTF freemarker template which I fill with some arbitrary data, and then save into a folder different than origin.The file saves correctly but without any modification - just the original template.Moreover, I don't understand the meaning of the node against which I am expected to call</description>
      <pubDate>Thu, 20 Feb 2014 01:08:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/correct-use-of-processtemplate/m-p/303367#M256497</guid>
      <dc:creator>lordzoster</dc:creator>
      <dc:date>2014-02-20T01:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Correct use of processTemplate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/correct-use-of-processtemplate/m-p/303368#M256498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;save outputFile after operation&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outputFile.save();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and may be you also need to change this &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outputFile.content.content=result;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Feb 2014 06:00:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/correct-use-of-processtemplate/m-p/303368#M256498</guid>
      <dc:creator>mitpatoliya</dc:creator>
      <dc:date>2014-02-20T06:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Correct use of processTemplate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/correct-use-of-processtemplate/m-p/303369#M256499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for replying, the output file gets already created anyway.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The point is that I cannot understand the nodes involved, even in the Javascript API cookbook example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;em&amp;gt;Executes a template from the repository against the current Document node:&amp;lt;/em&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;javascript&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; var template = "&amp;lt;h3&amp;gt;Document name is ${document.name}&amp;lt;/h3&amp;gt;" +&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "The ID argument: ${args['id']}";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var args = new Array()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;args["id"] = "01234-56789";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var result = document.processTemplate(template, args);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// save the template result content to a new node in my home space&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var outputFile = userhome.createFile("output.txt");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outputFile.content = result;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/javascript&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here we have:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. a template;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. an outputFile;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. and a document "against which the template is processed". What does this mean?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What is the meaning of "executing a template against a Document node"? What's the role of the Document node the template is processed against to?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Moreover, the outputFile is identical to the template: placeholders are not getting processed, they are output as is.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2014 13:30:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/correct-use-of-processtemplate/m-p/303369#M256499</guid>
      <dc:creator>lordzoster</dc:creator>
      <dc:date>2014-02-26T13:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Correct use of processTemplate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/correct-use-of-processtemplate/m-p/303370#M256500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Template+Model=New Output File&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the ideal scenario for any template processing language.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Now in Alfresco "document" is predefined object in alfresco context which points to current node which is being processed. So, in this case it is just being used to access APIs related to template processing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Mar 2014 07:12:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/correct-use-of-processtemplate/m-p/303370#M256500</guid>
      <dc:creator>mitpatoliya</dc:creator>
      <dc:date>2014-03-03T07:12:39Z</dc:date>
    </item>
  </channel>
</rss>

