I would need to call a workflow whenever a content author clicks activate on a page. The workflow would then send a notification to the administrator, who then proceeds to activate the page.
Let me explain this with some more detail. There are 2 parts to this
i) Whenever a content author is done modifying a page, he would then proceed to click "Activate Page" from either the sidekick or from page properties on the siteadmin. By doing so, he is not activating the page straight away but calling a workflow.
ii) The workflow will send out a notification to the admin, who then decides to activate the page. This bit is fairly ordinary, so no issues here.
All of this is an effort to make sure that there is nothing published/activated unless it has been reviewed by an admin.
I tried setting up a ReplicationEvent listener that would call a workflow. What happens is that the page is already activated before the workflow is called; the occurrence of a ReplicationEvent is only after said Replication Event (i.e Activate) occurs (Obviously!).
As stated, I need to make sure that the page isn't actually activated when the user clicks activate; which means I need to modify what the activate button does exactly.
I have tried looking up online, but found nothing, which leads me to believe that most of CQ5's siteadmin code is hidden from us and cannot be modified (and with good reason).
So is there anything else that anyone can think of which may help me to achieve my requirement? Or should I give this up as a lost cause?
Thanks in advance and apologies for the long post
You could put the authors in a user group that does not have replication permissions. When an author tries to activate a page without the permissions, it automatically starts the
request for activation
workflow. I think the default config has one step for content approval and a separate step for activation. Both steps are mapped to the administrator user group. The workflows are athttp://localhost:4502/libs/cq/workflow/content/console.html
and you can double click on a model to edit it.You can use replication preprocessor (example) which is something like replication event listener but is invoked before the activation is done. Throwing exception in the
preprocess()
method will stop activation process and display exception message.However, more elegant option is to use ACL to forbid an user to activate the page. After that, clicking Activate button won't publish the page but will rather invoke Request for Activation workflow.