• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Retrieve data from API for a Plesk Extension

debba

New Pleskian
Hi,

I'm implementing external service API in a Plesk Onyx extension.

I'd like to put in a table a dataset delivered by REST API from the service with a correct pagination (f.e. : if I have 2000 rows of data I want to paginate in 200 pages 10 rows).

I found pm_View_List_Simple class in Plesk documentation (https://docs.plesk.com/en-US/onyx/e...ment-ui/create-new-page/implement-list.76111/), but seems to get work only with fully dataset, so the pagination is only client-side.

The service allow me to retrieve only a group of data (with arguments limit and offset). So with pm_View_List_Simple I'd be forced to cycle each individual request starting from offset 0 and until number of total elements.

Horrible solution! Because total elements could be tens of thousands so lengthy process and useless waste of resources.

I'm still missing something or are there other solutions with Plesk classes?

I am not constrained using pm_View_List_Simple or other Plesk classes, of course. But if it were possible without reinventing the wheel I'd prefer.

I accept your advices!
 
  • Like
Reactions: seb
Back
Top