You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by gi...@apache.org on 2020/09/21 07:17:02 UTC

[sling-site] branch asf-site updated: Automatic website deployment from https://ci-builds.apache.org/job/Sling/job/modules/job/sling-site/job/master/29/

This is an automated email from the ASF dual-hosted git repository.

git-site-role pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/sling-site.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new 9cf3e57  Automatic website deployment from https://ci-builds.apache.org/job/Sling/job/modules/job/sling-site/job/master/29/
9cf3e57 is described below

commit 9cf3e579b9199cee6c66315526b6695296ccbb29
Author: jenkins <bu...@apache.org>
AuthorDate: Mon Sep 21 07:16:57 2020 +0000

    Automatic website deployment from https://ci-builds.apache.org/job/Sling/job/modules/job/sling-site/job/master/29/
---
 documentation/the-sling-engine/resources.html | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/documentation/the-sling-engine/resources.html b/documentation/the-sling-engine/resources.html
index 29cd6f8..6b628f6 100644
--- a/documentation/the-sling-engine/resources.html
+++ b/documentation/the-sling-engine/resources.html
@@ -139,7 +139,7 @@
 </table>
 <p>For a complete description of the <code>Resource</code> interface, please refer to the <a href="http://sling.apache.org/apidocs/sling8/org/apache/sling/api/resource/Resource.html"><code>Resource</code></a> JavaDoc.</p>
 <p>The properties are either exposed via the <code>ValueMap</code> or <code>ModifiableValueMap</code> adaptable or by calling <code>Resource.getValueMap()</code>.</p>
-<p>To get the main binary property from a given resource one can adapt it to an <code>InputStream</code>. Most resource providers return the underlying wrapper binary in that case.</p>
+<p>To get the <em>main</em> binary property from a given resource one can adapt it to an <code>InputStream</code>. Most resource providers return the underlying wrapper binary in that case. For arbitrary binary properties one must use the <code>ValueMap</code> which will return <code>InputStream</code> for such properties.</p>
 <h3><a href="#resource-types" id="resource-types">Resource Types</a></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>
 <table>
@@ -234,6 +234,13 @@
 <tr><td> <code>v</code> </td><td> <code>1.0</code> </td><td> Retrieves the underlying JCR node from the <a href="https://docs.adobe.com/docs/en/spec/jcr/2.0/15_Versioning.html">version history</a> leveraging the version label given in the value. </td><td> <a href="https://issues.apache.org/jira/browse/SLING-848">SLING-848</a></td></tr>
 </tbody>
 </table>
+<h4><a href="#main-binary-property" id="main-binary-property">Main Binary Property</a></h4>
+<p>The main binary property (i.e. the one being exposed by <code>Resource.adaptTo(InputStream.class)</code>) is determined like follows:</p>
+<ol>
+<li><code>jcr:data</code> is such a property exists, otherwise</li>
+<li>the primary item of the underlying node (as defined by <a href="https://docs.adobe.com/docs/en/spec/jsr170/javadocs/jcr-2.0/javax/jcr/Node.html#getPrimaryItem()">Node.getPrimaryItem()</a>).</li>
+</ol>
+<p>For node type <code>nt:file</code> the property is looked up in the child node <code>jcr:content</code> for both cases. For all other node types it is looked up in the underlying node of the current resource.</p>
 <h3><a href="#bundle-based-resources" id="bundle-based-resources">Bundle-based Resources</a></h3>
 <p>Resources may by provided by OSGi bundles. Providing bundles have a Bundle manifest header <code>Sling-Bundle-Resources</code> containing a list of absolute paths provided by the bundle. The path are separated by comma or whitespace (SP, TAB, VTAB, CR, LF).</p>
 <p>The <code>BundleResourceProvider</code> supporting bundle-based Resources provides directories as Resources of type <code>nt:folder</code> and files as Resources of type <code>nt:file</code>. This matches the default primary node types intended to be used for directories and files in JCR repositories.</p>
@@ -271,7 +278,7 @@
             </div><footer class="footer">
                 <div class="content has-text-centered is-small">
 <div class="revisionInfo">
-                        Last modified by <span class="author">Konrad Windszus</span> on <span class="comment">Thu Aug 6 10:00:58 2020 +0200</span>
+                        Last modified by <span class="author">Konrad Windszus</span> on <span class="comment">Mon Sep 21 09:12:52 2020 +0200</span>
                     </div>                    <p>
                         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.
                     </p><p>