Skip to content

Commit d953dac

Browse files
committed
add redaction, fix links, update curl examples
1 parent 72649ae commit d953dac

5 files changed

Lines changed: 344 additions & 34 deletions

File tree

6.1curlcommands.md

Lines changed: 126 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,7 +2008,61 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
20082008
These previewers support the [REFI-QDA standard](https://www.qdasoftware.org/) format for qualitative research files.
20092009
They allow viewing of the authors, codes, sources, annotations, and relationships listed in the codebook,
20102010
with added functionality to view code use frequency and filter by the entries in these tables. The REFI-QDA Project previewer
2011-
also allows viewing the annotation anchor text retrieved from the zipped source files.
2011+
also allows viewing the annotation anchor text retrieved from the zipped source files and download of the original and text versions of source files.
2012+
Further, for users who can edit the dataset, the Codebook and Project Previewers allow creation of "redacted" versions that become publicly previewable
2013+
even when the datafiles themselves are restricted. The "View *" previewers will only show when the user can download the datafile, while the "View Redacted *" previewers
2014+
will show all the time. As the first available previewer shows as the default one in the dataset files table, it is recommended that these previewers
2015+
be installed in the order shown below (so the full previewers are the default for those who can download the datafile).
2016+
2017+
2018+
2019+
```bash
2020+
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \
2021+
'{
2022+
"displayName":"View REFI-QDA Codebook",
2023+
"description":"View the contents of a REFI-QDA codebook file.",
2024+
"toolName":"refiqdaCodebookPreviewer",
2025+
"scope":"file",
2026+
"types":["preview"],
2027+
"toolUrl":"/dataverse-previewers/previewers/betatest/REFIQDAPreview.html",
2028+
"toolParameters": {
2029+
"queryParameters":[
2030+
{"fileid":"{fileId}"},
2031+
{"siteUrl":"{siteUrl}"},
2032+
{"datasetid":"{datasetId}"},
2033+
{"datasetversion":"{datasetVersion}"},
2034+
{"locale":"{localeCode}"}
2035+
]
2036+
},
2037+
"contentType":"text/x-xml-refiqda",
2038+
"allowedApiCalls": [
2039+
{
2040+
"name": "retrieveFileContents",
2041+
"httpMethod": "GET",
2042+
"urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=true",
2043+
"timeOut": 3600
2044+
},
2045+
{
2046+
"name": "downloadFile",
2047+
"httpMethod": "GET",
2048+
"urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=false",
2049+
"timeOut": 3600
2050+
},
2051+
{
2052+
"name": "uploadRedactedFile",
2053+
"httpMethod": "POST",
2054+
"urlTemplate": "/api/v1/access/datafile/{fileId}/auxiliary/qdc/1.0",
2055+
"timeOut": 3600
2056+
},
2057+
{
2058+
"name": "getDatasetVersionMetadata",
2059+
"httpMethod": "GET",
2060+
"urlTemplate": "/api/v1/datasets/{datasetId}/versions/{datasetVersion}",
2061+
"timeOut": 3600
2062+
}
2063+
]
2064+
}'
2065+
```
20122066

20132067
```bash
20142068
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \
@@ -2018,7 +2072,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
20182072
"toolName":"refiqdaProjectPreviewer",
20192073
"scope":"file",
20202074
"types":["preview"],
2021-
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/betatest/REFIQDPXPreview.html",
2075+
"toolUrl":"/dataverse-previewers/previewers/betatest/REFIQDPXPreview.html",
20222076
"toolParameters": {
20232077
"queryParameters":[
20242078
{"fileid":"{fileId}"},
@@ -2042,6 +2096,12 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
20422096
"urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=false",
20432097
"timeOut": 3600
20442098
},
2099+
{
2100+
"name": "uploadRedactedFile",
2101+
"httpMethod": "POST",
2102+
"urlTemplate": "/api/v1/access/datafile/{fileId}/auxiliary/qdpx/1.0",
2103+
"timeOut": 3600
2104+
},
20452105
{
20462106
"name": "getDatasetVersionMetadata",
20472107
"httpMethod": "GET",
@@ -2055,12 +2115,62 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
20552115
```bash
20562116
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \
20572117
'{
2058-
"displayName":"View REFI-QDA Codebook",
2059-
"description":"View the contents of a REFI-QDA codebook file.",
2060-
"toolName":"refiqdaCodebookPreviewer",
2118+
"displayName":"View Redacted REFI-QDA Project",
2119+
"description":"View the contents of a redacted EFI-QDA project file.",
2120+
"toolName":"refiqdaRedactedProjectPreviewer",
20612121
"scope":"file",
20622122
"types":["preview"],
2063-
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/betatest/REFIQDAPreview.html",
2123+
"toolUrl":"/dataverse-previewers/previewers/betatest/REFIQDPXPreview.html",
2124+
"toolParameters": {
2125+
"queryParameters":[
2126+
{"fileid":"{fileId}"},
2127+
{"siteUrl":"{siteUrl}"},
2128+
{"datasetid":"{datasetId}"},
2129+
{"datasetversion":"{datasetVersion}"},
2130+
{"locale":"{localeCode}"}
2131+
]
2132+
},
2133+
"contentType":"application/x-zip-refiqda",
2134+
"requirements": {
2135+
"auxFilesExist": [
2136+
{
2137+
"formatTag": "qdpx",
2138+
"formatVersion": "1.0"
2139+
}
2140+
]
2141+
},
2142+
"allowedApiCalls": [
2143+
{
2144+
"name": "retrieveFileContents",
2145+
"httpMethod": "GET",
2146+
"urlTemplate": "/api/v1/access/datafile/{fileId}/auxiliary/qdpx/1.0?gbrecs=true",
2147+
"timeOut": 3600
2148+
},
2149+
{
2150+
"name": "downloadFile",
2151+
"httpMethod": "GET",
2152+
"urlTemplate": "/api/v1/access/datafile/{fileId}/auxiliary/qdpx/1.0?gbrecs=false",
2153+
"timeOut": 3600
2154+
},
2155+
{
2156+
"name": "getDatasetVersionMetadata",
2157+
"httpMethod": "GET",
2158+
"urlTemplate": "/api/v1/datasets/{datasetId}/versions/{datasetVersion}",
2159+
"timeOut": 3600
2160+
}
2161+
]
2162+
}'
2163+
```
2164+
2165+
```bash
2166+
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \
2167+
'{
2168+
"displayName":"View Redacted REFI-QDA Codebook",
2169+
"description":"View the contents of a redacted REFI-QDA codebook file.",
2170+
"toolName":"refiqdaRedactedCodebookPreviewer",
2171+
"scope":"file",
2172+
"types":["preview"],
2173+
"toolUrl":"/dataverse-previewers/previewers/betatest/REFIQDAPreview.html",
20642174
"toolParameters": {
20652175
"queryParameters":[
20662176
{"fileid":"{fileId}"},
@@ -2071,17 +2181,25 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
20712181
]
20722182
},
20732183
"contentType":"text/x-xml-refiqda",
2184+
"requirements": {
2185+
"auxFilesExist": [
2186+
{
2187+
"formatTag": "qdc",
2188+
"formatVersion": "1.0"
2189+
}
2190+
]
2191+
},
20742192
"allowedApiCalls": [
20752193
{
20762194
"name": "retrieveFileContents",
20772195
"httpMethod": "GET",
2078-
"urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=true",
2196+
"urlTemplate": "/api/v1/access/datafile/{fileId}/auxiliary/qdc/1.0?gbrecs=true",
20792197
"timeOut": 3600
20802198
},
20812199
{
20822200
"name": "downloadFile",
20832201
"httpMethod": "GET",
2084-
"urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=false",
2202+
"urlTemplate": "/api/v1/access/datafile/{fileId}/auxiliary/qdc/1.0?gbrecs=false",
20852203
"timeOut": 3600
20862204
},
20872205
{

previewers/betatest/js/refiqda.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ function writeContent(fileUrl, file, title, authors) {
1616
}
1717
fetch(fileUrl)
1818
.then(response => response.text())
19-
.then(data => parseData(data));
19+
.then(data => parseData(data, file));
2020
}

0 commit comments

Comments
 (0)