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 2017/02/24 07:49:57 UTC

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

Author: buildbot
Date: Fri Feb 24 07:49:57 2017
New Revision: 1007233

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 Fri Feb 24 07:49:57 2017
@@ -1 +1 @@
-1784175
+1784233

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 Fri Feb 24 07:49:57 2017
@@ -138,6 +138,11 @@ h2:hover > .headerlink, h3:hover > .head
 </ul>
 </li>
 <li><a href="#writeable-resources">Writeable Resources</a></li>
+<li><a href="#resource-observation">Resource Observation</a><ul>
+<li><a href="#resource-observation-api-resourcechangelistener">Resource Observation API (ResourceChangeListener)</a></li>
+<li><a href="#osgi-event-admin">OSGi Event Admin</a></li>
+</ul>
+</li>
 <li><a href="#wrapdecorate-resources">Wrap/Decorate Resources</a></li>
 </ul>
 </div>
@@ -286,10 +291,18 @@ and <code>getResource(Resource base, Str
 <p>The advantage is that this works for any ResourceProvider that supports the required operations.</p>
 <p>See the testSimpleCRUD method in <a href="https://svn.apache.org/repos/asf/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/serversidetests/WriteableResourcesTest.java">WriteableResourcesTest</a> for a basic example of how that works.
 More details can be found at <a href="/documentation/the-sling-engine/sling-api-crud-support.html">Sling API CRUD Support</a>.</p>
+<h2 id="resource-observation">Resource Observation<a class="headerlink" href="#resource-observation" title="Permanent link">&para;</a></h2>
+<p>To be notified whenever certain resources or their properties have been modified/added/removed there are different possibilities</p>
+<h3 id="resource-observation-api-resourcechangelistener">Resource Observation API (ResourceChangeListener)<a class="headerlink" href="#resource-observation-api-resourcechangelistener" title="Permanent link">&para;</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>
+Register an OSGi service for <a href="https://svn.apache.org/repos/asf/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/observation/ResourceChangeListener.java"><code>org.apache.sling.api.resource.observation.ResourceChangeListener</code></a> or <code>org.apache.sling.api.resource.observation.ExternalResourceChangeListener</code> to be notified about changes. Certain properties can be used to 
+restrict subscription to only a subset of events.</p>
+<h3 id="osgi-event-admin">OSGi Event Admin<a class="headerlink" href="#osgi-event-admin" title="Permanent link">&para;</a></h3>
+<p>Event are send 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/api/SlingConstants.html"><code>org.apache.sling.api.SlingConstants</code></a> starting with the prefix <code>TOPIC_</code>.</p>
 <h2 id="wrapdecorate-resources">Wrap/Decorate Resources<a class="headerlink" href="#wrapdecorate-resources" title="Permanent link">&para;</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>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1761922 by kwin on Thu, 22 Sep 2016 12:18:55 +0000
+        Rev. 1784233 by kwin on Fri, 24 Feb 2017 07:46:03 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project