Psychoanalytic-Electronic-Publishing / PEP-Web-User-Interface

Single Page App Graphical User Interface for PEP-Web
1 stars 0 forks source link

Admin Report - Request of Character Counts #636

Open nrshapiro opened 2 years ago

nrshapiro commented 2 years ago

The server admin/reports have been upgraded to automatically generate the character count report and allow it to be downloaded in CSV. But right now, the only way to do this is to go to the Stage API endpoint testbed and request it using admin/reports at https://stage-api.pep-web.org/docs#/Documents/documents_image_fetch_v2_Documents_Image__imageID___get And you must be logged in as an admin to get those to work, so you need to know how to authenticate on that platform.

But instead, the way to do this right is to modify the admin page of the client app to allow the admin user to request the report, and download it directly from there.

Basically all you need is a button there that says something equivalent to "Download Character Counts". The client calls the server API with a valid client id and session id for an admin, and the rest is taken care of.

Effectively, though this example will not be authorized without the client and session-id of an admin (but this example shows the essential parameters): https://stage-api.pep-web.org/v2/Admin/Reports/Character%20Count%20Report?sortorder=ASC&download=true

nrshapiro commented 1 year ago

@SophieMBennett @jordanallen-dev @ocappello @davidtuckett

For "Resilience", the below comment is different than the admin report above, which is for annual statistics. but I thought it fit in here for now.

Below this paragraph (below the line) is what I just downloaded from there on Production. (It comes back as HTML, I just pasted it here and it's formatted). You may only want the first part of this, but the other part might be of interest elsewhere, as well.) You can see it in raw html in the interactive server API documentation or from bash or git-bash with this command: