Hello Everyone,
I have project requirement which is when content author modifies the editable template structure/content/policies/anything and click publish template(below screenshot). It should publish automatically all the corresponding pages to publisher and invalidate dispatcher.
I want to implement this solution in AEM. How do i implement this one in AEM 6.5 as CS ?
Views
Replies
Total Likes
You need to configured the path in the osgi for which template path your event listener will be called.
So you write only one event listener and from osgi config you get the template paths.
example : https://helpx.adobe.com/ca/experience-manager/kb/ReplicationListener.html
I'm not aware of an AEM ootb feature that provides this feature. If it had been AEM 6.5 I would have suggested using dispatcher flush rules (link below).
However, that feature is not compatible with aem as a cloud service.
One custom approach could be using the AEM replication API within a custom servlet with aem as a cloud service, which of course can be customized to listen for the template publication event and replicate pages that you want using the replication API.
Replication API example-
@sreekanthsuggu Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
Hello @kautuk_sahni ,
Thanks for reply. I didn’t find solution anywhere and still looking for solution to implement
Thanks
sree
Hi @sreekanthsuggu
Why do you need to publish all the pages? Just to invalidate the cache?
Hello @arunpatidar ,
Thanks for reply ..
Can you explain what is the event handler/service/etc needs to write when CA clicks on "Publish template" in editable template.
Also i am thinking to use SCD to invalidate the cache. is it ok to use ?
Hi @sreekanthsuggu
You can listen to REPLICATION event and filter based on template path. There is no specific event on publish template
Hello @arunpatidar ,
I have to write this utility for many templates in application.
How can i write replication event for so many templates ?
thanks
Sree
You need to configured the path in the osgi for which template path your event listener will be called.
So you write only one event listener and from osgi config you get the template paths.
example : https://helpx.adobe.com/ca/experience-manager/kb/ReplicationListener.html
Thanks @arunpatidar and let me try this solution.
Hello @arunpatidar , I have created "ResourceChangeListener" and mapped with list of templates(what you recommend) but it's not triggering when CA clicks on publish template in editable templates it works only when template is modified .
what to do ?
HI @sreekanthsuggu
You have to write Replication Event Listner.
https://helpx.adobe.com/tr/experience-manager/kb/ReplicationListener.html
Views
Replies
Total Likes