cancel
Showing results for 
Search instead for 
Did you mean: 

Get Node content modification time

eureka
Champ in-the-making
Champ in-the-making
Is it possible to get the modification date of one node's content?
I know there is the auditable aspect's proerty cm:modified, but it gets updated even if you edit any of the node's properties.
Do I have to add a custom property to be updated onContentUpdate?
Do I have to modify the auditable behaviour?

I've searched the forum and the issues, but found only topics relatesd to preserve node content creation time and so.

Thank in advance for any answer or hint.

Regards,

Angelo
7 REPLIES 7

mitpatoliya
Star Collaborator
Star Collaborator
I think what you are looking for is the date on which the document itself is updated not its metadata is it the case?
Please confirm

mrogers
Star Contributor
Star Contributor
There are no separate properties for the modification time of properties of type content.    

Further thoughts:
a) It would be fairly easy to add a new custom property driven by a policy when content is updated.

jspuchau
Champ in-the-making
Champ in-the-making
Hi,

I think that Alfresco stores the content in the content store depending on the date it was modified.

So you only have to parse the contentUrl metadata property on the node. You can check if this is true on a node browser.

Regards

mrogers
Star Contributor
Star Contributor
While that may work for some cases the layout of the content store is not intended to be queried like that.    Yes the repository is by default laid out in that way in order to assist with incremental back up, however be aware that you can add content on any path so its not guaranteed to work.

eureka
Champ in-the-making
Champ in-the-making
Hi all,

thanks for all your replies.

Yes, I was thinking to the date when the content of the node is actually updated. I think I can add a property to my base class and bind a behaviour to the onContentUpdatePolicy that update this property.
My concern is how to handle all the nodes already there in the repository.
Is it somehow possible to default the property value of my newly added modifcation time property to the value of last cm:modified?

@jspuchau
I need a property to exec lucene queries agaainst. I don't think i can retrieve that information, am I wrong?

Regards

mitpatoliya
Star Collaborator
Star Collaborator
Yes you can do it easily.
You can simply create a script which will copy default modified date value to your new property for all the existing contents.
And you can attache that script with rule and apply that rule to folder under which all your contents are lying.

eureka
Champ in-the-making
Champ in-the-making
@mitpatoliya: it doesn't work because you can apply a space rule to content that
1) are created or inserted in the folder
2) are udated
3) are moved ore delted

Content already there doesn't get picked by any of these condition Smiley Sad