Expand my Community achievements bar.

Get pagemodification information in a replication event handler

Avatar

Level 2

Hi everyone,

I have built an event handler, which listens to replication events (@Property(name = "event.topics", value = { ReplicationAction.EVENT_TOPIC })).

Within the EventHandler I am catching "Activate" requests. Additionally we have two different versions of an activation, one is the standard page activation, PageEvent (VersionCreated) plus ReplicationEvent (Activate), the other one creates just the ReplicationEvent (Activate) without a PageEvent. What we want to achieve is the distinction of the above mentioned cases and write it to the audit log.

My question is: Is it possible to get the PageModification information at the ReplicationEventHandler and how (catch both event topics in one handler does not solve the problem)?

My other idea was to use a replication preprocessor. However I am not sure were to put the needed information, so that I could use it at my replication event handler.

I would appreciate any tips or hints of you.

Thanks in advance for your help!

Regards,
Marcus

3 Replies

Avatar

Level 10

Hi Marcus,

An example of PageMove event itself is combination of 2 events one is delete & other is create. In short it is possible to club multiple events & generate other events. Use JCR events & arrive your events based on updation of property.

Leaving above statement apart page modification & replication events in general won;t happen at same time.  To me looks like your business case does not make sense there might be easy solution. Can you please elobrate your business case with an example.  Also note activation also creates page version. 

Thanks,

Avatar

Level 2

Hi Sham,

thanks for your prompt reply and the given information.  Sorry for my late answer.

The business case, in a nutshell, is the following:

- implement your own replicator -> (de-)activate pages and use your own replication agent to handle the events (already in existence; without the audit log handling)

- write modified audit log entries (optinal: centralize write process to audit log with your own implementation)

For this reason I am searching for a convenient way to solve that issue.

 

If I understand you right I should implement an jcr event listener, event type PROPERTY_CHANGED?

As the relevant property I want to choose "jcr:versionHistory", what is your opinion about that?

During my analysis yesterday I found some other, hopefully possible solutions. On my opinion it could be also possible to modify our own replicator and post my own event with its own topic.

Another solution could be to implement a preprocessor catch the relevant replication actions and set an property which I could use in an sling replication event handler.

What do you think about that variants?

Thanks a lot for your help in advance.

 

Best regards,

Marcus

Avatar

Level 10

hi Marcus,

I was thinking more how to achieve without or less custamization. Since you already have own replicator, post  own event with its own topic sounds ok to me.

Thanks,