From c1a612628e331cdaa29753a8c6369fc7c7bcd9ae Mon Sep 17 00:00:00 2001 From: Philip Durbin Date: Tue, 30 Jun 2020 13:12:39 -0400 Subject: [PATCH] add download all buttons under access button #6118 --- .../edu/harvard/iq/dataverse/DatasetPage.java | 21 ++++++++++++-- src/main/webapp/dataset.xhtml | 28 ++++++++++++------- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java index cba68fb1ff7..46dea68c7b3 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java +++ b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java @@ -2886,8 +2886,25 @@ public List getSelectedNonDownloadableFiles() { public void setSelectedNonDownloadableFiles(List selectedNonDownloadableFiles) { this.selectedNonDownloadableFiles = selectedNonDownloadableFiles; } - - + + public void validateAllFilesForDownloadArchival() { + selectAllFiles(); + boolean guestbookRequired = isDownloadPopupRequired(); + boolean downloadOriginal = false; + validateFilesForDownload(guestbookRequired, downloadOriginal); + } + + /** + * Can result in "requested optional service" error. For non-tabular files + * it's safer to use validateAllFilesForDownloadArchival. + */ + public void validateAllFilesForDownloadOriginal() { + selectAllFiles(); + boolean guestbookRequired = isDownloadPopupRequired(); + boolean downloadOriginal = true; + validateFilesForDownload(guestbookRequired, downloadOriginal); + } + public void validateFilesForDownload(boolean guestbookRequired, boolean downloadOriginal){ setSelectedDownloadableFiles(new ArrayList<>()); setSelectedNonDownloadableFiles(new ArrayList<>()); diff --git a/src/main/webapp/dataset.xhtml b/src/main/webapp/dataset.xhtml index 658b429768e..b4ff7347946 100644 --- a/src/main/webapp/dataset.xhtml +++ b/src/main/webapp/dataset.xhtml @@ -31,11 +31,7 @@ and !permissionsWrapper.canIssuePublishDatasetCommand(DatasetPage.dataset)}"/> - - - @@ -143,17 +139,29 @@