...
Implement the functionality to support multiple nodes addition using data fragment with list-node -list as a root element.
REST layer (incl openapi update)
...
- find parent node by parent node xpath (throw not found exception if absent)
- add all provided elements to parent node
- persist (throw already exists exception on unique constraint violation)
Delete
...
list-node content (all existing elements)
Implement the functionality to support multiple nodes addition using data fragment with node-list root elementremoval using list-node xpath.
REST layer (incl openapi update)
...
- delete all by dataspace and anchor and xpath starts with provided xpath to list-node (this includes all children as well)
Replace list-node content
Implement the functionality to support multiple nodes replacement using data fragment with list-node as a root element.
REST layer (incl openapi update)
- uri:
- (CPS) PATCH /dataspaces/{dataspaceName}/anchor/{anchorName}/list-node
- (NCMP) PATCH /cm-handle/{cmHandle}/list-node
- parameters:
- xpath - parent node xpath (mandatory)
- JSON data fragment via request body
- response 204 on success
Service layer
- parse JSON string into collection of DataNode objects
Persistence layer
- extract list-node xpath identifier from data nodes provided
- find parent node by parent node xpath (throw not found exception if absent)
- remove all children matching (starting with) list-node xpath identifier
- add all provided elements to parent node
- persist
Proposal