Skip to content
Snippets Groups Projects
Commit 9f363cc7 authored by Dorian Merz's avatar Dorian Merz Committed by Robert Lange
Browse files

refs #18611 [finc] react on resolver state 10 "unknown"

* adds readout of state 10
* also adds some refactoring to streamline Ezb Class

refs #18611 [finc] adds getDOI to MARC driver

refs #18611 [finc] add DOI-Parameter do Ezb-Query

+ slight refactoring
parent 578167ee
No related merge requests found
......@@ -404,6 +404,22 @@ trait SolrMarcFincTrait
return $retval;
}
public function getDOI () {
$allIdentifiers = $this->getOtherIdentifiers();
$dois = $allIdentifiers['doi'] ?? [];
if (!empty($dois)) {
return current($dois);
}
$urls = $this->getURLs();
foreach ($urls as $url) {
if (strpos($url['url'],'https://doi.org/') === 0) {
return substr($url['url'],16);
}
}
return null;
}
/**
* Get an array of instrumentation notes taken from the local data
* of the Petrucci music library subfield 590b
......
......@@ -131,16 +131,18 @@ class Ezb extends AbstractBase implements TranslatorAwareInterface
if (isset($this->config->bibid)) {
$openURL .= '&pid=' .
'bibid%3D' . $this->config->bibid;
$pid = 'bibid=' . $this->config->bibid;
} else {
// use IP-based request as fallback
$openURL .= '&pid=client_ip%3D' . $_SERVER['REMOTE_ADDR'];
$pid = 'client_ip=' . $_SERVER['REMOTE_ADDR'];
}
$openURL .= !isset($parsed['rft.issn']) && isset($parsed['zdbid']) ?
$pid .= !isset($parsed['rft.issn']) && isset($parsed['zdbid']) ?
'&zdbid=' . $parsed['zdbid'] : '';
$pid .= '&ezb=1';
$openURL .= urlencode('&ezb=1');
$openURL .= '&pid=' . urlencode($pid);
$openURL .= isset($parsed['doi']) ? '&id=doi:' . $parsed['doi'] : '';
$url = $this->getResolverUrl($openURL);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment