You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Günther Schmidt <gu...@kmmd.de> on 2012/06/03 20:42:31 UTC

How can I recurse a node?

Hi everyone,

http://localhost:8080/some/node.json will get me json info on this node. 
But how can I information on the (immediate) children?

Günther

Re: How can I recurse a node?

Posted by Felix Meschberger <fm...@adobe.com>.
Hi,

Am 04.06.2012 um 15:17 schrieb David Gonzalez:

> Gunter
> 
> James is spot in, large data sets will put load on the server.
> 
> If using the sling JSON selectors, make sure to limit their exposure
> to trusted sources. Exposing node.infinity.json, or even node.2.json,
> where node has 1000s of children could open you to DDOS.

This is where the configured hard limit comes into play: You won't be able to get more result than what is allowed per configuration.

Regards
Felix

> 
> Sent from my iPad
> 
> On Jun 4, 2012, at 12:19 AM, James Stansell <js...@gmail.com> wrote:
> 
>> Assuming that tree is stored in Jackrabbit, you should know that so many
>> children at one node will often cause a performance problem, so one thing
>> to keep in mind. I expect Jackrabbit 3 will address the issue that causes
>> that.
>> 
>> On Sun, Jun 3, 2012 at 2:41 PM, Günther Schmidt <gu...@kmmd.de>wrote:
>> 
>>> Hi David,
>>> 
>>> thank you, that seems to work fine.
>>> There's one hickup, I have a node, "/mails",  with almost 8,000 immediate
>>> children. When I try
>>> 
>>>  http://localhost:8080/mails.2.**json<http://localhost:8080/mails.2.json>
>>> 
>>> I only get
>>> 
>>> ["/mails.0.json"]
>>> 
>>> 
>>> as a result. Could this be because there are too many children? At other
>>> places it works fine.
>>> 
>>> Günther
>>> 
>>> 


Re: How can I recurse a node?

Posted by David Gonzalez <da...@gmail.com>.
Gunter

James is spot in, large data sets will put load on the server.

If using the sling JSON selectors, make sure to limit their exposure
to trusted sources. Exposing node.infinity.json, or even node.2.json,
where node has 1000s of children could open you to DDOS.

Sent from my iPad

On Jun 4, 2012, at 12:19 AM, James Stansell <js...@gmail.com> wrote:

> Assuming that tree is stored in Jackrabbit, you should know that so many
> children at one node will often cause a performance problem, so one thing
> to keep in mind. I expect Jackrabbit 3 will address the issue that causes
> that.
>
> On Sun, Jun 3, 2012 at 2:41 PM, Günther Schmidt <gu...@kmmd.de>wrote:
>
>> Hi David,
>>
>> thank you, that seems to work fine.
>> There's one hickup, I have a node, "/mails",  with almost 8,000 immediate
>> children. When I try
>>
>>   http://localhost:8080/mails.2.**json<http://localhost:8080/mails.2.json>
>>
>> I only get
>>
>>  ["/mails.0.json"]
>>
>>
>> as a result. Could this be because there are too many children? At other
>> places it works fine.
>>
>> Günther
>>
>>

Re: How can I recurse a node?

Posted by James Stansell <js...@gmail.com>.
Assuming that tree is stored in Jackrabbit, you should know that so many
children at one node will often cause a performance problem, so one thing
to keep in mind. I expect Jackrabbit 3 will address the issue that causes
that.

On Sun, Jun 3, 2012 at 2:41 PM, Günther Schmidt <gu...@kmmd.de>wrote:

> Hi David,
>
> thank you, that seems to work fine.
> There's one hickup, I have a node, "/mails",  with almost 8,000 immediate
> children. When I try
>
>    http://localhost:8080/mails.2.**json<http://localhost:8080/mails.2.json>
>
> I only get
>
>   ["/mails.0.json"]
>
>
> as a result. Could this be because there are too many children? At other
> places it works fine.
>
> Günther
>
>

Re: How can I recurse a node?

Posted by "David G." <da...@gmail.com>.
Correct - The default max # of results is 200.

This value can be adjusted via the Sling Get Servlet Component's [1] "json.maximumresults" property.
org.apache.sling.servlets.get.DefaultGetServlet  
json.maximumresults



[1] http://svn.apache.org/repos/asf/sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/DefaultGetServlet.java


--  
David Gonzalez
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Sunday, June 3, 2012 at 3:41 PM, Günther Schmidt wrote:

> Hi David,
>  
> thank you, that seems to work fine.
> There's one hickup, I have a node, "/mails", with almost 8,000  
> immediate children. When I try
>  
> http://localhost:8080/mails.2.json
>  
> I only get
>  
> ["/mails.0.json"]
>  
>  
> as a result. Could this be because there are too many children? At other  
> places it works fine.
>  
> Günther
>  
>  
> Am 03.06.12 21:08, schrieb David G.:
> > Gunter,
> >  
> > I think this is what you're looking for...
> >  
> > http://localhost:8080/some/node.2.json (http://localhost:8080/some/node.json) will give you the children for /some/node
> >  
> > Similarly you can do node.3.json, node.4.json, … node.N.json
> >  
> > .. you can also do node.infinity.json (which will give you a JSON rep of node and all children
> >  
> >  
> > --
> > David Gonzalez
> > Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
> >  
> >  
> > On Sunday, June 3, 2012 at 2:42 PM, Günther Schmidt wrote:
> >  
> > > Hi everyone,
> > >  
> > > http://localhost:8080/some/node.json will get me json info on this node.
> > > But how can I information on the (immediate) children?
> > >  
> > > Günther
>  
>  
> --  
> KMMD IT-Consulting UG (haftungsbeschränkt)
> Offenburger Str. 45
> 68239 Mannheim
> Tel: +49-621-4393887
> HRB 712101 Amtsgericht Mannheim
>  
>  



Re: How can I recurse a node?

Posted by Günther Schmidt <gu...@kmmd.de>.
Hi David,

thank you, that seems to work fine.
There's one hickup, I have a node, "/mails",  with almost 8,000 
immediate children. When I try

     http://localhost:8080/mails.2.json

I only get

    ["/mails.0.json"]


as a result. Could this be because there are too many children? At other 
places it works fine.

Günther


Am 03.06.12 21:08, schrieb David G.:
> Gunter,
>
> I think this is what you're looking for...
>
> http://localhost:8080/some/node.2.json (http://localhost:8080/some/node.json) will give you the children for /some/node
>
> Similarly you can do node.3.json, node.4.json, … node.N.json
>
> .. you can also do node.infinity.json (which will give you a JSON rep of node and all children
>
>
> --
> David Gonzalez
> Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
>
>
> On Sunday, June 3, 2012 at 2:42 PM, Günther Schmidt wrote:
>
>> Hi everyone,
>>
>> http://localhost:8080/some/node.json will get me json info on this node.
>> But how can I information on the (immediate) children?
>>
>> Günther
>


-- 
KMMD IT-Consulting UG (haftungsbeschränkt)
Offenburger Str. 45
68239 Mannheim
Tel: +49-621-4393887
HRB 712101 Amtsgericht Mannheim


Re: How can I recurse a node?

Posted by "David G." <da...@gmail.com>.
Gunter,

I think this is what you're looking for...

http://localhost:8080/some/node.2.json (http://localhost:8080/some/node.json) will give you the children for /some/node  

Similarly you can do node.3.json, node.4.json, … node.N.json

.. you can also do node.infinity.json (which will give you a JSON rep of node and all children


--  
David Gonzalez
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Sunday, June 3, 2012 at 2:42 PM, Günther Schmidt wrote:

> Hi everyone,
>  
> http://localhost:8080/some/node.json will get me json info on this node.  
> But how can I information on the (immediate) children?
>  
> Günther