<?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 Re: Apply template to document node using Javascript API in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/apply-template-to-document-node-using-javascript-api/m-p/64023#M40289</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Was a JIRA request ever created for this?&amp;nbsp; (I performed a quick search that did not appear to turn up a case.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;P.S.&amp;nbsp; It would be helpful if the JavaScript Wiki and/or examples make it very clear that results are not returned when the script is called from the Run Action facility.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Mar 2008 18:38:29 GMT</pubDate>
    <dc:creator>tdahlgren</dc:creator>
    <dc:date>2008-03-10T18:38:29Z</dc:date>
    <item>
      <title>Apply template to document node using Javascript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/apply-template-to-document-node-using-javascript-api/m-p/64019#M40285</link>
      <description>It looks like you can apply a template to a node using the Javascript API through the ScriptAction api??? Could anyone enlighten me on how you might go about this?</description>
      <pubDate>Fri, 16 Mar 2007 20:14:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/apply-template-to-document-node-using-javascript-api/m-p/64019#M40285</guid>
      <dc:creator>rbelisle</dc:creator>
      <dc:date>2007-03-16T20:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Apply template to document node using Javascript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/apply-template-to-document-node-using-javascript-api/m-p/64020#M40286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes you can. You can execute a template string directly:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; var result = document.processTemplate("this is a freemarker template executed by ${person.properties.userName}");&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;and you can execute a template that already exists in the repo, such as:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; var template = companyhome.childByNamePath["/Data Dictionary/Presentation Templates/doc_info.ftl"];&lt;BR /&gt;&amp;nbsp;&amp;nbsp; var result = document.processTemplate(template);&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;There's a lot you can do with this! As the first example shows, you can construct the template itself in javascript code, you can also load up template content, modify it if you wish and execute it on the fly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2007 14:48:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/apply-template-to-document-node-using-javascript-api/m-p/64020#M40286</guid>
      <dc:creator>kevinr</dc:creator>
      <dc:date>2007-03-21T14:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Apply template to document node using Javascript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/apply-template-to-document-node-using-javascript-api/m-p/64021#M40287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried the examples you provided. I was expecting that if I created a script file in the 'Scripts' space, then from the details page of a document, did a 'Run Action' and executed the script, that the template would be reflected in the current document web page view. (ie. the template would be applied and the result would be displayed in the webpage).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This does not seem to be the case. There are no Javascript errors, but no visible results either… any guidance?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2007 16:04:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/apply-template-to-document-node-using-javascript-api/m-p/64021#M40287</guid>
      <dc:creator>rbelisle</dc:creator>
      <dc:date>2007-03-21T16:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Apply template to document node using Javascript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/apply-template-to-document-node-using-javascript-api/m-p/64022#M40288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No the Run Action facility is not designed to display any results from scripts/templates. It was added long before the script+templates facilities were implemented. I suggest you raise a JIRA request for this feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It is possible to execute any script and display the result using the command servlet:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://wiki.alfresco.com/wiki/URL_Addressability#Script_Command_Processor" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/URL_Addressability#Script_Command_Processor&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;that doesn't help you in the Run Action case though.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2007 16:24:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/apply-template-to-document-node-using-javascript-api/m-p/64022#M40288</guid>
      <dc:creator>kevinr</dc:creator>
      <dc:date>2007-03-21T16:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Apply template to document node using Javascript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/apply-template-to-document-node-using-javascript-api/m-p/64023#M40289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Was a JIRA request ever created for this?&amp;nbsp; (I performed a quick search that did not appear to turn up a case.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;P.S.&amp;nbsp; It would be helpful if the JavaScript Wiki and/or examples make it very clear that results are not returned when the script is called from the Run Action facility.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 18:38:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/apply-template-to-document-node-using-javascript-api/m-p/64023#M40289</guid>
      <dc:creator>tdahlgren</dc:creator>
      <dc:date>2008-03-10T18:38:29Z</dc:date>
    </item>
  </channel>
</rss>

