简体   繁体   English

我可以使用Eclipse XQDT调试Marklogic模块/ xquery吗?

[英]Can I use Eclipse XQDT to debug Marklogic modules/xquery?

Hi Markloggers out there, 嗨,Markloggers,

I am working now a coupe of months with Marklogic, developping xquery, modules, applications on the ML app server etc etc. I use eclipse a lot, I have XQDT up and running for several marklogic servers. 我现在与Marklogic合作,工作了几个月,开发ML应用程序服务器上的xquery,模块,应用程序等。我经常使用eclipse,我为多个marklogic服务器启动并运行了XQDT。 We use the console also. 我们也使用控制台。

What I miss is a debug functionality... in Eclispe with XQDT I cannot get the debug function working? 我错过的是调试功能...在带有XQDT的Eclispe中,我无法使调试功能正常工作?

What I need is a nice and clean way to quickly test and develop modelules and functions... This is my basic lib from the ML example documentation: 我需要的是一种很好的方法,可以快速测试和开发模型和函数...这是我来自ML示例文档的基本库:

xquery version "1.0-ml";

module namespace lib = 'http://www.example.com/lib';

declare function lib:user()
{
xdmp:get-current-user()
};

I have this is my XQDT project in eclipse, I have setup a marklogic XDBC server locally and it works ok. 我有这是我在Eclipse中的XQDT项目,我已经在本地设置了marklogic XDBC服务器,并且工作正常。

Now I want to use the above module from a file again in the XQDT project in eclipse. 现在,我想在Eclipse的XQDT项目中再次使用文件中的上述模块。 But without going to steps of uploading the module to the db etc etc...: 但是无需执行将模块上传到数据库等步骤...

(: XQuery main module :)

import module namespace lib = 'http://www.example.com/lib' at 'lib.xq';

lib:user() 

Gives: 得到:

XDMP-MODNOTFOUND: (err:XQST0059) Module /lib.xq not found

Question 1: Is there a way to find the module without putting it in a module root? 问题1:有没有找到模块而不将其放在模块根目录中的方法? In the docs it says from a XQDT project I could source a module but I cannot get it to work... 在文档中说它可以从XQDT项目中获取模块,但无法使它正常工作...

Question 2: I can execute arbitrary xquery to the local Marklogic server but if I set a debug flag anywhere in a xgy file in the XQDT project and press the debug button I get a popup saying "The Debug Engine is not properly configured". 问题2:我可以对本地Marklogic服务器执行任意xquery,但是如果我在XQDT项目的xgy文件中的任何位置设置调试标志,然后按调试按钮,则会弹出一个对话框,提示“调试引擎配置不正确”。 Can anyone explain to me if it is possible to use the debug option in eclipse XQDT with Marklogic 7 ? 谁能向我解释是否可以在带有Marklogic 7的Eclipse XQDT中使用debug选项? Regards, 问候,

hugo 雨果

It's best to limit yourself to one question per SO post. 最好每个SO帖子限制自己一个问题。 After all you can only accept one answer. 毕竟,您只能接受一个答案。

Now I want to use the above module from a file again in the XQDT project in eclipse. 现在,我想在Eclipse的XQDT项目中再次使用文件中的上述模块。 But without going to steps of uploading the module to the db etc 但是无需执行将模块上传到数据库等步骤

That's a problem. 那是个问题。 You can evaluate an ad-hoc query directly. 您可以直接评估即席查询。 But if it references a library module, that library module needs to be available to the server. 但是,如果它引用一个库模块,则该库模块需要对服务器可用。 You're going to have to copy it to the server sooner or later anyhow, so do it sooner. 无论如何,您迟早都必须将其复制到服务器,因此请尽早进行。 I don't use an IDE myself, but can't you set it up to do that for you? 我自己没有使用IDE,但是您不能设置它为您这样做吗?

Question 1: Is there a way to find the module without putting it in a module root? 问题1:有没有找到模块而不将其放在模块根目录中的方法?

Not in the broadest sense of "module root", no. 从广义上讲,不是“模块根”。 The docs at https://docs.marklogic.com/guide/app-dev/import_modules talk about how this works. https://docs.marklogic.com/guide/app-dev/import_modules上的文档讨论了其工作原理。 Somehow or other, you need to make the library module available to MarkLogic. 无论如何,您都需要使库模块可用于MarkLogic。

I can't address your last question. 我无法解决您的最后一个问题。 I don't use an IDE, and even if I did I probably wouldn't use a debugger. 我不使用IDE,即使这样做,我也可能不会使用调试器。 Instead I xdmp:log messages to ErrorLog.txt , and occasionally I'll plant an breakpoint-like error() call in my code. 相反,我将xdmp:log消息发送到ErrorLog.txt ,有时我会在代码中xdmp:log类似于断点的error()调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM