In some applications, it is useful to know when a repository item was last modified most recently. You can set up a special property to store the last-modified time of a repository item. To configure a last-modified property:
Add a last-modified property to the item descriptor. This property must be a persistent, single-valued property. Its datatype must be a date or a timestamp. For example:
<property name="lastActivity" data-type="timestamp"/>
Add the
last-modified-property
attribute to the item descriptor and set its value to the name of your last-modified property. For example:<item-descriptor name="article" last-modified-property="lastActivity">
Include an
updateLastModified
<attribute>
element in the item descriptor with its value set totrue
. For example:<attribute name="updateLastModified" value="true"/>
The item descriptor might look like this:
<item-descriptor name="article" last-modified-property="lastActivity"> <attribute name="updateLastModified" value="true"/> <table name=ARTICLES type="primary" ...> <property name="lastActivity" data-type="timestamp"/> ... </table> </item-descriptor>
When items of this type are added or updated, the lastActivity
property is updated with the current time.