From f3f0764bf8bbe72e86a4406eb003571ac3f50797 Mon Sep 17 00:00:00 2001 From: TobiasNx <61879957+TobiasNx@users.noreply.github.com> Date: Mon, 2 Sep 2024 18:31:14 +0200 Subject: [PATCH 1/3] Reuse nwbib fix for #1951 and #1829 https://github.com/hbz/nwbib/issues/636 --- web/app/views/tags/result_doc.scala.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/app/views/tags/result_doc.scala.html b/web/app/views/tags/result_doc.scala.html index 192f18c65..6efe6c325 100644 --- a/web/app/views/tags/result_doc.scala.html +++ b/web/app/views/tags/result_doc.scala.html @@ -188,8 +188,8 @@ @for(pub <- sortedPublications((doc\"publication").asOpt[Seq[JsValue]].getOrElse(Seq()))){ @publication(pub) } @result_field("Auflage", "edition", doc, TableRow.VALUES) - @result_field("ISBN", "isbn", doc, TableRow.VALUES) - @result_field("ISSN", "issn", doc, TableRow.VALUES) + @result_field("ISBN", "isbn", doc, TableRow.VALUES, node = Option(doc)) + @result_field("ISSN", "issn", doc, TableRow.VALUES, node = Option(doc)) @withPrefixedLink("DOI", "https://dx.doi.org/", doc \ "doi") @withPrefixedLink("URN", "https://nbn-resolving.org/", doc \ "urn") @result_field("Umfang", "extent", doc, TableRow.VALUES) From 3e1587d1829640439dcad1dc79ebef5f10f30850 Mon Sep 17 00:00:00 2001 From: TobiasNx Date: Thu, 5 Sep 2024 11:14:27 +0200 Subject: [PATCH 2/3] Use zbd or hbz id as lobidUri for linking #1992 --- web/app/views/tags/result_doc.scala.html | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/web/app/views/tags/result_doc.scala.html b/web/app/views/tags/result_doc.scala.html index 6efe6c325..404dfebc5 100644 --- a/web/app/views/tags/result_doc.scala.html +++ b/web/app/views/tags/result_doc.scala.html @@ -91,8 +91,11 @@ }}} } -@lobidUrl(doc: JsValue) = @{ - "http://lobid.org/resources/" + (doc\"almaMmsId").asOpt[String].orElse((doc\"hbzId").asOpt[String]).orElse((doc\"rpbId").asOpt[String]).getOrElse("") + "#!" +@lobidUrlWithHbzId(doc: JsValue) = @{ + "http://lobid.org/resources/" + ((doc\"hbzId").asOpt[String]).getOrElse("") + "#!" +} +@lobidUrlWithZdbId(doc: JsValue) = @{ + "http://lobid.org/resources/ZDB-" + (doc\"zdbId").asOpt[String].getOrElse("") + "#!" } @lobid2_part_of(field: String, subField: String) = { @@ -197,9 +200,13 @@ @result_field("In", "containedIn", doc, TableRow.LINKS) @lobid2_part_of("isPartOf", "hasSuperordinate") - @defining(lobidUrl(doc)){ id => - @subordinated("isPartOf.hasSuperordinate.id", id, "Bände", ("zugehöriger Band", "zugehörige Bände")) - @subordinated("containedIn.id", id, "Enthält", ("Beitrag", "Beiträge")) + @defining(lobidUrlWithZdbId(doc)){ id => + @subordinated("isPartOf.hasSuperordinate.id", id, "Bände", ("zugehöriger Band", "zugehörige Bände")) + @subordinated("containedIn.id", id, "Enthält", ("Beitrag", "Beiträge")) + } + @defining(lobidUrlWithHbzId(doc)){ id => + @subordinated("isPartOf.hasSuperordinate.id", id, "Bände", ("zugehöriger Band", "zugehörige Bände")) + @subordinated("containedIn.id", id, "Enthält", ("Beitrag", "Beiträge")) } From fcf01f4bc020cef8a3805c81a8d44aea99f93bb7 Mon Sep 17 00:00:00 2001 From: Fabian Steeg Date: Wed, 11 Sep 2024 13:41:14 +0200 Subject: [PATCH 3/3] Replace `jsonVal` block with nwbib version (#1951) --- web/app/views/tags/result_field.scala.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/app/views/tags/result_field.scala.html b/web/app/views/tags/result_field.scala.html index c36bbf058..a8c899a2c 100644 --- a/web/app/views/tags/result_field.scala.html +++ b/web/app/views/tags/result_field.scala.html @@ -6,9 +6,10 @@ @import java.util.Optional @import controllers.resources.Lobid -@jsonVal(p: String) = @{ node match { - case Some(node) => node - case None => if ((doc \\ p).isEmpty) (doc \ p) else (doc \\ p).head +@jsonVal(p: String) = @{ + node match { + case Some(node) => (node \ p).asOpt[JsValue].getOrElse(node \ p) + case None => if ((doc \\ p).isEmpty) (doc \ p) else (doc \\ p).head } }