How to get original document object from link document object?

cancel
Showing results for 
Search instead for 
Did you mean: 
lex91
Active Member II

How to get original document object from link document object?

Jump to solution

Context:

I have created a link for a document with the "Copy to-> Create link" feature in alfresco share. I have the nodeRef and from that the document object of the link.

Question:

How do I get the original document's nodeRef or document object using the JS APIs? 

1 Solution

Accepted Solutions
krutik_jayswal
Senior Member II

Re: How to get original document object from link document object?

Jump to solution

When we create a link the type of content which is getting created is "app:filelink". There is property associated with this type named as cm:destination. This contains the details of actual nodeRef.

So in javascript you can get it by node.properties["cm:destination"].

View solution in original post

2 Replies
krutik_jayswal
Senior Member II

Re: How to get original document object from link document object?

Jump to solution

When we create a link the type of content which is getting created is "app:filelink". There is property associated with this type named as cm:destination. This contains the details of actual nodeRef.

So in javascript you can get it by node.properties["cm:destination"].

lex91
Active Member II

Re: How to get original document object from link document object?

Jump to solution

Thank you! That was what I was looking for.