In Search results, add additional downloads for external resources through specific dataflow annotation
As an ILO user
I want to have additional download options on the search results for files that are attached to the dataflow through the "EXT_RESOURCE" annotation,
So that I can immediately access related material (ready-made files prepared and stored externally, e.g. pre-generated Excel files, a proprietary csv format, or even a pdf with referential metadata while the right panel metadata is not ready) without going first to the viz page.
Extend download menu options according to all dataflow annotations "EXT_RESOURCE"
Given that I'm using the DE search result page
When a dataflow has one or more valid annotations of type "EXT_RESOURCE" (see SDMX-JSON syntax below)
Then instead of the current single download button with tooltip for the complete csv file, present it as a download menu button. The menu includes in addition to the out-of-the-box complete csv download option, one localised download option per annotation, after an additional separator line.
Example mockup that corresponds to the below SDMX-JSON syntax example:
SDMX-JSON syntax (structure or data message)
- Syntax - in dataflow definition (structure message) for adding additional download options for external resources:
"annotations": [
{
"type": "EXT_RESOURCE",
"text": "Full CSV (ILO Bulk)|https://www.ilo.org/ilostat-files/WEB_bulk_download/indicator/SDG_A871_SEX_AGE_RT_A.csv.gz|https://www.ilo.org/ilostat-files/ISCO/images/file-archive-icon.svg",
"texts": {
"en": "Full CSV (ILO Bulk)|https://www.ilo.org/ilostat-files/WEB_bulk_download/indicator/SDG_A871_SEX_AGE_RT_A.csv.gz|https://www.ilo.org/ilostat-files/ISCO/images/file-archive-icon.svg",
"es": "Completo CSV (ILO Bulk)|https://www.ilo.org/ilostat-files/WEB_bulk_download/indicator/SDG_A871_SEX_AGE_RT_A.csv.gz|https://www.ilo.org/ilostat-files/ISCO/images/file-archive-icon.svg",
"fr": "Complet CSV (ILO Bulk)|https://www.ilo.org/ilostat-files/WEB_bulk_download/indicator/SDG_A871_SEX_AGE_RT_A.csv.gz|https://www.ilo.org/ilostat-files/ISCO/images/file-archive-icon.svg"
}
}
],
NOTES:
- Any type of format (stored externally) can be triggered for download. Triggering the download of the external source should whether download the content, or open it (for display or download) in a separated tab of the web browser.
- The generation of the download menu is similar to the one in the visualisation page including styles.
- The localised annotation text is applied according to the current locale of the DE.
- The order of the added download option respects the order of the annotations as they have been provided.
- Since the annotation content is not indexed and thus not available in the search results, it can only be retrieved dynamically at the moment when the download menu is opened. It is acceptable to have a little waiting time to transparently fire a dataflow structure request (without references!), e.g. https://ilo.org/sdmx-test/rest/dataflow/ILO/DF_SDG_ALL_SDG_A871_SEX_AGE_RT/1.0 to retrieve the dataflow's annotation and add the additional download options to the download menu. The appropriate dataflow datasource needs to be used for this query, including if the datasource is external.