In some applications, it is useful to know when a repository item was most recently modified. The following item descriptor contains a last-modified property:
<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>
Three requirements apply:
The item descriptor contains a date or timestamp property that stores the last-modified value. This property must be persistent and single-valued:
<property name="lastActivity" data-type="timestamp"/>
The item descriptor sets the
last-modified-property
attribute to the name of the last-modified property:<item-descriptor name="article" last-modified-property="lastActivity">
The item descriptor sets the
updateLastModified
<attribute>
element totrue
:<attribute name="updateLastModified" value="true"/>
Given this example, an article
item’s lastActivity
property is updated with the current time when the item is added or updated.