Skip to content

Commit

Permalink
Merge pull request #5439 from IQSS/develop
Browse files Browse the repository at this point in the history
v4.10.1
  • Loading branch information
kcondon authored Jan 7, 2019
2 parents a88bbb6 + 9b4a874 commit 1a12cda
Show file tree
Hide file tree
Showing 11 changed files with 400 additions and 10 deletions.
4 changes: 2 additions & 2 deletions doc/sphinx-guides/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
# built documents.
#
# The short X.Y version.
version = '4.10'
version = '4.10.1'
# The full version, including alpha/beta/rc tags.
release = '4.10'
release = '4.10.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
4 changes: 3 additions & 1 deletion doc/sphinx-guides/source/versions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Dataverse Guides Versions

This list provides a way to refer to previous versions of the Dataverse guides, which we still host. In order to learn more about the updates delivered from one version to another, visit the `Releases <https://github.com/IQSS/dataverse/releases>`__ page in our GitHub repo.

- 4.10
- 4.10.1

- `4.10 </en/4.10/>`__
- `4.9.4 </en/4.9.4/>`__
- `4.9.3 </en/4.9.3/>`__
- `4.9.2 </en/4.9.2/>`__
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->
<groupId>edu.harvard.iq</groupId>
<artifactId>dataverse</artifactId>
<version>4.10</version>
<version>4.10.1</version>
<packaging>war</packaging>

<name>dataverse</name>
Expand Down
351 changes: 351 additions & 0 deletions scripts/database/create/create_v4.10.1.sql

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions scripts/database/releases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ v4.9.2
v4.9.3
v4.9.4
v4.10
v4.10.1
16 changes: 14 additions & 2 deletions src/main/java/edu/harvard/iq/dataverse/DOIDataCiteServiceBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,22 @@ public boolean registerWhenPublished() {

@Override
public boolean alreadyExists(DvObject dvObject) {
if(dvObject==null) {
logger.severe("Null DvObject sent to alreadyExists().");
return false;
}
return alreadyExists(dvObject.getGlobalId());
}

@Override
public boolean alreadyExists(GlobalId pid) {
logger.log(Level.FINE,"alreadyExists");
if(pid==null) {
logger.severe("No identifier sent.");
return false;
}
boolean alreadyExists;
String identifier = getIdentifier(dvObject);
String identifier = pid.asString();
try{
alreadyExists = doiDataCiteRegisterService.testDOIExists(identifier);
} catch (Exception e){
Expand All @@ -43,7 +56,6 @@ public boolean alreadyExists(DvObject dvObject) {
return alreadyExists;
}



@Override
public String createIdentifier(DvObject dvObject) throws Exception {
Expand Down
15 changes: 12 additions & 3 deletions src/main/java/edu/harvard/iq/dataverse/DOIEZIdServiceBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,31 @@ public boolean registerWhenPublished() {

@Override
public boolean alreadyExists(DvObject dvObject) throws Exception {
if(dvObject==null) {
logger.severe("Null DvObject sent to alreadyExists().");
return false;
}
return alreadyExists(dvObject.getGlobalId());
}

@Override
public boolean alreadyExists(GlobalId pid) throws Exception {
logger.log(Level.FINE,"alreadyExists");
try {
HashMap<String, String> result = ezidService.getMetadata(getIdentifier(dvObject));
HashMap<String, String> result = ezidService.getMetadata(pid.asString());
return result != null && !result.isEmpty();
// TODO just check for HTTP status code 200/404, sadly the status code is swept under the carpet
} catch (EZIDException e ){
//No such identifier is treated as an exception
//but if that is the case then we want to just return false
if(dvObject.getIdentifier() == null){
if(pid.getIdentifier() == null){
return false;
}
if (e.getLocalizedMessage().contains("no such identifier")){
return false;
}
logger.log(Level.WARNING, "alreadyExists failed");
logger.log(Level.WARNING, "getIdentifier(dvObject) {0}", getIdentifier(dvObject));
logger.log(Level.WARNING, "getIdentifier(dvObject) {0}", pid.asString());
logger.log(Level.WARNING, "String {0}", e.toString());
logger.log(Level.WARNING, "localized message {0}", e.getLocalizedMessage());
logger.log(Level.WARNING, "cause", e.getCause());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1567,7 +1567,7 @@ public boolean isGlobalIdUnique(String userIdentifier, DataFile datafile, Global
.getResultList().isEmpty();

try{
if (idServiceBean.alreadyExists(datafile)) {
if (idServiceBean.alreadyExists(new GlobalId(testProtocol, testAuthority, userIdentifier))) {
u = false;
}
} catch (Exception e){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public interface GlobalIdServiceBean {
static final Logger logger = Logger.getLogger(GlobalIdServiceBean.class.getCanonicalName());

boolean alreadyExists(DvObject dvo) throws Exception;

boolean alreadyExists(GlobalId globalId) throws Exception;

boolean registerWhenPublished();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,12 @@ public boolean alreadyExists(DvObject dvObject) throws Exception {
return isHandleRegistered(handle);
}

@Override
public boolean alreadyExists(GlobalId pid) throws Exception {
String handle = pid.getAuthority() + "/" + pid.getIdentifier();
return isHandleRegistered(handle);
}

@Override
public Map<String,String> getIdentifierMetadata(DvObject dvObject) {
throw new NotImplementedException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import edu.harvard.iq.dataverse.AbstractGlobalIdServiceBean;
import edu.harvard.iq.dataverse.DvObject;
import edu.harvard.iq.dataverse.GlobalId;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand All @@ -15,6 +17,11 @@ public class FakePidProviderServiceBean extends AbstractGlobalIdServiceBean {
public boolean alreadyExists(DvObject dvo) throws Exception {
return true;
}

@Override
public boolean alreadyExists(GlobalId globalId) throws Exception {
return true;
}

@Override
public boolean registerWhenPublished() {
Expand Down

0 comments on commit 1a12cda

Please sign in to comment.