You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bu...@apache.org on 2017/09/25 10:28:43 UTC

svn commit: r1018678 [1/2] - in /websites/staging/sling/trunk/content: ./ documentation/bundles/sling-query/

Author: buildbot
Date: Mon Sep 25 10:28:42 2017
New Revision: 1018678

Log:
Staging update by buildbot for sling

Added:
    websites/staging/sling/trunk/content/documentation/bundles/sling-query/
    websites/staging/sling/trunk/content/documentation/bundles/sling-query/basic-ideas.html
    websites/staging/sling/trunk/content/documentation/bundles/sling-query/examples.html
    websites/staging/sling/trunk/content/documentation/bundles/sling-query/hierarchy-operators.html
    websites/staging/sling/trunk/content/documentation/bundles/sling-query/methods.html
    websites/staging/sling/trunk/content/documentation/bundles/sling-query/modifiers.html
    websites/staging/sling/trunk/content/documentation/bundles/sling-query/operators.html
    websites/staging/sling/trunk/content/documentation/bundles/sling-query/selectors.html
    websites/staging/sling/trunk/content/documentation/bundles/sling-query/vs-jcr.html
Modified:
    websites/staging/sling/trunk/content/   (props changed)

Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Sep 25 10:28:42 2017
@@ -1 +1 @@
-1809598
+1809599

Added: websites/staging/sling/trunk/content/documentation/bundles/sling-query/basic-ideas.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/bundles/sling-query/basic-ideas.html (added)
+++ websites/staging/sling/trunk/content/documentation/bundles/sling-query/basic-ideas.html Mon Sep 25 10:28:42 2017
@@ -0,0 +1,205 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+  <head>
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <title>Apache Sling - Basic ideas</title>
+    <link rel="icon" href="/res/favicon.ico">
+    <link rel="stylesheet" href="/res/site.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/res/codehilite.css" type="text/css" media="all">
+  </head>
+  <body>
+    <div class="title">
+      <div class="logo">
+        <a href="//sling.apache.org/">
+          <img border="0" alt="Apache Sling" src="/res/logo.svg">
+        </a>
+      </div>
+      <div class="header">
+        <a href="//www.apache.org/">
+          <img border="0" alt="Apache" src="/res/apache.png">
+        </a>
+      </div>
+    </div>
+    
+    <div class="menu"> 
+      <style type="text/css">
+/* The following code is added by mdx_elementid.py
+   It was originally lifted from http://subversion.apache.org/style/site.css */
+/*
+ * Hide class="elementid-permalink", except when an enclosing heading
+ * has the :hover property.
+ */
+.headerlink, .elementid-permalink {
+  visibility: hidden;
+}
+h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
+<p><strong><a href="/documentation.html">Documentation</a></strong> <br />
+<a href="/documentation/getting-started.html">Getting Started</a> <br />
+<a href="/documentation/the-sling-engine.html">The Sling Engine</a> <br />
+<a href="/documentation/development.html">Development</a> <br />
+<a href="/documentation/bundles.html">Bundles</a> <br />
+<a href="/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a> <br />
+<a href="/documentation/configuration.html">Configuration</a>   </p>
+<p><a href="http://s.apache.org/sling.wiki">Wiki</a> <br />
+<a href="http://s.apache.org/sling.faq">FAQ</a>   </p>
+<p><strong>API Docs</strong>  <br />
+<a href="/apidocs/sling9/index.html">Sling 9</a> <br />
+<a href="/apidocs/sling8/index.html">Sling 8</a> <br />
+<a href="/apidocs/sling7/index.html">Sling 7</a> <br />
+<a href="/apidocs/sling6/index.html">Sling 6</a> <br />
+<a href="/apidocs/sling5/index.html">Sling 5</a> <br />
+<a href="/javadoc-io.html">Archive at javadoc.io</a>   </p>
+<p><strong>Project info</strong> <br />
+<a href="/downloads.cgi">Downloads</a> <br />
+<a href="http://www.apache.org/licenses/">License</a> <br />
+<a href="/contributing.html">Contributing</a> <br />
+<a href="/news.html">News</a> <br />
+<a href="/links.html">Links</a> <br />
+<a href="/project-information.html">Project Information</a> <br />
+<a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a> <br />
+<a href="http://ci.apache.org/builders/sling-trunk">Build Server</a> <br />
+<a href="/project-information/security.html">Security</a>   </p>
+<p><strong>Source</strong> <br />
+<a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a> <br />
+<a href="git://git.apache.org/sling.git">Git</a> <br />
+<a href="https://github.com/apache/sling">Github Mirror</a>   </p>
+<p><strong>Sponsorship</strong> <br />
+<a href="http://www.apache.org/foundation/thanks.html">Thanks</a> <br />
+<a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a> <br />
+<a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a>   </p>
+<p><strong><a href="/sitemap.html">Site Map</a></strong></p>
+<!-- no valid ads for now, we'll  reactivate this when needed
+<iframe 
+    src="http://www.apache.org/ads/button.html"
+    style="border-width:0; float: left" frameborder="0" 
+    scrolling="no"
+    width="135" 
+    height="135">
+</iframe>
+-->
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/bundles.html">Bundles</a>&nbsp;&raquo&nbsp;<a href="/documentation/bundles/sling-query.html">Sling Query</a>
+      </div>
+
+      
+      
+      <h1>Basic ideas</h1>
+      <style type="text/css">
+/* The following code is added by mdx_elementid.py
+   It was originally lifted from http://subversion.apache.org/style/site.css */
+/*
+ * Hide class="elementid-permalink", except when an enclosing heading
+ * has the :hover property.
+ */
+.headerlink, .elementid-permalink {
+  visibility: hidden;
+}
+h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
+<h3 id="collections">Collections<a class="headerlink" href="#collections" title="Permanent link">&para;</a></h3>
+<p><code>SlingQuery</code> class represents a collection of resources. Basic collection can be created explicitly via a dollar method:</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource1</span><span class="p">,</span> <span class="n">resource2</span><span class="p">,</span> <span class="n">resource3</span><span class="p">)</span>
+</pre></div>
+
+
+<p>Above method creates a new <code>SlingQuery</code> object that consists of 3 resources. This object implements <code>Iterable&lt;Resource&gt;</code> interface, so can be used in foreach statements directly:</p>
+<div class="codehilite"><pre><span class="k">for</span> <span class="p">(</span><span class="n">Resource</span> <span class="n">resource</span> <span class="n">in</span> $<span class="p">(...))</span> <span class="p">{</span> <span class="p">}</span>
+</pre></div>
+
+
+<h3 id="operations">Operations<a class="headerlink" href="#operations" title="Permanent link">&para;</a></h3>
+<p><code>SlingQuery</code> class defines a number of methods which can be used to transform current collection into a new one. Following code:</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource1</span><span class="p">,</span> <span class="n">resource2</span><span class="p">).</span><span class="n">parent</span><span class="p">()</span>
+</pre></div>
+
+
+<p>will replace each resource with its direct parent. If some resource is a repository root, it will be skipped. Some methods replace each resource with another resource (eg. <code>parent()</code> or <code>closest()</code>). Other methods can replace each resource with a set of resources:</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource1</span><span class="p">,</span> <span class="n">resource2</span><span class="p">).</span><span class="n">children</span><span class="p">();</span>
+</pre></div>
+
+
+<p>Resulting object will contain direct children of both <code>resource1</code> and <code>resource2</code> objects. There are also methods that doesn't add any new resources, but removes existing:</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource1</span><span class="p">,</span> <span class="n">resource2</span><span class="p">).</span><span class="n">first</span><span class="p">();</span>
+</pre></div>
+
+
+<p>Methods can be chained to create more complex query. Eg. following code will return last direct child of the <code>resource</code>:</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">().</span><span class="n">last</span><span class="p">();</span>
+</pre></div>
+
+
+<h4 id="laziness">Laziness<a class="headerlink" href="#laziness" title="Permanent link">&para;</a></h4>
+<p>All operations are lazy (except <code>prev()</code> and sometimes <code>not()</code>). It means that <code>SlingQuery</code> won't read any resources until it's actually necessary. Example:</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">().</span><span class="n">children</span><span class="p">().</span><span class="n">first</span><span class="p">();</span>
+</pre></div>
+
+
+<p><code>children().children()</code> construction reads all grand-children of the given resource. However, the last method limits the output to the first found resource. As a result, <code>SlingQuery</code> won't iterate over all children and grand-children, but it will simply take the first child of the <code>resource</code> and return its first child.</p>
+<h4 id="immutability">Immutability<a class="headerlink" href="#immutability" title="Permanent link">&para;</a></h4>
+<p><code>SlingQuery</code> object is immutable and each operation creates a new one. We can "freeze" some collection before performing more operations on it:</p>
+<div class="codehilite"><pre><span class="n">SlingQuery</span> <span class="n">children</span> <span class="p">=</span> $<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">();</span>
+<span class="n">SlingQuery</span> <span class="n">firstChild</span> <span class="p">=</span> <span class="n">children</span><span class="p">.</span><span class="n">first</span><span class="p">();</span>
+<span class="k">for</span> <span class="p">(</span><span class="n">Resource</span> <span class="n">child</span> <span class="p">:</span> <span class="n">children</span><span class="p">)</span> <span class="p">{</span> <span class="o">/*</span> <span class="n">will</span> <span class="n">display</span> <span class="n">all</span> <span class="n">children</span> <span class="o">*/</span> <span class="p">}</span>
+<span class="k">for</span> <span class="p">(</span><span class="n">Resource</span> <span class="n">child</span> <span class="p">:</span> <span class="n">firstChild</span><span class="p">)</span> <span class="p">{</span> <span class="o">/*</span> <span class="n">will</span> <span class="n">display</span> <span class="n">the</span> <span class="n">first</span> <span class="n">child</span> <span class="o">*/</span> <span class="p">}</span>
+</pre></div>
+
+
+<h3 id="selectors">Selectors<a class="headerlink" href="#selectors" title="Permanent link">&para;</a></h3>
+<p>Some operations may take an additional string selector parameter that defines a filtering. Selector could be used to define resource type, resource attributes and additional modifiers. Example selector could look like this:</p>
+<div class="codehilite"><pre>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;
+</pre></div>
+
+
+<p>It will match all resources with the given resource type. Example:</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">)</span>
+</pre></div>
+
+
+<p>will return only children with <code>cq:Page</code> resource type. You could also filter these resources defining any number of attributes in the square brackets:</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span><span class="p">[</span><span class="n">jcr</span><span class="p">:</span><span class="n">title</span><span class="p">=</span><span class="n">Some</span> <span class="n">title</span><span class="p">][</span><span class="n">jcr</span><span class="p">:</span><span class="n">description</span><span class="p">=</span><span class="n">Some</span> <span class="n">desc</span><span class="p">]</span>&quot;<span class="p">)</span>
+</pre></div>
+
+
+<p>And finally, you could add some modifiers at the end:</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span><span class="p">[</span><span class="n">jcr</span><span class="p">:</span><span class="n">content</span><span class="o">/</span><span class="n">cq</span><span class="p">:</span><span class="n">template</span><span class="p">=</span><span class="n">my</span><span class="o">/</span><span class="n">template</span><span class="p">]:</span><span class="n">even</span>&quot;<span class="p">)</span>
+</pre></div>
+
+
+<p>Above resources will find <code>cq:Page</code> children of the resource, using template <code>my/template</code> and return not all of them, but only those with even indices (eg. if matching children of the <code>resource</code> are <code>page_0</code>, <code>page_1</code> and <code>page_2</code>, only the first and the last will be returned).</p>
+<p>All parts of the selector are optional. In fact, an empty string (<code>""</code>) is a valid selector, accepting all resources. However, the defined order (resource type, attributes in square brackets and modifiers) has to be followed. Example selectors:</p>
+<div class="codehilite"><pre>&quot;<span class="n">foundation</span><span class="o">/</span><span class="n">components</span><span class="o">/</span><span class="n">richtext</span>&quot; <span class="o">//</span> <span class="n">resource</span> <span class="n">type</span>
+&quot;<span class="n">foundation</span><span class="o">/</span><span class="n">components</span><span class="o">/</span><span class="n">richtext</span><span class="p">:</span><span class="n">first</span>&quot; <span class="o">//</span> <span class="n">resource</span> <span class="n">type</span> <span class="n">with</span> <span class="n">modifier</span>
+&quot;<span class="p">[</span><span class="n">property</span><span class="p">=</span><span class="n">value</span><span class="p">][</span><span class="n">property2</span><span class="p">=</span><span class="n">value2</span><span class="p">]</span>&quot; <span class="o">//</span> <span class="n">two</span> <span class="n">attributes</span>
+&quot;<span class="p">:</span><span class="n">even</span>&quot; <span class="o">//</span> <span class="n">modifier</span>
+&quot;<span class="p">:</span><span class="n">even</span><span class="p">:</span><span class="n">not</span><span class="p">(:</span><span class="n">first</span><span class="p">)</span>&quot; <span class="o">//</span> <span class="n">two</span> <span class="n">modifiers</span><span class="p">,</span> <span class="n">the</span> <span class="n">second</span> <span class="n">one</span> <span class="n">is</span> <span class="n">nested</span>
+</pre></div>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+        Rev. 1809599 by tomekr on Mon, 25 Sep 2017 10:28:26 +0000
+      </div>
+      <div class="trademarkFooter"> 
+        Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project
+        logo are trademarks of The Apache Software Foundation. All other marks mentioned
+        may be trademarks or registered trademarks of their respective owners.
+      </div>
+    </div>
+  </body>
+</html>

Added: websites/staging/sling/trunk/content/documentation/bundles/sling-query/examples.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/bundles/sling-query/examples.html (added)
+++ websites/staging/sling/trunk/content/documentation/bundles/sling-query/examples.html Mon Sep 25 10:28:42 2017
@@ -0,0 +1,197 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+  <head>
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <title>Apache Sling - Examples</title>
+    <link rel="icon" href="/res/favicon.ico">
+    <link rel="stylesheet" href="/res/site.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/res/codehilite.css" type="text/css" media="all">
+  </head>
+  <body>
+    <div class="title">
+      <div class="logo">
+        <a href="//sling.apache.org/">
+          <img border="0" alt="Apache Sling" src="/res/logo.svg">
+        </a>
+      </div>
+      <div class="header">
+        <a href="//www.apache.org/">
+          <img border="0" alt="Apache" src="/res/apache.png">
+        </a>
+      </div>
+    </div>
+    
+    <div class="menu"> 
+      <style type="text/css">
+/* The following code is added by mdx_elementid.py
+   It was originally lifted from http://subversion.apache.org/style/site.css */
+/*
+ * Hide class="elementid-permalink", except when an enclosing heading
+ * has the :hover property.
+ */
+.headerlink, .elementid-permalink {
+  visibility: hidden;
+}
+h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
+<p><strong><a href="/documentation.html">Documentation</a></strong> <br />
+<a href="/documentation/getting-started.html">Getting Started</a> <br />
+<a href="/documentation/the-sling-engine.html">The Sling Engine</a> <br />
+<a href="/documentation/development.html">Development</a> <br />
+<a href="/documentation/bundles.html">Bundles</a> <br />
+<a href="/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a> <br />
+<a href="/documentation/configuration.html">Configuration</a>   </p>
+<p><a href="http://s.apache.org/sling.wiki">Wiki</a> <br />
+<a href="http://s.apache.org/sling.faq">FAQ</a>   </p>
+<p><strong>API Docs</strong>  <br />
+<a href="/apidocs/sling9/index.html">Sling 9</a> <br />
+<a href="/apidocs/sling8/index.html">Sling 8</a> <br />
+<a href="/apidocs/sling7/index.html">Sling 7</a> <br />
+<a href="/apidocs/sling6/index.html">Sling 6</a> <br />
+<a href="/apidocs/sling5/index.html">Sling 5</a> <br />
+<a href="/javadoc-io.html">Archive at javadoc.io</a>   </p>
+<p><strong>Project info</strong> <br />
+<a href="/downloads.cgi">Downloads</a> <br />
+<a href="http://www.apache.org/licenses/">License</a> <br />
+<a href="/contributing.html">Contributing</a> <br />
+<a href="/news.html">News</a> <br />
+<a href="/links.html">Links</a> <br />
+<a href="/project-information.html">Project Information</a> <br />
+<a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a> <br />
+<a href="http://ci.apache.org/builders/sling-trunk">Build Server</a> <br />
+<a href="/project-information/security.html">Security</a>   </p>
+<p><strong>Source</strong> <br />
+<a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a> <br />
+<a href="git://git.apache.org/sling.git">Git</a> <br />
+<a href="https://github.com/apache/sling">Github Mirror</a>   </p>
+<p><strong>Sponsorship</strong> <br />
+<a href="http://www.apache.org/foundation/thanks.html">Thanks</a> <br />
+<a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a> <br />
+<a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a>   </p>
+<p><strong><a href="/sitemap.html">Site Map</a></strong></p>
+<!-- no valid ads for now, we'll  reactivate this when needed
+<iframe 
+    src="http://www.apache.org/ads/button.html"
+    style="border-width:0; float: left" frameborder="0" 
+    scrolling="no"
+    width="135" 
+    height="135">
+</iframe>
+-->
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/bundles.html">Bundles</a>&nbsp;&raquo&nbsp;<a href="/documentation/bundles/sling-query.html">Sling Query</a>
+      </div>
+
+      
+      
+      <h1>Examples</h1>
+      <style type="text/css">
+/* The following code is added by mdx_elementid.py
+   It was originally lifted from http://subversion.apache.org/style/site.css */
+/*
+ * Hide class="elementid-permalink", except when an enclosing heading
+ * has the :hover property.
+ */
+.headerlink, .elementid-permalink {
+  visibility: hidden;
+}
+h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
+<p>Get containing page (like <a href="http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/wcm/api/PageManager.html">PageManager#getContainingPage</a>)</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">closest</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">)</span>
+</pre></div>
+
+
+<p>Get first ancestor with a given template</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">closest</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span><span class="p">[</span><span class="n">jcr</span><span class="p">:</span><span class="n">content</span><span class="o">/</span><span class="n">cq</span><span class="p">:</span><span class="n">template</span><span class="p">=</span><span class="o">/</span><span class="n">apps</span><span class="o">/</span><span class="n">geometrixx</span><span class="o">/</span><span class="n">templates</span><span class="o">/</span><span class="n">homepage</span><span class="p">]</span>&quot;<span class="p">)</span>
+</pre></div>
+
+
+<p>List siblings of the current page which can be displayed in the navigation</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">closest</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">).</span><span class="n">siblings</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span><span class="p">[</span><span class="n">jcr</span><span class="p">:</span><span class="n">content</span><span class="o">/</span><span class="n">hiddenInNav</span><span class="p">=</span><span class="n">false</span><span class="p">]</span>&quot;<span class="p">)</span>
+</pre></div>
+
+
+<p>Get the first sibling of the current page</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">closest</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">).</span><span class="n">siblings</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">).</span><span class="n">first</span><span class="p">()</span>
+</pre></div>
+
+
+<p>Get page ancestor closest to the root</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">parents</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">).</span><span class="n">last</span><span class="p">()</span>
+</pre></div>
+
+
+<p>Get the second child of each resource:</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource1</span><span class="p">,</span> <span class="n">resource2</span><span class="p">,</span> <span class="n">resource3</span><span class="p">).</span><span class="n">children</span><span class="p">(</span>&quot;<span class="p">:</span><span class="n">eq</span><span class="p">(</span>1<span class="p">)</span>&quot;<span class="p">)</span>
+</pre></div>
+
+
+<p>Get the first two children of each resource:</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource1</span><span class="p">,</span> <span class="n">resource2</span><span class="p">,</span> <span class="n">resource3</span><span class="p">).</span><span class="n">children</span><span class="p">(</span>&quot;<span class="p">:</span><span class="n">lt</span><span class="p">(</span>2<span class="p">)</span>&quot;<span class="p">)</span>
+</pre></div>
+
+
+<p>Closest ancestor page having non-empty parsys</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">closest</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span> <span class="n">foundation</span><span class="o">/</span><span class="n">components</span><span class="o">/</span><span class="n">parsys</span><span class="p">:</span><span class="n">parent</span>&quot;<span class="p">)</span>
+</pre></div>
+
+
+<p>Get all parents of the current resource and adapt them to Page object</p>
+<div class="codehilite"><pre><span class="n">Iterable</span><span class="o">&lt;</span><span class="n">Page</span><span class="o">&gt;</span> <span class="n">breadcrumbs</span> <span class="p">=</span> $<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">parents</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">).</span><span class="n">map</span><span class="p">(</span><span class="n">Page</span><span class="p">.</span><span class="n">class</span><span class="p">);</span>
+</pre></div>
+
+
+<p>Get all parents of the current resource up to the home page</p>
+<div class="codehilite"><pre><span class="n">Iterable</span><span class="o">&lt;</span><span class="n">Page</span><span class="o">&gt;</span> <span class="n">breadcrumbs</span><span class="p">;</span>
+<span class="n">breadcrumbs</span> <span class="p">=</span> $<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">parentsUntil</span><span class="p">(</span>
+    &quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span><span class="p">[</span><span class="n">jcr</span><span class="p">:</span><span class="n">content</span><span class="o">/</span><span class="n">cq</span><span class="p">:</span><span class="n">template</span><span class="p">=</span><span class="o">/</span><span class="n">apps</span><span class="o">/</span><span class="n">geometrixx</span><span class="o">/</span><span class="n">templates</span><span class="o">/</span><span class="n">homepage</span><span class="p">]</span>&quot;<span class="p">,</span>
+    &quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">).</span><span class="n">map</span><span class="p">(</span><span class="n">Page</span><span class="p">.</span><span class="n">class</span><span class="p">);</span>
+</pre></div>
+
+
+<p>List all grand-children pages having empty parsys</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">).</span><span class="n">children</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">).</span><span class="n">has</span><span class="p">(</span>&quot;<span class="n">foundation</span><span class="o">/</span><span class="n">components</span><span class="o">/</span><span class="n">parsys</span><span class="p">:</span><span class="n">empty</span><span class="p">)</span>
+</pre></div>
+
+
+<p>Use JCR query to find all <code>cq:Page</code>s with a given template</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resourceResolver</span><span class="p">)</span>
+    <span class="p">.</span><span class="n">searchStrategy</span><span class="p">(</span><span class="n">SearchStrategy</span><span class="p">.</span><span class="n">QUERY</span><span class="p">)</span>
+    <span class="p">.</span><span class="nb">find</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">PageContent</span><span class="p">[</span><span class="n">cq</span><span class="p">:</span><span class="n">template</span><span class="p">=</span><span class="o">/</span><span class="n">apps</span><span class="o">/</span><span class="n">geometrixx</span><span class="o">/</span><span class="n">templates</span><span class="o">/</span><span class="n">homepage</span><span class="p">]</span>&quot;<span class="p">)</span>
+    <span class="p">.</span><span class="n">parent</span><span class="p">()</span>
+</pre></div>
+
+
+<p>Find children named <code>en</code> or <code>de</code></p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">(</span>&quot;#<span class="n">en</span><span class="p">,</span> #<span class="n">de</span>&quot;<span class="p">)</span>
+</pre></div>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+        Rev. 1809599 by tomekr on Mon, 25 Sep 2017 10:28:26 +0000
+      </div>
+      <div class="trademarkFooter"> 
+        Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project
+        logo are trademarks of The Apache Software Foundation. All other marks mentioned
+        may be trademarks or registered trademarks of their respective owners.
+      </div>
+    </div>
+  </body>
+</html>

Added: websites/staging/sling/trunk/content/documentation/bundles/sling-query/hierarchy-operators.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/bundles/sling-query/hierarchy-operators.html (added)
+++ websites/staging/sling/trunk/content/documentation/bundles/sling-query/hierarchy-operators.html Mon Sep 25 10:28:42 2017
@@ -0,0 +1,162 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+  <head>
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <title>Apache Sling - Hierarchy operators</title>
+    <link rel="icon" href="/res/favicon.ico">
+    <link rel="stylesheet" href="/res/site.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/res/codehilite.css" type="text/css" media="all">
+  </head>
+  <body>
+    <div class="title">
+      <div class="logo">
+        <a href="//sling.apache.org/">
+          <img border="0" alt="Apache Sling" src="/res/logo.svg">
+        </a>
+      </div>
+      <div class="header">
+        <a href="//www.apache.org/">
+          <img border="0" alt="Apache" src="/res/apache.png">
+        </a>
+      </div>
+    </div>
+    
+    <div class="menu"> 
+      <style type="text/css">
+/* The following code is added by mdx_elementid.py
+   It was originally lifted from http://subversion.apache.org/style/site.css */
+/*
+ * Hide class="elementid-permalink", except when an enclosing heading
+ * has the :hover property.
+ */
+.headerlink, .elementid-permalink {
+  visibility: hidden;
+}
+h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
+<p><strong><a href="/documentation.html">Documentation</a></strong> <br />
+<a href="/documentation/getting-started.html">Getting Started</a> <br />
+<a href="/documentation/the-sling-engine.html">The Sling Engine</a> <br />
+<a href="/documentation/development.html">Development</a> <br />
+<a href="/documentation/bundles.html">Bundles</a> <br />
+<a href="/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a> <br />
+<a href="/documentation/configuration.html">Configuration</a>   </p>
+<p><a href="http://s.apache.org/sling.wiki">Wiki</a> <br />
+<a href="http://s.apache.org/sling.faq">FAQ</a>   </p>
+<p><strong>API Docs</strong>  <br />
+<a href="/apidocs/sling9/index.html">Sling 9</a> <br />
+<a href="/apidocs/sling8/index.html">Sling 8</a> <br />
+<a href="/apidocs/sling7/index.html">Sling 7</a> <br />
+<a href="/apidocs/sling6/index.html">Sling 6</a> <br />
+<a href="/apidocs/sling5/index.html">Sling 5</a> <br />
+<a href="/javadoc-io.html">Archive at javadoc.io</a>   </p>
+<p><strong>Project info</strong> <br />
+<a href="/downloads.cgi">Downloads</a> <br />
+<a href="http://www.apache.org/licenses/">License</a> <br />
+<a href="/contributing.html">Contributing</a> <br />
+<a href="/news.html">News</a> <br />
+<a href="/links.html">Links</a> <br />
+<a href="/project-information.html">Project Information</a> <br />
+<a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a> <br />
+<a href="http://ci.apache.org/builders/sling-trunk">Build Server</a> <br />
+<a href="/project-information/security.html">Security</a>   </p>
+<p><strong>Source</strong> <br />
+<a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a> <br />
+<a href="git://git.apache.org/sling.git">Git</a> <br />
+<a href="https://github.com/apache/sling">Github Mirror</a>   </p>
+<p><strong>Sponsorship</strong> <br />
+<a href="http://www.apache.org/foundation/thanks.html">Thanks</a> <br />
+<a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a> <br />
+<a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a>   </p>
+<p><strong><a href="/sitemap.html">Site Map</a></strong></p>
+<!-- no valid ads for now, we'll  reactivate this when needed
+<iframe 
+    src="http://www.apache.org/ads/button.html"
+    style="border-width:0; float: left" frameborder="0" 
+    scrolling="no"
+    width="135" 
+    height="135">
+</iframe>
+-->
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/bundles.html">Bundles</a>&nbsp;&raquo&nbsp;<a href="/documentation/bundles/sling-query.html">Sling Query</a>
+      </div>
+
+      
+      
+      <h1>Hierarchy operators</h1>
+      <style type="text/css">
+/* The following code is added by mdx_elementid.py
+   It was originally lifted from http://subversion.apache.org/style/site.css */
+/*
+ * Hide class="elementid-permalink", except when an enclosing heading
+ * has the :hover property.
+ */
+.headerlink, .elementid-permalink {
+  visibility: hidden;
+}
+h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
+<h3 id="child-operator-parent-child">Child operator (<code>parent &gt; child</code>)<a class="headerlink" href="#child-operator-parent-child" title="Permanent link">&para;</a></h3>
+<p>Select all direct child resources specified by <code>child</code> of resources specified by <code>parent</code></p>
+<div class="codehilite"><pre><span class="c1">// find all richtext components placed directly into parsys resources</span>
+<span class="err">$</span><span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">find</span><span class="p">(&#39;</span><span class="n">foundation</span><span class="o">/</span><span class="n">components</span><span class="o">/</span><span class="n">parsys</span> <span class="o">&gt;</span> <span class="n">foundation</span><span class="o">/</span><span class="n">components</span><span class="o">/</span><span class="n">richtext</span><span class="p">&#39;)</span>
+<span class="c1">// alternative version</span>
+<span class="err">$</span><span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">find</span><span class="p">(&#39;</span><span class="n">foundation</span><span class="o">/</span><span class="n">components</span><span class="o">/</span><span class="n">parsys</span><span class="p">&#39;).</span><span class="n">children</span><span class="p">(&#39;</span><span class="n">foundation</span><span class="o">/</span><span class="n">components</span><span class="o">/</span><span class="n">richtext</span><span class="p">&#39;)</span>
+</pre></div>
+
+
+<h3 id="descendant-operator-ancestor-descendant">Descendant operator (<code>ancestor descendant</code>)<a class="headerlink" href="#descendant-operator-ancestor-descendant" title="Permanent link">&para;</a></h3>
+<p>Select all resources that are <code>descendant</code>s of a given <code>ancestor</code></p>
+<div class="codehilite"><pre><span class="c1">// find all resources containing `someAttribute` on the `cq:Page`s being direct children of the resource</span>
+<span class="err">$</span><span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">(&#39;</span><span class="nl">cq:</span><span class="n">Page</span> <span class="p">[</span><span class="n">someAttribute</span><span class="p">]&#39;)</span>
+<span class="c1">// alternative version</span>
+<span class="err">$</span><span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">(&#39;</span><span class="nl">cq:</span><span class="n">Page</span><span class="p">&#39;).</span><span class="n">find</span><span class="p">(&#39;[</span><span class="n">someAttribute</span><span class="p">]&#39;)</span>
+</pre></div>
+
+
+<h3 id="next-adjacent-operator-prev-next">Next adjacent operator (<code>prev + next</code>)<a class="headerlink" href="#next-adjacent-operator-prev-next" title="Permanent link">&para;</a></h3>
+<p>Selects all next resources matching <code>next</code> that are immediately preceded by a sibling <code>prev</code></p>
+<div class="codehilite"><pre><span class="c1">// find next sibling of the cq:Page containing the resource</span>
+<span class="err">$</span><span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">closest</span><span class="p">(&#39;</span><span class="nl">cq:</span><span class="n">Page</span> <span class="o">+</span> <span class="nl">cq:</span><span class="n">Page</span><span class="p">&#39;)</span>
+<span class="c1">// alternative version</span>
+<span class="err">$</span><span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">closest</span><span class="p">(&#39;</span><span class="nl">cq:</span><span class="n">Page</span><span class="p">&#39;).</span><span class="n">next</span><span class="p">(&#39;</span><span class="nl">cq:</span><span class="n">Page</span><span class="p">&#39;)</span>
+</pre></div>
+
+
+<h3 id="next-siblings-operator-prev-next">Next siblings operator (<code>prev ~ next</code>)<a class="headerlink" href="#next-siblings-operator-prev-next" title="Permanent link">&para;</a></h3>
+<p>Selects all sibling resources that follow after the <code>prev</code> element, have the same parent, and match the filtering <code>siblings</code> selector</p>
+<div class="codehilite"><pre><span class="c1">// find all next siblings of the cq:Page containing the resource</span>
+<span class="err">$</span><span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">closest</span><span class="p">(&#39;</span><span class="nl">cq:</span><span class="n">Page</span> <span class="o">~</span> <span class="nl">cq:</span><span class="n">Page</span><span class="p">&#39;)</span>
+<span class="c1">// alternative version</span>
+<span class="err">$</span><span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">closest</span><span class="p">(&#39;</span><span class="nl">cq:</span><span class="n">Page</span><span class="p">&#39;).</span><span class="n">nextAll</span><span class="p">(&#39;</span><span class="nl">cq:</span><span class="n">Page</span><span class="p">&#39;)</span>
+</pre></div>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+        Rev. 1809599 by tomekr on Mon, 25 Sep 2017 10:28:26 +0000
+      </div>
+      <div class="trademarkFooter"> 
+        Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project
+        logo are trademarks of The Apache Software Foundation. All other marks mentioned
+        may be trademarks or registered trademarks of their respective owners.
+      </div>
+    </div>
+  </body>
+</html>

Added: websites/staging/sling/trunk/content/documentation/bundles/sling-query/methods.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/bundles/sling-query/methods.html (added)
+++ websites/staging/sling/trunk/content/documentation/bundles/sling-query/methods.html Mon Sep 25 10:28:42 2017
@@ -0,0 +1,305 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+  <head>
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <title>Apache Sling - Method list</title>
+    <link rel="icon" href="/res/favicon.ico">
+    <link rel="stylesheet" href="/res/site.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/res/codehilite.css" type="text/css" media="all">
+  </head>
+  <body>
+    <div class="title">
+      <div class="logo">
+        <a href="//sling.apache.org/">
+          <img border="0" alt="Apache Sling" src="/res/logo.svg">
+        </a>
+      </div>
+      <div class="header">
+        <a href="//www.apache.org/">
+          <img border="0" alt="Apache" src="/res/apache.png">
+        </a>
+      </div>
+    </div>
+    
+    <div class="menu"> 
+      <style type="text/css">
+/* The following code is added by mdx_elementid.py
+   It was originally lifted from http://subversion.apache.org/style/site.css */
+/*
+ * Hide class="elementid-permalink", except when an enclosing heading
+ * has the :hover property.
+ */
+.headerlink, .elementid-permalink {
+  visibility: hidden;
+}
+h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
+<p><strong><a href="/documentation.html">Documentation</a></strong> <br />
+<a href="/documentation/getting-started.html">Getting Started</a> <br />
+<a href="/documentation/the-sling-engine.html">The Sling Engine</a> <br />
+<a href="/documentation/development.html">Development</a> <br />
+<a href="/documentation/bundles.html">Bundles</a> <br />
+<a href="/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a> <br />
+<a href="/documentation/configuration.html">Configuration</a>   </p>
+<p><a href="http://s.apache.org/sling.wiki">Wiki</a> <br />
+<a href="http://s.apache.org/sling.faq">FAQ</a>   </p>
+<p><strong>API Docs</strong>  <br />
+<a href="/apidocs/sling9/index.html">Sling 9</a> <br />
+<a href="/apidocs/sling8/index.html">Sling 8</a> <br />
+<a href="/apidocs/sling7/index.html">Sling 7</a> <br />
+<a href="/apidocs/sling6/index.html">Sling 6</a> <br />
+<a href="/apidocs/sling5/index.html">Sling 5</a> <br />
+<a href="/javadoc-io.html">Archive at javadoc.io</a>   </p>
+<p><strong>Project info</strong> <br />
+<a href="/downloads.cgi">Downloads</a> <br />
+<a href="http://www.apache.org/licenses/">License</a> <br />
+<a href="/contributing.html">Contributing</a> <br />
+<a href="/news.html">News</a> <br />
+<a href="/links.html">Links</a> <br />
+<a href="/project-information.html">Project Information</a> <br />
+<a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a> <br />
+<a href="http://ci.apache.org/builders/sling-trunk">Build Server</a> <br />
+<a href="/project-information/security.html">Security</a>   </p>
+<p><strong>Source</strong> <br />
+<a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a> <br />
+<a href="git://git.apache.org/sling.git">Git</a> <br />
+<a href="https://github.com/apache/sling">Github Mirror</a>   </p>
+<p><strong>Sponsorship</strong> <br />
+<a href="http://www.apache.org/foundation/thanks.html">Thanks</a> <br />
+<a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a> <br />
+<a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a>   </p>
+<p><strong><a href="/sitemap.html">Site Map</a></strong></p>
+<!-- no valid ads for now, we'll  reactivate this when needed
+<iframe 
+    src="http://www.apache.org/ads/button.html"
+    style="border-width:0; float: left" frameborder="0" 
+    scrolling="no"
+    width="135" 
+    height="135">
+</iframe>
+-->
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/bundles.html">Bundles</a>&nbsp;&raquo&nbsp;<a href="/documentation/bundles/sling-query.html">Sling Query</a>
+      </div>
+
+      
+      
+      <h1>Method list</h1>
+      <style type="text/css">
+/* The following code is added by mdx_elementid.py
+   It was originally lifted from http://subversion.apache.org/style/site.css */
+/*
+ * Hide class="elementid-permalink", except when an enclosing heading
+ * has the :hover property.
+ */
+.headerlink, .elementid-permalink {
+  visibility: hidden;
+}
+h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
+<h3 id="resource-resources"><code>$(Resource... resources)</code><a class="headerlink" href="#resource-resources" title="Permanent link">&para;</a></h3>
+<p>Create a new SlingQuery object, using passed resources as an initial collection. Example:</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">);</span> <span class="o">//</span> <span class="n">a</span> <span class="n">simple</span> <span class="n">SlingQuery</span> <span class="n">collection</span> <span class="n">containing</span> <span class="n">one</span> <span class="n">resource</span>
+</pre></div>
+
+
+<h3 id="addresource-resources"><code>.add(Resource... resources)</code><a class="headerlink" href="#addresource-resources" title="Permanent link">&para;</a></h3>
+<p>Add resources to the collection.</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">().</span><span class="n">add</span><span class="p">(</span><span class="n">resource</span><span class="p">);</span> <span class="o">//</span> <span class="n">collection</span> <span class="n">contains</span> <span class="n">resource</span> <span class="n">and</span> <span class="n">all</span> <span class="n">its</span> <span class="n">children</span>
+</pre></div>
+
+
+<h3 id="aslist"><code>.asList()</code><a class="headerlink" href="#aslist" title="Permanent link">&para;</a></h3>
+<p>Transform SlingQuery collection into a lazy list.</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">).</span><span class="n">asList</span><span class="p">().</span><span class="n">get</span><span class="p">(</span>0<span class="p">);</span> <span class="o">//</span> <span class="n">get</span> <span class="n">the</span> <span class="n">first</span> <span class="n">child</span> <span class="n">page</span>
+$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">().</span><span class="n">asList</span><span class="p">().</span><span class="n">isEmpty</span><span class="p">();</span> <span class="o">//</span> <span class="k">return</span> <span class="n">true</span> <span class="k">if</span> <span class="n">the</span> <span class="n">resource</span> <span class="n">have</span> <span class="n">no</span> <span class="n">children</span>
+</pre></div>
+
+
+<h3 id="childrenselector"><code>.children([selector])</code><a class="headerlink" href="#childrenselector" title="Permanent link">&para;</a></h3>
+<p>Get list of the children for each resource in the collection. Pass <code>selector</code> to filter children. Example:</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">);</span> <span class="o">//</span> <span class="n">get</span> <span class="n">all</span> <span class="n">page</span> <span class="n">children</span> <span class="n">of</span> <span class="n">the</span> <span class="n">resource</span>
+$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">().</span><span class="n">children</span><span class="p">();</span> <span class="o">//</span> <span class="n">get</span> <span class="n">all</span> <span class="n">grand</span><span class="o">-</span><span class="n">children</span> <span class="n">of</span> <span class="n">the</span> <span class="n">resource</span>
+</pre></div>
+
+
+<h3 id="closestselector"><code>.closest(selector)</code><a class="headerlink" href="#closestselector" title="Permanent link">&para;</a></h3>
+<p>For each resource in the collection, return the first element matching the selector testing the resource itself and traversing up its ancestors. Example:</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">closest</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">);</span> <span class="o">//</span> <span class="nb">find</span> <span class="n">containing</span> <span class="n">page</span><span class="p">,</span> <span class="n">like</span> <span class="n">PageManager</span>#<span class="n">getContainingPage</span>
+<span class="o">//</span> <span class="n">let</span><span class="o">&#39;</span><span class="n">s</span> <span class="n">assume</span> <span class="n">that</span> <span class="n">someCqPageResource</span> <span class="n">is</span> <span class="n">a</span> <span class="n">cq</span><span class="p">:</span><span class="n">Page</span>
+$<span class="p">(</span><span class="n">someCqPageResource</span><span class="p">).</span><span class="n">closest</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">);</span> <span class="o">//</span> <span class="k">return</span> <span class="n">the</span> <span class="n">same</span> <span class="n">resource</span>
+</pre></div>
+
+
+<h3 id="eqindex"><code>.eq(index)</code><a class="headerlink" href="#eqindex" title="Permanent link">&para;</a></h3>
+<p>Reduce resource collection to the one resource at the given 0-based index. Example:</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource0</span><span class="p">,</span> <span class="n">resource1</span><span class="p">,</span> <span class="n">resource2</span><span class="p">).</span><span class="n">eq</span><span class="p">(</span>1<span class="p">);</span> <span class="o">//</span> <span class="k">return</span> <span class="n">resource1</span>
+$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">().</span><span class="n">eq</span><span class="p">(</span>0<span class="p">);</span> <span class="o">//</span> <span class="k">return</span> <span class="n">first</span> <span class="n">child</span> <span class="n">of</span> <span class="n">the</span> <span class="n">resource</span>
+</pre></div>
+
+
+<h3 id="filterselector"><code>.filter(selector)</code><a class="headerlink" href="#filterselector" title="Permanent link">&para;</a></h3>
+<p>Filter resource collection using given selector.</p>
+<div class="codehilite"><pre><span class="n">final</span> <span class="n">Calendar</span> <span class="n">someTimeAgo</span> <span class="p">=</span> <span class="n">Calendar</span><span class="p">.</span><span class="n">getInstance</span><span class="p">();</span>
+<span class="n">someTimeAgo</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">Calendar</span><span class="p">.</span><span class="n">HOUR</span><span class="p">,</span> <span class="o">-</span>5<span class="p">);</span>
+
+<span class="o">//</span> <span class="n">get</span> <span class="n">children</span> <span class="n">pages</span> <span class="n">modified</span> <span class="n">in</span> <span class="n">the</span> <span class="n">last</span> 5 <span class="n">hours</span>
+<span class="n">SlingQuery</span> <span class="n">query</span> <span class="p">=</span> $<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">).</span><span class="n">filter</span><span class="p">(</span><span class="n">new</span> <span class="n">Predicate</span><span class="o">&lt;</span><span class="n">Resource</span><span class="o">&gt;</span><span class="p">()</span> <span class="p">{</span>
+    <span class="p">@</span><span class="n">Override</span>
+    <span class="n">public</span> <span class="n">boolean</span> <span class="n">accepts</span><span class="p">(</span><span class="n">Resource</span> <span class="n">resource</span><span class="p">)</span> <span class="p">{</span>
+        <span class="k">return</span> <span class="n">resource</span><span class="p">.</span><span class="n">adaptTo</span><span class="p">(</span><span class="n">Page</span><span class="p">.</span><span class="n">class</span><span class="p">).</span><span class="n">getLastModified</span><span class="p">().</span><span class="n">after</span><span class="p">(</span><span class="n">someTimeAgo</span><span class="p">);</span>
+    <span class="p">}</span>
+<span class="p">});</span>
+</pre></div>
+
+
+<h3 id="findselector"><code>.find([selector])</code><a class="headerlink" href="#findselector" title="Permanent link">&para;</a></h3>
+<p>For each resource in collection return all its descendants using <a href="#searchstrategystrategy">selected strategy</a>. Please notice that invoking this method on a resource being a root of a large subtree may and will cause performance problems.</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="nb">find</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">);</span> <span class="o">//</span> <span class="nb">find</span> <span class="n">all</span> <span class="n">descendant</span> <span class="n">pages</span>
+</pre></div>
+
+
+<h3 id="first"><code>.first()</code><a class="headerlink" href="#first" title="Permanent link">&para;</a></h3>
+<p>Filter resource collection to the first element. Equivalent to <code>.eq(0)</code> or <code>.slice(0, 0)</code>.</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">siblings</span><span class="p">().</span><span class="n">first</span><span class="p">();</span> <span class="o">//</span> <span class="n">get</span> <span class="n">the</span> <span class="n">first</span> <span class="n">sibling</span> <span class="n">of</span> <span class="n">the</span> <span class="n">current</span> <span class="n">resource</span>
+</pre></div>
+
+
+<h3 id="hasselector"><code>.has(selector)</code><a class="headerlink" href="#hasselector" title="Permanent link">&para;</a></h3>
+<p>Pick such resources from the collection that have descendant matching the selector. Example:</p>
+<div class="codehilite"><pre>$<span class="p">(...).</span><span class="n">children</span><span class="p">(</span><span class="s">&#39;cq:Page&#39;</span><span class="p">).</span><span class="n">has</span><span class="p">(</span><span class="n">foundation</span><span class="o">/</span><span class="n">components</span><span class="o">/</span><span class="n">richtext</span><span class="p">)</span> <span class="o">//</span> <span class="nb">find</span> <span class="n">children</span> <span class="n">pages</span> <span class="n">containing</span> <span class="n">some</span> <span class="n">richtext</span> <span class="n">component</span>
+</pre></div>
+
+
+<p>This method uses <a href="#searchstrategystrategy">selected strategy</a> to iterate over resource descendants.</p>
+<h3 id="last"><code>.last()</code><a class="headerlink" href="#last" title="Permanent link">&para;</a></h3>
+<p>Filter resource collection to the last element.</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">siblings</span><span class="p">().</span><span class="n">last</span><span class="p">();</span> <span class="o">//</span> <span class="n">get</span> <span class="n">the</span> <span class="n">last</span> <span class="n">sibling</span> <span class="n">of</span> <span class="n">the</span> <span class="n">current</span> <span class="n">resource</span>
+</pre></div>
+
+
+<h3 id="mapclasst-clazz"><code>.map(Class&lt;T&gt; clazz)</code><a class="headerlink" href="#mapclasst-clazz" title="Permanent link">&para;</a></h3>
+<p>Transform the whole collection to a new <code>Iterable&lt;T&gt;</code> object, invoking <code>adaptTo(clazz)</code> method on each resource. If some resource can't be adapted to the class (eg. <code>adaptTo()</code> returns <code>null</code>), it will be skipped. Example:</p>
+<div class="codehilite"><pre><span class="k">for</span> <span class="p">(</span><span class="n">Page</span> <span class="n">page</span> <span class="p">:</span> $<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">parents</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">).</span><span class="n">map</span><span class="p">(</span><span class="n">Page</span><span class="p">.</span><span class="n">class</span><span class="p">))</span> <span class="p">{</span>
+    <span class="o">//</span> <span class="n">display</span> <span class="n">breadcrumbs</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<h3 id="nextselector"><code>.next([selector])</code><a class="headerlink" href="#nextselector" title="Permanent link">&para;</a></h3>
+<p>Return the next sibling for each resource in the collection and optionally filter it by a selector. If the selector is given, but the sibling doesn't match it, empty collection will be returned.</p>
+<div class="codehilite"><pre><span class="c1">// let&#39;s assume that resource have 3 children: child1, child2 and child3</span>
+<span class="err">$</span><span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">().</span><span class="n">first</span><span class="p">().</span><span class="n">next</span><span class="p">();</span> <span class="c1">// return child2</span>
+</pre></div>
+
+
+<h3 id="nextallselector"><code>.nextAll([selector])</code><a class="headerlink" href="#nextallselector" title="Permanent link">&para;</a></h3>
+<p>Return all following siblings for each resource in the collection, optionally filtering them by a selector.</p>
+<div class="codehilite"><pre><span class="c1">// let&#39;s assume that resource have 3 children: child1, child2 and child3</span>
+<span class="err">$</span><span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">().</span><span class="n">first</span><span class="p">().</span><span class="n">nextAll</span><span class="p">();</span> <span class="c1">// return child2 and child3</span>
+</pre></div>
+
+
+<h3 id="nextuntilselector"><code>.nextUntil(selector)</code><a class="headerlink" href="#nextuntilselector" title="Permanent link">&para;</a></h3>
+<p>Return all following siblings for each resource in the collection up to, but not including, resource matched by a selector.</p>
+<div class="codehilite"><pre><span class="c1">// let&#39;s assume that resource have 4 children: child1, child2, child3 and child4</span>
+<span class="c1">// additionaly, child4 has property jcr:title=Page</span>
+<span class="err">$</span><span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">().</span><span class="n">first</span><span class="p">().</span><span class="n">nextUntil</span><span class="p">(</span><span class="s">&quot;[jcr:title=Page]&quot;</span><span class="p">);</span> <span class="c1">// return child2 and child3</span>
+</pre></div>
+
+
+<h3 id="notselector"><code>.not(selector)</code><a class="headerlink" href="#notselector" title="Permanent link">&para;</a></h3>
+<p>Remove elements from the collection.</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">().</span><span class="n">not</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">);</span> <span class="o">//</span> <span class="n">remove</span> <span class="n">all</span> <span class="n">cq</span><span class="p">:</span><span class="n">Pages</span> <span class="n">from</span> <span class="n">the</span> <span class="n">collection</span>
+$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">().</span><span class="n">not</span><span class="p">(</span>&quot;<span class="p">:</span><span class="n">first</span>&quot;<span class="p">).</span><span class="n">not</span><span class="p">(</span>&quot;<span class="p">:</span><span class="n">last</span>&quot;<span class="p">);</span> <span class="o">//</span> <span class="n">remove</span> <span class="n">the</span> <span class="n">first</span> <span class="n">and</span> <span class="n">the</span> <span class="n">last</span> <span class="n">element</span> <span class="n">of</span> <span class="n">the</span> <span class="n">collection</span>
+</pre></div>
+
+
+<h3 id="parent"><code>.parent()</code><a class="headerlink" href="#parent" title="Permanent link">&para;</a></h3>
+<p>Replace each element in the collection with its parent.</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="nb">find</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">PageContent</span><span class="p">[</span><span class="n">jcr</span><span class="p">:</span><span class="n">title</span><span class="p">=</span><span class="n">My</span> <span class="n">page</span><span class="p">]:</span><span class="n">first</span>&quot;<span class="p">).</span><span class="n">parent</span><span class="p">();</span> <span class="o">//</span> <span class="nb">find</span> <span class="n">the</span> <span class="n">parent</span> <span class="n">of</span> <span class="n">the</span> <span class="n">first</span> `<span class="n">cq</span><span class="p">:</span><span class="n">PageContent</span>` <span class="n">resource</span> <span class="n">with</span> <span class="n">given</span> <span class="n">attribute</span> <span class="n">in</span>
  <span class="n">the</span> <span class="n">subtree</span>
+</pre></div>
+
+
+<h3 id="parentsselector"><code>.parents([selector])</code><a class="headerlink" href="#parentsselector" title="Permanent link">&para;</a></h3>
+<p>For each element in the collection find all of its ancestors, optionally filtering them by a selector.</p>
+<div class="codehilite"><pre><span class="p">(</span>$<span class="n">resource</span><span class="p">).</span><span class="n">parents</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">);</span> <span class="o">//</span> <span class="n">create</span> <span class="n">page</span> <span class="n">breadcrumbs</span> <span class="k">for</span> <span class="n">the</span> <span class="n">given</span> <span class="n">resources</span>
+</pre></div>
+
+
+<h3 id="parentsuntilselector"><code>.parentsUntil(selector)</code><a class="headerlink" href="#parentsuntilselector" title="Permanent link">&para;</a></h3>
+<p>For each element in the collection find all of its ancestors until a resource matching the selector is found.</p>
+<div class="codehilite"><pre><span class="p">(</span>$<span class="n">currentResource</span><span class="p">).</span><span class="n">parentsUntil</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">);</span> <span class="o">//</span> <span class="nb">find</span> <span class="n">all</span> <span class="n">ancestor</span> <span class="n">components</span> <span class="n">on</span> <span class="n">the</span> <span class="n">current</span> <span class="n">page</span>
+</pre></div>
+
+
+<h3 id="prevselector"><code>.prev([selector])</code><a class="headerlink" href="#prevselector" title="Permanent link">&para;</a></h3>
+<p>Return the previous sibling for each resource in the collection and optionally filter it by a selector. If the selector is given, but the sibling doesn't match it, empty collection will be returned.</p>
+<div class="codehilite"><pre><span class="c1">// let&#39;s assume that resource have 3 children: child1, child2 and child3</span>
+<span class="err">$</span><span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">().</span><span class="n">last</span><span class="p">().</span><span class="n">prev</span><span class="p">();</span> <span class="c1">// return child2</span>
+</pre></div>
+
+
+<h3 id="prevallselector"><code>.prevAll([selector])</code><a class="headerlink" href="#prevallselector" title="Permanent link">&para;</a></h3>
+<p>Return all preceding siblings for each resource in the collection, optionally filtering them by a selector.</p>
+<div class="codehilite"><pre><span class="c1">// let&#39;s assume that resource have 3 children: child1, child2 and child3</span>
+<span class="err">$</span><span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">().</span><span class="n">last</span><span class="p">().</span><span class="n">prevAll</span><span class="p">();</span> <span class="c1">// return child1 and child2</span>
+</pre></div>
+
+
+<h3 id="prevuntilselector"><code>.prevUntil(selector)</code><a class="headerlink" href="#prevuntilselector" title="Permanent link">&para;</a></h3>
+<p>Return all preceding siblings for each resource in the collection up to, but not including, resource matched by a selector.</p>
+<div class="codehilite"><pre><span class="c1">// let&#39;s assume that resource have 4 children: child1, child2, child3 and child4</span>
+<span class="c1">// additionally, child1 has property jcr:title=Page</span>
+<span class="err">$</span><span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">().</span><span class="n">last</span><span class="p">().</span><span class="n">prevUntil</span><span class="p">(</span><span class="s">&quot;[jcr:title=Page]&quot;</span><span class="p">);</span> <span class="c1">// return child2 and child3</span>
+</pre></div>
+
+
+<h3 id="searchstrategystrategy"><code>.searchStrategy(strategy)</code><a class="headerlink" href="#searchstrategystrategy" title="Permanent link">&para;</a></h3>
+<p>Select new search strategy, which will be used in following <a href="#findselector"><code>find()</code></a> and <a href="#hasselector"><code>has()</code></a> function invocations. There 3 options:</p>
+<ul>
+<li><code>SearchStrategy.DFS</code> - <a href="http://en.wikipedia.org/wiki/Depth-first_search">depth-first search</a></li>
+<li><code>SearchStrategy.BFS</code> - <a href="http://en.wikipedia.org/wiki/Breadth-first_search">breadth-first search</a></li>
+<li><code>SearchStrategy.QUERY</code> - use JCR SQL2 query (default since 1.4.0)</li>
+</ul>
+<p>DFS and BFS iterate through descendants using appropriate algorithm. QUERY strategy tries to transform SlingQuery selector into a SQL2 query and invokes it. Because there are SlingQuery operations that can't be translated (eg. <code>:has()</code> modifier), the SQL2 query result is treated as a initial collection that needs further processing.</p>
+<h3 id="siblingsselector"><code>.siblings([selector])</code><a class="headerlink" href="#siblingsselector" title="Permanent link">&para;</a></h3>
+<p>Return siblings for the given resources, optionally filtered by a selector.</p>
+<div class="codehilite"><pre>$<span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">closest</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">).</span><span class="n">siblings</span><span class="p">(</span>&quot;<span class="n">cq</span><span class="p">:</span><span class="n">Page</span>&quot;<span class="p">);</span> <span class="o">//</span> <span class="k">return</span> <span class="n">all</span> <span class="n">sibling</span> <span class="n">pages</span>
+</pre></div>
+
+
+<h3 id="slicefrom-to"><code>.slice(from[, to])</code><a class="headerlink" href="#slicefrom-to" title="Permanent link">&para;</a></h3>
+<p>Reduce the collection to a sub-collection specified by a given range. Both <code>from</code> and <code>to</code> are inclusive and 0-based indices. If the <code>to</code> parameter is not specified, the whole sub-collection starting with <code>from</code> will be returned.</p>
+<div class="codehilite"><pre><span class="c1">// let&#39;s assume that resource have 4 children: child1, child2, child3 and child4</span>
+<span class="err">$</span><span class="p">(</span><span class="n">resource</span><span class="p">).</span><span class="n">children</span><span class="p">().</span><span class="n">slice</span><span class="p">(</span><span class="mh">1</span><span class="p">,</span> <span class="mh">2</span><span class="p">);</span> <span class="c1">// return child1 and child2</span>
+</pre></div>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+        Rev. 1809599 by tomekr on Mon, 25 Sep 2017 10:28:26 +0000
+      </div>
+      <div class="trademarkFooter"> 
+        Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project
+        logo are trademarks of The Apache Software Foundation. All other marks mentioned
+        may be trademarks or registered trademarks of their respective owners.
+      </div>
+    </div>
+  </body>
+</html>