Commit 708ed3a8 authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

reconfigured modules

parent b0d82b62
......@@ -53,10 +53,14 @@ else if (contains($exist:path, "/$shared/")) then
</forward>
</dispatch>
else
let $path := "/../sade-projects/"|| $project || "/" || config:get("data-dir") || "/" || substring-after($exist:path, $project)
let $path := if( doc-available( $path ) ) then $path else "/../sade-projects/"|| $project || config:get("template") || substring-after($exist:path, $project)
return
(: everything else is passed through :)
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<cache-control cache="yes"/>
<forward url="../../../../sade-projects/{$project}/templates/tmpl1/{substring-after($exist:path, $project)}">
<forward url="{$path}">
<set-header name="Cache-Control" value="max-age=3600, must-revalidate"/>
</forward>
</dispatch>
......@@ -3,8 +3,7 @@ module namespace nav = "http://sade/tmpl-nav" ;
import module namespace console="http://exist-db.org/xquery/console";
import module namespace templates="http://exist-db.org/xquery/templates";
import module namespace config="http://exist-db.org/xquery/apps/config" at "../../core/config.xqm";
import module namespace fconfig="https://fontane-nb.dariah.eu/fontane-config" at "../../core/fconfig.xqm";
import module namespace config="http://textgrid.de/ns/SADE/config" at "../config/config.xqm";
(: TODO: Nav ohne Link :)
......@@ -14,11 +13,11 @@ declare
%templates:wrap
function nav:navitems($node as node(), $model as map(*)) as map(*) {
let $confLocation := fconfig:module-get($nav:module-key, "location")
let $confLocation := config:module-get($nav:module-key, "location")
let $navitems :=
if($confLocation != "") then
doc( fconfig:get('project-dir') || "/" || $confLocation)//navigation/*
doc( config:get('project-dir') || "/" || $confLocation)//navigation/*
else
$model("config")//module[string(@key)=$nav:module-key]//navigation/*
return map { "navitems" := $navitems }
......@@ -92,15 +91,15 @@ return
<textarea class="form-control" rows="10" name="new" />
<button type="submit" class="btn btn-primary">Save</button>
</form>
<pre>{serialize(doc('/sade-projects/' || fconfig:get("project-id") || '/navigation.xml'))}</pre>
<pre>{serialize(doc('/sade-projects/' || config:get("project-id") || '/navigation.xml'))}</pre>
</div>
else
let $item := xmldb:login('/sade-projects/' || fconfig:get("project-id"), fconfig:get("sade.user"), fconfig:get("sade.password")),
$egal := xmldb:store('/sade-projects/' || fconfig:get("project-id"), 'navigation.xml', $new, "text/xml")
let $item := xmldb:login('/sade-projects/' || config:get("project-id"), config:get("sade.user"), config:get("sade.password")),
$egal := xmldb:store('/sade-projects/' || config:get("project-id"), 'navigation.xml', $new, "text/xml")
return
<div><pre>{serialize(doc('/sade-projects/' || fconfig:get("project-id") || '/navigation.xml'))}</pre></div>
<div><pre>{serialize(doc('/sade-projects/' || config:get("project-id") || '/navigation.xml'))}</pre></div>
};
declare function nav:textgrid($node as node(), $model as map(*)) {
doc('/sade-projects/' || fconfig:get("project-id") || '/navigation-'|| fconfig:get("template") ||'.xml')
doc('/sade-projects/' || config:get("project-id") || '/navigation-'|| config:get("template") ||'.xml')
};
......@@ -11,6 +11,8 @@ import module namespace console="http://exist-db.org/xquery/console" at "java:or
import module namespace f-misc="http://fontane-nb.dariah.eu/ns/SADE/misc" at "fontane/misc.xqm";
import module namespace config="http://textgrid.de/ns/SADE/config" at "config/config.xqm";
import module namespace fsearch = "http://sade/faceted-search" at "faceted-search/faceted-search.xqm";
import module namespace nav="http://sade/tmpl-nav" at "tmpl-nav/tmpl-nav.xqm";
import module namespace wiki="http://textgrid.de/ns/SADE/wiki" at "wiki/wiki.xqm";
(:
: The following modules provide functions which will be called by the
......
Supports Markdown
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