help with a query

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

help with a query

rrodriguezIDIS
Sorry, but I'm not able to get a query getting this:

All comments added to XWiki users.

Please, could you help me?

Thank you very much,

Ricardo

--
Ricardo Rodríguez
Research Management and Promotion Technician
Technical Secretariat
Health Research Institute of Santiago de Compostela (IDIS)
http://www.idisantiago.es

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
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
--
Ricardo Rodríguez
Research Management and Promotion Technician
Technical Secretariat
Health Research Institute of Santiago de Compostela (IDIS)
http://www.idisantiago.es
Reply | Threaded
Open this post in threaded view
|

Re: help with a query

Sergiu Dumitriu-2
On 05/26/2012 07:29 PM, [hidden email] wrote:
> Sorry, but I'm not able to get a query getting this:
>
> All comments added to XWiki users.

Do you want to get the comments themselves as a whole, just the comment
body, or just the name of the user documents where comments have been added?

> Please, could you help me?
>
> Thank you very much,
>
> Ricardo
>
> --
> Ricardo Rodríguez
> Research Management and Promotion Technician
> Technical Secretariat
> Health Research Institute of Santiago de Compostela (IDIS)
> http://www.idisantiago.es
>
> 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


--
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: help with a query

rrodriguezIDIS
Thanks, Sergiu,

>> ________________________________________
>> From: [hidden email] [[hidden email]] On Behalf Of Sergiu Dumitriu [[hidden email]]
>> Sent: 27 May 2012 02:44
>> To: XWiki Users
>> Subject: Re: [xwiki-users] help with a query
>>
>> On 05/26/2012 07:29 PM, [hidden email] wrote:
> Sorry, but I'm not able to get a query getting this:
>
> All comments added to XWiki users.
>>
>> Do you want to get the comments themselves as a whole, just the comment
>> body, or just the name of the user documents where comments have been added?

First of all: the body of all comments liked to given group of users.

Then, I would like to understand how comments could be retrieve to have full control about what I'm getting. I do need all three queries you list, then I also like to be able to answer questions as:

1. Tabulated how many replies users posted in all pages of a given space like the one below on a per user/per page basis?
http://atriumkm.idisantiago.es/bin/OpenInitiative/InVitroPreclinicalModels2012

2. What is the name and the surname of the users holding a comment with a given string in one of her/his comments?

I found comments, spaces and groups really interesting "metaphors" available out of the box with XWiki to store different kinds of information without effort. But that effort must be done while retrieving it!!! All of these pieces of information could be stored in a more "structured" way designing ad hoc classes, creating "applications in a minute", and so on, so forth... but, for instance, comments, are really useful to make our mind about what we want to "translate" to an application.

I do hope this has sense for you! Thanks for your help!

> Please, could you help me?
>
> Thank you very much,
>
> Ricardo
>
> --
> Ricardo Rodríguez
> Research Management and Promotion Technician
> Technical Secretariat
> Health Research Institute of Santiago de Compostela (IDIS)
> http://www.idisantiago.es
>
> 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


--
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
users mailing list
[hidden email]
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
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
--
Ricardo Rodríguez
Research Management and Promotion Technician
Technical Secretariat
Health Research Institute of Santiago de Compostela (IDIS)
http://www.idisantiago.es
Reply | Threaded
Open this post in threaded view
|

Re: help with a query

rrodriguezIDIS
In reply to this post by Sergiu Dumitriu-2
Hi!

>> ________________________________________
>> From: [hidden email] [[hidden email]] On Behalf Of Sergiu Dumitriu [[hidden email]]
>> Sent: 27 May 2012 02:44
>> To: XWiki Users
>> Subject: Re: [xwiki-users] help with a query
>>
>> On 05/26/2012 07:29 PM, [hidden email] wrote:
> Sorry, but I'm not able to get a query getting this:
>
> All comments added to XWiki users.

>> Do you want to get the comments themselves as a whole, just the comment
>> body, or just the name of the user documents where comments have been added?

I've found this...

http://extensions.xwiki.org/xwiki/bin/Extension/Get+Last+Comment

Coming from this thread...

http://xwiki.markmail.org/thread/qwnwzoa23ewdt64w

Sorry, I should have found it before!

it requires programming rigths, but this is not a problem rigth now for us. What I'm not able to understand here is the role of setLimit(1). Please, check this...

http://atriumkm.idisantiago.es/bin/ICT/ListCommentsWithProgrammingRights

We get the same result by using or not using it. Please, what am I missing here?

Also, whatever value I use for setLimit(), I always get the first value in the list as ordered in the xwql statement.

I would not be hard to apply this query to all desired documents by looping through them. Please, is this the most effective/economic in terms of process work way of doing this query?


Thank you so much for your help!!!


> Please, could you help me?
>
> Thank you very much,
>
> Ricardo
>
> --
> Ricardo Rodríguez
> Research Management and Promotion Technician
> Technical Secretariat
> Health Research Institute of Santiago de Compostela (IDIS)
> http://www.idisantiago.es
>
> 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


--
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
users mailing list
[hidden email]
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
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
--
Ricardo Rodríguez
Research Management and Promotion Technician
Technical Secretariat
Health Research Institute of Santiago de Compostela (IDIS)
http://www.idisantiago.es
Reply | Threaded
Open this post in threaded view
|

Re: help with a query

Marius Dumitru Florea
On Sun, May 27, 2012 at 10:29 AM,
<[hidden email]> wrote:

> Hi!
>
>>> ________________________________________
>>> From: [hidden email] [[hidden email]] On Behalf Of Sergiu Dumitriu [[hidden email]]
>>> Sent: 27 May 2012 02:44
>>> To: XWiki Users
>>> Subject: Re: [xwiki-users] help with a query
>>>
>>> On 05/26/2012 07:29 PM, [hidden email] wrote:
>> Sorry, but I'm not able to get a query getting this:
>>
>> All comments added to XWiki users.
>
>>> Do you want to get the comments themselves as a whole, just the comment
>>> body, or just the name of the user documents where comments have been added?
>
> I've found this...
>
> http://extensions.xwiki.org/xwiki/bin/Extension/Get+Last+Comment
>
> Coming from this thread...
>
> http://xwiki.markmail.org/thread/qwnwzoa23ewdt64w
>
> Sorry, I should have found it before!
>

> it requires programming rigths, but this is not a problem rigth now for us. What I'm not able to understand here is the role of setLimit(1). Please, check this...

setLimit sets the maximum number of rows to return. In this case,
since the snippet is showing the last comment, the query needs to
return at most one row.

>
> http://atriumkm.idisantiago.es/bin/ICT/ListCommentsWithProgrammingRights
>
> We get the same result by using or not using it. Please, what am I missing here?
>

> Also, whatever value I use for setLimit(), I always get the first value in the list as ordered in the xwql statement.

Maybe you changed the query in the mean time, but I can see both
comments displayed when you don't set the limit.

Hope this helps,
Marius

>
> I would not be hard to apply this query to all desired documents by looping through them. Please, is this the most effective/economic in terms of process work way of doing this query?
>
>
> Thank you so much for your help!!!
>
>
>> Please, could you help me?
>>
>> Thank you very much,
>>
>> Ricardo
>>
>> --
>> Ricardo Rodríguez
>> Research Management and Promotion Technician
>> Technical Secretariat
>> Health Research Institute of Santiago de Compostela (IDIS)
>> http://www.idisantiago.es
>>
>> 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
>
>
> --
> Sergiu Dumitriu
> http://purl.org/net/sergiu/
> _______________________________________________
> users mailing list
> [hidden email]
> 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
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: help with a query

rrodriguezIDIS
>>>> ________________________________________
>>>> From: [hidden email] [[hidden email]] On Behalf Of Marius Dumitru Florea [[hidden email]]
>>>> Sent: 28 May 2012 08:48
>>>> To: XWiki Users
>>>> Subject: Re: [xwiki-users] help with a query
>>>>
>>>> On Sun, May 27, 2012 at 10:29 AM,
<[hidden email]> wrote:

> Hi!
>
>>> ________________________________________
>>> From: [hidden email] [[hidden email]] On Behalf Of Sergiu Dumitriu [[hidden email]]
>>> Sent: 27 May 2012 02:44
>>> To: XWiki Users
>>> Subject: Re: [xwiki-users] help with a query
>>>
>>> On 05/26/2012 07:29 PM, [hidden email] wrote:
>> Sorry, but I'm not able to get a query getting this:
>>
>> All comments added to XWiki users.
>
>>> Do you want to get the comments themselves as a whole, just the comment
>>> body, or just the name of the user documents where comments have been added?
>
> I've found this...
>
> http://extensions.xwiki.org/xwiki/bin/Extension/Get+Last+Comment
>
> Coming from this thread...
>
> http://xwiki.markmail.org/thread/qwnwzoa23ewdt64w
>
> Sorry, I should have found it before!
>

> it requires programming rigths, but this is not a problem rigth now for us. What I'm not able to understand here is the role of setLimit(1). Please, check this...

>>>> setLimit sets the maximum number of rows to return. In this case,
>>>> since the snippet is showing the last comment, the query needs to
>>>> return at most one row.

>
> http://atriumkm.idisantiago.es/bin/ICT/ListCommentsWithProgrammingRights
>
> We get the same result by using or not using it. Please, what am I missing here?
>

> Also, whatever value I use for setLimit(), I always get the first value in the list as ordered in the xwql statement.

>>>> Maybe you changed the query in the mean time, but I can see both
>>>> comments displayed when you don't set the limit.

Thanks, Marius. No, I didn't change the query. Please, see this...

$services.query.xwql($xwlquery).setLimit(1).execute().get(0) First
$services.query.xwql($xwlquery).execute().get(0) First

Only First (comment) is displayed in both cases. The first code lines includes setLimit(1) but the second one doesn't.

Please, where am I lost? Thanks!

>>>> Hope this helps,
>>>> Marius

>
> I would not be hard to apply this query to all desired documents by looping through them. Please, is this the most effective/economic in terms of process work way of doing this query?
>
>
> Thank you so much for your help!!!
>
>
>> Please, could you help me?
>>
>> Thank you very much,
>>
>> Ricardo
>>
>> --
>> Ricardo Rodríguez
>> Research Management and Promotion Technician
>> Technical Secretariat
>> Health Research Institute of Santiago de Compostela (IDIS)
>> http://www.idisantiago.es
>>
>> 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
>
>
> --
> Sergiu Dumitriu
> http://purl.org/net/sergiu/
> _______________________________________________
> users mailing list
> [hidden email]
> 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
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
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
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
--
Ricardo Rodríguez
Research Management and Promotion Technician
Technical Secretariat
Health Research Institute of Santiago de Compostela (IDIS)
http://www.idisantiago.es
Reply | Threaded
Open this post in threaded view
|

Re: help with a query

Marius Dumitru Florea
On Mon, May 28, 2012 at 11:54 PM,
<[hidden email]> wrote:

>>>>> ________________________________________
>>>>> From: [hidden email] [[hidden email]] On Behalf Of Marius Dumitru Florea [[hidden email]]
>>>>> Sent: 28 May 2012 08:48
>>>>> To: XWiki Users
>>>>> Subject: Re: [xwiki-users] help with a query
>>>>>
>>>>> On Sun, May 27, 2012 at 10:29 AM,
> <[hidden email]> wrote:
>> Hi!
>>
>>>> ________________________________________
>>>> From: [hidden email] [[hidden email]] On Behalf Of Sergiu Dumitriu [[hidden email]]
>>>> Sent: 27 May 2012 02:44
>>>> To: XWiki Users
>>>> Subject: Re: [xwiki-users] help with a query
>>>>
>>>> On 05/26/2012 07:29 PM, [hidden email] wrote:
>>> Sorry, but I'm not able to get a query getting this:
>>>
>>> All comments added to XWiki users.
>>
>>>> Do you want to get the comments themselves as a whole, just the comment
>>>> body, or just the name of the user documents where comments have been added?
>>
>> I've found this...
>>
>> http://extensions.xwiki.org/xwiki/bin/Extension/Get+Last+Comment
>>
>> Coming from this thread...
>>
>> http://xwiki.markmail.org/thread/qwnwzoa23ewdt64w
>>
>> Sorry, I should have found it before!
>>
>
>> it requires programming rigths, but this is not a problem rigth now for us. What I'm not able to understand here is the role of setLimit(1). Please, check this...
>
>>>>> setLimit sets the maximum number of rows to return. In this case,
>>>>> since the snippet is showing the last comment, the query needs to
>>>>> return at most one row.
>
>>
>> http://atriumkm.idisantiago.es/bin/ICT/ListCommentsWithProgrammingRights
>>
>> We get the same result by using or not using it. Please, what am I missing here?
>>
>
>> Also, whatever value I use for setLimit(), I always get the first value in the list as ordered in the xwql statement.
>
>>>>> Maybe you changed the query in the mean time, but I can see both
>>>>> comments displayed when you don't set the limit.
>
> Thanks, Marius. No, I didn't change the query. Please, see this...
>
> $services.query.xwql($xwlquery).setLimit(1).execute().get(0) First
> $services.query.xwql($xwlquery).execute().get(0) First
>
> Only First (comment) is displayed in both cases. The first code lines includes setLimit(1) but the second one doesn't.
>

> Please, where am I lost? Thanks!

It's simple. execute() returns a list:

['First']
['First', 'Second']

In both cases, the first item in the list obtained with get(0) is
'First'. There's nothing wrong with that. setLimit() sets the maximum
size of the returned list. In the first case the list has maximum one
element, and in the second case it has the size equal with the number
of matching rows found in the database.

Hope this helps,
Marius

>
>>>>> Hope this helps,
>>>>> Marius
>
>>
>> I would not be hard to apply this query to all desired documents by looping through them. Please, is this the most effective/economic in terms of process work way of doing this query?
>>
>>
>> Thank you so much for your help!!!
>>
>>
>>> Please, could you help me?
>>>
>>> Thank you very much,
>>>
>>> Ricardo
>>>
>>> --
>>> Ricardo Rodríguez
>>> Research Management and Promotion Technician
>>> Technical Secretariat
>>> Health Research Institute of Santiago de Compostela (IDIS)
>>> http://www.idisantiago.es
>>>
>>> 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
>>
>>
>> --
>> Sergiu Dumitriu
>> http://purl.org/net/sergiu/
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> 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
>> [hidden email]
>> http://lists.xwiki.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> [hidden email]
> 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
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: help with a query

rrodriguezIDIS

>>>>>> ________________________________________
>>>>>> From: [hidden email] [[hidden email]] On Behalf Of Marius Dumitru Florea [[hidden email]]
>>>>>> Sent: 29 May 2012 09:45
>>>>>> To: XWiki Users
>>>>>> Subject: Re: [xwiki-users] help with a query
>>>>>>
>>>>>> On Mon, May 28, 2012 at 11:54 PM,
<[hidden email]> wrote:

>>>>> ________________________________________
>>>>> From: [hidden email] [[hidden email]] On Behalf Of Marius Dumitru Florea [[hidden email]]
>>>>> Sent: 28 May 2012 08:48
>>>>> To: XWiki Users
>>>>> Subject: Re: [xwiki-users] help with a query
>>>>>
>>>>> On Sun, May 27, 2012 at 10:29 AM,
> <[hidden email]> wrote:
>> Hi!
>>
>>>> ________________________________________
>>>> From: [hidden email] [[hidden email]] On Behalf Of Sergiu Dumitriu [[hidden email]]
>>>> Sent: 27 May 2012 02:44
>>>> To: XWiki Users
>>>> Subject: Re: [xwiki-users] help with a query
>>>>
>>>> On 05/26/2012 07:29 PM, [hidden email] wrote:
>>> Sorry, but I'm not able to get a query getting this:
>>>
>>> All comments added to XWiki users.
>>
>>>> Do you want to get the comments themselves as a whole, just the comment
>>>> body, or just the name of the user documents where comments have been added?
>>
>> I've found this...
>>
>> http://extensions.xwiki.org/xwiki/bin/Extension/Get+Last+Comment
>>
>> Coming from this thread...
>>
>> http://xwiki.markmail.org/thread/qwnwzoa23ewdt64w
>>
>> Sorry, I should have found it before!
>>
>
>> it requires programming rigths, but this is not a problem rigth now for us. What I'm not able to understand here is the role of setLimit(1). Please, check this...
>
>>>>> setLimit sets the maximum number of rows to return. In this case,
>>>>> since the snippet is showing the last comment, the query needs to
>>>>> return at most one row.
>
>>
>> http://atriumkm.idisantiago.es/bin/ICT/ListCommentsWithProgrammingRights
>>
>> We get the same result by using or not using it. Please, what am I missing here?
>>
>
>> Also, whatever value I use for setLimit(), I always get the first value in the list as ordered in the xwql statement.
>
>>>>> Maybe you changed the query in the mean time, but I can see both
>>>>> comments displayed when you don't set the limit.
>
> Thanks, Marius. No, I didn't change the query. Please, see this...
>
> $services.query.xwql($xwlquery).setLimit(1).execute().get(0) First
> $services.query.xwql($xwlquery).execute().get(0) First
>
> Only First (comment) is displayed in both cases. The first code lines includes setLimit(1) but the second one doesn't.
>

> Please, where am I lost? Thanks!

>>>>>> It's simple. execute() returns a list:
>>>>>>
>>>>>> ['First']
>>>>>> ['First', 'Second']
>>>>>>
>>>>>> In both cases, the first item in the list obtained with get(0) is
>>>>>> 'First'. There's nothing wrong with that. setLimit() sets the maximum
>>>>>> size of the returned list. In the first case the list has maximum one
>>>>>> element, and in the second case it has the size equal with the number
>>>>>> of matching rows found in the database.

Great! Thanks for the explanation! I've added some more lines to check that I've perfectly understood the issue. So, setLimit() is used to recover a list as short as required to satisfy what we are looking for, the first or last comment on a row, and get(0) is used to get this single item.

http://atriumkm.idisantiago.es/bin/ICT/ListCommentsWithProgrammingRights

I do hope I'm able to remember all things I learn here!

Thanks for your help,

Ricardo

>>>>>>
>>>>>> Hope this helps,
>>>>>> Marius
>>>>>>
>
>>>>> Hope this helps,
>>>>> Marius
>
>>
>> I would not be hard to apply this query to all desired documents by looping through them. Please, is this the most effective/economic in terms of process work way of doing this query?
>>
>>
>> Thank you so much for your help!!!
>>
>>
>>> Please, could you help me?
>>>
>>> Thank you very much,
>>>
>>> Ricardo
>>>
>>> --
>>> Ricardo Rodríguez
>>> Research Management and Promotion Technician
>>> Technical Secretariat
>>> Health Research Institute of Santiago de Compostela (IDIS)
>>> http://www.idisantiago.es
>>>
>>> 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
>>
>>
>> --
>> Sergiu Dumitriu
>> http://purl.org/net/sergiu/
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> 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
>> [hidden email]
>> http://lists.xwiki.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> [hidden email]
> 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
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
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
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
--
Ricardo Rodríguez
Research Management and Promotion Technician
Technical Secretariat
Health Research Institute of Santiago de Compostela (IDIS)
http://www.idisantiago.es