cancel
Showing results for 
Search instead for 
Did you mean: 

get node by uuid

unknown-user
Champ on-the-rise
Champ on-the-rise
I can't seem to find a way to get the NodeRef by the uuid. I have the following information.


String uuid = "213-b…";
StoreRef storeRef = new StoreRef(protocolStr, storeStr);
NodeRef nodeRef = ?;

How do you get the NodeRef from a uuid? Do you have to perform a query? Thanks.
2 REPLIES 2

timster
Champ in-the-making
Champ in-the-making
I am wondering about this as well.  We are attempting to ascertain just how much information we need to encode in a string id value to be able to retrieve a node reference. 

To construct a nodeRef, the storeRef and id need to be supplied as an constructor.  But it would seem to me that in the 'NODE' table, a node could be looked up via the 'guid' column.  But there does not seem to be a way to do this via the API.  Is this on purpose?  What was the design intent for Alfresco's guid value. 

We want to be able to render a URL that contains a id value, that will allow us to fetch this node directly from the repository.  We do not want to make any assumptions on which store we are using.

So it seems to me that to generate an ID string for use in a URL, we will need to encode the store reference id as well along w/ the UUID, or if the UUID is all that is necessary to locate a Node, what is the suggested method to do this?

-tim

gavinc
Champ in-the-making
Champ in-the-making
A node can not be referenced by an id alone as the same node can appear in multiple stores, you therefore need to have a store reference as well as the guid.

We have several services that are accessed via URL, which sounds similar to what you are after. Have a look at http://wiki.alfresco.com/wiki/URL_Addressability to see how we reference nodes in a URL.