<?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 Problem with Script in Alfresco 3 in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/problem-with-script-in-alfresco-3/m-p/226773#M179903</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;We are having a problem with a Script from the Alfresco JavaScript API that we have built in a previous version 2.9 and which workded fine and that now in Alfresco 3.0 (new system we have installed to move the data to) is crashing and we dont know why as it is pretty simple&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically what we want to do is creating a script to be executed by a space rule so when a pdf document appears in the space, the script should look for a "tiff" document with the same name in the same space and remove it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As I said it is pretty simple and it worked fine in 2.9. Here is the code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;var nombrepdf = document.name;&lt;BR /&gt;var nombretif = nombrepdf.replace("pdf","tif");&lt;BR /&gt;var borrado = space.childByNamePath(nombretif);&lt;BR /&gt;&lt;BR /&gt;/*Finds the pdf in the space and deletes the tiff*/&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if (borrado != null) &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; borrado.remove();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&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;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;Now this gives us this error: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;org.alfresco.service.cmr.repository.InvalidNodeRefException: Node does not exist: workspace://SpacesStore/21b13f3c-6e64-4185-96e5-2acb8377e4c9&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas of what is wrong????&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2009 17:45:47 GMT</pubDate>
    <dc:creator>mrey</dc:creator>
    <dc:date>2009-10-29T17:45:47Z</dc:date>
    <item>
      <title>Problem with Script in Alfresco 3</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/problem-with-script-in-alfresco-3/m-p/226773#M179903</link>
      <description>Hi allWe are having a problem with a Script from the Alfresco JavaScript API that we have built in a previous version 2.9 and which workded fine and that now in Alfresco 3.0 (new system we have installed to move the data to) is crashing and we dont know why as it is pretty simpleBasically what we wa</description>
      <pubDate>Thu, 29 Oct 2009 17:45:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/problem-with-script-in-alfresco-3/m-p/226773#M179903</guid>
      <dc:creator>mrey</dc:creator>
      <dc:date>2009-10-29T17:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Script in Alfresco 3</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/problem-with-script-in-alfresco-3/m-p/226774#M179904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've tested your script in both 3.2 Enterprise Beta and 3d Labs and it works fine. I suspected maybe it was a problem of your script finding the deleted node, so I tested it more than once but I couldn't get it to fail.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you stepped through your script with the Rhino JavaScript debugger GUI to see if that gives you any idea what's happening? For example, can you confirm that the node ref it complains about not being able to find is actually the node ref of the file with TIF in the name? (Like maybe it is finding the wrong node or something).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, where are you running the script from? Maybe you are executing the script and it is working fine, but then something else is trying to work with the node (like a behavior, for example) and it is choking because the node's been removed?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2009 21:08:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/problem-with-script-in-alfresco-3/m-p/226774#M179904</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2009-10-30T21:08:32Z</dc:date>
    </item>
  </channel>
</rss>

