I'm working on a project in which I've developed an action that's working fine as a rule, as a doclib action on a document and as an action in the document detail page in Share using Alfresco CE 6.2-GA. For this I followed Jeff Potts excellent tutorial: http://ecmarchitect.com/alfresco-developer-series-tutorials/actions/tutorial/tutorial.html. I'm using the All-In-One SDK project, version 4.1, in Eclipse. I now need to apply this logic to a group of documents selected by the user in the multi select drop down menu. I don't need user interface like for example "Download as Zip".
I got my new menu item with icon in the drop down list which I configured in an extension module my-custom-share.xml file in a <multi-select> tag. It looks like this:
I built the project and tested. I was expecting my menu to do the same as "Download as Zip" but nothing happens. I went into the Share container and found the actions.js file in webapps/share/components/documentlibrary/actions.js. My custom "my-multitag-actions.js" is inside webapps/share/WEB-INF/lib/my-custom-share-1.0-SNAPSHOT.jar. I found that if I paste the onActionMultiTag code into webapps/share/components/documentlibrary/actions.js and restart the container my menu selection works like "Download as Zip".
I suppose the problem is how or where to override actions.js (among other potential problems further on).
Can anybody point me to a tutorial for creating a multi-select action from scratch? I've searched all over and haven't found any complete reference of how to do this.
The only thing that they are lacking is a description on the difference in call parameters between multi-select and single item actions. While a single item action will get a "record" parameter of a single object, the multi-select actions get a "records" parameter, which is an array of the same kind of objects. Since the action registered via the official extension point is registered both with the toolbar (multi-select) and the document list (single item), it can be called in both ways and needs to be aware of that, if it wants to support both use cases.
In the meantime I've wrapped my action logic in a Java class webscript where I call the action logic in a loop for each NodeRef. It might not be the best way but performance is not an issue in this case. I call my webscripot this way: