Hello,
I'd like to create and delete forests programmatically. Creation is fine,
and deletion kind of works ... but here is the problem:
If I call the script below via the ML ant task <ml:query> it returns
without error, but the forest still exists.
If I call the script from the query console, the forest gets deleted just
fine.
The XCC connection string used specifies the admin user for this task.
Also, all other tasks (database creation, deletion, attachment of database
to forest, etc.) using the same XCC connection all work fine, except the
forest deletion.
Thanks for any ideas you may have ...
cheers,
Jakob.
xquery version "1.0-ml";
(:
delete a forest and all its data
TODO: This doesn't actually delete an existing forest.
If you call this from within qconsole it works, though ...
I don't understand!
:)
import module namespace admin = "http://marklogic.com/xdmp/admin"
at "/MarkLogic/admin.xqy";
declare variable $forest-name as xs:string external;
(:
--------------------------------------------------------------------------
:)
(: delete forest
------------------------------------------------------------ :)
(:
--------------------------------------------------------------------------
:)
let $config := admin:get-configuration()
let $config := if (admin:forest-exists($config, $forest-name))
then
admin:forest-delete(
$config
,(admin:forest-get-id($config, $forest-name))
,fn:true() (: force data deletion :)
)
else
$config
(:
--------------------------------------------------------------------------
:)
(: commit changes
----------------------------------------------------------- :)
(:
--------------------------------------------------------------------------
:)
return admin:save-configuration($config);
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general