Skip to content

Commit

Permalink
Add missing transformation and display for title fields (RPB-114)
Browse files Browse the repository at this point in the history
Add `alternativeSpelling` to `alternativeTitle`, `parallelTitle`
to `otherTitleInformation`, display all `otherTitleInformation`
values in details view, don't sort values.
  • Loading branch information
fsteeg committed Nov 27, 2024
1 parent 5749097 commit c562904
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
4 changes: 1 addition & 3 deletions app/views/tags/result_doc.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,8 @@

@table(){
<tr><td>Titel</td><td><b>@((doc \ "title").asOpt[String].getOrElse(""))</b></td></tr>
@result_field("Titelzusatz", "otherTitleInformation", doc, TableRow.VALUES)
@result_field("Alternativer Titel", "alternativeTitle", doc, TableRow.VALUES)
@for(x <- (doc \ "otherTitleInformation").asOpt[Seq[JsValue]]) {
<tr><td>Titelzusatz</td><td><i>@x.head.asOpt[String].getOrElse("")</i></td></tr>
}
@result_field("Unterreihe", "titleOfSubSeries", doc, TableRow.VALUES)
@result_field("Verantwortlich", "responsibilityStatement", doc, TableRow.VALUES)
@contributions((doc \ "contribution").asOpt[Seq[JsValue]].getOrElse(Seq()))
Expand Down
2 changes: 1 addition & 1 deletion app/views/tags/result_field.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -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) }))
1 change: 1 addition & 0 deletions conf/output/test-output-5.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.]" ],
Expand Down
1 change: 1 addition & 0 deletions conf/output/test-output-74.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" : [ {
Expand Down
11 changes: 10 additions & 1 deletion conf/rpb-titel-to-lobid.fix
Original file line number Diff line number Diff line change
Expand Up @@ -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" -------

Expand Down

0 comments on commit c562904

Please sign in to comment.