Start a workflow on page activation without activa

2019-03-27 14:45发布

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

标签: adobe cq5
2条回答
不美不萌又怎样
2楼-- · 2019-03-27 15:20

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 at http://localhost:4502/libs/cq/workflow/content/console.html and you can double click on a model to edit it.

查看更多
劫难
3楼-- · 2019-03-27 15:36

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.

查看更多
登录 后发表回答