Hi All,
I am trying to get the result of pages which are published in author instance. But I am not able to get the correct results as newly created pages from a published template is taking 'cq:lastReplicated' & 'cq:lastReplicationAction' properties from the template. So even if we are not publishing that newly created page, we are seeing these properties being added in the jcr:content from the template as the template was already published.
Can anyone please help on this how we can remove these properties from newly created pages/ draft pages which hasn't been published?
Solved! Go to Solution.
Views
Replies
Total Likes
Please do not read these properties directly, as technically they are an implementation detail.
Rather do something like this:
ReplicationStatus status = page.adaptTo(ReplicationStatus.class); if (status.getAvailableAgents("preview")) { // status available for preview boolean canBeViewedOnPreview = status.getStatusForAgent("preview").isActivated(); }
Hello,
Can you check if one of below property helps you there??
cq:lastReplicated_publish
cq:lastReplicatedBy_publish
Thanks!!
hi Pawan,
Thanks for the suggestion but I am not seeing these properties in the page jcr:content. I am generating the result in author and not from the publish environment. I have to get the list of pages which are activated/published from the authors. So while doing so, I am getting those pages also in the list which are newly created and not activated/published. This is because its taking the lastreplicated property from the template used for creating the page.
Thanks & Regards,
Abhishek
Hi Abhishek,
I think you answer the question. if those properties are not available then you can use that as condition to know the pages which are not published because when you publish pages, these two properties should populate corresponding values.
I hope you understand it now.
Thanks!!
Please do not read these properties directly, as technically they are an implementation detail.
Rather do something like this:
ReplicationStatus status = page.adaptTo(ReplicationStatus.class); if (status.getAvailableAgents("preview")) { // status available for preview boolean canBeViewedOnPreview = status.getStatusForAgent("preview").isActivated(); }
Thanks for adding that, i think i missed mentioning. My intention about sharing those properties to mainly query from AEM console to find out those pages from authoring/local search into site path.
Views
Likes
Replies