Skip to content
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

2471 destroy command should unregister doi #6060

Merged
merged 4 commits into from
Aug 5, 2019

Conversation

sekmiller
Copy link
Contributor

@sekmiller sekmiller commented Jul 26, 2019

New Contributors

Welcome! New contributors should at least glance at CONTRIBUTING.md, especially the section on pull requests where we encourage you to reach out to other developers before you start coding. Also, please note that we measure code coverage and prefer you write unit tests. Pull requests can still be reviewed without tests or completion of the checklist outlined below. Thanks!

Related Issues

Pull Request Checklist

  • Unit [tests][x] none
  • Integration tests: None
  • Deployment requirements, None
  • Documentation None
  • Merged latest from "develop" [branch][x] and resolved conflicts

@coveralls
Copy link

coveralls commented Jul 26, 2019

Coverage Status

Coverage decreased (-0.004%) to 19.497% when pulling 4cd5863 on 2471-destroy-command-should-unregister-doi into dffb5f6 on develop.

Copy link
Contributor

@bencomp bencomp left a comment

Choose a reason for hiding this comment

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

Please excuse my intrusion on this issue. Should your comment #2471 (comment) be included in the documentation?

@@ -189,6 +188,32 @@ public static String getMetadataFromDvObject(String identifier, Map<String, Stri
return xmlMetadata;
}

public static String getMetadataForDeactivateIdentifier(String identifier, Map<String, String> metadata, DvObject dvObject) {

System.out.print("Start of getMetadataForDeactivateIdentifier: ");
Copy link
Contributor

Choose a reason for hiding this comment

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

Why would you not use logging?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is debug code that should have been removed altogether. I will delete it.

metadataTemplate.setIdentifier(identifier.substring(identifier.indexOf(':') + 1));
metadataTemplate.setCreators(Util.getListFromStr(metadata.get("datacite.creator")));

metadataTemplate.setDescription(":unav");
Copy link
Contributor

Choose a reason for hiding this comment

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

Where does this special value come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The special values here come from the DataCite Metadata schema https://support.datacite.org/docs/schema-values-unknown-information-v41

My intent for this is to mask any identifying information since the Dataset in question has been destroyed by Dataverse and in the opinion of the Dataverse admin should never have been created/published.

}
}

protected HashMap<String, String> addMetadataForDestroyedDataset(DvObject dvObjectIn) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the return type be Map instead of the more specific HashMap?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Will change.


protected HashMap<String, String> addMetadataForDestroyedDataset(DvObject dvObjectIn) {
HashMap<String, String> metadata = new HashMap<>();
String authorString = ":unav";
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this special string from?

@@ -279,6 +304,8 @@ public boolean testDOIExists(String identifier) {
DOIDataCiteRegisterCache rc = findByDOI(identifier);
if (rc != null) {
metadata.put("_status", rc.getStatus());
} else {
metadata.put("_status", "public");
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this public be a constant?

metadata.put("datacite.creator", authorString);
metadata.put("datacite.title", titleString);
metadata.put("datacite.publisher", producerString);
metadata.put("datacite.publicationyear", "9999");
Copy link
Contributor

@landreev landreev Aug 2, 2019

Choose a reason for hiding this comment

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

I agree with @bencomp, that special strings should generally be defined as constants somewhere.
Also, I find this a little confusing that this method is in AbstractGlobalIdServiceBean - but it does something that's very specific to the Datacite metadata. I understand you are modeling this method after the already existing method above (addBasicMetadata()) that does the same thing... I'm assuming we do this in the "abstract" bean because this datacite metadata format is used by both the Datacite and EZID DOI implementations. I still feel this could be confusing for the next person working with this code; could you rename these methods, to somehow indicate that they are specific to the DOI implementations - but not to Handles (that extends the same Abstract service class); something like addDOIMetadataForDestroyedDataset() etc.?

Copy link
Contributor

@landreev landreev left a comment

Choose a reason for hiding this comment

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

In addition to @bencomp's comments/requests, and what I added there, one more general question: Did we specifically decide that we were only implementing this for Datacite? (and not for EZID and/or Handles?)
"Out of scope" is a perfectly good answer - I just want to know if this was discussed at all.

@djbrooke
Copy link
Contributor

djbrooke commented Aug 2, 2019

@landreev there's a bit of discussion about EZID/Handles in the comment from @sekmiller at #2471 (comment). I think they are handled.

If not, I'm OK with scoping this to just Datacite DOIs for now.

@djbrooke
Copy link
Contributor

djbrooke commented Aug 2, 2019

... and belated thanks to @bencomp for the Code Review!

@landreev
Copy link
Contributor

landreev commented Aug 2, 2019

@landreev there's a bit of discussion about EZID/Handles in the comment from @sekmiller at #2471 (comment). I think they are handled.

If not, I'm OK with scoping this to just Datacite DOIs for now.

Thanks @djbrooke - I should've read the ticket, yes.

@sekmiller sekmiller self-assigned this Aug 2, 2019
@sekmiller sekmiller removed their assignment Aug 5, 2019
@landreev landreev removed their assignment Aug 5, 2019
@kcondon kcondon self-assigned this Aug 5, 2019
@kcondon kcondon merged commit 271dbd0 into develop Aug 5, 2019
@kcondon kcondon deleted the 2471-destroy-command-should-unregister-doi branch August 5, 2019 20:50
@pdurbin pdurbin mentioned this pull request Aug 6, 2019
@djbrooke djbrooke added this to the 4.16 milestone Aug 16, 2019
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.

Destroy command should unregister dataset from DOI / persistent ID provider
6 participants