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 2012/12/12 10:17:17 UTC

svn commit: r841833 [26/28] - in /websites/staging/sling/trunk/content: ./ site/ site/46-line-blog.data/ site/authentication.data/ site/documentation.data/ site/first-steps.data/ site/getting-and-building-sling.data/ site/how-to-manage-events-in-sling....

Added: websites/staging/sling/trunk/content/site/sling-testing-tools.html
==============================================================================
--- websites/staging/sling/trunk/content/site/sling-testing-tools.html (added)
+++ websites/staging/sling/trunk/content/site/sling-testing-tools.html Wed Dec 12 09:16:44 2012
@@ -0,0 +1,184 @@
+
+<!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 - Sling Testing Tools</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="Sling Testing Tools">Sling Testing Tools</A>
+        </DIV>
+<H1><A name="SlingTestingTools-SlingTestingTools"></A>Sling Testing Tools</H1>
+<P>Sling provides a number of testing tools to support the following use cases:</P>
+<UL>
+	<LI>Run JUnit tests contributed by OSGi bundles in an OSGi system. This does not require Sling and should work in other OSGi  environments.</LI>
+	<LI>Run scriptable tests in a Sling instance, using any supported scripting language.</LI>
+	<LI>Run integration tests via HTTP against a Sling instance that is started during the Maven build cycle, or independently.</LI>
+</UL>
+
+
+<P>This page describes those tools, and points to the bundles that implement them.</P>
+
+<P>The <A href="http://svn.apache.org/repos/asf/sling/trunk/testing/samples/integration-tests" class="external-link" rel="nofollow">testing/samples/integration-tests</A> module demonstrates these tools, and is also meant as a sample project to show how to run integration tests for Sling-based applications.</P>
+
+<P>The main Sling integration tests at <A href="https://svn.apache.org/repos/asf/sling/trunk/launchpad/integration-tests" class="external-link" rel="nofollow">launchpad/integration-tests</A> were created before this testing framework, and do not use it yet (as of March 2011). The new testing tools are simpler to use, but the &quot;old&quot; tests (all 400 of them as I write this) fulfill their validation role for testing Sling itself, there's no real need to modify them to use the new tools.</P>
+
+<P>See also <A href="testing-sling-based-applications.html" title="Testing Sling-based applications">Testing Sling&#45;based applications</A> which discusses testing in general.</P>
+
+<H1><A name="SlingTestingTools-ServersideJUnittestscontributedbybundles"></A>Server-side JUnit tests contributed by bundles</H1>
+<P>The services provided by the <A href="http://svn.apache.org/repos/asf/sling/trunk/testing/junit/core" class="external-link" rel="nofollow">org.apache.sling.junit.core</A> bundle allow bundles to register JUnit tests, which are executed server-side by the JUnitServlet registered by default at <TT>/system/sling/junit</TT>. This bundle is not dependent on Sling, it should work in other OSGi environments.</P>
+
+<DIV class="panelMacro"><TABLE class="warningMacro"><COLGROUP><COL width="24"><COL></COLGROUP><TR><TD valign="top"><IMG src="https://cwiki.apache.org/confluence/images/icons/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></TD><TD><B>JUnit servlet security</B><BR>Note that the JUnitServlet does not require authentication, so it would allow any client to run tests. The servlet can be disabled by configuration if needed, but in general the <TT>/system</TT> path should not be accessible to website visitors anyway.</TD></TR></TABLE></DIV>
+
+<DIV class="panelMacro"><TABLE class="noteMacro"><COLGROUP><COL width="24"><COL></COLGROUP><TR><TD valign="top"><IMG src="https://cwiki.apache.org/confluence/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></TD><TD><B>SlingJUnitServlet</B><BR>For tighter integration with Sling, the alternate <TT>SlingJUnitServlet</TT> is registered with the <TT>sling/junit/testing</TT> resource type and <TT>.junit</TT> selector, if the bundle is running in a Sling system. Using this servlet instead of the plain JUnitServlet also allows Sling authentication to be used for running the tests, and the standard Sling request processing is used, including servlet filters for example.</TD></TR></TABLE></DIV>
+
+<P>To try the JUnitServlet interactively, install the <A href="http://svn.apache.org/repos/asf/sling/trunk/testing/samples/sample-tests" class="external-link" rel="nofollow">org.apache.sling.testing.samples.sampletests</A> bundle.</P>
+
+<P>This bundle contains a number of test classes, which are registered with the <TT>org.apache.sling.junit.core</TT> services by way of the <TT>Sling-Test-Regexp=.*Test</TT> bundle header, defined in the bundle's <TT>pom.xml</TT>. The JUnit core services use this regular expression to select which classes of the test bundle should be executed as JUnit tests.</P>
+
+<P>To list the available tests, open <A href="http://localhost:8080/system/sling/junit/" class="external-link" rel="nofollow">http://localhost:8080/system/sling/junit/</A> . The servlet shows available tests, and allows you to execute them via a POST request.</P>
+
+<P>Adding a path allows you to select a specific subset of tests, as in <A href="http://localhost:8080/system/sling/junit/org.apache.sling.junit.remote.html" class="external-link" rel="nofollow">http://localhost:8080/system/sling/junit/org.apache.sling.junit.remote.html</A> - the example integration tests described below use this to selectively execute server-side tests. The JUnitServlet provides various output formats, including in particular JSON, see <A href="http://localhost:8080/system/sling/junit/.json" class="external-link" rel="nofollow">http://localhost:8080/system/sling/junit/.json</A> for example.</P>
+
+<P>To supply tests from your own bundles, simply export the tests classes and add the <TT>Sling-Test-Regexp</TT> header to the bundle so that the Sling JUnit core services register them as tests.</P>
+
+<H3><A name="SlingTestingTools-InjectionofOSGiservices"></A>Injection of OSGi services</H3>
+<P>The <TT>@TestReference</TT> annotation is used to inject OSGi services in tests that are executed server side.The <TT>BundleContext</TT> can also be injected in this way, see the <A href="http://svn.apache.org/repos/asf/sling/trunk/testing/samples/sample-tests/src/main/java/org/apache/sling/testing/samples/sampletests/OsgiAwareTest.java" class="external-link" rel="nofollow">OsgiAwareTest</A> for an example.</P>
+
+<H2><A name="SlingTestingTools-Curlexamples"></A>Curl examples</H2>
+<P>Here's an example executing a few tests using curl:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;"><B>Running tests with curl</B></DIV><DIV class="codeContent panelContent">
+<PRE class="code-java">
+$ curl -X POST http:<SPAN class="code-comment">//localhost:8080/system/sling/junit/org.apache.sling.testing.samples.sampletests.JUnit.json
+</SPAN>[{
+    <SPAN class="code-quote">&quot;INFO_TYPE&quot;</SPAN>: <SPAN class="code-quote">&quot;test&quot;</SPAN>,
+    <SPAN class="code-quote">&quot;description&quot;</SPAN>: <SPAN class="code-quote">&quot;testPasses(org.apache.sling.testing.samples.sampletests.JUnit3Test)&quot;</SPAN>
+  },{
+    <SPAN class="code-quote">&quot;INFO_TYPE&quot;</SPAN>: <SPAN class="code-quote">&quot;test&quot;</SPAN>,
+    <SPAN class="code-quote">&quot;description&quot;</SPAN>: <SPAN class="code-quote">&quot;testPasses(org.apache.sling.testing.samples.sampletests.JUnit4Test)&quot;</SPAN>
+  },{
+    <SPAN class="code-quote">&quot;INFO_TYPE&quot;</SPAN>: <SPAN class="code-quote">&quot;test&quot;</SPAN>,
+    <SPAN class="code-quote">&quot;description&quot;</SPAN>: <SPAN class="code-quote">&quot;testRequiresBefore(org.apache.sling.testing.samples.sampletests.JUnit4Test)&quot;</SPAN>
+  }
+]
+</PRE>
+</DIV></DIV>
+
+<P>And another example with a test that fails:</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;"><B>Failing tests with curl</B></DIV><DIV class="codeContent panelContent">
+<PRE class="code-java">
+$ curl -X POST http:<SPAN class="code-comment">//localhost:8080/system/sling/junit/org.apache.sling.testing.samples.failingtests.JUnit4FailingTest.json
+</SPAN>[continuous integration|SLINGxSITE:Project Information]
+</PRE>
+</DIV></DIV>
+
+<H1><A name="SlingTestingTools-Scriptableserversidetests"></A>Scriptable server-side tests</H1>
+<P>If the <A href="http://svn.apache.org/repos/asf/sling/trunk/testing/junit/scriptable" class="external-link" rel="nofollow">org.apache.sling.junit.scriptable</A> bundle is active in a Sling system, (in addition to the <TT>org.apache.sling.junit.core</TT> bundle), scriptable tests can be executed by the <TT>JUnitServlet</TT> according to the following rules:</P>
+
+<UL>
+	<LI>A node that has the <TT>sling:Test</TT> mixin is a scriptable test node.</LI>
+	<LI>For security reasons, scriptable test nodes are only executed as tests if they are found under <TT>/libs</TT> or <TT>/apps</TT>, or more precisely under a path that's part of Sling's <TT>ResourceResolver</TT> search path.</LI>
+	<LI>To execute a test, the scriptable tests provider makes an HTTP requests to the test node's path, with a <TT>.test.txt</TT> selector and extension, and expects the output to contain only the string <TT>TEST_PASSED</TT>. Empty lines and comment lines starting with a hash sign (#) are ignored in the output, and other lines are reported as failures.</LI>
+</UL>
+
+
+<P>The <A href="http://svn.apache.org/repos/asf/sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/scriptable/ScriptableTestsTest.java" class="external-link" rel="nofollow">ScriptableTestsTest</A> class, from the integration test samples module described below, sets up such a test node and its accompanying script, and calls the JUnitServlet to execute the test. It can be used as a detailed example of how this works.</P>
+
+<H1><A name="SlingTestingTools-Integrationtestsexample"></A>Integration tests example</H1>
+<P>The <A href="http://svn.apache.org/repos/asf/sling/trunk/testing/samples/integration-tests" class="external-link" rel="nofollow">testing/samples/integration-tests</A> module runs some simple integration tests against a Sling Launchpad instance that's setup from scratch before running the tests.</P>
+
+<P>This module's pom and Java code can be used as examples to setup your own integration testing modules for Sling-based apps - or for any other runnable jar that provides an http service.</P>
+
+<P>Besides serving as examples, some of the tests in this module are used to validate the testing tools. They run as part of the full Sling <A href="project-information.html" title="Project Information">continuous integration</A> build, so they're guaranteed to be correct examples if that build is successful.</P>
+
+<P>The sample uses the <A href="http://svn.apache.org/repos/asf/sling/trunk/testing/tools" class="external-link" rel="nofollow">testing/tools</A> to make the test code simpler. See the <A href="https://svn.apache.org/repos/asf/sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/http/OsgiConsoleTest.java" class="external-link" rel="nofollow">OsgiConsoleTest</A> class for an example of a test that's very readable and requires no test setup or boilerplate code.</P>
+
+<P>The following steps are executed in the <TT>integration-test</TT> phase of this module's Maven  build:</P>
+<OL>
+	<LI>A random port number for the Sling server is selected by the Maven build helper plugin, unless explicitely set (see pom.xml for such options).</LI>
+	<LI>Additional bundles, defined in the module's pom, are downloaded from the Maven repository in the <TT>target/sling/additional-bundles</TT> folder.</LI>
+	<LI>The first test that inherits from the <A href="https://svn.apache.org/repos/asf/sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/sling/SlingTestBase.java" class="external-link" rel="nofollow">SlingTestBase</A> class causes the Sling runnable jar (defined as a dependency in the module's pom) to be started.
+	<OL>
+		<LI>The <TT>SlingTestBase</TT> class waits for the Sling server to be ready, based on URLs and expected responses defined in the pom.</LI>
+		<LI>The <TT>SlingTestBase</TT> class installs and starts the bundles found in the <TT>target/sling/additional-bundles</TT> folder.</LI>
+	</OL>
+	</LI>
+	<LI>The test can now either test Sling directly via its http interface, or use the JUnitServlet to execute server-side tests contributed by bundles or scripts, as described above.</LI>
+	<LI>The Sling runnable jar is stopped when the test VM exits.</LI>
+	<LI>The test results are reported via the usual Maven mechanisms.</LI>
+</OL>
+
+
+<P>If <TT>-DkeepJarRunning</TT> is used on the Maven command line, the Sling runnable jar does not exit, to allow for running individual tests against this instance, for example when debugging the tests or the server code. See the pom for details.</P>
+
+<H1><A name="SlingTestingTools-Remotetestexecution"></A>Remote test execution</H1>
+<P>The testing tools support two types of remote test execution.</P>
+
+<H2><A name="SlingTestingTools-SlingRemoteTestRunner"></A>SlingRemoteTestRunner</H2>
+<P>The <A href="http://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java" class="external-link" rel="nofollow">SlingRemoteTestRunner</A> is used to run tests using the <TT>JUnitServlet</TT> described above. In this case, the client-side JUnit test only defines which tests to run and some optional assertions. Checking the number of tests executed, for example, can be useful to make sure all test bundles have been activated as expected, to avoid ignoring missing test bundles.</P>
+
+<P>See the <A href="https://svn.apache.org/repos/asf/sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/ServerSideSampleTest.java" class="external-link" rel="nofollow">ServerSideSampleTest</A> class for an example.</P>
+
+<H2><A name="SlingTestingTools-SlingRemoteExecutionRule"></A>SlingRemoteExecutionRule</H2>
+<P>The <A href="http://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java" class="external-link" rel="nofollow">SlingRemoteExecutionRule</A> is a JUnit Rule that allows tests to be executed remotely in a Sling instance from an IDE, assuming the test is available on both sides.</P>
+
+<P>The <A href="https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/exported/ExampleRemoteTest.java" class="external-link" rel="nofollow">ExampleRemoteTest</A> class demonstrates this. To run it from your IDE, set the <TT>sling.remote.test.url</TT> in the IDE to the URL of the JUnitServlet, like <A href="http://localhost:8080/system/sling/junit" class="external-link" rel="nofollow">http://localhost:8080/system/sling/junit</A> for example.</P>
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by bdelacretaz on Tue May 08 16:01:11 EDT 2012
+        </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>
+

Added: websites/staging/sling/trunk/content/site/sling.html
==============================================================================
--- websites/staging/sling/trunk/content/site/sling.html (added)
+++ websites/staging/sling/trunk/content/site/sling.html Wed Dec 12 09:16:44 2012
@@ -0,0 +1,550 @@
+
+<!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 - 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="documentation.html" title="Documentation">Documentation</A>&nbsp;&gt;&nbsp;<A href="development.html" title="Development">Development</A>&nbsp;&gt;&nbsp;<A href="" title="Sling">Sling</A>
+        </DIV>
+<H1><A name="Sling-MavenSlingPlugin"></A>Maven Sling Plugin</H1>
+
+<P>The Maven Sling Plugin provides a number of goals which may be of help while developping bundles for Sling. To run the plugin you need at least Maven 2.x and JDK 1.5 or higher. Maven Sling Plugin provides the following goals:</P>
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Goals <BR class="atl-forced-newline"> </TH>
+<TH class="confluenceTh"> Description <BR class="atl-forced-newline"> </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <A href="#Sling-deploy">sling:deploy</A> </TD>
+<TD class="confluenceTd"> Deploy a OSGi-bundle into a running Sling instance. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <A href="#Sling-deployfile">sling:deploy-file</A> </TD>
+<TD class="confluenceTd"> Deploy a OSGi-bundle into a running Sling instance without requiring a project descriptor file. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <A href="#Sling-install">sling:install </A> </TD>
+<TD class="confluenceTd"> Install a OSGi-bundle into a running Sling instance <BR class="atl-forced-newline"> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <A href="#Sling-installfile">sling:install-file</A> </TD>
+<TD class="confluenceTd"> Install a OSGi-bundle into a running Sling instance without requiring a project descriptor file. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <A href="#Sling-uninstall">sling:uninstall</A> </TD>
+<TD class="confluenceTd"> Uninstall a OSGi-bundle from a running Sling instance <BR class="atl-forced-newline"> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <A href="#Sling-validate">sling:validate</A> </TD>
+<TD class="confluenceTd"> Validate JSON files in module (used for initial content loading) <BR class="atl-forced-newline"> </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+<H2><A name="Sling-Usage"></A>Usage</H2>
+
+<P>You should specify the version in your project's plugin configuration:</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-xml">
+<SPAN class="code-tag">&lt;project&gt;</SPAN>
+  ...
+  <SPAN class="code-tag">&lt;build&gt;</SPAN>
+    <SPAN class="code-tag"><SPAN class="code-comment">&lt;!-- To define the plugin version in your parent POM --&gt;</SPAN></SPAN>
+    <SPAN class="code-tag">&lt;pluginManagement&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-sling-plugin<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN>
+          <SPAN class="code-tag">&lt;version&gt;</SPAN>2.0.5-SNAPSHOT<SPAN class="code-tag">&lt;/version&gt;</SPAN>
+        <SPAN class="code-tag">&lt;/plugin&gt;</SPAN>
+        ...
+      <SPAN class="code-tag">&lt;/plugins&gt;</SPAN>
+    <SPAN class="code-tag">&lt;/pluginManagement&gt;</SPAN>
+    <SPAN class="code-tag"><SPAN class="code-comment">&lt;!-- To use the plugin goals in your POM or parent POM --&gt;</SPAN></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-sling-plugin<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN>
+        <SPAN class="code-tag">&lt;version&gt;</SPAN>2.0.5-SNAPSHOT<SPAN class="code-tag">&lt;/version&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>
+<P>For more information, see <A href="http://maven.apache.org/guides/mini/guide-configuring-plugins.html" class="external-link" rel="nofollow">&quot;Guide to Configuring Plug-ins&quot;</A></P>
+
+<P><A name="Sling-deploy"></A></P>
+
+<H2><A name="Sling-The%7B%7Bdeploy%7D%7Dgoal"></A>The <TT>deploy</TT> goal</H2>
+
+<P>The <TT>deploy</TT> goal uploads a bundle to a Sling OSGi Bundle Repository server implemented by the <EM>sling-obr</EM> bundle, which may be located on a remote system. The plugin places an HTTP <TT>POST</TT> request to the server sending the bundle file.&nbsp;</P>
+
+<H3><A name="Sling-Use"></A>Use</H3>
+
+<P>To use the <TT>deploy</TT> goal of the Maven Sling 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-sling-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>deploy-bundle<SPAN class="code-tag">&lt;/id&gt;</SPAN>
+            <SPAN class="code-tag">&lt;goals&gt;</SPAN>
+              <SPAN class="code-tag">&lt;goal&gt;</SPAN>deploy<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>
+
+<H3><A name="Sling-Configuration"></A>Configuration</H3>
+
+<P>The <TT>deploy</TT> goal 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"> System Property Overwrite </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>skip</TT> </TD>
+<TD class="confluenceTd"> <TT>false</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.deploy.skip</TT> </TD>
+<TD class="confluenceTd"> Whether to skip this step even though it has been configured in the project to be executed. The main use of this setting is preventing deployment of the bundle to a Sling OSGi Bundle Repository server if it is known that there is none or if such an upload is not required. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>buildDirectory</TT> </TD>
+<TD class="confluenceTd"> <TT>${project.build.directory</TT>} </TD>
+<TD class="confluenceTd"> &#45; </TD>
+<TD class="confluenceTd"> The path of the file to be installed </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>jarName</TT> </TD>
+<TD class="confluenceTd"> <TT>${project.build.finalName}.jar</TT> </TD>
+<TD class="confluenceTd"> &#45; </TD>
+<TD class="confluenceTd"> The name of the file to be installed </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>obr</TT> </TD>
+<TD class="confluenceTd"> &#45; </TD>
+<TD class="confluenceTd"> <TT>obr</TT> </TD>
+<TD class="confluenceTd"> The URL of the running Sling instance to which the bundle is installed. Note that this parameter is required and has no defualt value. It must always be specified in the configuration section or on the command line. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+<P><A name="Sling-deployfile"></A></P>
+
+<H2><A name="Sling-The%7B%7Bdeployfile%7D%7Dgoal"></A>The <TT>deploy-file</TT> goal</H2>
+
+<P>The <TT>deploy-file</TT> goal is equivalent to the <TT>deploy</TT> goal except, that the <TT>deploy-file</TT> does not require a project descriptor file while the <TT>deploy</TT> goal does. In other words the <TT>deploy-file</TT> goal may used to upload any bundle file available to a Sling OBR server instance.</P>
+
+<H3><A name="Sling-Use"></A>Use</H3>
+
+<P>The <TT>deploy-file</TT> goal may only be used from the command line by explicitly calling it as in:</P>
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ mvn org.apache.sling:maven-sling-plugin:deploy-file -Dsling.file=&lt;file&gt; -Dobr=&lt;url&gt;
+</PRE>
+</DIV></DIV>
+<P>Specifying the bundle file to upload with the <TT>sling.file</TT> property is required.</P>
+
+<H3><A name="Sling-Configuration"></A>Configuration</H3>
+
+<P>The <TT>deploy-file</TT> supports similar configuration parameters as the <TT>deploy</TT> goal with the exception of the <TT>skip</TT> parameter which makes no sense. In addition, all parameters must be specified on the command line by setting system properties. The <TT>bundleFileName</TT> parameter specified as the <TT>sling.file</TT> system property as well as the <TT>obr</TT> URL are required by the <TT>deploy-file</TT> goal.</P>
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Parameter </TH>
+<TH class="confluenceTh"> Default Value </TH>
+<TH class="confluenceTh"> System Property Overwrite </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>bundleFileName</TT> </TD>
+<TD class="confluenceTd"> <TT>${project.build.directory}/${project.build.finalName}.jar</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.file</TT> </TD>
+<TD class="confluenceTd"> The path and name of the file to be installed </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>obr</TT> </TD>
+<TD class="confluenceTd"> &#45; </TD>
+<TD class="confluenceTd"> <TT>obr</TT> </TD>
+<TD class="confluenceTd"> The URL of the running Sling instance to which the bundle is installed. Note that this parameter is required and has no defualt value. It must always be specified in the configuration section or on the command line. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+<P>Example: To deploy the bundle file <TT>someBundle.jar</TT> to the OBR running at <TT><A href="http://obr.sample.org/" class="external-link" rel="nofollow">http://obr.sample.org</A></TT> you might use the goal as follows:</P>
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ mvn org.apache.sling:maven-sling-plugin:deploy-file -Dsling.file=someBundle.jar -Dobr=http://obr.sample.org
+</PRE>
+</DIV></DIV>
+<P><A name="Sling-install"></A></P>
+
+<H2><A name="Sling-The%7B%7Binstall%7D%7Dgoal"></A>The <TT>install</TT> goal</H2>
+
+<P>The <TT>install</TT> goal uploads a bundle to a running sling instance, which may be located on a remote system. The plugin places an HTTP <TT>POST</TT> request to the sling instance sending the bundle file together with flags indicating whether to start the bundle and what start level to assign the bundle. It's also possible to HTTP <TT>PUT</TT> instead of <TT>POST</TT> for WebDAV.</P>
+
+<H3><A name="Sling-Use"></A>Use</H3>
+
+<P>To use the <TT>install</TT> goal of the Maven Sling 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-sling-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>install-bundle<SPAN class="code-tag">&lt;/id&gt;</SPAN>
+            <SPAN class="code-tag">&lt;goals&gt;</SPAN>
+              <SPAN class="code-tag">&lt;goal&gt;</SPAN>install<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>
+
+<H3><A name="Sling-Configuration"></A>Configuration</H3>
+
+<P>The <TT>install</TT> goal 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"> System Property Overwrite </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>skip</TT> </TD>
+<TD class="confluenceTd"> <TT>false</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.install.skip</TT> </TD>
+<TD class="confluenceTd"> Whether to skip this step even though it has been configured in the project to be executed. The main use of this setting is preventing installation of the bundle to a running Sling installation if it is known that there is none or if such an upload is not required, for example when building the bundle in an automated build system such as Confluence. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>bundleFileName</TT> </TD>
+<TD class="confluenceTd"> <TT>${project.build.directory}/${project.build.finalName}.jar</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.file</TT> </TD>
+<TD class="confluenceTd"> The path and name of the file to be installed </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>bundleStart</TT> </TD>
+<TD class="confluenceTd"> <TT>true</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.bundle.start</TT> </TD>
+<TD class="confluenceTd"> Whether to start the bundle after installing it. If the bundle is just updated, this parameter is ignored even if the bundle is currently stopped </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>bundleStartLevel</TT> </TD>
+<TD class="confluenceTd"> <TT>20</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.bundle.startlevel</TT> </TD>
+<TD class="confluenceTd"> The start level to set on the installed bundle. If the bundle is already installed and therefore is only updated this parameter is ignored. The parameter is also ignored if the running Sling instance has no StartLevel service (which is unusual actually) </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>slingUrl</TT> </TD>
+<TD class="confluenceTd"> <TT>http</TT><TT>://localhost:8080/sling</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.url</TT> </TD>
+<TD class="confluenceTd"> The URL of the running Sling instance to which the bundle is installed </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>user</TT> </TD>
+<TD class="confluenceTd"> <TT>admin</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.user</TT> </TD>
+<TD class="confluenceTd"> The name of the user to authenticate as with the running Sling instance given by the <TT>slingUrl</TT> parameter </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>password</TT> </TD>
+<TD class="confluenceTd"> <TT>admin</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.password</TT> </TD>
+<TD class="confluenceTd"> The password of the user to authenticate as with the running Sling instance given by the <TT>slingUrl</TT> parameter </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>mountByFS</TT> </TD>
+<TD class="confluenceTd"> <TT>false</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.mountByFS</TT> </TD>
+<TD class="confluenceTd"> To configure FS ResourceProvider for initial content files (useful for testing) <BR class="atl-forced-newline"> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>usePut</TT> </TD>
+<TD class="confluenceTd"> <TT>false</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.usePut</TT> </TD>
+<TD class="confluenceTd"> If a simple HTTP PUT should be used instead of the standard POST to the  felix console. In the uninstall goal, a HTTP DELETE will be  used. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>refreshPackages</TT> </TD>
+<TD class="confluenceTd"> <TT>true</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.refreshPackages</TT> </TD>
+<TD class="confluenceTd"> Whether to refresh the packages after installing the uploaded bundle. If this property is set to <TT>true</TT>, the <TT>PackageAdmin.refreshPackages(Bundle[])</TT> method is called after installing or updating the bundle. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+<P><A name="Sling-installfile"></A></P>
+
+<H2><A name="Sling-The%7B%7Binstallfile%7D%7Dgoal"></A>The <TT>install-file</TT> goal</H2>
+
+<P>The <TT>install-file</TT> goal is equivalent to the <TT>install</TT> goal except, that the <TT>install-file</TT> does not require a project descriptor file while the <TT>install</TT> goal does. In other words the <TT>install-file</TT> goal may used to upload any bundle file available to a running Sling instance.</P>
+
+<H3><A name="Sling-Use"></A>Use</H3>
+
+<P>The <TT>install-file</TT> goal may only be used from the command line by explicitly calling it as in:</P>
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ mvn org.apache.sling:maven-sling-plugin:install-file -Dsling.file=&lt;file&gt;
+</PRE>
+</DIV></DIV>
+<P>Specifying the bundle file to upload with the <TT>sling.file</TT> property is required.</P>
+
+<H3><A name="Sling-Configuration"></A>Configuration</H3>
+
+<P>The <TT>install-file</TT> supports the same configuration parameters as the <TT>install</TT> goal with the exception of the <TT>skip</TT> parameter which makes no sense. In addition, all parameters must be specified on the command line by setting system properties. The <TT>bundleFileName</TT> parameter specified as the <TT>sling.file</TT> system property is required by the <TT>install-file</TT> goal.</P>
+
+<P>For a description of the parameters see the configuration section of the <A href="#Sling-install"><TT>install</TT> goal</A> above.</P>
+
+<P>Example: To upload the bundle file <TT>someBundle.jar</TT> you might use the goal as follows:</P>
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ mvn org.apache.sling:maven-sling-plugin:install-file -Dsling.file=someBundle.jar
+</PRE>
+</DIV></DIV>
+<P><A name="Sling-uninstall"></A></P>
+
+<H2><A name="Sling-The%7B%7Buninstall%7D%7Dgoal"></A>The <TT>uninstall</TT> goal</H2>
+
+<P>The <TT>uninstall</TT> goal uninstalls a bundle from a running sling instance, which may be located on a remote system. The plugin uninstalles a bundle via a HTTP <TT>POST</TT>request. It's also possible to use HTTP <TT>DELETE</TT> instead of <TT>POST</TT> for WebDAV.</P>
+
+<H3><A name="Sling-Use"></A>Use</H3>
+
+<P>To use the <TT>uninstall</TT> goal of the Maven Sling 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-sling-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>uninstall-bundle<SPAN class="code-tag">&lt;/id&gt;</SPAN>
+            <SPAN class="code-tag">&lt;goals&gt;</SPAN>
+              <SPAN class="code-tag">&lt;goal&gt;</SPAN>uninstall<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>
+
+<H3><A name="Sling-Configuration"></A>Configuration</H3>
+
+<P>The <TT>uninstall</TT> goal 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"> System Property Overwrite </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>bundleFileName</TT> </TD>
+<TD class="confluenceTd"> <TT>${project.build.directory}/${project.build.finalName}.jar</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.file</TT> </TD>
+<TD class="confluenceTd"> The path and name of the file to be uninstalled </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>slingUrl</TT> </TD>
+<TD class="confluenceTd"> <TT>http</TT><TT>://localhost:8080/sling</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.url</TT> </TD>
+<TD class="confluenceTd"> The URL of the running Sling instance to which the bundle should be uninstalled </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>user</TT> </TD>
+<TD class="confluenceTd"> <TT>admin</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.user</TT> </TD>
+<TD class="confluenceTd"> The name of the user to authenticate as with the running Sling instance given by the <TT>slingUrl</TT> parameter </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>password</TT> </TD>
+<TD class="confluenceTd"> <TT>admin</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.password</TT> </TD>
+<TD class="confluenceTd"> The password of the user to authenticate as with the running Sling instance given by the <TT>slingUrl</TT> parameter </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>usePut</TT> </TD>
+<TD class="confluenceTd"> <TT>false</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.usePut</TT> </TD>
+<TD class="confluenceTd"> In the uninstall goal, a HTTP DELETE will be used. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+<P><A name="Sling-validate"></A></P>
+
+<H2><A name="Sling-The%7B%7Bvalidate%7D%7Dgoal"></A>The <TT>validate</TT> goal</H2>
+
+<P>The <TT>validate</TT> goal checks the JSON code of a bundle.</P>
+
+<H3><A name="Sling-Use"></A>Use</H3>
+
+<P>To use the <TT>validate</TT> goal of the Maven Sling 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-sling-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>validate-bundle<SPAN class="code-tag">&lt;/id&gt;</SPAN>
+            <SPAN class="code-tag">&lt;goals&gt;</SPAN>
+              <SPAN class="code-tag">&lt;goal&gt;</SPAN>validate<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>
+
+<H3><A name="Sling-Configuration"></A>Configuration</H3>
+
+<P>The <TT>validate</TT> goal 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"> System Property Overwrite </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>skip</TT> </TD>
+<TD class="confluenceTd"> <TT>false</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.validation.skip</TT> </TD>
+<TD class="confluenceTd"> Whether to skip the validation </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>skipJson</TT> </TD>
+<TD class="confluenceTd"> <TT>false</TT> </TD>
+<TD class="confluenceTd"> <TT>sling.validation.skipJson</TT> </TD>
+<TD class="confluenceTd"> Whether to skip the JSON validation. At the time, there's no difference between <TT>skip</TT> and <TT>skipJson</TT> because only JSON files will be validated by now. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by fmeschbe on 2009-06-30 00:09:14.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>
+

Added: websites/staging/sling/trunk/content/site/slingdoc.data/sling.sh
==============================================================================
--- websites/staging/sling/trunk/content/site/slingdoc.data/sling.sh (added)
+++ websites/staging/sling/trunk/content/site/slingdoc.data/sling.sh Wed Dec 12 09:16:44 2012
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Synchronizes the Confluence Export of the
+# Sling site to the site folder and fixes
+# the mirror link settings of the downloads.html
+# page which are incorrectly expanded to absolute
+# links by the confluence export 
+
+# Site folder
+SITE=/www/incubator.apache.org/sling/site
+
+# downloads page location
+DLPAGE=${SITE}/downloads.html
+
+# temporary copy of the downloads page
+DLTMP=/home/fmeschbe/d.html 
+
+# synchronized from Confluence export
+/usr/local/bin/rsync -rt /www/confluence-exports/SLINGxSITE/ ${SITE}
+
+# copy downloads page and replace with patched
+cp ${DLPAGE} ${DLTMP}
+cat ${DLTMP} | sed  's/http:\/\/cwiki.apache.org\/confluence\/display\/SLINGxSITE\/%5Bpreferred%5D/[preferred]/g' > ${DLPAGE}
+
+# copy apache-sling.html to index.html
+cp ${SITE}/apache-sling.html ${SITE}/index.html
+

Propchange: websites/staging/sling/trunk/content/site/slingdoc.data/sling.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: websites/staging/sling/trunk/content/site/slingdoc.html
==============================================================================
--- websites/staging/sling/trunk/content/site/slingdoc.html (added)
+++ websites/staging/sling/trunk/content/site/slingdoc.html Wed Dec 12 09:16:44 2012
@@ -0,0 +1,168 @@
+
+<!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 - SlingDoc</TITLE>
+    <LINK rel="stylesheet" href="http://incubator.apache.org/sling/site/media.data/site.css" type="text/css" media="all">
+    <LINK rel="icon" href="http://incubator.apache.org/sling/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://incubator.apache.org/sling/site/index.html">
+          <IMG border="0" alt="Apache Sling" src="http://incubator.apache.org/sling/site/media.data/logo.png">
+        </A>
+      </DIV>
+      <DIV class="header">
+        <A href="http://incubator.apache.org/">
+          <IMG border="0" alt="Apache Incubator" src="http://incubator.apache.org/images/apache-incubator-logo.png">
+        </A>
+      </DIV>
+    </DIV>
+    <DIV class="menu">
+                                    <UL>
+	<LI><A href="documentation.html" title="Documentation">Documentation</A>
+	<UL>
+		<LI><A href="getting-started.html" title="Getting Started">Getting Started</A></LI>
+		<LI><A href="the-sling-engine.html" title="The Sling Engine">The Sling Engine</A></LI>
+		<LI><A href="development.html" title="Development">Development</A></LI>
+		<LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=SLINGxSITE&title=Bundles&linkCreation=true&fromPageId=76152" title="Create Page: Bundles" class="createlink">Bundles<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+		<LI>Tutorials How-Tos</LI>
+		<LI><SPAN class="nobr"><A href="http://cwiki.apache.org/SLING/" title="Visit page outside Confluence" rel="nofollow">Wiki<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+		<LI><A href="configuration.html" title="Configuration">Configuration</A></LI>
+		<LI><SPAN class="nobr"><A href="http://incubator.apache.org/sling/apidocs/sling5/index.html" title="Visit page outside Confluence" rel="nofollow">Sling 5 API<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+		<LI><SPAN class="nobr"><A href="http://cwiki.apache.org/SLING/faq.html" title="Visit page outside Confluence" rel="nofollow">FAQ<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+	</UL>
+	</LI>
+	<LI><A href="advanced-topics.html" title="Advanced Topics">Advanced Topics</A></LI>
+	<LI><A href="development.html" title="Development">Development</A></LI>
+	<LI><SPAN class="nobr"><A href="http://incubator.apache.org/sling/site/downloads.cgi" title="Visit page outside Confluence" rel="nofollow">Downloads<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+	<LI><A href="contributing.html" title="Contributing">Contributing</A></LI>
+	<LI><A href="links.html" title="Links">Links</A></LI>
+	<LI><A href="project-information.html" title="Project Information">Project Information</A></LI>
+	<LI><SPAN class="nobr"><A href="http://www.apache.org/foundation/thanks.html" title="Visit page outside Confluence" rel="nofollow">Sponsors<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+	<LI><SPAN class="nobr"><A href="http://www.apache.org/foundation/sponsorship.html" title="Visit page outside Confluence" rel="nofollow">Sponsorship<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>
+
+&lt;br&gt;style=&quot;border-width:0; float: left&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot;
+width=&quot;135&quot; height=&quot;135&quot;&gt;
+
+</LI>
+</UL>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </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="SlingDoc">SlingDoc</A>
+        </DIV>
+<H1><A name="SlingDoc-DocumentingSling"></A>Documenting Sling</H1>
+
+<P>The basic documentation of Sling is made up of four parts:</P>
+
+<OL>
+	<LI>The Sling Site at <SPAN class="nobr"><A href="http://incubator.apache.org/sling" title="Visit page outside Confluence" rel="nofollow">http://incubator.apache.org/sling<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN> (you are here)</LI>
+	<LI>The Public Wiki at <SPAN class="nobr"><A href="http://cwiki.apache.org/SLING" title="Visit page outside Confluence" rel="nofollow">http://cwiki.apache.org/SLING<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+	<LI>The JavaDoc</LI>
+	<LI>The Bundle documentation</LI>
+</OL>
+
+
+<P>This page is about how this documentation is maintained and who is allowed to do what.</P>
+
+
+<H2><A name="SlingDoc-TheSlingSite"></A>The Sling Site</H2>
+
+<H3><A name="SlingDoc-MainSite"></A>Main Site</H3>
+
+<P>The main Sling Site is maintained in the Confluence Wiki Space <EM>SLINGxSITE</EM>. The contents of this space is automatically synchronized with the web server with a simple shell script <SPAN class="nobr"><A href="slingdoc.data/sling.sh" title="sling.sh attached to SlingDoc">sling.sh<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/link_attachment_7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN> which is called regularly as per the following <TT>crontab</TT> entry:</P>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"># sync wiki autoexport to Sling site
+1 * * * * (/home/fmeschbe/sling.sh)</PRE>
+</DIV></DIV>
+
+<P>Thus, after editing the site source in the Wiki, the rest happens automatically, it just takes some time &ndash; in the order 2 hours or so &ndash; before the changes are visible at <SPAN class="nobr"><A href="http://incubator.apache.org/sling" title="Visit page outside Confluence" rel="nofollow">http://incubator.apache.org/sling<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>.</P>
+
+<P>Everybody is allowed to read the SLINGxSITE wiki and to add comments; but only committers of the Apache Sling project are allowed to edit the content and to manage the comments.</P>
+
+<P>The main site is located in the <TT>site</TT> folder below the Site URL <SPAN class="nobr"><A href="http://incubator.apache.org/sling" title="Visit page outside Confluence" rel="nofollow">http://incubator.apache.org/sling<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN> to which users are redirected automatically.</P>
+
+<H3><A name="SlingDoc-SecondarySite"></A>Secondary Site</H3>
+
+<P>The Sling site contains secondary site parts which are maintained in the Apache SVN repository at <SPAN class="nobr"><A href="http://svn.apache.org/repos/asf/incubator/sling/site" title="Visit page outside Confluence" rel="nofollow">http://svn.apache.org/repos/asf/incubator/sling/site<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>. Updates to secondary parts of the site have to be done in the following steps:</P>
+
+<P>1. Checkout or update the <SPAN class="nobr"><A href="https://svn.apache.org/repos/asf/incubator/sling/site" title="Visit page outside Confluence" rel="nofollow">site<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN> tree form SVN</P>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">$ svn checkout https:<SPAN class="code-comment">//svn.apache.org/repos/asf/incubator/sling/site</SPAN></PRE>
+</DIV></DIV>
+
+<P>2. Apply your changes</P>
+
+<P>3. Commit the changes back into SVN</P>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">$ svn commit -m<SPAN class="code-quote">&quot;&lt;enter your message here&gt;&quot;</SPAN></PRE>
+</DIV></DIV>
+
+<P>4. Login to <TT>people.apache.org</TT></P>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">$ ssh people.apache.org</PRE>
+</DIV></DIV>
+
+<P>5. Goto the location from where infrastructure mirroring is getting the actual sites and update from SVN</P>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">$ cd /x1/www/incubator.apache.org/sling
+$ svn update</PRE>
+</DIV></DIV>
+
+<P>After some time, the updates will be synchronized to the web servers and can be accessed.</P>
+
+
+<H2><A name="SlingDoc-ThePublicWiki"></A>The Public Wiki</H2>
+
+<P>The public wiki of Sling is available at <SPAN class="nobr"><A href="http://cwiki.apache.org/SLING" title="Visit page outside Confluence" rel="nofollow">http://cwiki.apache.org/SLING<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN> and is maintained in the Confluence space <EM>SLING</EM>. This is a public wiki, in that after self-registration, everybody is allowed to edit content.</P>
+
+
+<H2><A name="SlingDoc-TheJavaDoc"></A>The JavaDoc</H2>
+
+<P>Up until now the JavaDoc of the Sling Bundles has not been published.</P>
+
+<P>I just polished the JavaDoc generation setup of Sling a bit, so that I could generate a first shot of aggregate JavaDocs. This draft can currently be found on my site at <SPAN class="nobr"><A href="http://people.apache.org/~fmeschbe/slingdocs.762729/" title="Visit page outside Confluence" rel="nofollow">http://people.apache.org/~fmeschbe/slingdocs.762729/<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>. This JavaDoc has been generated as follows:</P>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">$ svn export -r 762729 http:<SPAN class="code-comment">//svn.apache.org/repos/asf/incubator/sling/trunk sling
+</SPAN>$ mvn -DexcludePackageNames=<SPAN class="code-quote">&quot;*.impl:*.internal:*.jsp:sun.misc:*.juli&quot;</SPAN> org.apache.maven.plugins:maven-javadoc-plugin:2.5:aggregate</PRE>
+</DIV></DIV>
+
+<P>I am still unsure, whether it makes sense to generate aggregate JavaDoc for all (or part of) the bundles of Sling. See also below regarding the Sites.</P>
+
+
+<H2><A name="SlingDoc-TheBundleDocumentation"></A>The Bundle Documentation</H2>
+
+<P>Apart from the documentation of Sling on the Site and in the Wiki, it would also be thinkable, that we accompany the source modules with some documentation and generate this using the Maven Site plugin. My tests so far generating a multi-module site has not been very successfull. But generating the site in a module-by-module manner might be a good thing, at least to get the per-module JavaDoc and some more code-oriented information like Surefire Reports, fixed bugs, etc.</P>
+
+<P>To prepare such Bundle Documentation I added a first shot at site generation setup to the parent project. For now, this includes the module's JavaDoc (of course), the Surefire reports and a report on the issues fixed (or open) with respect to some version. This site generation setup can be configured per module with two properties:</P>
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Property </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>site.jira.version.id</TT> </TD>
+<TD class="confluenceTd"> The ID of the JIRA version whose bugs are to be listed in the JIRA report. This is a number, such as 12313306 (Sling API version 2.0.4). </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>site.javadoc.exclude</TT> </TD>
+<TD class="confluenceTd"> The Java packages to not include with the JavaDoc generation. By default all packages containing <TT>impl</TT> or <TT>internal</TT> in their name are excluded. To add more packages for exlucsion, list them in the format suitable for the <SPAN class="nobr"><A href="http://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html#excludePackageNames" title="Visit page outside Confluence" rel="nofollow"><TT>excludePackageNames</TT><SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN> property of the Maven JavaDoc plugin. For example, to exclude any <TT>jsp</TT> and <TT>juli</TT> packages (see the <EM>scripting/jsp</EM> bundle), this property would be set to <TT>&#42;.jsp:&#42;.juli</TT>. </TD>
+</TR>
+</TBODY></TABLE>
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by fmeschbe on 2009-04-29 05:11:12.0
+        </DIV>
+    </DIV>
+  </BODY>
+</HTML>
+

Added: websites/staging/sling/trunk/content/site/testing-sling-based-applications.html
==============================================================================
--- websites/staging/sling/trunk/content/site/testing-sling-based-applications.html (added)
+++ websites/staging/sling/trunk/content/site/testing-sling-based-applications.html Wed Dec 12 09:16:44 2012
@@ -0,0 +1,153 @@
+
+<!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 - Testing Sling-based applications</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="tutorials-how-tos.html" title="Tutorials & How-Tos">Tutorials &amp; How-Tos</A>&nbsp;&gt;&nbsp;<A href="" title="Testing Sling-based applications">Testing Sling-based applications</A>
+        </DIV>
+<H1><A name="TestingSling-basedapplications-TestingSlingbasedapplications"></A>Testing Sling-based applications</H1>
+
+<P>Automated testing of OSGi components and services can be challenging, as many of them depend on other services that must be present or simulated for testing.</P>
+
+<P>This page describes the various approaches that we use to test Sling itself, and introduces a number of tools that can help testing OSGi and HTTP-based applications.</P>
+
+<DIV>
+<UL>
+    <LI><A href="#TestingSling-basedapplications-TestingSlingbasedapplications">Testing Sling-based applications</A></LI>
+<UL>
+    <LI><A href="#TestingSling-basedapplications-Unittests">Unit tests</A></LI>
+    <LI><A href="#TestingSling-basedapplications-TeststhatuseaJCRrepository">Tests that use a JCR repository</A></LI>
+    <LI><A href="#TestingSling-basedapplications-Mockclassesandservices">Mock classes and services</A></LI>
+<UL>
+    <LI><A href="#TestingSling-basedapplications-Sidenote%253Ainjectingservicesinprivatefields">Side note: injecting services in private fields</A></LI>
+</UL>
+    <LI><A href="#TestingSling-basedapplications-PaxExam">Pax Exam</A></LI>
+    <LI><A href="#TestingSling-basedapplications-Slingtestingtools%253AserversideJUnittests">Sling testing tools: server-side JUnit tests</A></LI>
+    <LI><A href="#TestingSling-basedapplications-HTTPbasedintegrationtests">HTTP-based integration tests</A></LI>
+    <LI><A href="#TestingSling-basedapplications-Summary">Summary</A></LI>
+</UL>
+</UL></DIV>
+
+<H2><A name="TestingSling-basedapplications-Unittests"></A>Unit tests</H2>
+<P>When possible, unit tests are obviously the fastest executing ones, and it's easy to keep them close to the code that they're testing. </P>
+
+<P>We have quite a lot of those in Sling, the older use the JUnit3 TestCase base class, and later ones use JUnit4 annotations. Mixing both approaches is possible, there's no need to rewrite existing tests.</P>
+
+<H2><A name="TestingSling-basedapplications-TeststhatuseaJCRrepository"></A>Tests that use a JCR repository</H2>
+<P>Utility classes from our <A href="https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/testing" class="external-link" rel="nofollow">commons/testing</A> module make it easy to get a real JCR repository for testing. That's a bit slower than pure unit tests, of course, but this only adds 1-2 seconds to the execution of a test suite.</P>
+
+<P>The <TT>RepositoryProviderTest</TT> in that module uses this technique to get a JCR repository.</P>
+
+<P>Note that our utilities do not cleanup the repository between tests, so you must be careful about test isolation, for example by using unique paths for each test.</P>
+
+<H2><A name="TestingSling-basedapplications-Mockclassesandservices"></A>Mock classes and services</H2>
+<P>The next step is to use mock classes and services to simulate components that are needed for testing. This makes it possible to test OSGi service classes without an OSGi framework.</P>
+
+<P>We have a number of custom-written mock services in Sling, like <A href="https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/MockNodeType.java" class="external-link" rel="nofollow">MockNodeType</A> for example. These handwritten mocks implement just what's needed for their tests, so they might not be reusable as is.</P>
+
+<P>In other cases we use <A href="http://www.jmock.org/" class="external-link" rel="nofollow">jmock</A> to help create mock objects without having to write much code - such mocking libraries take care of the plumbing and allow you to write just the bits of code that matter (often with funny syntaxes). The tests of the <A href="https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/event/" class="external-link" rel="nofollow">org.apache.sling.event</A> bundle, for example, make extensive use of such mock services.</P>
+
+<P>The problem with mocks is that it can become hard to make sure you're actually testing something, and not just &quot;mocking mocks&quot;. At a certain level of complexity, it becomes quicker and clearer to actually start an OSGi framework for automated tests.</P>
+
+<H3><A name="TestingSling-basedapplications-Sidenote%3Ainjectingservicesinprivatefields"></A>Side note: injecting services in private fields</H3>
+<P>To inject (real or fake) services in others for testing, without having to create getters and setters just for this, we use a reflection-based trick, as in this example:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;"><B>setting a private field via reflection</B></DIV><DIV class="codeContent panelContent">
+<PRE class="code-java">
+<SPAN class="code-comment">// set resource resolver factory
+</SPAN><SPAN class="code-comment">// in a ServletResolver object which has a <SPAN class="code-keyword">private</SPAN> resourceResolverFactory field
+</SPAN>
+ServletResolver servletResolver = ....
+<SPAN class="code-object">Class</SPAN>&lt;?&gt; resolverClass = servletResolver.getClass().getSuperclass();
+<SPAN class="code-keyword">final</SPAN> java.lang.reflect.Field resolverField = resolverClass.getDeclaredField(<SPAN class="code-quote">&quot;resourceResolverFactory&quot;</SPAN>);
+resolverField.setAccessible(<SPAN class="code-keyword">true</SPAN>);
+resolverField.set(servletResolver, factory);
+</PRE>
+</DIV></DIV>
+
+<H2><A name="TestingSling-basedapplications-PaxExam"></A>Pax Exam</H2>
+<P><A href="http://team.ops4j.org/wiki/display/paxexam/Pax%20Exam" class="external-link" rel="nofollow">Pax Exam</A> allows you to easily start an OSGi framework during execution of a JUnit test suite.</P>
+
+<P>We currently use it for our <A href="https://svn.apache.org/repos/asf/sling/trunk/installer/it" class="external-link" rel="nofollow">Sling installer integration tests</A> for example. As parts of the installer interact directly with the OSGi framework, it felt safer to test it in a realistic situation rather than mock everything.</P>
+
+<P>Such tests are obviously slower than plain unit tests and tests that use mocks. Our installer integration tests, using Pax Exam, take about a minute to execute on a 2010 macbook pro.</P>
+
+<H2><A name="TestingSling-basedapplications-Slingtestingtools%3AserversideJUnittests"></A>Sling testing tools: server-side JUnit tests</H2>
+<P>The <A href="sling-testing-tools.html" title="Sling Testing Tools">Sling testing tools</A> include a module that executes JUnit tests server-side, in a Sling instance. This allows integration tests to run in a realistic environment, and could also be used for self-testing production systems.</P>
+
+<P>As I write this, we are not using those tools to test Sling itself, but we have a <A href="https://svn.apache.org/repos/asf/sling/trunk/testing/samples/integration-tests" class="external-link" rel="nofollow">complete example</A> of integration tests that use them to run server-side JUnit tests, including automatic setup of the test Sling instance.</P>
+
+<H2><A name="TestingSling-basedapplications-HTTPbasedintegrationtests"></A>HTTP-based integration tests</H2>
+<P>The highest level of integration is testing a complete Sling instance via its HTTP interface.</P>
+
+<P>We use this technique to test Sling itself: the <A href="https://svn.apache.org/repos/asf/sling/trunk/launchpad/integration-tests" class="external-link" rel="nofollow">launchpad/integration-tests</A> module defines the tests (462 of them as I write this), and the <A href="https://svn.apache.org/repos/asf/sling/trunk/launchpad/testing" class="external-link" rel="nofollow">launchpad/testing</A> module executes them, after setting up a Sling instance from scratch (which is quite easy as Sling is just a runnable jar). </P>
+
+<P>A simple mechanism (described in README files in these modules) allows individual tests to be executed quickly against a previously started Sling instance, to be able to write and debug tests efficiently.</P>
+
+<P>The test code could be made simpler using the fluent HTTP interfaces defined in the Sling testing tools described above, but the launchpad tests were written before that module was created, and as they're stable there's no reason to rewrite them. If you're planning on using this technique for your own applications, we recommend looking at the Sling testing tools instead of these &quot;legacy&quot; tests - but the basic technique is the same.</P>
+
+<P>One problem with these launchpad tests is that the tests of all Sling modules are defined in a single testing module, they are not co-located with the code that they test. This could be improved by providing the tests in bundles that can be created from the same Maven modules that the code that they test.</P>
+
+<H2><A name="TestingSling-basedapplications-Summary"></A>Summary</H2>
+<P>Combining the above testing techniques has worked well for us in creating and testing Sling. Being able to test things at different levels of integration has proved an efficient way to get good test coverage without having to write too much boring test code.</P>
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by bdelacretaz on Tue May 08 16:05:45 EDT 2012
+        </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>
+

Added: websites/staging/sling/trunk/content/site/the-sling-engine.html
==============================================================================
--- websites/staging/sling/trunk/content/site/the-sling-engine.html (added)
+++ websites/staging/sling/trunk/content/site/the-sling-engine.html Wed Dec 12 09:16:44 2012
@@ -0,0 +1,106 @@
+
+<!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 - The Sling Engine</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="" 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="" title="The Sling Engine">The Sling Engine</A>
+        </DIV>
+<H1><A name="TheSlingEngine-TheSlingEngine"></A>The Sling Engine</H1>
+
+<H2><A name="TheSlingEngine-General"></A>General</H2>
+<UL>
+	<LI><A href="architecture.html" title="Architecture">Architecture</A></LI>
+	<LI><A href="authentication.html" title="Authentication">Authentication</A></LI>
+</UL>
+
+
+<H2><A name="TheSlingEngine-RequestHandling"></A>Request Handling</H2>
+
+<UL>
+	<LI><A href="dispatching-requests.html" title="Dispatching Requests">Dispatching Requests</A></LI>
+	<LI><A href="url-decomposition.html" title="URL decomposition">URL decomposition</A></LI>
+	<LI><A href="request-listeners.html" title="Request Listeners">Request Listeners</A></LI>
+	<LI><A href="filters.html" title="Filters">Filters</A></LI>
+	<LI><A href="servlets.html" title="Servlets">Servlets and Scripts</A></LI>
+	<LI><A href="errorhandling.html" title="Errorhandling">Errorhandling</A></LI>
+	<LI><A href="request-parameters.html" title="Request Parameters">Request Parameters</A></LI>
+</UL>
+
+
+<H2><A name="TheSlingEngine-Resources"></A>Resources</H2>
+
+<UL>
+	<LI><A href="resources.html" title="Resources">Resources</A></LI>
+	<LI><A href="wrap-or-decorate-resources.html" title="Wrap or Decorate Resources">Wrap or Decorate Resources</A></LI>
+	<LI><A href="mappings-for-resource-resolution.html" title="Mappings for Resource Resolution">Mappings for Resource Resolution</A></LI>
+</UL>
+
+
+<H2><A name="TheSlingEngine-Misc"></A>Misc</H2>
+
+<UL>
+	<LI><A href="adapters.html" title="Adapters">Adapters</A></LI>
+	<LI><A href="eventing-and-jobs.html" title="Eventing and Jobs">Eventing and Jobs</A></LI>
+</UL>
+
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by fmeschbe on 2011-02-06 08:05:15.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>
+