sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r813971 [11/11] - /websites/staging/sling/trunk/content/
Date Sun, 22 Apr 2012 17:20:13 GMT
Modified: websites/staging/sling/trunk/content/the-sling-launchpad.html
--- websites/staging/sling/trunk/content/the-sling-launchpad.html (original)
+++ websites/staging/sling/trunk/content/the-sling-launchpad.html Sun Apr 22 17:20:11 2012
@@ -82,7 +82,267 @@
 <a href="/">Home</a>
    <!--   <h1 class="title">The Sling Launchpad</h1> -->
+<!-- -->
+<p><a name="TheSlingLaunchpad-TheSlingLaunchpad"></a></p>
+<h1 id="the-sling-launchpad">The Sling Launchpad</h1>
+<p>This tries to explain how exactly the Sling Launchpad works, what
+constitutes the Sling Launchpad and how you can use the Sling Launchpad to
+custom create you Sling launchers. For a view behind the scenes of the
+Sling Launchpad Base module (the actual launcher) you might want to refer
+to the <a href="embedding-sling.html">Embedding Sling</a>
+ page.</p>
+<p><a name="TheSlingLaunchpad-SlingHome"></a></p>
+<h2 id="sling-home">Sling Home</h2>
+<p>Since Sling requires some space on the filesystem to store various files
+Sling has to know where this filesystem space is located.</p>
+<p>The following is a list of uses for the Sling Home directory:</p>
+<li><em></em> -- The main configuration file used by Sling to
+launch the framework. It mainly contains OSGi framework configuration and
+initial configuration for some bundles. This file is read on each startup
+of <em>Launcher JAR</em>. That is, changes to this file require a restart of the
+<em>Launcher JAR</em>.</li>
+<li><em></em> --  This is the <em>Launcher JAR</em>
+file used by the Standalone Application or the Web Application to start the
+OSGi Framework. This file is initially placed when first starting Sling and
+may later be updated by updating the system bundle with a new <em>Launcher
+<li><em>felix</em> -- The directory into which the Apache Felix Framework places
+the bundles, which have been installed into the system. This does generally
+not need to be touched.</li>
+<li><em>config</em> -- The directory into which the Apache Felix Configuration
+Admin Service stores the configurationes. Do not change any files in this
+directory, since changes will not generally be picked up.</li>
+<li><em>jackrabbit</em> -- The directory in which the Apache Jackrabbit JCR
+repository is started. Amongst other things this also contains the
+Jackrabbit configuration file <em>repository.xml</em>. You may modify this file,
+but don't forget to restart the Embedded Jackrabbit Repository bundle after
+doing this.</li>
+<li><em>logs</em> -- Contains the log files generated by Sling. By default this
+contains the error.log and its rotated generations.</li>
+<p><a name="TheSlingLaunchpad-CommandLineOptions"></a></p>
+<h2 id="command-line-options">Command Line Options</h2>
+<p>The Java Standalone Application supports a number of command line options,
+which influence the operation of the launch process.</p>
+<tr><th> Option </th><th> Argument </th><th> Description </th></tr>
+<tr><td> *start* </td><td> -- </td><td> Open a TCP/IP server socket when starting Sling. Uses
+option *-j* to define the local socket address. </td></tr>
+<tr><td> *status* </td><td> -- </td><td> Check whether a (remote) Sling application is running.
+Uses option *-j* to define the address of the Sling instance to check.
+Note, that the Sling application terminates after checking for the (remote)
+Sling status. </td></tr>
+<tr><td> *stop* </td><td> -- </td><td> Stop a (remote) Sling application is running. Uses option
+*-j* to define the address of the Sling instance to stop. Note, that the
+Sling application terminates after stopping the (remote) Sling instance. </td></tr>
+<tr><td> *-c* </td><td> slinghome </td><td> The directory in which Sling locates its initial
+configuration file ** and where files of Sling itself
+such as the Apache Felix bundle archive or the JCR repository files are
+stored. This defaults to the *sling* folder in the current working
+directory. This is the value which is commonly refered to as
+<tr><td> *-l* </td><td> loglevel </td><td> Sets the initial loglevel as an integer in the range
+0 to 4 or as one of the well known level strings *ERROR*, *WARN*,
+*INFO*, or *DEBUG*. This option overwrites the
+** setting the ** file.
+The default is *INFO*. </td></tr>
+<tr><td> *-f* </td><td> logfile </td><td>  The log file to use or *-* to log to standard out.
+This option overwrites the ** setting the
+** file. The default is
+*$\{sling.home}/logs/error.log*. </td></tr>
+<tr><td> *-a* </td><td> address </td><td> The interfact to bind to (use for any). This
+option is not implemented yet. </td></tr>
+<tr><td> *-p* </td><td> port </td><td>  The port to listen (default 8080) to handle HTTP
+requests. This option overwrites the *org.osgi.service.http.port* setting
+the ** file. </td></tr>
+<tr><td> *-j* </td><td> [ host ":" ](-host-":"-.html)
+ port </td><td>  The socket address to listen on for control connections (*start*
+or to use as the remote endpoint for the control connection (*status* and
+*stop*. If this parameter has no arguments or is not specified, the
+address defaults to port 63000 on localhost/ If only the port is
+specified localhost/ is used as the host part of the address. </td></tr>
+<tr><td> *-h* </td><td> -- </td><td> Prints a simple usage message listing all available command
+line options. </td></tr>
+<p>The Sling Standalone application looks for a definition of the
+<em>sling.home</em> setting in the following locations in order of precendence:</p>
+<li>The <em>-c</em> command line option</li>
+<li>The <em>sling.home</em> system property</li>
+<li>The <em>SLING_HOME</em> environment variable</li>
+<li>If none of the above resolves to a non-null value, the default value of
+<em>sling</em> is assumed</li>
+<p><a name="TheSlingLaunchpad-SecurityImplication"></a></p>
+<h3 id="security-implication">Security Implication</h3>
+<p>Note that using a control connection for the Sling Standalone Application
+presents a potential security issue. For this reason the following defaults
+<li>The server side socket for a running Sling Standalone Application is only
+created if the application is started with the <em>start</em> command line
+option. If this option is omitted -- the default -- the server side socket
+is not created and the Sling Standalone Application instance cannot be
+remotely controlled.</li>
+<li>The default host name for the socket is localhost/ meaning that
+the socket is only accessible from the same system as the Sling Standalone
+Application is running on. If the socket is accessible from remote systems
+additional must be taken to prevent malicious attackers to stop the system.
+The server side control connection implementation implements no security
+precaution (except from supporting to not create such a connection at all).</li>
+<p><a name="TheSlingLaunchpad-ServletParameters"></a></p>
+<h2 id="servlet-parameters">Servlet Parameters</h2>
+<p>The Web Application does not require specific servlet parameters. Those
+which are specified are used to overwrite any properties with the same name
+from the <em></em> file. One exception to this rule is the
+<em>sling.home</em> parameter, which is used to set the value of the
+<em>sling.home</em> property. If no parameter with this name is defined the
+Sling home directory is derived from the context path at which the Sling
+Web Application is registered.</p>
+<p>The <em>sling.home</em> folders for Sling Web Applications without the
+<em>sling.home</em> servlet parameter are all located in the <em>sling</em> folder in
+the current working directory as reported by the <em>user.dir</em> system
+property. The name of the actual directory is derived from the Web
+Application Context Path by replacing all slash characters <em>/</em> by
+underscore characters <em>_</em>. For the root context a single underscore
+character <em>_</em> is used.</p>
+<tr><th> Servlet Context </th><th> Default *sling.home* </th></tr>
+<tr><td> _root_ </td><td> *sling/\_* </td></tr>
+<tr><td> */sling* </td><td> *sling/\_sling* </td></tr>
+<tr><td> */sling/instance1* </td><td> *sling/\_sling\_instance1* </td></tr>
+<p>Starting with Launchpad Base 2.2.2 the fixed prefix <em>sling</em> is
+configurable with the <em>sling.home.prefix</em> system property. If this
+property is set the value used as the prefix.</p>
+<p>Examples: Assume the <em>sling.home.prefix</em> system property is set to
+<tr><th> Servlet Context </th><th> Default *sling.home* </th></tr>
+<tr><td> _root_ </td><td> */var/sling/\_* </td></tr>
+<tr><td> */sling* </td><td> */var/sling/\_sling* </td></tr>
+<tr><td> */sling/instance1* </td><td> */var/sling/\_sling\_instance1* </td></tr>
+<p><a name=""></a></p>
+<h2 id="slingproperties"></h2>
+<p>The <em></em> file contains the initial setup of the Sling
+Application and the OSGi framework. Some of the parameters are required and
+should not be modified without a very good reason. Some parameters may be
+freely modified to your needs. Please see the inlined comment in the
+<em></em> file installed when Sling is first started.</p>
+<p>One thing to note is, that the <em></em> file is a simple Java
+Properties file with support for property references. That is, the value of
+properties may refer other property values by means of the well known
+<em>${name</em>} notation. Such property references may even be cascaded as in</p>
+<div class="codehilite"><pre>java.packages=<span class="cp">${</span><span class="n">jre</span><span class="o">-</span><span class="err">$</span><span class="p">{</span><span class="n">java</span><span class="o">.</span><span class="n">specification</span><span class="o">.</span><span class="n">version</span><span class="cp">}</span>}
+<p><a name="TheSlingLaunchpad-Components"></a></p>
+<h2 id="components">Components</h2>
+<p>The Sling Launchapd consists of <em>Launchbad Base</em> project and three
+additional projects which ultimately create a Standalone Java Application
+and a Web Appliction with standard parts of Sling.</p>
+<p><a name="TheSlingLaunchpad-LaunchpadBase"></a></p>
+<h3 id="launchpad-base">Launchpad Base</h3>
+<p>The <em>Launchpad Base</em> projects creates the following artifacts, which are
+required in actual setups to get a Sling application:</p>
+<p><em>Launcher JAR</em> -- The primary artifact of the Base project contains the
+actual support to launch the Apache Felix OSGi Framework and install
+bundles, which are packaged with the application. It also contains the
+Apache Felix Framework together with the OSGi R4.1 Core and Compendium
+libraries as well as the Equinox HttpService bridge and the Servlet API.</p>
+<p><em>App JAR</em> -- The secondary artifact with classifier <em>app</em> is a minimal
+Standalone Java Application which may be started by simply typing</p>
+<p>$ java -jar</p>
+<p><em>Web App Archive</em> -- The secondary artifact with classifier <em>webapp</em> is a
+minimal Web Application, which may simply be deployed into your favirourite
+servlet container, provided it supports at least Servlet API 2.4.</p>
+<p><em>Source JAR</em> -- The secondary artifact with the classifier <em>sources</em> is
+simple the source of the <em>Launchpad Base</em> project.</p>
+<p>To build a very basic Sling launcher, the <em>Launchpad Base</em> is actually all
+you need. But to really glue this together and get a usable system, some
+more work is required. Lets see how the additionaly projects <em>Launchpad
+Bundles</em>, <em>Launchpad App</em>, and <em>Launchpad WebApp</em> get to that.</p>
+<p><a name="TheSlingLaunchpad-LaunchpadBundles"></a></p>
+<h3 id="launchpad-bundles">Launchpad Bundles</h3>
+<p>The second project we want to look at is the <em>Launchpad Bundles</em> project.
+This is a very simple project in that it only collects together a number of
+OSGi bundles, which will make up the final application. The bundles are
+stored in a (big) Java Archive in folders whose path is formed with
+<em>resources/9</em> where <em>9</em> is a start level which is assigned to the
+bundles as they are installed. The special start level <em>0</em> instructs the
+installer to not actually assign a specific start level to the bundles
+contained in that folder.</p>
+<p>Currently the following start level assignement is used by the <em>Launchpad
+Bundles</em> project:</p>
+<tr><th> Start Level </th><th> Bundle Group </th><th> Bundle(s) </th></tr>
+<tr><td> 1 </td><td> Basic bundles required for the correct operation of Sling </td><td>
+<tr><td> 5 </td><td> Apache Felix Web Console </td><td> org.apache.felix.bundlerepository,
+org.apache.felix.webconsole, </td></tr>
+<tr><td> 10 </td><td> OSGi Compendium Service Implementations </td><td>
+org.apache.felix.configadmin, org.apache.felix.eventadmin,
+org.apache.felix.metatype, org.apache.felix.scr </td></tr>
+<tr><td> 15 </td><td> JCR Repository (Jackrabbit) </td><td> commons-collections,
+commons-lang, jackrabbit-api, jackrabbit-jcr-commons,,,,,, |
+<tr><td> 0 </td><td> Actual Sling Application bundles </td><td>,,,,,,,,,,,,,,,,,,,,, </td></tr>
+<p><a name="TheSlingLaunchpad-LaunchpadAppandLaunchpadWebApp"></a></p>
+<h3 id="launchpad-app-and-launchpad-webapp">Launchpad App and Launchpad WebApp</h3>
+<p>The <em>Launchpad App</em> and <em>Launchpad WebApp</em> bundles are actually projects
+which just glue together artifacts from the Launchpad projects. There is
+nothing special about them. Here's what is done:</p>
+<li>Take the appropriate secondary artifact from the <em>Launchpad Base</em>
+project: <em>app</em> for the Standalone Java Application or <em>webapp</em> for the Web
+Application and unpack</li>
+<li>Take the <em>Launchpad Base</em> primary artifact and place it under the name
+<em></em> into the <em>resources</em> folder</li>
+<li>Take the <em>Launchpad Bundles</em> artifact and unpack it</li>
+<li>Finally pack all together into a single big JAR or WAR file</li>
+<p>That's it. The resulting artifact may be directly used to launch the
+Standalone Java Application or may directly be deployed into any Servlet
+API 2.4 (or later) compliant servlet container.</p>
         <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.

Modified: websites/staging/sling/trunk/content/url-decomposition.html
--- websites/staging/sling/trunk/content/url-decomposition.html (original)
+++ websites/staging/sling/trunk/content/url-decomposition.html Sun Apr 22 17:20:11 2012
@@ -82,7 +82,56 @@
 <a href="/">Home</a>
    <!--   <h1 class="title">URL decomposition</h1> -->
+<!-- -->
+<p><a name="URLdecomposition-URLdecomposition"></a></p>
+<h1 id="url-decomposition">URL decomposition</h1>
+<p>During the <em>Resource Resolution</em> step, the client request URL is decomposed
+into the following parts:</p>
+<li><em>Resource Path</em> -  The longest substring of the request URL such that the
+resource path is either the complete request URL or the next character in
+the request URL after the resource path is a dot (<em>.</em>).</li>
+<li><em>Selectors</em> -  If the first character in the request URL after the
+resource path is a dot, the string after the dot up to but not including
+the last dot before the next slash character or the end of the request URL.
+If the resource path spans the complete request URL no seletors exist. If
+only one dot follows the resource path before the end of the request URL or
+the next slash, also no selectors exist.</li>
+<li><em>Extension</em> -  The string after the last dot after the resource path in
+the request URL but before the end of the request URL or the next slash
+after the resource path in the request URL. </li>
+<li><em>Suffix Path</em> -  If the request URL contains a slash character after the
+resource path and optional selectors and extension, the path starting with
+the slash up to the end of the request URL is the suffix path. Otherwise,
+the suffix path is empty. Note, that after the resource path at least a dot
+must be in the URL to let Sling detect the resource path.</li>
+<p>There's a cheat sheet on Day's dev page under <a href=""></a>
+ available to get you familiar with the URL decomposition of Sling.</p>
+<p><em>Examples</em>: Assume there is a Resource at <em>/a/b</em>, which has no children.</p>
+<tr><th> URI </th><th> Resource Path </th><th> Selectors </th><th> Extension </th><th> Suffix </th><th> Resource
+Found </th></tr>
+<tr><td> /a/b               </td><td> /a/b </td><td> null  </td><td> null </td><td> null       </td><td> yes </td></tr>
+<tr><td> /a/b.html          </td><td> /a/b </td><td> null  </td><td> html </td><td> null       </td><td> yes </td></tr>
+<tr><td> /a/b.s1.html           </td><td> /a/b </td><td> s1    </td><td> html </td><td> null       </td><td> yes </td></tr>
+<tr><td> /a/b.s1.s2.html        </td><td> /a/b </td><td> s1.s2 </td><td> html </td><td> null       </td><td> yes </td></tr>
+<tr><td> /a/b/c/d           </td><td> /a/b/c/d </td><td> null  </td><td> null </td><td> null       </td><td> no! </td></tr>
+<tr><td> /a/b./c/d           </td><td> /a/b </td><td> null  </td><td> null </td><td> /c/d   </td><td> yes </td></tr>
+<tr><td> /a/b.html/c/d      </td><td> /a/b </td><td> null  </td><td> html </td><td> /c/d       </td><td> yes </td></tr>
+<tr><td> /a/b.s1.html/c/d       </td><td> /a/b </td><td> s1    </td><td> html </td><td> /c/d       </td><td> yes </td></tr>
+<tr><td> /a/b.s1.s2.html/c/d        </td><td> /a/b </td><td> s1.s2 </td><td> html </td><td> /c/d       </td><td> yes </td></tr>
+<tr><td> /a/b/c/d.s.txt     </td><td> /a/b/c/d </td><td> s  </td><td> txt </td><td> null </td><td> no! </td></tr>
+<tr><td> /a/b.html/c/d.s.txt        </td><td> /a/b </td><td> null  </td><td> html </td><td> /c/d.s.txt </td><td> yes </td></tr>
+<tr><td> /a/b.s1.html/c/d.s.txt    </td><td> /a/b </td><td> s1    </td><td> html </td><td> /c/d.s.txt </td><td> yes </td></tr>
+<tr><td> /a/b.s1.s2.html/c/d.s.txt </td><td> /a/b </td><td> s1.s2 </td><td> html </td><td> /c/d.s.txt </td><td> yes </td></tr>
+<p>{info:title=Automated tests and examples}
+The <a href="">SlingRequestPathInfoTest</a>
+ demonstrates and tests this decomposition. Feel free to suggest additional
+tests that help clarify how this works!
         <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.

Modified: websites/staging/sling/trunk/content/version-policy.html
--- websites/staging/sling/trunk/content/version-policy.html (original)
+++ websites/staging/sling/trunk/content/version-policy.html Sun Apr 22 17:20:11 2012
@@ -82,7 +82,290 @@
 <a href="/">Home</a>
    <!--   <h1 class="title">Version Policy</h1> -->
+<!-- -->
+<p><a name="VersionPolicy-DRAFTVersionPolicy"></a></p>
+<h1 id="draft-version-policy">DRAFT Version Policy</h1>
+<p>{excerpt}This page is about how we assign versions to exported packages and
+bundles and defines when to increase which part of the version
+Please note that this page is currently in draft stage and still being
+<p><a name="VersionPolicy-Introduction"></a></p>
+<h2 id="introduction">Introduction</h2>
+<p>In comments to SLING-1176 Ian Boston wrote:</p>
+The exports in bundle/api/pom.xml look like they might become problematic from a support point of view, although we probably can't avoid this. [...](....html)
+ [The problem is the] manual maintenance of the version numbers. (not a
+big problem but needs to be done)
+<p>I agree, that this is a problem. So let me reasonate on this a bit ;-)</p>
+<p>As a reference you might want to read <a href="">my blog post on version numbers</a>
+ and also what the [Eclipse guys have to say|]
+ (great read, btw). The OSGi Alliance has come up with a good definition
+for [Semantic Versioning|]
+ to which the definitions described below perfectly match.</p>
+<p>For Sling we have three kinds of version numbers:</p>
+<li>Big Sling Releases</li>
+<li>Sling Bundles</li>
+<li>Package Exports</li>
+<p><em>Big Sling Releases</em></p>
+<p>For <em>Big Sling releases</em> we already have an ample solution in that we just
+use a single number increased from release to release. Just remember that a
+<em>Big Sling release</em> is a convenience release of existing released Sling
+<p><em>Sling Bundles</em></p>
+<p>For <em>Sling Bundles</em> version numbers are just defined as the <em><version></em>
+element of the bundle's POM. The only restriction here is, that we decided
+to use even numbers for releases and odd numbers for SNAPSHOTs. Whether and
+when which version part is increased is not explicitly defined yet.</p>
+<p><em>Package Exports</em></p>
+<p>For <em>Package Exports</em> the situation is more problematic since there are a
+number of places to set exported package version number:</p>
+<li>In a <em>packageinfo</em> file inside the package (picked up by the Maven
+Bundle Plugin to set the export version)</li>
+<li>Explicitly in the <em><Export-Package></em> element of the Maven Bundle
+Plugin configuration</li>
+<li>By reference to the bundle version number using the <em>${pom.version</em>}
+<p>Upto now, we mostly used the <em>${pom.version</em> notation linking the
+exported package version to the bundle version. Over time this mechanism
+leads to a number of problems:</p>
+<li>For bundles with more than one package exported, the exported packages
+will evolve independently. As a consequence their versionin should also
+evolve independently. An example of such a bundle is the Sling API bundle
+of course.</li>
+<li>Linking the package export version number to the bundle version number
+confuses the actual semantics of both version numbers. The package export
+version number only indicates the version of the actual package while the
+bundle version number indicates a development state of the overall bundle.
+This will generally not be the same.</li>
+<li>The version of the exported package is increased on each bundle
+release, even though nothing may have changed on the export. In such a
+situation the version of the export should stay the same.</li>
+<p>That said, the reuse of the bundle version as the package export version
+still is probably the correct thing to do for legacy library wrappers.</p>
+<p>Consider for example the Sling API bundle, which exports 9 packages. Each
+of which may evolve independently. Now the <em>resource</em> package is extended
+causing a minor version increase. Should the version numbers of the other
+exports also be increased ? Thus acting as if there was some API change ?</p>
+<p>I would say, no. Particularly if some API implementation bundle is
+restricting the import version of the API implemented. Such an
+implementation would immediately stop working because the version has been
+increased. But since there has been no change, the implementation would
+still be correct.</p>
+<p>So, I think, we should evolve the exported package versions independently
+from each other and even independently from the bundle version.</p>
+<p>This places more burden on the developer when deciding on the exported
+package version - in fact this requires such a decision as compared to have
+Maven take the decision by just setting the bundle version.</p>
+<p>The only problem is: Where shall this be noted ? In the POM or in the
+<em>packageinfo</em> file ? If we would place the <em>packageinfo</em> file just
+beneath the class source files, I would say, in the <em>packageinfo</em> file.</p>
+<p>But this would require defining the class source locations as resource
+location in the POM (at least for <em>packageinfo</em>) files.</p>
+<p>I am not sure ....</p>
+<p>This has not been discussed at large, but I would assume, that the POM is
+still the correct place to take note of the version of the exported
+<p>The newest versions of the BND library also support an <em>@Export</em>
+annotation in the <em></em> pseudo class file. This pseudo
+class is supported starting with Java 5 to take package level annotations
+(like the <em>@Export</em> annotation) and as a replacement of the
+<em>package-info.html</em> file.</p>
+<p>Using this syntax something like the following would be easily possible:</p>
+<div class="codehilite"><pre><span class="o">/**</span>
+ <span class="o">*</span> <span class="n">This</span> <span class="n">is</span> <span class="n">the</span> <span class="n">Package</span> <span class="n">Level</span> <span class="n">JavaDoc</span>
+ <span class="o">*/</span>
+<span class="nv">@Export</span><span class="p">(</span><span class="n">version</span> <span class="o">=</span> <span class="s">&quot;1.0&quot;</span><span class="p">)</span>
+<span class="nb">package</span> <span class="n">org</span><span class="o">.</span><span class="n">apache</span><span class="o">.</span><span class="n">sling</span><span class="o">.</span><span class="n">api</span><span class="o">.</span><span class="n">auth</span><span class="p">;</span>
+<span class="nb">import</span> <span class="n">aQute</span><span class="o">.</span><span class="n">bnd</span><span class="o">.</span><span class="n">annotation</span><span class="o">.</span><span class="n">Export</span><span class="p">;</span>
+<p>See <a href="">Bnd Experimental</a>
+ for details. Unfortunately the current Maven Bundle Plugin version does
+not support updating to the most recent BND library versions due to
+<p><a name="VersionPolicy-VersionNumberSyntax"></a></p>
+<h2 id="version-number-syntax">Version Number Syntax</h2>
+<p>As a small reminder, this is how a version number is constructed:  In OSGi
+version numbers are composed of four (4) segments: 3 integers and a string
+named major.minor.micro.qualifier.</p>
+<p>Each segment captures a different intent:</p>
+<div class="codehilite"><pre><span class="o">*</span> <span class="n">the</span> <span class="n">major</span> <span class="n">segment</span> <span class="n">indicates</span> <span class="n">breakage</span> <span class="n">in</span> <span class="n">the</span> <span class="n">API</span>
+<span class="o">*</span> <span class="n">the</span> <span class="n">minor</span> <span class="n">segment</span> <span class="n">indicates</span> <span class="n">_externally</span> <span class="n">visible_</span> <span class="n">changes</span>
+<span class="o">*</span> <span class="n">the</span> <span class="n">micro</span> <span class="n">segment</span> <span class="n">indicates</span> <span class="n">bug</span> <span class="n">fixes</span>
+<span class="o">*</span> <span class="n">the</span> <span class="n">qualifier</span> <span class="n">segment</span> <span class="n">is</span> <span class="ow">not</span> <span class="n">generally</span> <span class="n">used</span> <span class="n">but</span> <span class="n">may</span> <span class="n">be</span> <span class="n">used</span> <span class="n">to</span> <span class="n">convey</span>
+<p>more information about a particular build, such as a build time or an SVN
+revision number.</p>
+<p><a name="VersionPolicy-EvolutionofExportedPackageVersions"></a></p>
+<h2 id="evolution-of-exported-package-versions">Evolution of Exported Package Versions</h2>
+<p>Version numbers of exported packages evolve independently from each other.
+Depending on the changes applied, the micro, minor, or major segement is
+increased. Whenever the major segment is increased, the minor and micro
+segments are reset to zero. Whenever the minor segment is increased, the
+micro segment is reset to zero.</p>
+<p>Segments are increased according to the above listing.</p>
+<p>This requires committers to think well about changes they apply to exported
+<li>Removing interfaces, methods or constants is likely an API breakage and
+thus requires a major version increase. In Sling we try to prevent this
+from happening.</li>
+<li>Adding new methods to interfaces is likely just an <em>externally visible</em>
+change and thus requires a minor version increase</li>
+<li>Fixing a bug in an exported class just requires a minor version
+<p>JavaDoc updates generally do not constitute a reason to evolve the version
+number. The exception is that if the JavaDoc update is caused by a API
+limitation, it might be conceivable to increase the version number of the
+exported package. A decision on this will have to be taken on a
+case-by-case basis.</p>
+<p><a name="VersionPolicy-EvolutionofBundleVersions"></a></p>
+<h2 id="evolution-of-bundle-versions">Evolution of Bundle Versions</h2>
+<p>Version numbers of bundles evolve depending on the evolution of the
+exported packages but also depending on the evolution of the private code,
+which is not exported.</p>
+<p>As a rule of thumb, the following reasons apply for increasing the segments
+of bundle version numbers:</p>
+<li>Increasing the major version number of any of the exported packages or
+restructuring the bundle such that major parts are removed from the bundle
+(and either completely removed or moved to other bundle(s)).</li>
+<li>Increasing the minor version number of any of the exported packages or
+refactoring the internal code or implementing a package exported by another
+bundle whose minor (or even major) version number has increased. Also
+functional extensions of the internal bundle classes consitutes a reason to
+increase the minor version number.</li>
+<li>Increasing the micro version number of any of the exported packages or
+bug fixes.</li>
+<p>Note, that this definition does not require the bundle and epxorted package
+version numbers to be synchronized in any way. While doing so might help in
+a first or second step, over time it will become close to impossible to
+keep the versions in sync. So rather than trying to keep the versions in
+sync, we should make sure, we increase the versions correctly.</p>
+<p><a name="VersionPolicy-Examples"></a></p>
+<h2 id="examples">Examples</h2>
+<p><a name="VersionPolicy-PureAPIBundle"></a></p>
+<h3 id="pure-api-bundle">Pure API Bundle</h3>
+<p>An example of an almost <em>Pure API Bundle</em> is the Sling API bundle. This
+bundle exports 9 packages. Some are really stable -- e.g. the
+<em></em> package or the <em></em>
+package -- and some are being worked on at the moment -- e.g. the
+<em></em> package.</p>
+<p>To not break existing users of the unmodified packages, the exported
+versions of these packages must not be increased.</p>
+<p>To signal to users of evolving packages, that there might be new and
+interesting functionality, the version number must be increased according
+to above definition. This also conveys to the implementor(s) of the API,
+that they have to take some action.</p>
+<p>A hypothetical evolution of version numbers shown on two packages and the
+bundle version might be as follows</p>
+<tr><td> Description </td><td> *api* package </td><td> *resource* package </td><td> bundle </td></tr>
+<tr><td> Initial Release </td><td> 1.0.0 </td><td> 1.0.0 </td><td> 1.0.0 </td></tr>
+<tr><td> Bug fix in a *resource* class </td><td> 1.0.0 </td><td> 1.0.2 </td><td> 1.0.2 </td></tr>
+<tr><td> New API in the *resource* package </td><td> 1.0.0 </td><td> 1.1.0 </td><td> 1.1.0 </td></tr>
+<tr><td> New API in the *api* package </td><td> 1.1.0 </td><td> 1.1.0 </td><td> 1.2.0 </td></tr>
+<tr><td> API breakage in the *api* package </td><td> 2.0.0 </td><td> 1.1.0 </td><td> 2.0.0 </td></tr>
+<p><a name="VersionPolicy-ImplementationBundleprovidingAPI"></a></p>
+<h3 id="implementation-bundle-providing-api">Implementation Bundle providing API</h3>
+<p>An example of such a hybrid bundle is the Sling Engine bundle. This bundle
+exports two packages themselves defining API and contains a number of
+internal packages which actually implement parts of the Sling API.</p>
+<p>A hypothetical evolution of version numbers shown on one exported package
+and the bundle version might be as follows</p>
+<tr><td> Description </td><td> *engine* package </td><td> bundle </td></tr>
+<tr><td> Initial Release </td><td> 1.0.0 </td><td> 1.0.0 </td></tr>
+<tr><td> Bug fix in a *engine* class </td><td> 1.0.2 </td><td> 1.0.2 </td></tr>
+<tr><td> Bug fix in an internal calss </td><td> 1.0.2 </td><td> 1.0.4 </td></tr>
+<tr><td> New API in the *engine* package </td><td> 1.1.0 </td><td> 1.1.0 </td></tr>
+<tr><td> Implement new API from *api* 1.1.0 </td><td> 1.1.0 </td><td> 1.2.0 </td></tr>
+<tr><td> Refactor internal classes </td><td> 1.1.0 </td><td> 1.3.0 </td></tr>
+<tr><td> Implement API from *api* 2.0.0 </td><td> 1.1.0 </td><td> 2.0.0 </td></tr>
+<p><a name="VersionPolicy-PureImplementationBundle"></a></p>
+<h3 id="pure-implementation-bundle">Pure Implementation Bundle</h3>
+<p>For Pure Implementation Bundles only the bundle version numbers are
+maintained because there is no exported package whose version number needs
+to be managed. This makes the decision process of version number evolution
+very simple.</p>
+<p><a name="VersionPolicy-ImportingPackages"></a></p>
+<h2 id="importing-packages">Importing Packages</h2>
+<p>When importing packages a version number will automatically be generated by
+the Maven Bundle Plugin as follows:</p>
+<li>If the providing package exports a package with an explicit version
+number, that exact version number will be used as the lower bound</li>
+<li>If such a lower bound exists, the upper bound is exclusive the next
+major version number.</li>
+<p>For example if importing the <em>api</em> package exported at version 1.2.3, the
+<em>Import-Package</em> statement is generated as</p>
+<div class="codehilite"><pre><span class="n">Import</span><span class="o">-</span><span class="n">Package:</span> <span class="n">api</span><span class="p">;</span><span class="n">version</span><span class="o">=</span><span class="p">[</span><span class="mf">1.2.3</span><span class="p">,</span><span class="mf">2.0.0</span><span class="p">)</span>
+<p>This default works well for consumers of the API, since according to above
+definitions an API is guaranteed to not contain breakages if the major
+version number is not increased.</p>
+<p>For bundles implementing the API, this default does not work well, since
+from their point of view an <em>externally visible</em> change in fact constitutes
+a breakage, because the implementation is not complete. So if a bundle
+implements a package a manually crafted import version should be defined
+which includes the export version of the defining bundle but excludes the
+next minor version.</p>
+<p>For example implementing the <em>api</em> package exported at version 1.2.3,
+would require the following manually created <em>Import-Package</em> statement:</p>
+<div class="codehilite"><pre><span class="n">Import</span><span class="o">-</span><span class="n">Package:</span> <span class="n">api</span><span class="p">;</span><span class="n">version</span><span class="o">=</span><span class="p">[</span><span class="mf">1.2.3</span><span class="p">,</span><span class="mf">1.3.0</span><span class="p">)</span>
+<p>This allows for the implementation to work correctly with bug fixed package
+exports but as soon as there are any <em>externally visible</em> changes, the
+implementation bundle has to be adapted -- even if this just means
+increasing the upper version bound in the <em>Import-Package</em> statement thus
+guaranteeing compliance (again).</p>
+<p>Recent versions of the BND library support automatic differntiation between
+use and implementation of API and to set the import version ranges
+accordingly. See <a href="">Bnd Experimental</a>
+ for details. Unfortunately the current Maven Bundle Plugin version does
+not support updating to the most recent BND library versions due to
+<p><a name="VersionPolicy-References"></a></p>
+<h2 id="references">References</h2>
+<p><a href="">Version Numbers</a>
+ -- The mail thread discussing version numbering
+<a href="">On Version Numbers</a>
+ -- Blog about version numbers
+<a href="">Version Numbering</a>
+ -- An Eclipse paper on assigning version numbers. Very good read.
+<a href="">Semantic Versioning</a>
+ -- An OSGi Alliance paper on semantic versioning.
+<a href="">Bnd Experimental</a>
+ -- Experimental extensions to the BND library; unfortunately these
+extensions are not yet usable with Maven Bundle Plugin 2.1.0 due to API
+changes in the BND library not supported by the plugin.</p>
         <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.

Modified: websites/staging/sling/trunk/content/web-console-extensions.html
--- websites/staging/sling/trunk/content/web-console-extensions.html (original)
+++ websites/staging/sling/trunk/content/web-console-extensions.html Sun Apr 22 17:20:11 2012
@@ -82,7 +82,60 @@
 <a href="/">Home</a>
    <!--   <h1 class="title">Web Console Extensions</h1> -->
+<!-- -->
+<p><a name="WebConsoleExtensions-WebConsoleExtensions"></a></p>
+<h1 id="web-console-extensions">Web Console Extensions</h1>
+<p>The Apache Sling project provides two extensions to the <a href="">Apache Felix Web Console</a>
+ (in addition to a number of plugins, of course):</p>
+<p><a name="WebConsoleExtensions-Branding("></a></p>
+<h2 id="branding-orgapacheslingextensionswebconsolebranding">Branding (</h2>
+<p>The Apache Sling Web Console Branding provided by Apache Sling is currently
+just for the product logo displayed in the upper right corner of the Web
+Console and some titles and strings.</p>
+<p>This bundle will attach as a fragment bundle to the Apache Felix Web
+Console bundle. To enable it after installation into a running system, you
+might have to refresh the package imports of the Apache Felix Web Console
+bundle. If you install using the Apache Felix Web Console bundle
+installation functionality, this will be taken care of by the Web Console.</p>
+<p>h2. Security Provider
+<p>The Apache Sling Web Console Security Provider implements the Apache Felix
+Web Console <em>WebConsoleSecurityProvider</em> interface authenticating Web
+Console users against the JCR repository. Each username and password
+presented is used to login to the JCR repository and to check the
+respective session.</p>
+<li>Ensure the username and password can be used to login to the default
+workspace. If not, access is denied</li>
+<li>If the username presented is one of the user names configured with the
+<em>users</em> configuration property, access is granted.</li>
+<li>Otherwise if the user is a (direct or indirect) member of one of the
+groups configured with the <em>groups</em> configuration property, access is
+<p>Access is denied if the username and password cannot be used to login to
+the default workspace or if the user is neither one of the configured
+allowed users nor in any of the configured groups.</p>
+<p><a name="WebConsoleExtensions-Configuration"></a></p>
+<h3 id="configuration">Configuration</h3>
+<p>The Security Provider is configured with configuration with PID
+supporting the following properties:</p>
+<tr><th> Property </th><th> Type </th><th> Default Value </th><th> Description
+<tr><td> *users* </td><td> *String*, {{String[](.html)
+}} or *Vector<String>* </td><td> admin </td><td> The list of users granted access to the
+Web Console </td></tr>
+<tr><td> *groups*</td><td> *String*, {{String[](.html)
+}} or *Vector<String>* </td><td> --- </td><td> The list of groups whose (direct or
+indirect) members are granted access to the Web Console </td></tr>
+<p>Note, that while the default value explicitly grants the <em>admin</em> user to
+access the Web Console it is suggested that system administrators define a
+special group and assign users with Web Console access to this group.</p>
         <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.

Modified: websites/staging/sling/trunk/content/wiki.html
--- websites/staging/sling/trunk/content/wiki.html (original)
+++ websites/staging/sling/trunk/content/wiki.html Sun Apr 22 17:20:11 2012
@@ -82,7 +82,32 @@
 <a href="/">Home</a>
    <!--   <h1 class="title">wiki</h1> -->
+<!-- -->
+<p><a name="wiki-ApacheSlingWebsite"></a></p>
+<h1 id="apache-sling-website">Apache Sling Website</h1>
+<p>{tip:title=Use Generated Pages}
+The Apache Sling project uses a Confluence space for documentation purposes
+and to generate the static Sling web site. You are currently looking at the
+source wiki. End users should generally use the static, generated pages, at
+ since the wiki is typically only
+necessary for editing content. Below you'll find an overview of the main
+menu, all pages in this wiki as well as a list of recently modified pages.
+<a name="wiki-Menu"></a></p>
+<h1 id="menu">Menu</h1>
+<a name="wiki-Recentlyupdatedpages"></a></p>
+<h1 id="recently-updated-pages">Recently updated pages</h1>
+<a name="wiki-Sitemap"></a></p>
+<h1 id="site-map">Site map</h1>
+{section} </p>
         <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.

Modified: websites/staging/sling/trunk/content/wrap-or-decorate-resources.html
--- websites/staging/sling/trunk/content/wrap-or-decorate-resources.html (original)
+++ websites/staging/sling/trunk/content/wrap-or-decorate-resources.html Sun Apr 22 17:20:11 2012
@@ -82,7 +82,47 @@
 <a href="/">Home</a>
    <!--   <h1 class="title">Wrap or Decorate Resources</h1> -->
+<!-- -->
+<p><a name="WraporDecorateResources-Servicetowrapresources"></a></p>
+<h1 id="service-to-wrap-resources">Service to wrap resources</h1>
+<p><a name="WraporDecorateResources-Introduction"></a></p>
+<h2 id="introduction">Introduction</h2>
+<p>The Sling API provides an easy way to wrap or decorate a resource before
+returning. Use cases for this could for example be
+<em> overwrite resource type/resource super type (for example based on the
+resource path)
+</em> add metadata</p>
+<p><a name="WraporDecorateResources-"></a></p>
+<p>To add a resource decorator just register one or more services which
+implement the interface <em>ResourceDecorator</em></p>
+<div class="codehilite"><pre><span class="n">interface</span> <span class="n">ResourceDecorator</span> <span class="p">{</span>
+    <span class="n">Resource</span> <span class="n">decorate</span><span class="p">(</span><span class="n">Resource</span><span class="p">)</span>
+    <span class="nv">@Deprecated</span>
+    <span class="n">Resource</span> <span class="n">decorate</span><span class="p">(</span><span class="n">Resource</span><span class="p">,</span> <span class="n">HttpServletRequest</span><span class="p">)</span>
+<span class="p">}</span>
+<p>The registered decorators will be called from the resource resolver for
+each resource returned. 
+If the service decorates the resource it should return the new resource. If
+the service does not want to decorate the resource, it should return the
+original resource or null. </p>
+<p>The two-argument <em>{decorate</em>} method will not be invoked, starting with
+version 2.1.0 of the JCR Resource bundle. Implementors of this interface
+targeting both newer and older versions of this bundle are advised to
+implement this method with:</p>
+<div class="codehilite"><pre>    <span class="n">public</span> <span class="n">Resource</span> <span class="n">decorate</span><span class="p">(</span><span class="n">Resource</span> <span class="n">resource</span><span class="p">,</span> <span class="n">HttpServletRequest</span> <span class="n">request</span><span class="p">)</span>
+        return this.decorate(resource);
+        }</p>
+<p>And use some other method (e.g. a <em>{ThreadLocal</em>}) to obtain the current
+request if necessary.</p>
         <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.

Modified: websites/staging/sling/trunk/content/xslt-processing-pipeline.html
--- websites/staging/sling/trunk/content/xslt-processing-pipeline.html (original)
+++ websites/staging/sling/trunk/content/xslt-processing-pipeline.html Sun Apr 22 17:20:11 2012
@@ -82,6 +82,7 @@
 <a href="/">Home</a>
    <!--   <h1 class="title">XSLT Processing Pipeline</h1> -->
+<!-- -->
         <div class="trademarkFooter"> 

View raw message