Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Are there any utilities for "touch"ing a node in CQ 5?

Avatar

Level 7

Hi,

In CQ, some nodes use cq:lastModified, cq:lastModifiedBy, etc. to store the last modification time stamp and user.

Some other nodes use jcr:lastModified, jcr:lastModifiedBy, etc. to store that information.

If we edit a node, for example a node of type "cq:Page", using the JCR API and save it, cq:lastModified, cq:lastModifiedBy won't be updated to reflect the change.

We have written a utility class to work around this issue, but is there a built-in way to update the correct set of modification metadata properties when a node is saved/updated?

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 10

OOB will update cq:lastModified, cq:lastModifiedBy correctly & if that is not the case file a daycare with reproduce scenario.  The jcr api is low level api & Page & asset api are high level and might set the additional properties to take of other use cases. SO there might be difference on how you are saving. 

For your custom usecase write an listener & update desired properties accordingly.
  

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

OOB will update cq:lastModified, cq:lastModifiedBy correctly & if that is not the case file a daycare with reproduce scenario.  The jcr api is low level api & Page & asset api are high level and might set the additional properties to take of other use cases. SO there might be difference on how you are saving. 

For your custom usecase write an listener & update desired properties accordingly.