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
Solved! Go to Solution.
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.
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.
Many thanks Alex!!
That really helps!
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.