Title array in List View

Asked by Siegfried Schweizer

Every time we have got substructures like chapters in our digitized works/METS files, we encounter that the $metadata array which is being used in tx_dlf_listview::getEntry() contains a subarray that holds all mods:titles of all substructures of that work, like this:

Array
(
    [shelfmark] => Array
        (
            [0] => Mus.ms.autogr. Weber, C. M. v. 7
            [1] => Mus.ms.autogr. Weber, C. M. v. 7
        )

    [title] => Array
        (
            [0] => Der Freischütz; J 277; WeV C.7; op.77
            [1] => [title page, p. 1:] Der Freyschütze | Romantische Oper in drey Aufzügen | gedichtet, von Friedr. Kind. | Music, von Carl Maria von Weber. | Dresden. vollendet d: 13. May | 1820.
            [2] => Overtura
            [3] => [Erster Aufzug]
            [4] => Nro. 1. Introduzione: Victoria, der Meister soll leben
            [5] => Nro. 2. Terzetto con Cori: O! diese Sonne
            [6] => Nro. 3. Walzer
            [7] => [Nro. 3 Forts. Scena ed Aria]: Nein! länger trag ich nicht die Qualen
            [8] => Nro. 4. Lied: Hier im ird'schen Jammertal
            [9] => Nro. 5. Aria: Schweig! schweig! damit dich niemand warnt
            [10] => Zweyter Aufzug
            [11] => Nro. 6. Duetto: Schelm! halt fest
            [12] => Nro. 7. Arietta: Kommt ein schlanker Bursch gegangen
            [13] => Nro. 8. Scena ed Aria: Wie nahte mir der Schlummer
            [14] => Nro. 9. Terzetto: Wie? Was? Entsetzen!
            [15] => Nro. 10. Finale: Milch des Mondes fiel auf's Kraut
            [16] => Dritter Aufzug
            [17] => Nro. 11. Entre Act
            [18] => Nro. 12. Cavatina: Und ob die Wolke sie verhülle
            [19] => Nro. 13. Romanza ed Aria: Einst träumte meiner sel'gen Base
            [20] => Nro. 14 [olim: 13]. Volkslied: Wir winden dir den Jungfernkranz
            [21] => Nro. 15 [olim: 14]. Jägerchor: Was gleicht wohl auf Erden
            [22] => Nro. 16 [olim: 15]. Finale: Schaut, o schaut!
        )

    [author] => Array
        (
            [0] => Weber, Carl Maria von
        )

    [type] => Array
        (
            [0] => manuscript
        )

)

And due to the do loop in tx_dlf_listview::getEntry(), this leads to the fact that the found work does not get [title][0] as it's title in the hit list, but rather (in this example) [title][22].

Is this caused by some strange misconfiguration of ours or must it be deemed a bug in Goobi.Presentation? It is easily to be fixed for us by using a simple break; in the title part of the do loop, but only as long as we do still (?) have deduplication in search lists (see question before).

Question information

Language:
English Edit question
Status:
Solved
For:
Goobi.Presentation Edit question
Assignee:
No assignee Edit question
Solved by:
Sebastian Meyer
Solved:
Last query:
Last reply:
Revision history for this message
Sebastian Meyer (sebastian-meyer) said :
#1

tx_dlf_listview::getEntry() iterates through the result list object and therefor should not get in touch with more than one title at once. I don't know where these 22 titles could come from...

Could you please provide your metadata configuration (especially the XPath settings) for the 'title' field and the METS file of the document? Which version of Goobi.Presentation do you use?

Revision history for this message
Siegfried Schweizer (siegfried-schweizer) said :
#2

The METS file: http://digital.staatsbibliothek-berlin.de/dms/mets-resolver/?PPN=PPN65499935X
The XPath for the 'title' field: //mods:mods/mods:titleInfo/mods:title

Revision history for this message
Best Sebastian Meyer (sebastian-meyer) said :
#3

I think the problem is your XPath statement. The leading "//" selects all title fields in the whole METS file. Please try to use a leading "./" instead. (This should be true for all XPath statements in your metadata configuration.)

A nice XPath tutorial can be found here: http://www.w3schools.com/xpath/default.asp

This is how our XPath statement for the 'title' field looks like:
concat(./mods:titleInfo/mods:nonSort," ",./mods:titleInfo/mods:title)

Revision history for this message
Siegfried Schweizer (siegfried-schweizer) said :
#4

OK, thank you for pointing this out. For us it now works using:
./mods:titleInfo[not(@type='alternative')]/mods:title

Revision history for this message
Siegfried Schweizer (siegfried-schweizer) said :
#5

Thanks Sebastian Meyer, that solved my question.