AnsweredAssumed Answered

Add context menu item only if aspect present

Question asked by nicolasraoul on Jan 23, 2012
Latest reply on Jan 23, 2012 by nicolasraoul
In Alfresco Share's document library, each document has a context menu with items like "Upload New Version".
I want to modify this context menu and add a "Warp" action.
But this action should only be visible if the document has the "Warpable" aspect.

What is the usual way to do this?
I plan to do something like the following, is it possible?

tomcat/webapps/share/WEB-INF/classes/alfresco/share-documentlibrary-config.xml :
         <action id="warp" type="javascript" label="actions.document.warp">
            <param name="function">onActionWarp</param>
            <evaluator negate="true">evaluator.doclib.action.hasAspect("warpable")</evaluator>

custom-slingshot-nicolas-raoul-context.xml :
<?xml version='1.0' encoding='UTF-8'?>
   <bean id="evaluator.doclib.action.warpable" class="org.alfresco.web.evaluator.HasAspectEvaluator">
      <property name="aspects">

Am I missing something?