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 2021/12/14 08:57:52 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/350/

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 255ce8b  Automatic website deployment from https://ci-builds.apache.org/job/Sling/job/modules/job/sling-site/job/master/350/
255ce8b is described below

commit 255ce8b00a130c5baef680e33576e07899ceeb67
Author: jenkins <bu...@apache.org>
AuthorDate: Tue Dec 14 08:57:49 2021 +0000

    Automatic website deployment from https://ci-builds.apache.org/job/Sling/job/modules/job/sling-site/job/master/350/
---
 documentation/the-sling-engine/resources.html | 22 ++++++++++++++++------
 sitemap.xml                                   |  4 ++--
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/documentation/the-sling-engine/resources.html b/documentation/the-sling-engine/resources.html
index c17ac14..d6c0740 100644
--- a/documentation/the-sling-engine/resources.html
+++ b/documentation/the-sling-engine/resources.html
@@ -179,8 +179,7 @@
 <li>Call <code>HttpServletRequest.getScheme(), .getServerName(), getServerPort</code> to get an absolute path out of the request URL: [scheme]/[host].[port][path] (<code>resolve(HttpServletRequest, String)</code> method only, which)</li>
 <li>Check whether any virtual path matches the absolute path. If such a match exists, the next step is entered with the match.</li>
 <li>Apply a list of mappings in order to create a mapped path. The first mapped path resolving to a Resource is assumed success and the Resource found is returned.</li>
-<li>If no mapping created a mapped path addressing an existing Resource, the method fails and returns a <code>NonExistingResource</code> (for the<br />
-<code>resolve(String)</code> and <code>resolve(HttpServletRequest,String)</code>) or null (for the <code>getResource(String path)</code> and <code>getResource(Resource base, String path)</code> methods).</li>
+<li>If no mapping created a mapped path addressing an existing Resource, the method fails and returns a <code>NonExistingResource</code> (for the <code>resolve(String)</code> and <code>resolve(HttpServletRequest,String)</code>) or null (for the <code>getResource(String path)</code> and <code>getResource(Resource base, String path)</code> methods).</li>
 </ol>
 <p>The virtual path mapping may be used to create shortcut URLs for otherwise long and complicated URLs. An example of such an URL might be the main administrative page of a CMS system. So, administrators may access the root of the web application and directed to the main administrative page.</p>
 <p>The path mapping functionality may be used to hide internal resource organization from the request URL space. For example to better control the structure of your repository, you might decide to store all accessible data inside a <code>/content</code> subtree. To hide this fact from the users, a mapping may be defined to prefix all incoming paths with <code>/content</code> to get at the actual Resource.</p>
@@ -277,11 +276,22 @@
 <p>To be notified whenever certain resources or their properties have been modified/added/removed there are different possibilities</p>
 <h3><a href="#resource-observation-api-resourcechangelistener" id="resource-observation-api-resourcechangelistener">Resource Observation API (ResourceChangeListener)</a></h3>
 <p><em>This API is only available since Sling API 2.11.0 (<a href="https://issues.apache.org/jira/browse/SLING-4751">SLING-4751</a>).</em></p>
-<p>Register an OSGi service for <a href="https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/observation/ResourceChangeListener.java"><code>org.apache.sling.api.resource.observation.ResourceChangeListener</code></a> to be notified about local changes. To be also notified about external changes (i.e. changes triggered by another Sling instance leveraging a clustered repository  make sure that your service implementation also impleme [...]
-<h3><a href="#osgi-event-admin" id="osgi-event-admin">OSGi Event Admin</a></h3>
-<p>Resource events are sent out via the OSGi Event Admin. You can subscribe to those event by registering an OSGi service for <a href="https://osgi.org/javadoc/r6/cmpn/org/osgi/service/event/EventHandler.html"><code>org.osgi.service.event.EventHandler</code></a>. Several properties should be used to restrict the subscription to only the relevant event. The event topics which are used for resources are listed as constants in <a href="http://sling.apache.org/apidocs/sling8/org/apache/sling [...]
+<p>Register an OSGi service for <a href="https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/observation/ResourceChangeListener.java"><code>org.apache.sling.api.resource.observation.ResourceChangeListener</code></a> to be notified about local changes. To be also notified about external changes (i.e. changes triggered by another Sling instance leveraging a clustered repository  make sure that your service implementation also impleme [...]
+<table>
+<thead>
+<tr><th>Property </th><th> Description</th></tr>
+</thead>
+<tbody>
+<tr><td><a href="https://sling.apache.org/apidocs/sling11/org/apache/sling/api/resource/observation/ResourceChangeListener.html#PATHS">ResourceChangeListener.PATHS</a></td><td> denote the path (including sub paths) in which you are interested in. This property is required.</td></tr>
+<tr><td><a href="https://sling.apache.org/apidocs/sling11/org/apache/sling/api/resource/observation/ResourceChangeListener.html#CHANGES">ResourceChangeListener.CHANGES</a></td><td> the type of changes you are interested in (optional)</td></tr>
+<tr><td><a href="https://sling.apache.org/apidocs/sling11/org/apache/sling/api/resource/observation/ResourceChangeListener.html#PROPERTY_NAMES_HINT">ResourceChhangeListener.PROPERTY_NAMES_HINT</a></td><td> filte r only for events affecting the properties with the given names (optional)</td></tr>
+</tbody>
+</table>
+<h3><a href="#osgi-event-based-resource-changes-deprecated" id="osgi-event-based-resource-changes-deprecated">OSGi Event based resource changes (deprecated)</a></h3>
+<p>Resource events are sent out via the OSGi Event Admin. You can subscribe to those events by registering an OSGi service for <a href="https://osgi.org/javadoc/r6/cmpn/org/osgi/service/event/EventHandler.html"><code>org.osgi.service.event.EventHandler</code></a>. Several properties should be used to restrict the subscription to only the relevant event(s). The event topics which are used for resources are listed as constants in <a href="http://sling.apache.org/apidocs/sling8/org/apache/s [...]
 <p>You receive events no matter whether they originate from the local repository or from a remote clustered repository. You can check though in your event listener for the <a href="/apache-sling-eventing-and-job-handling.html#basic-principles">event attribute <code>event.application</code></a>, which is only set in case the event was triggered from an external resource modification (compare with <a href="https://sling.apache.org/apidocs/sling9/org/apache/sling/event/dea/DEAConstants.html [...]
 <p>The OSGi event handlers may be <a href="http://felix.apache.org/documentation/subprojects/apache-felix-event-admin.html#configuration">blacklisted by Apache Felix</a> in case the processing takes too long. Therefore dispatch all long-lasting operations to a new thread or start a new Sling Job.</p>
+<p>This approach is deprecated in favor of the ResourceChangeListener described above, because the the ResourceChangeListeners allows the implementation to send out only relevant events (i.e. those which have subscribers), while the OSGI event based approach needs to create OSGI events for <strong>all</strong> repository events. To ease the transition the implementation will warn whenever an listener is registered which listens for the Resource (<code>org/apache/sling/api/resource/Resour [...]
 <h2><a href="#wrapdecorate-resources" id="wrapdecorate-resources">Wrap/Decorate Resources</a></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>
 </section></div></div>                            
@@ -295,7 +305,7 @@
                             content/documentation/the-sling-engine/resources.md
                         </a>
                     </div>                    <div class="revisionInfo">
-                        Last modified by <span class="author">Konrad Windszus</span> on <span class="comment">2021-11-22</span>
+                        Last modified by <span class="author">Jörg Hoh</span> on <span class="comment">2021-12-14</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>
diff --git a/sitemap.xml b/sitemap.xml
index d6ec8df..ff64fe0 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -1,6 +1,8 @@
 <?xml version="1.0"?>
 <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
     <url>
+        <loc>https://sling.apache.org/documentation/the-sling-engine/resources.html</loc><lastmod>2021-12-14</lastmod>
+    </url><url>
         <loc>https://sling.apache.org/releases.html</loc><lastmod>2021-12-13</lastmod>
     </url><url>
         <loc>https://sling.apache.org/contributing.html</loc><lastmod>2021-07-05</lastmod>
@@ -239,8 +241,6 @@
     </url><url>
         <loc>https://sling.apache.org/documentation/the-sling-engine/default-mapping-and-rendering.html</loc><lastmod>2017-09-29</lastmod>
     </url><url>
-        <loc>https://sling.apache.org/documentation/the-sling-engine/resources.html</loc><lastmod>2021-11-22</lastmod>
-    </url><url>
         <loc>https://sling.apache.org/documentation/the-sling-engine.html</loc><lastmod>2017-09-29</lastmod>
     </url><url>
         <loc>https://sling.apache.org/documentation.html</loc><lastmod>2017-11-22</lastmod>