[DNG API] Is there a way using OSLC capabilities that I can query my project areas for all requirements under all components?
Hi all,
Thank you for reading. I have a use case to scrape our DNG for all requirements. I only need a little bit of information from each requirement, basically an identifier and the status.
I'm following a discovery process where I pull the rootservices, then the oslc catalog, and then the service providers.
When I pull each service provider from here, I use the QueryBase under Query Capability with only a date filter added to the endpoint provided to pull all of the relevant requirements. The issue that I ran into is that this query returns only the requirements from whatever the default component was. I went back and I can see the component that is defined in the services.xml that I pulled from the service providers.
What I would like to do is "select" a component either when I GET the query capability or when I GET the services.xml. If I can do that, I can iterate through each component to gather all of the data that I need.
The ideal situation would be that I could pull all of the requirements from all of the components, but I have a feeling that that isn't an option.
I think my headers are fine, but for completeness:
'OSLC-Core-Version' = '2.0'
The endpoints that I pull, in order, are:
https://mydoors.com/rm/rootservices
https://mydoors.com/rm/oslc_rm/catalog
https://mydoors.com/rm/oslc_rm/{PROJECT_AREA}/services.xml
https://mydoors.com/rm/views?oslc.query=true&projectURL=https://mydoors.com/rm/process/project-areas/{PROJECT_AREA}
I've tried adding both the component URI and the config URI within a component to both the queries for the services.xml and the query capability in a couple ways:
As a header: "Configuration-Context" = "{URI}"
As part of the query: "oslc_config.context={URI}"
( https://mydoors.com/rm/views?oslc.query=true&projectURL=https://mydoors.com/rm/process/project-areas/{PROJECT_AREA}&oslc_config.context={URI} )
These resulted in the exact same responses, so they're either not a proper solution or I haven't figured out how to do it correctly.
If anyone can offer a solution of any kind, I'd really appreciate it!
2 answers
Hi Dominic
Hi Ian,
Thank you for the feedback. I'm not sure if it's something specific about our server, but this solution doesn't quite work, as I explained in the original post. I did find a solution on my own, though.
Rather than supplying a projectURL, I supply a "project" as a query parameter, and that is the missing piece of the puzzle. I found the 'project' by finding an endpoint looking like: 'https://mydoors.com/rm/cm/component/ldpc?project={PROJECT_IDENTIFIER}' within the component list from the response I get from here: 'https://mydoors.com/rm/oslc_config/components'.
With this specified, supplying the Configuration-Context header (pointed to a stream) gives me the responses that I was looking for.
Cheers,
Dominic