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

3657 4393 modular explore plus guestbook #4413

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5ae8418
stub out modular explore #3657 #4249
pdurbin Jan 3, 2018
488b604
Update the description for the Data Explorer
Jan 4, 2018
bd17812
Merge pull request #4397 from kevinworthington/patch-2
pdurbin Jan 4, 2018
61c4936
get test passing, {siteUrl} is now a valid reserved word #3657
pdurbin Jan 5, 2018
6538b93
differentiate external tools under own dropdown for now #3657
pdurbin Jan 5, 2018
b3be37e
make external explore tools available on dataset page too #3657
pdurbin Jan 5, 2018
e873c6e
Data Explorer expects `fileId` not `fileid` #4249 #3657
pdurbin Jan 5, 2018
233cdc1
add `type` to `externaltool` table for "explore" vs "configure" #3657
pdurbin Jan 8, 2018
bcca40b
externaltool type enum is stored in ALL CAPS #3657
pdurbin Jan 8, 2018
5d18067
put external tools under Explore button dropdown #3657
pdurbin Jan 8, 2018
0e1c1e9
have external tools respect downloadPopupRequired #3657
pdurbin Jan 8, 2018
79161d0
mention external tools in Data Exploration Guide #3657
pdurbin Jan 8, 2018
44fff97
#4393 fix gb record update and validators
sekmiller Jan 9, 2018
db4b868
#4393 add validation messages directly to required custom questions
sekmiller Jan 10, 2018
e916af0
Merge branch 'develop' into 4393-guestbook-not-enforcing-reqd-fields
sekmiller Jan 10, 2018
f460d5b
get TwoRavens working again (FIXME for external tools) #3657
pdurbin Jan 10, 2018
ef87fde
get external tool popup working on dataset page #3657
pdurbin Jan 10, 2018
4204279
only show explore tools for tabular data #3657
pdurbin Jan 11, 2018
0f55916
Merge branch 'develop' into 3657-modular-explore #3657
pdurbin Jan 11, 2018
5c5b19b
#4393 fixes from code review
sekmiller Jan 11, 2018
a72941b
Merge branch #3657 '4393-guestbook-not-enforcing-reqd-fields' into 36…
pdurbin Jan 11, 2018
cfbae2e
get validation working on external tools #3657
pdurbin Jan 11, 2018
bb51bd2
Merge branch 'develop' into 4393-guestbook-not-enforcing-reqd-fields
sekmiller Jan 11, 2018
3519747
Merge branch #3657 '4393-guestbook-not-enforcing-reqd-fields' into 36…
pdurbin Jan 11, 2018
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"displayName": "Awesome Tool",
"description": "The most awesome tool.",
"type": "explore",
"toolUrl": "https://awesometool.com",
"toolParameters": {
"queryParameters": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"displayName": "Data Explorer",
"description": "The Data Explorer provides a GUI which lists the variables in a tabular data file allowing searching, charting and cross tabulation analysis.",
"type": "explore",
"toolUrl": "https://scholarsportal.github.io/Dataverse-Data-Explorer/",
"toolParameters": {
"queryParameters": [
{
"fileId": "{fileId}"
},
{
"siteUrl": "{siteUrl}"
}
]
}
}
3 changes: 3 additions & 0 deletions doc/sphinx-guides/source/installation/external-tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ External tools must be expressed in an external tool manifest file, a specific J

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

``type`` is required and must be ``explore`` or ``configure``.

In the example above, a mix of required and optional reserved words appear that can be used to insert dynamic values into tools. The supported values are:

- ``{fileId}`` (required) - The Dataverse database ID of a file the external tool has been launched on.
- ``{siteUrl}`` (optional) - The URL of the Dataverse installation that hosts the file with the fileId above.
- ``{apiToken}`` (optional) - The Dataverse API token of the user launching the external tool.

Making an External Tool Available in Dataverse
Expand Down
2 changes: 2 additions & 0 deletions doc/sphinx-guides/source/user/data-exploration/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
Data Exploration Guide
=======================================================

Note that the installation of Dataverse you are using may have additional or different tools configured. Developers interested in creating tools should refer to the :doc:`/installation/external-tools` section of the Installation Guide.

Contents:

.. toctree::
Expand Down
3 changes: 3 additions & 0 deletions scripts/database/upgrades/upgrade_v4.8.4_to_v4.9.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE externaltool ADD COLUMN type character varying(255);
UPDATE externaltool SET type = 'CONFIGURE';
ALTER TABLE externaltool ALTER COLUMN type SET NOT NULL;
12 changes: 12 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/CustomQuestionResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,17 @@ public boolean equals(Object object) {
public String toString() {
return "edu.harvard.iq.dvn.core.vdc.CustomQuestionResponse[ id=" + id + " ]";
}

@Transient private String validationMessage;

public String getValidationMessage() {
return validationMessage;
}

public void setValidationMessage(String validationMessage) {
this.validationMessage = validationMessage;
}


}

30 changes: 29 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
import edu.harvard.iq.dataverse.externaltools.ExternalTool;
import edu.harvard.iq.dataverse.externaltools.ExternalToolServiceBean;
import edu.harvard.iq.dataverse.export.SchemaDotOrgExporter;
import edu.harvard.iq.dataverse.externaltools.ExternalToolHandler;
import java.util.Collections;

import javax.faces.event.AjaxBehaviorEvent;
Expand Down Expand Up @@ -256,6 +257,7 @@ public enum DisplayMode {

List<ExternalTool> allTools = new ArrayList<>();
Map<Long,List<ExternalTool>> queriedFileTools = new HashMap<>();
Map<Long, List<ExternalToolHandler>> externalToolHandlersByFileId = new HashMap<>();

public Boolean isHasRsyncScript() {
return hasRsyncScript;
Expand Down Expand Up @@ -1431,6 +1433,7 @@ private String init(boolean initFull) {
// populate MapLayerMetadata
this.loadMapLayerMetadataLookup(); // A DataFile may have a related MapLayerMetadata object
this.guestbookResponse = guestbookResponseService.initGuestbookResponseForFragment(dataset, null, session);
this.getFileDownloadHelper().setGuestbookResponse(guestbookResponse);
logger.fine("Checking if rsync support is enabled.");
if (DataCaptureModuleUtil.rsyncSupportEnabled(settingsWrapper.getValueForKey(SettingsServiceBean.Key.UploadMethods))) {
try {
Expand Down Expand Up @@ -4049,13 +4052,38 @@ public List<ExternalTool> getExternalToolsForDataFile(Long fileId) {

DataFile dataFile = datafileService.find(fileId);
fileTools = externalToolService.findExternalToolsByFile(allTools, dataFile);
// TODO: Do we even need "configure" tools right now? Should we delete all this code?
List<ExternalTool> onlyConfigureTools = new ArrayList<>();
for (ExternalTool fileTool : fileTools) {
if (ExternalTool.Type.CONFIGURE.equals(fileTool.getType())) {
onlyConfigureTools.add(fileTool);
}
}
fileTools = onlyConfigureTools;

queriedFileTools.put(fileId, fileTools); //add externalTools to map so we don't have to do the lifting again

return fileTools;
}


public List<ExternalToolHandler> getExternalToolHandlersForDataFile(Long fileId) {
List<ExternalToolHandler> externalToolHandlers = externalToolHandlersByFileId.get(fileId);
if (externalToolHandlers != null) { //if already queried before and added to list
return externalToolHandlers;
}
DataFile dataFile = datafileService.find(fileId);
externalToolHandlers = new ArrayList<>();
for (ExternalTool externalTool : allTools) {
if (ExternalTool.Type.EXPLORE.equals(externalTool.getType())) {
if (dataFile.isTabularData()) {
// TODO: What about the API Token? Data Explorer doesn't need it but TwoRavens will if it's made into an external tool.
externalToolHandlers.add(new ExternalToolHandler(externalTool, dataFile, null));
}
}
}
externalToolHandlersByFileId.put(fileId, externalToolHandlers); //add externalTools to map so we don't have to do the lifting again
return externalToolHandlers;
}

Boolean thisLatestReleasedVersion = null;

Expand Down
Loading