Skip to content
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

add v1.3 with Accessibility, audio/x-m4a and ... #5

Merged
merged 6 commits into from
Feb 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 69 additions & 21 deletions 5.2curlcommands.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Example Curl Commands to register previewers for Dataverse, version 5.2+

You should be able to cut/paste any/all of the commands below to run on your Dataverse machine:
You should be able to cut/paste any/all of the commands below to run on your Dataverse machine.

Note that the GeoJSON previewer requires version 5.9 of Dataverse or later, as mimetype recognition for this format was added in 5.9.

```bash
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \
Expand All @@ -10,7 +12,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"textPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/TextPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/TextPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -33,7 +35,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"htmlPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/HtmlPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/HtmlPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -56,7 +58,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"audioPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/AudioPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/AudioPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -79,7 +81,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"audioPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/AudioPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/AudioPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -102,7 +104,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"audioPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/AudioPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/AudioPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -125,7 +127,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"audioPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/AudioPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/AudioPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -140,6 +142,29 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
}'
```

```bash
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \
'{
"displayName":"Play Audio",
"description":"Listen to an audio file.",
"toolName":"audioPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/AudioPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
{"siteUrl":"{siteUrl}"},
{"key":"{apiToken}"},
{"datasetid":"{datasetId}"},
{"datasetversion":"{datasetVersion}"},
{"locale":"{localeCode}"}
]
},
"contentType":"audio/x-m4a"
}'
```

```bash
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \
'{
Expand All @@ -148,7 +173,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"imagePreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/ImagePreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/ImagePreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -171,7 +196,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"imagePreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/ImagePreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/ImagePreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -194,7 +219,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"imagePreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/ImagePreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/ImagePreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -217,7 +242,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"pdfPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/PDFPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/PDFPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -240,7 +265,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"videoPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/VideoPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/VideoPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -263,7 +288,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"videoPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/VideoPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/VideoPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -286,7 +311,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"videoPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/VideoPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/VideoPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -309,7 +334,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"spreadsheetPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/SpreadsheetPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/SpreadsheetPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -332,7 +357,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"spreadsheetPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/SpreadsheetPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/SpreadsheetPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -355,7 +380,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"spreadsheetPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/SpreadsheetPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/SpreadsheetPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -378,7 +403,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"spreadsheetPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/SpreadsheetPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/SpreadsheetPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -401,7 +426,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"stataPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/TextPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/TextPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -424,7 +449,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"rPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/TextPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/TextPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -447,7 +472,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"annotationPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.2/HypothesisPreview.html",
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/HypothesisPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -461,3 +486,26 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"contentType":"application/x-json-hypothesis"
}'
```

```bash
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \
'{
"displayName":"View Map",
"description":"View a map of the file.",
"toolName":"mapPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/MapPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
{"siteUrl":"{siteUrl}"},
{"key":"{apiToken}"},
{"datasetid":"{datasetId}"},
{"datasetversion":"{datasetVersion}"},
{"locale":"{localeCode}"}
]
},
"contentType":"application/geo+json"
}'
```
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

A collection of data file previewers that conform to the [Dataverse](https://dataverse.org) external tools interface, originally developed by the [Qualitative Data Repository](https://qdr.syr.edu). Earlier versions of Dataverse (v4.11+) make previewers available through the external tools button on Dataset pages (left). Newer versions (v4.18+) also use previewers for embedded display on Datafile pages (right). Even more recent versions (5.2+) can distinguish 'preview' and 'explore' tools and display them in different ways/separate places.

<img align="right" width="30%" src="https://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers/blob/master/examples/previewInPage.PNG?raw=true">
<img width="65%" src="https://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers/blob/master/examples/datasetdisplay.png?raw=true">
<img align="right" width="30%" src="https://github.com/gdcc/dataverse-previewers/blob/master/examples/previewInPage.PNG?raw=true">
<img width="65%" src="https://github.com/gdcc/dataverse-previewers/blob/master/examples/datasetdisplay.png?raw=true">

## Installation

Expand All @@ -21,7 +21,7 @@ Also note that using the commands below means that your installation will automa

There are two options to update to new versions:

##### API Method
### API Method

Use the Dataverse API to list all of the registered previewers and to then delete each old version. Then follow the new installation instructions

Expand All @@ -30,12 +30,16 @@ and, for each tool registered, delete them by id number:

curl -X DELETE http://localhost:8080/api/admin/externalTools/<id>

##### Database method
### Database method

Alternately, one can update the toolurl column in the externaltool table via SQL to change the repository and/or the version used. For example:

update externaltool set toolurl=REPLACE(toolurl, 'globaldataversecommunityconsortium.github.io/dataverse-previewers/previewers', 'gdcc.github.io/dataverse-previewers/previewers/v1.1');

or, to just change between versions after you've switched to using the gdcc repository:

update externaltool set toolurl=REPLACE(toolurl, 'v1.2', 'v1.3');


## How do they work?

Expand Down Expand Up @@ -66,17 +70,17 @@ The Spreadsheet Previewer was contributed by [anncie-pcss](https://github.com/an

[juancorr](https://github.com/juancorr) added internationalization and provided a Spanish translation for the existing previewers.

[kaitlinnewson](https://github.com/kaitlinnewson) provided a French translation for the existing previewers.
[kaitlinnewson](https://github.com/kaitlinnewson) provided a French translation for the existing previewers, and contributed the GeoJSON previewer.

## How can I help?

If you are interested in adding additional previewers, or in maintaining/enhancing existing ones, contact us at [dataverse-dev@googlegroups.com](mailto:dataverse-dev@googlegroups.com) or work through github to fork/make pull-requests against the repository.

The wiki now contains a [How To Create a Previewer](https://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers/wiki/How-to-create-a-previewer) page that provides a detailed guide to developing new previewers starting from the existing HTML/Javascript templates. (You can also build previewers using any language you choose, starting from the External Tools API in Dataverse.)
The wiki now contains a [How To Create a Previewer](https://github.com/gdcc/dataverse-previewers/wiki/How-to-create-a-previewer) page that provides a detailed guide to developing new previewers starting from the existing HTML/Javascript templates. (You can also build previewers using any language you choose, starting from the External Tools API in Dataverse.)

Contributors are expected to keep the master branch in a 'production-ready' state, as Dataverse instances may be using the html, javascript, and css files there directly via their github.io URLs (see curl commands below).

By committing code to the repository, Contributors are agreeing to make it available under the [MIT Open Source license](https://globaldataversecommunityconsortium.github.io/dataverse-previewers/LICENSE).
By committing code to the repository, Contributors are agreeing to make it available under the [MIT Open Source license](https://gdcc/dataverse-previewers/LICENSE).

## Curl commands to configure these tools with your Dataverse instance

Expand Down
Loading