-
Notifications
You must be signed in to change notification settings - Fork 535
Update Dataset License API #11815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Update Dataset License API #11815
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
3d9b283
Stash: updateVersionLicense endpoint WIP
GPortas 817ddaf
Stash: updateVersionLicense endpoint WIP. Endpoint logic implemented,…
GPortas 0be4b8c
Merge branch 'develop' of github.com:IQSS/dataverse into 11771-set-da…
GPortas 1ad96d3
Refactor: removed unused injected services in Datasets.java
GPortas f33028e
Refactor: pending TODO refactor implemented. datasetMetricsService mo…
GPortas ae10cee
Changed: license update implementation with unit tests
GPortas 5f33be4
Refactor: renamed UpdateDatasetVersionLicenseCommand to UpdateDataset…
GPortas e253f22
Changed: renamed bundle string
GPortas 6fbd2d9
Added: handling license updates where custom terms are sent
GPortas 37573ac
Merge branch 'develop' of github.com:IQSS/dataverse into 11771-set-da…
GPortas 45c3e04
Changed: naming and tweaks
GPortas 8342c0a
Added: integration tests, tweaks and improved error handling
GPortas 86510d8
Added: DatasetsIT test case for updating license with insufficient pe…
GPortas 806bbb3
Added: docs for new datasets updateLicense endpoint
GPortas c857a15
Added: release notes for #11771
GPortas 7012604
Merge branch 'develop' of github.com:IQSS/dataverse into 11771-set-da…
GPortas 44f31e9
Merge branch 'develop' of github.com:IQSS/dataverse into 11771-set-da…
GPortas 49945f7
Fixed: missing import statement
GPortas e2ef4a4
Fixed: UpdateDatasetLicenseCommand by not overwriting dataset TermsOf…
GPortas 676f834
Fixed: native api rst format
GPortas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| ## New Endpoint: `/datasets/{id}/license` | ||
|
|
||
| A new endpoint has been implemented to manage dataset licenses. | ||
|
|
||
| ### Functionality | ||
| - Updates the license of a dataset by applying it to the draft version. | ||
| - If no draft exists, a new one is automatically created. | ||
|
|
||
| ### Usage | ||
| This endpoint supports two ways of defining a license: | ||
| 1. **Predefined License** – Provide the license name (e.g., `CC BY 4.0`). | ||
| 2. **Custom Terms of Use and Access** – Provide a JSON body with the `customTerms` object. | ||
| - All fields are optional **except** `termsOfUse`, which is required. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
src/main/java/edu/harvard/iq/dataverse/api/dto/CustomTermsDTO.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| package edu.harvard.iq.dataverse.api.dto; | ||
|
|
||
| import edu.harvard.iq.dataverse.TermsOfUseAndAccess; | ||
|
|
||
| public class CustomTermsDTO { | ||
| private String termsOfUse; | ||
| private String confidentialityDeclaration; | ||
| private String specialPermissions; | ||
| private String restrictions; | ||
| private String citationRequirements; | ||
| private String depositorRequirements; | ||
| private String conditions; | ||
| private String disclaimer; | ||
|
|
||
| public String getTermsOfUse() { | ||
| return termsOfUse; | ||
| } | ||
|
|
||
| public void setTermsOfUse(String termsOfUse) { | ||
| this.termsOfUse = termsOfUse; | ||
| } | ||
|
|
||
| public String getConfidentialityDeclaration() { | ||
| return confidentialityDeclaration; | ||
| } | ||
|
|
||
| public void setConfidentialityDeclaration(String confidentialityDeclaration) { | ||
| this.confidentialityDeclaration = confidentialityDeclaration; | ||
| } | ||
|
|
||
| public String getSpecialPermissions() { | ||
| return specialPermissions; | ||
| } | ||
|
|
||
| public void setSpecialPermissions(String specialPermissions) { | ||
| this.specialPermissions = specialPermissions; | ||
| } | ||
|
|
||
| public String getRestrictions() { | ||
| return restrictions; | ||
| } | ||
|
|
||
| public void setRestrictions(String restrictions) { | ||
| this.restrictions = restrictions; | ||
| } | ||
|
|
||
| public String getCitationRequirements() { | ||
| return citationRequirements; | ||
| } | ||
|
|
||
| public void setCitationRequirements(String citationRequirements) { | ||
| this.citationRequirements = citationRequirements; | ||
| } | ||
|
|
||
| public String getDepositorRequirements() { | ||
| return depositorRequirements; | ||
| } | ||
|
|
||
| public void setDepositorRequirements(String depositorRequirements) { | ||
| this.depositorRequirements = depositorRequirements; | ||
| } | ||
|
|
||
| public String getConditions() { | ||
| return conditions; | ||
| } | ||
|
|
||
| public void setConditions(String conditions) { | ||
| this.conditions = conditions; | ||
| } | ||
|
|
||
| public String getDisclaimer() { | ||
| return disclaimer; | ||
| } | ||
|
|
||
| public void setDisclaimer(String disclaimer) { | ||
| this.disclaimer = disclaimer; | ||
| } | ||
|
|
||
| public TermsOfUseAndAccess toTermsOfUseAndAccess() { | ||
| TermsOfUseAndAccess termsOfUseAndAccess = new TermsOfUseAndAccess(); | ||
| termsOfUseAndAccess.setTermsOfUse(termsOfUse); | ||
| termsOfUseAndAccess.setConfidentialityDeclaration(confidentialityDeclaration); | ||
| termsOfUseAndAccess.setSpecialPermissions(specialPermissions); | ||
| termsOfUseAndAccess.setRestrictions(restrictions); | ||
| termsOfUseAndAccess.setCitationRequirements(citationRequirements); | ||
| termsOfUseAndAccess.setDepositorRequirements(depositorRequirements); | ||
| termsOfUseAndAccess.setConditions(conditions); | ||
| termsOfUseAndAccess.setDisclaimer(disclaimer); | ||
| return termsOfUseAndAccess; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't do anything to preserve whatever has been entered for File Access Requests or Terms of Access so it will fail if the dataset has any restricted files. In the absence of restricted files would we still want to wipe out whatever may have been entered with respect to data file access?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or the other TermsOfUseAndAccess fields (originalArchive, sizeOfCollection, ...).