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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

How can I keep jcr:lastModified updated when using a content package?

Avatar

Level 5

I created this content package:

-> jcr_root -> tmp -> .content.xml:

<?xml version="1.0" encoding="UTF-8"?>

<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"

          jcr:primaryType="sling:Folder"

          property1="property 1"/>

-> META-INF -> filter.xml:

<?xml version="1.0" encoding="UTF-8"?>

<workspaceFilter version="1.0">

    <filter root="/tmp" mode="update" />

</workspaceFilter>

Before I install:

Screen Shot 2019-07-22 at 22.11.16.png

After:

Screen Shot 2019-07-22 at 22.16.36.png

As you can see, my package updates the property but it doesn't update the jcr:lastModified date (in fact there isn't one). Is there a way that I can configure it so that the jcr:lastModified date will be updated when the package is installed?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

You can write custom resource listener. So, if there's any change happens in content hierarchy then whichever paths gets updated, you can update jcr:modified property for it.

2 Replies

Avatar

Employee Advisor

the PackageManager does not support this.

Avatar

Correct answer by
Community Advisor

You can write custom resource listener. So, if there's any change happens in content hierarchy then whichever paths gets updated, you can update jcr:modified property for it.