cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the checked out noderef

xinyieric
Champ in-the-making
Champ in-the-making
Hello everyone,

I had a file named "A",
then I checked it out, and it copied to file "B".
Now how can i get file "B" by file "A" ?

Such as "search.findCopyNode(nodeA)"

Thanks!
3 REPLIES 3

pqr
Champ in-the-making
Champ in-the-making
File A node doesnt contains any refrence to checked out File B node.

But if you see node B then you can check it out - cm:copiedfrom aspect is applied and its property cm:source
where cm:source value will be File A noderef.

mikeh
Star Contributor
Star Contributor
var searchNodes = search.query(
{
   query: "+@cm\\:source:\"" + fileA.nodeRef + "\" +ISNOTNULL:cm\\:workingCopyOwner",
   language: "lucene",
   page:
   {
      maxItems: 1
   }
});
if (searchNodes.length == 1)
{
   fileB = searchNodes[0];
   …
}

Thanks,
Mike

xinyieric
Champ in-the-making
Champ in-the-making
Thanks everyone for you suggset.