You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2017/09/26 12:40:39 UTC

[04/30] sling-site git commit: Resync with svn content at revision 1809724

http://git-wip-us.apache.org/repos/asf/sling-site/blob/f47e8676/documentation/bundles/sling-pipes.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/sling-pipes.html b/documentation/bundles/sling-pipes.html
index b574f2d..9a62e92 100644
--- a/documentation/bundles/sling-pipes.html
+++ b/documentation/bundles/sling-pipes.html
@@ -72,10 +72,11 @@
         </div>        <div class="main">
 <div class="breadcrumbs"><a href="/ng/">Home</a>&nbsp;&raquo;&nbsp;<a href="/ng/documentation.html">Documentation</a>&nbsp;&raquo;&nbsp;<a href="/ng/documentation/bundles.html">Bundles</a>&nbsp;&raquo;&nbsp;</div>            <h1>
                 Sling Pipes
-            </h1><div class="row"><div class="small-12 columns"><section class="wrap"><p>tool for doing extract - transform - load operations through a resource tree configuration.</p>
+            </h1><div class="row"><div class="small-12 columns"><section class="wrap"><p>tool set for doing extract - transform - load operations by chaining proven code bits.</p>
 <p>often one-shot data transformations need sample code to be written &amp; executed. This tiny tool set intends to provide ability to do such transformations with proven &amp; reusable blocks called pipes, streaming resources from one to the other.</p>
 <h2><a href="#what-is-a-pipe" name="what-is-a-pipe">What is a pipe</a></h2>
 <pre><code>         getOutputBinding
+
                ^
                |
  getInput  +---+---+   getOutput
@@ -86,19 +87,19 @@
 </code></pre>
 <p>A sling pipe is essentially a sling resource stream:</p>
 <ul>
-  <li>it provides an output as a sling resource iterator</li>
-  <li>it gets its input either from a configured path, either, if its chained (see container pipes below), from another pipe's output</li>
-  <li>each pipe can have additional dynamic inputs using other's bindings, and outputing its own bindings</li>
+  <li>it provides an output as a sling resource iterator,</li>
+  <li>it gets its input either from a configured path, either from former pipe's output,</li>
+  <li>each pipe can have contextual inputs using any other pipe's bindings, and outputting its own bindings</li>
 </ul>
 <p>At this moment, there are 3 types of pipes to consider:</p>
 <ul>
   <li>"reader" pipes, that will just output a set of resource depending on the input</li>
-  <li>"writer" pipes, that write to the repository, depending on configuration and output</li>
+  <li>"writer" pipes, that modify the repository, depending on configuration and input</li>
   <li>"container" pipes, that contains pipes, and whose job is to chain their execution : input is the input of their first pipe,  output is the output of the last pipe it contains.</li>
 </ul>
-<p>A <code>Plumber</code> osgi service is provided to help getting &amp; executing pipes.</p>
-<h2><a href="#registered-pipes" name="registered-pipes">Registered Pipes</a></h2>
-<p>a pipe configuration is a jcr node, with:</p>
+<p>A <code>Plumber</code> osgi service is provided to help getting, building &amp; executing pipes.</p>
+<h2>How to configure &amp; execute a pipe</h2>
+<p>A pipe configuration is ultimately a jcr node, with properties (varying a lot depending on the pipe type):</p>
 <ul>
   <li><code>sling:resourceType</code> property, which must be a pipe type registered by the plumber</li>
   <li><code>name</code> property, that will be used in bindings as an id, and will be the key for the output bindings (default value being a value map of the current output resource). Note that the node name will be used in case no name is provided.</li>
@@ -108,43 +109,118 @@
   <li><code>additionalScripts</code> is a multi value property to declare scripts that can be reused in expressions</li>
   <li><code>conf</code> optional child node that contains addition configuration of the pipe (depending on the type)</li>
 </ul>
+<p>This configuration can be generated quickly through Pipe Builder API.</p>
+<p>Once configuration is done, it's possible to execute Pipes </p>
+<ul>
+  <li>through plain java, with configured pipe resource as parameter,</li>
+  <li>through PipeBuilder API,</li>
+  <li>through HTTP API with GET (read) or POST (read/write) methods against configured pipe resource</li>
+</ul>
+<h3><a href="#pipe-builder-api" name="pipe-builder-api">Pipe Builder API</a></h3>
+<p>Plumber can provider a PipeBuilder with <code>newPipe(ResourceResolver resolver)</code> API, that gives a fluent API to quickly configure and run pipes. e.g. </p>
+<pre><code>plumber.newPipe(resolver).xpath(&#39;//element(*,nt:unstructured)[@sling:resourceType=&#39;to/delete&#39;]&quot;).rm().run();
+</code></pre>
+<p>will search for resource of type <code>to/delete</code> and remove them.</p>
+<p>PipeBuilder basically will automatically configure a container pipe, chaining pipes you can configure  with a fluent API:</p>
+<ul>
+  <li><code>pipe(type)</code> generate a new subpipe,</li>
+  <li><code>with(Object...)</code> add to actual subpipe configuration node key/value configurations,</li>
+  <li><code>expr(String)</code> add an expression configuration</li>
+  <li><code>path(String)</code> add an input path,</li>
+  <li><code>name(String)</code> specify a name (there would be a default one, named 'one', 'two', ... depending on the position otherwise),</li>
+  <li><code>conf(Object...)</code> add an extra configuration node with key/value properties/values</li>
+</ul>
+<p>note that that configuration part has shortcuts for some pipes. Typically, above sample is a shorter equivalent of </p>
+<pre><code>plumber.newPipe(resolver).pipe(&#39;slingPipes/xpath&#39;).expr(&#39;//element(*,nt:unstructured)[@sling:resourceType=&#39;to/delete&#39;]&quot;).pipe(&#39;slingPipes/rm&#39;).run();
+</code></pre>
+<p>when available, shortcuts will be specified next to each pipe type documentation.</p>
+<p>Once you are happy with the pipe you have created, you can terminate the builder with following command:</p>
+<ul>
+  <li><code>build()</code> will build the pipe under /var/pipes/... (random node under timed base path),</li>
+  <li><code>run(bindings)</code> will build the pipe, and run it with additional <code>bindings</code>,</li>
+  <li><code>runAsync(bindings)</code> will do the same, but asynchronously,</li>
+  <li><code>run()</code> will build &amp; run synchronously the pipe, with no bindings.</li>
+</ul>
+<h3><a href="#http-api" name="http-api">HTTP API</a></h3>
+<h5><a href="#request-path" name="request-path">Request Path</a></h5>
+<ul>
+  <li>
+    <p>either you'll need to create a slingPipes/plumber resource, say <code>etc/pipes</code> and then to execute</p>
+    <p>curl -u admin:admin -F "path=/etc/pipes/mySamplePipe" http://localhost:8080/etc/pipes.json</p>
+  </li>
+  <li>
+    <p>either you execute the request directly on the pipe Path, e.g.</p>
+    <p>curl -u admin:admin http://localhost:8080/etc/pipes/mySamplePipe.json</p>
+  </li>
+</ul>
+<p>which will return you the path of the resources that have been through the output of the configured pipe.</p>
+<p>In the eventuality of a long execution (synchronous or asynchronous), you can retrieve the status of a pipe, by executing</p>
+<pre><code>GET /etc/pipes/mySamplePipe.status.json
+</code></pre>
+<h5>Request Parameter <code>binding</code></h5>
+<p>you can add as <code>bindings</code> parameter a json object of global bindings you want to add for the execution of the pipe</p>
+<p>e.g.</p>
+<pre><code>curl -u admin:admin -F &quot;path=/etc/pipes/test&quot; -F &quot;bindings={testBinding:&#39;foo&#39;}&quot; http://localhost:4502/etc/pipes.json
+</code></pre>
+<p>will returns something like</p>
+<pre><code>{&quot;size&quot;:2, &quot;items&quot;:[&quot;/one/output/resource&quot;, &quot;another/one&quot;]}
+</code></pre>
+<h5>Request Parameter <code>writer</code></h5>
+<p>you can configure output of your servlet, with <code>writer</code> parameter, a json object as a pattern to the result you want to have. The values of the json object are expressions and can reuse each pipe's subpipe binding. </p>
+<p>e.g.</p>
+<pre><code>curl -u admin:admin http://localhost:4502/etc/pipes/users.json?writer={&quot;user&quot;:&quot;${user.fullName}&quot;}
+</code></pre>
+<p>will returns something similar to</p>
+<pre><code>{&quot;size&quot;:2, &quot;items&quot;:[{&#39;user&#39;:&#39;John Smith&#39;,&#39;path&#39;:&#39;/home/users/q/q123jk1UAZS&#39;},{&#39;user&#39;:&#39;John Doe&#39;,&#39;path&#39;:&#39;/home/users/q/q153jk1UAZS&#39;}]}
+</code></pre>
+<h5>Request Parameter <code>dryRun</code></h5>
+<p>if parameter dryRun is set to true, and the executed pipe is supposed to modify content, it will log (at best it can) the change it <em>would</em> have done, without doing anything</p>
+<h5>Request Parameter <code>size</code></h5>
+<p>default response is truncated to 10 items, if you need more (or less), you can modify that settings with the size parameter</p>
+<h5>Request Parameter <code>async</code></h5>
+<p>allow asynchronous execution of the given type. This is advised in case you plan your pipe execution to last longer than the session of your HTTP client. If used, the returned value will be id of the created sling Job. In that case you can monitor the pipes path with <code>status</code> selector as described above until it has the value <code>finished</code>.</p>
+<h2><a href="#registered-pipes" name="registered-pipes">Registered Pipes</a></h2>
 <h3><a href="#readers" name="readers">readers</a></h3>
-<h4><a href="#base-pipe" name="base-pipe">Base pipe</a></h4>
-<p>rather dummy pipe, outputs what is in input (so what is configured in path). Handy for doing some test mostly, and giving basic functionalities to others that inherit from it</p>
+<h5>Base pipe <code>echo(path)</code></h5>
+<p>outputs what is in input (so what is configured in path)</p>
 <ul>
   <li><code>sling:resourceType</code> is <code>slingPipes/base</code></li>
 </ul>
-<h4><a href="#slingquery-pipe" name="slingquery-pipe">SlingQuery Pipe</a></h4>
+<h5>SlingQuery Pipe (<code>$(expr)</code>)</h5>
 <p>executes $(getInput()).children(expression)</p>
 <ul>
   <li><code>sling:resourceType</code> is <code>slingPipes/slingQuery</code></li>
   <li><code>expr</code> mandatory property, contains slingQuery expression through which getInput()'s children will be computed to getOutput()</li>
 </ul>
-<h4><a href="#jsonpipe" name="jsonpipe">JsonPipe</a></h4>
-<p>feeds bindings with remote json</p>
-<ul>
-  <li><code>sling:resourceType</code> is <code>slingPipes/json</code></li>
-  <li><code>expr</code> mandatory property contains url that will be called, the json be sent to the output bindings, getOutput = getInput. An empty url or a failing url will block the pipe at that given place.</li>
-</ul>
-<h4><a href="#multipropertypipe" name="multipropertypipe">MultiPropertyPipe</a></h4>
+<h5><a href="#multipropertypipe" name="multipropertypipe">MultiPropertyPipe</a></h5>
 <p>iterates through values of input multi value property and write them to bindings</p>
 <ul>
   <li><code>sling:resourceType</code> is <code>slingPipes/multiProperty</code></li>
   <li><code>path</code> should be the path of a mv property</li>
 </ul>
-<h4><a href="#xpathpipe" name="xpathpipe">XPathPipe</a></h4>
+<h5>XPathPipe (<code>xpath(expr)</code>)</h5>
 <p>retrieve resources resulting of an xpath query</p>
 <ul>
   <li><code>sling:resourceType</code> is <code>slingPipes/xpath</code></li>
   <li><code>expr</code> should be a valid xpath query</li>
 </ul>
-<h3><a href="#jsonpipe" name="jsonpipe">JsonPipe</a></h3>
+<h5>TraversePipe (<code>traverse()</code>)</h5>
+<p>traverse current input resource's tree, outputing, as resources, either the node of the tree, either its properties</p>
+<ul>
+  <li><code>sling:resourceType</code> is <code>slingPipes/traverse</code>,</li>
+  <li><code>breadthFirst</code> the tree visit will be done deep first, unless this flag is set to true,</li>
+  <li><code>depth</code> max depth the visit should go to,</li>
+  <li><code>properties</code> is a flag mentioning the pipe should traverse node's property,</li>
+  <li><code>nameGlobs</code> filters the property that should get outputed</li>
+</ul>
+<h5>JsonPipe (<code>json(expr)</code>)</h5>
 <p>feeds bindings with remote json</p>
 <ul>
   <li><code>sling:resourceType</code> is <code>slingPipes/json</code></li>
   <li><code>expr</code> mandatory property contains url that will be called, the json be sent to the output bindings, getOutput = getInput. An empty url or a failing url will block the pipe at that given place.</li>
 </ul>
-<h4><a href="#authorizablepipe" name="authorizablepipe">AuthorizablePipe</a></h4>
+<p>In case the json is an array, the pipe will loop over the array elements, and output each one in the binding. Output resource remains each time the input one.</p>
+<h5>AuthorizablePipe (<code>auth(conf)</code>)</h5>
 <p>retrieve authorizable resource corresponding to the id passed in expression, or if not found (or void expression), from the input path, output the found authorizable's resource</p>
 <ul>
   <li><code>sling:resourceType</code> is <code>slingPipes/authorizable</code></li>
@@ -154,48 +230,61 @@
   <li><code>addToGroup</code> (expression) add found authorizable to instanciated group (in that case, considered as a write pipe)</li>
   <li><code>bindMembers</code> (boolean) if found authorizable is a group, bind the members (in that case, considered as a write pipe)</li>
 </ul>
-<h4><a href="#parentpipe" name="parentpipe">ParentPipe</a></h4>
-<p>outputs the parent resource of input resource - <code>sling:resourceType</code> is <code>slingPipes/parent</code></p>
-<h4><a href="#filterpipe" name="filterpipe">FilterPipe</a></h4>
+<h5>ParentPipe (<code>parent()</code>)</h5>
+<p>outputs the parent resource of input resource</p>
+<ul>
+  <li><code>sling:resourceType</code> is <code>slingPipes/parent</code></li>
+</ul>
+<h5>FilterPipe (<code>grep(conf)</code>)</h5>
 <p>outputs the input resource if its matches its configuration</p>
 <ul>
   <li><code>sling:resourceType</code> is <code>slingPipes/filter</code></li>
   <li><code>conf</code> node tree that will be tested against the current input of the pipe, each <code>/conf/sub@prop=value</code> will triggers a test on <code>./sub@prop</code> property of the current input, testing if its value matches <code>value</code> regex. If the special <code>slingPipesFilter_noChildren=${true}</code> property is there with the value instantiated as a true boolean, then filter will pass if corresponding node has no children.</li>
+  <li><code>slingPipesFilter_test=&#39;${...}&#39;</code> evaluates the property value, and filters out the stream if the expression is not a boolean or false</li>
   <li><code>slingPipesFilter_not=&#39;true&#39;</code> inverts the expected result of the filter</li>
 </ul>
+<p>as an example,</p>
+<pre><code>echo(&#39;/content/foo&#39;).grep(&#39;foo&#39;,&#39;bar&#39;,&#39;slingPipesFilter_not&#39;,true).run()
+</code></pre>
+<p>will either return <code>/content/foo</code> either nothing depending on it not containing <code>@foo=bar</code></p>
+<pre><code>echo(&#39;content/foo&#39;).name(&#39;FOO&#39;).grep(&#39;slingPipesFilter_test&#39;,&#39;${FOO.foo == &quot;bar&quot;}&#39;).run()
+</code></pre>
+<p>is an equivalent</p>
 <h3><a href="#containers" name="containers">containers</a></h3>
-<h4><a href="#container-pipe" name="container-pipe">Container Pipe</a></h4>
+<h5><a href="#container-pipe" name="container-pipe">Container Pipe</a></h5>
 <p>assemble a sequence of pipes</p>
 <ul>
   <li><code>sling:resourceType</code> is <code>slingPipes/container</code></li>
   <li><code>conf</code> node contains child pipes' configurations, that will be configured in the order they are found (note you should use sling:OrderedFolder)</li>
 </ul>
-<h4><a href="#referencepipe" name="referencepipe">ReferencePipe</a></h4>
+<p>Note that pipe builder api automatically creates one for you to chain the subpipe you are configuring</p>
+<h5><a href="#referencepipe" name="referencepipe">ReferencePipe</a></h5>
 <p>execute the pipe referenced in path property</p>
 <ul>
   <li><code>sling:resourceType</code> is <code>slingPipes/reference</code></li>
   <li><code>path</code> path of the referenced pipe</li>
 </ul>
 <h3><a href="#writers" name="writers">writers</a></h3>
-<h4><a href="#write-pipe" name="write-pipe">Write Pipe</a></h4>
+<h5>Write Pipe (<code>write(conf)</code>)</h5>
 <p>writes given nodes &amp; properties to current input</p>
 <ul>
   <li><code>sling:resourceType</code> is <code>slingPipes/write</code></li>
   <li><code>conf</code> node tree that will be copied to the current input of the pipe, each property's names and value will be written to the input resource. Input resource will be outputed. Note that properties that will be evaluated (in an expression) as <code>null</code> for a given input resource will be removed from it. E.g. <code>./conf/some/node@prop=${null}</code> will add <code>./conf/some/node</code> structure if not in current input resource, but remove its <code>prop</code> property if any).</li>
 </ul>
-<h3><a href="#movepipe" name="movepipe">MovePipe</a></h3>
+<p>e.g. <code>echo(&#39;/content/foo&#39;).write(&#39;foo&#39;,&#39;bar&#39;).run()</code> will write <code>@foo=bar</code> in <code>/content/foo</code></p>
+<h5>MovePipe (<code>mv(expr)</code>)</h5>
 <p>JCR move of current input to target path (can be a node or a property)</p>
 <ul>
   <li><code>sling:resourceType</code> is <code>slingPipes/mv</code></li>
-  <li><code>expr</code> target path, note that parent path must exists</li>
+  <li><code>expr</code> full target path, note that parent path must exists</li>
 </ul>
-<h4><a href="#removepipe" name="removepipe">RemovePipe</a></h4>
+<h5>RemovePipe (<code>rm()</code>)</h5>
 <p>removes the input resource, returns the parent, regardless of the resource being a node, or a property</p>
 <ul>
   <li><code>sling:resourceType</code> is <code>slingPipes/rm</code></li>
   <li><code>conf</code> node tree that will be used to filter relative properties &amp; subtrees to the current resource to remove. A subnode is considered to be removed if it has no property configured, nore any child.</li>
 </ul>
-<h4><a href="#pathpipe" name="pathpipe">PathPipe</a></h4>
+<h5>PathPipe (<code>mkdir(expr)</code>)</h5>
 <p>get or create path given in expression</p>
 <ul>
   <li><code>sling:resourceType</code> is <code>slingPipes/path</code></li>
@@ -212,167 +301,49 @@
 </ul>
 <p>you can use name of previous pipes in the pipe container, or the special binding <code>path</code>, where <code>path.previousPipe</code> is the path of the current resource of previous pipe named <code>previousPipe</code></p>
 <p>global bindings can be set at pipe execution, external scripts can be added to the execution as well (see pipe  configurations)</p>
-<h2><a href="#how-to-execute-a-pipe" name="how-to-execute-a-pipe">How to execute a pipe</a></h2>
-<p>for now it's possible to execute Pipes through GET (read) or POST (read/write) commands:</p>
-<h3><a href="#request-path" name="request-path">Request Path</a></h3>
-<ul>
-  <li>
-    <p>either you'll need to create a slingPipes/plumber resource, say <code>etc/pipes</code> and then to execute</p>
-    <p>curl -u admin:admin -F "path=/etc/pipes/mySamplePipe" http://localhost:8080/etc/pipes.json</p>
-  </li>
-  <li>
-    <p>either you execute the request directly on the pipe Path, e.g.</p>
-    <p>curl -u admin:admin http://localhost:8080/etc/pipes/mySamplePipe.json</p>
-  </li>
-</ul>
-<p>which will return you the path of the pipes that have been through the output of the configured pipe.</p>
-<h3>Request Parameter <code>binding</code></h3>
-<p>you can add as <code>bindings</code> parameter a json object of global bindings you want to add for the execution of the pipe</p>
-<p>e.g.</p>
-<pre><code>curl -u admin:admin -F &quot;path=/etc/pipes/test&quot; -F &quot;bindings={testBinding:&#39;foo&#39;}&quot; http://localhost:4502/etc/pipes.json
-</code></pre>
-<p>will returns something like</p>
-<pre><code>{&quot;size&quot;:2, &quot;items&quot;:[&quot;/one/output/resource&quot;, &quot;another/one&quot;]}
-</code></pre>
-<h3>Request Parameter <code>writer</code></h3>
-<p>you can add as <code>writer</code> parameter a json object as a pattern to the result you want to have. The values of the json object are expressions and can reuse each pipe's subpipe binding. Note this works only if the pipe called is a container pipe.</p>
-<p>e.g.</p>
-<pre><code>curl -u admin:admin http://localhost:4502/etc/pipes/users.json?writer={&quot;user&quot;:&quot;${user.fullName}&quot;}
-</code></pre>
-<p>will returns something similar to</p>
-<p>{"size":2, "items":[{'user':'John Smith','path':'/home/users/q/q123jk1UAZS'},{'user':'John Doe','path':'/home/users/q/q153jk1UAZS'}]}</p>
-<h3>Request Parameter <code>dryRun</code></h3>
-<p>if parameter dryRun is set to true, and the executed pipe is supposed to modify content, it will log (at best it can) the change it <em>would</em> have done, without doing anything</p>
-<h3>Request Parameter <code>size</code></h3>
-<p>default response is truncated to 10 items, if you need more (or less), you can modify that settings with the size parameter</p>
 <h2><a href="#sample-configurations" name="sample-configurations">sample configurations</a></h2>
-<h3>slingQuery | write</h3>
-<p>this pipe parse all profile nodes, and</p>
-<pre><code>{
-  &quot;sling:resourceType&quot;:&quot;slingPipes/container&quot;,
-  &quot;name&quot;:&quot;Dummy User prefix Sample&quot;,
-  &quot;jcr:description&quot;:&quot;prefix all full names of profile with &quot;Mr&quot; or &quot;Ms&quot; depending on gender&quot;,
-  &quot;conf&quot;:{
-    &quot;profile&quot;: {
-        &quot;sling:resourceType&quot;:&quot;slingPipes/slingQuery&quot;,
-        &quot;expr&quot;:&quot;nt:unstructured#profile&quot;,
-        &quot;path&quot;:&quot;/home/users&quot;
-    },
-    &quot;writeFullName&quot;: {
-        &quot;sling:resourceType&quot;:&quot;slingPipes/write&quot;,
-        &quot;conf&quot;: {
-            &quot;fullName&quot;:&quot;${(profile.gender === &#39;female&#39; ? &#39;Ms &#39; + profile.fullName : &#39;Mr &#39; + profile.fullName)}&quot;,
-            &quot;generatedBy&quot;:&quot;slingPipes&quot;
-        }
-    }
-  }
-}
+<h5>slingQuery | write</h5>
+<p>write repository user prefix Ms/Mr depending on gender</p>
+<pre><code>  plumber.newPipe(resolver).xpath(&#39;/jcr:root/home/users//element(*,rep:Users)&#39;)
+  .$(&#39;nt:unstructured#profile&#39;)
+  .write(&quot;fullName&quot;,&quot;${(profile.gender === &#39;female&#39; ? &#39;Ms &#39; + profile.fullName : &#39;Mr &#39; + profile.fullName)}&quot;)
+  .run()
 </code></pre>
-<h3>slingQuery | multiProperty | authorizable | write</h3>
-<pre><code>{
-  &quot;jcr:primaryType&quot;: &quot;sling:Folder&quot;,
-  &quot;jcr:description&quot;: &quot;move badge&lt;-&gt;user relation ship from badge MV property to a user MV property&quot;
-  &quot;name&quot;: &quot;badges&quot;,
-  &quot;sling:resourceType&quot;: &quot;slingPipes/container&quot;,
-  &quot;conf&quot;: {
-    &quot;jcr:primaryType&quot;: &quot;sling:OrderedFolder&quot;,
-    &quot;badge&quot;: {
-      &quot;jcr:primaryType&quot;: &quot;sling:Folder&quot;,
-      &quot;jcr:description&quot;: &quot;outputs all badge component resources&quot;,
-      &quot;expr&quot;: &quot;[sling:resourceType=myApp/components/badge]&quot;,
-      &quot;path&quot;: &quot;/etc/badges/badges-admin/jcr:content&quot;,
-      &quot;sling:resourceType&quot;: &quot;slingPipes/slingQuery&quot;
-      },
-    &quot;profile&quot;: {
-      &quot;jcr:primaryType&quot;: &quot;sling:Folder&quot;,
-      &quot;jcr:description&quot;: &quot;retrieve all user ids from a mv property&quot;,
-      &quot;path&quot;: &quot;${path.badge}/profiles&quot;,
-      &quot;sling:resourceType&quot;: &quot;slingPipes/multiProperty&quot;
-    },
-    &quot;user&quot;: {
-      &quot;jcr:primaryType&quot;: &quot;sling:OrderedFolder&quot;,
-      &quot;jcr:description&quot;: &quot;outputs user resource&quot;,
-      &quot;expr&quot;: &quot;profile&quot;,
-      &quot;sling:resourceType&quot;: &quot;slingPipes/authorizable&quot;
-    },
-    &quot;write&quot;: {
-      &quot;jcr:primaryType&quot;: &quot;sling:OrderedFolder&quot;,
-      &quot;jcr:descritption&quot;: &quot;patches the badge path to the badges property of the user profile&quot;
-      &quot;path&quot;: &quot;${path.user}/profile&quot;,
-      &quot;sling:resourceType&quot;: &quot;slingPipes/write&quot;,
-      &quot;conf&quot;: {
-        &quot;jcr:primaryType&quot;: &quot;nt:unstructured&quot;,
-        &quot;badges&quot;: &quot;+[${path.badge}]&quot;
-      }
-    }
-  }
-}
+<h5>slingQuery | multiProperty | authorizable | write</h5>
+<p>move badge&lt;-&gt;user relation ship from badge-&gt;users MV property to a user-&gt;badges MV property</p>
+<pre><code> plumber.newPipe(resolver).echo(&#39;/etc/badges/jcr:content/par&#39;)
+ .$(&#39;[sling:resourceType=myApp/components/badge]&#39;).name(&#39;badge&#39;)
+ .pipe(&#39;slingPipes/multiProperty&#39;).path(&#39;${path.badge}/profiles&#39;).name(&#39;profile&#39;)
+ .auth(&#39;${profile}&#39;).name(&#39;user&#39;)
+ .echo(&#39;${path.user}/profile&#39;)
+ .write(&#39;badges&#39;,&#39;+[${path.badge}]&#39;)
+ .run()
 </code></pre>
-<h3>xpath | json | write</h3>
-<p>this use case is for completing repository profiles with external system's data (that has an json api)</p>
-<pre><code>{
-  &quot;jcr:primaryType&quot;: &quot;nt:unstructured&quot;,
-  &quot;jcr:description&quot;: &quot;this pipe retrieves json info from an external system and writes them to the user profile, uses moment.js, it
-  distributes modified resources using publish distribution agent&quot;,
-  &quot;sling:resourceType&quot;: &quot;slingPipes/container&quot;,
-  &quot;distribution.agent&quot;: &quot;publish&quot;,
-  &quot;additionalScripts&quot;: &quot;/etc/source/moment.js&quot;,
-  &quot;conf&quot;: {
-    &quot;jcr:primaryType&quot;: &quot;sling:OrderedFolder&quot;,
-    &quot;profile&quot;: {
-      &quot;jcr:primaryType&quot;: &quot;sling:OrderedFolder&quot;,
-      &quot;expr&quot;: &quot;/jcr:root/home/users//element(profile,nt:unstructured)[@uid]&quot;,
-      &quot;jcr:description&quot;: &quot;query all user profile nodes&quot;,
-      &quot;sling:resourceType&quot;: &quot;slingPipes/xpath&quot;
-    },
-    &quot;json&quot;: {
-      &quot;jcr:primaryType&quot;: &quot;sling:OrderedFolder&quot;,
-      &quot;expr&quot;: &quot;${(profile.uid ? &#39;https://my.external.system.corp.com/profiles/&#39; + profile.uid.substr(0,2) + &#39;/&#39; + profile.uid + &#39;.json&#39; : &#39;&#39;)&quot;,
-      &quot;jcr:description&quot;: &quot;retrieves json information relative to the given profile, if the uid is not found, expr is empty: the pipe will do nothing&quot;,
-      &quot;sling:resourceType&quot;: &quot;slingPipes/json&quot;
-    },
-    &quot;write&quot;: {
-      &quot;jcr:primaryType&quot;: &quot;sling:OrderedFolder&quot;,
-      &quot;path&quot;: &quot;path.profile&quot;,
-      &quot;jcr:description&quot;: &quot;write json information to the profile node&quot;,
-      &quot;sling:resourceType&quot;: &quot;slingPipes/write&quot;,
-      &quot;conf&quot;: {
-        &quot;jcr:primaryType&quot;: &quot;sling:OrderedFolder&quot;,
-        &quot;background&quot;: &quot;${json.opt(&#39;background&#39;)}&quot;,
-        &quot;about&quot;: &quot;${json.opt(&#39;about&#39;)}&quot;,
-        &quot;birthday&quot;: &quot;${(json.opt(&#39;birthday&#39;) ? moment(json.opt(&#39;birthday&#39;), \&quot;MMMM DD\&quot;).toDate() : &#39;&#39;)}&quot;,
-        &quot;mobile&quot;: &quot;${json.opt(&#39;mobile&#39;)}&quot;
-      }
-    }
-  }
-}
-</code></pre>
-<h3>xpath | parent | rm</h3>
-<pre><code>{
-  &quot;jcr:primaryType&quot;: &quot;nt:unstructured&quot;,
-  &quot;jcr:description&quot;: &quot;this pipe removes user with bad property in their profile&quot;,
-  &quot;sling:resourceType&quot;: &quot;slingPipes/container&quot;,
-  &quot;conf&quot;: {
-    &quot;jcr:primaryType&quot;: &quot;sling:OrderedFolder&quot;,
-    &quot;profile&quot;: {
-      &quot;jcr:primaryType&quot;: &quot;sling:OrderedFolder&quot;,
-      &quot;expr&quot;: &quot;/jcr:root/home/users//element(profile,nt:unstructured)[@bad]&quot;,
-      &quot;jcr:description&quot;: &quot;query all user profile nodes with bad properties&quot;,
-      &quot;sling:resourceType&quot;: &quot;slingPipes/xpath&quot;
-    },
-    &quot;parent&quot;: {
-      &quot;jcr:primaryType&quot;: &quot;sling:OrderedFolder&quot;,
-      &quot;jcr:description&quot;: &quot;get the parent node (user node)&quot;,
-      &quot;sling:resourceType&quot;: &quot;slingPipes/parent&quot;
-    },
-    &quot;rm&quot;: {
-      &quot;jcr:primaryType&quot;: &quot;sling:OrderedFolder&quot;,
-      &quot;jcr:description&quot;: &quot;remove it&quot;,
-      &quot;sling:resourceType&quot;: &quot;slingPipes/rm&quot;,
-    }
-  }
-}
+<h5>echo | $ | $ | echo | json | write</h5>
+<p>this use case is for completing repository website with external system's data (that has an json api), it does </p>
+<ul>
+  <li>loop over "my:Page" country/language tree under <code>/content/mySite</code>,</li>
+  <li>fetch json with contextual parameter that must be in upper case,</li>
+  <li>and write part of the returned json in the current resource.</li>
+</ul>
+<p>This pipe is run asynchronously in case the execution takes long.</p>
+<pre><code>plumber.newPipe(resolver)
+ .echo(&quot;/content/mySite&quot;)
+ .$(&#39;my:Page&#39;)
+ .$(&#39;my:Page&#39;).name(&quot;localePage&quot;)
+ .echo(&#39;${path.localePage}/jcr:content&#39;).name(&quot;content&quot;)
+ .json(&#39;https://www.external.com/api/${content.country.toUpperCase()}.json.name(&#39;api&#39;)
+ .write(&#39;cachedValue&#39;,&#39;${api.remoteJsonValueWeWant}&#39;)
+ .runAsync(null)
 </code></pre>
+<h5>xpath | parent | rm</h5>
+<ul>
+  <li>query all user profile nodes with bad properties,</li>
+  <li>get the parent node (user node)</li>
+  <li>remove it
+    <p>plumber.newPipe(resolver) .xpath("/jcr:root/home/users//element(profile,nt:unstructured)[@bad]") .parent().rm().run()</p>
+  </li>
+</ul>
 <p>some other samples are in https://github.com/npeltier/sling-pipes/tree/master/src/test/</p>
 <h1><a href="#compatibility" name="compatibility">Compatibility</a></h1>
 <p>For running this tool on a sling instance you need:</p>

http://git-wip-us.apache.org/repos/asf/sling-site/blob/f47e8676/documentation/bundles/sling-query.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/sling-query.html b/documentation/bundles/sling-query.html
index 8f03873..a3bbb21 100644
--- a/documentation/bundles/sling-query.html
+++ b/documentation/bundles/sling-query.html
@@ -98,8 +98,8 @@ $(resource).closest(&quot;cq:Page[jcr:content/cq:template=my/template]&quot;)
 <p>SlingQuery is inspired by the jQuery framework. jQuery is the source of method names, selector string syntax and the dollar sign method used as a collection constructor.</p>
 <h2><a href="#features" name="features">Features</a></h2>
 <ul>
-  <li>useful <a href="https://github.com/Cognifide/Sling-Query/wiki/Method-list">operations</a> to traverse the resource tree,</li>
-  <li>flexible <a href="https://github.com/Cognifide/Sling-Query/wiki/Selector-syntax">filtering syntax</a>,</li>
+  <li>useful <a href="/documentation/bundles/sling-query/methods.html">operations</a> to traverse the resource tree,</li>
+  <li>flexible <a href="/documentation/bundles/sling-query/selectors.html">filtering syntax</a>,</li>
   <li>lazy evaluation of the query result,</li>
   <li><code>SlingQuery</code> object is immutable (thread-safe),</li>
   <li>fluent, friendly, jQuery-like API.</li>
@@ -114,17 +114,17 @@ $(resource).closest(&quot;cq:Page[jcr:content/cq:template=my/template]&quot;)
 </code></pre>
 <h2><a href="#documentation" name="documentation">Documentation</a></h2>
 <ul>
-  <li><a href="http://cognifide.github.io/Sling-Query/circuit2014/">CIRCUIT 2014 presentation</a></li>
-  <li><a href="https://github.com/Cognifide/Sling-Query/wiki/Basic-ideas">Basic ideas</a></li>
-  <li><a href="https://github.com/Cognifide/Sling-Query/wiki/Method-list">Method list</a></li>
-  <li><a href="https://github.com/Cognifide/Sling-Query/wiki/Selector-syntax">Selector syntax</a>
+  <li><a href="/documentation/bundles/sling-query/basic-ideas.html">Basic ideas</a></li>
+  <li><a href="/documentation/bundles/sling-query/methods.html">Method list</a></li>
+  <li><a href="/documentation/bundles/sling-query/selectors.html">Selector syntax</a>
     <ul>
-      <li><a href="https://github.com/Cognifide/Sling-Query/wiki/Operator-list">Operator list</a></li>
-      <li><a href="https://github.com/Cognifide/Sling-Query/wiki/Modifier-list">Modifier list</a></li>
-      <li><a href="https://github.com/Cognifide/Sling-Query/wiki/Hierarchy-operator-list">Hierarchy operator list</a></li>
+      <li><a href="/documentation/bundles/sling-query/hierarchy-operators.html">Operator list</a></li>
+      <li><a href="/documentation/bundles/sling-query/modifiers.html">Modifier list</a></li>
+      <li><a href="/documentation/bundles/sling-query/operators.html">Hierarchy operator list</a></li>
     </ul>
   </li>
-  <li><a href="https://github.com/Cognifide/Sling-Query/wiki/Examples">Examples</a></li>
+  <li><a href="/documentation/bundles/sling-query/vs-jcr.html">Sling Query vs. JCR</a></li>
+  <li><a href="/documentation/bundles/sling-query/examples.html">Examples</a></li>
 </ul>
 <h2><a href="#external-resources" name="external-resources">External resources</a></h2>
 <ul>

http://git-wip-us.apache.org/repos/asf/sling-site/blob/f47e8676/documentation/bundles/sling-query/basic-ideas.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/sling-query/basic-ideas.html b/documentation/bundles/sling-query/basic-ideas.html
new file mode 100644
index 0000000..8ce8e91
--- /dev/null
+++ b/documentation/bundles/sling-query/basic-ideas.html
@@ -0,0 +1,136 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html lang="en">
+<head>
+        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
+        <title>Apache Sling :: Basic Ideas</title>
+        <link rel="icon" href="/ng/res/favicon.ico"/>
+        <link rel="stylesheet" href="/ng/res/css/site.css"/>
+        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"/>
+        <script src='https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js'></script><script>
+            hljs.initHighlightingOnLoad();
+        </script>
+        
+    </head>    <body>
+<div class="title">
+            <div class="logo">
+                <a href="http://sling.apache.org">
+                    <img border="0" alt="Apache Sling" src="/ng/res/logos/sling.svg"/>
+                </a>
+            </div><div class="header">
+                <a href="http://www.apache.org">
+                    <img border="0" alt="Apache" src="/ng/res/logos/apache.png"/>
+                </a>
+            </div>
+        </div><h1 class="draft">DRAFT 2017 WEBSITE - SLING-6955</h1><div class="menu">
+            <p>
+                <strong><a href="/ng/documentation.html">Documentation</a></strong><br/>
+                <a href="/ng/documentation/getting-started.html">Getting Started</a><br/>
+                <a href="/ng/documentation/the-sling-engine.html">The Sling Engine</a><br/>
+                <a href="/ng/documentation/development.html">Development</a><br/>
+                <a href="/ng/documentation/bundles.html">Bundles</a><br/>
+                <a href="/ng/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/>
+                <a href="/ng/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><br/>
+                
+            </p><p>
+                <strong>API Docs</strong><br/>
+                <a href="/ng/apidocs/sling9/index.html">Sling 9</a><br/>
+                <a href="/ng/apidocs/sling8/index.html">Sling 8</a><br/>
+                <a href="/ng/apidocs/sling7/index.html">Sling 7</a><br/>
+                <a href="/ng/apidocs/sling6/index.html">Sling 6</a><br/>
+                <a href="/ng/apidocs/sling5/index.html">Sling 5</a><br/>
+                <a href="/ng/javadoc-io.html">Archive at javadoc.io</a><br/>
+                
+            </p><p>
+                <strong>Project info</strong><br/>
+                <a href="/ng/downloads.cgi">Downloads</a><br/>
+                <a href="http://www.apache.org/licenses/">License</a><br/>
+                <a href="/ng/contributing.html">Contributing</a><br/>
+                <a href="/ng/news.html">News</a><br/>
+                <a href="/ng/links.html">Links</a><br/>
+                <a href="/ng/project-information.html">Project Information</a><br/>
+                <a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/>
+                <a href="/ng/project-information/security.html">Security</a><br/>
+                
+            </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><br/>
+                
+            </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="https://donate.apache.org/">Donate!</a><br/>
+                <a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a><br/>
+                
+            </p><p>
+                <strong><a href="/ng/sitemap.html">Site Map</a></strong>
+            </p>
+        </div>        <div class="main">
+<div class="breadcrumbs"><a href="/ng/">Home</a>&nbsp;&raquo;&nbsp;<a href="/ng/documentation.html">Documentation</a>&nbsp;&raquo;&nbsp;<a href="/ng/documentation/bundles.html">Bundles</a>&nbsp;&raquo;&nbsp;<a href="/ng/documentation/bundles/sling-query.html">Sling Query</a>&nbsp;&raquo;&nbsp;</div>            <h1>
+                Basic Ideas
+            </h1><div class="row"><div class="small-12 columns"><section class="wrap"><h3><a href="#collections" name="collections">Collections</a></h3>
+<p><code>SlingQuery</code> class represents a collection of resources. Basic collection can be created explicitly via a dollar method:</p>
+<pre><code>$(resource1, resource2, resource3)
+</code></pre>
+<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>
+<pre><code>for (Resource resource in $(...)) { }
+</code></pre>
+<h3><a href="#operations" name="operations">Operations</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>
+<pre><code>$(resource1, resource2).parent()
+</code></pre>
+<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>
+<pre><code>$(resource1, resource2).children();
+</code></pre>
+<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>
+<pre><code>$(resource1, resource2).first();
+</code></pre>
+<p>Methods can be chained to create more complex query. Eg. following code will return last direct child of the <code>resource</code>:</p>
+<pre><code>$(resource).children().last();
+</code></pre>
+<h4><a href="#laziness" name="laziness">Laziness</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>
+<pre><code>$(resource).children().children().first();
+</code></pre>
+<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><a href="#immutability" name="immutability">Immutability</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>
+<pre><code>SlingQuery children = $(resource).children();
+SlingQuery firstChild = children.first();
+for (Resource child : children) { /* will display all children */ }
+for (Resource child : firstChild) { /* will display the first child */ }
+</code></pre>
+<h3><a href="#selectors" name="selectors">Selectors</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>
+<pre><code>&quot;cq:Page&quot;
+</code></pre>
+<p>It will match all resources with the given resource type. Example:</p>
+<pre><code>$(resource).children(&quot;cq:Page&quot;)
+</code></pre>
+<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>
+<pre><code>$(resource).children(&quot;cq:Page[jcr:title=Some title][jcr:description=Some desc]&quot;)
+</code></pre>
+<p>And finally, you could add some modifiers at the end:</p>
+<pre><code>$(resource).children(&quot;cq:Page[jcr:content/cq:template=my/template]:even&quot;)
+</code></pre>
+<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>&quot;&quot;</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>
+<pre><code>&quot;foundation/components/richtext&quot; // resource type
+&quot;foundation/components/richtext:first&quot; // resource type with modifier
+&quot;[property=value][property2=value2]&quot; // two attributes
+&quot;:even&quot; // modifier
+&quot;:even:not(:first)&quot; // two modifiers, the second one is nested
+</code></pre></section></div></div>
+<div class="footer">
+                <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>            
+            
+        </div>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/sling-site/blob/f47e8676/documentation/bundles/sling-query/examples.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/sling-query/examples.html b/documentation/bundles/sling-query/examples.html
new file mode 100644
index 0000000..e7e7540
--- /dev/null
+++ b/documentation/bundles/sling-query/examples.html
@@ -0,0 +1,128 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html lang="en">
+<head>
+        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
+        <title>Apache Sling :: Examples</title>
+        <link rel="icon" href="/ng/res/favicon.ico"/>
+        <link rel="stylesheet" href="/ng/res/css/site.css"/>
+        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"/>
+        <script src='https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js'></script><script>
+            hljs.initHighlightingOnLoad();
+        </script>
+        
+    </head>    <body>
+<div class="title">
+            <div class="logo">
+                <a href="http://sling.apache.org">
+                    <img border="0" alt="Apache Sling" src="/ng/res/logos/sling.svg"/>
+                </a>
+            </div><div class="header">
+                <a href="http://www.apache.org">
+                    <img border="0" alt="Apache" src="/ng/res/logos/apache.png"/>
+                </a>
+            </div>
+        </div><h1 class="draft">DRAFT 2017 WEBSITE - SLING-6955</h1><div class="menu">
+            <p>
+                <strong><a href="/ng/documentation.html">Documentation</a></strong><br/>
+                <a href="/ng/documentation/getting-started.html">Getting Started</a><br/>
+                <a href="/ng/documentation/the-sling-engine.html">The Sling Engine</a><br/>
+                <a href="/ng/documentation/development.html">Development</a><br/>
+                <a href="/ng/documentation/bundles.html">Bundles</a><br/>
+                <a href="/ng/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/>
+                <a href="/ng/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><br/>
+                
+            </p><p>
+                <strong>API Docs</strong><br/>
+                <a href="/ng/apidocs/sling9/index.html">Sling 9</a><br/>
+                <a href="/ng/apidocs/sling8/index.html">Sling 8</a><br/>
+                <a href="/ng/apidocs/sling7/index.html">Sling 7</a><br/>
+                <a href="/ng/apidocs/sling6/index.html">Sling 6</a><br/>
+                <a href="/ng/apidocs/sling5/index.html">Sling 5</a><br/>
+                <a href="/ng/javadoc-io.html">Archive at javadoc.io</a><br/>
+                
+            </p><p>
+                <strong>Project info</strong><br/>
+                <a href="/ng/downloads.cgi">Downloads</a><br/>
+                <a href="http://www.apache.org/licenses/">License</a><br/>
+                <a href="/ng/contributing.html">Contributing</a><br/>
+                <a href="/ng/news.html">News</a><br/>
+                <a href="/ng/links.html">Links</a><br/>
+                <a href="/ng/project-information.html">Project Information</a><br/>
+                <a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/>
+                <a href="/ng/project-information/security.html">Security</a><br/>
+                
+            </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><br/>
+                
+            </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="https://donate.apache.org/">Donate!</a><br/>
+                <a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a><br/>
+                
+            </p><p>
+                <strong><a href="/ng/sitemap.html">Site Map</a></strong>
+            </p>
+        </div>        <div class="main">
+<div class="breadcrumbs"><a href="/ng/">Home</a>&nbsp;&raquo;&nbsp;<a href="/ng/documentation.html">Documentation</a>&nbsp;&raquo;&nbsp;<a href="/ng/documentation/bundles.html">Bundles</a>&nbsp;&raquo;&nbsp;<a href="/ng/documentation/bundles/sling-query.html">Sling Query</a>&nbsp;&raquo;&nbsp;</div>            <h1>
+                Examples
+            </h1><div class="row"><div class="small-12 columns"><section class="wrap"><p>Get containing page (like [PageManager#getContainingPage](https://docs.adobe.com/docs/en/aem/6-3/develop/ref/javadoc/com/day/cq/wcm/api/PageManager.html#getContainingPage(org.apache.sling.api.resource.Resource)))</p>
+<pre><code>$(resource).closest(&quot;cq:Page&quot;)
+</code></pre>
+<p>Get first ancestor with a given template</p>
+<pre><code>$(resource).closest(&quot;cq:Page[jcr:content/cq:template=/apps/geometrixx/templates/homepage]&quot;)
+</code></pre>
+<p>List siblings of the current page which can be displayed in the navigation</p>
+<pre><code>$(resource).closest(&quot;cq:Page&quot;).siblings(&quot;cq:Page[jcr:content/hiddenInNav=false]&quot;)
+</code></pre>
+<p>Get the first sibling of the current page</p>
+<pre><code>$(resource).closest(&quot;cq:Page&quot;).siblings(&quot;cq:Page&quot;).first()
+</code></pre>
+<p>Get page ancestor closest to the root</p>
+<pre><code>$(resource).parents(&quot;cq:Page&quot;).last()
+</code></pre>
+<p>Get the second child of each resource:</p>
+<pre><code>$(resource1, resource2, resource3).children(&quot;:eq(1)&quot;)
+</code></pre>
+<p>Get the first two children of each resource:</p>
+<pre><code>$(resource1, resource2, resource3).children(&quot;:lt(2)&quot;)
+</code></pre>
+<p>Closest ancestor page having non-empty parsys</p>
+<pre><code>$(resource).closest(&quot;cq:Page foundation/components/parsys:parent&quot;)
+</code></pre>
+<p>Get all parents of the current resource and adapt them to Page object</p>
+<pre><code>Iterable&lt;Page&gt; breadcrumbs = $(resource).parents(&quot;cq:Page&quot;).map(Page.class);
+</code></pre>
+<p>Get all parents of the current resource up to the home page</p>
+<pre><code>Iterable&lt;Page&gt; breadcrumbs;
+breadcrumbs = $(resource).parentsUntil(
+    &quot;cq:Page[jcr:content/cq:template=/apps/geometrixx/templates/homepage]&quot;,
+    &quot;cq:Page&quot;).map(Page.class);
+</code></pre>
+<p>List all grand-children pages having empty parsys</p>
+<pre><code>$(resource).children(&quot;cq:Page&quot;).children(&quot;cq:Page&quot;).has(&quot;foundation/components/parsys:empty)
+</code></pre>
+<p>Use JCR query to find all <code>cq:Page</code>s with a given template</p>
+<pre><code>$(resourceResolver)
+    .searchStrategy(SearchStrategy.QUERY)
+    .find(&quot;cq:PageContent[cq:template=/apps/geometrixx/templates/homepage]&quot;)
+    .parent()
+</code></pre>
+<p>Find children named <code>en</code> or <code>de</code></p>
+<pre><code>$(resource).children(&quot;#en, #de&quot;)
+</code></pre></section></div></div>
+<div class="footer">
+                <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>            
+            
+        </div>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/sling-site/blob/f47e8676/documentation/bundles/sling-query/hierarchy-operators.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/sling-query/hierarchy-operators.html b/documentation/bundles/sling-query/hierarchy-operators.html
new file mode 100644
index 0000000..fcb417e
--- /dev/null
+++ b/documentation/bundles/sling-query/hierarchy-operators.html
@@ -0,0 +1,111 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html lang="en">
+<head>
+        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
+        <title>Apache Sling :: Hierarchy operators</title>
+        <link rel="icon" href="/ng/res/favicon.ico"/>
+        <link rel="stylesheet" href="/ng/res/css/site.css"/>
+        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"/>
+        <script src='https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js'></script><script>
+            hljs.initHighlightingOnLoad();
+        </script>
+        
+    </head>    <body>
+<div class="title">
+            <div class="logo">
+                <a href="http://sling.apache.org">
+                    <img border="0" alt="Apache Sling" src="/ng/res/logos/sling.svg"/>
+                </a>
+            </div><div class="header">
+                <a href="http://www.apache.org">
+                    <img border="0" alt="Apache" src="/ng/res/logos/apache.png"/>
+                </a>
+            </div>
+        </div><h1 class="draft">DRAFT 2017 WEBSITE - SLING-6955</h1><div class="menu">
+            <p>
+                <strong><a href="/ng/documentation.html">Documentation</a></strong><br/>
+                <a href="/ng/documentation/getting-started.html">Getting Started</a><br/>
+                <a href="/ng/documentation/the-sling-engine.html">The Sling Engine</a><br/>
+                <a href="/ng/documentation/development.html">Development</a><br/>
+                <a href="/ng/documentation/bundles.html">Bundles</a><br/>
+                <a href="/ng/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/>
+                <a href="/ng/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><br/>
+                
+            </p><p>
+                <strong>API Docs</strong><br/>
+                <a href="/ng/apidocs/sling9/index.html">Sling 9</a><br/>
+                <a href="/ng/apidocs/sling8/index.html">Sling 8</a><br/>
+                <a href="/ng/apidocs/sling7/index.html">Sling 7</a><br/>
+                <a href="/ng/apidocs/sling6/index.html">Sling 6</a><br/>
+                <a href="/ng/apidocs/sling5/index.html">Sling 5</a><br/>
+                <a href="/ng/javadoc-io.html">Archive at javadoc.io</a><br/>
+                
+            </p><p>
+                <strong>Project info</strong><br/>
+                <a href="/ng/downloads.cgi">Downloads</a><br/>
+                <a href="http://www.apache.org/licenses/">License</a><br/>
+                <a href="/ng/contributing.html">Contributing</a><br/>
+                <a href="/ng/news.html">News</a><br/>
+                <a href="/ng/links.html">Links</a><br/>
+                <a href="/ng/project-information.html">Project Information</a><br/>
+                <a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/>
+                <a href="/ng/project-information/security.html">Security</a><br/>
+                
+            </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><br/>
+                
+            </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="https://donate.apache.org/">Donate!</a><br/>
+                <a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a><br/>
+                
+            </p><p>
+                <strong><a href="/ng/sitemap.html">Site Map</a></strong>
+            </p>
+        </div>        <div class="main">
+<div class="breadcrumbs"><a href="/ng/">Home</a>&nbsp;&raquo;&nbsp;<a href="/ng/documentation.html">Documentation</a>&nbsp;&raquo;&nbsp;<a href="/ng/documentation/bundles.html">Bundles</a>&nbsp;&raquo;&nbsp;<a href="/ng/documentation/bundles/sling-query.html">Sling Query</a>&nbsp;&raquo;&nbsp;</div>            <h1>
+                Hierarchy operators
+            </h1><div class="row"><div class="small-12 columns"><section class="wrap"><h3>Child operator (<code>parent &gt; child</code>)</h3>
+<p>Select all direct child resources specified by <code>child</code> of resources specified by <code>parent</code></p>
+<pre><code>// find all richtext components placed directly into parsys resources
+$(resource).find(&#39;foundation/components/parsys &gt; foundation/components/richtext&#39;)
+// alternative version
+$(resource).find(&#39;foundation/components/parsys&#39;).children(&#39;foundation/components/richtext&#39;)
+</code></pre>
+<h3>Descendant operator (<code>ancestor descendant</code>)</h3>
+<p>Select all resources that are <code>descendant</code>s of a given <code>ancestor</code></p>
+<pre><code>// find all resources containing `someAttribute` on the `cq:Page`s being direct children of the resource
+$(resource).children(&#39;cq:Page [someAttribute]&#39;)
+// alternative version
+$(resource).children(&#39;cq:Page&#39;).find(&#39;[someAttribute]&#39;)
+</code></pre>
+<h3>Next adjacent operator (<code>prev + next</code>)</h3>
+<p>Selects all next resources matching <code>next</code> that are immediately preceded by a sibling <code>prev</code></p>
+<pre><code>// find next sibling of the cq:Page containing the resource
+$(resource).closest(&#39;cq:Page + cq:Page&#39;)
+// alternative version
+$(resource).closest(&#39;cq:Page&#39;).next(&#39;cq:Page&#39;)
+</code></pre>
+<h3>Next siblings operator (<code>prev ~ next</code>)</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>
+<pre><code>// find all next siblings of the cq:Page containing the resource
+$(resource).closest(&#39;cq:Page ~ cq:Page&#39;)
+// alternative version
+$(resource).closest(&#39;cq:Page&#39;).nextAll(&#39;cq:Page&#39;)
+</code></pre></section></div></div>
+<div class="footer">
+                <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>            
+            
+        </div>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/sling-site/blob/f47e8676/documentation/bundles/sling-query/methods.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/sling-query/methods.html b/documentation/bundles/sling-query/methods.html
new file mode 100644
index 0000000..3002ea6
--- /dev/null
+++ b/documentation/bundles/sling-query/methods.html
@@ -0,0 +1,214 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html lang="en">
+<head>
+        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
+        <title>Apache Sling :: Method list</title>
+        <link rel="icon" href="/ng/res/favicon.ico"/>
+        <link rel="stylesheet" href="/ng/res/css/site.css"/>
+        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"/>
+        <script src='https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js'></script><script>
+            hljs.initHighlightingOnLoad();
+        </script>
+        
+    </head>    <body>
+<div class="title">
+            <div class="logo">
+                <a href="http://sling.apache.org">
+                    <img border="0" alt="Apache Sling" src="/ng/res/logos/sling.svg"/>
+                </a>
+            </div><div class="header">
+                <a href="http://www.apache.org">
+                    <img border="0" alt="Apache" src="/ng/res/logos/apache.png"/>
+                </a>
+            </div>
+        </div><h1 class="draft">DRAFT 2017 WEBSITE - SLING-6955</h1><div class="menu">
+            <p>
+                <strong><a href="/ng/documentation.html">Documentation</a></strong><br/>
+                <a href="/ng/documentation/getting-started.html">Getting Started</a><br/>
+                <a href="/ng/documentation/the-sling-engine.html">The Sling Engine</a><br/>
+                <a href="/ng/documentation/development.html">Development</a><br/>
+                <a href="/ng/documentation/bundles.html">Bundles</a><br/>
+                <a href="/ng/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/>
+                <a href="/ng/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><br/>
+                
+            </p><p>
+                <strong>API Docs</strong><br/>
+                <a href="/ng/apidocs/sling9/index.html">Sling 9</a><br/>
+                <a href="/ng/apidocs/sling8/index.html">Sling 8</a><br/>
+                <a href="/ng/apidocs/sling7/index.html">Sling 7</a><br/>
+                <a href="/ng/apidocs/sling6/index.html">Sling 6</a><br/>
+                <a href="/ng/apidocs/sling5/index.html">Sling 5</a><br/>
+                <a href="/ng/javadoc-io.html">Archive at javadoc.io</a><br/>
+                
+            </p><p>
+                <strong>Project info</strong><br/>
+                <a href="/ng/downloads.cgi">Downloads</a><br/>
+                <a href="http://www.apache.org/licenses/">License</a><br/>
+                <a href="/ng/contributing.html">Contributing</a><br/>
+                <a href="/ng/news.html">News</a><br/>
+                <a href="/ng/links.html">Links</a><br/>
+                <a href="/ng/project-information.html">Project Information</a><br/>
+                <a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/>
+                <a href="/ng/project-information/security.html">Security</a><br/>
+                
+            </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><br/>
+                
+            </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="https://donate.apache.org/">Donate!</a><br/>
+                <a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a><br/>
+                
+            </p><p>
+                <strong><a href="/ng/sitemap.html">Site Map</a></strong>
+            </p>
+        </div>        <div class="main">
+<div class="breadcrumbs"><a href="/ng/">Home</a>&nbsp;&raquo;&nbsp;<a href="/ng/documentation.html">Documentation</a>&nbsp;&raquo;&nbsp;<a href="/ng/documentation/bundles.html">Bundles</a>&nbsp;&raquo;&nbsp;<a href="/ng/documentation/bundles/sling-query.html">Sling Query</a>&nbsp;&raquo;&nbsp;</div>            <h1>
+                Method list
+            </h1><div class="row"><div class="small-12 columns"><section class="wrap"><h3><a href="#resource-resources-" name="resource-resources-">$(Resource... resources)</a></h3>
+<p>Create a new SlingQuery object, using passed resources as an initial collection. Example:</p>
+<pre><code>$(resource); // a simple SlingQuery collection containing one resource
+</code></pre>
+<h3><a href="#add-resource-resources-" name="add-resource-resources-">.add(Resource... resources)</a></h3>
+<p>Add resources to the collection.</p>
+<pre><code>$(resource).children().add(resource); // collection contains resource and all its children
+</code></pre>
+<h3><a href="#aslist-" name="aslist-">.asList()</a></h3>
+<p>Transform SlingQuery collection into a lazy list.</p>
+<pre><code>$(resource).children(&quot;cq:Page&quot;).asList().get(0); // get the first child page
+$(resource).children().asList().isEmpty(); // return true if the resource have no children
+</code></pre>
+<h3><a href="#children-selector-" name="children-selector-">.children([selector])</a></h3>
+<p>Get list of the children for each resource in the collection. Pass <code>selector</code> to filter children. Example:</p>
+<pre><code>$(resource).children(&quot;cq:Page&quot;); // get all page children of the resource
+$(resource).children().children(); // get all grand-children of the resource
+</code></pre>
+<h3><a href="#closest-selector-" name="closest-selector-">.closest(selector)</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>
+<pre><code>$(resource).closest(&quot;cq:Page&quot;); // find containing page, like PageManager#getContainingPage
+// let&#39;s assume that someCqPageResource is a cq:Page
+$(someCqPageResource).closest(&quot;cq:Page&quot;); // return the same resource
+</code></pre>
+<h3><a href="#eq-index-" name="eq-index-">.eq(index)</a></h3>
+<p>Reduce resource collection to the one resource at the given 0-based index. Example:</p>
+<pre><code>$(resource0, resource1, resource2).eq(1); // return resource1
+$(resource).children().eq(0); // return first child of the resource
+</code></pre>
+<h3><a href="#filter-selector-" name="filter-selector-">.filter(selector)</a></h3>
+<p>Filter resource collection using given selector.</p>
+<pre><code>final Calendar someTimeAgo = Calendar.getInstance();
+someTimeAgo.add(Calendar.HOUR, -5);
+
+// get children pages modified in the last 5 hours
+SlingQuery query = $(resource).children(&quot;cq:Page&quot;).filter(new Predicate&lt;Resource&gt;() {
+    @Override
+    public boolean accepts(Resource resource) {
+        return resource.adaptTo(Page.class).getLastModified().after(someTimeAgo);
+    }
+});
+</code></pre>
+<h3><a href="#find-selector-" name="find-selector-">.find([selector])</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>
+<pre><code>$(resource).find(&quot;cq:Page&quot;); // find all descendant pages
+</code></pre>
+<h3><a href="#first-" name="first-">.first()</a></h3>
+<p>Filter resource collection to the first element. Equivalent to <code>.eq(0)</code> or <code>.slice(0, 0)</code>.</p>
+<pre><code>$(resource).siblings().first(); // get the first sibling of the current resource
+</code></pre>
+<h3><a href="#has-selector-" name="has-selector-">.has(selector)</a></h3>
+<p>Pick such resources from the collection that have descendant matching the selector. Example:</p>
+<pre><code>$(...).children(&#39;cq:Page&#39;).has(foundation/components/richtext) // find children pages containing some richtext component
+</code></pre>
+<p>This method uses <a href="#searchstrategystrategy">selected strategy</a> to iterate over resource descendants.</p>
+<h3><a href="#last-" name="last-">.last()</a></h3>
+<p>Filter resource collection to the last element.</p>
+<pre><code>$(resource).siblings().last(); // get the last sibling of the current resource
+</code></pre>
+<h3><a href="#map-class-t-clazz-" name="map-class-t-clazz-">.map(Class<T> clazz)</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>
+<pre><code>for (Page page : $(resource).parents(&quot;cq:Page&quot;).map(Page.class)) {
+    // display breadcrumbs
+}
+</code></pre>
+<h3><a href="#next-selector-" name="next-selector-">.next([selector])</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>
+<pre><code>// let&#39;s assume that resource have 3 children: child1, child2 and child3
+$(resource).children().first().next(); // return child2
+</code></pre>
+<h3><a href="#nextall-selector-" name="nextall-selector-">.nextAll([selector])</a></h3>
+<p>Return all following siblings for each resource in the collection, optionally filtering them by a selector.</p>
+<pre><code>// let&#39;s assume that resource have 3 children: child1, child2 and child3
+$(resource).children().first().nextAll(); // return child2 and child3
+</code></pre>
+<h3><a href="#nextuntil-selector-" name="nextuntil-selector-">.nextUntil(selector)</a></h3>
+<p>Return all following siblings for each resource in the collection up to, but not including, resource matched by a selector.</p>
+<pre><code>// let&#39;s assume that resource have 4 children: child1, child2, child3 and child4
+// additionaly, child4 has property jcr:title=Page
+$(resource).children().first().nextUntil(&quot;[jcr:title=Page]&quot;); // return child2 and child3
+</code></pre>
+<h3><a href="#not-selector-" name="not-selector-">.not(selector)</a></h3>
+<p>Remove elements from the collection.</p>
+<pre><code>$(resource).children().not(&quot;cq:Page&quot;); // remove all cq:Pages from the collection
+$(resource).children().not(&quot;:first&quot;).not(&quot;:last&quot;); // remove the first and the last element of the collection
+</code></pre>
+<h3><a href="#parent-" name="parent-">.parent()</a></h3>
+<p>Replace each element in the collection with its parent.</p>
+<pre><code>$(resource).find(&quot;cq:PageContent[jcr:title=My page]:first&quot;).parent(); // find the parent of the first `cq:PageContent` resource with given attribute in the subtree
+</code></pre>
+<h3><a href="#parents-selector-" name="parents-selector-">.parents([selector])</a></h3>
+<p>For each element in the collection find all of its ancestors, optionally filtering them by a selector.</p>
+<pre><code>($resource).parents(&quot;cq:Page&quot;); // create page breadcrumbs for the given resources
+</code></pre>
+<h3><a href="#parentsuntil-selector-" name="parentsuntil-selector-">.parentsUntil(selector)</a></h3>
+<p>For each element in the collection find all of its ancestors until a resource matching the selector is found.</p>
+<pre><code>($currentResource).parentsUntil(&quot;cq:Page&quot;); // find all ancestor components on the current page
+</code></pre>
+<h3><a href="#prev-selector-" name="prev-selector-">.prev([selector])</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>
+<pre><code>// let&#39;s assume that resource have 3 children: child1, child2 and child3
+$(resource).children().last().prev(); // return child2
+</code></pre>
+<h3><a href="#prevall-selector-" name="prevall-selector-">.prevAll([selector])</a></h3>
+<p>Return all preceding siblings for each resource in the collection, optionally filtering them by a selector.</p>
+<pre><code>// let&#39;s assume that resource have 3 children: child1, child2 and child3
+$(resource).children().last().prevAll(); // return child1 and child2
+</code></pre>
+<h3><a href="#prevuntil-selector-" name="prevuntil-selector-">.prevUntil(selector)</a></h3>
+<p>Return all preceding siblings for each resource in the collection up to, but not including, resource matched by a selector.</p>
+<pre><code>// let&#39;s assume that resource have 4 children: child1, child2, child3 and child4
+// additionally, child1 has property jcr:title=Page
+$(resource).children().last().prevUntil(&quot;[jcr:title=Page]&quot;); // return child2 and child3
+</code></pre>
+<h3><a href="#searchstrategy-strategy-" name="searchstrategy-strategy-">.searchStrategy(strategy)</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><a href="#siblings-selector-" name="siblings-selector-">.siblings([selector])</a></h3>
+<p>Return siblings for the given resources, optionally filtered by a selector.</p>
+<pre><code>$(resource).closest(&quot;cq:Page&quot;).siblings(&quot;cq:Page&quot;); // return all sibling pages
+</code></pre>
+<h3><a href="#slice-from-to-" name="slice-from-to-">.slice(from[, to])</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>
+<pre><code>// let&#39;s assume that resource have 4 children: child1, child2, child3 and child4
+$(resource).children().slice(1, 2); // return child1 and child2
+</code></pre></section></div></div>
+<div class="footer">
+                <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>            
+            
+        </div>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/sling-site/blob/f47e8676/documentation/bundles/sling-query/modifiers.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/sling-query/modifiers.html b/documentation/bundles/sling-query/modifiers.html
new file mode 100644
index 0000000..02b4ca9
--- /dev/null
+++ b/documentation/bundles/sling-query/modifiers.html
@@ -0,0 +1,123 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html lang="en">
+<head>
+        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
+        <title>Apache Sling :: Modifiers</title>
+        <link rel="icon" href="/ng/res/favicon.ico"/>
+        <link rel="stylesheet" href="/ng/res/css/site.css"/>
+        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"/>
+        <script src='https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js'></script><script>
+            hljs.initHighlightingOnLoad();
+        </script>
+        
+    </head>    <body>
+<div class="title">
+            <div class="logo">
+                <a href="http://sling.apache.org">
+                    <img border="0" alt="Apache Sling" src="/ng/res/logos/sling.svg"/>
+                </a>
+            </div><div class="header">
+                <a href="http://www.apache.org">
+                    <img border="0" alt="Apache" src="/ng/res/logos/apache.png"/>
+                </a>
+            </div>
+        </div><h1 class="draft">DRAFT 2017 WEBSITE - SLING-6955</h1><div class="menu">
+            <p>
+                <strong><a href="/ng/documentation.html">Documentation</a></strong><br/>
+                <a href="/ng/documentation/getting-started.html">Getting Started</a><br/>
+                <a href="/ng/documentation/the-sling-engine.html">The Sling Engine</a><br/>
+                <a href="/ng/documentation/development.html">Development</a><br/>
+                <a href="/ng/documentation/bundles.html">Bundles</a><br/>
+                <a href="/ng/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/>
+                <a href="/ng/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><br/>
+                
+            </p><p>
+                <strong>API Docs</strong><br/>
+                <a href="/ng/apidocs/sling9/index.html">Sling 9</a><br/>
+                <a href="/ng/apidocs/sling8/index.html">Sling 8</a><br/>
+                <a href="/ng/apidocs/sling7/index.html">Sling 7</a><br/>
+                <a href="/ng/apidocs/sling6/index.html">Sling 6</a><br/>
+                <a href="/ng/apidocs/sling5/index.html">Sling 5</a><br/>
+                <a href="/ng/javadoc-io.html">Archive at javadoc.io</a><br/>
+                
+            </p><p>
+                <strong>Project info</strong><br/>
+                <a href="/ng/downloads.cgi">Downloads</a><br/>
+                <a href="http://www.apache.org/licenses/">License</a><br/>
+                <a href="/ng/contributing.html">Contributing</a><br/>
+                <a href="/ng/news.html">News</a><br/>
+                <a href="/ng/links.html">Links</a><br/>
+                <a href="/ng/project-information.html">Project Information</a><br/>
+                <a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/>
+                <a href="/ng/project-information/security.html">Security</a><br/>
+                
+            </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><br/>
+                
+            </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="https://donate.apache.org/">Donate!</a><br/>
+                <a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a><br/>
+                
+            </p><p>
+                <strong><a href="/ng/sitemap.html">Site Map</a></strong>
+            </p>
+        </div>        <div class="main">
+<div class="breadcrumbs"><a href="/ng/">Home</a>&nbsp;&raquo;&nbsp;<a href="/ng/documentation.html">Documentation</a>&nbsp;&raquo;&nbsp;<a href="/ng/documentation/bundles.html">Bundles</a>&nbsp;&raquo;&nbsp;<a href="/ng/documentation/bundles/sling-query.html">Sling Query</a>&nbsp;&raquo;&nbsp;</div>            <h1>
+                Modifiers
+            </h1><div class="row"><div class="small-12 columns"><section class="wrap"><h3><a href="#eq-index-" name="eq-index-">:eq(index)</a></h3>
+<p>Reduce the set of matched elements to the one at the specified 0-based index. Example:</p>
+<pre><code>$(...).find(&quot;foundation/components/richtext:eq(2)&quot;); // find the third richtext in the subtree
+</code></pre>
+<h3><a href="#even" name="even">:even</a></h3>
+<p>Reduce the set of matched elements to those which indexes are even numbers:</p>
+<pre><code>$(...).children(&quot;cq:Page:even&quot;); // get even children pages for each resource in the collection
+</code></pre>
+<h3><a href="#first" name="first">:first</a></h3>
+<p>Reduce the set of matched elements to the first one:</p>
+<pre><code>$(...).find(&quot;foundation/components/richtext:first&quot;); // find the first richtext in the subtree
+</code></pre>
+<h3><a href="#gt-index-" name="gt-index-">:gt(index)</a></h3>
+<p>Reduce the set of matched elements to those which indexes are greater than the argument:</p>
+<pre><code>$(...).children(&quot;cq:Page:gt(2)&quot;); // filter out first 3 pages
+</code></pre>
+<h3><a href="#has-selector-" name="has-selector-">:has(selector)</a></h3>
+<p>Reduce the set of the matched elements to those which have descendant matching the selector:</p>
+<pre><code>$(...).children(&quot;cq:Page:has(foundation/components/richtext)]&quot;); // get children pages containing richtext component
+</code></pre>
+<h3><a href="#last" name="last">:last</a></h3>
+<p>Reduce the set of matched elements to the last one:</p>
+<pre><code>$(...).find(&quot;foundation/components/richtext:last&quot;); // find the last richtext in the subtree
+</code></pre>
+<h3><a href="#lt-index-" name="lt-index-">:lt(index)</a></h3>
+<p>Reduce the set of matched elements to those which indexes are lesser than the argument:</p>
+<pre><code>$(...).children(&quot;cq:Page:lt(3)&quot;); // get first 3 matches
+</code></pre>
+<h3><a href="#not-selector-" name="not-selector-">:not(selector)</a></h3>
+<p>Reduce the set of matched elements to those which doesn't match the selector. The selector may contain other modifiers as well, however in this case the function will be evaluated eagerly:</p>
+<pre><code>$(...).find(&quot;:not(:parent)&quot;); // ancestor resources that doesn&#39;t contain any children
+</code></pre>
+<h3><a href="#odd" name="odd">:odd</a></h3>
+<p>Reduce the set of matched elements to those which indexes are odd numbers:</p>
+<pre><code>$(...).children(&quot;cq:Page:odd&quot;); // get odd children pages for each resource in the collection
+</code></pre>
+<h3><a href="#parent" name="parent">:parent</a></h3>
+<p>Reduce the set of the matched elements to those which have any descendant resource.</p>
+<pre><code>$(...).children(&quot;:parent]&quot;); // get children resources containing any resource
+</code></pre></section></div></div>
+<div class="footer">
+                <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>            
+            
+        </div>
+    </body>
+</html>