How to update node's secondary children

cancel
Showing results for 
Search instead for 
Did you mean: 
atef-zayati
Member II

How to update node's secondary children

Jump to solution

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 Solution

Accepted Solutions
gavincornwell
Senior Member

Re: How to update node's secondary children

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

View solution in original post

3 Replies
afaust
Master

Re: How to update node's secondary children

Jump to solution

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

gavincornwell
Senior Member

Re: How to update node's secondary children

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

soloff
Member II

Re: How to update node's secondary children

Jump to solution

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

Are there some solutions in this case?