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 2014/09/12 00:50:19 UTC

svn commit: r921910 - in /websites/staging/sling/trunk/content: ./ documentation/the-sling-engine/resources.html

Author: buildbot
Date: Thu Sep 11 22:50:18 2014
New Revision: 921910

Log:
Staging update by buildbot for sling

Modified:
    websites/staging/sling/trunk/content/   (props changed)
    websites/staging/sling/trunk/content/documentation/the-sling-engine/resources.html

Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Sep 11 22:50:18 2014
@@ -1 +1 @@
-1624416
+1624417

Modified: websites/staging/sling/trunk/content/documentation/the-sling-engine/resources.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/the-sling-engine/resources.html (original)
+++ websites/staging/sling/trunk/content/documentation/the-sling-engine/resources.html Thu Sep 11 22:50:18 2014
@@ -119,24 +119,75 @@
 <p>The Resource is one of the central parts of Sling. Extending from JCR's <em>Everything is Content</em>, Sling assumes <em>Everthing is a Resource</em>. Thus Sling is maintaining a virtual tree of resources, which is a merger of the actual contents in the JCR Repository and resources provided by so called resource providers. By doing this Sling fits very well in the paradigma of the REST architecture.</p>
 <h3 id="resource-properties">Resource Properties</h3>
 <p>Resources have a number of essentiall properties:</p>
-<p>Property | Description
---+--
-Path | Resources are part of a Resource Tree. As such each Resource has a path which is formed by concatenating the names of all Resources along the root to the Resource separated by a slash. Ok, really, this is much like a URL path or a file system path where the slash (<code>/</code>) is the separator character.
-Name | The name of the Resource is the last element (or segment) in the path
-Resource Type | Each resource has a resource type which is used by the Servlet and Script resolver to find the appropriate Servlet or Script to handle the request for the Resource.
-Resource Super Type | The (optional explicit) super type of the Resource. See the section <em>Resource Types</em> below for more details.
-Adapters | Resources are always <code>Adaptable</code> and therefore can be adapted to a different view. See the section <em>Resource Adapters</em> below for more details.
-Metadata | Resources in general support <a href="http://sling.apache.org/apidocs/sling6/org/apache/sling/api/resource/ResourceMetadata.html" title="ResourceMetadata">link text</a> providing access to values such as the length of a binary resource (which can be streamed) or the Resource's content type.</p>
+<table>
+<thead>
+<tr>
+<th>Property</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Path</td>
+<td>Resources are part of a Resource Tree. As such each Resource has a path which is formed by concatenating the names of all Resources along the root to the Resource separated by a slash. Ok, really, this is much like a URL path or a file system path where the slash (<code>/</code>) is the separator character.</td>
+</tr>
+<tr>
+<td>Name</td>
+<td>The name of the Resource is the last element (or segment) in the path.</td>
+</tr>
+<tr>
+<td>Resource Type</td>
+<td>Each resource has a resource type which is used by the Servlet and Script resolver to find the appropriate Servlet or Script to handle the request for the Resource.</td>
+</tr>
+<tr>
+<td>Resource Super Type</td>
+<td>The (optional explicit) super type of the Resource. See the section <em>Resource Types</em> below for more details.</td>
+</tr>
+<tr>
+<td>Adapters</td>
+<td>Resources are always <code>Adaptable</code> and therefore can be adapted to a different view. See the section <em>Resource Adapters</em> below for more details.</td>
+</tr>
+<tr>
+<td>Metadata</td>
+<td>Resources in general support <a href="http://sling.apache.org/apidocs/sling6/org/apache/sling/api/resource/ResourceMetadata.html" title="ResourceMetadata">link text</a> providing access to values such as the length of a binary resource (which can be streamed) or the Resource's content type.</td>
+</tr>
+</tbody>
+</table>
 <p>For a complete description of the <code>Resource</code> interface, please refer to the <a href="http://sling.apache.org/apidocs/sling6/org/apache/sling/api/resource/Resource.html" title="Resource">link text</a> JavaDoc.</p>
 <h3 id="resource-types">Resource Types</h3>
 <p>The exact method of setting the resource type for a Resource depends on the actual Resource Provider. For the four main Resource Provider
 implementations provided by Sling, the assignments are as follows:</p>
-<p>Provider | Resource Type | Resource Super Type
---+--+--
-JCR | The value of the <code>sling:resourceType</code> property or the primary node type if the property is not set (a namespace separator colon is replaced by a slash, e.g. the <code>nt:file</code> primary node type is mapped to the <code>nt/file</code> resource type | The value of the <code>sling:resourceSuperType</code> of the Resource node or resource super type of the resource pointed to by the resource type (when accessed with <code>ResourceResolver.getResource(String)</code>
-File System | File based resources are of type <code>nt/file</code>; folder based resources are of type <code>nt/folder</code> corresponding to the respective JCR primary node type | none |
-Bundle | File based resources are of type <code>nt/file</code>; folder based resources are of type <code>nt/folder</code> corresponding to the respective JCR primary node type | none |
-Servlet | The absolute path of the resource appended with the suffix <code>.servlet</code> | <code>sling/bundle/resource</code></p>
+<table>
+<thead>
+<tr>
+<th>Provider</th>
+<th>Resource Type</th>
+<th>Resource Super Type</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>JCR</td>
+<td>The value of the <code>sling:resourceType</code> property or the primary node type if the property is not set (a namespace separator colon is replaced by a slash, e.g. the <code>nt:file</code> primary node type is mapped to the <code>nt/file</code> resource type</td>
+<td>The value of the <code>sling:resourceSuperType</code> of the Resource node or resource super type of the resource pointed to by the resource type (when accessed with <code>ResourceResolver.getResource(String)</code></td>
+</tr>
+<tr>
+<td>File System</td>
+<td>File based resources are of type <code>nt/file</code>; folder based resources are of type <code>nt/folder</code> corresponding to the respective JCR primary node type</td>
+<td>none</td>
+</tr>
+<tr>
+<td>Bundle</td>
+<td>File based resources are of type <code>nt/file</code>; folder based resources are of type <code>nt/folder</code> corresponding to the respective JCR primary node type</td>
+<td>none</td>
+</tr>
+<tr>
+<td>Servlet</td>
+<td>The absolute path of the resource appended with the suffix <code>.servlet</code></td>
+<td><code>sling/bundle/resource</code></td>
+</tr>
+</tbody>
+</table>
 <p>Resource Types form a type hierarchy much like Java classes form a type hierarchy. Each resource type has a resource super type, either explicitly defined as for example for JCR or Servlet Resources or implicitly. The implicit Resource Super Type is at the same time the root Resource Type much like the <code>java.lang.Object</code> class is called <code>sling/servlet/default</code> (for historical reasons). The <code>sling/servlet/default</code> Resource Type is the only type without a super type.</p>
 <h3 id="adapters">Adapters</h3>
 <p>The object types to which Resources may be adapted depend mostly depends on the Resource Provider providing the resource. For example all JCR node based resources always adapt to <code>javax.jcr.Node</code> objects.</p>
@@ -207,7 +258,7 @@ and <code>getResource(Resource base, Str
 <h2 id="wrapdecorate-resources">Wrap/Decorate Resources</h2>
 <p>The Sling API provides an easy way to wrap or decorate a resource before returning. Details see <a href="/documentation/the-sling-engine/wrap-or-decorate-resources.html">Wrap or Decorate Resources</a>.</p>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1624416 by fmeschbe on Thu, 11 Sep 2014 22:47:42 +0000
+        Rev. 1624417 by fmeschbe on Thu, 11 Sep 2014 22:50:12 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project