Skip to content

Commit

Permalink
Test if zdbId exists before mapping opacLinkZdbId #1888
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Sep 27, 2023
1 parent c34749e commit 94b2c6c
Show file tree
Hide file tree
Showing 33 changed files with 107 additions and 158 deletions.
8 changes: 5 additions & 3 deletions src/main/resources/alma/fix/macros.fix
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,11 @@ end
# opacLink

do put_macro("opacLink")
copy_field("$i.@iz", "$i.@opacLinkZdbId")
lookup("$i.@opacLinkZdbId","isil2opac_zdbId", delete:"true")
split_field("$i.@opacLinkZdbId","\\{zdbid\\}")
if exists("zdbId")
copy_field("$i.@iz", "$i.@opacLinkZdbId")
lookup("$i.@opacLinkZdbId","isil2opac_zdbId", delete:"true")
split_field("$i.@opacLinkZdbId","\\{zdbid\\}")
end
copy_field("$i.@iz", "$i.@opacLinkHbzId")
lookup("$i.@opacLinkHbzId","isil2opac_hbzId", delete:"true")
split_field("$i.@opacLinkHbzId","\\{hbzid\\}")
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990001412590206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
"serialNumber" : "50860674",
"currentLibrary" : "EFB",
"currentLocation" : "Freihand",
"opacLink" : "https://www.ub.tu-dortmund.de/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://www.ub.tu-dortmund.de/webOPACClient/start.do?Query=0010=%22HT000161712%22",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-290#!",
"isil" : "DE-290",
Expand All @@ -212,7 +212,7 @@
"serialNumber" : "B1252/640",
"currentLibrary" : "0",
"currentLocation" : "0-MagAlt",
"opacLink" : "https://opac2.ulb.uni-bonn.de:8080/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://bonnus.ulb.uni-bonn.de/Summon/Search?referrerBonnus=portlet&lookfor=HT000161712",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-5#!",
"isil" : "DE-5",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990014830510206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
"serialNumber" : "SK-201407",
"currentLibrary" : "SM",
"currentLocation" : "SM-Frei",
"opacLink" : "https://opac2.ulb.uni-bonn.de:8080/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://bonnus.ulb.uni-bonn.de/Summon/Search?referrerBonnus=portlet&lookfor=HT003864492",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-5-58#!",
"isil" : "DE-5-58",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990021367710206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"serialNumber" : "20098056",
"currentLibrary" : "SFS",
"currentLocation" : "Freihand",
"opacLink" : "https://www.ub.tu-dortmund.de/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://www.ub.tu-dortmund.de/webOPACClient/start.do?Query=0010=%22HT005207972%22",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-290#!",
"isil" : "DE-290",
Expand All @@ -109,7 +109,7 @@
"serialNumber" : "186573",
"currentLibrary" : "ZB",
"currentLocation" : "Freihand",
"opacLink" : "https://www.ub.tu-dortmund.de/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://www.ub.tu-dortmund.de/webOPACClient/start.do?Query=0010=%22HT005207972%22",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-290#!",
"isil" : "DE-290",
Expand Down
1 change: 0 additions & 1 deletion src/test/resources/alma-fix/990021974470206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@
"serialNumber" : "TEMP306538",
"currentLibrary" : "HIS",
"currentLocation" : "HIS_BIB",
"opacLink" : "https://suchen.ub.rub.de/zdbid/",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-294#!",
"isil" : "DE-294",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990026405480206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"serialNumber" : "40275409",
"currentLibrary" : "SIE",
"currentLocation" : "SIE_PRAES",
"opacLink" : "https://bib-sisis.bib.hochschule-bonn-rhein-sieg.de/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://bib-sisis.bib.hochschule-bonn-rhein-sieg.de/webOPACClient/start.do?Query=0010=%22HT006813395%22",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-Sie5#!",
"isil" : "DE-Sie5",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990030574430206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"serialNumber" : "SL-031324",
"currentLibrary" : "SG",
"currentLocation" : "SG-Frei",
"opacLink" : "https://opac2.ulb.uni-bonn.de:8080/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://bonnus.ulb.uni-bonn.de/Summon/Search?referrerBonnus=portlet&lookfor=HT007847893",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-5-13#!",
"isil" : "DE-5-13",
Expand All @@ -86,7 +86,7 @@
"serialNumber" : "65/7293",
"currentLibrary" : "0",
"currentLocation" : "0-Mag",
"opacLink" : "https://opac2.ulb.uni-bonn.de:8080/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://bonnus.ulb.uni-bonn.de/Summon/Search?referrerBonnus=portlet&lookfor=HT007847893",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-5#!",
"isil" : "DE-5",
Expand Down
3 changes: 1 addition & 2 deletions src/test/resources/alma-fix/990035016180206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"serialNumber" : "TEMP55788",
"currentLibrary" : "EFB",
"currentLocation" : "BibDtLit",
"opacLink" : "https://www.ub.tu-dortmund.de/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://www.ub.tu-dortmund.de/webOPACClient/start.do?Query=0010=%22HT008733617%22",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-290#!",
"isil" : "DE-290",
Expand All @@ -126,7 +126,6 @@
"serialNumber" : "TEMP50001300061-000010",
"currentLibrary" : "UB",
"currentLocation" : "UB_LS",
"opacLink" : "https://suchen.ub.rub.de/zdbid/",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-294#!",
"isil" : "DE-294",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990041403870206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"serialNumber" : "P99/228",
"currentLibrary" : "0",
"currentLocation" : "0-Speich",
"opacLink" : "https://opac2.ulb.uni-bonn.de:8080/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://bonnus.ulb.uni-bonn.de/Summon/Search?referrerBonnus=portlet&lookfor=HT009965981",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-5#!",
"isil" : "DE-5",
Expand Down
10 changes: 3 additions & 7 deletions src/test/resources/alma-fix/990058434730206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
"serialNumber" : "GA-112635",
"currentLibrary" : "GA",
"currentLocation" : "GA-Frei",
"opacLink" : "https://opac2.ulb.uni-bonn.de:8080/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://bonnus.ulb.uni-bonn.de/Summon/Search?referrerBonnus=portlet&lookfor=HT000893437",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-5-74#!",
"isil" : "DE-5-74",
Expand All @@ -290,7 +290,7 @@
"serialNumber" : "TK-077339",
"currentLibrary" : "TK",
"currentLocation" : "TK-Frei",
"opacLink" : "https://opac2.ulb.uni-bonn.de:8080/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://bonnus.ulb.uni-bonn.de/Summon/Search?referrerBonnus=portlet&lookfor=HT000893437",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-5-108#!",
"isil" : "DE-5-108",
Expand All @@ -304,7 +304,7 @@
"serialNumber" : "69/4564",
"currentLibrary" : "0",
"currentLocation" : "0-Mag",
"opacLink" : "https://opac2.ulb.uni-bonn.de:8080/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://bonnus.ulb.uni-bonn.de/Summon/Search?referrerBonnus=portlet&lookfor=HT000893437",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-5#!",
"isil" : "DE-5",
Expand All @@ -318,7 +318,6 @@
"serialNumber" : "RSB821",
"currentLibrary" : "UB",
"currentLocation" : "UB_G2B1",
"opacLink" : "https://suchen.ub.rub.de/zdbid/",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-294#!",
"isil" : "DE-294",
Expand All @@ -332,7 +331,6 @@
"serialNumber" : "TEMPHBZ60030859789-000010",
"currentLibrary" : "HIS",
"currentLocation" : "HIS_BIB",
"opacLink" : "https://suchen.ub.rub.de/zdbid/",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-294#!",
"isil" : "DE-294",
Expand All @@ -346,7 +344,6 @@
"serialNumber" : "TEMPHBZ60035269470-000010",
"currentLibrary" : "EVTH",
"currentLocation" : "EVTH_BIB",
"opacLink" : "https://suchen.ub.rub.de/zdbid/",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-294#!",
"isil" : "DE-294",
Expand All @@ -360,7 +357,6 @@
"serialNumber" : "TEMP70838",
"currentLibrary" : "KTH",
"currentLocation" : "KTH_BIB",
"opacLink" : "https://suchen.ub.rub.de/zdbid/",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-294#!",
"isil" : "DE-294",
Expand Down
13 changes: 4 additions & 9 deletions src/test/resources/alma-fix/990058567920206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
"serialNumber" : "116597",
"currentLibrary" : "ZB",
"currentLocation" : "Freihand",
"opacLink" : "https://www.ub.tu-dortmund.de/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://www.ub.tu-dortmund.de/webOPACClient/start.do?Query=0010=%22HT000909138%22",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-290#!",
"isil" : "DE-290",
Expand All @@ -320,7 +320,7 @@
"serialNumber" : "20105163",
"currentLibrary" : "SFS",
"currentLocation" : "Freihand",
"opacLink" : "https://www.ub.tu-dortmund.de/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://www.ub.tu-dortmund.de/webOPACClient/start.do?Query=0010=%22HT000909138%22",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-290#!",
"isil" : "DE-290",
Expand Down Expand Up @@ -376,7 +376,7 @@
"serialNumber" : "75/2644",
"currentLibrary" : "0",
"currentLocation" : "0-Mag",
"opacLink" : "https://opac2.ulb.uni-bonn.de:8080/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://bonnus.ulb.uni-bonn.de/Summon/Search?referrerBonnus=portlet&lookfor=HT000909138",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-5#!",
"isil" : "DE-5",
Expand All @@ -390,7 +390,7 @@
"serialNumber" : "PO-024839",
"currentLibrary" : "PO",
"currentLocation" : "PO-Frei",
"opacLink" : "https://opac2.ulb.uni-bonn.de:8080/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://bonnus.ulb.uni-bonn.de/Summon/Search?referrerBonnus=portlet&lookfor=HT000909138",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-5-162#!",
"isil" : "DE-5-162",
Expand Down Expand Up @@ -443,7 +443,6 @@
"serialNumber" : "117103641",
"currentLibrary" : "SOZ",
"currentLocation" : "SOZ_BIB",
"opacLink" : "https://suchen.ub.rub.de/zdbid/",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-294#!",
"isil" : "DE-294",
Expand All @@ -457,7 +456,6 @@
"serialNumber" : "TEMP303283",
"currentLibrary" : "HIS",
"currentLocation" : "HIS_BIB",
"opacLink" : "https://suchen.ub.rub.de/zdbid/",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-294#!",
"isil" : "DE-294",
Expand All @@ -471,7 +469,6 @@
"serialNumber" : "DNA4625+1",
"currentLibrary" : "UB",
"currentLocation" : "UB_G3B3",
"opacLink" : "https://suchen.ub.rub.de/zdbid/",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-294#!",
"isil" : "DE-294",
Expand All @@ -485,7 +482,6 @@
"serialNumber" : "DNA4625",
"currentLibrary" : "UB",
"currentLocation" : "UB_G3B3",
"opacLink" : "https://suchen.ub.rub.de/zdbid/",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-294#!",
"isil" : "DE-294",
Expand All @@ -499,7 +495,6 @@
"serialNumber" : "TEMP82023",
"currentLibrary" : "KTH",
"currentLocation" : "KTH_BIB",
"opacLink" : "https://suchen.ub.rub.de/zdbid/",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-294#!",
"isil" : "DE-294",
Expand Down
3 changes: 1 addition & 2 deletions src/test/resources/alma-fix/990059571560206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
"serialNumber" : "51/964(29)+2",
"currentLibrary" : "0",
"currentLocation" : "0-Mag",
"opacLink" : "https://opac2.ulb.uni-bonn.de:8080/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://bonnus.ulb.uni-bonn.de/Summon/Search?referrerBonnus=portlet&lookfor=HT001039253",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-5#!",
"isil" : "DE-5",
Expand All @@ -174,7 +174,6 @@
"serialNumber" : "WFA228-29:2",
"currentLibrary" : "UB",
"currentLocation" : "UB_G3/B4",
"opacLink" : "https://suchen.ub.rub.de/zdbid/",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-294#!",
"isil" : "DE-294",
Expand Down
2 changes: 0 additions & 2 deletions src/test/resources/alma-fix/990063549080206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@
"serialNumber" : "TEMP50001060163-000010",
"currentLibrary" : "UB",
"currentLocation" : "UB_G2B3",
"opacLink" : "https://suchen.ub.rub.de/zdbid/",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-294#!",
"isil" : "DE-294",
Expand All @@ -176,7 +175,6 @@
"serialNumber" : "ZRB80-507/509",
"currentLibrary" : "UB",
"currentLocation" : "UB_G2B3",
"opacLink" : "https://suchen.ub.rub.de/zdbid/",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-294#!",
"isil" : "DE-294",
Expand Down
7 changes: 2 additions & 5 deletions src/test/resources/alma-fix/990075429930206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
"serialNumber" : "TK-038705",
"currentLibrary" : "TK",
"currentLocation" : "TK-Frei",
"opacLink" : "https://opac2.ulb.uni-bonn.de:8080/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://bonnus.ulb.uni-bonn.de/Summon/Search?referrerBonnus=portlet&lookfor=HT000944190",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-5-108#!",
"isil" : "DE-5-108",
Expand All @@ -166,7 +166,7 @@
"serialNumber" : "GE-011615",
"currentLibrary" : "GE",
"currentLocation" : "GE-Frei",
"opacLink" : "https://opac2.ulb.uni-bonn.de:8080/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://bonnus.ulb.uni-bonn.de/Summon/Search?referrerBonnus=portlet&lookfor=HT000944190",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-5-20#!",
"isil" : "DE-5-20",
Expand All @@ -193,7 +193,6 @@
"serialNumber" : "TEMP50000410798-000010",
"currentLibrary" : "UB",
"currentLocation" : "UB_G3B1",
"opacLink" : "https://suchen.ub.rub.de/zdbid/",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-294#!",
"isil" : "DE-294",
Expand All @@ -207,7 +206,6 @@
"serialNumber" : "TEMPHBZ60036085491-000010",
"currentLibrary" : "HIS",
"currentLocation" : "HIS_BIB",
"opacLink" : "https://suchen.ub.rub.de/zdbid/",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-294#!",
"isil" : "DE-294",
Expand All @@ -221,7 +219,6 @@
"serialNumber" : "TEMP397133",
"currentLibrary" : "GER",
"currentLocation" : "GER_BIB",
"opacLink" : "https://suchen.ub.rub.de/zdbid/",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-294#!",
"isil" : "DE-294",
Expand Down
5 changes: 2 additions & 3 deletions src/test/resources/alma-fix/990126276700206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"serialNumber" : "90745439",
"currentLibrary" : "MOP",
"currentLocation" : "MOP_Haupt",
"opacLink" : "http://193.25.18.8/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "http://193.25.18.8/webOPACClient/start.do?Query=0010=%22HT014015351%22",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-Dm13#!",
"isil" : "DE-Dm13",
Expand Down Expand Up @@ -197,7 +197,7 @@
"serialNumber" : "2010/1208",
"currentLibrary" : "0",
"currentLocation" : "0-Frei1",
"opacLink" : "https://opac2.ulb.uni-bonn.de:8080/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://bonnus.ulb.uni-bonn.de/Summon/Search?referrerBonnus=portlet&lookfor=HT014015351",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-5#!",
"isil" : "DE-5",
Expand All @@ -224,7 +224,6 @@
"serialNumber" : "IFB9657",
"currentLibrary" : "UB",
"currentLocation" : "UB_G2B4",
"opacLink" : "https://suchen.ub.rub.de/zdbid/",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-294#!",
"isil" : "DE-294",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990143325070206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
"serialNumber" : "2007/5873",
"currentLibrary" : "0",
"currentLocation" : "0-Frei1",
"opacLink" : "https://opac2.ulb.uni-bonn.de:8080/webOPACClient/start.do?Query=-1=%22%22",
"opacLink" : "https://bonnus.ulb.uni-bonn.de/Summon/Search?referrerBonnus=portlet&lookfor=HT014601018",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-5#!",
"isil" : "DE-5",
Expand Down
Loading

0 comments on commit 94b2c6c

Please sign in to comment.