Hello Alfresco Community,
I'm using alfresco-client-sdk (developed by Jean Marie Pascal and Gavin Cornwell). I'm wondering how to update node's secondaryChildren.
NodesAPI's createNodeCall method accepts a NodeBodyCreate object. NodeBodyCreate object could be instantiated with a List of ChildAssociationBody as secondaryChildren parameter.
However, NodeBodyUpdate object in updateNodeCall method doesn't have a secondaryChildren field.
One approach I considered is to update secondary children with additions (createSecondaryChildAssocationCall) and deletions (deleteSecondaryChildAssocationCall) resulting in an overhead due to several REST calls.
Regards,
Atef ZAYATI
Solved! Go to Solution.
Axel Faust is correct, unfortunately we don't provide that functionality via the REST API yet.
Although a "batching" capability would be one way to address this updates of this manner would be better handled by a PATCH method which is something else on the backlog but without an ETA I'm afraid.
In the meantime your only option is the one you've suggested.
Ah, the typical consistency problems when a new ReST API is being developed. I would advice you to look for or create a new JIRA ticket to address the lack of secondary child association handling in the node update request body. At the moment, the createSecondaryChildAssociationCall you already mentioned would be the only way to go until the API is expanded. Richard Esplin has on multiple occasions mentioned to me that there would be some kind of "batching" feature in the future of the ReST API, but I neither know if that would allow to execute two operations in one HTTP call nor what the status is on that...
Axel Faust is correct, unfortunately we don't provide that functionality via the REST API yet.
Although a "batching" capability would be one way to address this updates of this manner would be better handled by a PATCH method which is something else on the backlog but without an ETA I'm afraid.
In the meantime your only option is the one you've suggested.
Create and delete associations is not solution if you association mandatory and not many
Are there some solutions in this case?
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.