@@ -2,21 +2,18 @@ xquery version "3.0";
2
2
3
3
module namespace wdbGS = "https://github.com/dariok/wdbplus/GlobalSettings" ;
4
4
5
- import module namespace wdb = "https://github.com/dariok/wdbplus/wdb" at "../modules/app.xqm" ;
6
- import module namespace console = "http://exist-db.org/xquery/console" ;
5
+ import module namespace config = "https://github.com/dariok/wdbplus/config" at "../modules/wdb-config.xqm" ;
7
6
8
- declare namespace config = "https://github.com/dariok/wdbplus/config" ;
9
7
declare namespace exgit = "http://exist-db.org/xquery/exgit" ;
10
8
declare namespace meta = "https://github.com/dariok/wdbplus/wdbmeta" ;
11
9
declare namespace system = "http://exist-db.org/xquery/system" ;
12
10
13
- declare function wdbGS:getRest ( $node as node (), $model as map (*) ) {
14
- <meta name = "rest" content = "{$wdb :restURL} " />
11
+ declare function wdbGS:getRest ( $node as node (), $model as map (*) ) as element (meta) {
12
+ <meta name = "rest" content = "{ $config :restURL } " />
15
13
};
16
14
17
15
declare function wdbGS:body ( $node as node (), $model as map (*) ) {
18
16
let $param := request:get-parameter ('job' , 'main' )
19
- let $metaFile := doc ('../config.xml' )
20
17
21
18
return switch ( $param )
22
19
case 'main' return
@@ -32,24 +29,24 @@ declare function wdbGS:body ( $node as node(), $model as map(*) ) {
32
29
</div>
33
30
34
31
case 'title' return
35
- local:titleForm ($metaFile )
32
+ local:titleForm ($config:configFile )
36
33
37
34
case 'chgTitle' return
38
- let $u1 := update replace $metaFile //config:meta/config:name
35
+ let $u1 := update replace $config:configFile //config:meta/config:name
39
36
with <name xmlns = "https://github.com/dariok/wdbplus/config" >{request:get-parameter ('longTitle' , '' )}</name>
40
- let $u1 := update replace $metaFile //config:meta/config:short
37
+ let $u1 := update replace $config:configFile //config:meta/config:short
41
38
with <short xmlns = "https://github.com/dariok/wdbplus/config" >{request:get-parameter ('shortTitle' , '' )}</short>
42
- return local:titleForm ($metaFile )
39
+ return local:titleForm ($config:configFile )
43
40
44
41
case 'role' return
45
- local:roleForm ($metaFile )
42
+ local:roleForm ($config:configFile )
46
43
47
44
case 'chgRole' return
48
- let $u1 := update replace $metaFile //config:role/config:type
45
+ let $u1 := update replace $config:configFile //config:role/config:type
49
46
with <type xmlns = "https://github.com/dariok/wdbplus/config" >{request:get-parameter ('role' , '' )}</type>
50
- let $u1 := update replace $metaFile //config:role/config:other
47
+ let $u1 := update replace $config:configFile //config:role/config:other
51
48
with <other xmlns = "https://github.com/dariok/wdbplus/config" >{request:get-parameter ('other' , '' )}</other>
52
- return local:roleForm ($metaFile )
49
+ return local:roleForm ($config:configFile )
53
50
54
51
default return
55
52
<div>
@@ -58,23 +55,23 @@ declare function wdbGS:body ( $node as node(), $model as map(*) ) {
58
55
</div>
59
56
};
60
57
61
- declare function local:titleForm ($metaFile ) {
58
+ declare function local:titleForm ($config:configFile ) {
62
59
<div>
63
60
<h3>Titeldaten verändern</h3>
64
61
<form action = "global.html" >
65
62
<input type = "hidden" name = "job" value = "chgTitle" />
66
63
<label style = "width: 100%" >Titel: <input type = "text" name = "longTitle"
67
- value = "{$metaFile //config:meta/config:name} " /></label><br />
64
+ value = "{$config:configFile //config:meta/config:name} " /></label><br />
68
65
<label style = "width: 100%" >Kurztitel: <input type = "text" name = "shortTitle"
69
- value = "{$metaFile //config:meta/config:short} " /></label><br />
66
+ value = "{$config:configFile //config:meta/config:short} " /></label><br />
70
67
<input type = "submit" />
71
68
</form>
72
69
</div>
73
70
};
74
71
75
- declare function local:roleForm ($metaFile ) {
76
- let $role := $metaFile //config:role/config:type
77
- let $other := $metaFile //config:role/config:other
72
+ declare function local:roleForm ($config:configFile ) {
73
+ let $role := $config:configFile //config:role/config:type
74
+ let $other := $config:configFile //config:role/config:other
78
75
79
76
return
80
77
<div>
@@ -85,7 +82,7 @@ declare function local:roleForm($metaFile) {
85
82
<select name = "role" >
86
83
<option value = "standalone" >{if ($role = 'standalone' ) then attribute selected {'selected' } else () }Standalone</option>
87
84
<option value = "workbench" >{if ($role = 'workbench' ) then attribute selected {'selected' } else () }Workbench</option>
88
- <option value = "publisher" >{if ($role = 'publisher' ) then attribute selected {'selected' } else ()}Publikationsumgebung</option>
85
+ <option value = "publisher" >{if ($role = 'publisher' ) then attribute selected {'selected' } else () }Publikationsumgebung</option>
89
86
</select>
90
87
</label><br />
91
88
<label>zugehörige Instanz: <input type = "text" name = "other" value = "{$other} " /></label><br />
@@ -95,5 +92,5 @@ declare function local:roleForm($metaFile) {
95
92
};
96
93
97
94
declare function wdbGS:ingest ($node as node (), $model as map (*)) {
98
- <a href = "directoryForm.html?ed={doc ($wdb :data || '/wdbmeta.xml' )/meta:projectMD/@xml:id} " >bestehendes Projekt hochladen</a>
99
- };
95
+ <a href = "directoryForm.html?ed={doc ($config :data || '/wdbmeta.xml' )/meta:projectMD/@xml:id} " >bestehendes Projekt hochladen</a>
96
+ };
0 commit comments