Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

/dataspaces/{dataspaceName}/anchor/{anchorName}/list-node


Implementation Proposal

Create list-node  with one or more elements elements

Implement the functionality to support multiple nodes addition using data fragment with node-list root element.

REST layer (incl openapi update)

  • uri:
    • (CPS) POST /dataspaces/{dataspaceName}/anchor/{anchorName}/list-node
    •  (NCMP) POST /cm-handle/{cmHandle}/list-node
  • parameters:
    • xpath - parent node xpath (mandatory)
    • JSON data fragment via request body
  • response 201 on success

Service layer

  • parse JSON string into collection of DataNode objects

Persistence layer

  • 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 all list-node elements

Implement the functionality to support multiple nodes addition using data fragment with node-list root element.

REST layer (incl openapi update)

  • uri:
    • (CPS) DELETE /dataspaces/{dataspaceName}/anchor/{anchorName}/list-node
    •  (NCMP) DELETE /cm-handle/{cmHandle}/list-node
  • parameters:
    • xpath - list node xpath (same as list-node element but with no key attribute definition)
      i.e. /root/parent/list-node
  • response 204 on success

Service layer

  • validate xpath referenced list-node element (?)

Persistence layer

  • delete all by dataspace and anchor and xpath starts with provided xpath to list-node (this includes all children as well)









Proposal