Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
Corrected the lookup of the DOI for an update-deposit. For some reaso…
Browse files Browse the repository at this point in the history
…n the dansBagId instead of dansSwordToken was used in DepositMigrationTask.

Now dansSwordToken (read from deposit.properties dataverse.sword-token) is always used. This is the correct behavior.
  • Loading branch information
janvanmansum committed Mar 11, 2024
1 parent 9fff554 commit c977b52
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -493,11 +493,7 @@ public OffsetDateTime getCreatedInstant() {
}

String resolveDoi(Deposit deposit) throws IOException, DataverseException {
return getDoi("dansSwordToken", deposit.getVaultMetadata().getSwordToken());
}

String getDoi(String key, String value) throws IOException, DataverseException {
var items = datasetService.searchDatasets(key, value);
var items = datasetService.searchDatasets("dansSwordToken", deposit.getVaultMetadata().getSwordToken());

if (items.size() != 1) {
throw new FailedDepositException(deposit, String.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,5 @@ void validateDeposit() {
);
}
}

@Override
String resolveDoi(Deposit deposit) throws IOException, DataverseException {
return getDoi("dansBagId", deposit.getIsVersionOf());
}
}

0 comments on commit c977b52

Please sign in to comment.