Hi Ricardo I just realised that the problem is, that there are more than two comments. So the query will find two comments that satisfies your ristrictions, even though there are more objects which do not. So e.g. comm1 and comm2 are both objects of the type XWD_ID:416379378 Gender:xxxxxxxx Withdrawal:20121017 Formely:XWiki.XWikiIDISE001 The solution is to write a query like this (unfortunately I can't tell you the exact XWQL syntax, I'm not even sure if this is possible in XWQL. So this is just pseudo code): .... and comm1.comment like '%$doc.title%' and 0=(select count(*) ..... where comm2.comment not like '%Withdrawal:2011%') I hope this is possible and you (or somebody else) knows or finds the exact syntax Edo On Wed, May 22, 2013 at 5:26 PM, < [email protected]> wrote:
Hi! Thanks you both for answering!
I'm afraid that your proposals didn't solve the problem. Please, see here...
http://www.idisantiago.es/bin/XWQL/SnapshotE0012012
Both users have three comments each. This way:
XWD_ID:416379378 Gender:xxxxxxxx Withdrawal:20121017 Formely:XWiki.XWikiIDISE001
XWD_ID:946660794 Gender:xxxxxxxx Withdrawal:20111231 Formely:XWiki.XWikiIDISE001
Thus, I'm still not able to design a query to retrive ONLY user XWD_ID:416379378 based on comments :-( Your proposals answer with a list including both users n times. I'm not able neither of explain n in both cases... any idea will be welcome!
Thank you very much for your help,
Ricardo
________________________________________ From: [email protected] [[email protected]] On Behalf Of Guillaume "Louis-Marie" Delhumeau [[email protected]] Sent: 22 May 2013 13:02 To: XWiki Users Subject: Re: [xwiki-users] XWQL query on several objects of the same class instantiated in the same doc
Hi Ricardo and Edo,
2013/5/22 Edo Beutler <[email protected]>
Hi Ricardo
You are only checking in one object. So there has to be one object that contains the doc name, but not the withdrawal part which is fulfilled by the third object in your example. Whilst I don't recall ever having tried checking for multiple objects in XWQL, I would suspect this should work:
#set ($xwlquery1 = "from doc.object(XWiki.XWikiComments) as comm1, doc.object(XWiki.XWikiComments) as comm2 where doc.translation = 0 and comm1.comment like '%$doc.title%' and comm2.comment not like '%Withdrawal:2011%'")
You are right. But I think you should add "comm1 <> comm2" in your query to make it work.
Louis-Marie _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Nota: A información contida nesta mensaxe e os seus posibles documentos adxuntos é privada e confidencial e está dirixida únicamente ó seu destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, por favor elimínea. A distribución ou copia desta mensaxe non está autorizada.
Nota: La información contenida en este mensaje y sus posibles documentos adjuntos es privada y confidencial y está dirigida únicamente a su destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, por favor elimínelo. La distribución o copia de este mensaje no está autorizada.
See more languages: http://www.sergas.es/aviso_confidencialidad.htm _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users