DNG OSLC queries pagination
HI,
May i know how to handle multiple pages return by OSLC query in case of large number of artifacts return by the query.
I came across the URI in tag <oslc:nextPage > in <oslc:ResponseInfo> with page parameter. but When i try to access it through HTTP client it returns status Error 403: Forbidden .
I also verified Response Header Location, Which doesn't seems like having expected URL (URL ending with /rm/view)
Can someone help me with it .
Thanks & regards,
-Jay
|
2 answers
Hi Jay,
Please check the following article, pagination is explained atbthe bottom.
Comments
Jayesh Gaikar
commented Sep 12 '20, 1:05 p.m.
Hi Bartosz,
Thanks for your quick reply!
I observed oslc.pageSize and pageno in the response i got from original OSLC submit call. I tried utilizing rdf:resource URI from <oslc:nextPage > tag to fetch nextpage data by using HTTP client. Which responded with 403 Forbidden status.
I m wondering is this right way to access second and subsequent pages from original query.
|
Yes, the <oslc:nextPage > url comes in response not working. its not encoded correctly in response that seems to be reason. but solution for fetching next page is. we can build next page url by our own in code/script.
oslc.where=<some criteria>&oslc.pageSize=100&pageno=1
above will result first page with first 100 records. suppose there are total 200 records then second page can be found by changing the pageSize and pageno input in query like below
oslc.where=<some criteria>&oslc.pageSize=100&pageno=2
One can build query internally and consume until <oslc:nextPage > tag is empty.
Thanks.
Comments
Ian Barnard
commented Oct 19 '20, 5:30 a.m.
| edited Oct 19 '20, 5:31 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
What DNG version are you using? The nextPage URL works fine for 6.0.6.1.
The oslc:nextPage resource in the XML has ampersand expansion, have you removed that?.
<oslc:nextPage rdf:resource="https://jazz.ibm.com:9443/rm/views?oslc.prefix=rp0%3D%3Chttps%3A%2F%2Fjazz.ibm.com%3A9443%2Frm%2Ftypes%2F%3E%2Cdcterms%3D%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%2Crm_nav%3D%3Chttp%3A%2F%2Fjazz.net%2Fns%2Frm%2Fnavigation%23%3E&oslc.select=rp0%3A_iEmzkQ7QEeuyn_ocqKJ0aA%2Cdcterms%3Atitle%2Cdcterms%3Aidentifier%2Crm_nav%3Aparent&oslc.orderBy=%2Brp0%3A_iEmzkQ7QEeuyn_ocqKJ0aA&oslc.paging=true&oslc.pageSize=200&page=2" />
Remove the ampersand encoding and that link works to get page 2.
You have to keep using the headers like OSLC-Core-Version: 2.0 and the vvc.configuration - i.e. the headers you used for the first request.
HTH
Ian
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.