jcoder12
jcoder12

Reputation: 167

Obtaining path of associated documents in custom model in Alfresco

I have an association in custom model in alfresco as has been mentioned in the post: How do I associate one piece of content with another in Alfresco?

For properties, to get the name of the property I am using: var model = document.properties["sc:itemNo"];

How can I obtain the name and path where this image resides in the repository, using JavaScript.

Thanks!

Upvotes: 1

Views: 210

Answers (1)

Andreas Steffan
Andreas Steffan

Reputation: 6159

Assuming document has an association named sc:sampleAssoc and there is at least one association exsting for that node, you will get its full qname path like so:

var qNameOfAssocatiatedNode = document.assocs["sc:sampleAssoc"][0].qnamePath;

Be clear though that there may be more than one node at that path.

Upvotes: 2

Related Questions