From 5bacd1cadda2fd8f3d96c5cafb2ab5fdbfc8698d Mon Sep 17 00:00:00 2001 From: Philipp Zumstein Date: Sun, 7 Jul 2024 18:17:23 +0200 Subject: [PATCH] Add collections info for electronic resources UMA The new option is only for man-sru.php and currently only used for bestandsabgleich.html for Mannheim. For example for the ISBNs 9781118823828 and 9781118823835 besides that they are online available (E) one can now also see in which collection i.e. on which platform (e.g. EBC or O'Reilly) they are available. --- isbn/man-sru.php | 23 +++++++++++++++++++++-- tools/bestandsabgleich.html | 6 ++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/isbn/man-sru.php b/isbn/man-sru.php index b36b0f5..5c56b0d 100644 --- a/isbn/man-sru.php +++ b/isbn/man-sru.php @@ -17,7 +17,8 @@ * ISBN kann ebenfalls eine Komma-separierte Liste von ISBNs sein * man-sru?isbn=ISBN&format=json * man-sru?isbn=ISBN&format=holdings - * + * man-sru?isbn=ISBN&format=holdings&with=collections +* * Sucht übergebene ISBN bzw. PPN in der SRU-Schnittstelle der UB Mannheim * und gibt maximal 10 Ergebnisse als MARCXML, JSON zurück oder eine * formattierte Bestandsangabe (eine kurze Zeile und die Details in einer @@ -118,6 +119,7 @@ $map = STANDARD_MARC_MAP; $map['bestand'] = '//datafield[@tag="AVA"]/subfield[@code="b"]'; +$map['sammlung'] = '//datafield[@tag="AVE"]/subfield[@code="m"]'; if (!isset($_GET['format'])) { header('Content-type: text/xml'); @@ -173,6 +175,7 @@ echo "\n"; echo "
\n"; if ($aveNodes) { + $collections = []; echo "\n"; foreach ($aveNodes as $node) { echo "\n"; @@ -183,6 +186,10 @@ echo " "; } echo "\n\n"; + $collection = $node->xpath('./subfield[@code="m"]'); + if ($collection) { + $collections[] = getValues($collection[0]); + } } echo "
" . $value . "
\n"; echo "
\n"; @@ -195,10 +202,14 @@ } if ($aveNodes) { echo "E"; + if ($_GET['with']) { + echo ' (' . implode(" | ", $collections) . ')'; + } } echo ''; } elseif ($aveNodes and !$avaNodes) { echo "\n"; + $collections = []; foreach ($aveNodes as $node) { echo "\n"; $subfields = $node->xpath('./subfield'); @@ -208,10 +219,18 @@ echo " "; } echo "\n\n"; + $collection = $node->xpath('./subfield[@code="m"]'); + if ($collection) { + $collections[] = getValues($collection[0]); + } } echo "
" . $value . "
\n"; echo "
\n"; - echo '
Bestand der UB Mannheim: E
'; + echo '
Bestand der UB Mannheim: E'; + if ($_GET['with']) { + echo ' (' . implode(" | ", $collections) . ')'; + } + echo '
'; } elseif ($size > 100) { //if the isbn is not found, then the $outputString is a minimal xml document //of size 48, for larger size something might be found... diff --git a/tools/bestandsabgleich.html b/tools/bestandsabgleich.html index 9d7c8f2..a4463e1 100644 --- a/tools/bestandsabgleich.html +++ b/tools/bestandsabgleich.html @@ -11,8 +11,8 @@