Conversation
… pending command impl
…taset-license-api
…ved to AbstractApiBean
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| return ok(BundleUtil.getStringFromBundle("datasets.api.updateLicense.success")); | ||
| } else if (requestBody.getCustomTerms() != null) { | ||
| CustomTermsDTO customTerms = requestBody.getCustomTerms(); | ||
| execCommand(new UpdateDatasetLicenseCommand(req, dataset, customTerms.toTermsOfUseAndAccess())); |
There was a problem hiding this comment.
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.
Or the other TermsOfUseAndAccess fields (originalArchive, sizeOfCollection, ...).
|
@GPortas please take a look at how the setting of custom terms of will delete any entries in custom terms of access. I ended up reworking #11772 so that the api will only modify the terms of access and leave the license or custom terms of use the same as they were prior to the update. A more radical approach would have been to split the terms of use and access tables into two tables but that seemed like too much to take on here. |
This comment has been minimized.
This comment has been minimized.
…UseAndAccess but merging new fields into the existing one
|
@sekmiller Thank you for finding the problem. I have followed a very similar approach to the one you took so we do not overwrite the whole entity, but only the custom terms of use fields. |
This comment has been minimized.
This comment has been minimized.
1 similar comment
|
📦 Pushed preview images as 🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
sekmiller
left a comment
There was a problem hiding this comment.
Looks good. Thanks for the update.
|
tested manually on local docker. Verified in UI and DB |
What this PR does / why we need it:
New Endpoint:
/datasets/{id}/licenseA new endpoint has been implemented to manage dataset licenses.
Functionality
Usage
This endpoint supports two ways of defining a license:
CC BY 4.0).customTermsobject.termsOfUse, which is required.Which issue(s) this PR closes:
Suggestions on how to test this:
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X PUT "https://demo.dataverse.org/api/datasets/<dataset_id>/license" -H "Content-type:application/json" --upload-file <json_file_path>To set a predefined license (e.g., CC BY 4.0), provide a JSON body with the license name:
To define custom terms of use and access, provide a JSON body with the following properties. All fields within
customTermsare optional, except for thetermsOfUsefield, which is required:Does this PR introduce a user interface change? If mockups are available, please link/include them here:
None
Is there a release notes update needed for this change?:
Attached