dataverse-lrs/README.md

50 lines
5.7 KiB
Markdown
Raw Normal View History

2021-01-13 15:47:10 +01:00
# dataverse-lrs
2021-02-22 09:23:56 +01:00
### Integrating Dataverse with the Clarin Resource Switchboard.
2021-02-22 09:23:27 +01:00
This repository contains a collection of files that are built according to the [Dataverse external tools interface](https://guides.dataverse.org/en/latest/admin/external-tools.html) in order to make the Clarin [Resource Switchboard](https://switchboard.clarin.eu) available through the external tools button on Dataset pages (left). Some of these files also implements data previewer apps for embedded display on Datafile pages (right): the *Text* and *PDF* previewers are based on those originally developed by the [Qualitative Data Repository](https://qdr.syr.edu), the *GeoJSON previewer* is a basic, experimental, viewer for GeoJSON files developed using the [d3.js](https://d3js.org) library.
2021-01-26 15:52:18 +01:00
#### Installation
2021-07-06 13:01:54 +02:00
The files can be installed on a Dataverse instance by executing the curl command(s) below to register them with the Dataverse instance. In alternative the code can be downloaded and used locally. Detailed instructions for a local installation can be found at the [Dataverse Project site](https://guides.dataverse.org/en/latest/admin/external-tools.html#).
2021-01-26 15:52:18 +01:00
2021-02-11 10:09:13 +01:00
In this release there is one file for each mime type, each file can be installed independently from others.
2021-01-26 15:52:18 +01:00
#### Known limitations
2021-02-22 09:23:27 +01:00
Files in the current release *do not allow* to send to LRS or to preview restricted content (i.e. non public files). To send a non public file to the Resource Switchboard or to preview it, the permission to access the dataset version containing the file would be required, technically speaking this means that a valid API Token should be used. Instead sending/viewing public content does not require an API Token.
2021-02-11 10:09:13 +01:00
The decision to implement the processing of restricted content depends on the security policy that will be adopted.
2021-02-11 10:15:10 +01:00
The *application/geo+json* mime type is not automatically recognized by Dataverse when uploading a GeoJSON file, to associate the GeoJSON previewer to the file the correct mime type must be manually set in the correspondent metadata property of the file.
2021-01-26 15:52:18 +01:00
The current release has been tested with Dataverse v5.11+, however it should work also with Dataverse releases v4.12+.
2021-07-06 13:01:54 +02:00
*Note: this is an in progress activity, code may change and may not be stable all the time.*
2021-01-14 09:53:48 +01:00
2021-02-22 09:23:27 +01:00
#### Curl commands to install and run Resource Switchboard integration web apps with a Dataverse instance:
2021-01-14 09:53:48 +01:00
2021-01-26 15:54:03 +01:00
Using the *curl* commands below it should be possible to install and run the dataverse-lrs files as external applications on a Dataverse instance:
2021-01-14 09:53:48 +01:00
-- text/plain previewer
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \ "{ \"displayName\":\"SSHOC text previewer\", \"description\":\"Preview text files and use the LRS tools to process the file.\", \"scope\":\"file\", \"type\":\"explore\", \"hasPreviewMode\":\"true\", \"toolUrl\":\"https://v4e-dock.isti.cnr.it/previewers/TextPreview.html\", \"toolParameters\": { \"queryParameters\":[ {\"fileid\":\"{fileId}\"}, {\"siteUrl\":\"{siteUrl}\"}, {\"key\":\"{apiToken}\"}, {\"datasetid\":\"{datasetId}\"}, {\"datasetversion\":\"{datasetVersion}\"}, {\"locale\":\"{localeCode}\"} ] }, \"contentType\":\"text/plain\" }"
-- send text directly to LRS
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \ "{ \"displayName\":\"Process text file with LRS\", \"description\":\"Process a text file using LRS.\", \"scope\":\"file\", \"type\":\"explore\", \"hasPreviewMode\":\"false\", \"toolUrl\":\"https://v4e-dock.isti.cnr.it/previewers/SendText.html\", \"toolParameters\": { \"queryParameters\":[ {\"fileid\":\"{fileId}\"}, {\"siteUrl\":\"{siteUrl}\"}, {\"key\":\"{apiToken}\"}, {\"datasetid\":\"{datasetId}\"}, {\"datasetversion\":\"{datasetVersion}\"}, {\"locale\":\"{localeCode}\"} ]}, \"contentType\":\"text/plain\" }"
-- application/pdf previewer
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \ "{ \"displayName\":\"SSHOC PDF previewer\", \"description\":\"Read a pdf document and use the LRS tools to process the file.\", \"scope\":\"file\", \"type\":\"explore\", \"hasPreviewMode\":\"true\", \"toolUrl\":\"https://v4e-dock.isti.cnr.it/previewers/PDFPreview.html\", \"toolParameters\": { \"queryParameters\":[ {\"fileid\":\"{fileId}\"}, {\"siteUrl\":\"{siteUrl}\"}, {\"key\":\"{apiToken}\"}, {\"datasetid\":\"{datasetId}\"}, {\"datasetversion\":\"{datasetVersion}\"}, {\"locale\":\"{localeCode}\"} ] }, \"contentType\":\"application/pdf\" }"
-- send PDF directly to LRS
2021-01-27 10:48:17 +01:00
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \ "{ \"displayName\":\"Process PDF file with LRS\", \"description\":\"Process a PDF file using LRS.\", \"scope\":\"file\", \"type\":\"explore\", \"hasPreviewMode\":\"false\", \"toolUrl\":\"https://v4e-dock.isti.cnr.it/previewers/SendPDF.html\", \"toolParameters\": { \"queryParameters\":[ {\"fileid\":\"{fileId}\"}, {\"siteUrl\":\"{siteUrl}\"}, {\"key\":\"{apiToken}\"}, {\"datasetid\":\"{datasetId}\"}, {\"datasetversion\":\"{datasetVersion}\"}, {\"locale\":\"{localeCode}\"} ]}, \"contentType\":\"application/pdf\" }"
2021-01-13 17:03:23 +01:00
2021-02-11 10:09:13 +01:00
-- application/geo+json previewer
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \ "{ \"displayName\":\"Preview GeoJSON Document\", \"description\":\"Preview a GeoJSON document.\", \"scope\":\"file\", \"type\":\"explore\", \"hasPreviewMode\":\"true\", \"toolUrl\":\"https://v4e-dock.isti.cnr.it/previewers/GeoJSONPreview.html\", \"toolParameters\": { \"queryParameters\":[ {\"fileid\":\"{fileId}\"}, {\"siteUrl\":\"{siteUrl}\"}, {\"key\":\"{apiToken}\"}, {\"datasetid\":\"{datasetId}\"}, {\"datasetversion\":\"{datasetVersion}\"}, {\"locale\":\"{localeCode}\"} ] }, \"contentType\":\"application/geo+json\" }"