You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by "Patel, Yesha" <ye...@sap.com> on 2019/12/05 17:53:08 UTC

OData V4 Pagination

Hi,

I went thru olingo documentation, however there is no clear tutorial on how to handle pagination for OData Client when consuming odata service.

How do we handle pagination using Olingo OData V4 either client-side or server-side?

Client-side, if we use $top and $skip, how can we get all the records where the service is limiting the records it sends in one payload to for example 1000 and total records are 1 M.

Server-side, if we use @odata.nextlink, how can we get all the records? Considering, that each service can either have fully qualified next link vs relative next link.

Is there a document on which API to use or an example to reference for OData V4 client consuming odata services for pagination?

Any help is appreciated

Thanks,
Yesha

RE: OData V4 Pagination

Posted by "Grande, Oliver" <ol...@sap.com>.
Great,
Oliver

From: Patel, Yesha <ye...@sap.com>
Sent: Montag, 9. Dezember 2019 19:59
To: Grande, Oliver <ol...@sap.com>
Cc: user@olingo.apache.org; mibo <mi...@apache.org>
Subject: RE: OData V4 Pagination

Hi Oliver,
I was able to find getNext() method, which returns the nextlink. Now, I am able to pull all records.

Thank you for your feedback!  Really appreciate it.

Thanks,
Yesha

From: Grande, Oliver <ol...@sap.com>>
Sent: Thursday, December 5, 2019 11:43 PM
To: Patel, Yesha <ye...@sap.com>>
Cc: mibo <mi...@apache.org>>; user@olingo.apache.org<ma...@olingo.apache.org>
Subject: RE: OData V4 Pagination

Hello Yesha,

as you may know the server driven paging is a protection of the server, so the server want get out of memory.

The only way to get all the data I know is to request all the packages via the nextlink. This would mean that you would need to send 1000 requests, which is a lot. You can try to influence the page size using the maxpagesize prefer header or try to contact the developer of the server.

Oliver


From: Patel, Yesha <ye...@sap.com>>
Sent: Donnerstag, 5. Dezember 2019 18:53
To: user@olingo.apache.org<ma...@olingo.apache.org>
Cc: mibo <mi...@apache.org>>
Subject: [CAUTION] OData V4 Pagination

Hi,

I went thru olingo documentation, however there is no clear tutorial on how to handle pagination for OData Client when consuming odata service.

How do we handle pagination using Olingo OData V4 either client-side or server-side?

Client-side, if we use $top and $skip, how can we get all the records where the service is limiting the records it sends in one payload to for example 1000 and total records are 1 M.

Server-side, if we use @odata.nextlink, how can we get all the records? Considering, that each service can either have fully qualified next link vs relative next link.

Is there a document on which API to use or an example to reference for OData V4 client consuming odata services for pagination?

Any help is appreciated

Thanks,
Yesha

RE: OData V4 Pagination

Posted by "Patel, Yesha" <ye...@sap.com>.
Hi Oliver,
I was able to find getNext() method, which returns the nextlink. Now, I am able to pull all records.

Thank you for your feedback!  Really appreciate it.

Thanks,
Yesha

From: Grande, Oliver <ol...@sap.com>>
Sent: Thursday, December 5, 2019 11:43 PM
To: Patel, Yesha <ye...@sap.com>>
Cc: mibo <mi...@apache.org>>; user@olingo.apache.org<ma...@olingo.apache.org>
Subject: RE: OData V4 Pagination

Hello Yesha,

as you may know the server driven paging is a protection of the server, so the server want get out of memory.

The only way to get all the data I know is to request all the packages via the nextlink. This would mean that you would need to send 1000 requests, which is a lot. You can try to influence the page size using the maxpagesize prefer header or try to contact the developer of the server.

Oliver


From: Patel, Yesha <ye...@sap.com>>
Sent: Donnerstag, 5. Dezember 2019 18:53
To: user@olingo.apache.org<ma...@olingo.apache.org>
Cc: mibo <mi...@apache.org>>
Subject: [CAUTION] OData V4 Pagination

Hi,

I went thru olingo documentation, however there is no clear tutorial on how to handle pagination for OData Client when consuming odata service.

How do we handle pagination using Olingo OData V4 either client-side or server-side?

Client-side, if we use $top and $skip, how can we get all the records where the service is limiting the records it sends in one payload to for example 1000 and total records are 1 M.

Server-side, if we use @odata.nextlink, how can we get all the records? Considering, that each service can either have fully qualified next link vs relative next link.

Is there a document on which API to use or an example to reference for OData V4 client consuming odata services for pagination?

Any help is appreciated

Thanks,
Yesha

RE: OData V4 Pagination

Posted by "Patel, Yesha" <ye...@sap.com>.
Hi Oliver,

Do you know if there an example of how to use olingo API that I can reference for nextlink from the client side consumption?

Yes, increasing the pagesize on the server does give more records, however we need to utilize nextlink as you mentioned from the client side to fetch all the records.

In our code, currently, we use  executeQuery  with absoluteUri, which gets the first page of records into an ClientEntitySetIterator<eclipse-javadoc:%E2%98%82=DataServices/src%3Ccom.acta.adapter.odata.base%7BODataV4Handler.java%E2%98%83ODataV4Handler%5Eiterator%E2%98%82org.apache.olingo.client.api.domain.ClientEntitySetIterator> iterator, we use hasNext() on the iterator until there is data, but olingo's hasNext() does not seems to take care of nextlink on its own?

Do you know if Olingo's hasNext() takes care of pagination or it has to be handle via multiple requests using nextlink?


Thanks,
Yesha
From: Grande, Oliver <ol...@sap.com>
Sent: Thursday, December 5, 2019 11:43 PM
To: Patel, Yesha <ye...@sap.com>
Cc: mibo <mi...@apache.org>; user@olingo.apache.org
Subject: RE: OData V4 Pagination

Hello Yesha,

as you may know the server driven paging is a protection of the server, so the server want get out of memory.

The only way to get all the data I know is to request all the packages via the nextlink. This would mean that you would need to send 1000 requests, which is a lot. You can try to influence the page size using the maxpagesize prefer header or try to contact the developer of the server.

Oliver


From: Patel, Yesha <ye...@sap.com>>
Sent: Donnerstag, 5. Dezember 2019 18:53
To: user@olingo.apache.org<ma...@olingo.apache.org>
Cc: mibo <mi...@apache.org>>
Subject: [CAUTION] OData V4 Pagination

Hi,

I went thru olingo documentation, however there is no clear tutorial on how to handle pagination for OData Client when consuming odata service.

How do we handle pagination using Olingo OData V4 either client-side or server-side?

Client-side, if we use $top and $skip, how can we get all the records where the service is limiting the records it sends in one payload to for example 1000 and total records are 1 M.

Server-side, if we use @odata.nextlink, how can we get all the records? Considering, that each service can either have fully qualified next link vs relative next link.

Is there a document on which API to use or an example to reference for OData V4 client consuming odata services for pagination?

Any help is appreciated

Thanks,
Yesha

RE: OData V4 Pagination

Posted by "Grande, Oliver" <ol...@sap.com>.
Hello Yesha,

as you may know the server driven paging is a protection of the server, so the server want get out of memory.

The only way to get all the data I know is to request all the packages via the nextlink. This would mean that you would need to send 1000 requests, which is a lot. You can try to influence the page size using the maxpagesize prefer header or try to contact the developer of the server.

Oliver


From: Patel, Yesha <ye...@sap.com>
Sent: Donnerstag, 5. Dezember 2019 18:53
To: user@olingo.apache.org
Cc: mibo <mi...@apache.org>
Subject: [CAUTION] OData V4 Pagination

Hi,

I went thru olingo documentation, however there is no clear tutorial on how to handle pagination for OData Client when consuming odata service.

How do we handle pagination using Olingo OData V4 either client-side or server-side?

Client-side, if we use $top and $skip, how can we get all the records where the service is limiting the records it sends in one payload to for example 1000 and total records are 1 M.

Server-side, if we use @odata.nextlink, how can we get all the records? Considering, that each service can either have fully qualified next link vs relative next link.

Is there a document on which API to use or an example to reference for OData V4 client consuming odata services for pagination?

Any help is appreciated

Thanks,
Yesha