AnsweredAssumed Answered

Force refresh after Share custom action

Question asked by warinner on Mar 21, 2011
Latest reply on Mar 21, 2011 by warinner
I have a couple of custom actions for Share that I have gotten working but for one pesky detail: the actions add or remove aspects and properties that will in turn affect the display of items on the action menu.

For example, in document-actions.get.config.xml, I have the following:


      <actionSet id="document">
         <action type="action-link" id="onActionArchive" permission="archive" label="actions.document.archive" />     
         <action type="action-link" id="onActionRestore" permission="restore" label="actions.document.restore" />

In evaluator.lib.js, I have the following:


   documentAndFolder: function Evaluator_documentAndFolder(node, permissions, status, actionLabels)
   {



      /* Set permissions for archiving */
     try
     {
         /* restore only if archived */
         if (node.hasAspect("ra:archived"))
         {
           permissions["restore"] = true;
         }
     
         /* always allowed to archive */
         permissions["archive"] = true;
      }
      catch (e)
      {
         /* eat exception thrown if Folders archiving not installed */
         logger.log("Folders archiving content model is not installed!");
      }

     …


The custom archive ultimately invokes a Java backed webscript that among other things, adds the ra:archived aspect to the target node.

However, after the action has been executed, the old action menu is still displayed, i.e., the onActionRestore action is not displayed. Manually refreshing the page will cause the action menu to display the onActionRestore action in the menu but I am looking for some way to do this programmatically.

N.B. I have equivalent actions defined for Explorer. In Explorer, I have a JSF bean that does a


         UIContextService.getInstance(FacesContext.getCurrentInstance()).notifyBeans();


to refresh after the action. I am looking for its Share equivalent.

Andrew Warinner

Outcomes