Good summary as always Gert.

Just one correction; you can create directories with a call to 
xdmp:filesystem-directory-create() like this:

      xdmp:filesystem-directory-create( $dir,
        <options xmlns="xdmp:filesystem-directory-create">
          <create-parents>true</create-parents>
        </options>
      )

This will create the directory path specified in $dir and all parent 
directories if they don't already exist.

NOTE: xdmp:filesystem-directory-create is not [yet] a supported function but if 
it was removed from the xdmp library MarkLogic would have to rewrite their 
admin interfaces.

Keith L. Breinholt
ICS Content & Media
[email protected]<mailto:[email protected]>

-----Original Message-----

Message: 6
Date: Fri, 11 Sep 2009 13:09:45 +0200
From: Geert Josten <[email protected]>
Subject: RE: [MarkLogic Dev General] Operating system call from Xquery
To: General Mark Logic Developer Discussion
        <[email protected]>
Message-ID:
        <0260356c6dfe754ba6fa48e659a1433833364bf...@helios.olympus.borgus.nl>
Content-Type: text/plain; charset="Windows-1252"

Hi Chetan,

Sorry for the late reply.

> Is there a way to make system call from xquery like move
> files from one directory to another, call shell scripts etc?

MarkLogic has some filesystem functions. You can use xdmp:filesystem-directory 
to get file listings, use xdmp:filesystem-file to read a file as plain text, 
use xdmp:document-get/insert to get text, binary or xml and insert into the 
database (or use xdmp:document-load to do both in one call), and use xdmp:save 
to write information back to the file system.

A description of these functions can be found here:

http://developer.marklogic.com/pubs/4.1/apidocs/All.html

There is however no way to delete files or folders, nor a way to create 
directories that way. To my knowledge it is not possible to do system-calls 
from Xquery either, but you can delegate such tasks to a second webservice is 
you like. You could use MLJAM for that, but you have to consider security when 
taking this approach. More on MLJAM can be found here: 
http://developer.marklogic.com/code/

You might like to consider putting a Java-layer (or .Net-layer) between 
MarkLogic Server and the front-end. Then you can do filesystem stuff in there 
and do only database things in xquery.

> Can MarkLogic pull data from FTP site?

To my knowledge, no. But you could do that in the Java-layer as well. It can 
retrieve content through HTTP(S) though, perhaps that is a suitable alternative?

Kind regards,
Geert


Drs. G.P.H. Josten
Consultant


http://www.daidalos.nl/
Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665 JZ Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
http://www.daidalos.nl/
KvK 27164984
De informatie - verzonden in of met dit emailbericht - is afkomstig van 
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit 
bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit 
bericht kunnen geen rechten worden ontleend.


 NOTICE: This email message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information. Any unauthorized 
review, use, disclosure or distribution is prohibited. If you are not the 
intended recipient, please contact the sender by reply email and destroy all 
copies of the original message.


_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to