2

In Alfresco, how to disable actions in multiselect drop down. Assume I have delete couple of files. So i am selecting all those files. Now, if any of the selected files have a specific aspect then the delete option should not be enabled. How can I achieve this?

This is what I tried. But no luck.

<action type="action-link" id="onActionDelete" label="menu.selected-items.delete" notAspect="p:hasSecondaryParent" />

My expectation here is if any of the selected items have "p:hasSecondaryParent" aspect then I do not want the "Delete" action in "Selected Items" drop down. All other time it should display

sabtharishi
  • 3,141
  • 5
  • 24
  • 27

1 Answers1

0

You need to create action evaluator for that. There is out of box has aspect evaluator available which you need to utilize set your custom aspect in that evaluator. Now add that evaluator in config of delete action. Restart server And that's it.

Ex.

 <bean id="evaluator.doclib.indicator.exifMetadata" class="org.alfresco.web.evaluator.HasAspectEvaluator">
  <property name="aspects">
     <list>
        <value>exif:exif</value>
     </list>
  </property>

This is example from out of box context file you need to replace aspect name and id of evaluator. Then Add this evaluator in your action config.

 <config evaluator="string-compare" condition="DocLibActions">

  <actions>
     <!-- Download document -->
     <action id="custom-action" type="link" label="customaction">
        <evaluator>evaluator.doclib.indicator.exifMetadata</evaluator>
     </action>
  </actions>

mitpatoliya
  • 2,037
  • 12
  • 23