01-28-2021 07:32 PM
Hi
Alfresco provides a rich set of REST apis(ACS REST api and CMIS REST apis(OASIS specification implementation) for external integration .
But for custom type upload of document - the mandatory field validation is not done . And content is uploaded -> node created in alfresco. However showing warning sign on the mandatory custom properties.
Ideally - it should give a bad request (400) , OR is there any way /configuration to have the mandatory fields(custom type , aspects) applied in REST calls?
Kindly note: I understand that -
a) We can create webscripts for upload of specific type and validation done.(extending)
b) UI can do validation on form .
Ranjeet
01-29-2021 02:58 AM
You should maybe check with the documentation on Alfresco data models about the "mandatory" vs. "enforced mandatory" configuration for model properties. Any property that is set as "mandatory" without having the "enforced" flag as "true" is not "hard mandatory" - meaning it is perfectly valid to create a node without the property being set and the expected result would indeed be that Alfresco flags the node as incomplete (with warning flags in the UI). Only if you have an "enforced mandatory" property not set during creation should you expect a failure - and I can say that the validation for that is completely independent of which API is used to create the node, so will definitely occur and fail even for the ReST API.
01-29-2021 02:58 AM
You should maybe check with the documentation on Alfresco data models about the "mandatory" vs. "enforced mandatory" configuration for model properties. Any property that is set as "mandatory" without having the "enforced" flag as "true" is not "hard mandatory" - meaning it is perfectly valid to create a node without the property being set and the expected result would indeed be that Alfresco flags the node as incomplete (with warning flags in the UI). Only if you have an "enforced mandatory" property not set during creation should you expect a failure - and I can say that the validation for that is completely independent of which API is used to create the node, so will definitely occur and fail even for the ReST API.
01-29-2021 09:51 AM
Many thanks Alex!!
That really helps!
Explore our Alfresco products with the links below. Use labels to filter content by product module.