cancel
Showing results for 
Search instead for 
Did you mean: 

Document Action - Remove All

drozes
Champ in-the-making
Champ in-the-making
Hi guys;

I have a custom Content Model "myModel", I have some custom actions that get shown for only this model.

My question is - how would I remove all other document actions when this model is the node?

(i understand I can manually add my own evaluator to each of the normal document actions - but there must be a better way then adding it to over 20 other options)
3 REPLIES 3

jpotts
World-Class Innovator
World-Class Innovator
Unfortunately, I'm not aware of a better way.

Jeff

mikeh
Star Contributor
Star Contributor
One way would be to override the actionGroupId calculation in surf-doclist.lib.js. This would allow you to use a completely separate set of action group definitions for nodes of that type.

This area has changed very recently on HEAD (so not yet in a formal Community release), so be aware of that.

For 4.0.d and earlier:
- Override surf-doclist.get.js
- After the <import> add your own function to calculate the action group
DocList_Custom.calculateActionGroupId = function My_calculateActionGroupId(record, view)
{
   …
}
- You would check record.node.type for your custom model and prefix the actionGroupId, for example, for those nodes.

Currently on HEAD (i.e. what will likely be 4.0.e)
- You can do something similar to the above, although note you now have to supply an object with a resolve(itemJSON, view) function
- You can override the "resolver.doclib.actionGroupResolver" bean which now does the same calculation as the JavaScript used to, but now in Java source instead.


I'm not that familiar with the latter method, but can point the correct person to this topic should you hit problems.

Thanks,
Mike

Not applicable
Hi,
(this is my first post),
I'm browsing alfresco svn and i read on this new evaluator in this file.
I also read on new tag for extension file (<configuration>) in rm-extensions.xml (record management).
These two features are very interesting and I would use them in my projects.
when you release 4.0.e? Smiley Tongue