cq:lastReplicated property is not available in publish instance. | Community
Skip to main content
Level 2
October 6, 2023
Solved

cq:lastReplicated property is not available in publish instance.

  • October 6, 2023
  • 4 replies
  • 3265 views

I've a requirement to show the last 3 replicated assets every time a particular page is loaded. I can do so in author by using the 'cq:lastReplicated' property, but I don't see this property in publisher. However I saw a property called 'cq:lastReplicated_publish' in AEM publish, but it doesn't get updated based on the publication time. Is there another property in publisher that gets updated whenever an asset is published?

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

@sethia_varsha 
cq:lastReplicationAction, cq:lastreplicated and cq:lastReplicatedBy properties are not carried over to publish by design.

In order to carry over these properties disable the below component in author instance:  com.day.cq.replication.impl.ReplicationPropertiesFilterFactory

4 replies

Level 2
October 9, 2023

Hello @saravanan_dharmaraj 

Thanks for your reply!

 

I've gone through the link, but the concern in using ' jcr:created' property is that it doesn't get updated if an asset is republished (publishing an already published asset).

 

 Is there a property that gets updated when an asset is republished?

 

aanchal-sikka
Community Advisor
Community Advisor
October 6, 2023

Hello @sethia_varsha 

 

cq:Replicated properties are only for Author, since they are used in terms of replication.

 

A publish is Author = Create in publish

An unpublish in Author = Delete in publish

 

Thus, you can use jcr:created on Publish Instance

Aanchal Sikka
Level 2
October 9, 2023

Hi @aanchal-sikka 

Thanks for your reply!

 

The concern in using ' jcr:created' property is that it doesn't get updated if an asset is republished (publishing an already published asset).

 

 Is there a property that gets updated when an asset is republished?

 

aanchal-sikka
Community Advisor
Community Advisor
October 9, 2023

Hello @sethia_varsha 

 

I would suggest to check the metadata via http://localhost:4502/content/dam/abc.infinity.json

You should be able to identify, the metadata changes on subsequent replication.

 

Just append .infinity.json to the publish URL of asset and compare the 2 json

Aanchal Sikka
arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
October 9, 2023

@sethia_varsha 
cq:lastReplicationAction, cq:lastreplicated and cq:lastReplicatedBy properties are not carried over to publish by design.

In order to carry over these properties disable the below component in author instance:  com.day.cq.replication.impl.ReplicationPropertiesFilterFactory

Arun Patidar
Level 2
October 9, 2023

Hi @arunpatidar 

Thanks for your reply!

 

I've disabled the component in local and it seems to work as expected. However can I deploy this to higher environments? and if yes, how can I do it?

kautuk_sahni
Community Manager
Community Manager
October 9, 2023

@sethia_varsha 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.

Kautuk Sahni
Level 2
October 9, 2023

Hello @arunpatidar @aanchal-sikka @saravanan_dharmaraj @kautuk_sahni 

Thank you all for your replies!

 

I've noticed that '@jcr:content/renditions/original/jcr:created' property is updated in publisher with the latest date every time an asset is republished from author to publisher.