Displaying associations
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2009 05:50 AM
I've adapted the folder.get web script from the samples (I'm running Alfresco Community 3.2) in order to display content on our intranet.
I've also added a custom content type that holds related documents as associations, and I'm now trying to adapt the folder.get script further to display links to related documents (if the associations exist) below the link to the 'main' document.
I hope I've explained this well enough - can anyone give me some pointers on how to achieve this?
Thanks in advance.
I've also added a custom content type that holds related documents as associations, and I'm now trying to adapt the folder.get script further to display links to related documents (if the associations exist) below the link to the 'main' document.
I hope I've explained this well enough - can anyone give me some pointers on how to achieve this?
Thanks in advance.
Labels:
- Labels:
-
Archive
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2009 08:43 AM
Hi,
http://wiki.alfresco.com/wiki/3.0_JavaScript_API
will be a good starting point.
Note the ScriptNode API part of the Cookbook:
- assocs
- sourceAssocs
Cheers!
http://wiki.alfresco.com/wiki/3.0_JavaScript_API
will be a good starting point.
Note the ScriptNode API part of the Cookbook:
- assocs
A readonly associative array (map) of the target associations of the node. Each named entry in the array contains an Array of the ScriptNode objects on the end of the association. For example: mynode.assocs["cm:translations"][0].
- sourceAssocs
A readonly associative array (map) of the source associations to this node. Each named entry in the array contains an Array of the ScriptNode objects on the start of the association. For example: mynode.sourceAssocs["cm:translations"][0].
Cheers!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2009 07:59 AM
Thanks - that helps.
I'm a bit further on now, have got documents displaying with the associations listed beneath where they exist.
BUT the associations are node refs (e.g. workspace://SpacesStore/ae8813d6-11da-4a2f-8817-79426c5bc3a3). I've read about the DownloadContentServlet at http://wiki.alfresco.com/wiki/URL_Addressability but this servlet wants the file name, which I don't have.
So
i) Is there a way to get the file name of the content from the node ref so I can build the full URL for the DownloadContentServlet
or
ii) Am I barking up the wrong tree and there's a better way to get from my node ref associations to a 'download content' URL?
Thanks for the help, it is appreciated.
I'm a bit further on now, have got documents displaying with the associations listed beneath where they exist.
BUT the associations are node refs (e.g. workspace://SpacesStore/ae8813d6-11da-4a2f-8817-79426c5bc3a3). I've read about the DownloadContentServlet at http://wiki.alfresco.com/wiki/URL_Addressability but this servlet wants the file name, which I don't have.
So
i) Is there a way to get the file name of the content from the node ref so I can build the full URL for the DownloadContentServlet
or
ii) Am I barking up the wrong tree and there's a better way to get from my node ref associations to a 'download content' URL?
Thanks for the help, it is appreciated.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2009 04:05 PM
I've cracked it. My code is too ugly to post right now but I'm happy to share once I've tidied it up.

