Commit 9c983c68 authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

existdb 5 compatibility

parent 56c0f9df
Pipeline #130487 passed with stages
in 11 minutes and 15 seconds
......@@ -16,11 +16,11 @@ let $target := $beacon[starts-with(., "#TARGET:")] => substring-after(": ")
(: should return something like "http://www.deutsche-biographie.de/pnd{ID}.html#adbcontent"
: where «{ID}» is to be replaced by the GND ID :)
let $replacement := "\{ID\}"
return map:new(
return map:merge(
for $i in $beacon[not(starts-with(., "#"))][not(starts-with(., "("))][. != ""]
return
map:entry($i, replace($target, $replacement, $i))
)
)
let $merge := map:merge($maps)
return
......
......@@ -52,7 +52,7 @@ let $cleanup := local:remove-old-stuff($dataPath)
let $prefixes := (//tei:listPrefixDef[(.//@replacementPattern/contains(., "textgrid:")) = true()])/tei:prefixDef
let $map :=
map:new(
map:merge(
$prefixes !
map:entry(string(./@ident), $dataPath || substring(./@replacementPattern, 10, 5) || ".xml")
)
......
......@@ -42,7 +42,7 @@ let $cleanup := update delete //tei:linkGrp//comment()[contains(., "Notizbuch ")
(: map prefixes to index documents :)
let $prefixes := (//tei:listPrefixDef[(.//@replacementPattern/contains(., "textgrid:")) = true()])/tei:prefixDef
let $map :=
map:new(
map:merge(
$prefixes !
map:entry(string(./@ident), $dataPath || substring(./@replacementPattern, 10, 5) || ".xml")
)
......
......@@ -14,9 +14,9 @@ let $dataPath := "/db/sade-projects/textgrid/data/xml/data/"
(: map prefixes to index documents :)
let $prefixes := (//tei:listPrefixDef[(.//@replacementPattern/contains(., "textgrid:")) = true()])/tei:prefixDef
let $map :=
map:new(
map:merge(
$prefixes !
map:entry(string(./@ident), $dataPath || substring(./@replacementPattern, 10, 5) || ".xml")
map{ string(./@ident): $dataPath || substring(./@replacementPattern, 10, 5) || ".xml"}
)
(: collect available entities from the index :)
......
......@@ -14,7 +14,7 @@ let $collection := collection($dataPath)
(: map prefixes to index documents :)
let $prefixes := ($collection//tei:listPrefixDef[(.//@replacementPattern/contains(., "textgrid:")) = true()])/tei:prefixDef
let $map :=
map:new(
map:merge(
$prefixes !
map:entry(string(./@ident), $dataPath || substring(./@replacementPattern, 10, 5) || ".xml")
)
......
......@@ -126,7 +126,7 @@ let $login := xmldb:login("/db", "admin", "")
(: map prefixes to index documents :)
let $prefixes := ($collection//tei:listPrefixDef[(.//@replacementPattern/contains(., "textgrid:")) = true()])/tei:prefixDef
let $map :=
map:new(
map:merge(
$prefixes !
map:entry(string(./@ident), $dataPath || substring(./@replacementPattern, 10, 5) || ".xml")
)
......
......@@ -80,9 +80,11 @@ declare variable $credentialInjection :=
declare variable $configdoc := doc( "/db/sade-projects/textgrid/config.xml" );
declare variable $config := map:new(for $param in $configdoc/config/param
return map:entry(string($param/@key), string($param))
);
declare variable $config :=
map:merge(
for $param in $configdoc/config/param
return map:entry(string($param/@key), string($param))
);
declare variable $postinstall-log := util:log-system-out("webauth: "||$config("textgrid.webauth"));
......
......@@ -25,7 +25,7 @@ declare variable $img := request:get-parameter("img", "textgrid:164h2.1");
declare variable $surfaces := collection('/db/sade-projects/textgrid/data/xml/data/')//tei:sourceDoc/tei:surface[ends-with(@facs, substring-before($img, "."))];
declare variable $xywh :=
map:new(
map:merge(
for $surface in $surfaces
let $iiifUrlArr := fontaneTransfo:digilib($surface) => tokenize('/')
let $pctArr := $iiifUrlArr[starts-with(., 'pct:')] => substring(5) => tokenize(',')
......
......@@ -6,9 +6,10 @@ import module namespace tgclient="http://textgrid.info/namespaces/xquery/tgclien
declare namespace tgmd="http://textgrid.info/namespaces/metadata/core/2010";
declare variable $configdoc := doc( "/db/sade-projects/textgrid/config.xml" );
declare variable $config := map:new(for $param in $configdoc//param
return map:entry(string($param/@key), string($param))
);
declare variable $config :=
map:merge( for $param in $configdoc//param
return map:entry(string($param/@key), string($param))
);
declare variable $sid :=
tgclient:getSid(
$config("textgrid.webauth"),
......
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