Skip to content

Issue 1275: replace PIDServiceEPICV2 with EpicHandleService - #1359

Open
kuchtiak-ufal wants to merge 4 commits into
clarin-v7from
issue_#1275_replace_PIDServiceEPICV2_with_EpicHandleService
Open

Issue 1275: replace PIDServiceEPICV2 with EpicHandleService#1359
kuchtiak-ufal wants to merge 4 commits into
clarin-v7from
issue_#1275_replace_PIDServiceEPICV2_with_EpicHandleService

Conversation

@kuchtiak-ufal

Copy link
Copy Markdown

No description provided.

@kuchtiak-ufal kuchtiak-ufal linked an issue May 4, 2026 that may be closed by this pull request
@kuchtiak-ufal kuchtiak-ufal changed the title Issue 1275: replace PIDServiceEPICV2 with EpicHAndleService Issue 1275: replace PIDServiceEPICV2 with EpicHandleService May 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / DSpaceApi flow with EpicHandleService methods called directly from HandleServiceImpl.
  • Add ePIC handle metadata update support and invoke it during item installation.
  • Rework Spring/config wiring for the handle service implementation and add the EpicHandleField enum.

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 {
Comment thread dspace/config/clarin-dspace.cfg Outdated
@kuchtiak-ufal kuchtiak-ufal linked an issue May 5, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code cleanup PIDServiceEPICv2 EpicHandleRestHelper EPIC handle metadata are never updated

2 participants