Repository navigation
Conversation
of DANS-KNAW#251 at 972a501 (irrelevant import changes)
# Conflicts: # src/main/webapp/dataset.xhtml
82d01da to
673074b
Compare
# Conflicts: # src/main/java/edu/harvard/iq/dataverse/DatasetPage.java # src/main/java/edu/harvard/iq/dataverse/search/IndexServiceBean.java # src/main/webapp/guestbook-terms-popup-fragment.xhtml
qqmyers
left a comment
There was a problem hiding this comment.
Phew - a relatively simple goal (to split the tables to allow file licenses) but lots of changed lines! I've requested some changes / asked some questions.
I think most are minor/straight forward with one possible exception - the link between FileMetadata and TermsOfUseOrLicense is a) One-To-One and b) not represented in the TermsOfUseOrLicense class. I'm not sure whether the design is one-to-one (the design doc has a symbol that looks like many to one). If it is, I think the back-link from TermsOfUseOrLIcense (same as for dataset version and template) is needed. If it should be many-to-one that needs to change and a back-link is needed.
The test deletes the dataset’s only custom terms, leaving neither terms nor a license—a state the current validator rejects with HTTP 409. I’ll make the test assert that rejection, then restore CC0 through the semantic API and verify the custom terms are gone. Updated testSemanticMetadataAPIs to expect HTTP 409 when deleting the only terms without a license, then restore CC0 and verify the custom terms disappear. Added regression coverage for that validation rule.
This reverts commit 0f64dad.
The test deletes the dataset’s only custom terms, leaving neither terms nor a license—a state the current validator rejects with HTTP 409. I’ll make the test assert that rejection, then restore CC0 through the semantic API and verify the custom terms are gone. Updated testSemanticMetadataAPIs to expect HTTP 409 when deleting the only terms without a license, then restore CC0 and verify the custom terms disappear. Added regression coverage for that validation rule.
…nticMetadataAPIs" This reverts commit 7782cc6.
# Conflicts: # src/main/resources/db/migration/V6.12.1.1.sql
This reverts commit 289e38f.
# Conflicts: # src/test/java/edu/harvard/iq/dataverse/DatasetVersionTest.java
| return false; | ||
| } | ||
| } else { | ||
| if (StringUtils.isBlank(value.getTermsOfUse())) { |
There was a problem hiding this comment.
From the meeting I understood the tests might also succeed with the following additional check and the validation annotation switched on. That would be better than never validating anything. For the web-ui and when publishing a dataset, we would like to ignore this setting.
On the other hand I assume we still have validation active with DatsetVersion.validate explicitly calling
validator.validate(this.defaultTermsOfUseOrLicense)
| if (StringUtils.isBlank(value.getTermsOfUse())) { | |
| if (StringUtils.isBlank(value.getTermsOfUse()) && ! JvmSettings.API_ALLOW_INCOMPLETE_METADATA.lookupOptional(Boolean.class).orElse(false) )) { |
| public class TermsOfUseAndAccess implements Serializable { | ||
| //TODO fix failing tests in DatasetTypesIT to re-enable @ValidateTermsOfUseOrLicense | ||
| //@ValidateTermsOfUseOrLicense |
# Conflicts: # src/main/webapp/dataset.xhtml # src/test/java/edu/harvard/iq/dataverse/api/SearchIT.java
What this PR does / why we need it:
This PR prepares the Dataverse codebase for file-specific licenses/terms by splitting the legacy model “TermsOfUseAndAccess” into two separate models (“TermsOfUseOrLicense” and “TermsOfAccess”) and updating persistence, API, UI, and tests accordingly.
Changes:
termsofaccessandtermsofuseorlicensetables (Flyway) and updates entity mappings and references.Which issue(s) this PR closes:
Special notes for your reviewer:
Suggestions on how to test this:
See my cheat sheet for DANS VM of v6.10
These tests clearly did not cover code flagged by Codepilot DANS-KNAW-jp@cf45fb2
After v6.10 new commands (UpdateTemplateLicense and UpdateTemplateTermsOfAccess) are introduced using the old TermsOfUseAndAccess. So additionally to the cheat sheet:
Should I still have missed something: null pointer exceptions usually meant an omission in pairs of lines like
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?:
Yes, a DB table is split into two tables and its references needs updates, so:
Additional documentation: