Disabling checkout option for particulate type of file

kirit
Champ on-the-rise
Champ on-the-rise
I need to disable the checkout option or icon for a particular type of file.
lets say, for any pdf file I do not want to provide checkout functionality for all the users.

So where do I need to make the changes in alfresco configuration or do I need to add some customized code?
2 REPLIES 2

kirit
Champ on-the-rise
Champ on-the-rise
Hey!! I got the solution for this.
There is a evaluator (e.g CheckoutDocEvaluator.java) for each of the options/buttons,
so we can extend the same and add our custom code!! don't forget to make your new class entry in web-client-config-custom.xml file.
If anybody has any other trick let us know.

Extending the class…

public class ExtCheckoutEvaluator extends CheckoutDocEvaluator
{
   @Override
   public boolean evaluate(Node node)
   {
      boolean status = false;
      //……
      // add your custom logic here…
      //……
      return status;
   }
}
‍‍‍‍‍‍‍‍‍‍‍‍‍‍


Entry in web-client-config-custom.xml file

<action id="checkout_doc">
    <evaluator>com.alfrescoexploration.customAction.ExtCheckoutEvaluator</evaluator>
    <label-id>checkout</label-id>
    <image>/images/icons/CheckOut_icon.gif</image>
    <action-listener>#{CheckinCheckoutBean.setupContentAction}</action-listener>
    <action>dialog:checkoutFile</action>
    <params>
       <param name="id">#{actionContext.id}</param>
    </params>
</action>
‍‍‍‍‍‍‍‍‍‍‍‍

rodrigopetter
Champ in-the-making
Champ in-the-making

kirit _ Does this Approach work only for the alfresco share interface or with the REST API or CMIS will work too?