Perhaps not exactly what you're looking for, but possibly useful, the script 
below creates a forest, creates a database, attaches the forest to the 
database, and sets up an http app server. 

One way to use it is to copy and paste it into CQ, edit the forest name, edit 
the database name, edit the http app server name, edit the port number, edit 
the directory path, press XML to execute the code, and then see that they were 
all set up by going into the Admin Interface (if desired).

---


(: forest :)

xquery version "1.0-ml";

import module namespace admin = "http://marklogic.com/xdmp/admin"; at 
"/MarkLogic/admin.xqy";

let $config := admin:get-configuration()

let $config := admin:forest-create(
  $config, 
  "playground",
  xdmp:host(), 
  ())

return admin:save-configuration($config);




(: database :)

xquery version "1.0-ml";

import module namespace admin = "http://marklogic.com/xdmp/admin"; at 
"/MarkLogic/admin.xqy";

let $config := admin:get-configuration()

let $config := admin:database-create(
  $config,
  "playground",
  xdmp:database("Security"),
  xdmp:database("Schemas"))

return admin:save-configuration($config);




(: attach forest to database :)


xquery version "1.0-ml";

import module namespace admin = "http://marklogic.com/xdmp/admin"; at 
"/MarkLogic/admin.xqy";

let $config := admin:get-configuration()

let $config := admin:database-attach-forest(
  $config,
  xdmp:database("playground"), 
  xdmp:forest("playground"))

return admin:save-configuration($config);



(: application server :)

xquery version "1.0-ml";

import module namespace admin = "http://marklogic.com/xdmp/admin"; at 
"/MarkLogic/admin.xqy";

let $config := admin:get-configuration()

let $groupid := admin:group-get-id($config, "Default")

let $server := admin:http-server-create(
  $config, 
  $groupid,
  "8041-playground", 
  "C:\mls-projects\playground",
  8041,
  0,
  admin:database-get-id($config, "playground"))

return admin:save-configuration($server)

 

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Andrew Welch
Sent: Tuesday, March 02, 2010 8:42 AM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] user installation using a query

Hi,

It seems that everything you can do through the admin screen you can
do through a query... so rather give the customer a list of steps to
follow (create http server, create webdav server etc), I can shield
them from the admin screens and give them a query to run instead.

The question is, what is the user-friendliest way for them to run that
xquery, when the person installing the application is likely to know
very little about MarkLogic?

Is using the Docs dir the best way:

1) Install MarkLogic
2) copy the "install.xqy" to [install dir]/Docs
2) navigate to [hostname]:8000/install.xqy

...or is there another way?



thanks
-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to