-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement paging functions #13
Comments
So, the relevant link regarding the CiviCRM api is http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API I presume you need to map the CiviCRM format for specifying paging type stuff to the OSDI format? |
Right now, the OSDI endpoint seems to be retrieving all responses. I get 236 here: http://camus.fuzion.co.nz/hal-browser/browser.html#/sites/default/ext/osdi/api/v3/People/index.php So yeah, mapping those paging and navigation functions and adding links to the OSDI response for previous and next should do it. |
Jason, I agree we don't want to crash our servers or decrease their performance. So I believe paging and navigation is also provided as a part of HAL-spec (as in clickable buttons for for accessing next & prev pages each having a definite set per_page value) so if I include a function for handling this functionality then HAL-browser would show up the navigation buttons. OR this can be done if I pass a variable in the url from the AEP to navigate to the per page result and a button for changing page number value in the url to navigate between pages. Right now I am more positive towards the latter method, is there any other way that I may have missed ? |
You'll want to do navigation as its defined in the osdi spec linked above. So links with a specific label. What the url is can be anything, the label is the important part. For the per page limit and page number url arguments I believe the osdi spec says what arguments must be used.
|
This can be implemented after some of the other stuff, but tor the entire API, you might want to implement the paging functions as described here:
http://opensupporter.github.io/osdi-docs/#collections-and-navigation
Right now it seems you return all contacts in the Civi system with going to the people endpoint. While there aren't many, this probably works fine. Once you have thousands, or tens of thousands, or hundreds of thousands, that's going to cause extremely slow performance. Implementing paging and navigation will keep things fast.
The way we've done it, we've set the default max page size to 25. Folks can request less than that, but we've also set the overall max page size to 25 to keep things fast. You might want to talk with Eileen about what the defaults and overall max should be for a civi system.
The text was updated successfully, but these errors were encountered: