Skip to content

Commit

Permalink
Merge pull request #7 from GlobalDataverseCommunityConsortium/Retenti…
Browse files Browse the repository at this point in the history
…onPeriod

minor text changes and removing extra changes in schema.xml
  • Loading branch information
PaulBoon authored Mar 27, 2024
2 parents a760bb2 + 9587c1f commit e29fcfc
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 26 deletions.
21 changes: 10 additions & 11 deletions conf/solr/9.3.0/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@
<field name="publicationStatus" type="string" stored="true" indexed="true" multiValued="true"/>
<field name="externalStatus" type="string" stored="true" indexed="true" multiValued="false"/>
<field name="embargoEndDate" type="plong" stored="true" indexed="true" multiValued="false"/>

<field name="retentionEndDate" type="plong" stored="true" indexed="true" multiValued="false"/>

<field name="subtreePaths" type="string" stored="true" indexed="true" multiValued="true"/>
Expand Down Expand Up @@ -290,12 +289,12 @@
<field name="coverage.Temporal.StopTime" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="dataCollectionSituation" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="dataCollector" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="dataSources" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="datasetContact" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="datasetContactAffiliation" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="datasetContactEmail" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="datasetContactName" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="datasetLevelErrorNotes" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="dataSources" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="dateOfCollection" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="dateOfCollectionEnd" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="dateOfCollectionStart" type="text_en" multiValued="true" stored="true" indexed="true"/>
Expand Down Expand Up @@ -381,13 +380,13 @@
<field name="studyAssayOrganism" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="studyAssayOtherMeasurmentType" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="studyAssayOtherOrganism" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="studyAssayOtherPlatform" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="studyAssayOtherTechnologyType" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="studyAssayPlatform" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="studyAssayOtherPlatform" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="studyAssayTechnologyType" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="studyAssayOtherTechnologyType" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="studyDesignType" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="studyFactorType" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="studyOtherDesignType" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="studyFactorType" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="studyOtherFactorType" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="subject" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="subtitle" type="text_en" multiValued="false" stored="true" indexed="true"/>
Expand All @@ -399,10 +398,10 @@
<field name="timePeriodCoveredEnd" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="timePeriodCoveredStart" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="title" type="text_en" multiValued="false" stored="true" indexed="true"/>
<field name="topicClassification" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="topicClassValue" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="topicClassVocab" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="topicClassVocabURI" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="topicClassification" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="unitOfAnalysis" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="universe" type="text_en" multiValued="true" stored="true" indexed="true"/>
<field name="weighting" type="text_en" multiValued="false" stored="true" indexed="true"/>
Expand Down Expand Up @@ -529,12 +528,12 @@
<copyField source="coverage.Temporal.StopTime" dest="_text_" maxChars="3000"/>
<copyField source="dataCollectionSituation" dest="_text_" maxChars="3000"/>
<copyField source="dataCollector" dest="_text_" maxChars="3000"/>
<copyField source="dataSources" dest="_text_" maxChars="3000"/>
<copyField source="datasetContact" dest="_text_" maxChars="3000"/>
<copyField source="datasetContactAffiliation" dest="_text_" maxChars="3000"/>
<copyField source="datasetContactEmail" dest="_text_" maxChars="3000"/>
<copyField source="datasetContactName" dest="_text_" maxChars="3000"/>
<copyField source="datasetLevelErrorNotes" dest="_text_" maxChars="3000"/>
<copyField source="dataSources" dest="_text_" maxChars="3000"/>
<copyField source="dateOfCollection" dest="_text_" maxChars="3000"/>
<copyField source="dateOfCollectionEnd" dest="_text_" maxChars="3000"/>
<copyField source="dateOfCollectionStart" dest="_text_" maxChars="3000"/>
Expand Down Expand Up @@ -620,13 +619,13 @@
<copyField source="studyAssayOrganism" dest="_text_" maxChars="3000"/>
<copyField source="studyAssayOtherMeasurmentType" dest="_text_" maxChars="3000"/>
<copyField source="studyAssayOtherOrganism" dest="_text_" maxChars="3000"/>
<copyField source="studyAssayOtherPlatform" dest="_text_" maxChars="3000"/>
<copyField source="studyAssayOtherTechnologyType" dest="_text_" maxChars="3000"/>
<copyField source="studyAssayPlatform" dest="_text_" maxChars="3000"/>
<copyField source="studyAssayOtherPlatform" dest="_text_" maxChars="3000"/>
<copyField source="studyAssayTechnologyType" dest="_text_" maxChars="3000"/>
<copyField source="studyAssayOtherTechnologyType" dest="_text_" maxChars="3000"/>
<copyField source="studyDesignType" dest="_text_" maxChars="3000"/>
<copyField source="studyFactorType" dest="_text_" maxChars="3000"/>
<copyField source="studyOtherDesignType" dest="_text_" maxChars="3000"/>
<copyField source="studyFactorType" dest="_text_" maxChars="3000"/>
<copyField source="studyOtherFactorType" dest="_text_" maxChars="3000"/>
<copyField source="subject" dest="_text_" maxChars="3000"/>
<copyField source="subtitle" dest="_text_" maxChars="3000"/>
Expand All @@ -638,10 +637,10 @@
<copyField source="timePeriodCoveredEnd" dest="_text_" maxChars="3000"/>
<copyField source="timePeriodCoveredStart" dest="_text_" maxChars="3000"/>
<copyField source="title" dest="_text_" maxChars="3000"/>
<copyField source="topicClassification" dest="_text_" maxChars="3000"/>
<copyField source="topicClassValue" dest="_text_" maxChars="3000"/>
<copyField source="topicClassVocab" dest="_text_" maxChars="3000"/>
<copyField source="topicClassVocabURI" dest="_text_" maxChars="3000"/>
<copyField source="topicClassification" dest="_text_" maxChars="3000"/>
<copyField source="unitOfAnalysis" dest="_text_" maxChars="3000"/>
<copyField source="universe" dest="_text_" maxChars="3000"/>
<copyField source="weighting" dest="_text_" maxChars="3000"/>
Expand Down
6 changes: 3 additions & 3 deletions doc/sphinx-guides/source/api/native-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2502,12 +2502,12 @@ The API call requires a Json body that includes the list of the fileIds that the
curl -H "X-Dataverse-key: $API_TOKEN" -H "Content-Type:application/json" "$SERVER_URL/api/datasets/:persistentId/files/actions/:unset-embargo?persistentId=$PERSISTENT_IDENTIFIER" -d "$JSON"
Set a Retention period on Files in a Dataset
Set a Retention Period on Files in a Dataset
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``/api/datasets/$dataset-id/files/actions/:set-retention`` can be used to set a retention period on one or more files in a dataset. Retention periods can be set on files that are only in a draft dataset version (and are not in any previously published version) by anyone who can edit the dataset. The same API call can be used by a superuser to add a retention period to files that have already been released as part of a previously published dataset version.

The API call requires a Json body that includes the retention period's end date (dateUnavailable), a short reason (optional), and a list of the fileIds that the retention period should be set on. The dateUnavailable must be after the current date and the duration (dateUnavailable - today's date) must be more than the value specified by the :ref:`:MinRetentionDurationInMonths` setting. All files listed must be in the specified dataset. For example:
The API call requires a Json body that includes the retention period's end date (dateUnavailable), a short reason (optional), and a list of the fileIds that the retention period should be set on. The dateUnavailable must be after the current date and the duration (dateUnavailable - today's date) must be larger than the value specified by the :ref:`:MinRetentionDurationInMonths` setting. All files listed must be in the specified dataset. For example:

.. code-block:: bash
Expand All @@ -2518,7 +2518,7 @@ The API call requires a Json body that includes the retention period's end date
curl -H "X-Dataverse-key: $API_TOKEN" -H "Content-Type:application/json" "$SERVER_URL/api/datasets/:persistentId/files/actions/:set-retention?persistentId=$PERSISTENT_IDENTIFIER" -d "$JSON"
Remove a Retention period on Files in a Dataset
Remove a Retention Period on Files in a Dataset
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``/api/datasets/$dataset-id/files/actions/:unset-retention`` can be used to remove a retention period on one or more files in a dataset. Retention periods can be removed from files that are only in a draft dataset version (and are not in any previously published version) by anyone who can edit the dataset. The same API call can be used by a superuser to remove retention periods from files that have already been released as part of a previously published dataset version.
Expand Down
8 changes: 4 additions & 4 deletions doc/sphinx-guides/source/installation/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4321,11 +4321,11 @@ can enter for an embargo end date. This limit will be enforced in the popup dial
:MinRetentionDurationInMonths
+++++++++++++++++++++++++++++

This setting controls whether retentions are allowed in a Dataverse instance and can limit the minimum duration users are allowed to specify. A value of 0 months or non-existent
setting indicates retentions are not supported. A value of -1 allows retentions of any length. Any other value indicates the minimum number of months (from the current date) a user
can enter for a retention end date. This limit will be enforced in the popup dialog in which users enter the retention date. For example, to set a ten year minimum:
This setting controls whether retention periods are allowed in a Dataverse instance and can limit the minimum duration users are allowed to specify. A value of 0 months or non-existent
setting indicates retention periods are not supported. A value of -1 allows retention periods of any length. Any other value indicates the minimum number of months (from the current date) a user
can enter for a retention period end date. This limit will be enforced in the popup dialog in which users enter the retention period end date. For example, to set a ten year minimum:

``curl -X PUT -d 120 http://localhost:8080/api/admin/settings/:MaxEmbargoDurationInMonths``
``curl -X PUT -d 120 http://localhost:8080/api/admin/settings/:MinRetentionDurationInMonths``


:DataverseMetadataValidatorScript
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/propertyFiles/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ embargo.date.required=An embargo date is required
retention.after=Was retained until
retention.isfrom=Is retained until
retention.willbeafter=Draft: will be retained until
retention.enddateinfo=after this date the file is not available
retention.enddateinfo=after which it will no longer be accessible
retention.date.invalid=Date is outside the allowed range: ({0} to {1})
retention.date.required=A retention end date is required
retention.date.required=A retention period end date is required
cancel=Cancel
ok=OK
saveChanges=Save Changes
Expand Down Expand Up @@ -1860,13 +1860,13 @@ file.retention=Retention Period
file.editRetention=Edit Retention Period
file.editRetention.add=Add or Change
file.editRetention.delete=Remove
file.editRetentionDialog.tip=Edit the planned retention period for the selected file or files. Once this dataset version is published, you will need to contact an administrator to change the retention period date or reason of the file or files. \n After the retention period expires the files become unavailable for download.
file.editRetentionDialog.tip=Edit the planned retention period for the selected file or files. Once this dataset version is published, you will need to contact an administrator to change the retention period end date or reason of the file or files. \n After the retention period expires the files become unavailable for download.
file.editRetentionDialog.some.tip=One or more of the selected files have already been published. Contact an administrator to change the retention period date or reason of the file or files.
file.editRetentionDialog.none.tip=The selected file or files have already been published. Contact an administrator to change the retention period date or reason of the file or files.
file.editRetentionDialog.partial.tip=Any changes you make here will not be made to these files.
file.editRetentionDialog.reason.tip=Enter a short reason why this retention period exists
file.editRetentionDialog.newReason=Add a reason...
file.editRetentionDialog.newDate=Select the retention period end-date
file.editRetentionDialog.newDate=Select the retention period end date
file.editRetentionDialog.remove=Remove existing retention period(s) on selected files

file.setThumbnail=Set Thumbnail
Expand All @@ -1880,7 +1880,7 @@ file.advancedIngestOptions=Advanced Ingest Options
file.assignedDataverseImage.success={0} has been saved as the thumbnail for this dataset.
file.assignedTabFileTags.success=The tags were successfully added for {0}.
file.assignedEmbargo.success=An Embargo was successfully added for {0}.
file.assignedRetention.success=A Retention was successfully added for {0}.
file.assignedRetention.success=A Retention Period was successfully added for {0}.
file.tabularDataTags=Tabular Data Tags
file.tabularDataTags.tip=Select a tag to describe the type(s) of data this is (survey, time series, geospatial, etc).
file.spss-savEncoding=Language Encoding
Expand Down Expand Up @@ -2741,7 +2741,7 @@ access.api.fileAccess.failure.noUser=Could not find user to execute command: {0}
access.api.requestAccess.failure.commandError=Problem trying request access on {0} : {1}
access.api.requestAccess.failure.requestExists=An access request for this file on your behalf already exists.
access.api.requestAccess.failure.invalidRequest=You may not request access to this file. It may already be available to you.
access.api.requestAccess.failure.retentionExpired=You may not request access to this file. It is not available because of a retention.
access.api.requestAccess.failure.retentionExpired=You may not request access to this file. It is not available because its retention period has ended.

access.api.requestAccess.noKey=You must provide a key to request access to a file.
access.api.requestAccess.fileNotFound=Could not find datafile with id {0}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ void testCanNotDownloadFile_forExpiredRetentionFile() {
DataFile dataFile = new DataFile();
dataFile.setId(2L);

// With an embargo, an unrestricted file should only be accessible if the embargo has ended
// With an expired retention end date, an unrestricted file should not be accessible

Retention ret = new Retention(LocalDate.now().minusDays(1), "Retention period expired");
dataFile.setRetention(ret);
Expand All @@ -243,7 +243,7 @@ void testCanDownloadFile_forUnrestrictedReleasedNotExpiredRetentionFile() {
DataFile dataFile = new DataFile();
dataFile.setId(2L);

// With an embargo, an unrestricted file should only be accessible if the embargo has ended
// With a retention end date in the future, an unrestricted file should be accessible

Retention ret = new Retention(LocalDate.now(), "Retention period NOT expired");
dataFile.setRetention(ret);
Expand Down

0 comments on commit e29fcfc

Please sign in to comment.