incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1420577 [14/30] - in /sling/site/trunk/content/site: ./ 46-line-blog.data/ authentication.data/ documentation.data/ first-steps.data/ getting-and-building-sling.data/ how-to-manage-events-in-sling.data/ index.data/ links.data/ manipulating...
Date Wed, 12 Dec 2012 09:14:44 GMT
Added: sling/site/trunk/content/site/jcr-installer-provider.html
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/jcr-installer-provider.html?rev=1420577&view=auto
==============================================================================
--- sling/site/trunk/content/site/jcr-installer-provider.html (added)
+++ sling/site/trunk/content/site/jcr-installer-provider.html Wed Dec 12 09:13:50 2012
@@ -0,0 +1,218 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<HTML>
+  <HEAD>
+    <TITLE>Apache Sling - JCR Installer Provider</TITLE>
+    <LINK rel="stylesheet" href="http://sling.apache.org/site/media.data/site.css" type="text/css" media="all">
+    <LINK rel="icon" href="http://sling.apache.org/site/media.data/favicon.ico">
+    <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </HEAD>
+  <BODY>
+    <DIV class="title">
+      <DIV class="logo">
+        <A href="http://sling.apache.org/site/index.html">
+          <IMG border="0" alt="Apache Sling" src="http://sling.apache.org/site/media.data/logo.png">
+        </A>
+      </DIV>
+      <DIV class="header">
+        <A href="http://www.apache.org/">
+          <IMG border="0" alt="Apache" src="http://sling.apache.org/site/media.data/apache.png">
+        </A>
+      </DIV>
+    </DIV>
+    <DIV class="menu">
+<P><B>Documentation</B><BR class="atl-forced-newline">
+<A href="getting-started.html" title="Getting Started">Getting Started</A><BR class="atl-forced-newline">
+<A href="the-sling-engine.html" title="The Sling Engine">The Sling Engine</A><BR class="atl-forced-newline">
+<A href="development.html" title="Development">Development</A><BR class="atl-forced-newline">
+<A href="bundles.html" title="Bundles">Bundles</A><BR class="atl-forced-newline">
+<A href="tutorials-how-tos.html" title="Tutorials & How-Tos">Tutorials &amp; How&#45;Tos</A><BR class="atl-forced-newline">
+<A href="configuration.html" title="Configuration">Configuration</A><BR class="atl-forced-newline">
+<A href="http://sling.apache.org/apidocs/sling6/index.html" class="external-link" rel="nofollow">API docs</A><BR class="atl-forced-newline">
+<A href="http://s.apache.org/sling.wiki" class="external-link" rel="nofollow">Wiki</A><BR class="atl-forced-newline">
+<A href="http://s.apache.org/sling.faq" class="external-link" rel="nofollow">FAQ</A><BR class="atl-forced-newline"></P>
+
+<P><B>Project info</B><BR class="atl-forced-newline">
+<A href="http://sling.apache.org/site/downloads.cgi" class="external-link" rel="nofollow">Downloads</A><BR class="atl-forced-newline">
+<A href="http://www.apache.org/licenses/" class="external-link" rel="nofollow">License</A><BR class="atl-forced-newline">
+<A href="contributing.html" title="Contributing">Contributing</A><BR class="atl-forced-newline">
+<A href="news.html" title="News">News</A><BR class="atl-forced-newline">
+<A href="links.html" title="Links">Links</A><BR class="atl-forced-newline">
+<A href="project-information.html" title="Project Information">Project Information</A><BR class="atl-forced-newline">
+<A href="https://issues.apache.org/jira/browse/SLING" class="external-link" rel="nofollow">Issue Tracker</A><BR class="atl-forced-newline">
+<A href="http://svn.apache.org/viewvc/sling/trunk" class="external-link" rel="nofollow">Browse Source Repository</A><BR class="atl-forced-newline">
+<A href="security.html" title="Security">Security</A><BR class="atl-forced-newline"></P>
+
+<P><B>Sponsorship</B><BR class="atl-forced-newline">
+<A href="http://www.apache.org/foundation/thanks.html" class="external-link" rel="nofollow">Thanks</A><BR class="atl-forced-newline">
+<A href="http://www.apache.org/foundation/sponsorship.html" class="external-link" rel="nofollow">Become a Sponsor</A><BR>
+<A href="http://www.apache.org/foundation/buy_stuff.html" class="external-link" rel="nofollow">Buy Stuff</A></P>
+
+
+  <IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
+  <P style="height: 135px"></P>
+    </DIV>
+    <DIV class="main">
+        <DIV class="breadcrump" style="font-size: 80%;">
+<A href="apache-sling.html" title="Apache Sling Website">Apache Sling Website</A>&nbsp;&gt;&nbsp;<A href="apache-sling.html" title="Apache Sling">Apache Sling</A>&nbsp;&gt;&nbsp;<A href="documentation.html" title="Documentation">Documentation</A>&nbsp;&gt;&nbsp;<A href="bundles.html" title="Bundles">Bundles</A>&nbsp;&gt;&nbsp;<A href="" title="JCR Installer Provider">JCR Installer Provider</A>
+        </DIV>
+<P>The JCR installer provider scans the JCR repository for artifacts and provides them to the <A href="osgi-installer.html" title="OSGi Installer">OSGI installer</A>.</P>
+
+<H2><A name="JCRInstallerProvider-ConfigurationandScanning"></A>Configuration and Scanning</H2>
+
+<P>The JCR installer provider can be configured with weighted paths which are scanned. By default, the installer scans in <B>/apps</B> and <B>/libs</B> where artifacts found in <B>/apps</B> get a higher priority. The installer does a deep scan and uses a regular expression to detect folders containing artifacts to be installed. By default, artifacts from within a folder named <EM>install</EM> are provided to the OSGi installer.</P>
+
+<P>If such an install folder contains a binary artifact (e.g. a bundle) this is provided to the OSGi installer. In addition a node of type <EM>sling:OsgiConfig</EM> is provided as a configuration to the installer.</P>
+
+<P>The jcr installer provider does not check or scan the artifacts itself, the detection and installation is deferred to the OSGi installer.</P>
+
+<H3><A name="JCRInstallerProvider-RunmodeSupport"></A>Runmode Support</H3>
+
+<P>The JCR installer supports run modes for installing artifacts. By default folders named <EM>install</EM> are checked for artifacts. If Apache Sling is started with one (or more run modes), all folders named <EM>install.<A href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=SLINGxSITE&title=RUNMODE&linkCreation=true&fromPageId=2852417" class="createlink">RUNMODE</A></EM> are scanned as well. To be precise, the folder name can be followed by any number of run modes separated by comma. For example, if started with run modes <EM>dev</EM>, <EM>a1</EM>, and <EM>public</EM>, folders like <EM>install.dev</EM>, <EM>install.a1</EM>, <EM>install.public</EM> are searched as well as <EM>install.dev.a1</EM>, or <EM>install.a1.dev</EM>.</P>
+
+<P>Artifacts from folders with a run mode get a higher priority. For example by default, an <EM>install</EM> folder underneath <EM>/libs</EM> gets the priority <EM>50</EM>. For each run mode in the folder name, this priority is increased by <EM>1</EM>, so <EM>install.dev</EM> has <EM>51</EM> and <EM>install.a1.dev</EM> is <EM>52</EM>.</P>
+
+<H1><A name="JCRInstallerProvider-Example"></A>Example</H1>
+<P>Here's a quick walkthrough of the JCR installer functionality.</P>
+
+<H2><A name="JCRInstallerProvider-Installation"></A>Installation</H2>
+<P>Start the Sling <A href="http://svn.apache.org/repos/asf/sling/trunk/launchpad/app" class="external-link" rel="nofollow">launchpad/app</A> and install and start the following additional bundles:</P>
+<UL>
+	<LI><A href="run-modes-orgapacheslingrunmode.html" title="Run Modes (org.apache.sling.runmode)">RunMode service</A></LI>
+	<LI>OSGi installer service (<A href="http://svn.apache.org/repos/asf/sling/trunk/installer/core" class="external-link" rel="nofollow">org.apache.sling.osgi.installer</A>)</LI>
+	<LI>JCR installer provider (<A href="http://svn.apache.org/repos/asf/sling/trunk/installer/providers/jcr" class="external-link" rel="nofollow">org.apache.sling.jcr.jcrinstall</A>)</LI>
+</UL>
+
+
+<P>To watch the logs produced by these modules, you can filter <TT>sling/logs/error.log</TT> using <TT>egrep 'jcrinstall|osgi.installer'</TT>.</P>
+
+<H2><A name="JCRInstallerProvider-Installandremoveabundle"></A>Install and remove a bundle</H2>
+<P>We'll use the <A href="http://www.knopflerfish.org/releases/2.0.5/jars/desktop_awt/desktop_awt_all-2.0.0.jar" class="external-link" rel="nofollow">Knopflerfish Desktop</A> bundle for this example, it is convenient as it displays a graphical user interface when started.</P>
+
+<P>We use <TT>curl</TT> to create content, to make it easy to reproduce the example by copying and pasting the <TT>curl</TT> commands. Any other way to create content in the repository will work, of course.</P>
+
+<P>By default, JCRInstall picks up bundles found in folders named <EM>install</EM> under <TT>/libs</TT> and <TT>/apps</TT>, so we start by creating such a folder:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>curl -X MKCOL  http://admin:admin@localhost:8888/apps/jcrtest
+curl -X MKCOL  http://admin:admin@localhost:8888/apps/jcrtest/install
+</PRE>
+</DIV></DIV>
+
+<P>And we copy the bundle to install in that folder (a backslash in command lines means <EM>continued on next line</EM>):</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>curl -T desktop_awt_all-2.0.0.jar \
+  http://admin:admin@localhost:8888/apps/jcrtest/install/desktop_awt_all-2.0.0.jar
+</PRE>
+</DIV></DIV>
+
+<P>That's it. After 2-3 seconds, the bundle should be picked up by JCRInstall, installed and started. If this works you'll see a small <EM>Knopflerfish Desktop</EM> window on your desktop, and Sling's OSGi console can of course be used to check the details.</P>
+
+<P>Removing the bundle from the repository will cause it to be uninstalled, so:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>curl -X DELETE \
+  http://admin:admin@localhost:8888/apps/jcrtest/install/desktop_awt_all-2.0.0.jar
+</PRE>
+</DIV></DIV>
+
+<P>Should cause the <EM>Knopflerfish Desktop</EM> window to disappear as the bundle is uninstalled.</P>
+
+
+<H2><A name="JCRInstallerProvider-Install%2Cmodifyandremoveaconfiguration"></A>Install, modify and remove a configuration</H2>
+<P>JCRInstall installs OSGi configurations from nodes having the <EM>sling:OsgiConfig</EM> node type, found in folders named <EM>install</EM> under the installation roots (/apps and /libs).</P>
+
+<P>Let's try this feature by creating a configuration with two properties:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>curl \
+  -F &quot;jcr:primaryType=sling:OsgiConfig&quot; \
+  -F foo=bar -F works=yes \
+  http://admin:admin@localhost:8888/apps/jcrtest/install/some.config.pid
+</PRE>
+</DIV></DIV>
+
+<P>And verify the contents of our config node:</P>
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>curl \
+  http://admin:admin@localhost:8888/apps/jcrtest/install/some.config.pid.json
+</PRE>
+</DIV></DIV>
+
+<P>Which should display something like</P>
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>{&quot;foo&quot;:&quot;bar&quot;,
+&quot;jcr:created&quot;:&quot;Wed Aug 26 2009 17:06:40GMT+0200&quot;,
+&quot;jcr:primaryType&quot;:&quot;sling:OsgiConfig&quot;,&quot;works&quot;:&quot;yes&quot;}
+</PRE>
+</DIV></DIV>
+
+<P>At this point, JCRInstall should have picked up our new config and installed it. The logs would confirm that, but we can also use the OSGi console's config status page (<A href="http://localhost:8888/system/console/config" class="external-link" rel="nofollow">http://localhost:8888/system/console/config</A>) to check it. That page should now contain:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>PID=some.config.pid
+  BundleLocation=Unbound
+  _jcr_config_path=jcrinstall:/apps/jcrtest/install/some.config.pid
+  foo=bars
+  service.pid=some.config.pid
+  works=yes
+</PRE>
+</DIV></DIV>
+
+<P>Indicating that the configuration has been installed.</P>
+
+<P>Let's try modifying the configuration parameters:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>curl \
+  -F works=updated -F even=more \
+  http://admin:admin@localhost:8888/apps/jcrtest/install/some.config.pid
+</PRE>
+</DIV></DIV>
+
+<P>And check the changes in the console page:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>PID=some.config.pid
+  BundleLocation=Unbound
+  _jcr_config_path=jcrinstall:/apps/jcrtest/install/some.config.pid
+  even=more
+  foo=bars
+  service.pid=some.config.pid
+  works=updated
+</PRE>
+</DIV></DIV>
+
+<P>We can now delete the configuration node:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>curl -X DELETE \
+  http://admin:admin@localhost:8888/apps/jcrtest/install/some.config.pid
+</PRE>
+</DIV></DIV>
+
+<P>And verify that the corresponding configuration is gone in the console page (after 1-2 seconds, like for all other JCRInstall operations).</P>
+
+<P><B>TODO:</B> A node named like <TT>o.a.s.foo.bar-a</TT> uses <EM>o.a.s.foo.bar</EM> as its factory PID creating a configuration with an automatically generated PID. The value of <EM>a</EM> is stored as an alias property in the configuration to correlate the configuration object with the repository node - demonstrate that.</P>
+
+<H1><A name="JCRInstallerProvider-AutomatedTests"></A>Automated Tests</H1>
+<P>The following modules contain lots of automated tests (under <TT>src/test</TT>, as usual):</P>
+
+<UL>
+	<LI>OSGi installer integration tests (<A href="http://svn.apache.org/repos/asf/sling/trunk/installer/it" class="external-link" rel="nofollow">org.apache.sling.installer.it</A>)</LI>
+	<LI>JCR installer service (<A href="http://svn.apache.org/repos/asf/sling/trunk/installer/providers/jcr" class="external-link" rel="nofollow">org.apache.sling.installer.providers.jcr</A>)</LI>
+</UL>
+
+
+<P>Many of these tests are fairly readable, and can be used to find out in more detail how these modules work.</P>
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by cziegeler@apache.org on 2011-10-11 07:47:44.0
+        </DIV>
+        <DIV class="trademarkFooter">
+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.
+        </DIV>
+    </DIV>
+  </BODY>
+</HTML>
+

Propchange: sling/site/trunk/content/site/jcr-installer-provider.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/site/trunk/content/site/jcr-installer-provider.html
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: sling/site/trunk/content/site/jcr-installer-provider.html
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: sling/site/trunk/content/site/jspc.html
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/jspc.html?rev=1420577&view=auto
==============================================================================
--- sling/site/trunk/content/site/jspc.html (added)
+++ sling/site/trunk/content/site/jspc.html Wed Dec 12 09:13:50 2012
@@ -0,0 +1,157 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<HTML>
+  <HEAD>
+    <TITLE>Apache Sling - JspC</TITLE>
+    <LINK rel="stylesheet" href="http://sling.apache.org/site/media.data/site.css" type="text/css" media="all">
+    <LINK rel="icon" href="http://sling.apache.org/site/media.data/favicon.ico">
+    <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </HEAD>
+  <BODY>
+    <DIV class="title">
+      <DIV class="logo">
+        <A href="http://sling.apache.org/site/index.html">
+          <IMG border="0" alt="Apache Sling" src="http://sling.apache.org/site/media.data/logo.png">
+        </A>
+      </DIV>
+      <DIV class="header">
+        <A href="http://www.apache.org/">
+          <IMG border="0" alt="Apache" src="http://sling.apache.org/site/media.data/apache.png">
+        </A>
+      </DIV>
+    </DIV>
+    <DIV class="menu">
+<P><B>Documentation</B><BR class="atl-forced-newline">
+<A href="getting-started.html" title="Getting Started">Getting Started</A><BR class="atl-forced-newline">
+<A href="the-sling-engine.html" title="The Sling Engine">The Sling Engine</A><BR class="atl-forced-newline">
+<A href="development.html" title="Development">Development</A><BR class="atl-forced-newline">
+<A href="bundles.html" title="Bundles">Bundles</A><BR class="atl-forced-newline">
+<A href="tutorials-how-tos.html" title="Tutorials & How-Tos">Tutorials &amp; How&#45;Tos</A><BR class="atl-forced-newline">
+<A href="configuration.html" title="Configuration">Configuration</A><BR class="atl-forced-newline">
+<A href="http://sling.apache.org/apidocs/sling6/index.html" class="external-link" rel="nofollow">API docs</A><BR class="atl-forced-newline">
+<A href="http://s.apache.org/sling.wiki" class="external-link" rel="nofollow">Wiki</A><BR class="atl-forced-newline">
+<A href="http://s.apache.org/sling.faq" class="external-link" rel="nofollow">FAQ</A><BR class="atl-forced-newline"></P>
+
+<P><B>Project info</B><BR class="atl-forced-newline">
+<A href="http://sling.apache.org/site/downloads.cgi" class="external-link" rel="nofollow">Downloads</A><BR class="atl-forced-newline">
+<A href="http://www.apache.org/licenses/" class="external-link" rel="nofollow">License</A><BR class="atl-forced-newline">
+<A href="contributing.html" title="Contributing">Contributing</A><BR class="atl-forced-newline">
+<A href="news.html" title="News">News</A><BR class="atl-forced-newline">
+<A href="links.html" title="Links">Links</A><BR class="atl-forced-newline">
+<A href="project-information.html" title="Project Information">Project Information</A><BR class="atl-forced-newline">
+<A href="https://issues.apache.org/jira/browse/SLING" class="external-link" rel="nofollow">Issue Tracker</A><BR class="atl-forced-newline">
+<A href="http://svn.apache.org/viewvc/sling/trunk" class="external-link" rel="nofollow">Browse Source Repository</A><BR class="atl-forced-newline">
+<A href="security.html" title="Security">Security</A><BR class="atl-forced-newline"></P>
+
+<P><B>Sponsorship</B><BR class="atl-forced-newline">
+<A href="http://www.apache.org/foundation/thanks.html" class="external-link" rel="nofollow">Thanks</A><BR class="atl-forced-newline">
+<A href="http://www.apache.org/foundation/sponsorship.html" class="external-link" rel="nofollow">Become a Sponsor</A><BR>
+<A href="http://www.apache.org/foundation/buy_stuff.html" class="external-link" rel="nofollow">Buy Stuff</A></P>
+
+
+  <IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
+  <P style="height: 135px"></P>
+    </DIV>
+    <DIV class="main">
+        <DIV class="breadcrump" style="font-size: 80%;">
+<A href="apache-sling.html" title="Apache Sling Website">Apache Sling Website</A>&nbsp;&gt;&nbsp;<A href="apache-sling.html" title="Apache Sling">Apache Sling</A>&nbsp;&gt;&nbsp;<A href="documentation.html" title="Documentation">Documentation</A>&nbsp;&gt;&nbsp;<A href="development.html" title="Development">Development</A>&nbsp;&gt;&nbsp;<A href="" title="JspC">JspC</A>
+        </DIV>
+<H1><A name="JspC-MavenJspCPlugin"></A>Maven JspC Plugin</H1>
+
+
+
+<P>The Maven JspC Plugin provides a single goal <TT>jspc</TT> which is by default executed in the <TT>compile</TT> phase of the Maven build process. This goal takes all JSP source files from a configured location (<TT>src/main/scripts</TT> by default) and compiles them into classes in a configurable location (<TT>target/jspc-plugin-generated</TT> by default). In addition, for each compiled JSP a Declarative Services descriptor is generated and written to a descriptor file (<TT>OSGI-INF/jspServiceComponents.xml</TT> in the output location). This descriptor will then be read by the Service Component Runtime of the deployment OSGi framework to register all contained JSP as <TT>javax.servlet.Servlet</TT> services.</P>
+
+
+
+<H2><A name="JspC-Use"></A>Use</H2>
+
+<P>To use the Maven JspC Plugin define the following elements in the <TT>&lt;plugins&gt;</TT> section of the POM:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-xml">
+<SPAN class="code-tag">&lt;?xml version=<SPAN class="code-quote">&quot;1.0&quot;</SPAN> encoding=<SPAN class="code-quote">&quot;ISO-8859-1&quot;</SPAN>?&gt;</SPAN>
+<SPAN class="code-tag">&lt;project&gt;</SPAN>
+    ....
+    <SPAN class="code-tag">&lt;build&gt;</SPAN>
+        ....
+        <SPAN class="code-tag">&lt;plugins&gt;</SPAN>
+            ....
+            <SPAN class="code-tag">&lt;plugin&gt;</SPAN>
+                <SPAN class="code-tag">&lt;groupId&gt;</SPAN>org.apache.sling<SPAN class="code-tag">&lt;/groupId&gt;</SPAN>
+                <SPAN class="code-tag">&lt;artifactId&gt;</SPAN>maven-jspc-plugin<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN>
+                <SPAN class="code-tag">&lt;executions&gt;</SPAN>
+                    <SPAN class="code-tag">&lt;execution&gt;</SPAN>
+                        <SPAN class="code-tag">&lt;id&gt;</SPAN>compile-jsp<SPAN class="code-tag">&lt;/id&gt;</SPAN>
+                        <SPAN class="code-tag">&lt;goals&gt;</SPAN>
+                            <SPAN class="code-tag">&lt;goal&gt;</SPAN>jspc<SPAN class="code-tag">&lt;/goal&gt;</SPAN>
+                        <SPAN class="code-tag">&lt;/goals&gt;</SPAN>
+                    <SPAN class="code-tag">&lt;/execution&gt;</SPAN>
+                <SPAN class="code-tag">&lt;/executions&gt;</SPAN>
+            <SPAN class="code-tag">&lt;/plugin&gt;</SPAN>
+            ....
+        <SPAN class="code-tag">&lt;plugins&gt;</SPAN>
+        ....
+    <SPAN class="code-tag">&lt;build&gt;</SPAN>
+    ....
+<SPAN class="code-tag">&lt;project&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+
+
+<H2><A name="JspC-Configuration"></A>Configuration</H2>
+
+<P>The Maven JspC Plugin may be configured in the <TT>&lt;configuration&gt;</TT> element using the following properties:</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Parameter </TH>
+<TH class="confluenceTh"> Default Value </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>sourceDirectory</TT> </TD>
+<TD class="confluenceTd"> <TT>${project.build.scriptSourceDirectory</TT>} </TD>
+<TD class="confluenceTd"> Location of the JSP source file; may be overwritten using the <TT>jspc.sourceDirectory</TT> system property. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>outputDirectory</TT> </TD>
+<TD class="confluenceTd"> <TT>${project.build.directory}/jspc-plugin-generated</TT> </TD>
+<TD class="confluenceTd"> Target directory for the compiled JSP classes; may be overwritten using the <TT>jspc.outputDirectory</TT> system propertiy. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>compilerTargetVM</TT> </TD>
+<TD class="confluenceTd"> <TT>1.5</TT> </TD>
+<TD class="confluenceTd"> The Target Virtual Machine Version to generate class files for; may be overwritten using the <TT>jspc.compilerTargetVM</TT> system property. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>compilerSourceVM</TT> </TD>
+<TD class="confluenceTd"> <TT>1.5</TT> </TD>
+<TD class="confluenceTd"> The Compiler Source Version of the Java source generated from the JSP files before compiling into classes; may be overwritten using the <TT>jspc.compilerSourceVM</TT> system property. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>servletPackage</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.jsp</TT> </TD>
+<TD class="confluenceTd"> The root package name for the generated class files; may be overwritten using the <TT>jspc.servletPackage</TT> system property. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+
+
+<H2><A name="JspC-Notes"></A>Notes</H2>
+
+<P>The generated JSP classes as well as the Declarative Services descriptor are automatically copied to the generated bundle jar file if the Maven Bundle Plugin (from the Apache Felix) project is used to build the project package.</P>
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by fmeschbe on 2008-02-11 05:47:49.0
+        </DIV>
+        <DIV class="trademarkFooter">
+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.
+        </DIV>
+    </DIV>
+  </BODY>
+</HTML>
+

Propchange: sling/site/trunk/content/site/jspc.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/site/trunk/content/site/jspc.html
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: sling/site/trunk/content/site/jspc.html
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: sling/site/trunk/content/site/launch-sling.html
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/launch-sling.html?rev=1420577&view=auto
==============================================================================
--- sling/site/trunk/content/site/launch-sling.html (added)
+++ sling/site/trunk/content/site/launch-sling.html Wed Dec 12 09:13:50 2012
@@ -0,0 +1,69 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<HTML>
+  <HEAD>
+    <TITLE>Apache Sling - Launch Sling</TITLE>
+    <LINK rel="stylesheet" href="http://sling.apache.org/site/media.data/site.css" type="text/css" media="all">
+    <LINK rel="icon" href="http://sling.apache.org/site/media.data/favicon.ico">
+    <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </HEAD>
+  <BODY>
+    <DIV class="title">
+      <DIV class="logo">
+        <A href="http://sling.apache.org/site/index.html">
+          <IMG border="0" alt="Apache Sling" src="http://sling.apache.org/site/media.data/logo.png">
+        </A>
+      </DIV>
+      <DIV class="header">
+        <A href="http://www.apache.org/">
+          <IMG border="0" alt="Apache" src="http://sling.apache.org/site/media.data/apache.png">
+        </A>
+      </DIV>
+    </DIV>
+    <DIV class="menu">
+<P><B>Documentation</B><BR class="atl-forced-newline">
+<A href="getting-started.html" title="Getting Started">Getting Started</A><BR class="atl-forced-newline">
+<A href="the-sling-engine.html" title="The Sling Engine">The Sling Engine</A><BR class="atl-forced-newline">
+<A href="development.html" title="Development">Development</A><BR class="atl-forced-newline">
+<A href="bundles.html" title="Bundles">Bundles</A><BR class="atl-forced-newline">
+<A href="tutorials-how-tos.html" title="Tutorials & How-Tos">Tutorials &amp; How&#45;Tos</A><BR class="atl-forced-newline">
+<A href="configuration.html" title="Configuration">Configuration</A><BR class="atl-forced-newline">
+<A href="http://sling.apache.org/apidocs/sling6/index.html" class="external-link" rel="nofollow">API docs</A><BR class="atl-forced-newline">
+<A href="http://s.apache.org/sling.wiki" class="external-link" rel="nofollow">Wiki</A><BR class="atl-forced-newline">
+<A href="http://s.apache.org/sling.faq" class="external-link" rel="nofollow">FAQ</A><BR class="atl-forced-newline"></P>
+
+<P><B>Project info</B><BR class="atl-forced-newline">
+<A href="http://sling.apache.org/site/downloads.cgi" class="external-link" rel="nofollow">Downloads</A><BR class="atl-forced-newline">
+<A href="http://www.apache.org/licenses/" class="external-link" rel="nofollow">License</A><BR class="atl-forced-newline">
+<A href="contributing.html" title="Contributing">Contributing</A><BR class="atl-forced-newline">
+<A href="news.html" title="News">News</A><BR class="atl-forced-newline">
+<A href="links.html" title="Links">Links</A><BR class="atl-forced-newline">
+<A href="project-information.html" title="Project Information">Project Information</A><BR class="atl-forced-newline">
+<A href="https://issues.apache.org/jira/browse/SLING" class="external-link" rel="nofollow">Issue Tracker</A><BR class="atl-forced-newline">
+<A href="http://svn.apache.org/viewvc/sling/trunk" class="external-link" rel="nofollow">Browse Source Repository</A><BR class="atl-forced-newline">
+<A href="security.html" title="Security">Security</A><BR class="atl-forced-newline"></P>
+
+<P><B>Sponsorship</B><BR class="atl-forced-newline">
+<A href="http://www.apache.org/foundation/thanks.html" class="external-link" rel="nofollow">Thanks</A><BR class="atl-forced-newline">
+<A href="http://www.apache.org/foundation/sponsorship.html" class="external-link" rel="nofollow">Become a Sponsor</A><BR>
+<A href="http://www.apache.org/foundation/buy_stuff.html" class="external-link" rel="nofollow">Buy Stuff</A></P>
+
+
+  <IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
+  <P style="height: 135px"></P>
+    </DIV>
+    <DIV class="main">
+        <DIV class="breadcrump" style="font-size: 80%;">
+<A href="apache-sling.html" title="Apache Sling Website">Apache Sling Website</A>&nbsp;&gt;&nbsp;<A href="apache-sling.html" title="Apache Sling">Apache Sling</A>&nbsp;&gt;&nbsp;<A href="old-stuff.html" title="Old Stuff">Old Stuff</A>&nbsp;&gt;&nbsp;<A href="" title="Launch Sling">Launch Sling</A>
+        </DIV>
+<P>Please refer to <A href="the-sling-launchpad.html" title="The Sling Launchpad">The Sling Launchpad</A> for up-to-date information on launching Sling.</P>
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by fmeschbe on 2010-07-30 17:54:33.0
+        </DIV>
+        <DIV class="trademarkFooter">
+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.
+        </DIV>
+    </DIV>
+  </BODY>
+</HTML>
+

Propchange: sling/site/trunk/content/site/launch-sling.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/site/trunk/content/site/launch-sling.html
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: sling/site/trunk/content/site/launch-sling.html
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: sling/site/trunk/content/site/links.data/ApacheConEU08_FFT_Sling.pdf
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/links.data/ApacheConEU08_FFT_Sling.pdf?rev=1420577&view=auto
==============================================================================
Binary file - no diff available.

Propchange: sling/site/trunk/content/site/links.data/ApacheConEU08_FFT_Sling.pdf
------------------------------------------------------------------------------
    svn:mime-type = application/pdf

Added: sling/site/trunk/content/site/links.data/ApacheConEU08_JCR_Meetup_Sling_Architecture.pdf
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/links.data/ApacheConEU08_JCR_Meetup_Sling_Architecture.pdf?rev=1420577&view=auto
==============================================================================
Binary file - no diff available.

Propchange: sling/site/trunk/content/site/links.data/ApacheConEU08_JCR_Meetup_Sling_Architecture.pdf
------------------------------------------------------------------------------
    svn:mime-type = application/pdf

Added: sling/site/trunk/content/site/links.data/ApacheConUS07_FFT_Sling.pdf
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/links.data/ApacheConUS07_FFT_Sling.pdf?rev=1420577&view=auto
==============================================================================
Binary file - no diff available.

Propchange: sling/site/trunk/content/site/links.data/ApacheConUS07_FFT_Sling.pdf
------------------------------------------------------------------------------
    svn:mime-type = application/pdf

Added: sling/site/trunk/content/site/links.html
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/links.html?rev=1420577&view=auto
==============================================================================
--- sling/site/trunk/content/site/links.html (added)
+++ sling/site/trunk/content/site/links.html Wed Dec 12 09:13:50 2012
@@ -0,0 +1,140 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<HTML>
+  <HEAD>
+    <TITLE>Apache Sling - Links</TITLE>
+    <LINK rel="stylesheet" href="http://sling.apache.org/site/media.data/site.css" type="text/css" media="all">
+    <LINK rel="icon" href="http://sling.apache.org/site/media.data/favicon.ico">
+    <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </HEAD>
+  <BODY>
+    <DIV class="title">
+      <DIV class="logo">
+        <A href="http://sling.apache.org/site/index.html">
+          <IMG border="0" alt="Apache Sling" src="http://sling.apache.org/site/media.data/logo.png">
+        </A>
+      </DIV>
+      <DIV class="header">
+        <A href="http://www.apache.org/">
+          <IMG border="0" alt="Apache" src="http://sling.apache.org/site/media.data/apache.png">
+        </A>
+      </DIV>
+    </DIV>
+    <DIV class="menu">
+<P><B>Documentation</B><BR class="atl-forced-newline">
+<A href="getting-started.html" title="Getting Started">Getting Started</A><BR class="atl-forced-newline">
+<A href="the-sling-engine.html" title="The Sling Engine">The Sling Engine</A><BR class="atl-forced-newline">
+<A href="development.html" title="Development">Development</A><BR class="atl-forced-newline">
+<A href="bundles.html" title="Bundles">Bundles</A><BR class="atl-forced-newline">
+<A href="tutorials-how-tos.html" title="Tutorials & How-Tos">Tutorials &amp; How&#45;Tos</A><BR class="atl-forced-newline">
+<A href="configuration.html" title="Configuration">Configuration</A><BR class="atl-forced-newline">
+<A href="http://sling.apache.org/apidocs/sling6/index.html" class="external-link" rel="nofollow">API docs</A><BR class="atl-forced-newline">
+<A href="http://s.apache.org/sling.wiki" class="external-link" rel="nofollow">Wiki</A><BR class="atl-forced-newline">
+<A href="http://s.apache.org/sling.faq" class="external-link" rel="nofollow">FAQ</A><BR class="atl-forced-newline"></P>
+
+<P><B>Project info</B><BR class="atl-forced-newline">
+<A href="http://sling.apache.org/site/downloads.cgi" class="external-link" rel="nofollow">Downloads</A><BR class="atl-forced-newline">
+<A href="http://www.apache.org/licenses/" class="external-link" rel="nofollow">License</A><BR class="atl-forced-newline">
+<A href="contributing.html" title="Contributing">Contributing</A><BR class="atl-forced-newline">
+<A href="news.html" title="News">News</A><BR class="atl-forced-newline">
+<A href="" title="Links">Links</A><BR class="atl-forced-newline">
+<A href="project-information.html" title="Project Information">Project Information</A><BR class="atl-forced-newline">
+<A href="https://issues.apache.org/jira/browse/SLING" class="external-link" rel="nofollow">Issue Tracker</A><BR class="atl-forced-newline">
+<A href="http://svn.apache.org/viewvc/sling/trunk" class="external-link" rel="nofollow">Browse Source Repository</A><BR class="atl-forced-newline">
+<A href="security.html" title="Security">Security</A><BR class="atl-forced-newline"></P>
+
+<P><B>Sponsorship</B><BR class="atl-forced-newline">
+<A href="http://www.apache.org/foundation/thanks.html" class="external-link" rel="nofollow">Thanks</A><BR class="atl-forced-newline">
+<A href="http://www.apache.org/foundation/sponsorship.html" class="external-link" rel="nofollow">Become a Sponsor</A><BR>
+<A href="http://www.apache.org/foundation/buy_stuff.html" class="external-link" rel="nofollow">Buy Stuff</A></P>
+
+
+  <IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
+  <P style="height: 135px"></P>
+    </DIV>
+    <DIV class="main">
+        <DIV class="breadcrump" style="font-size: 80%;">
+<A href="apache-sling.html" title="Apache Sling Website">Apache Sling Website</A>&nbsp;&gt;&nbsp;<A href="apache-sling.html" title="Apache Sling">Apache Sling</A>&nbsp;&gt;&nbsp;<A href="" title="Links">Links</A>
+        </DIV>
+<H1><A name="Links-Links"></A>Links</H1>
+
+<P>Here are some links to other resources</P>
+
+<H2><A name="Links-Articles"></A>Articles</H2>
+<UL>
+	<LI><A href="http://java.dzone.com/articles/java-content-repository-best" class="external-link" rel="nofollow">Java Content Repository: The Best Of Both Worlds</A> - by Bertrand Delacretaz on Javalobby - uses the Sling HTTP interface to demonstrate JCR features.</LI>
+	<LI><A href="http://www.lucamasini.net/Home/sling-and-cq5/accessing-relational-data-as-sling-restful-urls" class="external-link" rel="nofollow">Accessing Relational Data as SLING RESTful URLs</A> - by Luca Masini</LI>
+	<LI><A href="http://confluence.sakaiproject.org/display/KERNDOC/Your%20First%20Day%20With%20Sakai%20Nakamura" class="external-link" rel="nofollow">Your First Day With Sakai Nakamura</A> - Sakai Nakamura is based on Sling, that introductory article has very good explanations of REST and Sling basics, and on why hierarchies are useful on the Web.</LI>
+</UL>
+
+
+<H2><A name="Links-AboutSling"></A>About Sling</H2>
+
+<UL>
+	<LI><A href="http://dev.day.com/microsling/content/blogs/main.html?category=sling" class="external-link" rel="nofollow">Sling on dev.day.com</A> - Day's developers blog, regularly includes articles on Sling and JCR. Powered by Sling, of course.</LI>
+	<LI><A href="http://weblogs.goshaky.com/weblogs/lars/tags/sling" class="external-link" rel="nofollow">Sling on Lars Trieloff's Blog</A> - Lars regularly writes on his experiences with Sling. Most notably the mini series of three entries introducing Sling and microsling.</LI>
+	<LI><A href="http://del.icio.us/tag/sling%20jcr" class="external-link" rel="nofollow">Sling links at del.icio.us</A> - If you're a del.icio.us user, please tag Sling-related posts with both <EM>sling</EM> and <EM>jcr</EM> tags, so that they appear in that list.</LI>
+	<LI><A href="http://fisheye6.atlassian.com/browse/sling" class="external-link" rel="nofollow">Sling on Fisheye</A> - code repository viewer, activity statistics, etc.</LI>
+	<LI><A href="https://www.ohloh.net/p/sling" class="external-link" rel="nofollow">Sling on ohloh</A> - activity and community statistics.</LI>
+	<LI><A href="http://sling.markmail.org/" class="external-link" rel="nofollow">Sling on MarkMail</A> - searchable mailing list archives.</LI>
+</UL>
+
+
+
+<H2><A name="Links-ProjectsusingSling"></A>Projects using Sling</H2>
+
+<UL>
+	<LI>Gert Vanthienen succeeded in installing Sling into the new Apache ServiceMix kernel and documented his experience <A href="http://servicemix.apache.org/SMX4KNL/running-apache-sling-on-servicemix-kernel.html" class="external-link" rel="nofollow">Sling On ServiceMix Kernel</A></LI>
+</UL>
+
+
+<H2><A name="Links-SlingPresentationsandScreencasts"></A>Sling Presentations and Screencasts</H2>
+
+<UL>
+	<LI><A href="http://www.slideshare.net/tag/sling" class="external-link" rel="nofollow">Presentations tagged with &quot;sling&quot; at slideshare</A></LI>
+</UL>
+
+
+<P>The following screencasts demonstrate Day Software's CRX quickstart product, powered by Sling:</P>
+<UL>
+	<LI><A href="http://dev.day.com/microsling/content/blogs/main/firststeps1.html" class="external-link" rel="nofollow">First Steps with CRX Quickstart</A></LI>
+	<LI><A href="http://dev.day.com/microsling/content/blogs/main/firststeps2.html" class="external-link" rel="nofollow">TheServerSide.com in 15 minutes</A></LI>
+</UL>
+
+
+<H2><A name="Links-FromApacheConEU08"></A>From ApacheCon EU 08</H2>
+
+<UL>
+	<LI><A href="links.data/ApacheConEU08_FFT_Sling.pdf">ApacheCon EU 08 Fast Feather Track Presentation on Sling</A></LI>
+	<LI><A href="links.data/ApacheConEU08_JCR_Meetup_Sling_Architecture.pdf">JCR Meetup Presentation on Sling Architecture</A></LI>
+</UL>
+
+
+<H2><A name="Links-FromApacheConUS07"></A>From ApacheCon US 07</H2>
+
+<UL>
+	<LI><A href="links.data/ApacheConUS07_FFT_Sling.pdf">ApacheCon US 07 Fast Feather Track Presentation on Sling</A></LI>
+	<LI><A href="http://feathercast.org/?p=59" class="external-link" rel="nofollow">Feathercast On Day 4 with an interview on Sling with Felix</A></LI>
+</UL>
+
+
+<H2><A name="Links-TechnologyusedbySling"></A>Technology used by Sling</H2>
+
+<UL>
+	<LI><A href="http://jackrabbit.apache.org/" class="external-link" rel="nofollow">Apache Jackrabbit</A> - The reference implementation of the Content Repository for Java (JCR) Specification. This implementation is used in Sling as the primary repository.</LI>
+	<LI><A href="http://www.jcp.org/en/jsr/detail?id=170" class="external-link" rel="nofollow">JSR 170: Content Repository for Java<SPAN class="tm mark "><B></B><SMALL><SUP>TM</SUP></SMALL></SPAN>
+ technology API</A> - The specification of the repository API.</LI>
+	<LI><A href="http://felix.apache.org/" class="external-link" rel="nofollow">Apache Felix</A> - The OSGi Framework implementation we use in Sling.</LI>
+	<LI><A href="http://www.osgi.org/" class="external-link" rel="nofollow">The OSGi Alliance</A> - The OSGi Alliance is the specification body defining the OSGi Core and Compendium Services. These specifications are at the center of making Sling possible.</LI>
+</UL>
+
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by bdelacretaz on 2010-04-23 06:04:57.0
+        </DIV>
+        <DIV class="trademarkFooter">
+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.
+        </DIV>
+    </DIV>
+  </BODY>
+</HTML>
+

Propchange: sling/site/trunk/content/site/links.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/site/trunk/content/site/links.html
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: sling/site/trunk/content/site/links.html
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: sling/site/trunk/content/site/logging.html
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/logging.html?rev=1420577&view=auto
==============================================================================
--- sling/site/trunk/content/site/logging.html (added)
+++ sling/site/trunk/content/site/logging.html Wed Dec 12 09:13:50 2012
@@ -0,0 +1,290 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<HTML>
+  <HEAD>
+    <TITLE>Apache Sling - Logging</TITLE>
+    <LINK rel="stylesheet" href="http://sling.apache.org/site/media.data/site.css" type="text/css" media="all">
+    <LINK rel="icon" href="http://sling.apache.org/site/media.data/favicon.ico">
+    <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </HEAD>
+  <BODY>
+    <DIV class="title">
+      <DIV class="logo">
+        <A href="http://sling.apache.org/site/index.html">
+          <IMG border="0" alt="Apache Sling" src="http://sling.apache.org/site/media.data/logo.png">
+        </A>
+      </DIV>
+      <DIV class="header">
+        <A href="http://www.apache.org/">
+          <IMG border="0" alt="Apache" src="http://sling.apache.org/site/media.data/apache.png">
+        </A>
+      </DIV>
+    </DIV>
+    <DIV class="menu">
+<P><B>Documentation</B><BR class="atl-forced-newline">
+<A href="getting-started.html" title="Getting Started">Getting Started</A><BR class="atl-forced-newline">
+<A href="the-sling-engine.html" title="The Sling Engine">The Sling Engine</A><BR class="atl-forced-newline">
+<A href="development.html" title="Development">Development</A><BR class="atl-forced-newline">
+<A href="bundles.html" title="Bundles">Bundles</A><BR class="atl-forced-newline">
+<A href="tutorials-how-tos.html" title="Tutorials & How-Tos">Tutorials &amp; How&#45;Tos</A><BR class="atl-forced-newline">
+<A href="configuration.html" title="Configuration">Configuration</A><BR class="atl-forced-newline">
+<A href="http://sling.apache.org/apidocs/sling6/index.html" class="external-link" rel="nofollow">API docs</A><BR class="atl-forced-newline">
+<A href="http://s.apache.org/sling.wiki" class="external-link" rel="nofollow">Wiki</A><BR class="atl-forced-newline">
+<A href="http://s.apache.org/sling.faq" class="external-link" rel="nofollow">FAQ</A><BR class="atl-forced-newline"></P>
+
+<P><B>Project info</B><BR class="atl-forced-newline">
+<A href="http://sling.apache.org/site/downloads.cgi" class="external-link" rel="nofollow">Downloads</A><BR class="atl-forced-newline">
+<A href="http://www.apache.org/licenses/" class="external-link" rel="nofollow">License</A><BR class="atl-forced-newline">
+<A href="contributing.html" title="Contributing">Contributing</A><BR class="atl-forced-newline">
+<A href="news.html" title="News">News</A><BR class="atl-forced-newline">
+<A href="links.html" title="Links">Links</A><BR class="atl-forced-newline">
+<A href="project-information.html" title="Project Information">Project Information</A><BR class="atl-forced-newline">
+<A href="https://issues.apache.org/jira/browse/SLING" class="external-link" rel="nofollow">Issue Tracker</A><BR class="atl-forced-newline">
+<A href="http://svn.apache.org/viewvc/sling/trunk" class="external-link" rel="nofollow">Browse Source Repository</A><BR class="atl-forced-newline">
+<A href="security.html" title="Security">Security</A><BR class="atl-forced-newline"></P>
+
+<P><B>Sponsorship</B><BR class="atl-forced-newline">
+<A href="http://www.apache.org/foundation/thanks.html" class="external-link" rel="nofollow">Thanks</A><BR class="atl-forced-newline">
+<A href="http://www.apache.org/foundation/sponsorship.html" class="external-link" rel="nofollow">Become a Sponsor</A><BR>
+<A href="http://www.apache.org/foundation/buy_stuff.html" class="external-link" rel="nofollow">Buy Stuff</A></P>
+
+
+  <IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
+  <P style="height: 135px"></P>
+    </DIV>
+    <DIV class="main">
+        <DIV class="breadcrump" style="font-size: 80%;">
+<A href="apache-sling.html" title="Apache Sling Website">Apache Sling Website</A>&nbsp;&gt;&nbsp;<A href="apache-sling.html" title="Apache Sling">Apache Sling</A>&nbsp;&gt;&nbsp;<A href="documentation.html" title="Documentation">Documentation</A>&nbsp;&gt;&nbsp;<A href="development.html" title="Development">Development</A>&nbsp;&gt;&nbsp;<A href="" title="Logging">Logging</A>
+        </DIV>
+<H1><A name="Logging-Logging"></A>Logging</H1>
+
+<H2><A name="Logging-Introduction"></A>Introduction</H2>
+
+<P>Logging in Sling is supported by the <TT>org.apache.sling.commons.log</TT> bundle, which is one of the first bundles installed and started by the Sling Launcher. The <TT>org.apache.sling.commons.log</TT> bundle has the following tasks:</P>
+
+<UL>
+	<LI>Implements the OSGi Log Service Specification and registers the <TT>LogService</TT> and <TT>LogReader</TT> services</LI>
+	<LI>Exports three commonly used logging APIs:
+	<UL>
+		<LI><A href="http://www.slf4j.org/" class="external-link" rel="nofollow">Simple Logging Facade for Java (SLF4J)</A></LI>
+		<LI><A href="http://jakarta.apache.org/commons/logging" class="external-link" rel="nofollow">Apache Commons Logging</A></LI>
+		<LI><A href="http://logging.apache.org/log4j/index.html" class="external-link" rel="nofollow">log4j</A></LI>
+		<LI><A href="http://download.oracle.com/javase/6/docs/api/java/util/logging/package-summary.html" class="external-link" rel="nofollow">java.util.logging</A> (as of r1169918)</LI>
+	</UL>
+	</LI>
+	<LI>Configures logging through our own implementation of the SLF4J backend API</LI>
+</UL>
+
+
+
+<H2><A name="Logging-InitialConfiguration"></A>Initial Configuration</H2>
+
+<P>The <TT>org.apache.sling.commons.log</TT> bundle gets the initial configuration from the following <TT>BundleContext</TT> properties:</P>
+
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Property </TH>
+<TH class="confluenceTh"> Default </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>org.apache.sling.commons.log.level</TT> </TD>
+<TD class="confluenceTd"> <TT>INFO</TT> </TD>
+<TD class="confluenceTd"> Sets the initial logging level of the root logger. This may be any of the defined logging levels <TT>DEBUG</TT>, <TT>INFO</TT>, <TT>WARN</TT>, <TT>ERROR</TT> and <TT>FATAL</TT>. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>org.apache.sling.commons.log.file</TT> </TD>
+<TD class="confluenceTd"> undefined </TD>
+<TD class="confluenceTd"> Sets the log file to which log messages are written. If this property is empty or missing, log messages are written to <TT>System.out</TT>. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>org.apache.sling.commons.log.file.number</TT> </TD>
+<TD class="confluenceTd"> 5 </TD>
+<TD class="confluenceTd"> The number of rotated files to keep. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>org.apache.sling.commons.log.file.size</TT> </TD>
+<TD class="confluenceTd"> '.'yyyy-MM-dd </TD>
+<TD class="confluenceTd"> Defines how the log file is rotated (by schedule or by size) and when to rotate. See the section <EM>Log File Rotation</EM> below for full details on log file rotation. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>org.apache.sling.commons.log.pattern</TT> </TD>
+<TD class="confluenceTd"> {0,date,dd.MM.yyyy HH:mm:ss.SSS} &#42;{4}&#42; [{2}] {3} {5} </TD>
+<TD class="confluenceTd"> The <TT>MessageFormat</TT> pattern to use for formatting log messages with the root logger. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>org.apache.sling.commons.log.julenabled</TT> </TD>
+<TD class="confluenceTd"> n/a </TD>
+<TD class="confluenceTd"> Enables the <TT>java.util.logging</TT> support. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+
+<H2><A name="Logging-UserConfiguration"></A>User Configuration</H2>
+
+<P>User Configuration after initial configuration is provided by the Configuration Admin Service. To this avail two <TT>org.osgi.services.cm.ManagedServiceFactory</TT> services are registered under the PIDs <TT>org.apache.sling.commons.log.LogManager.factory.writer</TT> and <TT>org.apache.sling.commons.log.LogManager.factory.config</TT> which may receive configuration.</P>
+
+
+<H3><A name="Logging-LoggerConfiguration"></A>Logger Configuration</H3>
+
+<P>Loggers (or Categories) can be configured to log to specific files at specific levels using configurable patterns. To this avail factory configuration instances with factory PID <TT>org.apache.sling.commons.log.LogManager.factory.config</TT> may be created and configured with the Configuration Admin Service.</P>
+
+<P>The following properties may be set:</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Property </TH>
+<TH class="confluenceTh"> Type </TH>
+<TH class="confluenceTh"> Default </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>org.apache.sling.commons.log.level</TT> </TD>
+<TD class="confluenceTd"> String </TD>
+<TD class="confluenceTd"> <TT>INFO</TT> </TD>
+<TD class="confluenceTd"> Sets the logging level of the loggers. This may be any of the defined logging levels <TT>DEBUG</TT>, <TT>INFO</TT>, <TT>WARN</TT>, <TT>ERROR</TT> and <TT>FATAL</TT>. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>org.apache.sling.commons.log.file</TT> </TD>
+<TD class="confluenceTd"> String </TD>
+<TD class="confluenceTd"> undefined </TD>
+<TD class="confluenceTd"> Sets the log file to which log messages are written. If this property is empty or missing, log messages are written to <TT>System.out</TT>. This property should refer to the file name of a configured Log Writer (see below). If no Log Writer is configured with the same file name an implicit Log Writer configuration with default configuration is created. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>org.apache.sling.commons.log.pattern</TT> </TD>
+<TD class="confluenceTd"> String </TD>
+<TD class="confluenceTd"> {0,date,dd.MM.yyyy HH:mm:ss.SSS} &#42;{4}&#42; [{2}] {3} {5} </TD>
+<TD class="confluenceTd"> The <TT>java.util.MessageFormat</TT> pattern to use for formatting log messages with the root logger. This is a <TT>java.util.MessageFormat</TT> pattern supporting up to six arguments: {0} The timestamp of type <TT>java.util.Date</TT>, {1} the log marker, {2} the name of the current thread, {3} the name of the logger, {4} the debug level and {5} the actual debug message. If the log call includes a Throwable, the stacktrace is just appended to the message regardless of the pattern. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>org.apache.sling.commons.log.names</TT> </TD>
+<TD class="confluenceTd"> String[] </TD>
+<TD class="confluenceTd"> &ndash; </TD>
+<TD class="confluenceTd"> A list of logger names to which this configuration applies. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+
+<P>Note that multiple Logger Configurations may refer to the same Log Writer Configuration. If no Log Writer Configuration exists whose file name matches the file name set on the Logger Configuration an implicit Log Writer Configuration with default setup (daily log rotation) is internally created. </P>
+
+
+<H3><A name="Logging-LogWriterConfiguration"></A>Log Writer Configuration</H3>
+
+<P>Log Writer Configuration is used to setup file output and log file rotation characteristics for log writers used by the Loggers.</P>
+
+<P>The following properties may be set:</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Property </TH>
+<TH class="confluenceTh"> Default </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>org.apache.sling.commons.log.file</TT> </TD>
+<TD class="confluenceTd"> undefined </TD>
+<TD class="confluenceTd"> Sets the log file to which log messages are written. If this property is empty or missing, log messages are written to <TT>System.out</TT>. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>org.apache.sling.commons.log.file.number</TT> </TD>
+<TD class="confluenceTd"> 5 </TD>
+<TD class="confluenceTd"> The number of rotated files to keep. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>org.apache.sling.commons.log.file.size</TT> </TD>
+<TD class="confluenceTd"> '.'yyyy-MM-dd </TD>
+<TD class="confluenceTd"> Defines how the log file is rotated (by schedule or by size) and when to rotate. See the section <EM>Log File Rotation</EM> below for full details on log file rotation. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+<P>See the section <EM>Log File Rotation</EM> below for full details on the <TT>org.apache.sling.commons.log.file.size</TT> and <TT>org.apache.sling.commons.log.file.number</TT> properties.</P>
+
+
+
+<H2><A name="Logging-LogFileRotation"></A>Log File Rotation</H2>
+
+<P>Log files can grow rather quickly and fill up available disk space. To cope with this growth log files may be rotated in two ways: At specific times or when the log file reaches a configurable size. The first method is called <EM>Scheduled Rotation</EM> and is used by specifying a <TT>SimpleDateFormat</TT> pattern as the log file &quot;size&quot;. The second method is called <EM>Size Rotation</EM> and is used by setting a maximum file size as the log file size.</P>
+
+<P>As of version 2.0.6 of the Sling Commons Log bundle, the default value for log file scheduling is <TT>'.'yyyy-MM-dd</TT> causing daily log rotation. Previously log rotation defaulted to a 10MB file size limit.</P>
+
+
+
+<H3><A name="Logging-ScheduledRotation"></A>Scheduled Rotation</H3>
+
+<P>The rolling schedule is specified by setting the <TT>org.apache.sling.commons.log.file.size</TT> property to a <TT>java.text.SimpleDateFormat</TT> pattern. Literal text (such as a leading dot) to be included must be <EM>enclosed</EM> within a pair of single quotes. A formatted version of the date pattern is used as the suffix for the rolled file name.</P>
+
+<P>For example, if the log file is configured as <TT>/foo/bar.log</TT> and the pattern set to <TT>'.'yyyy-MM-dd</TT>, on 2001-02-16 at midnight, the logging file <TT>/foo/bar.log</TT> will be renamed to <TT>/foo/bar.log.2001-02-16</TT> and logging for 2001-02-17 will continue in a new <TT>/foo/bar.log</TT> file until it rolls over the next day.</P>
+
+<P>It is possible to specify monthly, weekly, half-daily, daily, hourly, or minutely rollover schedules.</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> DatePattern </TH>
+<TH class="confluenceTh"> Rollover schedule </TH>
+<TH class="confluenceTh"> Example </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>'.'yyyy-MM</TT> </TD>
+<TD class="confluenceTd"> Rollover at the beginning of each month </TD>
+<TD class="confluenceTd"> At midnight of May 31st, 2002 <TT>/foo/bar.log</TT> will be copied to <TT>/foo/bar.log.2002-05</TT>. Logging for the month of June will be output to <TT>/foo/bar.log</TT> until it is also rolled over the next month. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>'.'yyyy-ww</TT> </TD>
+<TD class="confluenceTd"> Rollover at the first day of each week. The first day of the week depends on the locale. </TD>
+<TD class="confluenceTd"> Assuming the first day of the week is Sunday, on Saturday midnight, June 9th 2002, the file <TT>/foo/bar.log</TT> will be copied to <TT>/foo/bar.log.2002-23</TT>. Logging for the 24th week of 2002 will be output to <TT>/foo/bar.log</TT> until it is rolled over the next week. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>'.'yyyy-MM-dd</TT> </TD>
+<TD class="confluenceTd"> Rollover at midnight each day.</TD>
+<TD class="confluenceTd"> At midnight, on March 8th, 2002, <TT>/foo/bar.log</TT> will be copied to <TT>/foo/bar.log.2002-03-08</TT>. Logging for the 9th day of March will be output to <TT>/foo/bar.log</TT> until it is rolled over the next day.</TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>'.'yyyy-MM-dd-a</TT> </TD>
+<TD class="confluenceTd"> Rollover at midnight and midday of each day.</TD>
+<TD class="confluenceTd"> at noon, on March 9th, 2002, <TT>/foo/bar.log</TT> will be copied to  <TT>/foo/bar.log.2002-03-09-AM</TT>. Logging for the afternoon of the 9th will be output to <TT>/foo/bar.log</TT> until it is rolled over at midnight.</TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>'.'yyyy-MM-dd-HH</TT> </TD>
+<TD class="confluenceTd"> Rollover at the top of every hour.</TD>
+<TD class="confluenceTd"> At approximately 11:00.000 o'clock on March 9th, 2002, <TT>/foo/bar.log</TT> will be copied to <TT>/foo/bar.log.2002-03-09-10</TT>. Logging for the 11th hour of the 9th of March will be output to <TT>/foo/bar.log</TT> until it is rolled over at the beginning of the next hour.</TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>'.'yyyy-MM-dd-HH-mm</TT> </TD>
+<TD class="confluenceTd"> Rollover at the beginning of every minute.</TD>
+<TD class="confluenceTd"> At approximately 11:23,000, on March 9th, 2001, <TT>/foo/bar.log</TT> will be copied to <TT>/foo/bar.log.2001-03-09-10-22</TT>. Logging for the minute of 11:23 (9th of March) will be output to <TT>/foo/bar.log</TT> until it is rolled over the next minute.</TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+<P>Do not use the colon &quot;:&quot; character in anywhere in the pattern option. The text before the colon is interpeted as the protocol specificaion of a URL which is probably not what you want.</P>
+
+<P>Note that Scheduled Rotation ignores the <TT>org.apache.sling.commons.log.file.number</TT> property since the old log files are not numbered but &quot;dated&quot;.</P>
+
+
+<H3><A name="Logging-SizeRotation"></A>Size Rotation</H3>
+
+<P>Log file rotation by size is specified by setting the <TT>org.apache.sling.commons.log.file.size</TT> property to a plain number or a number plus a size multiplier. The size multiplier may be any of <TT>K</TT>, <TT>KB</TT>, <TT>M</TT>, <TT>MB</TT>, <TT>G</TT>, or <TT>GB</TT> where the case is ignored and the meaning is probably obvious.</P>
+
+<P>When using Size Rotation, the <TT>org.apache.sling.commons.log.file.number</TT> defines the number of old log file generations to keep. For example to keep 5 old log files indexed by 0 through 4, set the <TT>org.apache.sling.commons.log.file.number</TT> to <TT>5</TT> (which happens to be the default).</P>
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by justinedelson on 2011-09-12 16:57:06.0
+        </DIV>
+        <DIV class="trademarkFooter">
+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.
+        </DIV>
+    </DIV>
+  </BODY>
+</HTML>
+

Propchange: sling/site/trunk/content/site/logging.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/site/trunk/content/site/logging.html
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: sling/site/trunk/content/site/logging.html
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: sling/site/trunk/content/site/managing-events.html
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/managing-events.html?rev=1420577&view=auto
==============================================================================
--- sling/site/trunk/content/site/managing-events.html (added)
+++ sling/site/trunk/content/site/managing-events.html Wed Dec 12 09:13:50 2012
@@ -0,0 +1,332 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<HTML>
+  <HEAD>
+    <TITLE>Apache Sling - Managing events</TITLE>
+    <LINK rel="stylesheet" href="http://sling.apache.org/site/media.data/site.css" type="text/css" media="all">
+    <LINK rel="icon" href="http://sling.apache.org/site/media.data/favicon.ico">
+    <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </HEAD>
+  <BODY>
+    <DIV class="title">
+      <DIV class="logo">
+        <A href="http://sling.apache.org/site/index.html">
+          <IMG border="0" alt="Apache Sling" src="http://sling.apache.org/site/media.data/logo.png">
+        </A>
+      </DIV>
+      <DIV class="header">
+        <A href="http://www.apache.org/">
+          <IMG border="0" alt="Apache" src="http://sling.apache.org/site/media.data/apache.png">
+        </A>
+      </DIV>
+    </DIV>
+    <DIV class="menu">
+<P><B>Documentation</B><BR class="atl-forced-newline">
+<A href="getting-started.html" title="Getting Started">Getting Started</A><BR class="atl-forced-newline">
+<A href="the-sling-engine.html" title="The Sling Engine">The Sling Engine</A><BR class="atl-forced-newline">
+<A href="development.html" title="Development">Development</A><BR class="atl-forced-newline">
+<A href="bundles.html" title="Bundles">Bundles</A><BR class="atl-forced-newline">
+<A href="tutorials-how-tos.html" title="Tutorials & How-Tos">Tutorials &amp; How&#45;Tos</A><BR class="atl-forced-newline">
+<A href="configuration.html" title="Configuration">Configuration</A><BR class="atl-forced-newline">
+<A href="http://sling.apache.org/apidocs/sling5/index.html" class="external-link" rel="nofollow">API docs</A><BR class="atl-forced-newline">
+<A href="http://s.apache.org/sling.wiki" class="external-link" rel="nofollow">Wiki</A><BR class="atl-forced-newline">
+<A href="http://s.apache.org/sling.faq" class="external-link" rel="nofollow">FAQ</A><BR class="atl-forced-newline"></P>
+
+<P><B>Project info</B><BR class="atl-forced-newline">
+<A href="http://sling.apache.org/site/downloads.cgi" class="external-link" rel="nofollow">Downloads</A><BR class="atl-forced-newline">
+<A href="contributing.html" title="Contributing">Contributing</A><BR class="atl-forced-newline">
+<A href="news.html" title="News">News</A><BR class="atl-forced-newline">
+<A href="links.html" title="Links">Links</A><BR class="atl-forced-newline">
+<A href="project-information.html" title="Project Information">Project Information</A><BR class="atl-forced-newline"></P>
+
+<P><B>Sponsorship</B><BR class="atl-forced-newline">
+<A href="http://www.apache.org/foundation/thanks.html" class="external-link" rel="nofollow">Thanks</A><BR class="atl-forced-newline">
+<A href="http://www.apache.org/foundation/sponsorship.html" class="external-link" rel="nofollow">Become a Sponsor</A><BR>
+<A href="http://www.apache.org/foundation/buy_stuff.html" class="external-link" rel="nofollow">Buy Stuff</A></P>
+
+
+  <IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
+  <P style="height: 135px"></P>
+    </DIV>
+    <DIV class="main">
+        <DIV class="breadcrump" style="font-size: 80%;">
+<A href="apache-sling.html" title="Apache Sling Website">Apache Sling Website</A>&nbsp;&gt;&nbsp;<A href="apache-sling.html" title="Apache Sling">Apache Sling</A>&nbsp;&gt;&nbsp;<A href="documentation.html" title="Documentation">Documentation</A>&nbsp;&gt;&nbsp;<A href="tutorials-how-tos.html" title="Tutorials & How-Tos">Tutorials &amp; How-Tos</A>&nbsp;&gt;&nbsp;<A href="" title="Managing events">Managing events</A>
+        </DIV>
+<P>Apache Sling provides some mechanisms and support for managing events. This page describes ...</P>
+
+<P>Sling makes a distinction between 2 types of events:</P>
+<UL>
+	<LI>standard events: no garantee of processing</LI>
+	<LI>job events: garantee of processing. Someone has to do something with the event (do the job).</LI>
+</UL>
+
+
+<P>The event mechanism is leveraging the OSGi Event Admin Specification (OSGi Compendium 113).<BR>
+The OSGi API is very simple and leightweight - sending an event is just generating the event object and calling the event admin. Receiving the event is implementing a single interface and declaring through properties which topics one is interested in. For more details please refer to the following javadocs:</P>
+<UL>
+	<LI>package <A href="http://www.osgi.org/javadoc/r4v42/org/osgi/service/event/package-summary.html" class="external-link" rel="nofollow">org.osgi.service.event</A> of the OSGI API.</LI>
+	<LI>package <A href="http://sling.apache.org/apidocs/sling5/org/apache/sling/event/package-summary.html" class="external-link" rel="nofollow">org.apache.sling.event</A> of the Sling API.</LI>
+</UL>
+
+
+<P>You can learn more in the <A href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=SLINGxSITE&title=Eventing,%20Jobs%20and%20Scheduling%20section&linkCreation=true&fromPageId=23335037" class="createlink">Eventing, Jobs and Scheduling section</A> (<A href="http://sling.apache.org/site/eventing-and-jobs.html" class="external-link" rel="nofollow">http://sling.apache.org/site/eventing-and-jobs.html</A>).</P>
+
+<P>To get started with the Sling eventing API, you will implement here a service that listens to files posted to <B>/tmp/dropbox</B> and moves them to the appropriate locations depending on the mime-type:</P>
+<UL>
+	<LI>images (.png) are moved to <B>/dropbox/images/</B></LI>
+	<LI>music (.mp3) are moved to <B>/dropbox/music/</B></LI>
+	<LI>movies (.avi) are moved to <B>/dropbox/movies/</B></LI>
+	<LI>otherwise the files are moved to <B>/dropbox/other/</B></LI>
+</UL>
+
+
+<P>To do that, you will implement 2 services. The first one, called <B>OsgiDropBoxService</B>:</P>
+<UL>
+	<LI>listens to osgi event <B>resource added</B></LI>
+	<LI>sends a job event<BR>
+The second one, called <B>DropBoxEventHandler</B>:</LI>
+	<LI>listens to job event <B>file added to /tmp/dropbox</B></LI>
+	<LI>moves the file according to its extension</LI>
+</UL>
+
+
+<H2><A name="Managingevents-ListeningtoOSGIEvents"></A>Listening to OSGI Events</H2>
+
+<P>To listen to the specific osgi event <B>resource added</B>:</P>
+<UL>
+	<LI>The service needs to implement the <B>org.osgi.service.event.EventHandler</B> interface and its <B>handleEvent(Event event)</B> method.</LI>
+	<LI>The property <B>event.topics</B> needs to be set to <B>org.apache.sling.api.SlingConstants.TOPIC_RESOURCE_ADDED</B> in the class annotations.</LI>
+</UL>
+
+
+<P>To get a list of possible events available in Sling (resource added, removed or changed), refer to the <A href="http://sling.apache.org/apidocs/sling5/org/apache/sling/api/SlingConstants.html" class="external-link" rel="nofollow">org.apache.sling.api.SlingConstants</A> class in the Javadocs.</P>
+
+<H2><A name="Managingevents-SendingaJobEvent"></A>Sending a Job Event</H2>
+
+<P>To send a job event:</P>
+<UL>
+	<LI>The service needs to implement the <B>org.apache.sling.event.JobProcessor</B> interface and its <B>process(org.osgi.service.event.Event job)</B> method.</LI>
+</UL>
+
+
+<P>The first part of the code looks as follows:</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+/**
+ * The &lt;code&gt;OsgiDropBoxService&lt;/code&gt; is listening content added to /tmp/dropbox by using OSGI events
+ * 
+ * @scr.component  immediate=<SPAN class="code-quote">&quot;<SPAN class="code-keyword">true</SPAN>&quot;</SPAN>
+ * @scr.service <SPAN class="code-keyword">interface</SPAN>=<SPAN class="code-quote">&quot;org.osgi.service.event.EventHandler&quot;</SPAN>
+ * @scr.property name=<SPAN class="code-quote">&quot;event.topics&quot;</SPAN> valueRef=<SPAN class="code-quote">&quot;org.apache.sling.api.SlingConstants.TOPIC_RESOURCE_ADDED&quot;</SPAN>
+ */
+<SPAN class="code-keyword">public</SPAN> class OsgiDropBoxService <SPAN class="code-keyword">implements</SPAN> JobProcessor, EventHandler {
+</PRE>
+</DIV></DIV>
+
+<P>The Event Admin service is needed to send the job event:</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+	/** 
+	 * The OSGI event admin used <SPAN class="code-keyword">for</SPAN> sending events 
+	 * @scr.reference
+	 */
+	<SPAN class="code-keyword">private</SPAN> EventAdmin eventAdmin;
+</PRE>
+</DIV></DIV>
+
+<P>The job topic for dropbox job events needs to be defined:</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+    /** The job topic <SPAN class="code-keyword">for</SPAN> dropbox job events. */
+    <SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">static</SPAN> <SPAN class="code-keyword">final</SPAN> <SPAN class="code-object">String</SPAN> JOB_TOPIC = <SPAN class="code-quote">&quot;com/sling/eventing/dropbox/job&quot;</SPAN>;
+</PRE>
+</DIV></DIV>
+
+<P>The org.osgi.service.event.EventHandler#handleEvent(Event event) method needs to be implemented:</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+	<SPAN class="code-keyword">public</SPAN> void handleEvent(Event event) {
+	    <SPAN class="code-keyword">if</SPAN> (EventUtil.isLocal(event)) {
+	        EventUtil.processJob(event, <SPAN class="code-keyword">this</SPAN>);
+	    }
+	}
+</PRE>
+</DIV></DIV>
+
+<P>The <B>org.apache.sling.event.JobProcessor#process(Event event)</B> method needs to be implemented.</P>
+
+<P>The logic is as follows:</P>
+<UL>
+	<LI>the OSGI event is analyzed</LI>
+	<LI>if the event is a file that has been added to &quot;/tmp/dropbox&quot;:
+	<UL>
+		<LI>an event is created with 2 properties:
+		<UL>
+			<LI>one to flag the event as a job event</LI>
+			<LI>the file path</LI>
+		</UL>
+		</LI>
+		<LI>the job event is sent to all the listeners that subscribe to the topic of the event.</LI>
+	</UL>
+	</LI>
+</UL>
+
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+	<SPAN class="code-keyword">public</SPAN> <SPAN class="code-object">boolean</SPAN> process(Event event) {
+		<SPAN class="code-object">String</SPAN> propPath = (<SPAN class="code-object">String</SPAN>) event.getProperty(SlingConstants.PROPERTY_PATH);
+		<SPAN class="code-object">String</SPAN> propResType = (<SPAN class="code-object">String</SPAN>) event.getProperty(SlingConstants.PROPERTY_RESOURCE_TYPE);
+		<SPAN class="code-comment">// an event is sent <SPAN class="code-keyword">if</SPAN> a file is added to /tmp/dropbox
+</SPAN>		<SPAN class="code-keyword">if</SPAN> (propPath.startsWith(<SPAN class="code-quote">&quot;/tmp/dropbox&quot;</SPAN>) &amp;&amp; propResType.equals(<SPAN class="code-quote">&quot;nt:file&quot;</SPAN>)) {
+    		<SPAN class="code-keyword">final</SPAN> Dictionary&lt;<SPAN class="code-object">String</SPAN>, <SPAN class="code-object">Object</SPAN>&gt; props = <SPAN class="code-keyword">new</SPAN> Hashtable&lt;<SPAN class="code-object">String</SPAN>, <SPAN class="code-object">Object</SPAN>&gt;();
+            props.put(EventUtil.PROPERTY_JOB_TOPIC, JOB_TOPIC);
+    		props.put(<SPAN class="code-quote">&quot;resourcePath&quot;</SPAN>, propPath);
+    		Event dropboxJobEvent = <SPAN class="code-keyword">new</SPAN> Event(EventUtil.TOPIC_JOB, props);
+    		eventAdmin.sendEvent(dropboxJobEvent);
+    		log.info(<SPAN class="code-quote">&quot;the dropbox job has been sent: {}&quot;</SPAN>, propPath);
+		}
+		<SPAN class="code-keyword">return</SPAN> <SPAN class="code-keyword">true</SPAN>;
+	}
+</PRE>
+</DIV></DIV>
+
+<P>The whole service looks now as follows:<BR>
+...</P>
+
+<P>Now that you have a service that sends job events whenever a file is uploaded to <B>/tmp/dropbox</B>, you will create the service <B>DropBoxEventHandler</B> that listens to those job events and moves the files to a location corresponding to their mime-types.</P>
+
+<H2><A name="Managingevents-ListeningtoJobEvents"></A>Listening to Job Events</H2>
+
+<P>To listen to the job events that have been defined before:</P>
+<UL>
+	<LI>The service also needs to implement the <B>org.osgi.service.event.EventHandler</B> interface and its <B>handleEvent(Event event)</B> method.</LI>
+	<LI>The property <B>event.topics</B> needs to be set to <B>com.jck.sling.eventing.osgi.OsgiDropBoxService.JOB_TOPIC</B> in the class annotations.</LI>
+</UL>
+
+
+<P>To move the files:</P>
+<UL>
+	<LI>The service needs to implement the <B>org.apache.sling.event.JobProcessor</B> interface and its <B>process(org.osgi.service.event.Event job)</B> method.</LI>
+</UL>
+
+
+<P>The first part of the code looks as follows:</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+/**
+ * @scr.component  immediate=<SPAN class="code-quote">&quot;<SPAN class="code-keyword">true</SPAN>&quot;</SPAN>
+ * @scr.service <SPAN class="code-keyword">interface</SPAN>=<SPAN class="code-quote">&quot;org.osgi.service.event.EventHandler&quot;</SPAN>
+ * @scr.property name=<SPAN class="code-quote">&quot;event.topics&quot;</SPAN> valueRef=<SPAN class="code-quote">&quot;com.jck.sling.eventing.osgi.OsgiDropBoxService.JOB_TOPIC&quot;</SPAN>
+ */
+
+<SPAN class="code-keyword">public</SPAN> class DropBoxEventHandler <SPAN class="code-keyword">implements</SPAN> JobProcessor, EventHandler {
+</PRE>
+</DIV></DIV>
+
+
+<P>Several class fields are defined:</P>
+<UL>
+	<LI>for logging</LI>
+	<LI>to reference the SlingRepository and the JcrResourceResolverFactory services, which are used in the implementation</LI>
+	<LI>to define the destination path of the files</LI>
+</UL>
+
+
+ <DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+   /** Default log. */
+    <SPAN class="code-keyword">protected</SPAN> <SPAN class="code-keyword">final</SPAN> Logger log = LoggerFactory.getLogger(<SPAN class="code-keyword">this</SPAN>.getClass());
+
+    <SPAN class="code-keyword">private</SPAN> Session adminSession;
+    
+    /** @scr.reference */
+    <SPAN class="code-keyword">private</SPAN> SlingRepository repository;
+    
+    /**
+     * @scr.reference
+     */
+    <SPAN class="code-keyword">private</SPAN> JcrResourceResolverFactory resolverFactory;
+    
+    <SPAN class="code-keyword">private</SPAN> <SPAN class="code-keyword">final</SPAN> <SPAN class="code-keyword">static</SPAN> <SPAN class="code-object">String</SPAN> IMAGES_PATH = <SPAN class="code-quote">&quot;/dropbox/images/&quot;</SPAN>;
+    <SPAN class="code-keyword">private</SPAN> <SPAN class="code-keyword">final</SPAN> <SPAN class="code-keyword">static</SPAN> <SPAN class="code-object">String</SPAN> MUSIC_PATH = <SPAN class="code-quote">&quot;/dropbox/music/&quot;</SPAN>;
+    <SPAN class="code-keyword">private</SPAN> <SPAN class="code-keyword">final</SPAN> <SPAN class="code-keyword">static</SPAN> <SPAN class="code-object">String</SPAN> MOVIES_PATH = <SPAN class="code-quote">&quot;/dropbox/movies/&quot;</SPAN>;
+    <SPAN class="code-keyword">private</SPAN> <SPAN class="code-keyword">final</SPAN> <SPAN class="code-keyword">static</SPAN> <SPAN class="code-object">String</SPAN> OTHER_PATH = <SPAN class="code-quote">&quot;/dropbox/other/&quot;</SPAN>;
+</PRE>
+</DIV></DIV>
+
+<H2><A name="Managingevents-HandlingJobEvents"></A>Handling Job Events</H2>
+
+<P>The <B>org.osgi.service.event.EventHandler#handleEvent(Event event)</B> method needs to be implemented:</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+	<SPAN class="code-keyword">public</SPAN> void handleEvent(Event event) {
+	    <SPAN class="code-keyword">if</SPAN> (EventUtil.isLocal(event)) {
+	        EventUtil.processJob(event, <SPAN class="code-keyword">this</SPAN>);
+	    }
+	}
+</PRE>
+</DIV></DIV>
+
+<P>The <B>org.apache.sling.event.JobProcessor#process(Event event)</B> method needs to be implemented.<BR>
+The logic is as follows:</P>
+<UL>
+	<LI>the resource path is extracted from the job event property</LI>
+	<LI>the resource is obtained from the file path</LI>
+	<LI>if the resource is a file, the destination path is defined based on the file mime-type</LI>
+	<LI>the file is moved to the new location</LI>
+</UL>
+
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+	<SPAN class="code-keyword">public</SPAN> <SPAN class="code-object">boolean</SPAN> process(Event event) {
+		<SPAN class="code-keyword">try</SPAN> {
+			<SPAN class="code-object">String</SPAN> resourcePath = (<SPAN class="code-object">String</SPAN>) event.getProperty(<SPAN class="code-quote">&quot;resourcePath&quot;</SPAN>);
+			<SPAN class="code-object">String</SPAN> resourceName = resourcePath.substring(resourcePath.lastIndexOf(<SPAN class="code-quote">&quot;/&quot;</SPAN>) + 1);
+        	adminSession = repository.loginAdministrative(<SPAN class="code-keyword">null</SPAN>);
+	        ResourceResolver resourceResolver = resolverFactory.getResourceResolver(adminSession);
+	        Resource res = resourceResolver.getResource(resourcePath);
+	        <SPAN class="code-keyword">if</SPAN> (ResourceUtil.isA(res, <SPAN class="code-quote">&quot;nt:file&quot;</SPAN>)) {
+	        	<SPAN class="code-object">String</SPAN> mimeType = res.getResourceMetadata().getContentType();
+	        	<SPAN class="code-object">String</SPAN> destDir;
+	        	<SPAN class="code-keyword">if</SPAN> (mimeType.equals(<SPAN class="code-quote">&quot;image/png&quot;</SPAN>)) {
+	        		destDir = IMAGES_PATH;
+	        	}
+	        	<SPAN class="code-keyword">else</SPAN> <SPAN class="code-keyword">if</SPAN> (mimeType.equals(<SPAN class="code-quote">&quot;audio/mpeg&quot;</SPAN>)) {
+	        		destDir = MUSIC_PATH;
+	        	}
+	        	<SPAN class="code-keyword">else</SPAN> <SPAN class="code-keyword">if</SPAN> (mimeType.equals(<SPAN class="code-quote">&quot;video/x-msvideo&quot;</SPAN>)) {
+	        		destDir = MOVIES_PATH;
+	        	}
+	        	<SPAN class="code-keyword">else</SPAN> {
+	        		destDir = OTHER_PATH;
+	        	}
+        		adminSession.move(resourcePath, destDir + resourceName);
+	        	adminSession.save();
+	        	log.info(<SPAN class="code-quote">&quot;The file {} has been moved to {}&quot;</SPAN>, resourceName, destDir);
+	        }
+	        <SPAN class="code-keyword">return</SPAN> <SPAN class="code-keyword">true</SPAN>;
+		} <SPAN class="code-keyword">catch</SPAN> (RepositoryException e) {
+			log.error(<SPAN class="code-quote">&quot;RepositoryException: &quot;</SPAN> + e);
+			<SPAN class="code-keyword">return</SPAN> <SPAN class="code-keyword">false</SPAN>;
+        } <SPAN class="code-keyword">finally</SPAN> {
+            <SPAN class="code-keyword">if</SPAN> (adminSession != <SPAN class="code-keyword">null</SPAN> &amp;&amp; adminSession.isLive()) {
+            	adminSession.logout();
+            	adminSession = <SPAN class="code-keyword">null</SPAN>;
+            }
+        }
+	}
+</PRE>
+</DIV></DIV>
+
+<P>The complete code for the service looks as follows:<BR>
+...</P>
+
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by jck on Mon Aug 16 08:58:35 EDT 2010
+        </DIV>
+    </DIV>
+  </BODY>
+</HTML>
+

Propchange: sling/site/trunk/content/site/managing-events.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/site/trunk/content/site/managing-events.html
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: sling/site/trunk/content/site/managing-events.html
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message