I googled a lot but couldn’t find any tutorial on Event Listeners or Handlers in Adobe Cq5.4,
Please can anyone suggest me a good tutorial or let me know steps to implement Event handler using Adobe cq 5.4 and Java.
Also please suggest a tutorial for Listeners that listens to the event of Page activation.
Advanced Thanks,
Yash
This Adobe blog post covers the JCR observation & event handling quite well:
http://experiencedelivers.adobe.com/cemblog/en/experiencedelivers/2012/04/event_handling_incq.html
In essence, you create an OSGi component that implements EventListener, and the onEvent method is called for each set of events that has been fired (it can receive multiple events sometimes). The activate method has to register the listener with a call to addEventListener and specify the types of event, path, etc. Full specs and more information are here:
http://www.day.com/specs/jcr/2.0/12_Observation.html
I hope this helps,
Antony