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 2015/04/21 15:30:41 UTC

svn commit: r948623 - in /websites/staging/sling/trunk/content: ./ documentation/bundles/sling-query.html

Author: buildbot
Date: Tue Apr 21 13:30:41 2015
New Revision: 948623

Log:
Staging update by buildbot for sling

Modified:
    websites/staging/sling/trunk/content/   (props changed)
    websites/staging/sling/trunk/content/documentation/bundles/sling-query.html

Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Apr 21 13:30:41 2015
@@ -1 +1 @@
-1675115
+1675116

Modified: websites/staging/sling/trunk/content/documentation/bundles/sling-query.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/bundles/sling-query.html (original)
+++ websites/staging/sling/trunk/content/documentation/bundles/sling-query.html Tue Apr 21 13:30:41 2015
@@ -90,9 +90,9 @@
       
       
       <h1>Sling Query</h1>
-      <p>SlingQuery is a Sling resource tree traversal tool inspired by the <a href="http://api.jquery.com/category/traversing/tree-traversal/">jQuery</a>.</p>
+      <p>SlingQuery is a Sling resource tree traversal tool inspired by the <a href="http://api.jquery.com/category/traversing/tree-traversal/">jQuery</a> JavaScript API.</p>
 <h2 id="introduction">Introduction</h2>
-<p>Recommended way to find resources in the Sling repository is using tree-traversal methods, like <code>listChildren()</code> and <code>getParent()</code> rather than JCR queries. The latter are great for listing resources with given properties, but we can't leverage the repository tree structure with such queries. On the other hand, using tree-traversal method is quite verbose. Consider following code that takes an resource and returns its first ancestor, being <code>cq:Page</code>, with given <code>jcr:content/cq:template</code> attribute:</p>
+<p>The recommended way to find resources in the Sling repository is using tree-traversal methods, like <code>listChildren()</code> and <code>getParent()</code> rather than JCR queries. The latter are great for listing resources with given properties, but we can't leverage the repository tree structure with such queries. On the other hand, using tree-traversal method is quite verbose. Consider following code that takes an resource and returns its first ancestor, being <code>cq:Page</code>, with given <code>jcr:content/cq:template</code> attribute:</p>
 <div class="codehilite"><pre><span class="n">Resource</span> <span class="n">resource</span> <span class="p">=</span> <span class="p">...;</span>
 <span class="k">while</span> <span class="p">((</span><span class="n">resource</span> <span class="p">=</span> <span class="n">resource</span><span class="p">.</span><span class="n">getParent</span><span class="p">())</span> !<span class="p">=</span> <span class="n">null</span><span class="p">)</span> <span class="p">{</span>
     <span class="k">if</span> <span class="p">(</span>!<span class="n">resource</span><span class="p">.</span><span class="n">isResourceType</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="p">{</span>
@@ -155,7 +155,7 @@ $<span class="p">(</span><span class="n"
 <li>Method names, selector syntax and some parts of documentation are inspired by the <a href="http://jquery.com/">jQuery</a> library.</li>
 </ul>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1675115 by justin on Tue, 21 Apr 2015 13:29:09 +0000
+        Rev. 1675116 by justin on Tue, 21 Apr 2015 13:30:34 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project