jcr:lastModified vs cq:lastModified
Asked Answered
E

3

7

What is the significance of having 2 separate last modified dates(jcr:lastModified and cq:lastModified)? Is there a scenario where one of the dates gets updated and second one not. Cant we live with one of the last modified (maybe jcr) and use it everywhere?

My issue is, we have few queries and conditions in our application defined based of either of these dates and am confused if the usage is right.

Here is a sample: enter image description here

Elfriedeelfstan answered 15/4, 2016 at 9:10 Comment(1)
On cq:PageContent you only see the cq:lastModified and not jcr:lastModified. I think the rule is, that everything that gets modified through the CMS functionality updates the cq:lastModified and everything that is core JCR only uses the jcr:lastModified. I've never seen both on one node. Do you have an example?Andre
R
2

cq:lastModified is present at jcr:content node level, means it is available on all those nodes whose jcr:primaryType is cq:pageContent. Where as at all other nodes types jcr:lastModified is used. In general we can say that if any content is getting modified through aem functionality it will refer and update cq:lastModified and everything else that is using JCR core functionality will refer and update jcr:lastModified. Both properties can’t be present on the same node.

Read more at WHAT IS THE DIFFERENCE BETWEEN JCR:LASTMODIFIED AND CQ:LASTMODIFIED

Rettke answered 17/5, 2017 at 14:40 Comment(1)
The link is dead now.Siding
A
0

I think one should always check both properties. I'm currently facing the situation that updating an image with the ootb image dialog is not changing the cq:lastModified property. however, the jcr:lastModified property is either added or modified. This a very curious behavior I'd say. I'm not sure if I'm missing something in my dialog config:

Can be caused by the fact that the image tab is embedded in another dialog ... but I'm not sure

Augur answered 2/7, 2016 at 10:10 Comment(1)
Nopes. I cannot check for both properties coz it is not consistently populated. And I cannot put a condition like if present, then use the date. If there is a documented explanation of when either of them is populated, I can bridge the gaps and make code clean.Elfriedeelfstan
A
0

Any modification on page by an authoring activity i.e. on component dialogs or page properties dialog, it always associated with jcr:lastModified and jcr:lastModifiedBy properties on the respective nodes (i.e. if content modification is done on component then node type is nt:unstructured and if it is page properties like jcr:title then it is cq:pageContent).

For each content modification on the page as part of authoring activity, cq:lastModified and cq:lastModifiedBy properties on the jcr:content node gets updated; no matter on which component the modification have been done. Hence, if there is a modification on page properties like jcr:title then on jcr:content node, cq:lastModified, cq:lastModifiedBy, jcr:lastModified and jcr:lastModifiedBy property values get changed.

Anchie answered 30/12, 2017 at 8:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.