Hi Geert,

According to your conclusion, I will rewrite my code.

But I'm quite confused by this functionality, because querying relies on whether I asked some document to be managed or not. So result may be inconsistent.
I admit that if this process seem's natural for me, I'm not expected the same from everybody. So I will do the stuff to check "a priori" if a document is managed and then constraint the search on document-query or not.

something like :

fn:doc()[(dls:document-is-managed(base-uri(.)) = false()) or (cts:contains(., dls:documents-query()))]//value

Anyway, thank you for your answer

Thanks
Stéphane

Le 28 janv. 2011 à 10:41, Geert Josten a écrit :

Hi Stéphane,
 
The DLS library is implemented as an XQuery function module, it is not backed by core functionality for versioning. It really expects that all document access goes through the DLS library. There might be ways around, but they are cumbersome. I could imagine that you remove all read permissions from all non-HEAD versions, but you will have to add them again each time you would like to access the history. It also requires you are not running with the admin account, which by-passes all the permission stuff..
 
In short, rewriting the code sounds like the easiest solution.
 
Kind regards,
Geert
 
Van: [email protected] [mailto:[email protected]] Namens Stephane Toussaint
Verzonden: vrijdag 28 januari 2011 10:32
Aan: General MarkLogic Developer Discussion
Onderwerp: Re: [MarkLogic Dev General] Hide managed document versions in query result
 
Hi Danny,
 
Thanks for your answer.
 
Your right, 
 
fn:doc()[cts:contains(., dls:documents-query())]//value
 
works as
 
cts:search(doc(), dls:documents-query())//value
 
But both solutions are not really what I wan't because all my queries are already written, and I don't expect to rewrite them all. Maybe it is a philosophical point of view question, but I was expected that :
 
- A simple call to native functions as fn:doc() will simply return the HEAD version of every documents in database.
- The explicit use of the dls module, will permits access to every documents versions.
 
Is there any way to do that by configuration (security constraints for instance ?)
 
Thanks
 
Stéphane
 
 
 
Le 25 janv. 2011 à 20:49, Danny Sokolsky a écrit :


I think maybe the following will  work:
 
fn:doc()[cts:contains(., dls:documents-query())]//value
 
-Danny
 
From: [email protected] [mailto:[email protected]] On Behalf Of Stephane Toussaint
Sent: Tuesday, January 25, 2011 3:18 AM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Hide managed document versions in query result
 
Hi,
 
I start playing a bit with the DLS library because I want to keep an history of version modification.
The version management works well but now I'm facing a new problem.
 
My queries aren't returning only the last version matching documents, but every single version matching the current query.
Is there an unobtrusive way to hide version result (without explicitly use cst:search with dls:documents-query()) ?
 
For exemple I want that :
 
doc()//value
 
return 
<value>TEST1</value>
<value>TEST3</value>
<value>TEST2</value>
<value>TEST4</value>
and not
 
<value>TEST1</value>
<value>TEST1</value>
<value>TEST3</value>
<value>TEST2</value>
<value>TEST4</value>
because document containing TEST1 is currently managed.
 
Thanks
Stéphane
 
<image001.jpg>
Stéphane TOUSSAINT
XMS Technical Product Leader
Tel : 01.61.08.50.30
Std : 01.61.08.50.20
Fax : 01.61.38.24.41
 
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general
 
<image001.jpg>
Stéphane TOUSSAINT
XMS Technical Product Leader
Tel : 01.61.08.50.30
Std : 01.61.08.50.20
Fax : 01.61.38.24.41
 
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general


Stéphane TOUSSAINT
XMS Technical Product Leader
Tel : 01.61.08.50.30
Std : 01.61.08.50.20
Fax : 01.61.38.24.41

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

Reply via email to