Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SADE
SADE
Commits
708ed3a8
Commit
708ed3a8
authored
May 10, 2017
by
Mathias Goebel
Browse files
reconfigured modules
parent
b0d82b62
Changes
3
Hide whitespace changes
Inline
Side-by-side
controller.xql
View file @
708ed3a8
...
...
@@ -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>
modules/tmpl-nav/tmpl-nav.xqm
View file @
708ed3a8
...
...
@@ -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 :=
f
config:module-get($nav:module-key, "location")
let $confLocation := config:module-get($nav:module-key, "location")
let $navitems :=
if($confLocation != "") then
doc(
f
config: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/' ||
f
config: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/' ||
f
config:get("project-id"),
f
config:get("sade.user"),
f
config:get("sade.password")),
$egal := xmldb:store('/sade-projects/' ||
f
config: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/' ||
f
config: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/' ||
f
config:get("project-id") || '/navigation-'||
f
config:get("template") ||'.xml')
doc('/sade-projects/' || config:get("project-id") || '/navigation-'|| config:get("template") ||'.xml')
};
modules/view.xql
View file @
708ed3a8
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment