Skip to content

Commit

Permalink
#2438 Fix register of Files via DataCite
Browse files Browse the repository at this point in the history
  • Loading branch information
sekmiller committed May 14, 2018
1 parent d7e1e87 commit c25083a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ public String registerIdentifier(String identifier, HashMap<String, String> meta
} catch (UnsupportedEncodingException ex) {
Logger.getLogger(DOIDataCiteRegisterService.class.getName()).log(Level.SEVERE, null, ex);
}
} else{
try (DataCiteRESTfullClient client = openClient()) {
retString = client.postMetadata(xmlMetadata);
client.postUrl(identifier.substring(identifier.indexOf(":") + 1), target);
} catch (UnsupportedEncodingException ex) {
Logger.getLogger(DOIDataCiteRegisterService.class.getName()).log(Level.SEVERE, null, ex);
}
}
return retString;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ private void notifyUsersDatasetPublish(CommandContext ctxt, DvObject subject) {
*/
private void registerExternalIdentifier(Dataset theDataset, CommandContext ctxt) throws CommandException {
IdServiceBean idServiceBean = IdServiceBean.getBean(theDataset.getProtocol(), ctxt);
if (theDataset.getGlobalIdCreateTime() == null) {
if (!theDataset.isIdentifierRegistered()) {
if (idServiceBean!=null) {
try {
if (!idServiceBean.alreadyExists(theDataset)) {
Expand Down

0 comments on commit c25083a

Please sign in to comment.