Skip to content

split table terms of use and access - #12659

Open
jo-pol wants to merge 8 commits into
IQSS:developfrom
DANS-KNAW-jp:split-terms-table
Open

split table terms of use and access#12659
jo-pol wants to merge 8 commits into
IQSS:developfrom
DANS-KNAW-jp:split-terms-table

Conversation

@jo-pol

@jo-pol jo-pol commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

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:

  • Introduces new termsofaccess and termsofuseorlicense tables (Flyway) and updates entity mappings and references.
  • Updates API/commands/JSON export-import paths to read/write the new split terms objects.
  • Updates UI (xhtml), exporters, and test fixtures to reflect the new model.
  • Added validation tests to DatasetVersionTest

Which issue(s) this PR closes:

  • 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:

    curl -X PUT "$HOST/api/dataverses/1/licenseTerms" -H "X-Dataverse-key: $API_TOKEN" -H "Content-Type: application/json" -d '{ "name": "CC BY 4.0" }'
    curl -X PUT "$HOST/api/dataverses/1/licenseTerms" -H "X-Dataverse-key: $API_TOKEN" -H "Content-Type: application/json" \
         -d '{ "customTerms": { "termsOfUse": "Your terms of use", "restrictions": "Your restrictions" } }'
    curl -H "X-Dataverse-key:$API_TOKEN" -X PUT "$HOST/api/dataverses/1/access" -H "Content-Type: application/json" \
         -d '{ "customTermsOfAccess": { "fileAccessRequest": true, "termsOfAccess": "Your changed terms of access for restricted files" } }' 
    
  • Should I still have missed something: null pointer exceptions usually meant an omission in pairs of lines like

              termsOfAccess.setXxx(obj);
              obj.setTermsOfAccess(termsOfAccess);
    
              termsOfUseOrLicense.setXxx(obj);
              obj.setTermsOfUseOrLicense(termsOfUseOrLicense);
    

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:

Upgrading requires a maintenance window and downtime. Please plan accordingly, create backups of your database, etc.

Additional documentation:

of DANS-KNAW#251 at 972a501 (irrelevant import changes)
@jo-pol
jo-pol marked this pull request as draft August 31, 2026 09:38
@jo-pol
jo-pol marked this pull request as ready for review September 3, 2026 10:05
# Conflicts:
#	src/main/webapp/dataset.xhtml
@pdurbin pdurbin moved this to Ready for Triage in IQSS Dataverse Project Sep 8, 2026
@pdurbin pdurbin moved this from Ready for Triage to In Review 🔎 in IQSS Dataverse Project Sep 8, 2026
@pdurbin pdurbin added the Size: 20 A percentage of a sprint. 14 hours. label Sep 8, 2026
@cmbz cmbz added FY27 Sprint 5 FY27 Sprint 5 (2026-08-26 - 2026-09-09) FY27 Sprint 6 FY27 Sprint 6 (2026-09-09 - 2026-09-23) labels Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY27 Sprint 5 FY27 Sprint 5 (2026-08-26 - 2026-09-09) FY27 Sprint 6 FY27 Sprint 6 (2026-09-09 - 2026-09-23) Size: 20 A percentage of a sprint. 14 hours.

Projects

Status: In Review 🔎

Development

Successfully merging this pull request may close these issues.

4 participants