Ankur,

Note also that cq has a "content source" drop down that specifies both the 
database and app server. The app server is in parentheses at the end of the 
entry. The module root used to find the code you are importing is specified as 
part of the configuration of that app server.

The query will still run on the app server you are using to host cq, but the 
module lookups will be relative to the app server specified in the content 
source.

Yours,
Damon

From: [email protected] 
[mailto:[email protected]] On Behalf Of Danny Sokolsky
Sent: Friday, June 03, 2011 5:43 PM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] specifying path while importing module 
using cq

Hi Ankur,

This chapter in the Application Developer's Guide should help:

http://docs.marklogic.com/4.2doc/docapp.xqy#display.xqy?fname=http://pubs/4.2doc/xml/dev_guide/import_modules.xml

The short answer is that / resolves to the App Server root or the Modules 
directory.  You cannot put your code anywhere except the App Server root or the 
Modules directory (because it would violate the App Server security model).  If 
there is no / in your import path, it will attempt to resolve relative to the 
calling module.

So for example, if your App Server root is c:/my-root, you can put your library 
module called foo.xqy in c:/my-root/foo.xqy and import it with something like:

import module namespace foo="foo" at "/foo.xqy";

-Danny

From: [email protected] 
[mailto:[email protected]] On Behalf Of Ankur Acharya
Sent: Friday, June 03, 2011 1:38 PM
To: [email protected]
Subject: [MarkLogic Dev General] specifying path while importing module using cq

Disclaimer: This might be a very naive question to most of the readers.

I'm trying to import a module using the following code:

...
import module namespace conf = "http://foo.com/lib/config"; at "/lib/config.xqy";
...



When I copy it to the C:\ drive and rephrase the code to:
...
import module namespace conf = "http://foo.com/lib/config"; at 
"C:/lib/config.xqy";
...

I get an error saying: "1.0-ml] XDMP-IMPORTPATH: Invalid Module Import path: 
C:\lib\config.xqy"

I am unsure how the default path to /lib/config.xqy is set? I mean where on my 
physical drive do I need to copy the config.xqy file?

Thanks,
Ankur
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to