This Spike describes the implementation and changes necessary in order to support a list element as a top-level data node.
Easy Solution for read and create
Need further analysis for Delete and Update (link spike)
Implementation Proposal
We will be augmenting the existing CPS-Core endpoint /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodes?xpath=/
...
- CpsDataPersistenceService.java
- new method storeListElements
- CpsDataPersistenceServiceImpl.java
- new method storeListElements, converts datanodes to fragment repository and saves it.
Issues:
...
Endpoint | Issue | Solution | Spike/User Story |
---|---|---|---|
Get Node | Get Node only gets the first node of the list element at the top level. |
...
- Refactor endpoint get node to get node(s) and have it search for parallel nodes.
- Create new endpoint (get root node / get list elements)
- Refactor endpoint so that it functions differently when root xpath is given
Delete Datanode only deletes one node of the list element at the top level
- Refactor to delete all nodes when passed root xpath /
...
Create a new endpoint Get Nodes which can return multiple parallel nodes. | |||
Post List Element | Post List Element does not allow for create List Element, only appends onto existing node as children | Add functionality to Post List Element to allow for the independent creation of a list element | |
Delete Node | Delete Datanode is unable to delete an element from the list elements if they are the top level list node. | Investigate implementation which will allow for deletion of element(s) from top level list elements | |
Update List Element | Update List Element relies on the parent node of the list element to update the List Elements but a top level List Element will not have a parent node | Investigate implementation which will allow for update of element(s) from top level list elements NB ensure no possibility of empty list element at top level |