<?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 Need help on best practices in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/need-help-on-best-practices/m-p/219448#M172578</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all and thanks in advance for your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using Alfresco 3.2 and I am looking for advice on the best plan for passing documents around.&amp;nbsp; It seems like there are two ways: by path and by noderef.&amp;nbsp; There also seems to be something called the "current document" which I really don't get.&amp;nbsp; I am writing links (buttons, calls from AJAX code, whatever) that will go to web scripts which will edit certain aspects, manage workflow, etc. on a passed document.&amp;nbsp; So, it seems to me that I will be passing some reference to a document to each of these scripts.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The nodeRef seems like an obvious choice since (I assume) it is fixed in size and won't have any unexpected symbols (apart from colon and slash) and apparently I can simply do new Node(nodeRef) to get the node.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However it seems like a lot of people are using the full path to the document and then using userhome.childByNamePath(documentPath) to find the document's node.&amp;nbsp; The path, however, seems like it could potentially be very long indeed, and could have any random foreign character or symbol in it, and so I would have to use POST methods to send this to the script.&amp;nbsp; This doesn't seem like the best plan.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And maybe there is something fundamental that I'm missing, because when I look at some of the built-in web scripts they seem to not have any parameters passed in yet clearly they do work to a document.&amp;nbsp; Maybe they are using this "current document" thing that I've read references to, but haven't yet read anything clearly describing what this is.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note that I'm just learning Alfresco, so I may be missing something fundamental here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Mar 2010 08:12:50 GMT</pubDate>
    <dc:creator>sgartner</dc:creator>
    <dc:date>2010-03-02T08:12:50Z</dc:date>
    <item>
      <title>Need help on best practices</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/need-help-on-best-practices/m-p/219448#M172578</link>
      <description>Hi all and thanks in advance for your help.I am using Alfresco 3.2 and I am looking for advice on the best plan for passing documents around.&amp;nbsp; It seems like there are two ways: by path and by noderef.&amp;nbsp; There also seems to be something called the "current document" which I really don't get.&amp;nbsp; I am wri</description>
      <pubDate>Tue, 02 Mar 2010 08:12:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/need-help-on-best-practices/m-p/219448#M172578</guid>
      <dc:creator>sgartner</dc:creator>
      <dc:date>2010-03-02T08:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on best practices</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/need-help-on-best-practices/m-p/219449#M172579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I got this from a friend:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For what it’s worth, I have settled down on doing the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;I use noderef when ever I can. Especially when a doc ref as an argument between web scripts. Noderef, as you state, is shorter, and it remains the same even if the document moves. The Utilities object has a handy routine to get the ScriptNode object that has a given noderef (see &lt;A href="http://wiki.alfresco.com/wiki/3.2_JavaScript_API#Utility_Functions" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/3.2_JavaScript_API#Utility_Functions&lt;/A&gt;) utils.GetNodeFromString(&amp;lt;noderef&amp;gt;).&lt;BR /&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;I do use paths, and childByNamePath(), or childrenByXPath() when I want to do simple searches, or grab a directory to iterate through. &lt;BR /&gt;&lt;UL&gt;a.&amp;nbsp;&amp;nbsp;&amp;nbsp;There are cases where I know the directory name I want to iterate through, but not the noderef.&lt;BR /&gt;b.&amp;nbsp;&amp;nbsp;&amp;nbsp;There are rare cases where I know the filename and where it is, but not the noderef. &lt;BR /&gt;c.&amp;nbsp;&amp;nbsp;&amp;nbsp;Finally, there are cases where I want to search for files matching a given criteria.&lt;/UL&gt;3.&amp;nbsp;&amp;nbsp;&amp;nbsp;I have written only a couple of small scripts that act as either document actions, or as view templates for a document. In these two cases, Alfresco sets the ‘document’ object for me. However, the bulk of the time, the scrip is not working on a specific document, so the document object is not set.&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 00:28:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/need-help-on-best-practices/m-p/219449#M172579</guid>
      <dc:creator>sgartner</dc:creator>
      <dc:date>2010-03-03T00:28:56Z</dc:date>
    </item>
  </channel>
</rss>

