06-30-2020 05:18 PM
Hi,
Could anyone advise if it is possible to custom define/override the system-audit attributes while inserting a new document/content into Alfresco using REST-API POST request end-point - e.g.: cm:created, cm:modified ??
Thanks,
06-30-2020 08:34 PM
As far as i know, you can not override the default auditable properties such as creator, created, modifier, modified etc by any means. These properties are protected and mandatory by design.
See the auditable aspect which is defined in default content model:
<aspect name="cm:auditable"> <title>Auditable</title> <properties> <property name="cm:created"> <title>Created</title> <type>d:datetime</type> <protected>true</protected> <mandatory enforced="true">true</mandatory> <index enabled="true"> <atomic>true</atomic> <stored>false</stored> <tokenised>both</tokenised> <facetable>true</facetable> </index> </property> <property name="cm:creator"> <title>Creator</title> <type>d:text</type> <protected>true</protected> <mandatory enforced="true">true</mandatory> <index enabled="true"> <atomic>true</atomic> <stored>false</stored> <tokenised>true</tokenised> <facetable>true</facetable> </index> </property> <property name="cm:modified"> <title>Modified</title> <type>d:datetime</type> <protected>true</protected> <mandatory enforced="true">true</mandatory> <index enabled="true"> <atomic>true</atomic> <stored>false</stored> <tokenised>both</tokenised> <facetable>true</facetable> </index> </property> <property name="cm:modifier"> <title>Modifier</title> <type>d:text</type> <protected>true</protected> <mandatory enforced="true">true</mandatory> <index enabled="true"> <atomic>true</atomic> <stored>false</stored> <tokenised>true</tokenised> <facetable>true</facetable> </index> </property> <property name="cm:accessed"> <title>Accessed</title> <type>d:datetime</type> <protected>true</protected> <index enabled="true"> <atomic>true</atomic> <stored>false</stored> <tokenised>both</tokenised> </index> </property> </properties> </aspect>
However, if you have a very specific requirement then, you can create custom properties (to map created, modified info) in your custom content model and set the values as needed.
Explore our Alfresco products with the links below. Use labels to filter content by product module.