CPS-766 Get Nodes Endpoint

CPS-766: Get Nodes Endpoint (support multipel to-level nodes)Closed

Implementation Proposal

Creating a new get nodes endpoint

REST Layer

  • cpsData.yml

    • New get endpoint for nodesByDataspaceAndAnchor "Get parallel nodes with an option to retrieve all the children for a given anchor and dataspace"

  • DataRestController.java

    • New method, getNodesByDataspaceAndAnchor which calls new method getDataNodes from cpsDataService and return obtained datanodes.

  • DataRestControllerSpec.groovy

    • Add test for scenario above

Service Layer

  • CpsDataService.java

    • new getDataNodes method to be overwritten

  • CpsDataServiceImpl.java

    • implement getDataNodes and call getDataNodes from persistence layer

Persistence Layer

  • CpsDataPersistenceService.java

    • new method getDataNodes

  • CpsDataPersistenceServiceImpl.java

    • implement getDataNodes, call new method getFragmentsByXpath

    • getFragmentsByXpath calls new FragmentRepository method findRootFragmentsByDataspaceAndAnchor if root xpath or new method getFragmentsByDataspaceAndAnchorAndXpath if non root xpath

  • FragmentRepository

    • findRootFragmentsByDataspaceAndAnchor obtains nodes when there is no node xpath

    • getFragmentsByDataspaceAndAnchorAndXpath obtains nodes when there is an xpath provided