Commit 1664fe4d authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

tg mirador in iframe based on sandbox data

parent e69cc1f2
......@@ -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(*)) {
......@@ -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(*) ){
......
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