-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closes #2519: Changing the status of dataset DOI from findable to reg… #2525
Closes #2519: Changing the status of dataset DOI from findable to reg… #2525
Conversation
@@ -87,18 +87,18 @@ public String reserveIdentifier(String identifier, Map<String, String> metadata, | |||
|
|||
public void registerIdentifier(String identifier, Map<String, String> metadata, DvObject dvObject) throws IOException { | |||
String xmlMetadata = getMetadataFromDvObject(identifier, metadata, dvObject); | |||
DOIDataCiteRegisterCache rc = findByDOI(identifier); | |||
DOIDataCiteRegisterCache rc = Optional.ofNullable(findByDOI(identifier)) | |||
.orElseGet(DOIDataCiteRegisterCache::new); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Files get registered directly on publication (whereas for datasets we reserve the DOI on create). And a cache entry was only been created in the reservation method. As a result DOI for files would never get unregistered because of the missing entry in the cache table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this DOIDataCiteRegisterCache
is even needed (for both datasets and files). Maybe I am missing something in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT it's mainly to keep track of the DOI status. And modifyIdentifier
/ deleteIdentifier
depend on it to perform the correct API calls. Agree, it's not particularly obvious. Maybe we can add a follow-up issue for the rafactoring?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we can add a follow-up issue for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue created: #2553
@@ -121,6 +121,7 @@ public String getMetadataForDeactivateId(String identifier) { | |||
resource.setTitles(Collections.singletonList("This item has been removed from publication")); | |||
resource.setPublisher(":unav"); | |||
resource.setPublicationYear("9999"); | |||
resource.setCreators(Collections.singletonList(new DataCiteResource.Creator(":unav"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The creators
field is now mandatory.
...main/java/edu/harvard/iq/dataverse/engine/command/impl/DeaccessionDatasetVersionCommand.java
Outdated
Show resolved
Hide resolved
@@ -87,18 +87,18 @@ public String reserveIdentifier(String identifier, Map<String, String> metadata, | |||
|
|||
public void registerIdentifier(String identifier, Map<String, String> metadata, DvObject dvObject) throws IOException { | |||
String xmlMetadata = getMetadataFromDvObject(identifier, metadata, dvObject); | |||
DOIDataCiteRegisterCache rc = findByDOI(identifier); | |||
DOIDataCiteRegisterCache rc = Optional.ofNullable(findByDOI(identifier)) | |||
.orElseGet(DOIDataCiteRegisterCache::new); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this DOIDataCiteRegisterCache
is even needed (for both datasets and files). Maybe I am missing something in the code.
Changing the status of dataset DOI from
findable
toregistered
when deaccessing it.Issue: #2519