Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ RUN ant -lib /usr/share/java
FROM stadlerpeter/existdb:6
LABEL org.opencontainers.image.authors="Peter Stadler"

ADD --chown=wegajetty https://weber-gesamtausgabe.de/downloads/WeGA-data-testing-44180.xar ${EXIST_HOME}/autodeploy/
ADD --chown=wegajetty https://weber-gesamtausgabe.de/downloads/WeGA-data-testing-44180a.xar ${EXIST_HOME}/autodeploy/
COPY --from=builder /opt/wega-lib/build/*.xar ${EXIST_HOME}/autodeploy/
COPY --from=builder /opt/wega/build/*.xar ${EXIST_HOME}/autodeploy/
2 changes: 1 addition & 1 deletion catalogues/dictionary_en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -651,4 +651,4 @@
<entry xml:id="geonamesFeatureClass_T">Mountain, Hill, Rock</entry>
<entry xml:id="geonamesFeatureClass_V">Forest, Heath</entry>
<entry xml:id="WeGA_fullTexts">WeGA full texts</entry>
</dictionary>
</dictionary>
16 changes: 15 additions & 1 deletion modules/app.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -1924,6 +1924,20 @@ declare
}
};

declare
%templates:default("lang", "en")
function app:process-biblio-publishing($node as node(), $model as map(*), $lang as xs:string) as map(*) {
Comment thread
SteffenAstheimer marked this conversation as resolved.
let $biblStruct := $model('result-page-entry')//tei:biblStruct[1]
let $journalCitations :=
if(count($biblStruct/tei:monogr/tei:imprint) gt 1)
then bibl:printJournalCitationPerImprint($biblStruct/tei:monogr, <xhtml:li class="journal-citation"/>, $lang)
else ()
return
map {
'journalCitations' : $journalCitations
}
};

declare
%templates:wrap
function app:preview-details($node as node(), $model as map(*)) as map(*) {
Expand Down Expand Up @@ -1969,7 +1983,7 @@ declare
case element(tei:biblStruct) return
element {node-name($node)} {
$node/@*,
bibl:printCitation($source, <xhtml:p/>, $lang)/node()
bibl:printCitation($source, <xhtml:p/>, $lang)/node()[not(self::xhtml:span[@class=('deleteme_journalTitle', 'deleteme_imprintSection')])]
}
default return ()
};
Expand Down
43 changes: 36 additions & 7 deletions modules/bibl.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ declare function bibl:printArticleCitation($biblStruct as element(tei:biblStruct
$wrapperElement/@*,
if(exists($authors)) then ($authors, ', ') else (),
if($biblStruct[@type='review']) then '[' || lang:get-language-string('review', $lang) || '] ' else (),
if($articleTitle) then (bibl:printTitles($articleTitle, ()), ', in: ') else (),
if($articleTitle) then (bibl:printTitles($articleTitle, ())) else (),
if($journalCitation) then (', in: ') else (),
$journalCitation/xhtml:span,
$journalCitation/text(),
$note
Expand Down Expand Up @@ -173,17 +174,46 @@ declare function bibl:printIncollectionCitation($biblStruct as element(tei:biblS
: @param $lang the language switch (en, de)
: @return element
:)
declare function bibl:printJournalCitation($monogr as element(tei:monogr), $wrapperElement as element(), $lang as xs:string) as element() {
let $journalTitle := <xhtml:span class="journalTitle">{bibl:printTitles($monogr/tei:title, $monogr/tei:edition)/node()}</xhtml:span>
let $biblScope := bibl:biblScope($monogr/tei:imprint[1], $lang)
return
declare function bibl:printJournalCitation($monogr as element(tei:monogr), $wrapperElement as element(), $lang as xs:string) as element()? {
let $journalTitle :=
if (count($monogr/tei:imprint) gt 1)
then <xhtml:span class="deleteme_journalTitle">{bibl:printTitles($monogr/tei:title, $monogr/tei:edition)/node()}</xhtml:span>
else (<xhtml:span class="journalTitle">{bibl:printTitles($monogr/tei:title, $monogr/tei:edition)/node()}</xhtml:span>)
let $biblScope :=
if (count($monogr/tei:imprint) gt 1)
then for $imprint in $monogr/tei:imprint
return <xhtml:span class="deleteme_imprintSection">{bibl:biblScope($imprint, $lang)}</xhtml:span>
else <xhtml:span class="imprint">{bibl:biblScope($monogr/tei:imprint, $lang)}</xhtml:span>
return
element {$wrapperElement/name()} {
$wrapperElement/@*,
$journalTitle,
$biblScope
}
};

(:~
: Create bibliographic citations for all imprints of a journal monogr
:
: @author Steffen Astheimer
: @param $monogr the TEI monogr element with the bibliographic reference of the journal
: @param $wrapperElement the HTML element for wrapping each output item (usually li or span)
: @param $lang the language switch (en, de)
: @return element*
:)
declare function bibl:printJournalCitationPerImprint($monogr as element(tei:monogr), $wrapperElement as element(), $lang as xs:string) as element()* {
for $imprint in $monogr/tei:imprint
return
let $journalTitle := <xhtml:span class="journalTitle">{bibl:printTitles($monogr/tei:title, $monogr/tei:edition)/node()}</xhtml:span>
let $biblScope := <xhtml:span class="imprintSection">{bibl:biblScope($imprint, $lang)}</xhtml:span>
return
element {$wrapperElement/name()} {
$wrapperElement/@*,
$journalTitle,
$biblScope
}
};

(:~
: Helper function for various bibl:print*Citation()
:
Expand All @@ -194,8 +224,7 @@ declare function bibl:printJournalCitation($monogr as element(tei:monogr), $wrap
:)
declare %private function bibl:biblScope($parent as element(), $lang as xs:string) as xs:string {
let $isNZfM := some $title in $parent/../tei:title[not(@type='sub')] satisfies matches(string($title), '\(?neue zeitschrift\)? für musik', 'i')
return
concat(
return concat(
if($parent/tei:biblScope/@unit = 'jg' and $isNZfM) then concat(', ', 'Jg.', '&#160;', $parent/tei:biblScope[@unit = 'jg']) else (),
if($parent/tei:biblScope/@unit = 'vol') then bibl:print-single-biblScope-unit(', ', $parent/tei:biblScope[@unit = 'vol'], $lang) else (),
if($parent/tei:biblScope/@unit = 'jg' and not($isNZfM)) then concat(', ', 'Jg.', '&#160;', $parent/tei:biblScope[@unit = 'jg']) else (),
Expand Down
6 changes: 4 additions & 2 deletions resources/sass/pages/_search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
}
}

.wega-volltext {
.wega-volltext,
.journal-citation {
display: block;
margin-left: 1em;
margin-left: 3em;
text-indent: -1em;
}

.doi-link {
Expand Down
12 changes: 9 additions & 3 deletions templates/includes/preview-biblio.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@
<a data-template="app:preview-title">Biblio Title</a>
</h3>-->
<p data-template="app:preview-citation" class="biblio-entry">
Allgemeine Musikalische Zeitung (13.
September 1809)
Johann Andreas Stumpff, Huldigung, Karl Maria von Weber nach der ersten Erscheinung des „Oberon“ (am 12. April.), in: Berliner Allgemeine Musikalische Zeitung, Jg. 3, Nr. 37 (13. September 1826), S. 293
</p>

<div data-template="app:process-biblio-publishing" data-template-wrap="no">
<ul data-template="app-shared:if-exists" data-template-key="journalCitations" class="publishing-info">
<li data-template="app-shared:output" data-template-key="journalCitations" data-template-wrap="no">Berliner Allgemeine Musikalische Zeitung, Jg. 3, Nr. 37 (13. September 1826), S. 293</li>
</ul>
</div>

<p>
<strong><span data-template="lang:translate">biblioType</span>:</strong>
<span data-template="lang:translate-key" data-template-key="biblioType">book</span>
Expand All @@ -30,4 +36,4 @@
</p>
<div class="kwic" data-template="search:kwic"/>
</div>
</div>
</div>
9 changes: 9 additions & 0 deletions testing/xqsuite/biblio-tests.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ declare
declare
%test:args('A112915') %test:assertXPath("$result//xhtml:span[@class='title'] and $result//xhtml:span[@class='author'] and $result//xhtml:span[@class='journalTitle']")
%test:args('A112660') %test:assertEquals("<xhtml:div xmlns:xhtml='http://www.w3.org/1999/xhtml'><xhtml:span class='author'>Kurt Mey</xhtml:span>, <xhtml:span class='title'>Richard Wagners Webertrauermarsch</xhtml:span>, in: <xhtml:span class='journalTitle'>Die Musik</xhtml:span>, Bd.&#160;22, Jg.&#160;6, Heft&#160;12 (März 1907), S.&#160;331–336</xhtml:div>")
%test:args('A111869') %test:assertEquals("<xhtml:div xmlns:xhtml='http://www.w3.org/1999/xhtml'><xhtml:span class='author'>Carl Mennicke</xhtml:span>, <xhtml:span class='title'>Unbekannte Schriften von Carl Maria von Weber</xhtml:span></xhtml:div>")
function bt:test-printArticleCitation($a as xs:string) as element() {
let $doc := crud:doc($a)
return
Expand Down Expand Up @@ -148,6 +149,14 @@ declare
bibl:printCitation($doc//tei:biblStruct, <xhtml:div/>, 'de')
};

declare
%test:args('A111869') %test:assertXPath("count($result) eq 3 and count($result/xhtml:span[@class='journalTitle'][.='Blätter für Haus- und Kirchenmusik']) eq 3")
function bt:test-printJournalCitationsByImprint($a as xs:string) as element()+ {
let $doc := crud:doc($a)
return
bibl:printJournalCitationPerImprint($doc//tei:monogr, <xhtml:li/>, 'de')
};

declare %private function bt:normalize-hrefs($nodes as node()*) as node()* {
for $node in $nodes
return
Expand Down
Loading