AnsweredAssumed Answered

Need help on best practices

Question asked by sgartner on Mar 2, 2010
Latest reply on Mar 3, 2010 by sgartner
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.  It seems like there are two ways: by path and by noderef.  There also seems to be something called the "current document" which I really don't get.  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.  So, it seems to me that I will be passing some reference to a document to each of these scripts. 

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. 

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.  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.  This doesn't seem like the best plan.

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.  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.

Note that I'm just learning Alfresco, so I may be missing something fundamental here.