Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

cq:lastReplicated date available on publish

Avatar

Avatar
Give Back 5
Level 3
minisanu
Level 3

Likes

9 likes

Total Posts

43 posts

Correct Reply

2 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 5
Ignite 3
View profile

Avatar
Give Back 5
Level 3
minisanu
Level 3

Likes

9 likes

Total Posts

43 posts

Correct Reply

2 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 5
Ignite 3
View profile
minisanu
Level 3

12-10-2017

Hi Everyone,

We are dynamically fetching values from one page to another. Based on the cq:lastReplicatedDate  of one page we are doing a sorting and showing up the details on another page.If cq:lastReplicated is not there , then the values will not be sorted and we will not get details on another page.

We need the cq:lastReplicatedDate in publish environment also.How can we achieve this. We know cq:lastReplicatedDAte will not available in publish,but how can we resolve this issue?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,090 likes

Total Posts

3,123 posts

Correct Reply

1,063 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,090 likes

Total Posts

3,123 posts

Correct Reply

1,063 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

12-10-2017

Hi,

the cq:lastReplicated will be created/updated on author after the replication has happened. That also means, every property "cq:lastReplicated" you see on publish shows the replication date of the last replication; that would typically render it useless for your purpose.

If you really want to have such a property, I see 2 options:

1) Create a listener on publish which sets the current date as "lastChanged" property whenever the page changes. This works under the assumption, that pages on publish are only changed when they are replicated.

2) If you run replication already in a workflow, add a dedicated workflow step which adds the current time as "replicationDate" to the page. It might not be accurate, but when you only need relative order of pages it should work.

In both cases you now have a date, which is written under clearly defined circumstances you control. Relying on properties maintained by the produt itself will not give you this confidence.

Jörg

Answers (4)

Answers (4)

Avatar

Avatar
Validate 1
Level 3
arjun07180302
Level 3

Likes

14 likes

Total Posts

36 posts

Correct Reply

8 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 3
arjun07180302
Level 3

Likes

14 likes

Total Posts

36 posts

Correct Reply

8 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
arjun07180302
Level 3

12-10-2017

The publish environment does not have cq:lastReplicated property. The equivalent property on a page that you would get to see on publish instance is, jcr:created. This property gets updated every time a page is published. So, technically jcr:created property's value in publish instance and cq:lastReplicated value in author instance will almost always identical. See if you can use either of these properties based on your WCM mode(author/publish) to sort the values.

Avatar

Avatar
Give Back 5
Level 3
minisanu
Level 3

Likes

9 likes

Total Posts

43 posts

Correct Reply

2 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 5
Ignite 3
View profile

Avatar
Give Back 5
Level 3
minisanu
Level 3

Likes

9 likes

Total Posts

43 posts

Correct Reply

2 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 5
Ignite 3
View profile
minisanu
Level 3

30-11-2017

Thanks Jorg.Sorry for the delayed response.

Avatar

Avatar
Validate 1
Level 3
arjun07180302
Level 3

Likes

14 likes

Total Posts

36 posts

Correct Reply

8 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 3
arjun07180302
Level 3

Likes

14 likes

Total Posts

36 posts

Correct Reply

8 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
arjun07180302
Level 3

12-10-2017

I agree. But there is a catch, jcr:created property gets updated for every publish(regardless of the modifications to the page) where as cq:lastModified property will be updated only when the page is modified. A mere publish without modifying the page will not update cq:lastModified but it does update jcr:created property. So, either of those can be used for sorting the articles.

Avatar

Avatar
Boost 3
Level 2
digitalect-expe
Level 2

Likes

4 likes

Total Posts

10 posts

Correct Reply

2 solutions
Top badges earned
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Boost 3
Level 2
digitalect-expe
Level 2

Likes

4 likes

Total Posts

10 posts

Correct Reply

2 solutions
Top badges earned
Boost 3
Boost 1
Affirm 1
View profile
digitalect-expe
Level 2

12-10-2017

You can use jcr:created if the page is newly created i.e. the page was not available but after replication it is created/made avaialble. And if the page is already available, then you can use cq:lastModified property. This will serve the purpose.

Thanks.