From c562904ad81a7a14b9e9e4978b5257a06ced5b2e Mon Sep 17 00:00:00 2001 From: Fabian Steeg Date: Wed, 27 Nov 2024 13:13:20 +0100 Subject: [PATCH] Add missing transformation and display for title fields (RPB-114) Add `alternativeSpelling` to `alternativeTitle`, `parallelTitle` to `otherTitleInformation`, display all `otherTitleInformation` values in details view, don't sort values. --- app/views/tags/result_doc.scala.html | 4 +--- app/views/tags/result_field.scala.html | 2 +- conf/output/test-output-5.json | 1 + conf/output/test-output-74.json | 1 + conf/rpb-titel-to-lobid.fix | 11 ++++++++++- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/views/tags/result_doc.scala.html b/app/views/tags/result_doc.scala.html index 0162f4e5..49ae24b7 100644 --- a/app/views/tags/result_doc.scala.html +++ b/app/views/tags/result_doc.scala.html @@ -243,10 +243,8 @@ @table(){ Titel@((doc \ "title").asOpt[String].getOrElse("")) + @result_field("Titelzusatz", "otherTitleInformation", doc, TableRow.VALUES) @result_field("Alternativer Titel", "alternativeTitle", doc, TableRow.VALUES) - @for(x <- (doc \ "otherTitleInformation").asOpt[Seq[JsValue]]) { - Titelzusatz@x.head.asOpt[String].getOrElse("") - } @result_field("Unterreihe", "titleOfSubSeries", doc, TableRow.VALUES) @result_field("Verantwortlich", "responsibilityStatement", doc, TableRow.VALUES) @contributions((doc \ "contribution").asOpt[Seq[JsValue]].getOrElse(Seq())) diff --git a/app/views/tags/result_field.scala.html b/app/views/tags/result_field.scala.html index 52b0a481..0dc87ef8 100644 --- a/app/views/tags/result_field.scala.html +++ b/app/views/tags/result_field.scala.html @@ -27,5 +27,5 @@ property, param, label, - multiSingleOrEmptySeq(jsonVal(property)).map(_.asOpt[String].getOrElse("--")).sorted(Ordering[String].reverse), + multiSingleOrEmptySeq(jsonVal(property)).map(_.asOpt[String].getOrElse("--")), if(valueLabel.isEmpty){ Optional.empty() } else { Optional.of(valueLabel.get) })) diff --git a/conf/output/test-output-5.json b/conf/output/test-output-5.json index 55dcf5fe..42a149a1 100644 --- a/conf/output/test-output-5.json +++ b/conf/output/test-output-5.json @@ -10,6 +10,7 @@ "label" : "Rheinland-Pfälzische Bibliographie" } ], "title" : "Sagas légendes des bords du Rhin [Elektronische Ressource] : orné de 8 gravures sur acier", + "alternativeTitle" : [ "Düsseldorf" ], "extent" : "[1] Bl., VIII, 299 S., [7] Bl. : Ill.", "note" : [ "HT003558438 Dt. Ausg. u.d.T.: Rheinlands Sagen, Geschichten und Legenden" ], "responsibilityStatement" : [ "[Alfred von Reumont]. D'après les dessins des peintres de l' Ecole de Dusseldorf [Kretschmer del. ; Plüddemann del. ; Alfred Rethel del. ; Sonderland del.]" ], diff --git a/conf/output/test-output-74.json b/conf/output/test-output-74.json index 43e9b6bb..fbc91af7 100644 --- a/conf/output/test-output-74.json +++ b/conf/output/test-output-74.json @@ -9,6 +9,7 @@ "label" : "Rheinland-Pfälzische Bibliographie" } ], "title" : "Piffche-Bahnfahrt durch Rheinhessen", + "otherTitleInformation" : [ "= Piffsche-Bahnfahrd dorsch Rhoihesse" ], "note" : [ "Text teilweise Hochdeutsch, teilweise in rheinhessischem Dialekt" ], "responsibilityStatement" : [ "Hartmut Keil" ], "publication" : [ { diff --git a/conf/rpb-titel-to-lobid.fix b/conf/rpb-titel-to-lobid.fix index 5f993f79..b4a41cce 100644 --- a/conf/rpb-titel-to-lobid.fix +++ b/conf/rpb-titel-to-lobid.fix @@ -103,8 +103,17 @@ if is_array("title") end replace_all("title", "\\s\\+", "") +# ------- "otherTitleInformation" ------- +set_array("otherTitleInformation[]") +copy_field("otherTitleInformation", "otherTitleInformation[].$append") +prepend("parallelTitle[].*.value", "= ") +copy_field("parallelTitle[].*.value", "otherTitleInformation[].$append") + +# ------- "alternativeTitle" ------- move_field("alternativeTitle[]", "alternativeTitleObjects[]") -copy_field("alternativeTitleObjects[].*.value", "alternativeTitle[]") +set_array("alternativeTitle[]") +copy_field("alternativeSpelling", "alternativeTitle[].$append") +copy_field("alternativeTitleObjects[].*.value", "alternativeTitle[].$append") # ------- "extent" -------