Commit 39aa78bd authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

Merge branch 'release/2.5.0'

parents 5081d3dd c0c0e6a6
# customized config files #
###########################
local.build.properties
src/core/config.xql
# oxygen project file #
#######################
cr_xq.xpr
# files generated by ant #
##########################
src/repo.xml
src/expath-pkg.xml
build
dist-utils/antbuild/ivy/
dist-utils/antbuild/lib/
expath-pkg.xml
.DS_STORE
=======
build/*
git.branches
node {
stage('Preparation') {
checkout scm
sh 'rm -f build/*.xar'
}
stage('Build') {
sh 'ant'
}
stage('Publish') {
archiveArtifacts artifacts: 'build/*.xar', onlyIfSuccessful: true
FILENAME = sh (
script: "find build/ -name '*.xar' -exec basename {} \\;",
returnStdout: true
).trim()
sh "curl -X POST -F 'file=@build/${FILENAME}' http://localhost:8181/exist/apps/receiver.xql"
}
stage('Post') {
always {
cleanWs()
}
}
}
xquery version "3.1";
let $params :=
<parameters>
<param name="output" value="backup"/>
<param name="zip" value="no"/>
<param name="backup" value="yes"/>
<param name="incremental" value="yes"/>
</parameters>
return
system:trigger-system-task("org.exist.storage.ConsistencyCheckTask", $params)
project.namespace=http://textgrid.de/ns/SADE
project.version=2.5.0
project.title=Scalable Architecture for Digital Editions
project.abbrev=SADE
<?xml version="1.0" encoding="UTF-8"?>
<project default="xar" name="SADE">
<xmlproperty file="expath-pkg.xml"/>
<property name="project.version" value="${package(version)}"/>
<property name="project.app" value="SADE"/>
<property environment="env"/>
<property file="build.properties"/>
<property name="build.dir" value="build"/>
<target name="xar">
<copy file="expath-pkg.xml.tmpl" tofile="expath-pkg.xml" filtering="true" overwrite="true">
<filterset>
<filter token="project.version" value="${project.version}"/>
<filter token="project.title" value="${project.title}"/>
<filter token="project.abbrev" value="${project.abbrev}"/>
<filter token="project.namespace" value="${project.namespace}"/>
</filterset>
</copy>
<mkdir dir="${build.dir}"/>
<zip basedir="." destfile="${build.dir}/${project.app}-${project.version}.xar" excludes="${build.dir}/*"/>
<zip basedir="." destfile="${build.dir}/${project.abbrev}-${project.version}.xar"
excludes="${build.dir}/*"/>
</target>
</project>
\ No newline at end of file
</project>
......@@ -58,28 +58,39 @@ else if (tokenize($exist:path, '/') = "get") then
$docCollection := $config:projects-dir || $project ||"/data/xml/xhtml/"|| $id ||"/",
$docpath := $docCollection || $page ||".xml",
$doc := doc( $docpath ),
$error := $doc//error,
$content :=
switch ($exist:resource)
case "code.html" return
replace(serialize($doc//xhtml:div[@class="teixml"]), "xhtml:", "")
case "code.html" return (
replace(serialize($doc//xhtml:div[@class="teixml"]), "xhtml:", ""),
serialize($error)
)
case "trans.html" return
replace(serialize($doc/xhtml:body/xhtml:div/xhtml:div[not(@class="teixml")][not(@class="facs")]), "xhtml:", "")
case "facs.html" return
replace(serialize($doc//xhtml:div[@class="facs"]), "xhtml:", "")
case "toc.html" return
replace(serialize(doc( $docCollection || "toc.xml" )), "xhtml:", "")
case "comm.html" return
replace(serialize($doc//xhtml:div[@class="notes"]), "xhtml:", "")
default return "supported requests are: facs, trans, code"
return
response:stream($content, "method=text media-type=text/plain")
(: the important stuff :)
else if(
$exist:resource = "edition.html"
and config:get("sade.develop") = "true"
and string(request:get-cookie-value('fontaneAuth')) != config:get("secret")
) then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<redirect url="login.html?redirect={$exist:path => substring-after("textgrid/")}?{request:get-query-string()}"/>
</dispatch>
else if (ends-with($exist:resource, ".html")) then
let $doc-path := $config:projects-dir || $project || config:get("template") || $exist:resource
return
......
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://expath.org/ns/pkg" name="http://textgrid.de/ns/SADE" abbrev="SADE" version="2.3.2" spec="1.0">
<title>Scalable Architecture for Digital Editions powered by TextGrid</title>
<title>Scalable Architecture for Digital Editions</title>
<dependency package="http://exist-db.org/apps/markdown"/>
<dependency package="http://exist-db.org/apps/monex"/>
</package>
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://expath.org/ns/pkg" name="@project.namespace@" abbrev="@project.abbrev@" version="@project.version@" spec="1.0">
<title>@project.title@</title>
<dependency package="http://exist-db.org/apps/markdown"/>
<dependency package="http://exist-db.org/apps/monex"/>
</package>
......@@ -110,13 +110,13 @@ declare function config:keys() {
};
declare function config:module-get($module-name as xs:string, $key as xs:string) as item()? {
let $module := $config:configDoc//module[string(@key)=$module-name]
let $module := $config:configDoc//*[string(@key)=$module-name]
return
$module/param[ string(@key)=$key ]/node()
};
declare function config:module-get($module-name as xs:string, $key as xs:string, $default as item()?) as item()? {
let $value := config:module-get($module-name , $key)
let $value := config:module-get($module-name, $key)
return if (empty($value)) then
$default
else
......
......@@ -5,9 +5,20 @@ import module namespace config="http://textgrid.de/ns/SADE/config" at "../config
import module namespace console="http://exist-db.org/xquery/console";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare namespace test="http://exist-db.org/xquery/xqsuite";
declare namespace tgmd="http://textgrid.info/namespaces/metadata/core/2010";
declare namespace xhtml="http://www.w3.org/1999/xhtml";
declare variable $f-misc:metadata-collection := collection("/db/sade-projects/textgrid/data/xml/meta");
declare
%test:arg("baseUri","textgrid:16b00") %test:assertEquals("Notizbuch C07")
%test:arg("baseUri","") %test:assertEquals("")
function f-misc:get-title-by-baseUri($baseUri as xs:string) as xs:string? {
if($baseUri = "") then () else
$f-misc:metadata-collection//tgmd:object[tgmd:generic/tgmd:generated/tgmd:textgridUri[starts-with(., $baseUri)]]//tgmd:title/string()
};
declare function f-misc:cite($node as node(), $model as map(*)) {
let $url := request:get-url(),
$res := tokenize($url, '/')[last()],
......@@ -23,7 +34,7 @@ let $url := request:get-url(),
default return 'Blatt '||$page,
$doc := doc( config:get("data-dir")||$id),
$title := $doc//tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title/string(),
$version := string( ($doc//tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change/text())[1] ),
$version := string( ($doc//tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change[last()]/text())[1] ),
$date := current-date(),
$date := day-from-date($date)||'.'||month-from-date($date)||'.'||year-from-date($date),
$url := replace($url, 'localhost:8080/exist/apps/SADE/textgrid', 'fontane-nb.dariah.eu') ||(if (request:get-query-string()) then '?' || request:get-query-string() else '')
......@@ -46,9 +57,11 @@ return
<div class="modal-body">
Theodor Fontane: {$title}. Hrsg. von Gabriele Radecke.
In: Theodor Fontane: Notizbücher. Digitale genetisch-kritische und kommentierte Edition.
Hrsg. von Gabriele Radecke, {$page}.
{$url},
abgerufen am: {$date}
Hrsg. von Gabriele Radecke,
Blatt {$page}.
{$url}.
{$version},
abgerufen am {$date}
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
......@@ -332,16 +345,6 @@ switch ( config:get('sade.develop') )
</ul>
</div>
</div>
<div id="rotateBtn" class="col-xs-2">
<input
id="RotateSlide"
type="range"
min="0"
max="359"
step="5"
defaultValue="0"
style="height:0;"/>
</div>
</div>
default return
<div class="row">
......@@ -456,7 +459,7 @@ return
let $status := $doc/xhtml:div[@class]/tokenize(@class, '\s+')[last()]
return
if( $doc//ok ) then () else
<div class="alert alert-{$status}">
<div class="alert alert-{if($status = "error") then "danger" else $status}">
<h4>TextGrid-Statusmeldung</h4>
<p>Es liegt eine aktuelle Meldung zum TextGrid Repository vor. Einige
Funktionen, z.Bsp die Darstellung der Faksimiles, sind vom TextGrid
......@@ -467,6 +470,45 @@ return
</div>
};
declare function f-misc:serverStatus($node as node(), $model as map(*)) {
let $col := "/db/sade-projects/textgrid"
let $res := "serverstatus.xml"
let $url := "https://dariah-de.github.io/status/index.html"
let $lastMod := xmldb:last-modified($col, $res)
let $path := $col || "/" || $res
let $doc := doc( $path )
let $active := not( exists( $doc//ok ) )
let $needUpdate := not(doc-available($path)) or $lastMod < (current-dateTime() - xs:dayTimeDuration("PT6H"))
let $getStatus :=
if( $needUpdate )
then
let $status := httpclient:get(xs:anyURI($url), false(), ())//*:li[contains(., "Fontane")]/ancestor::*:div[contains(@class, "alert")]
let $status := if( exists( $status ) ) then $status else <ok/>
return
(xmldb:login($col, config:get("sade.user"), config:get("sade.password")),
xmldb:store($col, $res, $status))
else if($active and $lastMod < (current-dateTime() - xs:dayTimeDuration("PT2H")))
then
let $status := httpclient:get(xs:anyURI($url), false(), ())//*:li[contains(., "Fontane")]/ancestor::*:div[contains(@class, "alert")]
let $status := if( exists( $status ) ) then $status else <ok/>
return
(xmldb:login($col, config:get("sade.user"), config:get("sade.password")), xmldb:store($col, $res, $status))
else ()
let $doc := doc( $col || "/" || $res )
return
let $status := $doc/*:div[@class]/tokenize(@class, '\s+')[last()]
return
if( $doc//ok ) then () else
<div class="alert {$status}">
<h4>Statusmeldung</h4>
<p>Es liegt eine aktuelle Meldung zum Betrieb dieses Servers vor.</p>
<h5>Status: {substring-after($status, "-")}<br/>
Datum: {string-join( ($doc//*:time/string(@datetime)), ";")}</h5>
<!-- at DARIAH-DE status page no p[@lang='de'] available -->
<p>Die vollständige Statusmeldung finden Sie unter <a href="https://dariah-de.github.io/status/">dariah-de.github.io/status/</a></p>
</div>
};
declare function f-misc:nbTitle($id as xs:string, $model as map(*)){
let $doc := doc( config:get("data-dir") || $id)
let $title := $doc//tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title/string(.)
......@@ -483,7 +525,7 @@ if(request:get-parameter-names() = 'page')
then
let $page := if(request:get-parameter('page', '') = '') then 'outer_front_cover' else request:get-parameter('page', '')
let $doc:= doc('/db/sade-projects/textgrid/data'||$id)/tei:TEI
let $pagelist := $doc//tei:sourceDoc//tei:surface[parent::tei:sourceDoc or @type="clipping"]/string(@n)
let $pagelist := $doc//tei:sourceDoc//tei:surface[parent::tei:sourceDoc or @type="clipping" or @type="additional"]/string(@n)
let $page := if ($page = '') then 'outer_front_cover' else $page
let $index := index-of($pagelist, $page)
let $return :=
......
......@@ -3,20 +3,60 @@ xquery version "3.1";
module namespace fontaneregister="http://fontane-nb.dariah.eu/register";
import module namespace console="http://exist-db.org/xquery/console" at "java:org.exist.console.xquery.ConsoleModule";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare namespace ore="http://www.openarchives.org/ore/terms/";
declare namespace rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare namespace tgmd="http://textgrid.info/namespaces/metadata/core/2010";
declare function local:Links($link as element()) {
let $targetSf := substring-before(substring-after($link/string(@target), "surface[@n='"), "']")
let $baseUri := substring(substring-after($link/@target, 'textgrid:'), 1, 5)
let $title := doc( '/db/sade-projects/textgrid/data/xml/meta/' || $baseUri || '.xml')//tgmd:title/text()
let $nb := request:get-parameter('nb', 'textgrid')
(: new stuff :)
declare variable $fontaneregister:metaCollection := '/db/sade-projects/textgrid/data/xml/meta/';
declare variable $fontaneregister:titles :=
map:new(
for $title in collection($fontaneregister:metaCollection)//tgmd:title[starts-with(., "Notizbuch ")]
let $uri := $title/base-uri() => substring-after($fontaneregister:metaCollection) => substring-before(".xml")
return
if(contains($link/@target, $nb)) then
<li><a href="edition.html?id=/xml/data/{$baseUri}.xml&amp;page={$targetSf}">{$title} – {$targetSf}</a></li>
else ()
(map:entry($uri, string($title)),
map:entry("textgrid:"||$uri, string($title)))
);
declare function local:links3($links as element()*) {
let $uris :=
$links ! (substring-after(./@target, "textgrid:") => substring(1,5))
=> distinct-values()
return
if($uris = ()) then () else
<ul>
{ for $nb in $uris[.=map:keys($fontaneregister:titles)]
let $title := $fontaneregister:titles($nb)
let $surfaces := $links[contains(@target, $nb)]/substring-before(substring-after(@target, "@n='"), "'")
let $link2surfaces := $surfaces ! local:create-links($nb, .)
let $linksToTarget := ($link2surfaces[1], for $l in $link2surfaces[position() gt 1] return (", ", $l))
order by $title
return
<li>{ replace($title, "Notizbuch ([A-E])0(\d)", "$1$2") } ({ $linksToTarget })</li>
}
</ul>
};
declare function local:create-links($uri as xs:string, $surface as xs:string) as element()? {
<a href="edition.html?id=/xml/data/{$uri}.xml&amp;page={ $surface }">{ $surface }</a>
};
(: END new stuff :)
declare function local:Links($links as element()*) {
(:let $links :=:)
(: for $link in $links:)
(: let $targetSf := substring-before(substring-after($link/string(@target), "surface[@n='"), "']"):)
(: let $baseUri := substring(substring-after($link/@target, 'textgrid:'), 1, 5):)
(: let $title := doc( '/db/sade-projects/textgrid/data/xml/meta/' || $baseUri || '.xml')//tgmd:title/text():)
(: let $nb := request:get-parameter('nb', 'textgrid'):)
(: order by $title:)
(: return:)
(: if(contains($link/@target, $nb)) then:)
(: <li><a href="edition.html?id=/xml/data/{$baseUri}.xml&amp;page={$targetSf}">{$title} – {$targetSf}</a></li>:)
(: else ():)
()
};
declare function local:Links2($link as element()) {
......@@ -175,45 +215,45 @@ return
</div>
<div class="panel-body">
<ul>
{ for $pers in $persList/tei:person|$persList/tei:personGrp
{for $pers in $persList/tei:person|$persList/tei:personGrp
let $classes := ("registerEintrag",
"reg-"||$pers/local-name(),
if($pers/@xml:id = request:get-parameter('e', '')) then 'fhighlighted' else ())
let $primaryName := string( $pers/tei:persName[1] )
let $isPointer := not(exists($pers/@xml:id))
let $pointer := if($isPointer) then local:pointer($pers//tei:ptr, $persList/ancestor::*//*[@xml:id = substring-after($pers//tei:ptr/@target, '#')]) else ()
where ($pers//tei:link/contains(@target, map:keys($fontaneregister:titles))) = true()
return
<li id="{$pers/@xml:id}" class="{ $classes }">
{ $primaryName }
{ if( $isPointer ) then $pointer else
(: Person :) (
let $registerLink :=
<span class="registerLink">
<a href="register.html?{replace(request:get-query-string(), '(&amp;)*e=.+(&amp;)*', '')||(if(request:get-query-string() = "") then () else "&amp;")}e={$pers/string(@xml:id)}"><i title="Link zu diesem Eintrag" class="fa fa-link"></i></a>
</span>
let $hasVariant := exists($pers/tei:persName[@type="variant"])
let $birthAndDeath := if( not($pers/tei:birth or $pers/tei:death) ) then () else
<li>{if($pers/tei:birth/node()) then ('&#8727;',$pers/tei:birth/text()) else ()} {if($pers/tei:death/node()) then ('✝',$pers/tei:death/text()) else()}</li>
(: test if we process for a specific notebook :)
(: if (not(
($pers//tei:link/contains(@target, request:get-parameter('nb', 'textgrid')) = true() )
)
) then () else
if(not(local:pointerTest(string(string($pers//tei:note/tei:ptr/@target)), request:get-parameter('nb', 'textgrid')))) then () else
:) <li id="{$pers/@xml:id}" class="registerEintrag reg-{$pers/local-name()} {if($pers/@xml:id = request:get-parameter('e', '')) then 'fhighlighted' else ()}">
{$pers/tei:persName[1]/text()}
{
if( not( exists($pers/@xml:id)) ) then local:pointer($pers//tei:ptr, $persList/ancestor::*//*[@xml:id = substring-after($pers//tei:ptr/@target, '#')])
else (
<span class="registerLink"> <a href="register.html?{replace(request:get-query-string(), '(&amp;)*e=.+(&amp;)*', '')||(if(request:get-query-string() = "") then () else "&amp;")}e={$pers/string(@xml:id)}"><i title="Link zu diesem Eintrag" class="fa fa-link"></i></a> </span>,
<ul>
{if(exists($pers/tei:persName[@type="variant"]))
then <li>im Text:
<ul>{ for $item in $pers/tei:persName[@type="variant"]/text() return <li> {$item} </li>} </ul>
</li> else ()}
{if($pers/tei:birth or $pers/tei:death)
then <li>{if($pers/tei:birth) then ('&#8727;',$pers/tei:birth/text()) else ()}{' '}{if($pers/tei:death) then ('✝',$pers/tei:death/text()) else()}</li>
else ()}
return ($registerLink,
<ul>{ if( not( $hasVariant) ) then () else
<li>im Text:
<ul>{ for $item in $pers/tei:persName[@type="variant"]/text() return <li> {$item} </li>} </ul>
</li>
}
{ $birthAndDeath }
{if($pers/tei:occupation) then <li>{$pers/tei:occupation/text()}</li> else ()}
<li>(<a href="http://d-nb.info/gnd/{$pers/tei:idno[@xml:base="http://d-nb.info/gnd/"]/text()}">GND</a>)</li>
<li>
<ul>
{if($pers/tei:note/text()) then <li>{$pers/tei:note/text()}</li> else ()}
<li>{if(count( distinct-values($pers//tei:link/substring(substring-after(@target, 'textgrid:'), 1, 5)) ) lt 2) then 'In Notizbuch' else 'In den Notizbüchern'}
<ul>
{for $link in $pers//tei:link[@corresp="https://schema.org/mentions"]
return local:Links($link)}
</ul>
{ local:links3($pers//tei:link) }
</li>
</ul>
</li>
</ul>
)}
</ul>))}
</li>
}
</ul>
......@@ -225,6 +265,7 @@ return
};
declare function fontaneregister:places($geoDoc) {
let $console := console:log($geoDoc/base-uri())
let $geoURI := tokenize($geoDoc/base-uri(), '/|\.')[8]
return
(: Ortsregister :)
......@@ -320,6 +361,7 @@ let $r := request:get-parameter('r', '')
let $e := request:get-parameter('e', '')
let $agg := '253st.xml'
let $uris := doc('/db/sade-projects/textgrid/data/xml/agg/'||$agg)//ore:aggregates/substring-after(@rdf:resource, 'textgrid:')
let $meta := for $uri in $uris
where doc-available( '/db/sade-projects/textgrid/data/xml/data/' || $uri ||'.xml')
return
......@@ -362,7 +404,7 @@ return
<div class="tab-content">
{ fontaneregister:events( $docs//tei:body/tei:listEvent ) }
{ fontaneregister:orgs( $docs//tei:body/tei:listOrg ) }
{ fontaneregister:places( $docs//tei:body/tei:listPlace ) }
<!-- { fontaneregister:places( $docs//tei:body/tei:listPlace ) } -->
{ fontaneregister:persons( $docs//tei:body/tei:listPerson ) }
{ fontaneregister:works( $docs//tei:body//tei:list[@type="works"] ) }
{ fontaneregister:works( $docs//tei:body//tei:list[@type="periodicals"] ) }
......
xquery version "3.1";
import module namespace test="http://exist-db.org/xquery/xqsuite"
at "resource:org/exist/xquery/lib/xqsuite/xqsuite.xql";
(: this is the main test script for fontane specific modules.
it should run during startup and stores the results at /db/test-results.xml
where all other test suites should put their two pennies worth.
:)
test:suite(
inspect:module-functions(xs:anyURI("misc.xqm"))
)
This diff is collapsed.
......@@ -2,54 +2,19 @@ xquery version "3.1";
declare namespace tei="http://www.tei-c.org/ns/1.0";
import module namespace fontaneTransfo="http://fontane-nb.dariah.eu/Transfo" at "/db/apps/SADE/modules/multiviewer/fontane.xqm";
import module namespace fontaneTransfo="http://fontane-nb.dariah.eu/Transfo" at "/db/apps/SADE/modules/fontane/transform.xqm";
let $uri := "1zzdp"
let $header := doc( "/db/sade-projects/textgrid/data/xml/data/" || $uri || ".xml" )//tei:teiHeader
let $uri := "2128d"
let $doc := doc( "/db/sade-projects/textgrid/data/xml/data/" || $uri || ".xml" )
let $surface := "1v"
let $tei :=
<TEI xmlns="http://www.tei-c.org/ns/1.0">
{$header}
<sourceDoc n="Nachl._Theodor_Fontane,Notizbücher_C05">
<surface n="outer_front_cover" facs="http://textgridrep.org/textgrid:18wz6">
<graphic n="C05_001" url="http://textgridrep.org/textgrid:18wz6" mimeType="image/jpeg"/>
<surface facs="http://textgridrep.org/textgrid:18wz6" type="label" subtype="Signaturen-Klebchen_Archivar_alt" ulx="0.0" uly="2.7" lrx="1.6" lry="6.5">
<graphic n="C05_001" url="http://textgridrep.org/textgrid:18wz6" mimeType="image/jpeg"/>
<zone uly="0.3" lry="1.2">
<handShift new="#fremde_Hand1" medium="black_ink thin_pen" script="Latn clean"/>
<line style="margin-left:0.8cm">C</line>
<line style="margin-left:0.8cm">5</line>
<handShift new="#Fontane" medium="pencil" script="Latf standard"/>
</zone>
</surface>
<surface facs="http://textgridrep.org/textgrid:18wz6" type="label" subtype="Etikett_vom_Notizbuch-Hersteller_angefertigt" ulx="1.7" uly="4.1" lrx="8.6" lry="8.5">
<graphic n="C05_001" url="http://textgridrep.org/textgrid:18wz6" mimeType="image/jpeg"/>
<zone>
<handShift new="#fremde_Hand3"/>
<line style="margin-left:0.5cm" rend="align(center)">✓ <handShift new="#Fontane" medium="black_ink thick_pen" script="clean"/><seg type="heading"><seg style="letter-spacing:0.2cm; font-size:xx-large; font-weight:bold"><seg><date type="synchronous" when-iso="1873"><hi>1<seg style="text-decoration:underline" rend="underline-style:slightly_wavy">873</seg></hi></date></seg>.</seg></seg></line>
<handShift script="standard"/>
<zone type="toc" subtype="Fontane">
<zone type="item" rend="align(center)">
<line style="margin-left:0.3cm">(<seg style="letter-spacing:0.2cm"><seg><rs type="direct" ref="plc:Thueringen_Land"><handShift script="Latn"/>Thüringen</rs></seg><handShift script="Latf"/>.</seg> Auf⸗</line>
<lb type="edited_text"/>
<line style="margin-left:0.8cm">enthalt in <seg><rs type="direct" ref="plc:Tabarz"><handShift script="Latn"/><seg><ref target="#xpath(//surface[@n='38r'])">Tabarz</ref></seg></rs></seg><handShift script="Latf"/>.)</line>
<lb type="edited_text"/>
<line style="margin-left:0.8cm"><seg><rs type="direct" ref="plc:Gotha"><seg><ref target="#xpath(//surface[@n='1r'])">Gotha</ref></seg></rs></seg>. <seg><rs type="direct" ref="plc:Eisenach"><seg><ref target="#xpath(//surface[@n='11r'])">Eiſenach</ref></seg></rs></seg>.<seg><rs type="direct" ref="plc:Coburg"><seg><ref target="#xpath(//surface[@n='60r'])">Coburg</ref></seg></rs></seg>.</line>
<lb type="edited_text"/>
<line style="margin-left:0.5cm"><seg><rs type="direct" ref="plc:Neuses">Neuſeß</rs></seg>. <!--Verlinkung?--><seg><rs type="direct" ref="plc:Schmalkalden"><seg><ref target="#xpath(//surface[@n='41r'])">Schmalkalden</ref></seg></rs></seg></line>
<lb type="edited_text"/>
<handShift script="Latn"/>
<line style="margin-left:2.0cm">etc. etc.</line>
<handShift medium="pencil" script="Latf"/>
</zone>
</zone>
</zone>
</surface>
</surface>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
{$doc//tei:teiHeader}
<sourceDoc n="{string($doc//tei:sourceDoc/@n)}">
{$doc//tei:surface[@n = $surface]}
</sourceDoc>
</TEI>
</TEI>
return
fontaneTransfo:magic($tei)
......@@ -79,24 +79,32 @@ let $tei := doc($docpath)//tei:teiHeader,
case 3 return try {
<ul>
<li>Herausgeber-Inhaltsverzeichnis
<ul>{for $item in $tei/fileDesc/sourceDesc/msDesc/msContents/ab/list[@type="editorial"]/item return
<li>{for $text in $item//text()[not(parent::tei:hi)] return local:textref($text)}</li> }
<ul>{for $item in $tei//msContents/ab/list[@type="editorial"]/item return
<li>{for $text in $item//text() where not($text/parent::tei:hi) return local:textref($text)}</li> }
</ul>
</li>
</ul> } catch * { 'error at item 3' }
case 4 return <ul> {
(if( $tei/profileDesc/textClass/keywords[1]/term/string(text()) = 'non-fiction')
then <li>Nicht-Fiktional</li>
else (),
if($tei/profileDesc/textClass/keywords[2]/term/string(.) = 'fiction')
then <li>Fiktional</li>
else ())}
<hr/> {for $item in $tei/profileDesc/textClass/keywords[not(@scheme)]/term return
<li>
{if( $item/string(.) = "fiction" ) then "Fiktional" else $item/text()}
</li>}
</ul>
case 4 return <ul>{for $item in $tei/profileDesc/textClass/keywords return <li>nach {$item/string(@scheme)} <ul>{for $term in $item/term return <li>{$term/text()}</li>}</ul></li>}</ul>
</ul> } catch * { 'error at item 3', <p>{$err:code}: {$err:description}. Data: {$err:value}</p> }
case 4 return
let $keywordsCat := $tei/profileDesc/textClass/keywords[@scheme]
return
<xhtml:ul>
{for $keyword at $pos in $keywordsCat
return
(if($pos = 2) then <xhtml:hr/> else (),
<xhtml:li class="textClass_cat">
<xhtml:span title="{string($keyword/@scheme)}">
{if( $keyword//term[. = 'fiction'] ) then "Fiktional" else ()}
{if( $keyword//term[. = 'non-fiction'] ) then "Nicht-Fiktional" else ()}
</xhtml:span>
<xhtml:ul>
{for $term in $keyword/following-sibling::tei:keywords[1][not(@scheme)]//tei:term
return
<xhtml:li>{string($term)}</xhtml:li>
}
</xhtml:ul>
</xhtml:li>)
}
</xhtml:ul>
case 5 return
if( not($tei//profileDesc/textDesc/derivation/*) ) then "Keine" else
<ul>{for $type in distinct-values($tei//profileDesc/textDesc/derivation/linkGrp/link/string(@type))
......@@ -109,14 +117,26 @@ let $tei := doc($docpath)//tei:teiHeader,
} <ul> {for $link in $tei//profileDesc/textDesc/derivation/linkGrp/link[@type = $type]
let $target := substring-after(substring-after($link/@target, ' '), ':')
let $litVZ := doc('/db/sade-projects/textgrid/data/xml/data/25547.xml')/tei:TEI
return <li><xhtml:a href="literaturvz.html?id={$target}">{ $litVZ//bibl[@xml:id = $target]//expan/text()}</xhtml:a>
{if($link/@resp) then (' [Vgl. ', <xhtml:a href="literaturvz.html?id={substring-after($link/@resp, ':')}">{$litVZ//bibl[@xml:id = substring-after($link/@resp, ':')]//abbr/text()}</xhtml:a>, '.]') else ()}</li>
let $page := substring-after($link/@target, "_") => substring-before("_")
return
if(starts-with($link/@target, "http://textgridrep.org/"))
then
<xhtml:li>
<xhtml:a href="literaturvz.html?id={$target}">{ $litVZ//bibl[@xml:id = $target]//abbr/text() => replace("\.$", "")}</xhtml:a>;
{if($link/@resp) then (' vgl. ', <xhtml:a href="literaturvz.html?id={substring-after($link/@resp, ':')}">{$litVZ//bibl[@xml:id = substring-after($link/@resp, ':')]//abbr/text()}</xhtml:a>, '.') else ()}
</xhtml:li>
else
<xhtml:li>
<xhtml:a href="literaturvz.html?id={$target}">{ $litVZ//bibl[@xml:id = $target]//abbr/text() => replace("\.$", "")}</xhtml:a>;
<xhtml:a href="edition.html?id={request:get-parameter("id", "")}&amp;page={$page}&amp;target={substring-before($link/@target, " ") => substring-after("#")}">Blatt {$page}</xhtml:a>.
{if($link/@resp) then (' [Vgl. ', <xhtml:a href="literaturvz.html?id={substring-after($link/@resp, ':')}">{$litVZ//bibl[@xml:id = substring-after($link/@resp, ':')]//abbr/text()}</xhtml:a>, '.]') else ()}
</xhtml:li>
} </ul></li>}</ul>
case 6
return
if($tei//msPart/*)
then <div>
<div><span style="font-weight: bold;">Beilagen: </span> {
<div>{
switch(count($tei//msPart))
case 1 return "Eine"
case 2 return "Zwei"
......@@ -132,7 +152,7 @@ let $tei := doc($docpath)//tei:teiHeader,
<ul>
{ for $msPart in $tei//tei:msPart[tei:msIdentifier][tei:ab]
return
<li> {$msPart/msIdentifier/idno/text()}: {$msPart/ab/text()}</li>