Updated JCR Node | TimeStamp of File Un Affected

Avatar

Avatar

sudhag73425455

Avatar

sudhag73425455

sudhag73425455

02-04-2017

Hi All,

Use Case 1 -> Programmatically I check if a node exists from Java and if exists, I update jcr:data property of the jcs:content node.

Just to give you an idea node that gets modified programmatically is /content/fca-brands/na/ramtrucks/en_us/data/product_data/2017/jsons/accessories.js/jcr:content

Use Case 2 -> I got to CRX DE Lite and update some property on jcr:content node.

 

In Both cases above, if I go to this file accessories.js for which jcr:content node I updated and check the time stamp, I see it is NOT MODIFIED. It shows the creation timestamp only.

Is this expected? Can this behavior be altered to show the modified date when any property is changed ?

 

Thanks,

Sudha.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

942

Correct Reply

1.0K

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

942

Correct Reply

1.0K
Jörg_Hoh
Employee

04-04-2017

Hi,

you can use

jcrNode.SetProperty("cq:lastModified,Calendar.getInstance());

to set this property to the current time.

Jörg

Answers (3)

Answers (3)

Avatar

Avatar

sudhag73425455

Avatar

sudhag73425455

sudhag73425455

03-04-2017

Thanks for responding.

My use case is ,

1. The only way these nodes get changed is from the back-end Java code.

2. If the nodes are not present, the code creates them and adds the relevant content.

3. If the nodes are already present, code simply updates the jcr:data property of the node.

So if I have to manually set is this the best approach?

jcrNode.setProperty("jcr:lastModified", value);

Can you let me know how I should populate the value for this case?

I see the current value is 2017-03-22T22:50:32.275+05:30

Avatar

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

942

Correct Reply

1.0K

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

942

Correct Reply

1.0K
Jörg_Hoh
Employee

03-04-2017

Hi,

the jcr:modfied property is not maintained automatically with any JCR operation. You need to modify it explicitly.

Jörg

Avatar

Avatar

MC_Stuff

Avatar

MC_Stuff

MC_Stuff

03-04-2017

Hi Sudha, 

It should get modified. Please engage with support if it is reproducible.  

Thanks,