diff --git a/orcid-core/src/main/java/org/orcid/core/utils/v3/identifiers/resolvers/ISBNOCLCResolver.java b/orcid-core/src/main/java/org/orcid/core/utils/v3/identifiers/resolvers/ISBNOCLCResolver.java index 025cb203cfb..ed8304c303e 100644 --- a/orcid-core/src/main/java/org/orcid/core/utils/v3/identifiers/resolvers/ISBNOCLCResolver.java +++ b/orcid-core/src/main/java/org/orcid/core/utils/v3/identifiers/resolvers/ISBNOCLCResolver.java @@ -9,6 +9,7 @@ import org.orcid.core.utils.v3.identifiers.PIDResolverCache; import org.orcid.jaxb.model.v3.release.record.Work; import org.orcid.pojo.PIDResolutionResult; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import com.google.common.collect.Lists; @@ -21,6 +22,9 @@ public class ISBNOCLCResolver implements LinkResolver { @Resource PIDResolverCache cache; + + @Value("${org.orcid.core.utils.v3.identifiers.resolvers.ISBNOCLCResolver.disabled:true}") + private boolean disableIsbnResolution; public List canHandle() { return Lists.newArrayList("oclc","isbn"); @@ -39,10 +43,14 @@ public PIDResolutionResult resolve(String apiTypeName, String value) { // this assumes we're using worldcat - 303 on success, 200 on fail String normUrl = normalizationService.generateNormalisedURL(apiTypeName, value); if (!StringUtils.isEmpty(normUrl)) { - if (cache.isHttp303(normUrl)){ - return new PIDResolutionResult(true,true,true,normUrl); - }else{ - return new PIDResolutionResult(false,true,true,null); + if (disableIsbnResolution) { + // If it is a valid format, but the resolver is disabled, + // return just the valid format + return new PIDResolutionResult(false, true, true, null); + } else if (cache.isHttp303(normUrl)) { + return new PIDResolutionResult(true, true, true, normUrl); + } else { + return new PIDResolutionResult(false, true, true, null); } } return new PIDResolutionResult(false,false,true,null);//unreachable?