We should probably include previewers in our container setup: https://github.com/gdcc/dataverse-previewers
We added them a long time ago to Ansible.
As I test this PR, I'm wishing they were already in place: signed URLs with private url users, autogenerate API token #10098
Something like this should work:
cd docker-dev-volumes/app/data/docroot
mkdir dataexplore
cd dataexplore
git clone https://github.com/gdcc/dataverse-previewers.git
Followed by this:
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \
'{
"displayName":"Read Text",
"description":"Read the text file.",
"toolName":"textPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"http://localhost:8080/dataexplore/dataverse-previewers/previewers/v1.3/TextPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
{"siteUrl":"{siteUrl}"},
{"key":"{apiToken}"},
{"datasetid":"{datasetId}"},
{"datasetversion":"{datasetVersion}"},
{"locale":"{localeCode}"}
]
},
"contentType":"text/plain"
}'
Last updated: Oct 30 2025 at 05:14 UTC