Commit 6f6e2b2e authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

Merge branch 'release/2.3.0'

parents 7cd7106a 56aef919
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://expath.org/ns/pkg" name="http://textgrid.de/ns/SADE" abbrev="SADE" version="2.2.4" spec="1.0">
<package xmlns="http://expath.org/ns/pkg" name="http://textgrid.de/ns/SADE" abbrev="SADE" version="2.3.0" spec="1.0">
<title>Scalable Architecture for Digital Editions powered by TextGrid</title>
<dependency package="http://exist-db.org/apps/markdown"/>
<dependency package="http://exist-db.org/apps/monex"/>
......
......@@ -5,6 +5,7 @@ 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 tgmd="http://textgrid.info/namespaces/metadata/core/2010";
declare namespace xhtml="http://www.w3.org/1999/xhtml";
declare function f-misc:cite($node as node(), $model as map(*)) {
......@@ -209,7 +210,7 @@ declare function f-misc:list($datadir, $param, $num as xs:integer) {
onclick="goldenState('trans')">Transkriptionsansicht</a></li>
<li>Edierter Text/Textkritischer Apparat</li>
<li>TEI/XML-Ansicht: <a href="edition.html?id=/xml/data/{$uri[last()]}.xml&amp;page="
onclick="createCookie('facs', 'inactive' , 180); createCookie('xml', 'true', 180); createCookie('trans', 'inactive', 180)"><i title="seitenweise" class="fa fa-file-o"></i></a> | <a href="xml.html?id=/xml/data/{$uri[last()]}.xml"><i title="gesamtes XML auf der Webseite betrachten" class="fa fa-file-code-o"></i></a> |<a target="_blank" href="/rest/data/{$uri[last()]}.xml">REST</a></li>
onclick="goldenState('code')"><i title="seitenweise" class="fa fa-file-o"></i></a> | <a href="xml.html?id=/xml/data/{$uri[last()]}.xml"><i title="gesamtes XML auf der Webseite betrachten" class="fa fa-file-code-o"></i></a> |<a target="_blank" href="/rest/data/{$uri[last()]}.xml">REST</a></li>
<li>Kommentare und Register
<ul>
<li><a href="ueberblickskommentar.html?id=/xml/data/{$uri[last()]}.xml">Überblickskommentar</a></li>
......@@ -388,9 +389,12 @@ switch ( config:get('sade.develop') )
};
declare function f-misc:mirador($node as node(), $model as map(*), $n){
if((string-length($n) lt 4) and matches($n, "^[A-Ea-e]\d+"))
then <iframe src="https://fontane-nb.dariah.eu/public/mirador/{replace(lower-case($n), '0(\d)', '$1')}.html" height="100%" width="100%"/>
else "Die Digitalisate zum gesuchten Notizbuch sind noch nicht verfügbar oder die Anfrage ist ungültig."
let $sandbox := doc( "/db/sade-projects/textgrid/data/xml" || "/sandbox-iiif.xml" )
let $url := "https://textgridlab.org/1.0/iiif/mirador/?uri="
let $book := if(string-length($n) = 2) then substring($n, 1, 1) || "0" || substring($n, 2, 1) else $n
let $uri := string($sandbox//tgmd:title[matches(., "Notizbuch_" || $book || "-IIIF")]/ancestor::tgmd:generic//tgmd:textgridUri)
return
<iframe src="{$url || $uri}" height="100%" width="100%"/>
};
declare function f-misc:debug( $node as node(), $model as map(*) ){
......@@ -407,6 +411,7 @@ switch ($develop)
<button class="btn btn-default{ if(not(request:get-cookie-names() = 'del') or contains(request:get-cookie-value('del'), 'inactive')) then ' inactive' else ()}" id="delBtn">del</button>
<button class="btn btn-default{ if(not(request:get-cookie-names() = 'add') or contains(request:get-cookie-value('add'), 'inactive')) then ' inactive' else ()}" id="addBtn">add</button>
<button class="btn btn-default{ if(not(request:get-cookie-names() = 'mod') or contains(request:get-cookie-value('mod'), 'inactive')) then ' inactive' else ()}" id="modBtn">mod</button>
<button class="btn btn-default{ if(not(request:get-cookie-names() = 'seq') or contains(request:get-cookie-value('seq'), 'inactive')) then ' inactive' else ()}" id="seqBtn">seq</button>
<button class="btn btn-default{ if(not(request:get-cookie-names() = 'latn') or contains(request:get-cookie-value('latn'), 'inactive')) then ' inactive' else ()}" id="latnBtn">Latn</button>
<button class="btn btn-default{ if(not(request:get-cookie-names() = 'script') or contains(request:get-cookie-value('script'), 'inactive')) then ' inactive' else ()}" id="scriptBtn">script
<div class="BtnExt">
......@@ -430,14 +435,14 @@ declare function f-misc:textgridStatus($node as node(), $model as map(*)) {
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("PT12H"))
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(), ())//xhtml:div[contains(@class, 'repstatus')][not( contains(@class, 'ok') )]
let $status := if( exists( $status ) ) then $status else <ok/>
return
(xmldb:login($col, config:get("sade.user"), config:get("sade.password")),
(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
......
......@@ -179,12 +179,12 @@ return
return
(: test if we process for a specific notebook :)
if (not(
(: 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 ()}">
:) <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, '#')])
......
......@@ -9,7 +9,7 @@ declare namespace tei="http://www.tei-c.org/ns/1.0";
declare namespace xhtml="http://www.w3.org/1999/xhtml";
declare variable $f-render:id := request:get-parameter("id", "/xml/data/16b00.xml");
declare variable $f-render:page :=
declare variable $f-render:page :=
let $para := request:get-parameter("page", "outer_front_cover")
return
if($para = "") then "outer_front_cover" else $para
......@@ -22,11 +22,14 @@ declare variable $f-render:notebook := substring-after($f-render:doc//tei:source
declare function f-render:initView($node as node(), $model as map()) {
let $nodes := for $n in $node/node() return templates:process($n, $model)
return
element {$node/name()} {
attribute id {$f-render:notebook},
$node/@*[not(local-name() => starts-with("data-") )],
$nodes
}
if( doc-available( config:get("data-dir") || request:get-parameter("id", "0")) )
then
element {$node/name()} {
attribute id {$f-render:notebook},
$node/@*[not(local-name() => starts-with("data-") )],
$nodes
}
else <div>The requested document is not available.</div>
};
declare function f-render:facs($node as node(), $model as map()) {
......@@ -46,4 +49,4 @@ declare function f-render:code($node as node(), $model as map()) {
{$node/@*[not(local-name() => starts-with("data-") )]}
{$f-render:xhtml//xhtml:div[@class = "teixml"]}
</xhtml:div>
};
\ No newline at end of file
};
This diff is collapsed.
......@@ -30,6 +30,7 @@ let $doc :=
$result := <div>{local:dokuwikiparser( $result/*[not(@id='dw__toc')] )}</div>,
$login := xmldb:login( '/sade-projects/textgrid/data/xml/doku/', config:get('sade.user') , config:get("sade.password")),
$store := xmldb:store( '/sade-projects/textgrid/data/xml/doku/', $id || '.rev' || $revisionInWiki || '.xml' , $result )
$imageReload := local:dokuwikiImageReload($id, $model)
return
$result
return
......@@ -222,8 +223,8 @@ for $node in $nodes return
$node/@width,
$node/@title,
attribute class {'imgLazy'},
attribute data-original { '/public/doku/' || $node/substring-after(@data-original, 'fontane:') },
attribute src {"/public/img/loader.svg"}
attribute data-original { 'public/doku/' || $node/substring-after(@data-original, 'fontane:') },
attribute src {"public/img/loader.svg"}
}, () )
case text() return
(: Circa 1,2 Mio mal wird hier replace() aufgerufen. :)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment