Issue 1275: replace PIDServiceEPICV2 with EpicHandleService - #1359
Open
kuchtiak-ufal wants to merge 4 commits into
Open
Issue 1275: replace PIDServiceEPICV2 with EpicHandleService#1359kuchtiak-ufal wants to merge 4 commits into
kuchtiak-ufal wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors CLARIN-DSpace’s ePIC PID integration by removing the legacy static PID service wrappers and wiring handle creation/updates through EpicHandleService inside the normal Spring-managed HandleService. It also adds support for pushing extra metadata into ePIC handle records during item install.
Changes:
- Replace the old
PIDService/PIDServiceEPICv2/DSpaceApiflow withEpicHandleServicemethods called directly fromHandleServiceImpl. - Add ePIC handle metadata update support and invoke it during item installation.
- Rework Spring/config wiring for the handle service implementation and add the
EpicHandleFieldenum.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
dspace/config/spring/api/core-services.xml |
Wires HandleServiceImpl to a configurable ePIC handle service bean. |
dspace/config/clarin-dspace.cfg |
Renames PID implementation selection config and updates related comments. |
dspace-api/src/test/java/org/dspace/handle/PIDConfigurationTest.java |
Removes imports and comments out the URL-generation test. |
dspace-api/src/main/java/org/dspace/handle/service/HandleService.java |
Adds updateHandleMetadata() to the handle service API. |
dspace-api/src/main/java/org/dspace/handle/service/EpicHandleService.java |
Expands the ePIC service interface for custom-suffix creation and metadata updates. |
dspace-api/src/main/java/org/dspace/handle/PIDServiceEPICv2.java |
Deletes the legacy EPIC v2 PID service implementation. |
dspace-api/src/main/java/org/dspace/handle/PIDService.java |
Deletes the legacy static PID service facade. |
dspace-api/src/main/java/org/dspace/handle/HandleServiceImpl.java |
Moves PID creation/finalization logic into HandleServiceImpl and adds metadata update support. |
dspace-api/src/main/java/org/dspace/handle/HandlePlugin.java |
Switches extracted handle metadata to typed EpicHandleField keys. |
dspace-api/src/main/java/org/dspace/handle/EpicHandleServiceImpl.java |
Implements new ePIC create/update operations and JSON payload generation with extra metadata. |
dspace-api/src/main/java/org/dspace/handle/EpicHandleRestHelper.java |
Refactors PUT handling and adds helpers for conditional create/update requests. |
dspace-api/src/main/java/org/dspace/handle/EpicHandleField.java |
Introduces enum values for supported ePIC metadata fields. |
dspace-api/src/main/java/org/dspace/handle/AbstractPIDService.java |
Deletes the legacy abstract PID service base class. |
dspace-api/src/main/java/org/dspace/content/InstallItemServiceImpl.java |
Calls handle metadata update after item archival. |
dspace-api/src/main/java/org/dspace/api/DSpaceApi.java |
Deletes the old static DSpace PID utility class. |
Comments suppressed due to low confidence (1)
dspace-api/src/test/java/org/dspace/handle/PIDConfigurationTest.java:140
- This change comments out the only regression test for URL generation, but the replacement
HandleServiceImpl.generateItemURLWithHandle()logic is still live and was moved without equivalent coverage. That leaves trailing-slash and namespace handling untested.
/*
@Test
public void testGeneratingItemURL() {
ConfigurationService configurationService = DSpaceServicesFactory.getInstance().getConfigurationService();
//test with trailing slash
configurationService
.setProperty("dspace.ui.url", "http://localhost:4000/");
String expectedUrl = "http://localhost:4000/handle/" + publicItem.getHandle();
String pid = publicItem.getHandle();
String url = DSpaceApi.generateItemURLWithHandle(pid, publicItem);
Comment on lines
+131
to
+135
| try (Response response = EpicHandleRestHelper.createNewHandleWithSuffix(pidServiceUrl, | ||
| prefix, suffix, jsonData)) { | ||
| if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { | ||
| return objectMapper.readValue(response.readEntity(String.class), EpicPid.class).getHandle(); | ||
| } else { |
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.
No description provided.