[MarkLogic Dev General] dls functions questions in MarkLogic 4.2
Danny.Sokolsky at marklogic.com
Thu Nov 10 10:18:52 PST 2011
It is hard to comment on the implementation here, as it really depends on how the functions get called.
Do you have a set of detailed steps for which you do not understand the results?
Also, keep in mind that you cannot have the admin role and use the dls functions—it is designed for non-admin role users (because users with the admin role can see and update everything).
From: general-bounces at developer.marklogic.com [mailto:general-bounces at developer.marklogic.com] On Behalf Of John Zhong
Sent: Wednesday, November 09, 2011 9:06 AM
To: general at developer.marklogic.com
Subject: Re: [MarkLogic Dev General] dls functions questions in MarkLogic 4.2
I want to recall this...or should I contact ML support?
On Thu, Nov 3, 2011 at 10:21 PM, John Zhong <john at yuxipacific.com<mailto:john at yuxipacific.com>> wrote:
I have two questions about the dls functions in MarkLogic 4.2-7 (I tried 4.2-3 before, I encountered the same behavior):
1, The first one is the dls:document-insert-and-manage, it supports to add the document into specify collections, but I found the version 1 document has not been added into the collections, while the main document has been added. Then I looked into the source code dls.xqy in MarkLogic install folder/Modules/MarkLogic, starts from line 119, after calling the dls-document-insert to insert the main document, it calls the _document-manage function to add the version document, there are two questions here:
a, the function document-insert-version will not be executed at line 1477, because the transaction, the main document has not been committed, so the fn:doc($uri) is empty. So I think this code is not necessary?
b, it calls the function document-insert-version again at line 1437, but also because the transaction, the xdmp:document-get-collections($uri) is empty too, so that is why the version document has not been added into the specify collections. I think we should pass the collections as parameter.
2, The second one is the dls:document-checkout-update-checkin, it also supports to add the updated document into specify collections, when I wanted to update the document to another collection, I found the main document keeps the old collections, while the version document has been added into the new collections. Then I looked at the same dls.xqy, starts from line 204, it calls the _document-update function at line 1383 to update the document, but it uses the xdmp:document-get-collections($uri) to get the OLD collections, that is why the updated main document keeps the old collections. I think we should use the $collections, which is the new collections.
Can someone confirm these?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the General