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
fontane-notizbuecher
SADE-Project
Commits
ce3a80c2
Commit
ce3a80c2
authored
Apr 09, 2020
by
Mathias Goebel
Browse files
remove index conf and reindex from autostart
parent
9ccca840
Pipeline
#130747
passed with stages
in 3 minutes and 51 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
system/autostart/reindex.xq
View file @
ce3a80c2
xquery
version
"3.1"
;
let
$doc
:=
doc
(
"/db/system/config/db/sade-projects/textgrid/data/xml/data/collection.xconf"
)
/*
let
$tmp
:=
xmldb:store
(
"/db"
,
"tmp-collection.xconf"
,
$doc
)
let
$newdoc
:=
doc
(
$tmp
)
let
$log
:=
util:log-system-out
(
"Autostart: »Hello.«"
)
let
$credentials
:=
file:read
(
"/var/lib/textgrid/fontane/credentials.txt"
)
=>
tokenize
(
"\n"
)
let
$credentials
:=
file:read
(
"/var/lib/textgrid/fontane/credentials.txt"
)
=>
tokenize
(
"\n"
)
let
$configdoc
:=
doc
(
"/db/sade-projects/textgrid/config.xml"
)
let
$credentialInjection
:=
for
$line
at
$pos
in
$credentials
...
...
@@ -21,11 +15,7 @@ let $credentialInjection :=
case
4
return
update
replace
$configdoc
//
param
[
@key
=
"dokuwiki.user"
]
/
text
()
with
text
{
$line
}
case
5
return
update
replace
$configdoc
//
param
[
@key
=
"dokuwiki.password"
]
/
text
()
with
text
{
$line
}
default
return
false
()
let
$passwd
:=
sm:passwd
(
"admin"
,
$credentials
[
3
])
let
$
set
passwd
:=
sm:passwd
(
"admin"
,
$credentials
[
3
])
return
(
xmldb:remove
(
"/db/system/config/db/sade-projects/textgrid/data/xml/data"
,
"collection.xconf"
)
,
xmldb:store
(
"/db/system/config/db/sade-projects/textgrid/data/xml/data"
,
"collection.xconf"
,
$newdoc
)
,
xmldb:remove
(
"/db"
,
"tmp-collection.xconf"
)
)
,
xmldb:reindex
(
"/db/sade-projects/textgrid/data/xml/data"
)
true
()
\ No newline at end of file
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