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: 3 additions & 3 deletions 5.2curlcommands.md
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"jupyterPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/betatest/JupyterPreview.html",
"toolUrl":"https://qualitativedatarepository/dataverse-previewers/previewers/betatest/JupyterPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -781,7 +781,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"mapShpPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"qualitativedatarepository.github.io/dataverse-previewers/previewers/v1.5/MapShpPreview.html",
"toolUrl":"https://qualitativedatarepository.github.io/dataverse-previewers/previewers/v1.5/MapShpPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand Down Expand Up @@ -810,7 +810,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"mapShpPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"qualitativedatarepository.github.io/dataverse-previewers/previewers/v1.5/MapRasterPreview.html",
"toolUrl":"https://qualitativedatarepository.github.io/dataverse-previewers/previewers/v1.5/MapRasterPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand Down
134 changes: 126 additions & 8 deletions 6.1curlcommands.md
Original file line number Diff line number Diff line change
Expand Up @@ -2008,7 +2008,61 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
These previewers support the [REFI-QDA standard](https://www.qdasoftware.org/) format for qualitative research files.
They allow viewing of the authors, codes, sources, annotations, and relationships listed in the codebook,
with added functionality to view code use frequency and filter by the entries in these tables. The REFI-QDA Project previewer
also allows viewing the annotation anchor text retrieved from the zipped source files.
also allows viewing the annotation anchor text retrieved from the zipped source files and download of the original and text versions of source files.
Further, for users who can edit the dataset, the Codebook and Project Previewers allow creation of "redacted" versions that become publicly previewable
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
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
be installed in the order shown below (so the full previewers are the default for those who can download the datafile).



```bash
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \
'{
"displayName":"View REFI-QDA Codebook",
"description":"View the contents of a REFI-QDA codebook file.",
"toolName":"refiqdaCodebookPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"/dataverse-previewers/previewers/betatest/REFIQDAPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
{"siteUrl":"{siteUrl}"},
{"datasetid":"{datasetId}"},
{"datasetversion":"{datasetVersion}"},
{"locale":"{localeCode}"}
]
},
"contentType":"text/x-xml-refiqda",
"allowedApiCalls": [
{
"name": "retrieveFileContents",
"httpMethod": "GET",
"urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=true",
"timeOut": 3600
},
{
"name": "downloadFile",
"httpMethod": "GET",
"urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=false",
"timeOut": 3600
},
{
"name": "uploadRedactedFile",
"httpMethod": "POST",
"urlTemplate": "/api/v1/access/datafile/{fileId}/auxiliary/qdc/1.0",
"timeOut": 3600
},
{
"name": "getDatasetVersionMetadata",
"httpMethod": "GET",
"urlTemplate": "/api/v1/datasets/{datasetId}/versions/{datasetVersion}",
"timeOut": 3600
}
]
}'
```

```bash
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \
Expand All @@ -2018,7 +2072,7 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"toolName":"refiqdaProjectPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/betatest/REFIQDPXPreview.html",
"toolUrl":"/dataverse-previewers/previewers/betatest/REFIQDPXPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -2042,6 +2096,12 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
"urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=false",
"timeOut": 3600
},
{
"name": "uploadRedactedFile",
"httpMethod": "POST",
"urlTemplate": "/api/v1/access/datafile/{fileId}/auxiliary/qdpx/1.0",
"timeOut": 3600
},
{
"name": "getDatasetVersionMetadata",
"httpMethod": "GET",
Expand All @@ -2055,12 +2115,62 @@ 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":"View REFI-QDA Codebook",
"description":"View the contents of a REFI-QDA codebook file.",
"toolName":"refiqdaCodebookPreviewer",
"displayName":"View Redacted REFI-QDA Project",
"description":"View the contents of a redacted EFI-QDA project file.",
"toolName":"refiqdaRedactedProjectPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/betatest/REFIQDAPreview.html",
"toolUrl":"/dataverse-previewers/previewers/betatest/REFIQDPXPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
{"siteUrl":"{siteUrl}"},
{"datasetid":"{datasetId}"},
{"datasetversion":"{datasetVersion}"},
{"locale":"{localeCode}"}
]
},
"contentType":"application/x-zip-refiqda",
"requirements": {
"auxFilesExist": [
{
"formatTag": "qdpx",
"formatVersion": "1.0"
}
]
},
"allowedApiCalls": [
{
"name": "retrieveFileContents",
"httpMethod": "GET",
"urlTemplate": "/api/v1/access/datafile/{fileId}/auxiliary/qdpx/1.0?gbrecs=true",
"timeOut": 3600
},
{
"name": "downloadFile",
"httpMethod": "GET",
"urlTemplate": "/api/v1/access/datafile/{fileId}/auxiliary/qdpx/1.0?gbrecs=false",
"timeOut": 3600
},
{
"name": "getDatasetVersionMetadata",
"httpMethod": "GET",
"urlTemplate": "/api/v1/datasets/{datasetId}/versions/{datasetVersion}",
"timeOut": 3600
}
]
}'
```

```bash
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \
'{
"displayName":"View Redacted REFI-QDA Codebook",
"description":"View the contents of a redacted REFI-QDA codebook file.",
"toolName":"refiqdaRedactedCodebookPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"/dataverse-previewers/previewers/betatest/REFIQDAPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
Expand All @@ -2071,17 +2181,25 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
]
},
"contentType":"text/x-xml-refiqda",
"requirements": {
"auxFilesExist": [
{
"formatTag": "qdc",
"formatVersion": "1.0"
}
]
},
"allowedApiCalls": [
{
"name": "retrieveFileContents",
"httpMethod": "GET",
"urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=true",
"urlTemplate": "/api/v1/access/datafile/{fileId}/auxiliary/qdc/1.0?gbrecs=true",
"timeOut": 3600
},
{
"name": "downloadFile",
"httpMethod": "GET",
"urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=false",
"urlTemplate": "/api/v1/access/datafile/{fileId}/auxiliary/qdc/1.0?gbrecs=false",
"timeOut": 3600
},
{
Expand Down
5 changes: 2 additions & 3 deletions previewers/betatest/REFIQDAPreview.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
<title class="refiqdaPreviewText">REFI-QDA Preview</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script type="text/javascript" src="js/xss.js"></script>
<link href="https://cdn.datatables.net/v/dt/dt-2.3.5/sb-1.8.4/sl-3.1.3/datatables.min.css" rel="stylesheet" integrity="sha384-DpDi3pDJ2463LMrQcpHQvB1a5fUBPyXzbcEwddvQf8pQoEV7wcuoPRmD80IcKSui" crossorigin="anonymous">
<script src="https://cdn.datatables.net/v/dt/dt-2.3.5/sb-1.8.4/sl-3.1.3/datatables.min.js" integrity="sha384-3uEOa3r5q7Ds0Hy3F6S6bAIKatT3XgusNgosaq0b6RbFdy+AtzwpqMPmCxosv6T9" crossorigin="anonymous"></script>
<script src="https://unpkg.com/@popperjs/core@2"></script>
<link href="https://cdn.datatables.net/v/dt/dt-2.3.7/b-3.2.6/sl-3.1.3/datatables.min.css" rel="stylesheet" integrity="sha384-9yFi5daN2JbhIggBjwc0HdEbwVl9JkZIJtEJqe9jj1tvEQNNnBAn+kgqPlXDrSDD" crossorigin="anonymous">
<script src="https://cdn.datatables.net/v/dt/dt-2.3.7/b-3.2.6/sl-3.1.3/datatables.min.js" integrity="sha384-vKlJ3Fd2BmxNNmrgkf/yAi4RQ8BJvEurqwWXHtJZYcWkIfUFJEoBxxOpSgNBOGW1" crossorigin="anonymous"></script> <script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
<link rel="stylesheet" href="https://unpkg.com/tippy.js@6/dist/tippy.css" />
<script type="text/javascript" src="js/refiqda.js"></script>
Expand Down
6 changes: 3 additions & 3 deletions previewers/betatest/REFIQDPXPreview.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
<link rel="stylesheet" href="https://unpkg.com/tippy.js@6/dist/tippy.css" />
<script type="text/javascript" src="js/retriever.js"></script>
<script type="text/javascript" src="js/refiqdpx.js"></script>
<script type="text/javascript" src="js/refiqdacore.js"></script>
<script type="text/javascript" src="js/ziplocal.js"></script>
<script src="lib/jquery.i18n.js"></script>
<script src="lib/jquery.i18n.messagestore.js"></script>
<script src="lib/jquery.i18n.language.js"></script>
<link href="https://cdn.datatables.net/v/dt/dt-2.3.5/sb-1.8.4/sl-3.1.3/datatables.min.css" rel="stylesheet" integrity="sha384-DpDi3pDJ2463LMrQcpHQvB1a5fUBPyXzbcEwddvQf8pQoEV7wcuoPRmD80IcKSui" crossorigin="anonymous">
<script src="https://cdn.datatables.net/v/dt/dt-2.3.5/sb-1.8.4/sl-3.1.3/datatables.min.js" integrity="sha384-3uEOa3r5q7Ds0Hy3F6S6bAIKatT3XgusNgosaq0b6RbFdy+AtzwpqMPmCxosv6T9" crossorigin="anonymous"></script>
<script type="text/javascript" src="js/retriever.js"></script>
<link href="https://cdn.datatables.net/v/dt/dt-2.3.7/b-3.2.6/sl-3.1.3/datatables.min.css" rel="stylesheet" integrity="sha384-9yFi5daN2JbhIggBjwc0HdEbwVl9JkZIJtEJqe9jj1tvEQNNnBAn+kgqPlXDrSDD" crossorigin="anonymous">
<script src="https://cdn.datatables.net/v/dt/dt-2.3.7/b-3.2.6/sl-3.1.3/datatables.min.js" integrity="sha384-vKlJ3Fd2BmxNNmrgkf/yAi4RQ8BJvEurqwWXHtJZYcWkIfUFJEoBxxOpSgNBOGW1" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.21.0/cytoscape.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.21.0/cytoscape.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
Expand Down
15 changes: 15 additions & 0 deletions previewers/betatest/css/refiqdas.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,19 @@

.tooltip-text {
margin-top: 5px;
}

label {
margin-left:5px;
}

.redacted-notice {
background-color: #fffbe6; /* A light yellow background */
border: 1px solid #ffe58f; /* A slightly darker yellow border */
border-radius: 4px; /* Softens the corners */
padding: 15px; /* Adds space inside the box */
margin-bottom: 20px; /* Adds space below the notice */
color: #8a6d3b; /* A dark, brownish-yellow text color for good contrast */
text-align: center; /* Centers the notice text */
font-weight: bold; /* Makes the text bold */
}
29 changes: 17 additions & 12 deletions previewers/betatest/js/refiqda.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
function writeContent(fileUrl, file, title, authors) {
addStandardPreviewHeader(file, title, authors);
options = {
"stripIgnoreTag": true,
"stripIgnoreTagBody": ['script', 'head']
}; // Custom rules
wait = $('<div/>').attr('id', 'waiting');
$('<img/>').width('15%').attr('src','images/Loading_icon.gif').attr('id','throbber').appendTo(wait);
$('<span/>').text('Retrieving File...').appendTo(wait);
wait.appendTo($('.preview'));
addStandardPreviewHeader(file, title, authors);
options = {
"stripIgnoreTag": true,
"stripIgnoreTagBody": ['script', 'head']
}; // Custom rules
wait = $('<div/>').attr('id', 'waiting');
$('<img/>').width('15%').attr('src', 'images/Loading_icon.gif').attr('id', 'throbber').appendTo(wait);
$('<span/>').text('Retrieving File...').appendTo(wait);
wait.appendTo($('.preview'));

fetch(fileUrl)
.then(response => response.text())
.then(data => parseData(data));
if (fileUrl.includes('auxiliary/qdpx')) {
redactedMode = true;
} else {
redactedMode = false;
}
fetch(fileUrl)
.then(response => response.text())
.then(data => parseData(data, file));
}
Loading
Loading