Skip to content
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# do not track IntelliJ IDEA files #
####################################
.idea
**/*.iml
/bin/

# Logs and databases #
######################
docker-dev-volumes/
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ Additionally, configuration files for Harvard Dataverse are kept here, including
- [customization](customization): custom header, footer, etc.
- [metadatablocks](metadatablocks): custom metadata blocks

### External Tools:
- [datacurationtool](scripts/datacurationtool): Data Curation Tool

You may also find a script or two.
42 changes: 42 additions & 0 deletions scripts/datacurationtool/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Data Curation Tool

An external tool for exploring and curating Dataverse tab delimited DataFiles
The tool source can be found in this GitHub repositiry:
https://github.com/scholarsportal/Dataverse-Data-Explorer/blob/main/README.md

## Installing the tool in Apache:

This is used for installing in demo and production.

Build the source per the instructions in the README of the Dataverse-Data-Explorer project linked above. Use ng build to create the dist folder.

- ng build

(Note: If the dist/index.html file has 'base href="/"' change it to base href="./" )

zip the dist/ directory and copy it to the Dataverse server
On the Dataverse server unzip the file and rename dist/ to datacuration/
- unzip dist.zip
- mv dist/ datacuration/
- sudo cp -r datacuration/ /var/www/html/
- sudo vi /etc/httpd/conf.d/ssl.conf

Add to ssl.conf 'ProxyPassMatch ^/datacuration !' to the '# don't pass paths used by rApache...' section.
- sudo apachectl graceful

Load the setting to configure Dataverse to use the external tool:

Copy the appropriate json file to the server

dataverse-manifest-demo.json or dataverse-manifest-prod.json and rename it to local-dataverse-manifest.json
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools --upload-file local-dataverse-manifest.json

## Installing the tool in Docker:

This is used primarily for development work (where dataverse is also running in docker)

From the scripts/docker directory run the setup-datacurationtool.sh (make sure Dataverse is running so the settings api will work)

- ./setup-datacurationtool.sh

This script will build the image for the tool directly from GitHub. The script is not designed to install a specific release version.
44 changes: 44 additions & 0 deletions scripts/datacurationtool/dataverse-manifest-demo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"displayName": "Data Curation Tool",
"description": "Data Curation Tool for curation of variables",
"scope": "file",
"type": "configure",
"contentType": "text/tab-separated-values",
"toolUrl": "https://demo.dataverse.org/datacuration/",
"toolParameters": {
"queryParameters": [
{
"fileId": "{fileId}"
},
{
"fileMetadataId": "{fileMetadataId}"
},
{
"datasetPid": "{datasetPid}"
},
{
"locale": "{localeCode}"
}
]
},
"allowedApiCalls": [
{
"name": "retrieveDataFileDDI",
"httpMethod": "GET",
"urlTemplate": "/api/v1/access/datafile/{fileId}/metadata/ddi",
"timeOut": 270
},
{
"name": "retrieveDataFile",
"httpMethod": "GET",
"urlTemplate": "/api/v1/access/datafile/{fileId}",
"timeOut": 270
},
{
"name": "uploadDataFile",
"httpMethod": "PUT",
"urlTemplate": "/api/v1/edit/{fileId}",
"timeOut": 270
}
]
}
44 changes: 44 additions & 0 deletions scripts/datacurationtool/dataverse-manifest-prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"displayName": "Data Curation Tool",
"description": "Data Curation Tool for curation of variables",
"scope": "file",
"type": "configure",
"contentType": "text/tab-separated-values",
"toolUrl": "https://dataverse.harvard.edu/datacuration/",
"toolParameters": {
"queryParameters": [
{
"fileId": "{fileId}"
},
{
"fileMetadataId": "{fileMetadataId}"
},
{
"datasetPid": "{datasetPid}"
},
{
"locale": "{localeCode}"
}
]
},
"allowedApiCalls": [
{
"name": "retrieveDataFileDDI",
"httpMethod": "GET",
"urlTemplate": "/api/v1/access/datafile/{fileId}/metadata/ddi",
"timeOut": 270
},
{
"name": "retrieveDataFile",
"httpMethod": "GET",
"urlTemplate": "/api/v1/access/datafile/{fileId}",
"timeOut": 270
},
{
"name": "uploadDataFile",
"httpMethod": "PUT",
"urlTemplate": "/api/v1/edit/{fileId}",
"timeOut": 270
}
]
}
21 changes: 21 additions & 0 deletions scripts/datacurationtool/docker/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: "2.4"

services:
dev_datacurationtool:
container_name: "dev_datacurationtool"
hostname: datacurationtool
image: datacurationtool
restart: on-failure
build: https://github.com/scholarsportal/Dataverse-Data-Curation-Tool.git
environment:
- http.host=0.0.0.0
- transport.host=localhost
- network.host=0.0.0.0
ports:
- "4200:80" # Proxy HTTP (Data Curation Tool Listener) / NGINX(Docker)
networks:
- dataverse

networks:
dataverse:
external: true
44 changes: 44 additions & 0 deletions scripts/datacurationtool/docker/dataverse-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"displayName": "Data Curation Tool",
"description": "Data Curation Tool for curation of variables",
"scope": "file",
"type": "configure",
"contentType": "text/tab-separated-values",
"toolUrl": "http://127.0.0.1:4200",
"toolParameters": {
"queryParameters": [
{
"fileId": "{fileId}"
},
{
"fileMetadataId": "{fileMetadataId}"
},
{
"datasetPid": "{datasetPid}"
},
{
"locale": "{localeCode}"
}
]
},
"allowedApiCalls": [
{
"name": "retrieveDataFileDDI",
"httpMethod": "GET",
"urlTemplate": "/api/v1/access/datafile/{fileId}/metadata/ddi",
"timeOut": 270
},
{
"name": "retrieveDataFile",
"httpMethod": "GET",
"urlTemplate": "/api/v1/access/datafile/{fileId}",
"timeOut": 270
},
{
"name": "uploadDataFile",
"httpMethod": "PUT",
"urlTemplate": "/api/v1/edit/{fileId}",
"timeOut": 270
}
]
}
12 changes: 12 additions & 0 deletions scripts/datacurationtool/docker/setup-datacurationtool.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
echo "Setting up Data Curation Tool"
TOOL=$(curl http://localhost:8080/api/admin/externalTools | grep "Data Curation Tool")
if [ -z "${TOOL}" ]; then
response=$(curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools --upload-file dataverse-manifest.json 2>&1)
if [ $? -ne 0 ] ; then
echo "Error: ""$response" && exit;
fi
fi

docker compose up -d &