cancel
Showing results for 
Search instead for 
Did you mean: 

How to update node's secondary children

atef-zayati
Champ in-the-making
Champ in-the-making

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

1 ACCEPTED ANSWER

gavincornwell
Star Collaborator
Star Collaborator

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.

View answer in original post

3 REPLIES 3

afaust
Legendary Innovator
Legendary Innovator

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...

soloff
Champ in-the-making
Champ in-the-making

Create and delete associations is not solution if you association mandatory and not many Smiley Sad

Are there some solutions in this case?

gavincornwell
Star Collaborator
Star Collaborator

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.