Skip to content
Open
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
c7f53d4
Add ackowledgment before publishing
stevenwinship Dec 17, 2025
b6383e5
release note
stevenwinship Dec 17, 2025
2bc9ca2
Merge branch 'develop' into 359-enhance-publishing-message-acknowledg…
stevenwinship Dec 18, 2025
f4b3f87
Merge branch 'develop' into 359-enhance-publishing-message-acknowledg…
stevenwinship Dec 18, 2025
84d792a
Merge branch 'develop' into 359-enhance-publishing-message-acknowledg…
stevenwinship Dec 19, 2025
60ffb29
Merge branch 'develop' into 359-enhance-publishing-message-acknowledg…
stevenwinship Dec 23, 2025
2100340
Merge branch 'develop' into 359-enhance-publishing-message-acknowledg…
stevenwinship Jan 5, 2026
2885cc3
add ack to api
stevenwinship Jan 5, 2026
a192c52
Merge branch 'develop' into 359-enhance-publishing-message-acknowledg…
stevenwinship Jan 5, 2026
0ca367d
move json code to json printer
stevenwinship Jan 5, 2026
0c4ee0a
refactor to remove API publish blocking code
stevenwinship Jan 8, 2026
237f389
refactor to remove API publish blocking code
stevenwinship Jan 8, 2026
573e379
refactor to remove API publish blocking code
stevenwinship Jan 8, 2026
dba437e
refactor to remove API publish blocking code
stevenwinship Jan 8, 2026
34c5b17
Merge branch 'develop' into 359-enhance-publishing-message-acknowledg…
stevenwinship Jan 8, 2026
2ea2d06
update doc
stevenwinship Jan 8, 2026
0e53d1e
Merge branch 'develop' into 359-enhance-publishing-message-acknowledg…
stevenwinship Jan 8, 2026
97514b2
Merge branch 'develop' into 359-enhance-publishing-message-acknowledg…
stevenwinship Jan 10, 2026
e4a4074
Merge branch 'develop' into 359-enhance-publishing-message-acknowledg…
stevenwinship Jan 13, 2026
e6aca17
add info API to get disclaimer text
stevenwinship Jan 13, 2026
6a5ee28
fix
stevenwinship Jan 13, 2026
8e13c7b
Merge branch 'develop' into 359-enhance-publishing-message-acknowledg…
stevenwinship Jan 13, 2026
c8fbec4
add cross refference to settings
stevenwinship Jan 16, 2026
ded9a4d
Merge branch 'develop' into 359-enhance-publishing-message-acknowledg…
stevenwinship Jan 16, 2026
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
@@ -0,0 +1,21 @@
## Publishing Enhancement ##

Before a Dataset can be published the user must acknowledge acceptance of the disclaimer if it is required.

The setting "PublishDatasetDisclaimerText", when set, will prevent a draft dataset from being published without the user acknowledging the disclaimer.
The approved disclaimer text is `"By publishing this dataset, I fully accept all legal responsibility for ensuring that the deposited content is: anonymized, free of copyright violations, and contains data that is computationally reusable. I understand and agree that any violation of these conditions may result in the immediate removal of the dataset by the repository without prior notice."`

To enable/disable the acknowledgement requirement an Admin can set/delete the setting using the following APIs:

`curl -X PUT -d "By publishing this dataset, I fully accept all legal responsibility for ensuring that the deposited content is: anonymized, free of copyright violations, and contains data that is computationally reusable. I understand and agree that any violation of these conditions may result in the immediate removal of the dataset by the repository without prior notice." http://localhost:8080/api/admin/settings/:PublishDatasetDisclaimerText`

`curl -X DELETE http://localhost:8080/api/admin/settings/:PublishDatasetDisclaimerText`

The UI will prevent the user from publishing a Dataset unless the disclaimer is acknowledged.

The APIs will continue to publish without the acknowledgement for now. An Info API getter was added for non-superusers to get the disclaimer text.

`curl -X GET http://localhost:8080/api/info/settings/:PublishDatasetDisclaimerText`

See:
- [#359](https://github.com/IQSS/dataverse.harvard.edu/issues/359)
25 changes: 25 additions & 0 deletions doc/sphinx-guides/source/api/native-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6366,11 +6366,14 @@ The fully expanded example above (without environment variables) looks like this

curl "https://demo.dataverse.org/api/info/server"

.. _show-custom-popup-for-publishing-datasets:

Show Custom Popup Text for Publishing Datasets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For now, only the value for the :ref:`:DatasetPublishPopupCustomText` setting from the Configuration section of the Installation Guide is exposed:

.. note:: See :ref:`show-disclaimer-for-publishing-datasets` if you want the user to acknowledge before publishing.
.. note:: See :ref:`curl-examples-and-environment-variables` if you are unfamiliar with the use of export below.

.. code-block:: bash
Expand All @@ -6385,6 +6388,28 @@ The fully expanded example above (without environment variables) looks like this

curl "https://demo.dataverse.org/api/info/settings/:DatasetPublishPopupCustomText"

.. _show-disclaimer-for-publishing-datasets:

Show Disclaimer for Publishing Datasets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The setting "PublishDatasetDisclaimerText", when set, will prevent a draft dataset from being published through the UI without the user acknowledging the disclaimer.

.. note:: See :ref:`show-custom-popup-for-publishing-datasets` if the user acknowledgment is not required but you want the message to be displayed in the UI.
.. 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/:PublishDatasetDisclaimerText"

The fully expanded example above (without environment variables) looks like this:

.. code-block:: bash

curl "https://demo.dataverse.org/api/info/settings/:PublishDatasetDisclaimerText"

.. _api-get-app-tou:

Get Application Terms of Use (General Terms of Use)
Expand Down
9 changes: 9 additions & 0 deletions doc/sphinx-guides/source/installation/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5279,6 +5279,15 @@ This post-publish workflow is useful for actions such as sending notifications a

See :ref:`Workflow Admin section <workflow_admin>` for more details and context.

.. _:PublishDatasetDisclaimerText:

:PublishDatasetDisclaimerText
+++++++++++++++++++++++++++++

The text displayed to the user that must be acknowledged prior to publishing a Dataset. When not set the acknowledgment is not required nor displayed.

``curl -X PUT -d "By publishing this dataset, I fully accept all legal responsibility for ensuring that the deposited content is: anonymized, free of copyright violations, and contains data that is computationally reusable. I understand and agree that any violation of these conditions may result in the immediate removal of the dataset by the repository without prior notice." http://localhost:8080/api/admin/settings/:PublishDatasetDisclaimerText``

.. _:BagItHandlerEnabled:

:BagItHandlerEnabled
Expand Down
12 changes: 9 additions & 3 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package edu.harvard.iq.dataverse;

import edu.harvard.iq.dataverse.authorization.DataverseRole;
import edu.harvard.iq.dataverse.engine.command.DataverseRequest;
import edu.harvard.iq.dataverse.globus.Permissions;
import edu.harvard.iq.dataverse.provenance.ProvPopupFragmentBean;
import edu.harvard.iq.dataverse.api.AbstractApiBean;
import edu.harvard.iq.dataverse.authorization.AuthenticationServiceBean;
Expand Down Expand Up @@ -6251,6 +6248,7 @@ public void setFileMetadataForAction(FileMetadata fileMetadataForAction) {

private String termsOfAccess;
private boolean fileAccessRequest;
private boolean publishDisclaimerAcknowledged;

public String getTermsOfAccess() {
return termsOfAccess;
Expand All @@ -6268,6 +6266,14 @@ public void setFileAccessRequest(boolean fileAccessRequest) {
this.fileAccessRequest = fileAccessRequest;
}

public boolean isPublishDisclaimerAcknowledged() {
return publishDisclaimerAcknowledged || !settingsWrapper.isHasPublishDatasetDisclaimerText();
}

public void setPublishDisclaimerAcknowledged(boolean publishDisclaimerAcknowledged) {
this.publishDisclaimerAcknowledged = publishDisclaimerAcknowledged;
}

// 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) {
Expand Down
17 changes: 15 additions & 2 deletions src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ public class SettingsWrapper implements java.io.Serializable {

private Boolean webloaderUpload = null;

private String metricsUrl = null;
private String metricsUrl = null;

private String publishDatasetDisclaimerText = null;

private Boolean dataFilePIDSequentialDependent = null;

Expand Down Expand Up @@ -872,4 +874,15 @@ public List<MetadataBlock> getSystemMetadataBlocks() {

return systemMetadataBlocks;
}
}

public String getPublishDatasetDisclaimerText() {
if (publishDatasetDisclaimerText == null) {
publishDatasetDisclaimerText = getValueForKey(Key.PublishDatasetDisclaimerText);
}
return publishDatasetDisclaimerText;
}

public Boolean isHasPublishDatasetDisclaimerText() {
return !StringUtil.isEmpty(getPublishDatasetDisclaimerText());
}
}
6 changes: 6 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/api/Info.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public Response getDatasetPublishPopupCustomText() {
return getSettingResponseByKey(SettingsServiceBean.Key.DatasetPublishPopupCustomText);
}

@GET
@Path("settings/:PublishDatasetDisclaimerText")
public Response getPublishDatasetDisclaimerText() {
return getSettingResponseByKey(SettingsServiceBean.Key.PublishDatasetDisclaimerText);
}

@GET
@Path("settings/:MaxEmbargoDurationInMonths")
public Response getMaxEmbargoDurationInMonths() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@ <p>Size limit (in bytes) for tabular file ingest. Accepts either a single numeri
*/
DatasetPublishPopupCustomTextOnAllVersions,
/*
Publish Disclaimer text. If this setting exists user must acknowledge before a Dataset can be published
*/
PublishDatasetDisclaimerText,
/*
Whether Harvesting (OAI) service is enabled
*/
OAIServerEnabled,
Expand Down
18 changes: 14 additions & 4 deletions src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -2029,8 +2029,18 @@
<p class="col-sm-12 help-block">#{bundle['dataset.publish.terms.help.tip']}</p>
</div>
</ui:fragment>
<ui:fragment rendered="#{valid and settingsWrapper.isHasPublishDatasetDisclaimerText()}">
<div class="form-group">
<p:selectBooleanCheckbox class="text-danger" id="publishDisclaimer"
itemLabel="#{settingsWrapper.getPublishDatasetDisclaimerText()}"
value="#{DatasetPage.publishDisclaimerAcknowledged}">
<p:ajax event="change" update="releaseDatasetButton"/>
</p:selectBooleanCheckbox>
</div>
</ui:fragment>
<div class="button-block">
<p:commandButton rendered="#{valid}" styleClass="btn btn-default" value="#{bundle.continue}"
<p:commandButton id="releaseDatasetButton" rendered="#{valid}" styleClass="btn btn-default" value="#{bundle.continue}"
disabled="#{!DatasetPage.publishDisclaimerAcknowledged}"
onclick="PF('publishDataset').hide();
PF('blockDatasetForm').hide();" action="#{DatasetPage.releaseDataset}" />
<button class="btn btn-link" onclick="PF('publishDataset').hide();
Expand Down Expand Up @@ -2085,7 +2095,7 @@
<p class="text-warning">
<span class="glyphicon glyphicon-warning-sign"/> #{bundle['dataset.rejectMessage']} #{disableReasonField ? '':bundle['dataset.rejectMessageReason']}
</p>

<ui:fragment rendered="#{!disableReasonField}">
<p:inputTextarea id="returnReason" rows="4" value="#{DatasetPage.returnReason}" title="#{bundle['dataset.rejectMessage.label']}" maxlength="2000" widgetVar="returnReason"
cols="70" counter="display" counterTemplate="{0} characters remaining." autoResize="false"
Expand All @@ -2097,7 +2107,7 @@
<p:watermark for="returnReason" value="#{bundle['dataset.rejectWatermark']}" id="returnReasonWatermark"/>
<h:message for="returnReason" styleClass="bg-danger text-danger"/>
</ui:fragment>

<div class="button-block">
<p:commandButton styleClass="btn btn-default" value="#{bundle.continue}"
update="@form"
Expand Down Expand Up @@ -2182,7 +2192,7 @@
<script>
Cite.CSL.register.addTemplate("#{requestedCSL}",
"#{CSLUtil:getCitationFormat((requestedCSL == '') ? 'apa' : requestedCSL)}");

document.getElementById('datasetForm:cslOutput').innerHTML = cite.format("bibliography", {
format: "html",
template: "#{requestedCSL}",
Expand Down
6 changes: 6 additions & 0 deletions src/test/java/edu/harvard/iq/dataverse/api/InfoIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,24 @@ public static void setUpClass() {
UtilIT.deleteSetting(SettingsServiceBean.Key.DatasetPublishPopupCustomText);
UtilIT.deleteSetting(SettingsServiceBean.Key.ApplicationTermsOfUse);
UtilIT.deleteSetting(SettingsServiceBean.Key.ApplicationTermsOfUse, "fr");
UtilIT.deleteSetting(SettingsServiceBean.Key.PublishDatasetDisclaimerText);
}

@AfterAll
public static void afterClass() {
UtilIT.deleteSetting(SettingsServiceBean.Key.MaxEmbargoDurationInMonths);
UtilIT.deleteSetting(SettingsServiceBean.Key.DatasetPublishPopupCustomText);
UtilIT.deleteSetting(SettingsServiceBean.Key.PublishDatasetDisclaimerText);
}

@Test
public void testGetDatasetPublishPopupCustomText() {
testSettingEndpoint(SettingsServiceBean.Key.DatasetPublishPopupCustomText, "Hello world!");
}
@Test
public void testGetDatasetPublishDisclaimerText() {
testSettingEndpoint(SettingsServiceBean.Key.PublishDatasetDisclaimerText, "Hello world!");
}

@Test
public void testGetMaxEmbargoDurationInMonths() {
Expand Down