incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r860698 - in /websites/staging/sling/trunk/content: ./ documentation/tutorials-how-tos/how-to-manage-events-in-sling.html
Date Fri, 03 May 2013 10:08:40 GMT
Author: buildbot
Date: Fri May  3 10:08:39 2013
New Revision: 860698

Log:
Staging update by buildbot for sling

Modified:
    websites/staging/sling/trunk/content/   (props changed)
    websites/staging/sling/trunk/content/documentation/tutorials-how-tos/how-to-manage-events-in-sling.html

Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri May  3 10:08:39 2013
@@ -1 +1 @@
-1477100
+1478705

Modified: websites/staging/sling/trunk/content/documentation/tutorials-how-tos/how-to-manage-events-in-sling.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/tutorials-how-tos/how-to-manage-events-in-sling.html
(original)
+++ websites/staging/sling/trunk/content/documentation/tutorials-how-tos/how-to-manage-events-in-sling.html
Fri May  3 10:08:39 2013
@@ -115,14 +115,17 @@ Sling makes a distinction between events
 <li>Moves the file according to its extension.</li>
 </ul>
 <h2 id="listening-to-osgi-events">Listening to OSGI Events</h2>
-<p>To listen to the specific OSGI event <strong>resource added</strong>
the property <em>event.topics</em> needs to be set to
-<strong>org.apache.sling.api.SlingConstants.TOPIC_RESOURCE_ADDED</strong> in
the class annotations.</p>
+<p>To listen to OSGi events in Sling you just need to register an org.osgi.service.event.EventHandler
service with 
+an event.topics property that describes which event topics the handler is interested in.</p>
+<p>To listen to a Sling <strong>resource added</strong> events, for example,
you'll set the <em>event.topics</em> property to 
+<strong>org.apache.sling.api.SlingConstants.TOPIC_RESOURCE_ADDED</strong> in
the class annotations:</p>
 <div class="codehilite"><pre> <span class="nd">@Property</span><span
class="o">(</span><span class="n">name</span><span class="o">=</span><span
class="s">&quot;event.topics&quot;</span><span class="o">,</span>
     <span class="n">value</span><span class="o">=</span><span
class="n">org</span><span class="o">.</span><span class="na">apache</span><span
class="o">.</span><span class="na">sling</span><span class="o">.</span><span
class="na">api</span><span class="o">.</span><span class="na">SlingConstants</span><span
class="o">.</span><span class="na">TOPIC_RESOURCE_ADDED</span><span
class="o">)</span>
 </pre></div>
 
 
-<p>You can refer to the <a href="/apidocs/sling6/org/apache/sling/api/SlingConstants.html">org.apache.sling.api.SlingConstants</a>
class in the Javadocs to know about other events available in Sling.</p>
+<p>The javadoc of the <a href="/apidocs/sling6/org/apache/sling/api/SlingConstants.html">org.apache.sling.api.SlingConstants</a>
+class lists and explains the available event topics available in Sling.</p>
 <h2 id="sending-job-events">Sending Job Events</h2>
 <p>To send an event the following code can be used: </p>
 <div class="codehilite"><pre><span class="kd">public</span> <span
class="kt">void</span> <span class="nf">sendEvent</span><span class="o">()</span>
<span class="o">{</span>
@@ -303,7 +306,7 @@ Sling makes a distinction between events
 
 <p>The complete code for the <strong>DropBoxEventHandler</strong> service
is available <a href="DropBoxEventHandler.java">here</a>.</p>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1463862 by fmeschbe on Wed, 3 Apr 2013 07:56:20 +0000
+        Rev. 1478705 by bdelacretaz on Fri, 3 May 2013 10:08:28 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project



Mime
View raw message