Run the workflow when activating the page without activating the page in CQ5

I will need to invoke the workflow whenever the content author clicks on the page. The workflow then sends a notification to the administrator, who then activates the page.

Let me explain this in more detail. There are 2 parts for this.

i) Whenever the content author modifies the page, he then goes to “ Activate page ” either from the sidekick attribute or from the page properties on the siteadmin site. However, it does not activate the page immediately, but calls up the workflow.

ii) The workflow will send a notification to the administrator, who then decides to activate the page. This bit is pretty ordinary, so there is no problem here.

All this is an attempt to make sure that nothing is published / activated if it has not been viewed by the administrator.

I tried setting up a ReplicationEvent listener that would invoke the workflow. It happens that the page is already activated before the workflow is called; ReplicationEvent occurs only after the Replication event (for example, Activate) has occurred (obviously!).

As indicated, I need to make sure that the page is not activated when the user clicks the activation button; which means that I need to change what the activation button does.

I tried to find online, but did not find anything, which made me believe that most of the CQ5 site code is hidden from us and cannot be changed (and not without reason).

So is there anything else anyone can think of that can help me achieve my requirement? Or should I give it back as a lost cause?

Thanks in advance and apologize for the long post

+7
adobe cq5
source share
2 answers

You can put authors in a user group that does not have replication permissions. When an author tries to activate a page without permissions, it automatically starts the request for activation workflow. I think the default configuration has one step for content approval and a separate step for activation. Both steps are mapped to the administrator user group. Workflows are located at http://localhost:4502/libs/cq/workflow/content/console.html , and you can double-click on the model to edit it.

+7
source share

You can use ( example ), which is something like a replication event listener, but is called before activation. A throw exception in the preprocess() method will stop the activation process and display an exception message.

However, a more elegant option is to use an ACL to prevent the user from activating the page. After that, clicking the Activate button will not publish the page, but rather will trigger the Activation Request workflow.

+4
source share

All Articles