• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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