It's all about the answers!

Ask a question

DNG OSLC queries pagination


Jayesh Gaikar (473) | asked Sep 11, 7:52 p.m.
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



permanent link
Bartosz Chrabski (2.5k11936) | answered Sep 12, 9:07 a.m.

 Hi Jay,


Please check the following article, pagination is explained atbthe bottom. 


Comments
Jayesh Gaikar commented Sep 12, 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.

permanent link
aresha vora (212) | answered Oct 18, 4:04 a.m.
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, 5:30 a.m. | edited Oct 19, 5:31 a.m.
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?.


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


Register or to post your answer.