<?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 WebScript for update file content with a .doc converted file in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/webscript-for-update-file-content-with-a-doc-converted-file/m-p/125207#M88102</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi, all!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IÃ‚Â´m trying to update the content of an existing HTML file in Alfresco with a new converted file content. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The new content should come from a .doc-&amp;gt;HTML&amp;nbsp; file convertion. All this should happen with a webScript.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I cannot just delete the current file, because it is being referenced outside alfresco. So just the content has to be changed, not the file "last:transformed.html". &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this is what IÃ‚Â´m using, but it doesnÃ‚Â´t work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;// check if it is any .doc file in the folder already&lt;BR /&gt;// if there is one, delete it&lt;BR /&gt;var nodes = space.childrenByXPath("*[@cm:name='.doc']");&lt;BR /&gt;for (var i=0; i &amp;lt; nodes.length; i++)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodes[i].remove();&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;// check if it is a "last_transformed.html" file in the folder already&lt;BR /&gt;var lastfile = space.childByNamePath("last_transformed.html");&lt;BR /&gt;&lt;BR /&gt;if (lastfile != null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;transformed = document.transformDocument("text/html", space);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;lastfile.content = transformed.content;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;lastfile.save();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;transformed.remove();&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;/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;Does anybody have any idea, why it doesnÃ‚Â´t work? what am I doing wrong?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 13 Oct 2007 09:26:25 GMT</pubDate>
    <dc:creator>weggyboy</dc:creator>
    <dc:date>2007-10-13T09:26:25Z</dc:date>
    <item>
      <title>WebScript for update file content with a .doc converted file</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/webscript-for-update-file-content-with-a-doc-converted-file/m-p/125207#M88102</link>
      <description>hi, all!IÃ‚Â´m trying to update the content of an existing HTML file in Alfresco with a new converted file content. The new content should come from a .doc-&amp;gt;HTML&amp;nbsp; file convertion. All this should happen with a webScript.I cannot just delete the current file, because it is being referenced outside</description>
      <pubDate>Sat, 13 Oct 2007 09:26:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/webscript-for-update-file-content-with-a-doc-converted-file/m-p/125207#M88102</guid>
      <dc:creator>weggyboy</dc:creator>
      <dc:date>2007-10-13T09:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: WebScript for update file content with a .doc converted file</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/webscript-for-update-file-content-with-a-doc-converted-file/m-p/125208#M88103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;problem was solved without childrenByXPath…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks anyway.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 09:25:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/webscript-for-update-file-content-with-a-doc-converted-file/m-p/125208#M88103</guid>
      <dc:creator>weggyboy</dc:creator>
      <dc:date>2007-10-15T09:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: WebScript for update file content with a .doc converted file</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/webscript-for-update-file-content-with-a-doc-converted-file/m-p/125209#M88104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried to duplicate your code; however I am thrown error that says space is not defined.&amp;nbsp; I thought space was a default root object, do I have to declare this at the beginning of my code??&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2007 18:44:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/webscript-for-update-file-content-with-a-doc-converted-file/m-p/125209#M88104</guid>
      <dc:creator>dooley</dc:creator>
      <dc:date>2007-11-02T18:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: WebScript for update file content with a .doc converted file</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/webscript-for-update-file-content-with-a-doc-converted-file/m-p/125210#M88105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Within a Web Script context, the space root object is not available in the javascript and freemarker apis.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's the responsibility of the script to locate any repository objects (based on arguments etc).&amp;nbsp; companyhome etc are available.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Nov 2007 15:59:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/webscript-for-update-file-content-with-a-doc-converted-file/m-p/125210#M88105</guid>
      <dc:creator>davidc</dc:creator>
      <dc:date>2007-11-12T15:59:52Z</dc:date>
    </item>
  </channel>
</rss>

