Expand my Community achievements bar.

SOLVED

Scheduler service in AEM 6.5?

Avatar

Level 7

Hi

My objective is to create a scheduler service that check all pages in a specific location in the content tree and verifies is the tags on these pages still exist. The reason for this task is that if a tag, which is referenced on a page is deleted, the reference remains in the property of the corresponding page.

 

What would be a preferred way to solve this?

 

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi @anasustic ,

 

To resolve your issue, you should write a sling event listener which should get triggered if there are any tag deletions in a particular path level and then your code should query the reference of that deleted tag and remove it. Hope this helps. 

 

Regards,

Hemalatha

View solution in original post

3 Replies

Avatar

Correct answer by
Level 4

Hi @anasustic ,

 

To resolve your issue, you should write a sling event listener which should get triggered if there are any tag deletions in a particular path level and then your code should query the reference of that deleted tag and remove it. Hope this helps. 

 

Regards,

Hemalatha

Avatar

Level 7

Thank you so much @Hemalatha I have two content locations with tags /content/cq:tags/path1 and /content/cq:tags/path2. These are then used in articles.

Avatar

Level 4

Make sure you are creating an event listener which should listen for updates in these paths - tags /content/cq:tags/path1 and /content/cq:tags/path2 and accordingly query the tags used in articles folder and update the same.