Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90009307
pre-install.xql
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Oct 28, 10:00
Size
1 KB
Mime Type
text/x-java
Expires
Wed, Oct 30, 10:00 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
21984263
Attached To
rTOPOTEI topoTEI
pre-install.xql
View Options
xquery version "1.0";
import module namespace xdb="http://exist-db.org/xquery/xmldb";
import module namespace console="http://exist-db.org/xquery/console";
import module namespace system="http://exist-db.org/xquery/system";
(: The following external variables are set by the repo:deploy function :)
(: file path pointing to the exist installation directory :)
declare variable $home external;
(: path to the directory containing the unpacked .xar package :)
declare variable $dir external;
(: the target collection into which the app is deployed :)
declare variable $target external;
declare function local:mkcol-recursive($collection, $components) {
if (exists($components)) then
let $newColl := concat($collection, "/", $components[1])
return (
xdb:create-collection($collection, $components[1]),
local:mkcol-recursive($newColl, subsequence($components, 2))
)
else
()
};
(: Helper function to recursively create a collection hierarchy. :)
declare function local:mkcol($collection, $path) {
local:mkcol-recursive($collection, tokenize($path, "/"))
};
(: store the collection configuration :)
local:mkcol("/db/system/config", $target),
local:mkcol(concat("/system/config", $target), "data"),
xdb:store-files-from-pattern(concat("/system/config", $target, "/data"), $dir, "collection.xconf")
Event Timeline
Log In to Comment