diff --git a/doc/release-notes/12325-submit-for-review-message.md b/doc/release-notes/12325-submit-for-review-message.md new file mode 100644 index 00000000000..ec922e29437 --- /dev/null +++ b/doc/release-notes/12325-submit-for-review-message.md @@ -0,0 +1,4 @@ +## Feature + +Added Submit for Review dialog disclaimer messages (similar to Publish disclaimer messages). Can be set using setting :PrePublishDatasetDisclaimerText + Also added :DatasetPrePublishPopupCustomText to allow for custom text to be displayed in the dialog similar to the Publish dialog diff --git a/doc/sphinx-guides/source/api/native-api.rst b/doc/sphinx-guides/source/api/native-api.rst index 8fe87ad5e65..da0bce8ad49 100644 --- a/doc/sphinx-guides/source/api/native-api.rst +++ b/doc/sphinx-guides/source/api/native-api.rst @@ -6605,6 +6605,28 @@ The fully expanded example above (without environment variables) looks like this curl "https://demo.dataverse.org/api/info/settings/:DatasetPublishPopupCustomText" +.. _show-custom-popup-for-pre-publishing-datasets: + +Show Custom Popup Text for Pre-Publishing Datasets (Submit for Review) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +For now, only the value for the :ref:`:DatasetPrePublishPopupCustomText` setting from the Configuration section of the Installation Guide is exposed: + +.. note:: See :ref:`show-disclaimer-for-prepublishing-datasets` if you want the user to acknowledge before submitting for review. +.. note:: See :ref:`curl-examples-and-environment-variables` if you are unfamiliar with the use of export below. + +.. code-block:: bash + + export SERVER_URL=https://demo.dataverse.org + + curl "$SERVER_URL/api/info/settings/:DatasetPrePublishPopupCustomText" + +The fully expanded example above (without environment variables) looks like this: + +.. code-block:: bash + + curl "https://demo.dataverse.org/api/info/settings/:DatasetPrePublishPopupCustomText" + .. _show-disclaimer-for-publishing-datasets: Show Disclaimer for Publishing Datasets @@ -6627,6 +6649,27 @@ The fully expanded example above (without environment variables) looks like this curl "https://demo.dataverse.org/api/info/settings/:PublishDatasetDisclaimerText" +.. _show-disclaimer-for-prepublishing-datasets: + +Show Disclaimer for PrePublishing Datasets (Submit for Review) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The setting :ref:`:PrePublishDatasetDisclaimerText`, when set, will prevent a draft dataset from being submitted for review through the UI without the user acknowledging the disclaimer. + +.. note:: See :ref:`curl-examples-and-environment-variables` if you are unfamiliar with the use of export below. + +.. code-block:: bash + + export SERVER_URL=https://demo.dataverse.org + + curl "$SERVER_URL/api/info/settings/:PrePublishDatasetDisclaimerText" + +The fully expanded example above (without environment variables) looks like this: + +.. code-block:: bash + + curl "https://demo.dataverse.org/api/info/settings/:PrePublishDatasetDisclaimerText" + .. _api-get-app-tou: Get Application Terms of Use (General Terms of Use) diff --git a/doc/sphinx-guides/source/installation/config.rst b/doc/sphinx-guides/source/installation/config.rst index e5ed52acb83..9c16243fe92 100644 --- a/doc/sphinx-guides/source/installation/config.rst +++ b/doc/sphinx-guides/source/installation/config.rst @@ -4842,6 +4842,23 @@ Set whether a user will see the custom text when publishing all versions of a da ``curl -X PUT -d true http://localhost:8080/api/admin/settings/:DatasetPublishPopupCustomTextOnAllVersions`` +.. _:DatasetPrePublishPopupCustomText: + +:DatasetPrePublishPopupCustomText ++++++++++++++++++++++++++++++++++ + +Set custom text a user will view when submitting a dataset for review. Note that this text is exposed via the "Info" endpoint of the :doc:`/api/native-api`. + +``curl -X PUT -d "Deposit License Requirements" http://localhost:8080/api/admin/settings/:DatasetPrePublishPopupCustomText`` + +If you have a long text string, you can upload it as a file as in the example below. + +``curl -X PUT --upload-file /tmp/long.txt http://localhost:8080/api/admin/settings/:DatasetPrePublishPopupCustomText`` + +There is a related setting called :ref:`:PrePublishDatasetDisclaimerText` that also makes text appear on the popup when submitting for review, but it requires a checkbox to be clicked. + +See also :ref:`show-custom-popup-for-pre-publishing-datasets` in the API Guide. + :SearchHighlightFragmentSize ++++++++++++++++++++++++++++ @@ -5369,6 +5386,17 @@ There is a similar setting called :ref:`:DatasetPublishPopupCustomText` that als See also :ref:`show-disclaimer-for-publishing-datasets` in the API Guide. +.. _:PrePublishDatasetDisclaimerText: + +:PrePublishDatasetDisclaimerText +++++++++++++++++++++++++++++++++ + +The text displayed to the user that must be acknowledged prior to submitting a Dataset for review. When not set the acknowledgment is not required nor displayed. + +``curl -sS -X PUT -d 'I agree to the following:
1. My submission has been fully anonymized (required for all human subject'\''s datasets).
2. My submission does not violate any known copyright laws.
3. I understand that I am liable for any and all violations of the Harvard Repository Terms of Use.' http://localhost:8080/api/admin/settings/:PrePublishDatasetDisclaimerText`` + +See also :ref:`show-disclaimer-for-prepublishing-datasets` in the API Guide. + .. _:BagItHandlerEnabled: :BagItHandlerEnabled diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java index 3b1c8c4f3c4..56f94bb6281 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java +++ b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java @@ -4870,6 +4870,18 @@ public Boolean isDatasetPublishPopupCustomTextOnAllVersions(){ return settingsWrapper.isTrueForKey(SettingsServiceBean.Key.DatasetPublishPopupCustomTextOnAllVersions, false); } + public boolean isDisplayPrePublishPopupCustomText() { + return !getDatasetPrePublishCustomText().isEmpty(); + } + + public String getDatasetPrePublishCustomText(){ + String datasetPrePublishCustomText = settingsWrapper.getValueForKey(SettingsServiceBean.Key.DatasetPrePublishPopupCustomText); + if (datasetPrePublishCustomText != null && !datasetPrePublishCustomText.isEmpty()) { + return datasetPrePublishCustomText; + } + return ""; + } + public String getVariableMetadataURL(Long fileid) { String myHostURL = getDataverseSiteUrl(); String metaURL = myHostURL + "/api/meta/datafile/" + fileid; @@ -6373,6 +6385,7 @@ public void setFileMetadataForAction(FileMetadata fileMetadataForAction) { private String termsOfAccess; private boolean fileAccessRequest; private boolean publishDisclaimerAcknowledged; + private boolean prePublishDisclaimerAcknowledged; public String getTermsOfAccess() { return termsOfAccess; @@ -6398,6 +6411,14 @@ public void setPublishDisclaimerAcknowledged(boolean publishDisclaimerAcknowledg this.publishDisclaimerAcknowledged = publishDisclaimerAcknowledged; } + public boolean isPrePublishDisclaimerAcknowledged() { + return prePublishDisclaimerAcknowledged || !settingsWrapper.isHasPrePublishDatasetDisclaimerText(); + } + + public void setPrePublishDisclaimerAcknowledged(boolean prePublishDisclaimerAcknowledged) { + this.prePublishDisclaimerAcknowledged = prePublishDisclaimerAcknowledged; + } + // wrapper method to see if the file has been deleted (or replaced) in the current version public boolean isFileDeleted (DataFile dataFile) { if (dataFile.getDeleted() == null) { @@ -7005,4 +7026,4 @@ public void setRequestedCSL(String requestedCSL) { public void validateEmbargoReason(FacesContext context, UIComponent component, Object value) { FileUtil.validateEmbargoReason(context, component, value, removeEmbargo); } -} \ No newline at end of file +} diff --git a/src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java b/src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java index 23db066dc14..feb77274e53 100644 --- a/src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java +++ b/src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java @@ -127,7 +127,9 @@ public class SettingsWrapper implements java.io.Serializable { private String metricsUrl = null; private String publishDatasetDisclaimerText = null; - + + private String prePublishDatasetDisclaimerText = null; + private Boolean dataFilePIDSequentialDependent = null; private Boolean customLicenseAllowed = null; @@ -885,4 +887,15 @@ public String getPublishDatasetDisclaimerText() { public Boolean isHasPublishDatasetDisclaimerText() { return !StringUtil.isEmpty(getPublishDatasetDisclaimerText()); } + + public String getPrePublishDatasetDisclaimerText() { + if (prePublishDatasetDisclaimerText == null) { + prePublishDatasetDisclaimerText = getValueForKey(Key.PrePublishDatasetDisclaimerText); + } + return prePublishDatasetDisclaimerText; + } + + public Boolean isHasPrePublishDatasetDisclaimerText() { + return !StringUtil.isEmpty(getPrePublishDatasetDisclaimerText()); + } } diff --git a/src/main/java/edu/harvard/iq/dataverse/api/Info.java b/src/main/java/edu/harvard/iq/dataverse/api/Info.java index 1aab185e6fb..713f3ce9a1c 100644 --- a/src/main/java/edu/harvard/iq/dataverse/api/Info.java +++ b/src/main/java/edu/harvard/iq/dataverse/api/Info.java @@ -46,12 +46,24 @@ public Response getDatasetPublishPopupCustomText() { return getSettingResponseByKey(SettingsServiceBean.Key.DatasetPublishPopupCustomText); } + @GET + @Path("settings/:DatasetPrePublishPopupCustomText") + public Response DatasetPrePublishPopupCustomText() { + return getSettingResponseByKey(SettingsServiceBean.Key.DatasetPrePublishPopupCustomText); + } + @GET @Path("settings/:PublishDatasetDisclaimerText") public Response getPublishDatasetDisclaimerText() { return getSettingResponseByKey(SettingsServiceBean.Key.PublishDatasetDisclaimerText); } + @GET + @Path("settings/:PrePublishDatasetDisclaimerText") + public Response getPrePublishDatasetDisclaimerText() { + return getSettingResponseByKey(SettingsServiceBean.Key.PrePublishDatasetDisclaimerText); + } + @GET @Path("settings/:MaxEmbargoDurationInMonths") public Response getMaxEmbargoDurationInMonths() { diff --git a/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java index 994f1c00841..9f43eeeeda6 100644 --- a/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java @@ -325,11 +325,19 @@

Size limit (in bytes) for tabular file ingest. Accepts either a single numeri Whether to display the publish text for every published version */ DatasetPublishPopupCustomTextOnAllVersions, + /** + The message added to a popup upon dataset submit for review + */ + DatasetPrePublishPopupCustomText, /* Publish Disclaimer text. If this setting exists user must acknowledge before a Dataset can be published */ PublishDatasetDisclaimerText, /* + Submit for review Disclaimer text. If this setting exists user must acknowledge before a Dataset can be submitted for review + */ + PrePublishDatasetDisclaimerText, + /* Whether Harvesting (OAI) service is enabled */ OAIServerEnabled, diff --git a/src/main/webapp/dataset.xhtml b/src/main/webapp/dataset.xhtml index 1fdd5af2591..ae8cab5cc82 100644 --- a/src/main/webapp/dataset.xhtml +++ b/src/main/webapp/dataset.xhtml @@ -1947,11 +1947,25 @@

#{bundle['dataset.message.incomplete.warning']}

+
+ +
+ +
+ + + +
+
-