This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare variable $payload-status := '{"operation": "backup-status", "job-id" : "' || "8774639830166037592" || '","host-name": "' || xdmp:host-name() || '"}'; | |
xdmp:http-post("http://localhost:8002/manage/v2/databases/Documents?format=json", | |
<options xmlns="xdmp:http"> | |
<authentication method="digest"> | |
<username>admin</username> | |
<password>admin</password> | |
</authentication> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare variable $payload-status := '{"operation": "backup-database", "forest": ["Documents"], "backup-dir": "/tmp" }'; | |
xdmp:http-post("http://localhost:8002/manage/v2/databases/Documents?format=json", | |
<options xmlns="xdmp:http"> | |
<authentication method="digest"> | |
<username>admin</username> | |
<password>admin</password> | |
</authentication> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; | |
declare variable $config := admin:get-configuration(); | |
let $config := admin:group-add-trace-event($config, admin:group-get-id($config, "Default"), | |
( | |
admin:group-trace-event("Forest SetMasterInfo"), | |
admin:group-trace-event("Forest Mount"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare variable $DATABASE-NAME as xs:string := "Security-Extra"; | |
if (xdmp:database-name(xdmp:database()) eq $DATABASE-NAME ) | |
then( | |
for $i in cts:uris() | |
let $perm := xdmp:eval('xquery version "1.0-ml"; | |
declare variable $URI as xs:string external; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare function local:seq-contains($string as xs:string, $search-strings as xs:string+) as xs:boolean { | |
some $search-string in $search-strings satisfies ($string eq $search-string) | |
}; | |
declare variable $SECURITY-DATABASE-NAME as xs:string := "Security-Extra"; | |
declare variable $ML5-DEFAULT-SECURITY-URIS as xs:string+ := ( | |
"http://marklogic.com/xdmp/amps/10036407012685036038", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; | |
declare variable $PATH as xs:string := "/tmp"; | |
declare variable $NUMBER-OF-FORESTS as xs:integer := 4; | |
declare variable $FOREST-NAME as xs:string := "example-forest"; | |
declare variable $CONFIG := admin:get-configuration(); | |
for $i in 1 to $NUMBER-OF-FORESTS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
(:~ | |
: Security Module for creating the Generic Database Users and roles | |
: | |
: @version 1.0 | |
:) | |
import module namespace sec = "http://marklogic.com/xdmp/security" at "/MarkLogic/security.xqy"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare function local:create-html-payload() { | |
xdmp:set-response-content-type("text/html"), | |
for $a in (1 to 100) | |
return element p {"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae dolor. Nullam tristique diam non turpis. Cras placerat accumsan nulla. Nullam rutrum. Nam vestibulum accumsan nisl."} | |
}; | |
if(fn:contains(xdmp:get-request-header("Accept-Encoding"), "gzip")) | |
then( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare function local:create-html-payload() { | |
xdmp:set-response-content-type("text/html"), | |
for $a in (1 to 100) | |
return element p {"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae dolor. Nullam tristique diam non turpis. Cras placerat accumsan nulla. Nullam rutrum. Nam vestibulum accumsan nisl."} | |
}; | |
local:create-html-payload() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; | |
declare variable $config := admin:get-configuration(); | |
let $config := admin:group-add-trace-event($config, admin:group-get-id($config, "Default"), | |
( | |
admin:group-trace-event("SPARQL Describe Limit Off") | |
) |