cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco System Properties - Override

MJay
Champ in-the-making
Champ in-the-making

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,

1 REPLY 1

abhinavmishra14
World-Class Innovator
World-Class Innovator

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. 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)