<?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: How to move or remove a document using the JavaScript API in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288091#M241221</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;BR /&gt;&lt;SPAN&gt;i am a new for alfresco.Can any one help me out how to "Delete a specific version document using web services or using java script"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jan 2014 08:50:50 GMT</pubDate>
    <dc:creator>gangadharjwala</dc:creator>
    <dc:date>2014-01-22T08:50:50Z</dc:date>
    <item>
      <title>How to move or remove a document using the JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288083#M241213</link>
      <description>I'm trying to build a simple workflow. A document arrives in a space and must be copied to another one and moved to a third one. Or copied and removed, it's OK too. It's easy to use a script within a Content Rule to copy it, but how can I move or remove the document? Just "document.remove()" doesn't</description>
      <pubDate>Fri, 13 Sep 2013 21:58:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288083#M241213</guid>
      <dc:creator>lcandido</dc:creator>
      <dc:date>2013-09-13T21:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to move or remove a document using the JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288084#M241214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you're using the Alfresco JavaScript API, the call to remove a node must be called from the parent of the node that you want to delete.&amp;nbsp; The call looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;parentNode.removeNode(childNode);&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Full JavaDoc of the JavaScript API of node can be found here &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;A href="http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/repo/jscript/ScriptNode.html" rel="nofollow noopener noreferrer"&gt;http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/repo/jscript/ScriptNode.html&lt;/A&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 22:09:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288084#M241214</guid>
      <dc:creator>parzgnat</dc:creator>
      <dc:date>2013-09-13T22:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to move or remove a document using the JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288085#M241215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;… as said The Beatles.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried to use your tip, but I'm really beginning. The code&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var pai = document.getParent()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var no = document.getNodeRef()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(call) pai.removeNode(no)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;hasn't worked. Would you extend your explanation with a functional example?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;More: Thanks to "Class ScriptNode" I've found the method "public boolean move(ScriptNode destination)" that will be very useful. Would be possible to send a short example?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot,&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2013 21:42:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288085#M241215</guid>
      <dc:creator>lcandido</dc:creator>
      <dc:date>2013-09-17T21:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to move or remove a document using the JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288086#M241216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can&amp;nbsp; just delete the node by using node.remove(),this method returns true on success, false otherwise&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to get it's parent please use node.parent(return primary parent node),or node.parents.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 01:10:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288086#M241216</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2013-09-18T01:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to move or remove a document using the JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288087#M241217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can&amp;nbsp; just delete the node by using node.remove(),this method returns true on success, false otherwise&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to get it's parent please use node.parent(return primary parent node),or node.parents.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 01:11:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288087#M241217</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2013-09-18T01:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to move or remove a document using the JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288088#M241218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've tried:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var no = document.getNodeRef()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var success = no.remove()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var pai = document.getParent()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var success = pai.removeNode(no)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var no = document.properties.node-uuid&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var success = no.remove()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No success at all. Please, just one example!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 21:35:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288088#M241218</guid>
      <dc:creator>lcandido</dc:creator>
      <dc:date>2013-09-18T21:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to move or remove a document using the JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288089#M241219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;By using document root object ,I guess you want to execute javascripts from the Data Dictionary on current document.Follow below &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;steps:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1.Create a file called testremove.js(or any name) and store it in Company Home&amp;gt;Data Dictionary&amp;gt;Scripts folder&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;if (document.mimetype == "application/msword")&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;document.remove();&lt;BR /&gt;}&lt;BR /&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;2.upload an ms word document in a space. for example, upload a document named toremove.doc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3.open the details view of the document. Click on Run Action and select Execute script. You can see your new script testremove.js ,select it and click OK.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4.Click on Finish to execute the action. This will run your javascript and your toremove.doc will be removed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Sep 2013 02:27:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288089#M241219</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2013-09-19T02:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to move or remove a document using the JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288090#M241220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;All this time I was working on a JavaScript code at space "data dictonary/scripts". But now the code is running. I belive the testing mode was wrong. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your helpful answer.&amp;nbsp; &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Sep 2013 21:36:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288090#M241220</guid>
      <dc:creator>lcandido</dc:creator>
      <dc:date>2013-09-19T21:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to move or remove a document using the JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288091#M241221</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;BR /&gt;&lt;SPAN&gt;i am a new for alfresco.Can any one help me out how to "Delete a specific version document using web services or using java script"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 08:50:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-move-or-remove-a-document-using-the-javascript-api/m-p/288091#M241221</guid>
      <dc:creator>gangadharjwala</dc:creator>
      <dc:date>2014-01-22T08:50:50Z</dc:date>
    </item>
  </channel>
</rss>

