The Gitlab instance will be restarted on Monday April 28th at 2AM. There will be a short interruption of service.

Skip to content
Snippets Groups Projects
Commit 4d900218 authored by Gregor Gawol's avatar Gregor Gawol Committed by André Lahmann
Browse files

refs #8055:

* add setting to suppress generic URLs for EBL records
parent 1b51004e
No related merge requests found
......@@ -1523,11 +1523,18 @@ remove[] = "gndmusic"
; Please note: Service if only available with configuration of [LinksRewrite]
; section. Use equal defined pattern below for ebl[pattern] and ebl[method] =
; resolveEblLink to call specific link resolver of EBL with authentication and
; persmision logic.
; permission logic.
;[Ebl]
;pattern = "namespace of uri"
;secret_key = "secret key provided by supplier"
; This setting defines a string that is used to identify Ebl-records by checking Marc
; 912a against it (see also https://intern.finc.info/issues/8055). This allows to
; suppress generic URLs found in Marc of Ebl records.
; Note: this requires to fully enable the [LinksRewrite] and [Ebl] sections including
; all settings otherwise the Ebl plugin might throw exceptions.
;product_sigel = "ZDB-89-EBL"
; Section of rewriting of urls of marc field $856 using regular expression or
; through injection of self-declared method. Rewrite options here are not really
; fit to resolve by bare linkresolver logic or openurl processing.
......
......@@ -67,6 +67,7 @@ showStyleBasedIcons = true
[Ebl]
pattern = "leip.eblib.com"
secret_key = "SecretKey"
product_sigel = "ZDB-89-EBL"
[LinksRewrite]
; Personalized rewriting of Open Urls.
......
......@@ -122,7 +122,7 @@ trait SolrMarcFincTrait
if (true === in_array($isil, $this->isil)) {
$isISIL = true;
}
} else {
} else if (!$this->_isEBLRecord()) {
$isISIL = true;
}
......@@ -160,6 +160,27 @@ trait SolrMarcFincTrait
return $retVal;
}
/**
* Checks if the record is an EBL record (as defined in config.ini section
* [Ebl]->product_sigel)
*
* @return bool
* @link https://intern.finc.info/issues/8055
*/
private function _isEBLRecord()
{
$value = $this->getFirstFieldValue('912', ['a']);
if (isset($this->mainConfig->Ebl->product_sigel)) {
if (preg_match(
'/'.addslashes($this->mainConfig->Ebl->product_sigel).'/', $value
)) {
return true;
}
}
return false;
}
/**
* Method to return the order information stored in fullrecord
* LocalMarcFieldOfLibrary $m
......
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