You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Joshi, Suhas D" <su...@merck.com> on 2010/01/19 23:41:33 UTC

Retrieving a fixed number of nodes

Hello:

I am implementing an interactive and user interface driven "list"
function with Apache Jackrabbit. The repository has thousands of nodes
but I want to retrieve only the first 100 nodes. When the user presses
the "Next" button then I will retrieve the next 100 nodes, and so on. 

Is it possible to do that through the Query language? How? 

Thanks in advance.

Suhas Joshi
MRL Information Technology
Merck & Co., Inc.
126 E. Lincoln Ave
Rahway, NJ 07065
+1 732.594.1558 w
Suhas_Joshi@Merck.com



Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.

Re: Retrieving a fixed number of nodes

Posted by Marcel Reutegger <ma...@gmx.net>.
Hi,

there is no query language support for this. but the API has methods
for this use case.

see:
http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/query/Query.html#setLimit(long)
http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/query/Query.html#setOffset(long)

regards
 marcel

On Wed, Jan 20, 2010 at 13:45, Michael Coldewey <po...@coldy.de> wrote:
>
> Hello,
>
> I am also interested in this topic. The only way that I found, was, to set
> the Limit in the Query Object with qu.setLimit(100) e.g.
>
> Is there a way to define the limit within the xpath-query?
>
> Greetings,
> Michael Coldewey
>
> On Tue, 19 Jan 2010 17:41:33 -0500, "Joshi, Suhas D"
> <su...@merck.com>
> wrote:
>> Hello:
>>
>> I am implementing an interactive and user interface driven "list"
>> function with Apache Jackrabbit. The repository has thousands of nodes
>> but I want to retrieve only the first 100 nodes. When the user presses
>> the "Next" button then I will retrieve the next 100 nodes, and so on.
>>
>> Is it possible to do that through the Query language? How?
>>
>> Thanks in advance.
>>
>> Suhas Joshi
>> MRL Information Technology
>> Merck & Co., Inc.
>> 126 E. Lincoln Ave
>> Rahway, NJ 07065
>> +1 732.594.1558 w
>> Suhas_Joshi@Merck.com
>>
>>
>>
>> Notice:  This e-mail message, together with any attachments, contains
>> information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
> New
>> Jersey, USA 08889), and/or its affiliates Direct contact information for
>> affiliates is available at http://www.merck.com/contact/contacts.html)
> that
>> may be confidential, proprietary copyrighted and/or legally privileged.
> It
>> is intended solely for the use of the individual or entity named on this
>> message. If you are not the intended recipient, and have received this
>> message in error, please notify us immediately by reply e-mail and then
>> delete it from your system.
>

Re: Retrieving a fixed number of nodes

Posted by Michael Coldewey <po...@coldy.de>.
Hello,

I am also interested in this topic. The only way that I found, was, to set
the Limit in the Query Object with qu.setLimit(100) e.g.

Is there a way to define the limit within the xpath-query? 

Greetings,
Michael Coldewey

On Tue, 19 Jan 2010 17:41:33 -0500, "Joshi, Suhas D"
<su...@merck.com>
wrote:
> Hello:
> 
> I am implementing an interactive and user interface driven "list"
> function with Apache Jackrabbit. The repository has thousands of nodes
> but I want to retrieve only the first 100 nodes. When the user presses
> the "Next" button then I will retrieve the next 100 nodes, and so on. 
> 
> Is it possible to do that through the Query language? How? 
> 
> Thanks in advance.
> 
> Suhas Joshi
> MRL Information Technology
> Merck & Co., Inc.
> 126 E. Lincoln Ave
> Rahway, NJ 07065
> +1 732.594.1558 w
> Suhas_Joshi@Merck.com
> 
> 
> 
> Notice:  This e-mail message, together with any attachments, contains
> information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New
> Jersey, USA 08889), and/or its affiliates Direct contact information for
> affiliates is available at http://www.merck.com/contact/contacts.html)
that
> may be confidential, proprietary copyrighted and/or legally privileged.
It
> is intended solely for the use of the individual or entity named on this
> message. If you are not the intended recipient, and have received this
> message in error, please notify us immediately by reply e-mail and then
> delete it from your system.