Repository navigation
VSB-TUO/Replace the retired Creative Commons API with the local CC legal tools CSV - #1645
Merged
Merged
Conversation
(cherry picked from commit 4fe1d4e)
…t use mock (cherry picked from commit 9f305a2)
(cherry picked from commit 3945722)
…ense name when document is null (cherry picked from commit 4024db7)
(cherry picked from commit ffd63aa)
…ues inside of cc.license.classfilter (cherry picked from commit 075cb89)
…e classfilter list, allow excluding licenses based on UNIT column, check CC version, fix issues with array property (cherry picked from commit 49b3155)
…ampling licenses to CSV. Fix CC license remove check to use URI instead of name (cherry picked from commit d5d6d21)
Reverts the upstream commit 3945722 from DSpace#12424, which comments the step out because vanilla DSpace ships it disabled. VSB-TUO enables it on purpose (#1053). This reverts commit 9e854be. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ava 11 Stream.toList() is Java 16+; customer/vsb-tuo builds with release 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the old API, cc.license.jurisdiction commented out (#1059) meant the 'standard' class always resolved to the international 4.0 licence, so VSB submitters could only pick CC 4.0 or CC0. The CSV now lists 3.0 as its own entry, so exclude it to keep the same choice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Items licensed through the retired CC API carry http URIs, and URIs typed into the dc.rights.uri form field often lack the trailing slash. The CSV lookup was an exact match on the https form, so re-accepting such a licence in the submission failed with a 500 (CCLicenseAddPatchOperation). Normalise the scheme and the trailing slash on both sides of the lookup; the stored URI itself is left as it is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The CC licence ITs assert the upstream defaults (CC 3.0 offered, jurisdiction us), which the VSB dspace.cfg changes on purpose. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
An active finding remains because the URI-based license-removal guard lacks integration coverage for existing-license removal, the no-license error case, and the cc.submit.setname=false configuration.
1 open issue
What changed in this PR
This pull request replaces the retired Creative Commons API with a locally bundled CC Legal Tools CSV, preserving license selection while removing runtime API and RDF-license dependencies.
Changes:
- Adds CSV-backed license loading, filtering, jurisdiction handling, URI resolution, and legacy URI normalization.
- Updates Creative Commons services, REST repositories, Spring wiring, and configuration for local license data.
- Stores metadata-only licenses for new submissions while cleaning up legacy
license_rdfbundles. - Removes obsolete API mocks and RDF transformations and updates the remaining integration coverage.
Review findings remain unresolved: localized CSV titles for some 3.0 jurisdiction rows can overwrite dc.rights instead of preserving an English name (moderate, 1 vote). The add/update and remove PATCH flows also lack integration coverage after their tests were deleted (nits, 1 and 3 votes).
| File | Description |
|---|---|
dspace/config/spring/api/core-services.xml |
Registers the CSV license repository bean. |
dspace/config/dspace.cfg |
Configures the local CSV and VSB-specific license filtering. |
dspace/config/cc-license/cc-legal-tools.csv |
Bundles Creative Commons license metadata and canonical URLs. |
dspace-server-webapp/src/test/java/org/dspace/license/MockCCLicenseConnectorServiceImpl.java |
Removes the obsolete API mock. |
dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionCCLicenseUrlRepositoryIT.java |
Updates license URL resolution tests for CSV-backed licenses. |
dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionCCLicenseRestRepositoryIT.java |
Updates REST tests for local license definitions and filtering. |
dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SubmissionCCLicenseMatcher.java |
Updates REST matchers for the new license representation. |
dspace-server-webapp/src/test/java/org/dspace/app/rest/CCLicenseRemovePatchOperationIT.java |
Removes the obsolete remove-PATCH integration tests; replacement coverage is recommended. |
dspace-server-webapp/src/test/java/org/dspace/app/rest/CCLicenseAddPatchOperationIT.java |
Removes the obsolete add-PATCH integration tests; replacement coverage is recommended. |
dspace-server-webapp/src/test/data/dspaceFolder/config/spring/api/core-services-mock.xml |
Removes obsolete mocked connector wiring. |
dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/factory/impl/CCLicenseRemovePatchOperation.java |
Detects licenses by URI and removes legacy license bundles; the removal path lacks integration coverage. |
dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionCCLicenseRestRepository.java |
Uses the default CSV-backed license definitions for REST responses. |
dspace-api/src/test/java/org/dspace/license/MockCCLicenseConnectorServiceImpl.java |
Removes the obsolete API mock. |
dspace-api/src/test/java/org/dspace/license/CCLicenseConnectorServiceImplIT.java |
Adds integration coverage for CSV loading, filtering, jurisdiction, URI resolution, and legacy URI handling. |
dspace-api/src/test/data/dspaceFolder/config/local.cfg |
Sets test-specific Creative Commons filtering and jurisdiction settings. |
dspace-api/src/main/resources/org/dspace/license/LicenseCleanup.xsl |
Removes the obsolete license cleanup transformation. |
dspace-api/src/main/resources/org/dspace/license/CreativeCommons.xsl |
Removes the obsolete Creative Commons RDF transformation. |
dspace-api/src/main/java/org/dspace/license/service/CreativeCommonsService.java |
Removes RDF-related service APIs and updates license addition signatures. |
dspace-api/src/main/java/org/dspace/license/LicenseCleanup.java |
Removes the obsolete RDF cleanup utility. |
dspace-api/src/main/java/org/dspace/license/CreativeCommonsServiceImpl.java |
Stores metadata-only licenses and removes legacy RDF bundles; PATCH add/update coverage is missing. |
dspace-api/src/main/java/org/dspace/license/CCLicenseCSVRow.java |
Defines the in-memory CSV license row model. |
dspace-api/src/main/java/org/dspace/license/CCLicenseCSVRepository.java |
Loads and indexes local CSV license data. |
dspace-api/src/main/java/org/dspace/license/CCLicenseConnectorServiceImpl.java |
Implements local license filtering, URI resolution, and legacy lookup; some 3.0 rows can provide localized names instead of English dc.rights values. |
dspace-api/src/main/java/org/dspace/license/CCLicenseConnectorService.java |
Updates the connector contract for local CSV license data. |
Review effort: Lite
xlukacm
marked this pull request as ready for review
November 5, 2026 06:44
jr-rk
approved these changes
Nov 5, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Problem description
Reported issues
The Creative Commons API (
api.creativecommons.org) was shut down on 2026-11-02, so thecclicensesubmission step on VSB-TUO no longer loads licences, and accepting one fails.Not-reported issues
None.
Analysis
Backport of the upstream fix
DSpace/DSpace#12424(issueDSpace/DSpace#11808), merged intomainon 2026-11-04 at the head cherry-picked here (b12ab4f22d). The licences come from the CC legal tools CSV shipped indspace/config/cc-license/cc-legal-tools.csv(dspace.cc-license.csv), so nothing calls Creative Commons at runtime. The 8 upstream commits are cherry-picked with-x; conflicts were only in unrelateddspace.cfgcontext and in mocks/ITs the PR deletes.VSB-TUO commits on top:
cclicensestep enabled (reverts the upstream commit that comments it out, VSB enables it on purpose in VSB-TUO/Creative Commons license #1053)Collectors.toList()instead ofStream.toList()for Java 11cc.license.classfilter = CC3.0, recombo, mark, certification: with the old API and the jurisdiction commented out (VSB-TUO/Use international license 4.0. instead of czech 3.0. #1059), VSB submitters could only pick CC 4.0 International or CC0; the CSV lists 3.0 separately, so it is hidden to keep the same choicehttp://URIs and thedc.rights.uriform field often has no trailing slash, and the CSV lookup was an exact match onhttps://…/, so re-accepting such a licence returned HTTP 500. The lookup now normalises scheme and trailing slash; the stored URI is not rewrittenlocal.cfgpins the upstream classfilter/jurisdiction the CC ITs assertBehaviour changes for VSB:
cc.license.localeandcc.submit.addbitstreamare gone: question labels come from the UI translations, and nolicense_rdfbitstream is added to new items (existing ones are still exported and removed when the licence changes)https://creativecommons.org/…, existing items keephttp://dc.rights) stay English, as the old API returned themTested: the CC ITs (
CCLicenseConnectorServiceImplIT,SubmissionCCLicenseRestRepositoryIT,SubmissionCCLicenseUrlRepositoryIT, 28 tests), plus a local stack built from this branch and the matching frontend branch: new item, reopen, Czech UI, and an existing item with anhttp://URI.Requires the frontend PR: dataquest-dev/dspace-angular#1714
Problems
dc.rights.uri(e.g. a publisher licence) still gives HTTP 500 when the CC section is re-accepted, as before.CCLicenseAddPatchOperationIT/CCLicenseRemovePatchOperationIT, so the PATCH operations have no IT.🤖 Generated with Claude Code