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

6919 preview tools #7311

Merged
merged 34 commits into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
bee8880
Added static preview icon btn to file table on dataset pg, reviewed r…
mheppler Aug 20, 2020
9a6c0c9
Added hasPreviewMode to example code in Admin Guide, added preview ic…
mheppler Aug 21, 2020
78fb7df
Fixed format and layout issues on Patterns pg in Style Guide [ref #6919]
mheppler Aug 24, 2020
37afbce
Merge branch 'develop' into 6919-preview-tools
sekmiller Aug 25, 2020
b142cc5
Merge branch 'develop' into 6919-preview-tools
sekmiller Aug 27, 2020
e2d0caf
#6919 add Preview Type to External Tools
sekmiller Aug 28, 2020
8b2dcfd
#6919 preview mode logic
sekmiller Aug 28, 2020
54bd1e3
Merge branch 'develop' into 6919-preview-tools
sekmiller Sep 2, 2020
5f102be
fix formatting #6919
pdurbin Sep 11, 2020
80fe764
get test passing (preview added) #6919
pdurbin Sep 11, 2020
a2fb03c
add tools to test explore, preview, and both #6919
pdurbin Sep 11, 2020
2c94148
show preview tools on Preview tab #6919
pdurbin Sep 14, 2020
de01f35
selectively render preview/eyeball button #6919
pdurbin Sep 14, 2020
50f9018
remove binding and process=@this #6919
pdurbin Sep 25, 2020
886cab8
show gb/terms on Preview tab, relax preview rules #6919
pdurbin Sep 30, 2020
c509773
Fixed guestbook form focus issue, added external tool type render log…
mheppler Oct 2, 2020
2115b6d
Added conditional btn text to file pg preview tab external tool btn […
mheppler Oct 5, 2020
2b34ca9
adding "process" to target correct fields #6919
pdurbin Oct 5, 2020
9a24283
move validateThisContext up, remove extra p:fragment #6919
pdurbin Oct 5, 2020
f8213ba
more precise update than "form" #6919
pdurbin Oct 5, 2020
55c6854
expand "update" for validation #6919
pdurbin Oct 5, 2020
a6d32ff
Merge branch 'develop' into 6919-preview-tools #6919
pdurbin Oct 5, 2020
bff99b3
cleanup (no-op), formatting, etc. #6919
pdurbin Oct 6, 2020
90f1673
update docs for preview tools branch #6919
pdurbin Oct 7, 2020
a42fa4d
add release note for preview tools #6919
pdurbin Oct 7, 2020
e469cc4
Merge branch 'develop' into 6919-preview-tools #6919
pdurbin Oct 7, 2020
5696f5f
Merge branch 'develop' into 6919-preview-tools #6919
pdurbin Oct 8, 2020
e5eacae
remove "Tools" from preview tool switcher #6919
pdurbin Oct 15, 2020
767882b
support multiple types, remove hasPreviewMode #6919
pdurbin Oct 21, 2020
6b62d0d
Merge branch 'develop' into 6919-preview-tools #6919
pdurbin Oct 21, 2020
e73d2f4
remove validation checks we don't need #6919
pdurbin Oct 26, 2020
132e1ee
Merge branch 'develop' into 6919-preview-tools #6919
pdurbin Oct 26, 2020
a82d839
#6919 remove unused code
sekmiller Oct 27, 2020
b6c0778
Merge branch 'develop' into 6919-preview-tools
sekmiller Oct 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions doc/release-notes/6919-preview-tools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Release Highlights

### File Preview When Guestbooks or Terms Exist

Previously, file preview was only available when files were publicly downloadable. Now if a guestbook or terms (or both) are configured for the dataset, they will be shown in the Preview tab and once they are agreed to, the file preview will appear (#6919).

### Preview Only External Tools

A new external tool type called "preview" has been added that prevents the tool from being displayed under "Explore Options" under the "Access File" button on the file landing page (#6919).


## Major Use Cases

Newly-supported use cases in this release include:

- Users can now preview files that have a guestbook or terms. (Issue #6919)
- External tools authors can indicate that their tool is "preview only". (Issue #6919)


## Notes for Dataverse Installation Administrators

### Converting Explore External Tools to Preview Only

When the war file is deployed, a SQL migration script will convert [dataverse-previewers][] to have both "explore" and "preview" types so that they will continue to be displayed in the Preview tab.

If you would prefer that these tools be preview only, you can delete the tools, adjust the JSON manifests (changing "explore" to "preview"), and re-add them.

[dataverse-previewers]: https://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers

## Notes for Tool Developers and Integrators

### Preview Only External Tools

A new external tool type called "preview" has been added that prevents the tool from being displayed under "Explore Options" under the "Access File" button on the file landing page (#6919). This "preview" type replaces "hasPreviewMode", which has been removed.

### Multiple Types for External Tools

External tools now support multiple types. In practice, the types "explore" and "preview" are the only combination that makes a difference in the UI as opposed to only having only one or the other type (see "preview only" above). Multiple types are specified in the JSON manifest with an array in "types". The older, single "type" is still supported but should be considered deprecated.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Tool Type Scope Description
TwoRavens explore file A system of interlocking statistical tools for data exploration, analysis, and meta-analysis: http://2ra.vn. See the :doc:`/user/data-exploration/tworavens` section of the User Guide for more information on TwoRavens from the user perspective and the :doc:`/installation/r-rapache-tworavens` section of the Installation Guide.
Data Explorer explore file A GUI which lists the variables in a tabular data file allowing searching, charting and cross tabulation analysis. See the README.md file at https://github.com/scholarsportal/Dataverse-Data-Explorer for the instructions on adding Data Explorer to your Dataverse; and the :doc:`/installation/prerequisites` section of the Installation Guide for the instructions on how to set up **basic R configuration required** (specifically, Dataverse uses R to generate .prep metadata files that are needed to run Data Explorer).
Whole Tale explore dataset A platform for the creation of reproducible research packages that allows users to launch containerized interactive analysis environments based on popular tools such as Jupyter and RStudio. Using this integration, Dataverse users can launch Jupyter and RStudio environments to analyze published datasets. For more information, see the `Whole Tale User Guide <https://wholetale.readthedocs.io/en/stable/users_guide/integration.html>`_.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"displayName": "Dynamic Dataset Tool",
"description": "Dazzles! Dizzying!",
"scope": "dataset",
"type": "explore",
"types": [
"explore"
],
"toolUrl": "https://dynamicdatasettool.com/v2",
"toolParameters": {
"queryParameters": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"description": "Fabulous Fun for Files!",
"toolName": "fabulous",
"scope": "file",
"type": "explore",
"types": [
"explore",
"preview"
],
"toolUrl": "https://fabulousfiletool.com",
"contentType": "text/tab-separated-values",
"toolParameters": {
Expand Down
27 changes: 17 additions & 10 deletions doc/sphinx-guides/source/admin/external-tools.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
External Tools
==============

External tools can provide additional features that are not part of Dataverse itself, such as data exploration.
External tools can provide additional features that are not part of Dataverse itself, such as data file previews, visualization, and curation.

.. contents:: |toctitle|
:local:
Expand All @@ -12,7 +12,7 @@ Inventory of External Tools
---------------------------

.. csv-table::
:header: "Tool", "Type", "Scope", "Description"
:header-rows: 1
:widths: 20, 10, 5, 65
:delim: tab
:file: ../_static/admin/dataverse-external-tools.tsv
Expand All @@ -31,14 +31,12 @@ To add an external tool to your installation of Dataverse you must first downloa

Go to :ref:`inventory-of-external-tools` and download a JSON manifest for one of the tools by following links in the description to installation instructions.

In the curl command below, replace the placeholder "fabulousFileTool.json" placeholder for the actual name of the JSON file you downloaded.
Configure the tool with the curl command below, making sure to replace the ``fabulousFileTool.json`` placeholder for name of the JSON manifest file you downloaded.

.. code-block:: bash

curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools --upload-file fabulousFileTool.json

Note that some tools will provide a preview mode, which provides an embedded, simplified view of the tool on the file pages of your installation. This is controlled by the `hasPreviewMode` parameter.

Listing All External Tools in Dataverse
+++++++++++++++++++++++++++++++++++++++

Expand Down Expand Up @@ -75,17 +73,26 @@ Testing External Tools

Once you have added an external tool to your installation of Dataverse, you will probably want to test it to make sure it is functioning properly.

File Level vs. Dataset Level
++++++++++++++++++++++++++++

File level tools are specific to the file type (content type or MIME type). For example, a tool may work with PDFs, which have a content type of "application/pdf".

In contrast, dataset level tools are always available no matter what file types are within the dataset.

File Level Explore Tools
++++++++++++++++++++++++

File level explore tools are specific to the file type (content type or MIME type) of the file. For example, Data Explorer is tool for exploring tabular data files.
File level explore tools provide a variety of features from data visualization to statistical analysis.

An "Explore" button will appear (on both the dataset page and the file landing page) for files that match the type that the tool has been built for. When there are multiple explore tools for a filetype, the button becomes a dropdown.
For each supported file type, file level explore tools appear in the file listing of the dataset page as well as under the "Access" button on each file page.

File Level Preview Tools
++++++++++++++++++++++++

File level explore tools can be set up to display in preview mode, which is a simplified view of an explore tool designed specifically for embedding in the file page.
File level preview tools allow the user to see a preview of the file contents without having to download it.

When a file has a preview available, a preview icon will appear next to that file in the file listing on the dataset page. On the file page itself, the preview will appear in a Preview tab either immediately or once a guestbook has been filled in or terms, if any, have been agreed to.

File Level Configure Tools
++++++++++++++++++++++++++
Expand All @@ -95,12 +102,12 @@ File level configure tools are only available when you log in and have write acc
Dataset Level Explore Tools
+++++++++++++++++++++++++++

When a dataset level explore tool is added, an "Explore" button on the dataset page will appear. This button becomes a drop down when there are multiple tools.
Dataset level explore tools allow the user to explore all the files in a dataset.

Dataset Level Configure Tools
+++++++++++++++++++++++++++++

Configure tools at the dataset level are not currently supported. No button appears in the GUI if you add this type of tool.
Configure tools at the dataset level are not currently supported.

Writing Your Own External Tool
------------------------------
Expand Down
4 changes: 2 additions & 2 deletions doc/sphinx-guides/source/admin/geoconnect-worldmap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ SQL commands to point a Dataverse installation at different Geoconnect servers:
Removing Dead Explore Links
---------------------------

After a map has been created in WorldMap (assuming all the setup has been done), an "Explore" button will appear next to the name of the file in Dataverse. The "Explore" button should open the map in WorldMap. In rare occasions, the map has been deleted on the WorldMap side such that the "Explore" button goes nowhere, resulting in a dead link, a 404.
After a map has been created in WorldMap (assuming all the setup has been done), in Dataverse the file will display WorldMap as an explore option. In rare occasions, the map has been deleted on the WorldMap resulting in a dead link, a 404 page not found error.

Functionality has been added on the Dataverse side to iterate through all the maps Dataverse knows about (stored in the ``maplayermetadata`` database table) and to check for the existence of each map in WorldMap. The status code returned from WorldMap (200, 404, etc.) is recorded in Dataverse along with a timestamp of when the check was performed. To perform this check, you can execute the following ``curl`` command:

``curl -X POST http://localhost:8080/api/admin/geoconnect/mapLayerMetadatas/check``

The output above will contain the ``layerLink`` being checked as well as the HTTP response status code (200, 404, etc.) in the ``lastVerifiedStatus`` field. 200 means OK and 404 means not found. 500 might indicate that the map is only temporarily unavailable. The ``lastVerifiedStatus`` and ``lastVerifiedTime`` will be persisted to the ``maplayermetadata`` database table.

Armed with this information about WorldMap returning a 404 for a map, you may want to delete any record of the map on the Dataverse side so that the "Explore" button goes away (and so that thumbnail files are cleaned up). To accomplish this, use the following ``curl`` command, substituting the id of the file:
Armed with this information about WorldMap returning a 404 for a map, you may want to delete any record of the map on the Dataverse side removing WorldMap as an explore option (and so that thumbnail files are cleaned up). To accomplish this, use the following ``curl`` command, substituting the id of the file:

``curl -H "X-Dataverse-key: $API_TOKEN" -X DELETE http://localhost:8080/api/files/{file_id}/map``

Expand Down
4 changes: 2 additions & 2 deletions doc/sphinx-guides/source/api/apps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ OSF allows you to view, download, and upload files to and from a Dataverse datas

https://github.com/CenterForOpenScience/osf.io/tree/develop/addons/dataverse

GeoConnect
Geoconnect
~~~~~~~~~~

GeoConnect allows Dataverse files to be visualized on http://worldmap.harvard.edu with the "Explore" button. Read more about it in the :doc:`/user/data-exploration/worldmap` section of the User Guide.
Geoconnect allows Dataverse files to be visualized and explored on `WorldMap <http://worldmap.harvard.edu>`_. Read more about it in the :doc:`/user/data-exploration/worldmap` section of the User Guide.

https://github.com/IQSS/geoconnect

Expand Down
30 changes: 18 additions & 12 deletions doc/sphinx-guides/source/api/external-tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,38 @@ External tools can provide additional features that are not part of Dataverse it
Introduction
------------

You can think of a external tool as **a glorified hyperlink** that opens a browser window in a new tab on some other website. The term "external" is used to indicate that the user has left the Dataverse web interface. For example, perhaps the user is looking at a dataset on https://demo.dataverse.org . They click "Explore" and are brought to https://fabulousfiletool.com?fileId=42&siteUrl=http://demo.dataverse.org
External tools are additional applications the user can access or open from Dataverse to preview, explore, and manipulate data files and datasets. The term "external" is used to indicate that the tool is not part of the main Dataverse application.

The "other website" (fabulousfiletool.com in the example above) is probably part of the same ecosystem of scholarly publishing that Dataverse itself participates in. Sometimes the other website runs entirely in the browser. Sometimes the other website is a full blown server side web application like Dataverse itself.
Once you have created the external tool itself (which is most of the work!), you need to teach Dataverse how to construct URLs that your tool needs to operate. For example, if you've deployed your tool to fabulousfiletool.com your tool might want the ID of a file and the siteUrl of the Dataverse installation like this: https://fabulousfiletool.com?fileId=42&siteUrl=http://demo.dataverse.org

The possibilities for external tools are endless. Let's look at some examples to get your creative juices flowing.
In short, you will be creating a manifest in JSON format that describes not only how to construct URLs for your tool, but also what types of files your tool operates on, where it should appear in the Dataverse web interfaces, etc.

The possibilities for external tools are endless. Let's look at some examples to get your creative juices flowing. Then we'll look at a complete list of parameters you can use when creating the manifest file for your tool.

If you're still looking for more information on external tools, you can also watch a video introduction called `Background on the External Tool Framework`_ (slides_) from the 2020 Dataverse Community Meeting.

.. _Background on the External Tool Framework: https://youtu.be/YH4I_kldmGI?t=159

.. _slides: https://osf.io/xjdfw/

Examples of External Tools
--------------------------

Note: This is the same list that appears in the :doc:`/admin/external-tools` section of the Admin Guide.

.. csv-table::
:header: "Tool", "Type", "Scope", "Description"
:header-rows: 1
:widths: 20, 10, 5, 65
:delim: tab
:file: ../_static/admin/dataverse-external-tools.tsv

How External Tools Are Presented to Users
-----------------------------------------

An external tool can appear in Dataverse in one of three ways:
An external tool can appear in Dataverse in a variety of ways:

- under an "Explore" or "Configure" button either on a dataset landing page
- under an "Explore" or "Configure" button on a file landing page
- as an explore, preview, or configure option for a file
- as an explore option for a dataset
- as an embedded preview on the file landing page

See also the :ref:`testing-external-tools` section of the Admin Guide for some perspective on how installations of Dataverse will expect to test your tool before announcing it to their users.
Expand All @@ -50,7 +58,7 @@ Let's look at two examples of external tool manifests (one at the file level and
External Tools for Files
^^^^^^^^^^^^^^^^^^^^^^^^

:download:`fabulousFileTool.json <../_static/installation/files/root/external-tools/fabulousFileTool.json>` is a file level explore tool that operates on tabular files:
:download:`fabulousFileTool.json <../_static/installation/files/root/external-tools/fabulousFileTool.json>` is a file level both an "explore" tool and a "preview" tool that operates on tabular files:

.. literalinclude:: ../_static/installation/files/root/external-tools/fabulousFileTool.json

Expand All @@ -70,20 +78,18 @@ Terminology
=========================== ==========
Term Definition
=========================== ==========
external tool manifest A **JSON file** the defines the URL constructed by Dataverse when users click "Explore" or "Configure" buttons. External tool makers are asked to host this JSON file on a website (no app store yet, sorry) and explain how to use install and use the tool. Examples include :download:`fabulousFileTool.json <../_static/installation/files/root/external-tools/fabulousFileTool.json>` and :download:`dynamicDatasetTool.json <../_static/installation/files/root/external-tools/dynamicDatasetTool.json>` as well as the real world examples above such as Data Explorer.
external tool manifest A **JSON file** the defines the URL constructed by Dataverse when users click explore or configure tool options. External tool makers are asked to host this JSON file on a website (no app store yet, sorry) and explain how to use install and use the tool. Examples include :download:`fabulousFileTool.json <../_static/installation/files/root/external-tools/fabulousFileTool.json>` and :download:`dynamicDatasetTool.json <../_static/installation/files/root/external-tools/dynamicDatasetTool.json>` as well as the real world examples above such as Data Explorer.

displayName The **name** of the tool in the Dataverse web interface. For example, "Data Explorer".

description The **description** of the tool, which appears in a popup (for configure tools only) so the user who clicked the tool can learn about the tool before being redirected the tool in a new tab in their browser. HTML is supported.

scope Whether the external tool appears and operates at the **file** level or the **dataset** level. Note that a file level tool much also specify the type of file it operates on (see "contentType" below).

type Whether the external tool is an **explore** tool or a **configure** tool. Configure tools require an API token because they make changes to data files (files within datasets). Configure tools are currently not supported at the dataset level (no "Configure" button appears in the GUI for datasets).
types Whether the external tool is an **explore** tool, a **preview** tool, a **configure** tool or any combination of these (multiple types are supported for a single tool). Configure tools require an API token because they make changes to data files (files within datasets). Configure tools are currently not supported at the dataset level. The older "type" keyword that allows you to pass a single type as a string is deprecated but still supported.

toolUrl The **base URL** of the tool before query parameters are added.

hasPreviewMode A boolean that indicates whether tool has a preview mode which can be embedded in the File Page. Since this view is designed for embedding within Dataverse, the preview mode for a tool will typically be a view without headers or other options that may be included with a tool that is designed to be launched in a new window. Sometimes, a tool will exist solely to preview files in Dataverse and the preview mode will be the same as the regular view.

contentType File level tools operate on a specific **file type** (content type or MIME type such as "application/pdf") and this must be specified. Dataset level tools do not use contentType.

toolParameters **Query parameters** are supported and described below.
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx-guides/source/developers/geospatial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ The ``get_latest_jointarget_information()`` in ``utils.py`` retrieves recent Joi
Setting Up WorldMap Test Data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For the dataset page, this script gives a query to add test WorldMap map data. After the query is run, the "Explore Map" button should appear for a tabular file or shapefile. In the example SQL queries below, substitute ``$DATASET_ID`` and ``$DATAFILE_ID`` with the appropriate ID's.
For the dataset page, this script gives a query to add test WorldMap map data. After the query is run, the explore in WorldMap option should display for tabular files or shapefiles. In the example SQL queries below, substitute ``$DATASET_ID`` and ``$DATAFILE_ID`` with the appropriate ID's.

To add sample map data for a tabular file:

Expand Down