Hi Team,
I am trying to create a event handler for deleting a page.First time , its calling up... but second time its not calling handleEvent() method..any clue??
What API are you using?
Views
Replies
Total Likes
Simple code snippet:
@Component(immediate = true)
@Service
@Property(name = EventConstants.EVENT_TOPIC, value = "com/day/cq/wcm/core/page")
public class SimpleResourceListener implements EventHandler{
public SimpleResourceListener(){
System.out.println("inside construc");
}
private Logger log =LoggerFactory.getLogger(this.getClass());
public void handleEvent(Event event) {
// TODO Auto-generated method stub
System.out.println("inside hanlder");
}
Now when I create a page, this handler reacts and logs the string "inside handler". Now when I activate the page second or third time, the Event handler does not react
Views
Replies
Total Likes
Does the Event handler fire when you create a 2nd page?
Views
Replies
Total Likes
Also - what AEM version are you using and how are you getting the Session?
Views
Replies
Total Likes
No , Event is firing on first time only ...AEM 6.0 SP2
If restart the bundle ... its firing a event...but not on second time again...
Views
Replies
Total Likes
I tried your code on 6.3.. The handlers are getting triggered correctly. When you say " I activate the page second or third time, the Event handler does not react", do you make any change before activating the page again?
When there is no change, activation is never really triggered, so corresponding event handle should not be called anyway
Views
Replies
Total Likes
Hi , Sorry .. I am not trying to replicate the page ...
I wanna trigger a event when i try to create a page or delete a page ...
So first time event is calling properly but not second time...
Example :
test - cq:page - working
test1-cq:page - not working
Views
Replies
Total Likes
In the HELPX article - it states. Have you configured your event handler to not timeout?
Event handling in Sling by default may timeout your event handler. To configure your event handler to ignore a timeout, perform these tasks:
Sorry ...I forgot to update the latest status on this...
I am able to get the events once I configured a package to ignore a timeout..
Views
Replies
Total Likes
That is great! I am going to update this article soon for use on 6.3.
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies