scriptNode.sourceAssocs instead of assocs for targets?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2008 08:29 AM
Is there a way to get the source associations of a node? assocs returns only the target association.
I found org.alfresco.repo.jscript.ScriptNode.getSourceAssocs() in the code but I don't understand how the java object is hooked to the javascript object.
Thanks,
Marc
I found org.alfresco.repo.jscript.ScriptNode.getSourceAssocs() in the code but I don't understand how the java object is hooked to the javascript object.
Thanks,
Marc
Labels:
- Labels:
-
Archive
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2008 02:19 PM
I assume you have a dev/labs build as getSourceAssocs was only added to the JavaScript ScriptNode API in the last month or so. That is why it is not documented yet 
You want something like this
var sourceAssocs = node.sourceAssocs;
This returns a map of assoc qname to a list of nodes. Basically it works identically to the node.assocs Target Associations API that you have already used but it returns source assocs instead.
Kevin

You want something like this
var sourceAssocs = node.sourceAssocs;
This returns a map of assoc qname to a list of nodes. Basically it works identically to the node.assocs Target Associations API that you have already used but it returns source assocs instead.
Kevin

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2008 06:14 AM
Thanks Kevin, source and running instance were indeed out of sync
ops:. Everything is fine now.

