Commit f5efb5a9 authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

existdb 5 compatibility

parent dec41953
......@@ -78,10 +78,11 @@ declare variable $config:project :=
let $value:= try { request:get-url() => substring-after("SADE/") => substring-before("/") } catch * { "textgrid" }
return if($value="") then "textgrid" else $value;
declare variable $config:configDoc := doc( $config-params:projects-dir || $config:project || "/config.xml" );
declare variable $config:configMap := map:new(
for $param in $config:configDoc/config/*[./@key]
return map:entry(string($param/@key), string($param))
);
declare variable $config:configMap :=
map:merge(
for $param in $config:configDoc/config/*[./@key]
return map:entry(string($param/@key), string($param))
);
declare function config:get($key as xs:string) as xs:string {
let $return :=
......@@ -95,7 +96,7 @@ return
then $return
else
let $doc := doc( $config-params:projects-dir || $config:project || "/config.xml" )
let $map := map:new(for $param in $doc/config/*[./@key] return map:entry(string($param/@key), string($param)))
let $map := map:merge( for $param in $doc/config/*[./@key] return map:entry(string($param/@key), string($param)))
return
switch ($key)
case "data-dir" return $config-params:projects-dir || $config:project || "/" || $map($key)
......
......@@ -162,7 +162,7 @@ function fsearch:result-id($node as node(), $model as map(*)) {
};
declare function fsearch:facets($model as map(*), $hits) as map() {
map:new(
map:merge(
for $facet in $config:configDoc//module[@key="faceted-search"]//facet
return
map:entry(xs:string($facet/@key), local:facet($model, $hits, $facet/@key, $facet//xpath/text()))
......
......@@ -125,7 +125,7 @@ declare function ixp:main-map($index as xs:string+)
as map() {
let $nodes := ixp:getNodes()
return
map:new(
map:merge(
for $n in 1 to array:size($nodes)
let $node := $nodes?($n)
let $localId := string-join(($node/local-name(), $node/@type), "-")
......@@ -146,11 +146,11 @@ map:new(
return
map:entry(
$localId,
map:new((
map:merge(
map:entry("content", $content)
))
)
)
)
)
};
declare function ixp:main-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