Hi,
when working with Content Fragments or Templates and we modify them (as AEM devs), the property cq:lastModified gets updated accordingly after publishing locally.
We then need to make sure that cq:lastReplicated is present and not older than cq:lastModified. This process is conducted manually by developers.
Is there a way to have the values of cq:lastModified and cq:lastReplicated to change, but only when editors make updates (last modified) and push those updates (last replicated)?
Thanks,
Tina
Solved! Go to Solution.
Views
Replies
Total Likes
Hey @Tina2
So the short answer is NO. cq:lastModified will be updated when changes are pushed, and cq:lastReplicated will change only when you 'activate/publish' a resource. That's the out-of-the-box behavior. However, you could still customize when/what values these properties have on specific events. For example, you could create a workflow step that updates the values of the properties whenever the page or template is 'activated.' You can then create a launcher to listen for when this page/template/resource is activated and execute the custom process step. Another option is to create a replication listener that will do the job.
Hope this helps.
Hi,
These properties are out of the box, meaning they adhere to specific functionality. If you need them to be dependent on a critical process, the recommendation is to understand how they work before using them or creating new properties that vary according to your requirements.
In short, cq:lastModified will be updated with any update, and cq:lastReplicated will be updated once a replication event has been applied to a resource.
Hope this helps.
https://stackoverflow.com/questions/36642920/jcrlastmodified-vs-cqlastmodified
Hi Esteban, in truth the question is changed a bit as follows:
Is there a way to have the values of cq:lastModified and cq:lastReplicated to change, but only when editors make updates (last modified) and push those updates (last replicated)?
instead of having devs to manually update the cq:lastReplicated to a newer one.
Thanks a lot!
Hey @Tina2
So the short answer is NO. cq:lastModified will be updated when changes are pushed, and cq:lastReplicated will change only when you 'activate/publish' a resource. That's the out-of-the-box behavior. However, you could still customize when/what values these properties have on specific events. For example, you could create a workflow step that updates the values of the properties whenever the page or template is 'activated.' You can then create a launcher to listen for when this page/template/resource is activated and execute the custom process step. Another option is to create a replication listener that will do the job.
Hope this helps.
Hello @Tina2
All facts shared by @EstebanBustamante are correct.
In general, everyone will discourage you from doing this. In case of content issues, it will become difficult to trace when the modifications were done. Or did the developer forget to replicate stuff after modification.
It will only spiral into bigger maintenance issues. Its better that devs replicate the modified templates and CFM after they have done the edits.
Its more systematic and thus less error prone
@Tina2 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.