From c5208e51ae1739f11fa6210ed91d1f629063c63b Mon Sep 17 00:00:00 2001
From: Stephen Kraffmiller
Date: Fri, 15 Apr 2022 14:39:02 -0400
Subject: [PATCH 1/7] #7565 cleanup additional pages
---
src/main/webapp/dataset-license-terms.xhtml | 8 ++--
src/main/webapp/dataverse.xhtml | 18 +++------
src/main/webapp/dataverseuser.xhtml | 9 ++---
src/main/webapp/editFilesFragment.xhtml | 41 ++++++++++-----------
4 files changed, 34 insertions(+), 42 deletions(-)
diff --git a/src/main/webapp/dataset-license-terms.xhtml b/src/main/webapp/dataset-license-terms.xhtml
index 0874f6939d9..7430efff63c 100644
--- a/src/main/webapp/dataset-license-terms.xhtml
+++ b/src/main/webapp/dataset-license-terms.xhtml
@@ -11,7 +11,7 @@
jsf:rendered="#{dataverseSession.user.authenticated and empty editMode and !widgetWrapper.widgetView
and permissionsWrapper.canIssueUpdateDatasetCommand(DatasetPage.dataset)}">
+ update="@form,:messagePanel" disabled="#{DatasetPage.lockedFromEdits}">
#{bundle['file.dataFilesTab.terms.editTermsBtn']}
@@ -50,7 +50,7 @@
-
+
@@ -491,7 +491,7 @@
+ update=":datasetForm" oncomplete="PF('viewGuestbook').show();"/>
@@ -530,7 +530,7 @@
+ update=":datasetForm" oncomplete="PF('viewGuestbook').show();"/>
diff --git a/src/main/webapp/dataverse.xhtml b/src/main/webapp/dataverse.xhtml
index e7bfb49cd96..572bcf40300 100644
--- a/src/main/webapp/dataverse.xhtml
+++ b/src/main/webapp/dataverse.xhtml
@@ -97,8 +97,7 @@
style="display:none"
process="@this :dataverseForm:selectHostDataverse"
update=":dataverseForm,:breadCrumbPanel"
- action="#{DataversePage.updateOwnerDataverse()}"
- oncomplete="bind_bsui_components();">
+ action="#{DataversePage.updateOwnerDataverse()}">
@@ -221,15 +220,13 @@
+ action="#{DataverseUserPage.remove(item.id)}" update="@form">
@@ -394,13 +393,13 @@
+ actionListener="#{DataverseUserPage.edit}" update="@form">
+ actionListener="#{DataverseUserPage.changePassword}" update="@form">
diff --git a/src/main/webapp/editFilesFragment.xhtml b/src/main/webapp/editFilesFragment.xhtml
index 883949d0441..3d694e996ee 100644
--- a/src/main/webapp/editFilesFragment.xhtml
+++ b/src/main/webapp/editFilesFragment.xhtml
@@ -148,7 +148,7 @@
process="filesTable"
update=":datasetForm:filesTable, @([id$=filesButtons])"
label="#{bundle['file.selectToAddBtn']}"
- oncomplete="javascript:bind_bsui_components();uploadFinished(PF('fileUploadWidget'));"
+ oncomplete="uploadFinished(PF('fileUploadWidget'));"
onstart="javascript:uploadWidgetDropRemoveMsg();uploadStarted();"
onerror="javascript:uploadFailure();"
sizeLimit="#{EditDatafilesPage.getMaxFileUploadSizeInBytes()}"
@@ -298,9 +298,9 @@
-
+
-
+
-
+
@@ -603,9 +603,9 @@
#{bundle['file.deleteFileDialog.failed.tip']}
@@ -643,8 +643,7 @@
+ update="filesTable,:messagePanel"/>
#{bundle.cancel}
@@ -828,8 +827,8 @@
@@ -849,8 +848,8 @@
@@ -860,8 +859,8 @@
@@ -947,8 +946,8 @@
-->
-
-
+
+
From 9d06b451a5c325c8903010ff733393f3f9cd49c8 Mon Sep 17 00:00:00 2001
From: Stephen Kraffmiller
Date: Fri, 15 Apr 2022 15:29:29 -0400
Subject: [PATCH 2/7] #7565 more cleanup
---
src/main/webapp/editdatafiles.xhtml | 4 ++--
src/main/webapp/file-edit-button-fragment.xhtml | 4 ++--
src/main/webapp/file.xhtml | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/main/webapp/editdatafiles.xhtml b/src/main/webapp/editdatafiles.xhtml
index aa4eb5f228c..4be14f2c682 100644
--- a/src/main/webapp/editdatafiles.xhtml
+++ b/src/main/webapp/editdatafiles.xhtml
@@ -75,9 +75,9 @@
-
+
#{bundle.done}
diff --git a/src/main/webapp/file-edit-button-fragment.xhtml b/src/main/webapp/file-edit-button-fragment.xhtml
index fd7d116e63d..4975bc22636 100644
--- a/src/main/webapp/file-edit-button-fragment.xhtml
+++ b/src/main/webapp/file-edit-button-fragment.xhtml
@@ -49,7 +49,7 @@
+ oncomplete="PF('accessPopup').show();">
@@ -110,7 +110,7 @@
+ oncomplete="PF('editProvenancePopup').show();">
#{bundle['file.provenance']}
diff --git a/src/main/webapp/file.xhtml b/src/main/webapp/file.xhtml
index f5232623822..106e6b2387c 100644
--- a/src/main/webapp/file.xhtml
+++ b/src/main/webapp/file.xhtml
@@ -327,7 +327,7 @@
-
+
From 81e92b99b1e2a8f0c6644a698567cc1fbb8bdf78 Mon Sep 17 00:00:00 2001
From: Stephen Kraffmiller
Date: Wed, 20 Apr 2022 10:38:37 -0400
Subject: [PATCH 3/7] #7565 more pages
---
src/main/webapp/filesFragment.xhtml | 20 ++++++++++----------
src/main/webapp/guestbook.xhtml | 8 ++++----
src/main/webapp/harvestclients.xhtml | 24 ++++++++++++------------
src/main/webapp/harvestsets.xhtml | 16 ++++++++--------
src/main/webapp/manage-groups.xhtml | 4 ++--
5 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/src/main/webapp/filesFragment.xhtml b/src/main/webapp/filesFragment.xhtml
index 9dcd1fa2064..deba02f4815 100644
--- a/src/main/webapp/filesFragment.xhtml
+++ b/src/main/webapp/filesFragment.xhtml
@@ -32,13 +32,13 @@
-
+
-
+
@@ -105,10 +105,10 @@
-
+
-
+
@@ -324,14 +324,14 @@
-
+
-
+
@@ -412,7 +412,7 @@
disabled="#{false and DatasetPage.lockedFromDownload}"
onclick="if (!testFilesSelected()) return false;"
action="#{DatasetPage.startDownloadSelectedOriginal()}"
- update="@form" oncomplete="bind_bsui_components();showPopup();">
+ update="@form" oncomplete="showPopup();">
#{bundle.download}
@@ -428,7 +428,7 @@
@@ -438,7 +438,7 @@
@@ -451,7 +451,7 @@
#{bundle['file.requestAccess']}
diff --git a/src/main/webapp/guestbook.xhtml b/src/main/webapp/guestbook.xhtml
index 76af9e02ab4..3528ff5f032 100644
--- a/src/main/webapp/guestbook.xhtml
+++ b/src/main/webapp/guestbook.xhtml
@@ -153,13 +153,13 @@
-
+
-
+
@@ -176,13 +176,13 @@
-
+
-
+
diff --git a/src/main/webapp/harvestclients.xhtml b/src/main/webapp/harvestclients.xhtml
index 4ff5dbbdbf1..5c7b3482ed3 100644
--- a/src/main/webapp/harvestclients.xhtml
+++ b/src/main/webapp/harvestclients.xhtml
@@ -31,7 +31,7 @@
+ oncomplete="PF('newHarvestingClientForm').show();handleResizeDialog('newHarvestingClientDialog');">
#{bundle['harvestclients.btn.add']}
@@ -88,7 +88,7 @@
+ oncomplete="PF('newHarvestingClientForm').show();handleResizeDialog('newHarvestingClientDialog');">
#{bundle['harvestclients.btn.add']}
@@ -125,7 +125,7 @@
@@ -133,7 +133,7 @@
@@ -283,7 +283,7 @@
#{bundle.next}
@@ -365,14 +365,14 @@
#{bundle.previous}
#{bundle.next}
@@ -459,14 +459,14 @@
#{bundle.previous}
#{bundle.next}
@@ -535,7 +535,7 @@
#{bundle.previous}
@@ -545,7 +545,7 @@
value="#{bundle['harvestclients.newClientDialog.btn.create']}"
update="newHarvestingClientDialogContent :messagePanel :harvestingClientsForm clientsTable emptyClientsTable"
actionListener="#{harvestingClientsPage.createClient}"
- oncomplete="if (args && !args.validationFailed) PF('newHarvestingClientForm').hide(); else PF('newHarvestingClientForm').show();bind_bsui_components();">
+ oncomplete="if (args && !args.validationFailed) PF('newHarvestingClientForm').hide(); else PF('newHarvestingClientForm').show();">
+ oncomplete="if (args && !args.validationFailed) PF('newHarvestingClientForm').hide(); else PF('newHarvestingClientForm').show();">
diff --git a/src/main/webapp/harvestsets.xhtml b/src/main/webapp/harvestsets.xhtml
index 908512f6b63..2ddcac76575 100644
--- a/src/main/webapp/harvestsets.xhtml
+++ b/src/main/webapp/harvestsets.xhtml
@@ -57,7 +57,7 @@
+ oncomplete="PF('newOAISetForm').show();handleResizeDialog('newOAISetDialog');">
#{bundle['harvestserver.btn.add']}
@@ -111,7 +111,7 @@
+ oncomplete="PF('newOAISetForm').show();handleResizeDialog('newOAISetDialog');">
#{bundle['harvestserver.btn.add']}
@@ -157,7 +157,7 @@
@@ -165,7 +165,7 @@
@@ -244,7 +244,7 @@
@@ -120,7 +118,7 @@
+ oncomplete="PF('viewRemoveWidget').show();">
@@ -203,7 +201,7 @@
#{bundle['dataverse.permissionsFiles.files.assignBtn']}
+ oncomplete="PF('assignWidget').show();handleResizeDialog('assignDialog');"> #{bundle['dataverse.permissionsFiles.files.assignBtn']}
diff --git a/src/main/webapp/permissions-manage.xhtml b/src/main/webapp/permissions-manage.xhtml
index c0a7508be04..b328e4abc81 100644
--- a/src/main/webapp/permissions-manage.xhtml
+++ b/src/main/webapp/permissions-manage.xhtml
@@ -105,7 +105,7 @@
+ oncomplete="PF('userGroupsForm').show();handleResizeDialog('userGroupDialog');">
#{bundle['dataverse.permissions.usersOrGroups.assignBtn']}
@@ -163,7 +163,7 @@
rendered="#{managePermissionsPage.dvObject.instanceofDataverse and permissionsWrapper.canManagePermissions(managePermissionsPage.dvObject)
and dataverseSession.user.superuser}"
actionListener="#{managePermissionsPage.createNewRole}"
- oncomplete="PF('roleForm').show();handleResizeDialog('rolesPermissionsDialog');bind_bsui_components();"
+ oncomplete="PF('roleForm').show();handleResizeDialog('rolesPermissionsDialog');"
update=":#{p:resolveClientId('rolesPermissionsForm:editRolePanel', view)}">
#{bundle['dataverse.permissions.roles.add']}
diff --git a/src/main/webapp/provenance-popups-fragment.xhtml b/src/main/webapp/provenance-popups-fragment.xhtml
index adf5076d13a..da644d60f6a 100644
--- a/src/main/webapp/provenance-popups-fragment.xhtml
+++ b/src/main/webapp/provenance-popups-fragment.xhtml
@@ -51,7 +51,6 @@
label="#{bundle['file.editProvenanceDialog.selectToAddBtn']}"
onstart="javascript:uploadStarted();"
onerror="javascript:uploadFailure();"
- oncomplete="bind_bsui_components();"
fileLimit="1"
invalidSizeMessage="#{bundle['file.edit.error.file_exceeds_limit']}"/>
@@ -167,8 +166,11 @@
-
-
+
+
#{bundle.cancel}
diff --git a/src/main/webapp/themeAndWidgetsFragment.xhtml b/src/main/webapp/themeAndWidgetsFragment.xhtml
index eddf2dbb892..b87f8af3637 100644
--- a/src/main/webapp/themeAndWidgetsFragment.xhtml
+++ b/src/main/webapp/themeAndWidgetsFragment.xhtml
@@ -25,7 +25,7 @@
-
+
@@ -48,13 +48,13 @@
-
+
-
-
@@ -68,7 +68,7 @@
-
+
@@ -194,13 +194,13 @@
-
+
-
-
@@ -237,7 +237,7 @@
From a2796c9fd0bb1b19ef1c247f4d1c455f7af49f42 Mon Sep 17 00:00:00 2001
From: Stephen Kraffmiller
Date: Wed, 20 Apr 2022 12:53:37 -0400
Subject: [PATCH 5/7] #7565 cleanup merge
---
src/main/webapp/dataset-license-terms.xhtml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/webapp/dataset-license-terms.xhtml b/src/main/webapp/dataset-license-terms.xhtml
index 99db5ba7cff..afacdb2539a 100644
--- a/src/main/webapp/dataset-license-terms.xhtml
+++ b/src/main/webapp/dataset-license-terms.xhtml
@@ -11,7 +11,7 @@
jsf:rendered="#{dataverseSession.user.authenticated and empty editMode and !widgetWrapper.widgetView
and permissionsWrapper.canIssueUpdateDatasetCommand(DatasetPage.dataset)}">
+ update="@form,:messagePanel" disabled="#{DatasetPage.lockedFromEdits}">
#{bundle['file.dataFilesTab.terms.editTermsBtn']}
From 4a4e66e70bc683e4120d032bc6377659a57b7a0b Mon Sep 17 00:00:00 2001
From: Stephen Kraffmiller
Date: Thu, 21 Apr 2022 15:14:59 -0400
Subject: [PATCH 6/7] #7565 fix create/edit templates
---
.../edu/harvard/iq/dataverse/TemplatePage.java | 1 +
.../iq/dataverse/TermsOfUseAndAccessValidator.java | 8 +++++++-
src/main/webapp/dataset-license-terms.xhtml | 14 +++++++-------
3 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/src/main/java/edu/harvard/iq/dataverse/TemplatePage.java b/src/main/java/edu/harvard/iq/dataverse/TemplatePage.java
index b04136bb5a1..331ecbf24f8 100644
--- a/src/main/java/edu/harvard/iq/dataverse/TemplatePage.java
+++ b/src/main/java/edu/harvard/iq/dataverse/TemplatePage.java
@@ -129,6 +129,7 @@ public String init() {
if (template.getTermsOfUseAndAccess() != null) {
TermsOfUseAndAccess terms = template.getTermsOfUseAndAccess().copyTermsOfUseAndAccess();
+ terms.setTemplate(template);
template.setTermsOfUseAndAccess(terms);
}
diff --git a/src/main/java/edu/harvard/iq/dataverse/TermsOfUseAndAccessValidator.java b/src/main/java/edu/harvard/iq/dataverse/TermsOfUseAndAccessValidator.java
index ee094d772e2..3ae1533f263 100644
--- a/src/main/java/edu/harvard/iq/dataverse/TermsOfUseAndAccessValidator.java
+++ b/src/main/java/edu/harvard/iq/dataverse/TermsOfUseAndAccessValidator.java
@@ -28,7 +28,13 @@ public boolean isValid(TermsOfUseAndAccess value, ConstraintValidatorContext con
}
public static boolean isTOUAValid(TermsOfUseAndAccess value, ConstraintValidatorContext context){
- //If there are no restricted files then terms are valid
+
+ //if part of a template it is valid
+ if (value.getTemplate() != null){
+ return true;
+ }
+
+ //If there are no restricted files then terms are valid
if (!value.getDatasetVersion().isHasRestrictedFile()) {
return true;
}
diff --git a/src/main/webapp/dataset-license-terms.xhtml b/src/main/webapp/dataset-license-terms.xhtml
index afacdb2539a..9d381f54dd5 100644
--- a/src/main/webapp/dataset-license-terms.xhtml
+++ b/src/main/webapp/dataset-license-terms.xhtml
@@ -296,7 +296,7 @@
-
From 512c8d91a37507f1fccc16d815ab5d7c999712e4 Mon Sep 17 00:00:00 2001
From: Stephen Kraffmiller
Date: Thu, 21 Apr 2022 16:02:29 -0400
Subject: [PATCH 7/7] #7565 fix messang/bundle
---
src/main/java/edu/harvard/iq/dataverse/DatasetVersion.java | 2 +-
.../harvard/iq/dataverse/TermsOfUseAndAccessValidator.java | 4 ++--
src/main/java/propertyFiles/Bundle.properties | 1 +
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetVersion.java b/src/main/java/edu/harvard/iq/dataverse/DatasetVersion.java
index 73b4723de53..faa91b87e12 100644
--- a/src/main/java/edu/harvard/iq/dataverse/DatasetVersion.java
+++ b/src/main/java/edu/harvard/iq/dataverse/DatasetVersion.java
@@ -1686,7 +1686,7 @@ public Set validate() {
Set> constraintViolations = validator.validate(toua);
if (constraintViolations.size() > 0) {
ConstraintViolation violation = constraintViolations.iterator().next();
- String message = BundleUtil.getStringFromBundle("toua.invalid");
+ String message = BundleUtil.getStringFromBundle("dataset.message.toua.invalid");
logger.info(message);
this.termsOfUseAndAccess.setValidationMessage(message);
returnSet.add(violation);
diff --git a/src/main/java/edu/harvard/iq/dataverse/TermsOfUseAndAccessValidator.java b/src/main/java/edu/harvard/iq/dataverse/TermsOfUseAndAccessValidator.java
index 3ae1533f263..2cf78db0f03 100644
--- a/src/main/java/edu/harvard/iq/dataverse/TermsOfUseAndAccessValidator.java
+++ b/src/main/java/edu/harvard/iq/dataverse/TermsOfUseAndAccessValidator.java
@@ -45,10 +45,10 @@ public static boolean isTOUAValid(TermsOfUseAndAccess value, ConstraintValidator
if (!valid) {
try {
if (context != null) {
- context.buildConstraintViolationWithTemplate(BundleUtil.getStringFromBundle("toua.invalid")).addConstraintViolation();
+ context.buildConstraintViolationWithTemplate(BundleUtil.getStringFromBundle("dataset.message.toua.invalid")).addConstraintViolation();
}
- value.setValidationMessage(BundleUtil.getStringFromBundle("toua.invalid"));
+ value.setValidationMessage(BundleUtil.getStringFromBundle("dataset.message.toua.invalid"));
} catch (NullPointerException e) {
return false;
}
diff --git a/src/main/java/propertyFiles/Bundle.properties b/src/main/java/propertyFiles/Bundle.properties
index 31a58ae65b1..89f3760909b 100644
--- a/src/main/java/propertyFiles/Bundle.properties
+++ b/src/main/java/propertyFiles/Bundle.properties
@@ -1475,6 +1475,7 @@ dataset.message.editMetadata.label=Edit Dataset Metadata
dataset.message.editMetadata.message=Add more metadata about this dataset to help others easily find it.
dataset.message.editMetadata.duplicateFilenames=Duplicate filenames: {0}
dataset.message.editMetadata.invalid.TOUA.message=Datasets with restricted files are required to have Request Access enabled or Terms of Access to help people access the data. Please edit the dataset to confirm Request Access or provide Terms of Access to be in compliance with the policy.
+dataset.message.toua.invalid=You must enable request access or add terms of access in datasets with restricted files.
dataset.message.editTerms.label=Edit Dataset Terms
dataset.message.editTerms.message=Add the terms of use for this dataset to explain how to access and use your data.