0
votes

When an author tries to activate a page without the permissions, it automatically starts the default CQ "Request For Activation Workflow". I have a custom workflow I created, Is it possible to either make this the default workflow so that when users without replicate permissions try to activate a page my "custom workflow" gets triggered.

OR

Apply some listener to my workflow to be triggered on page activation without using replication preprocessor.

IN SUMMARY

Activate button won't publish the page but will rather invoke "custom workflow" as opposed to default "Request for Activation workflow". I am using CQ version 5.6.1

Kindly Assist :)

1

1 Answers

0
votes

If it is for pages, try over riding the siteadmin to /apps and on activate action menu(condition property) write a ext function to check the permission. Depending on the permission you can disable or enable the activate action.

same steps for assets also can be applied except over riding the damadmin instead of siteadmin node from libs sample ext function:

/*
    * This for enable/disable the activate on damadmin
    */
    CQ.wcm.DAMAdminExtn.checkConditions = function() {
        var paths = [];

        var admin = CQ.Ext.getCmp(window.CQ_SiteAdmin_id);
        if (admin) {
            var selections = admin.getSelectedPages();  
            for (var i=0; i<selections.length; i++) {
                try {
                  paths.push(selections[i].id);
                } catch (e) {}
            }     
        }var returnVar = false;
         $.ajax({// check the permission from servlet call
              url:"/apps/activateCheck",
             data:{"paths":paths}, 
             type:'POST',
              success:function(result){
                  var resultRes = result.status;
                  //var resultRes = result;
                  if(resultRes == "enable"){
                    returnVar = true;
                  }
              }, 
              async: false
          }); return returnVar;};