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 [18/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/maven-archetypes.html
==============================================================================
--- websites/staging/sling/trunk/content/site/maven-archetypes.html (added)
+++ websites/staging/sling/trunk/content/site/maven-archetypes.html Wed Dec 12 09:16:44 2012
@@ -0,0 +1,94 @@
+
+<!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 - Maven Archetypes</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="Maven Archetypes">Maven Archetypes</A>
+        </DIV>
+<P>Sling includes four Maven archetypes to quick start development. See <A href="http://maven.apache.org/archetype/maven-archetype-plugin/" class="external-link" rel="nofollow">http://maven.apache.org/archetype/maven-archetype-plugin/</A> for general information on using Maven archetypes. The Maven groupId for all Sling archetypes is <TT>org.apache.sling</TT>.</P>
+
+<H3><A name="MavenArchetypes-slinglaunchpadstandalonearchetype"></A>sling-launchpad-standalone-archetype</H3>
+
+<P>This archetype generates a Maven project which will build a standalone Launchpad JAR file using the default bundle set. For demonstration purposes, the generated project includes an extra bundle list file (<TT>src/main/bundles/list</TT>) which includes Apache Felix FileInstall as well as a test configuration file (<TT>src/test/config/sling.properties</TT>).</P>
+
+<H3><A name="MavenArchetypes-slinglaunchpadwebapparchetype"></A>sling-launchpad-webapp-archetype</H3>
+
+<P>This archetype generates a Maven project which will build a Launchpad WAR file using the default bundle set. For demonstration purposes, the generated project includes an extra bundle list file (<TT>src/main/bundles/list</TT>) which includes Apache Felix FileInstall as well as a test configuration file (<TT>src/test/config/sling.properties</TT>).</P>
+
+<H3><A name="MavenArchetypes-slingintitialcontentarchetype"></A>sling-intitial-content-archetype</H3>
+
+<P>This archetype generates a Maven project which will build an OSGi bundle that supports JCR NodeType registration (in <TT>SLING-INF/nodetypes/nodetypes.cnd</TT>) and initial content loading (in <TT>SLING-INF/scripts</TT> and <TT>SLING-INF/content</TT>).</P>
+
+<H3><A name="MavenArchetypes-slingservletarchetype"></A>sling-servlet-archetype</H3>
+
+<P>This archetype generates a Maven project which will build an OSGi bundle containing two Servlets registered with Sling, one registered by path and one registered by resource type.</P>
+
+<H3><A name="MavenArchetypes-slingbundlearchetype"></A>sling-bundle-archetype</H3>
+
+<P>This archetype generates a Maven project which will build a basic OSGi bundle including support for the Felix SCR Annotations. It is pre-configured to install using the Felix Web Console when the profile <TT>autoInstallBundle</TT> is activated.</P>
+
+
+<H3><A name="MavenArchetypes-slingjcrinstallbundlearchetype"></A>sling-jcrinstall-bundle-archetype</H3>
+
+<P>This archetype generates a Maven project which will build a basic OSGi bundle including support for the Felix SCR Annotations. It is pre-configured to install using a WebDAV PUT into the JCR when the profile <TT>autoInstallBundle</TT> is activated.</P>
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by justinedelson on 2011-11-28 09:46:44.0
+        </DIV>
+        <DIV class="trademarkFooter">
+Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
+        </DIV>
+    </DIV>
+  </BODY>
+</HTML>
+

Added: websites/staging/sling/trunk/content/site/maven-launchpad-plugin.html
==============================================================================
--- websites/staging/sling/trunk/content/site/maven-launchpad-plugin.html (added)
+++ websites/staging/sling/trunk/content/site/maven-launchpad-plugin.html Wed Dec 12 09:16:44 2012
@@ -0,0 +1,270 @@
+
+<!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 - Maven Launchpad Plugin</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="Maven Launchpad Plugin">Maven Launchpad Plugin</A>
+        </DIV>
+<H1><A name="MavenLaunchpadPlugin-MavenLaunchpadPlugin"></A>Maven Launchpad Plugin</H1>
+
+<P>The Maven Launchpad Plugin provides goals which facilitate the creation of OSGi applications. It supports the following runtime scenarios:</P>
+<UL>
+	<LI>A WAR file suitable for running in a JavaEE servlet container.</LI>
+	<LI>A standalone Java application, with HTTP support from the Felix HttpService implementation</LI>
+	<LI>Inside Apache Karaf</LI>
+</UL>
+
+
+<P>In addition, the Maven Launchpad Plugin supports the publishing of an application descriptor, in the form of a <B>bundle list</B>, as a Maven artifact. This descriptor can then be used by downstream application builders as the basis for other applications. In Sling, this is embodied by two Maven projects:</P>
+<UL>
+	<LI><A href="http://svn.apache.org/repos/asf/sling/trunk/launchpad/builder" class="external-link" rel="nofollow">org.apache.sling.launchpad</A> - produces an application descriptor.</LI>
+	<LI><A href="http://svn.apache.org/repos/asf/sling/trunk/launchpad/builder/testing" class="external-link" rel="nofollow">org.apache.sling.launchpad.testing</A> - uses the application descriptor from <TT>org.apache.sling.launchpad</TT> and adds two bundles.</LI>
+</UL>
+
+
+<P>Maven Launchpad Plugin provides the following goals: </P>
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Goals </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> launchpad:prepare-package </TD>
+<TD class="confluenceTd"> Create the file system structure required by Sling's Launchpad framework. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> launchpad:attach-bundle-list </TD>
+<TD class="confluenceTd"> Attach the bundle list descriptor to the current project as a Maven artifact. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> launchpad:create-karaf-descriptor </TD>
+<TD class="confluenceTd"> Create an Apache Karaf Feature descriptor. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> launchpad:create-bundle-jar </TD>
+<TD class="confluenceTd"> Create a JAR file containing the bundles in a Launchpad-structured JAR file. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> launchpad:check-bundle-list-for-snapshots </TD>
+<TD class="confluenceTd"> Validate that the bundle list does not contain any SNAPSHOT versions. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> launchpad:run </TD>
+<TD class="confluenceTd"> Run a Launchpad application. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> launchpad:start </TD>
+<TD class="confluenceTd"> Start a Launchpad application. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> launchpad:stop </TD>
+<TD class="confluenceTd"> Stop a Launchpad application. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> launchpad:output-bundle-list </TD>
+<TD class="confluenceTd"> Output the bundle list to the console as XML. (added in version 2.0.8) </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+<H3><A name="MavenLaunchpadPlugin-GeneralConfiguration"></A>General Configuration</H3>
+
+<P>In general, the bulk of the configuration of the Maven Launchpad Plugin is concerned with setting up the bundle list which all of the goals will use. This bundle list is created using the following steps:</P>
+<OL>
+	<LI>If <TT>includeDefaultBundles</TT> is <TT>true</TT> (the default), the default bundle list is loaded. By default, this is <TT>org.apache.sling.launchpad:org.apache.sling.launchpad:RELEASE:xml:bundlelist</TT>, but can be overridden by setting the <TT>defaultBundleList</TT> plugin parameter.</LI>
+	<LI>If <TT>includeDefaultBundles</TT> is <TT>false</TT>, an empty list is created.</LI>
+	<LI>If the bundle list file exists (by default, at <TT>src/main/bundles/list.xml</TT>), the bundles defined in it are added to the bundle list.</LI>
+	<LI>If the <TT>additionalBundles</TT> plugin parameter is defined, those bundles are added to the bundle list.</LI>
+	<LI>If the <TT>bundleExclusions</TT> plugin parameter is defined, those bundles are removed from the bundle list.</LI>
+</OL>
+
+
+<P>When a bundle is added to the bundle list, if a bundle with the same groupId, artifactId, type, and classifier is already in the bundle list, the version of the existing bundle is modified. However, the start level of a bundle is never changed once that bundle is added to the bundle list.</P>
+
+<P>The plugin may also contribute bundles to (or remove bundles from) the bundle list as it sees fit.</P>
+
+<H3><A name="MavenLaunchpadPlugin-FrameworkConfiguration"></A>Framework Configuration</H3>
+
+<P>For the <TT>run</TT> and <TT>start</TT> goals, the plugin will look for a file named <TT>src/test/config/sling.properties</TT>. If this file is present, it will be filtered using standard Maven filtering and used to populate the OSGi framework properties. This can be used, for example, to specify a <TT>repository.xml</TT> file to be used during development:</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+sling.repository.config.file.url=${basedir}/src/test/config/repository.xml
+</PRE>
+</DIV></DIV>
+
+<H2><A name="MavenLaunchpadPlugin-BundleListFiles"></A>Bundle List Files</H2>
+
+<P>The bundle list file uses a simple XML syntax representing a list of bundles organized into start levels:</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>?&gt;</SPAN>
+<SPAN class="code-tag">&lt;bundles&gt;</SPAN>
+    <SPAN class="code-tag">&lt;startLevel level=<SPAN class="code-quote">&quot;0&quot;</SPAN>&gt;</SPAN>
+        <SPAN class="code-tag">&lt;bundle&gt;</SPAN>
+            <SPAN class="code-tag">&lt;groupId&gt;</SPAN>commons-io<SPAN class="code-tag">&lt;/groupId&gt;</SPAN>
+            <SPAN class="code-tag">&lt;artifactId&gt;</SPAN>commons-io<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN>
+            <SPAN class="code-tag">&lt;version&gt;</SPAN>1.4<SPAN class="code-tag">&lt;/version&gt;</SPAN>
+        <SPAN class="code-tag">&lt;/bundle&gt;</SPAN>
+        <SPAN class="code-tag">&lt;bundle&gt;</SPAN>
+            <SPAN class="code-tag">&lt;groupId&gt;</SPAN>commons-collections<SPAN class="code-tag">&lt;/groupId&gt;</SPAN>
+            <SPAN class="code-tag">&lt;artifactId&gt;</SPAN>commons-collections<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN>
+            <SPAN class="code-tag">&lt;version&gt;</SPAN>3.2.1<SPAN class="code-tag">&lt;/version&gt;</SPAN>
+        <SPAN class="code-tag">&lt;/bundle&gt;</SPAN>
+    <SPAN class="code-tag">&lt;/startLevel&gt;</SPAN>
+
+    <SPAN class="code-tag">&lt;startLevel level=<SPAN class="code-quote">&quot;10&quot;</SPAN>&gt;</SPAN>
+        <SPAN class="code-tag">&lt;bundle&gt;</SPAN>
+            <SPAN class="code-tag">&lt;groupId&gt;</SPAN>org.apache.felix<SPAN class="code-tag">&lt;/groupId&gt;</SPAN>
+            <SPAN class="code-tag">&lt;artifactId&gt;</SPAN>org.apache.felix.eventadmin<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN>
+            <SPAN class="code-tag">&lt;version&gt;</SPAN>1.0.0<SPAN class="code-tag">&lt;/version&gt;</SPAN>
+        <SPAN class="code-tag">&lt;/bundle&gt;</SPAN>
+    <SPAN class="code-tag">&lt;/startLevel&gt;</SPAN>
+
+    <SPAN class="code-tag">&lt;startLevel level=<SPAN class="code-quote">&quot;15&quot;</SPAN>&gt;</SPAN>
+        <SPAN class="code-tag">&lt;bundle&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>org.apache.sling.jcr.api<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN>
+            <SPAN class="code-tag">&lt;version&gt;</SPAN>2.0.2-incubator<SPAN class="code-tag">&lt;/version&gt;</SPAN>
+        <SPAN class="code-tag">&lt;/bundle&gt;</SPAN>
+    <SPAN class="code-tag">&lt;/startLevel&gt;</SPAN>
+<SPAN class="code-tag">&lt;/bundles&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>Within each <TT>bundle</TT> element, <TT>type</TT> and <TT>classifier</TT> are also supported.</P>
+
+<H2><A name="MavenLaunchpadPlugin-ArtifactDefinition"></A>Artifact Definition</H2>
+
+<P>The <TT>defaultBundleList</TT>, <TT>jarWebSupport</TT>, <TT>additionalBundles</TT>, and <TT>bundleExclusions</TT> parameters are configured with artifact definitions. This is done using a syntax similar to Maven dependency elements:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-xml">
+<SPAN class="code-tag">&lt;configuration&gt;</SPAN>
+...
+  <SPAN class="code-tag">&lt;jarWebSupport&gt;</SPAN>
+    <SPAN class="code-tag">&lt;groupId&gt;</SPAN>GROUP_ID<SPAN class="code-tag">&lt;/groupId&gt;</SPAN>
+    <SPAN class="code-tag">&lt;artifactId&gt;</SPAN>ARTIFACT_ID<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN>
+    <SPAN class="code-tag">&lt;version&gt;</SPAN>VERSION<SPAN class="code-tag">&lt;/version&gt;</SPAN>
+    <SPAN class="code-tag"><SPAN class="code-comment">&lt;!-- type and classifier can also be specified if needed --&gt;</SPAN></SPAN>
+  <SPAN class="code-tag">&lt;/jarWebSupport&gt;</SPAN>
+...
+<SPAN class="code-tag">&lt;/configuration&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>For example, to use Pax Web instead of Felix HttpService as the HttpService provider, use the following:</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-xml">
+<SPAN class="code-tag">&lt;configuration&gt;</SPAN>
+...
+  <SPAN class="code-tag">&lt;jarWebSupport&gt;</SPAN>
+    <SPAN class="code-tag">&lt;groupId&gt;</SPAN>org.ops4j.pax.web<SPAN class="code-tag">&lt;/groupId&gt;</SPAN>
+    <SPAN class="code-tag">&lt;artifactId&gt;</SPAN>pax-web-service<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN>
+    <SPAN class="code-tag">&lt;version&gt;</SPAN>RELEASE<SPAN class="code-tag">&lt;/version&gt;</SPAN>
+    <SPAN class="code-tag"><SPAN class="code-comment">&lt;!-- type and classifier can also be specified if needed --&gt;</SPAN></SPAN>
+  <SPAN class="code-tag">&lt;/jarWebSupport&gt;</SPAN>
+...
+<SPAN class="code-tag">&lt;/configuration&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>In the case of <TT>additionalBundles</TT> and <TT>bundleExclusions</TT>, these are arrays of definitions, so an intermediate <TT>bundle</TT> element is necessary:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-xml">
+<SPAN class="code-tag">&lt;configuration&gt;</SPAN>
+...
+  <SPAN class="code-tag">&lt;additionalBundles&gt;</SPAN>
+    <SPAN class="code-tag">&lt;bundle&gt;</SPAN>
+      <SPAN class="code-tag">&lt;groupId&gt;</SPAN>GROUP_ID<SPAN class="code-tag">&lt;/groupId&gt;</SPAN>
+      <SPAN class="code-tag">&lt;artifactId&gt;</SPAN>ARTIFACT_ID<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN>
+      <SPAN class="code-tag">&lt;version&gt;</SPAN>VERSION<SPAN class="code-tag">&lt;/version&gt;</SPAN>
+      <SPAN class="code-tag"><SPAN class="code-comment">&lt;!-- type and classifier can also be specified if needed --&gt;</SPAN></SPAN>
+    <SPAN class="code-tag">&lt;/bundle&gt;</SPAN>
+  <SPAN class="code-tag">&lt;/additionalBundles&gt;</SPAN>
+...
+<SPAN class="code-tag">&lt;/configuration&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>By default, bundles are added to start level 0. To change, this use the <TT>startLevel</TT> element within each additional bundle definition.</P>
+
+<H2><A name="MavenLaunchpadPlugin-IntegrationTesting"></A>Integration Testing</H2>
+
+<P>For integration testing examples, see <TT>/samples/inplace-integration-test</TT> and <TT>launchpad/testing</TT> in the Sling source tree.</P>
+
+<H2><A name="MavenLaunchpadPlugin-BundleListRewriting"></A>Bundle List Rewriting</H2>
+
+<P>The Maven Launchpad Plugin supports the use of rules to rewrite the bundle list. These rules are executed by the <A href="http://www.jboss.org/drools" class="external-link" rel="nofollow">Drools</A> rule engine. Typically, this is used along with Maven profiles. For example, Sling's testing project includes a profile called <TT>test-reactor-sling-bundles</TT>. When activated, this profile runs a Drools rule file which scans the project list from the Maven reactor and modifies the version number for bundles which were contained within the reactor.</P>
+
+<P>In order for rules to interact with the Maven build, the following global variables are made available:</P>
+
+<UL>
+	<LI><TT>mavenSession</TT> - an instance of <TT>org.apache.maven.execution.MavenSession</TT>.</LI>
+	<LI><TT>mavenProject</TT> - an instance of <TT>org.apache.maven.project.MavenProject</TT>.</LI>
+</UL>
+
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by justinedelson on 2010-10-13 16:00:29.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/maventipsandtricks.html
==============================================================================
--- websites/staging/sling/trunk/content/site/maventipsandtricks.html (added)
+++ websites/staging/sling/trunk/content/site/maventipsandtricks.html Wed Dec 12 09:16:44 2012
@@ -0,0 +1,124 @@
+
+<!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 - MavenTipsAndTricks</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="MavenTipsAndTricks">MavenTipsAndTricks</A>
+        </DIV>
+<P>Here's our collection of tips and tricks for building Sling with <A href="http://maven.apache.org/" class="external-link" rel="nofollow">Maven</A>.</P>
+
+<H1><A name="MavenTipsAndTricks-Mavenlocalrepository"></A>Maven local repository</H1>
+
+<P>The first time you run a Maven build, or when Maven needs additional build components, it downloads plugins and dependencies under its <EM>local repository</EM> folder on your computer. By default, this folder is named <EM>.m2/repository</EM> in your home directory.</P>
+
+<P>Maven uses this repository as a cache for artifacts that it might need for future builds, which means that the first Sling build usually takes much longer than usual, as Maven needs to download many tools and dependencies into its local repository while the build progresses.</P>
+
+<P>The build might fail if one of those downloads fails, in that case it might be worth retrying the build, to check if that was just a temporary connection problem, or if there's a more serious error.</P>
+
+<P>In some cases, the local Maven repository might get corrupted - if your build fails on a computer and works on another one, clearing the local repository before restarting the build might be worth trying.</P>
+
+<H1><A name="MavenTipsAndTricks-Mavensettings"></A>Maven settings</H1>
+
+<H2><A name="MavenTipsAndTricks-Ignoreyourlocalsettings"></A>Ignore your local settings</H2>
+<P>To make sure you're getting the same results as we are when building Sling, it is recommend to ignore any local settings.</P>
+
+<P>On unixish platforms, using</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>mvn -s /dev/null ...
+</PRE>
+</DIV></DIV>
+
+<P>does the trick.</P>
+
+<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>Does anyone have a similar command-line option that works under Windows?</TD></TR></TABLE></DIV>
+
+<H1><A name="MavenTipsAndTricks-"></A></H1>
+<H1><A name="MavenTipsAndTricks-MAVENOPTS"></A>MAVEN_OPTS</H1>
+<P>The MAVEN_OPTS environment variable defines options for the JVM that executes Maven.</P>
+
+<P>Set it according to your platform, i.e. <TT>export MAVEN_OPTS=...</TT> on unixish systems or <TT>set MAVEN_OPTS=...</TT> on Windows.</P>
+
+<H2><A name="MavenTipsAndTricks-IncreaseJVMmemoryifneeded"></A>Increase JVM memory if needed</H2>
+<P>If getting an OutOfMemoryException when running mvn, try setting</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>MAVEN_OPTS=&quot;-Xmx256M -XX:MaxPermSize=256m&quot;
+</PRE>
+</DIV></DIV>
+
+<P>to allocate 256MB of RAM to Maven.</P>
+
+<H2><A name="MavenTipsAndTricks-DebuggingcodelaunchedbyMaven"></A>Debugging code launched by Maven</H2>
+<P>To run the Sling launchpad webapp in debug mode from Maven, for example, use something like</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>MAVEN_OPTS=&quot;-agentlib:jdwp=transport=dt_socket,address=30303,server=y,suspend=n&quot;
+</PRE>
+</DIV></DIV>
+
+<P>And then connect to port 30303 with a remote JVM debugger (most IDEs do this).</P>
+
+<H2><A name="MavenTipsAndTricks-AvoidspacesinMavenrepositoryandworkspacepaths"></A>Avoid spaces in Maven repository and workspace paths</H2>
+<P>Some Maven plugins do not like spaces in paths. It is better to avoid putting your Maven repository, or your code, under paths like <EM>Documents and Settings</EM>, for example.</P>
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by fmeschbe on 2011-06-02 09:54:47.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/media.data/apache.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/sling/trunk/content/site/media.data/apache.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/sling/trunk/content/site/media.data/apache.png.jpeg
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/sling/trunk/content/site/media.data/apache.png.jpeg
------------------------------------------------------------------------------
    svn:mime-type = image/jpeg

Added: websites/staging/sling/trunk/content/site/media.data/favicon.ico
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/sling/trunk/content/site/media.data/favicon.ico
------------------------------------------------------------------------------
    svn:mime-type = image/x-ico

Added: websites/staging/sling/trunk/content/site/media.data/gradient.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/sling/trunk/content/site/media.data/gradient.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/sling/trunk/content/site/media.data/gradient.png.jpeg
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/sling/trunk/content/site/media.data/gradient.png.jpeg
------------------------------------------------------------------------------
    svn:mime-type = image/jpeg

Added: websites/staging/sling/trunk/content/site/media.data/logo.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/sling/trunk/content/site/media.data/logo.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/sling/trunk/content/site/media.data/logo.png.jpeg
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/sling/trunk/content/site/media.data/logo.png.jpeg
------------------------------------------------------------------------------
    svn:mime-type = image/jpeg

Added: websites/staging/sling/trunk/content/site/media.data/site.css
==============================================================================
--- websites/staging/sling/trunk/content/site/media.data/site.css (added)
+++ websites/staging/sling/trunk/content/site/media.data/site.css Wed Dec 12 09:16:44 2012
@@ -0,0 +1,230 @@
+/* @override http://sling.apache.org/site/media.data/site.css */
+
+body {
+    background-color: #ffffff;
+    color: #3b3b3b;
+    font-family: Tahoma, Arial, sans-serif;
+    font-size: 10pt;
+    line-height: 140%
+}
+
+h1,h2,h3,h4,h5,h6 {
+    font-weight: normal;
+    color: #000000;
+    line-height: 100%;
+}
+
+h1 {
+    font-size: 200%
+}
+
+h2 {
+    font-size: 175%
+}
+
+h3 {
+    font-size: 150%
+}
+
+h4 {
+    font-size: 140%
+}
+
+h5 {
+    font-size: 130%
+}
+
+h6 {
+    font-size: 120%
+}
+
+a {
+    color: #1980af
+}
+
+a:visited {
+    color: #1980af
+}
+
+a:hover {
+    color: #1faae9
+}
+
+.title {
+    position: absolute;
+    left: 1px;
+    right: 1px;
+    top: 25px;
+    height: 81px;
+    background:
+        url(http://incubator.apache.org/sling/site/media.data/gradient.png)
+        repeat-x;
+    background-position: bottom;
+}
+
+.logo {
+    position: absolute;
+    width: 15em;
+    height: 81px;
+    text-align: center;
+}
+
+.header {
+    text-align: right;
+    margin-right: 20pt;
+}
+
+.menu {
+    border-top: 10px solid #f9bb00;
+    position: absolute;
+    top: 107px;
+    left: 1px;
+    width: 15em;
+    bottom: 0px;
+    padding: 0px;
+    background-color: #fcfcfc
+}
+
+.menu ul,.menu p {
+    background-color: #fdf5d9;
+    list-style: none;
+    padding-left: 4em;
+    margin-top: 0px;
+    padding-top: 2em;
+    padding-bottom: 2em;
+    margin-left: 0px;
+    color: #4a4a43
+}
+
+.menu p {
+    font-size: 90%;
+    margin: 0px;
+    padding: 1px;
+    padding-left: 1em;
+}
+
+.menu a {
+    text-decoration: none;
+    color: #4a4a43
+}
+
+.main {
+    position: absolute;
+    border-top: 10px solid #cde0ea;
+    top: 107px;
+    left: 15em;
+    right: 1px;
+    margin-left: 2px;
+    padding-right: 4em;
+    padding-left: 1em;
+    padding-top: 1em;
+}
+
+.code {
+    color: black;
+    background-color: #eeeeee;
+    border: solid 1px black;
+    margin-top: 0.5em;
+    margin-bottom: 0.5em;
+}
+
+.codeHeader {
+    text-align: center;
+    font-family: monospace;
+    border-bottom: 1px solid black;
+    padding-top: 0.5em;
+    padding-bottom: 0.5em;
+    margin-bottom: 0.5em;
+}
+
+.codeContent {
+    padding: 0.5em
+}
+
+.codeContent pre {
+    margin: 0em
+}
+
+.code-keyword {
+    color: #880000
+}
+
+.code-quote {
+    color: #008800
+}
+
+.code-object {
+    color: #0000dd
+}
+
+.code-java {
+    margin: 0em
+}
+
+.preformatted {
+    color: black;
+    background-color: #eeeeee;
+    border: solid 1px black;
+    padding: 0.5em
+}
+
+.preformattedContent pre {
+    margin: 0em
+}
+
+table.confluenceTable {
+    border-collapse: collapse;
+    margin: 5px;
+}
+
+table.confluenceTable th.confluenceTh {
+    background-color: #FDF5D9;
+    border: 1px solid #CCCCCC;
+    padding: 3px 4px;
+    text-align: center;
+}
+
+table.confluenceTable td.confluenceTd {
+    border: 1px solid #CCCCCC;
+    padding: 3px 4px;
+}
+
+.infoMacro {
+    background-color: #D8E4F1;
+    border: 1px solid #3C78B5;
+}
+
+.noteMacro {
+    background-color: #FFFFCE;
+    border: 1px solid #F0C000;
+}
+
+.tipMacro {
+    background-color: #DDFFDD;
+    border: 1px solid #009900;
+}
+
+.warningMacro {
+    background-color: #FFCCCC;
+    border: 1px solid #CC0000;
+}
+
+/** Breadcrump at the top of each page */
+.breadcrump {
+    font-size: 80%;
+}
+
+/** Last modification information at the botton of each page */
+.timestamp {
+    margin-top: 30px;
+    font-size: 80%;
+    text-align: right;
+}
+
+/** Trademark text at the bottom of each page */
+.trademarkFooter {
+    font-size: 80%;
+    font-style: italic;
+    margin-top: 10px;
+    text-align: left;
+}
\ No newline at end of file

Added: websites/staging/sling/trunk/content/site/media.html
==============================================================================
--- websites/staging/sling/trunk/content/site/media.html (added)
+++ websites/staging/sling/trunk/content/site/media.html Wed Dec 12 09:16:44 2012
@@ -0,0 +1,279 @@
+
+<!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 - Media</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="" title="Media">Media</A>
+        </DIV>
+<P>This page holds all media required for the Apache Sling website. The media are attachments and can be addressed using the following URL: <A href="http://cwiki.apache.org/SLINGxSITE/media.data/" class="external-link" rel="nofollow">http://cwiki.apache.org/SLINGxSITE/media.data/</A> (followed by the actual name of the attachment).</P>
+
+<P>Currently, some of these attachments are used by the overall site template (only visible/editable by Confluence administrators).</P>
+
+
+
+    
+
+<DIV class="plugin_attachments_container">
+    <DIV class="plugin_attachments_table_container">
+        <FIELDSET class="hidden">
+            <INPUT type="hidden" class="plugin_attachments_macro_render_param" name="pageId" value="76189">
+            <INPUT type="hidden" name="deleteConfirmMessage" value="Are you sure you want to remove the attached file {0}?">
+            <INPUT type="hidden" name="i18n-notpermitted" value="You are not permitted to perform this operation.">
+                                                    <INPUT type="hidden" name="outputType" value="display">
+        </FIELDSET>
+                    <FIELDSET class="hidden parameters">
+    <INPUT type="hidden" id="removeAttachmentWarning" value="Are you sure you want to remove the attached file {0}?">
+</FIELDSET>
+
+<TABLE class="tableview attachments">
+    <TR>
+                <TH class="filename-column">            <A href="">Name</A>
+    </TH>
+        <TH>            <A href="">Size</A>
+    </TH>
+        <TH>Creator</TH>
+        <TH>            <A href="">Creation Date</A>
+    </TH>
+        <TH class="comment">Comment</TH>
+                    <TH>&nbsp;</TH>
+            </TR>
+
+    
+    
+                
+        
+                <TR id="attachment-5765">
+                                <TD class="filename-column">
+                
+<SPAN class="icon icon-file-image" title="PNG" file="">PNG File</SPAN>                <A class="filename" href="media.data/logo.png" title="logo.png" data-filename="logo.png">
+                    logo.png
+                </A>
+            </TD>
+            <TD class="attachment-size">6 kB</TD>
+            <TD><A href="https://cwiki.apache.org/confluence/users/viewuserprofile.action?username=fmeschbe" class="url fn confluence-userlink" data-username="fmeschbe">Felix Meschberger</A></TD>
+            <TD>Feb 11, 2008 05:45</TD>
+            <TD class="comment">
+                                    &nbsp;
+                            </TD>
+                        <TD class="attachment-actions">
+                                                <UL>
+                                            <LI class="first">
+    
+        
+    
+    <A href="https://cwiki.apache.org/confluence/pages/editattachment.action?pageId=$page.id&fileName=logo.png" class="editAttachmentLink" title="">
+                   <SPAN>Properties</SPAN></A>        </LI>
+                                            <LI class="">
+    
+        
+    
+    <A href="https://cwiki.apache.org/confluence/pages/removeattachment.action?pageId=$page.id&fileName=logo.png&version=1" class="removeAttachmentLink" title="">
+                   <SPAN>Remove</SPAN></A>        </LI>
+                                    </UL>
+                            </TD>
+                    </TR>
+
+            
+                
+        
+                <TR id="attachment-5766">
+                                <TD class="filename-column">
+                
+<SPAN class="icon icon-file-unknown" title="File">File</SPAN>                <A class="filename" href="media.data/favicon.ico" title="favicon.ico" data-filename="favicon.ico">
+                    favicon.ico
+                </A>
+            </TD>
+            <TD class="attachment-size">1 kB</TD>
+            <TD><A href="https://cwiki.apache.org/confluence/users/viewuserprofile.action?username=fmeschbe" class="url fn confluence-userlink" data-username="fmeschbe">Felix Meschberger</A></TD>
+            <TD>Feb 11, 2008 05:46</TD>
+            <TD class="comment">
+                                    &nbsp;
+                            </TD>
+                        <TD class="attachment-actions">
+                                                <UL>
+                                            <LI class="first">
+    
+        
+    
+    <A href="https://cwiki.apache.org/confluence/pages/editattachment.action?pageId=$page.id&fileName=favicon.ico" class="editAttachmentLink" title="">
+                   <SPAN>Properties</SPAN></A>        </LI>
+                                            <LI class="">
+    
+        
+    
+    <A href="https://cwiki.apache.org/confluence/pages/removeattachment.action?pageId=$page.id&fileName=favicon.ico&version=1" class="removeAttachmentLink" title="">
+                   <SPAN>Remove</SPAN></A>        </LI>
+                                    </UL>
+                            </TD>
+                    </TR>
+
+            
+                
+        
+                <TR id="attachment-5767">
+                                <TD class="filename-column">
+                
+<SPAN class="icon icon-file-image" title="PNG" file="">PNG File</SPAN>                <A class="filename" href="media.data/gradient.png" title="gradient.png" data-filename="gradient.png">
+                    gradient.png
+                </A>
+            </TD>
+            <TD class="attachment-size">4 kB</TD>
+            <TD><A href="https://cwiki.apache.org/confluence/users/viewuserprofile.action?username=fmeschbe" class="url fn confluence-userlink" data-username="fmeschbe">Felix Meschberger</A></TD>
+            <TD>Feb 11, 2008 05:46</TD>
+            <TD class="comment">
+                                    &nbsp;
+                            </TD>
+                        <TD class="attachment-actions">
+                                                <UL>
+                                            <LI class="first">
+    
+        
+    
+    <A href="https://cwiki.apache.org/confluence/pages/editattachment.action?pageId=$page.id&fileName=gradient.png" class="editAttachmentLink" title="">
+                   <SPAN>Properties</SPAN></A>        </LI>
+                                            <LI class="">
+    
+        
+    
+    <A href="https://cwiki.apache.org/confluence/pages/removeattachment.action?pageId=$page.id&fileName=gradient.png&version=1" class="removeAttachmentLink" title="">
+                   <SPAN>Remove</SPAN></A>        </LI>
+                                    </UL>
+                            </TD>
+                    </TR>
+
+            
+                
+        
+                <TR id="attachment-20873258">
+                                <TD class="filename-column">
+                
+<SPAN class="icon icon-file-image" title="PNG" file="">PNG File</SPAN>                <A class="filename" href="media.data/apache.png" title="apache.png" data-filename="apache.png">
+                    apache.png
+                </A>
+            </TD>
+            <TD class="attachment-size">12 kB</TD>
+            <TD><A href="https://cwiki.apache.org/confluence/users/viewuserprofile.action?username=fmeschbe" class="url fn confluence-userlink" data-username="fmeschbe">Felix Meschberger</A></TD>
+            <TD>May 02, 2010 03:31</TD>
+            <TD class="comment">
+                                    &nbsp;
+                            </TD>
+                        <TD class="attachment-actions">
+                                                <UL>
+                                            <LI class="first">
+    
+        
+    
+    <A href="https://cwiki.apache.org/confluence/pages/editattachment.action?pageId=$page.id&fileName=apache.png" class="editAttachmentLink" title="">
+                   <SPAN>Properties</SPAN></A>        </LI>
+                                            <LI class="">
+    
+        
+    
+    <A href="https://cwiki.apache.org/confluence/pages/removeattachment.action?pageId=$page.id&fileName=apache.png&version=1" class="removeAttachmentLink" title="">
+                   <SPAN>Remove</SPAN></A>        </LI>
+                                    </UL>
+                            </TD>
+                    </TR>
+
+            
+                
+        
+                <TR id="attachment-24346634">
+                                <TD class="filename-column">
+                
+<SPAN class="icon icon-file-unknown" title="File">File</SPAN>                <A class="filename" href="media.data/site.css" title="site.css" data-filename="site.css">
+                    site.css
+                </A>
+            </TD>
+            <TD class="attachment-size">3 kB</TD>
+            <TD><A href="https://cwiki.apache.org/confluence/users/viewuserprofile.action?username=fmeschbe" class="url fn confluence-userlink" data-username="fmeschbe">Felix Meschberger</A></TD>
+            <TD>Oct 16, 2010 15:25</TD>
+            <TD class="comment">
+                                    &nbsp;
+                            </TD>
+                        <TD class="attachment-actions">
+                                                <UL>
+                                            <LI class="first">
+    
+        
+    
+    <A href="https://cwiki.apache.org/confluence/pages/editattachment.action?pageId=$page.id&fileName=site.css" class="editAttachmentLink" title="">
+                   <SPAN>Properties</SPAN></A>        </LI>
+                                            <LI class="">
+    
+        
+    
+    <A href="https://cwiki.apache.org/confluence/pages/removeattachment.action?pageId=$page.id&fileName=site.css&version=1" class="removeAttachmentLink" title="">
+                   <SPAN>Remove</SPAN></A>        </LI>
+                                    </UL>
+                            </TD>
+                    </TR>
+
+            </TABLE>            </DIV>
+
+    <DIV class="plugin_attachments_upload_container">
+            </DIV>
+</DIV>
+
+
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by fmeschbe on 2008-02-11 06:21:38.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/mime-type-support-commonsmime.data/mimetypes.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/sling/trunk/content/site/mime-type-support-commonsmime.data/mimetypes.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/sling/trunk/content/site/mime-type-support-commonsmime.data/mimetypes.png.jpeg
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/sling/trunk/content/site/mime-type-support-commonsmime.data/mimetypes.png.jpeg
------------------------------------------------------------------------------
    svn:mime-type = image/jpeg

Added: websites/staging/sling/trunk/content/site/mime-type-support-commonsmime.html
==============================================================================
--- websites/staging/sling/trunk/content/site/mime-type-support-commonsmime.html (added)
+++ websites/staging/sling/trunk/content/site/mime-type-support-commonsmime.html Wed Dec 12 09:16:44 2012
@@ -0,0 +1,180 @@
+
+<!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 - MIME Type Support (commons.mime)</TITLE>
+    <LINK rel="stylesheet" href="http://sling.apache.org/site/media.data/site.css" type="text/css" media="all">
+    <LINK rel="icon" href="http://sling.apache.org/site/media.data/favicon.ico">
+    <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </HEAD>
+  <BODY>
+    <DIV class="title">
+      <DIV class="logo">
+        <A href="http://sling.apache.org/site/index.html">
+          <IMG border="0" alt="Apache Sling" src="http://sling.apache.org/site/media.data/logo.png">
+        </A>
+      </DIV>
+      <DIV class="header">
+        <A href="http://www.apache.org/">
+          <IMG border="0" alt="Apache" src="http://sling.apache.org/site/media.data/apache.png">
+        </A>
+      </DIV>
+    </DIV>
+    <DIV class="menu">
+<P><B>Documentation</B><BR class="atl-forced-newline">
+<A href="getting-started.html" title="Getting Started">Getting Started</A><BR class="atl-forced-newline">
+<A href="the-sling-engine.html" title="The Sling Engine">The Sling Engine</A><BR class="atl-forced-newline">
+<A href="development.html" title="Development">Development</A><BR class="atl-forced-newline">
+<A href="bundles.html" title="Bundles">Bundles</A><BR class="atl-forced-newline">
+<A href="tutorials-how-tos.html" title="Tutorials & How-Tos">Tutorials &amp; How&#45;Tos</A><BR class="atl-forced-newline">
+<A href="configuration.html" title="Configuration">Configuration</A><BR class="atl-forced-newline">
+<A href="http://sling.apache.org/apidocs/sling6/index.html" class="external-link" rel="nofollow">API docs</A><BR class="atl-forced-newline">
+<A href="http://s.apache.org/sling.wiki" class="external-link" rel="nofollow">Wiki</A><BR class="atl-forced-newline">
+<A href="http://s.apache.org/sling.faq" class="external-link" rel="nofollow">FAQ</A><BR class="atl-forced-newline"></P>
+
+<P><B>Project info</B><BR class="atl-forced-newline">
+<A href="http://sling.apache.org/site/downloads.cgi" class="external-link" rel="nofollow">Downloads</A><BR class="atl-forced-newline">
+<A href="http://www.apache.org/licenses/" class="external-link" rel="nofollow">License</A><BR class="atl-forced-newline">
+<A href="contributing.html" title="Contributing">Contributing</A><BR class="atl-forced-newline">
+<A href="news.html" title="News">News</A><BR class="atl-forced-newline">
+<A href="links.html" title="Links">Links</A><BR class="atl-forced-newline">
+<A href="project-information.html" title="Project Information">Project Information</A><BR class="atl-forced-newline">
+<A href="https://issues.apache.org/jira/browse/SLING" class="external-link" rel="nofollow">Issue Tracker</A><BR class="atl-forced-newline">
+<A href="http://svn.apache.org/viewvc/sling/trunk" class="external-link" rel="nofollow">Browse Source Repository</A><BR class="atl-forced-newline">
+<A href="security.html" title="Security">Security</A><BR class="atl-forced-newline"></P>
+
+<P><B>Sponsorship</B><BR class="atl-forced-newline">
+<A href="http://www.apache.org/foundation/thanks.html" class="external-link" rel="nofollow">Thanks</A><BR class="atl-forced-newline">
+<A href="http://www.apache.org/foundation/sponsorship.html" class="external-link" rel="nofollow">Become a Sponsor</A><BR>
+<A href="http://www.apache.org/foundation/buy_stuff.html" class="external-link" rel="nofollow">Buy Stuff</A></P>
+
+
+  <IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
+  <P style="height: 135px"></P>
+    </DIV>
+    <DIV class="main">
+        <DIV class="breadcrump" style="font-size: 80%;">
+<A href="apache-sling.html" title="Apache Sling Website">Apache Sling Website</A>&nbsp;&gt;&nbsp;<A href="apache-sling.html" title="Apache Sling">Apache Sling</A>&nbsp;&gt;&nbsp;<A href="documentation.html" title="Documentation">Documentation</A>&nbsp;&gt;&nbsp;<A href="bundles.html" title="Bundles">Bundles</A>&nbsp;&gt;&nbsp;<A href="" title="MIME Type Support (commons.mime)">MIME Type Support (commons.mime)</A>
+        </DIV>
+<H1><A name="MIMETypeSupport%28commons.mime%29-MIMETypeSupport"></A>MIME Type Support</H1>
+
+<P>Support for MIME type mappings is generally a problematic issue. On the one hand applications have to take care to stay up to date with their mappings on the other hands in web applications it is tedious to maintain the mappings. Apache Sling takes a very user and deployment friendly approadch to this problem which is described in detail on this page.</P>
+
+
+<DIV>
+<UL>
+    <LI><A href="#MIMETypeSupport%2528commons.mime%2529-ServletAPISupport">Servlet API Support</A></LI>
+    <LI><A href="#MIMETypeSupport%2528commons.mime%2529-EnterSling%253ATheMimeTypeService">Enter Sling: The MimeTypeService</A></LI>
+    <LI><A href="#MIMETypeSupport%2528commons.mime%2529-AndMore...">And More...</A></LI>
+    <LI><A href="#MIMETypeSupport%2528commons.mime%2529-ConfiguringMIMETypeMappings">Configuring MIME Type Mappings</A></LI>
+    <LI><A href="#MIMETypeSupport%2528commons.mime%2529-MIMETypeMappingFileFormat">MIME Type Mapping File Format</A></LI>
+    <LI><A href="#MIMETypeSupport%2528commons.mime%2529-WebConsolePlugin">Web Console Plugin</A></LI>
+</UL></DIV>
+
+
+<H2><A name="MIMETypeSupport%28commons.mime%29-ServletAPISupport"></A>Servlet API Support</H2>
+
+<P>The Servlet API specification provides a limited support for MIME type mappings :</P>
+
+<UL>
+	<LI>Mappings may be defined in the <TT>mime-mapping</TT> elements of the the web application descriptor <TT>web.xml</TT>. Managing these mappings is presumably tedious. So servlet containers may provide reasonable defaults (or not).</LI>
+	<LI>The <TT>ServletContext.getMimeType(String)</TT> returns a MIME type for a given file name based on the extension of the filename. The mapping returned is based on the servlet container configuration as well as the web application descriptor's <TT>mime-mapping</TT> elements.</LI>
+</UL>
+
+
+
+<H2><A name="MIMETypeSupport%28commons.mime%29-EnterSling%3ATheMimeTypeService"></A>Enter Sling: The MimeTypeService</H2>
+
+<P>Already at the start of the Sling project we realized, that just basing the MIME type mapping decisions on the servlet container will not yield acceptable results. For this reason the Apache Sling projects provides a spezialized and configurable service supporting such mappings: The <A href="http://incubator.apache.org/sling/apidocs/sling5/org/apache/sling/commons/mime/MimeTypeService.html" class="external-link" rel="nofollow"><TT>MimeTypeService</TT></A>.</P>
+
+<P>This service provides access to registered MIME types and their mappings with two methods:</P>
+
+<UL>
+	<LI><TT>getExtension(String)</TT> &ndash; given a MIME type this methods returns a primary extension. For example for the type <TT>text/plain</TT> this method will return <TT>txt</TT></LI>
+	<LI><TT>getMimeType(String)</TT> &ndash; given a file name or just the extension) returns the mapped MIME type. For example for the filename <TT>sample.html</TT> (or just the extension <TT>html</TT>) this method will return <TT>text/html</TT></LI>
+</UL>
+
+
+
+<P>Two more method allow to programmatically add MIME type mappings:</P>
+
+<UL>
+	<LI><TT>registerMimeType(InputStream)</TT> registers additional mappings from the given input stream which is expected to be formated in traditional <TT>mime.types</TT> file format (see below).</LI>
+	<LI><TT>registerMimeType(String, String...)</TT> registers a single mapping for the give MIME type and the respective extensions.</LI>
+</UL>
+
+
+
+
+<H2><A name="MIMETypeSupport%28commons.mime%29-AndMore..."></A>And More...</H2>
+
+<P>Besides the <TT>MimeTypeService</TT> provided by Apache Sling, there is actually more:</P>
+
+<UL>
+	<LI>The <A href="http://incubator.apache.org/sling/apidocs/sling5/org/apache/sling/api/SlingHttpServletRequest.html" class="external-link" rel="nofollow"><TT>SlingHttpServletRequest</TT></A> provides the <TT>getResponseContentType()</TT> method, which returns the preferred <EM>Content-Type</EM> for the response based on the requests extension. This method is implemented by Apache Sling using the <TT>MimeTypeService</TT>. So servlets and scripts may just call this method to set the content type of the response to the desired value.</LI>
+	<LI>Each Servlet (and JSP scripts) is initialized by Apache Sling with a <TT>ServletContext</TT> instance whose implementation of the <TT>getMimeType(String)</TT> effectively calls the <TT>MimeTypeService.getMimeType(String)</TT> method.</LI>
+	<LI>The Scripting support infrastructure of Sling sets the response content type on behalf of the script to the default value as returned by the <TT>SlingHttpServletRequest.getResponseContentType()</TT> method. At the same time the response character set is also set to <TT>UTF-8</TT> for <EM>text</EM> content types.</LI>
+</UL>
+
+
+
+
+<H2><A name="MIMETypeSupport%28commons.mime%29-ConfiguringMIMETypeMappings"></A>Configuring MIME Type Mappings</H2>
+
+
+<P>The implementation of the <TT>MimeTypeService</TT> in the Apache Sling MIME type mapping support (<TT>org.apache.sling.commons.mime</TT>) bundle supports a numnber of ways to configure and extend the set of MIME type mappings:</P>
+
+<UL>
+	<LI>Default configuration. The default configuration is based on the <A href="http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types" class="external-link" rel="nofollow"><TT>mime.types</TT></A> file maintained by Roy Fielding for the Apache httpd project and some extensions by Apache Sling.</LI>
+	<LI>Bundle provided mappings. Bundles registered in the OSGi framework may contain MIME type mappings files <TT>META-INF/mime.types</TT> which are loaded automatically by the Apache Sling MIME type mapping support bundle.</LI>
+	<LI>Configuration. Mappings may be supplied by configuration of the <TT>MimeTypeService</TT> implementation as the multi-value string property <TT>mime.types</TT>. Each value of the property corresponds to a line in a MIME type configuration file (see below for the format).</LI>
+	<LI>Registered Mappings. Mappings may be registered with the <TT>MimeTypeService.registerMapping</TT> methods.</LI>
+	<LI><A href="http://incubator.apache.org/sling/apidocs/sling5/org/apache/sling/commons/mime/MimeTypeProvider.html" class="external-link" rel="nofollow"><TT>MimeTypeProvider</TT></A>. Additional mappings may be provided by service implementing the <TT>MimeTypeProvider</TT> interface. The <TT>MimeTypeService</TT> implementation will call these services in turn until a service returns a mapping provided there is no static configuration to responde to the mapping request.</LI>
+</UL>
+
+
+<P>Please note, that existing mappings cannot be overwritten later. Thus mappings have an inherent priority:</P>
+
+<OL>
+	<LI>Mappings provided by the Apache httpd project's <TT>mime.types</TT> file</LI>
+	<LI>Extensions by the Apache Sling MIME type mapping support bundle</LI>
+	<LI>Bundles providing a <TT>META-INF/mime.types</TT> file in the order of their bundle-id (or startup order if started after the MIME type mapping support bundle)</LI>
+	<LI>OSGi Configuration. Note that bundles started <EM>after</EM> the MIME type mapping support bundle may not overwrite mappings provided by the OSGi configuration. This may sounds like a problem, but in reality this should genrally not matter</LI>
+	<LI>Mappings registered calling the <TT>MimeTypeService.registerMimeType</TT> method</LI>
+	<LI>Mappings provided by <TT>MimeTypeProvider</TT> services</LI>
+</OL>
+
+
+
+
+<H2><A name="MIMETypeSupport%28commons.mime%29-MIMETypeMappingFileFormat"></A>MIME Type Mapping File Format</H2>
+
+<P>The file format for MIME type mapping files is rather simple:</P>
+
+<UL>
+	<LI>The files are assumed to be encoded with the <EM>ISO-8859-1</EM> (aka Latin 1) character encoding</LI>
+	<LI>The files consist of lines defining mappings where each line is terminated with either or both of a carriage return (CR, 0x0c) and line feed character (LF, 0x0a). There is no line continuation support &agrave;-la shell scripts or Java properties files.</LI>
+	<LI>Empty lines and lines starting with a hash sign (<TT>#</TT>) are ignored</LI>
+	<LI>Data lines consist of space (any whitespace matching the <TT>\s</TT> regular expression) separated values. The first value is the MIME type name and the remaining values defining mappings to file name extensions. The first listed file name extension is considered the <EM>default mapping</EM> and is returned by the <TT>MimeTypeService.getExtension(String)</TT> method. Entry lines consisting of just a mime type but no extensions are also (currently) ignored.</LI>
+</UL>
+
+
+<P>THe data line format described here also applies to configuration provided by the values of the <TT>mime.types</TT> property of the MIME type service configuration. The file format description applies to all <TT>META-INF/mime.types</TT> files provided by the bundles as well as input streams supplied to the <TT>MimeTypeService.registerMimeType(InputStream)</TT> method.</P>
+
+
+
+<H2><A name="MIMETypeSupport%28commons.mime%29-WebConsolePlugin"></A>Web Console Plugin</H2>
+
+<P>The Apache Sling MIME type mapping support bundle implements a plugin for the Apache Felix Web Console which may be consulted to investigate the current contents of the MIME type mapping tables.</P>
+
+<P><SPAN class="image-wrap" style=""><A class="confluence-thumbnail-link 958x621" href="mime-type-support-commonsmime.data/mimetypes.png"><IMG src="mime-type-support-commonsmime.data/mimetypes.png.jpeg" title="Sample MIME types console page" style="border: 0px solid black"></A></SPAN></P>
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by mykee on 2009-06-01 07:13:30.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/mime-type-support.data/mimetypes.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/sling/trunk/content/site/mime-type-support.data/mimetypes.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/sling/trunk/content/site/mime-type-support.data/mimetypes.png.jpeg
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/sling/trunk/content/site/mime-type-support.data/mimetypes.png.jpeg
------------------------------------------------------------------------------
    svn:mime-type = image/jpeg

Added: websites/staging/sling/trunk/content/site/mime-type-support.html
==============================================================================
--- websites/staging/sling/trunk/content/site/mime-type-support.html (added)
+++ websites/staging/sling/trunk/content/site/mime-type-support.html Wed Dec 12 09:16:44 2012
@@ -0,0 +1,167 @@
+
+<!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 - MIME Type Support</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">
+                                    <P style="display: none"></P>
+
+<UL>
+	<LI><A href="documentation.html" title="Documentation">Documentation</A></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><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>
+	<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="project-information.html" title="Project Information">Project Information</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://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>
+
+<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: 100px"></P>
+</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="advanced-topics.html" title="Advanced Topics">Advanced Topics</A>&nbsp;&gt;&nbsp;<A href="" title="MIME Type Support">MIME Type Support</A>
+        </DIV>
+<H1><A name="MIMETypeSupport-MIMETypeSupport"></A>MIME Type Support</H1>
+
+<P>Support for MIME type mappings is generally a problematic issue. On the one hand applications have to take care to stay up to date with their mappings on the other hands in web applications it is tedious to maintain the mappings. Apache Sling takes a very user and deployment friendly approadch to this problem which is described in detail on this page.</P>
+
+
+<DIV>
+<UL>
+  <LI><A href="#MIMETypeSupport-ServletAPISupport">Servlet API Support</A></LI>
+  <LI><A href="#MIMETypeSupport-EnterSling%253ATheMimeTypeService">Enter Sling: The MimeTypeService</A></LI>
+  <LI><A href="#MIMETypeSupport-AndMore...">And More...</A></LI>
+  <LI><A href="#MIMETypeSupport-ConfiguringMIMETypeMappings">Configuring MIME Type Mappings</A></LI>
+  <LI><A href="#MIMETypeSupport-MIMETypeMappingFileFormat">MIME Type Mapping File Format</A></LI>
+  <LI><A href="#MIMETypeSupport-WebConsolePlugin">Web Console Plugin</A></LI>
+</UL></DIV>
+
+
+<H2><A name="MIMETypeSupport-ServletAPISupport"></A>Servlet API Support</H2>
+
+<P>The Servlet API specification provides a limited support for MIME type mappings :</P>
+
+<UL>
+	<LI>Mappings may be defined in the <TT>mime-mapping</TT> elements of the the web application descriptor <TT>web.xml</TT>. Managing these mappings is presumably tedious. So servlet containers may provide reasonable defaults (or not).</LI>
+	<LI>The <TT>ServletContext.getMimeType(String)</TT> returns a MIME type for a given file name based on the extension of the filename. The mapping returned is based on the servlet container configuration as well as the web application descriptor's <TT>mime-mapping</TT> elements.</LI>
+</UL>
+
+
+
+<H2><A name="MIMETypeSupport-EnterSling%3ATheMimeTypeService"></A>Enter Sling: The MimeTypeService</H2>
+
+<P>Already at the start of the Sling project we realized, that just basing the MIME type mapping decisions on the servlet container will not yield acceptable results. For this reason the Apache Sling projects provides a spezialized and configurable service supporting such mappings: The <SPAN class="nobr"><A href="http://incubator.apache.org/sling/apidocs/sling5/org/apache/sling/commons/mime/MimeTypeService.html" title="Visit page outside Confluence" rel="nofollow"><TT>MimeTypeService</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>.</P>
+
+<P>This service provides access to registered MIME types and their mappings with two methods:</P>
+
+<UL>
+	<LI><TT>getExtension(String)</TT> &ndash; given a MIME type this methods returns a primary extension. For example for the type <TT>text/plain</TT> this method will return <TT>txt</TT></LI>
+	<LI><TT>getMimeType(String)</TT> &ndash; given a file name or just the extension) returns the mapped MIME type. For example for the filename <TT>sample.html</TT> (or just the extension <TT>html</TT>) this method will return <TT>text/html</TT></LI>
+</UL>
+
+
+
+<P>Two more method allow to programmatically add MIME type mappings:</P>
+
+<UL>
+	<LI><TT>registerMimeType(InputStream)</TT> registers additional mappings from the given input stream which is expected to be formated in traditional <TT>mime.types</TT> file format (see below).</LI>
+	<LI><TT>registerMimeType(String, String...)</TT> registers a single mapping for the give MIME type and the respective extensions.</LI>
+</UL>
+
+
+
+
+<H2><A name="MIMETypeSupport-AndMore..."></A>And More...</H2>
+
+<P>Besides the <TT>MimeTypeService</TT> provided by Apache Sling, there is actually more:</P>
+
+<UL>
+	<LI>The <SPAN class="nobr"><A href="http://incubator.apache.org/sling/apidocs/sling5/org/apache/sling/api/SlingHttpServletRequest.html" title="Visit page outside Confluence" rel="nofollow"><TT>SlingHttpServletRequest</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> provides the <TT>getResponseContentType()</TT> method, which returns the preferred <EM>Content-Type</EM> for the response based on the requests extension. This method is implemented by Apache Sling using the <TT>MimeTypeService</TT>. So servlets and scripts may just call this method to set the content type of the response to the desired value.</LI>
+	<LI>Each Servlet (and JSP scripts) is initialized by Apache Sling with a <TT>ServletContext</TT> instance whose implementation of the <TT>getMimeType(String)</TT> effectively calls the <TT>MimeTypeService.getMimeType(String)</TT> method.</LI>
+	<LI>The Scripting support infrastructure of Sling sets the response content type on behalf of the script to the default value as returned by the <TT>SlingHttpServletRequest.getResponseContentType()</TT> method. At the same time the response character set is also set to <TT>UTF-8</TT> for <EM>text</EM> content types.</LI>
+</UL>
+
+
+
+
+<H2><A name="MIMETypeSupport-ConfiguringMIMETypeMappings"></A>Configuring MIME Type Mappings</H2>
+
+
+<P>The implementation of the <TT>MimeTypeService</TT> in the Apache Sling MIME type mapping support (<TT>org.apache.sling.commons.mime</TT>) bundle supports a numnber of ways to configure and extend the set of MIME type mappings:</P>
+
+<UL>
+	<LI>Default configuration. The default configuration is based on the <SPAN class="nobr"><A href="http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types" title="Visit page outside Confluence" rel="nofollow"><TT>mime.types</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> file maintained by Roy Fielding for the Apache httpd project and some extensions by Apache Sling.</LI>
+	<LI>Bundle provided mappings. Bundles registered in the OSGi framework may contain MIME type mappings files <TT>META-INF/mime.types</TT> which are loaded automatically by the Apache Sling MIME type mapping support bundle.</LI>
+	<LI>Configuration. Mappings may be supplied by configuration of the <TT>MimeTypeService</TT> implementation as the multi-value string property <TT>mime.types</TT>. Each value of the property corresponds to a line in a MIME type configuration file (see below for the format).</LI>
+	<LI>Registered Mappings. Mappings may be registered with the <TT>MimeTypeService.registerMapping</TT> methods.</LI>
+	<LI><SPAN class="nobr"><A href="http://incubator.apache.org/sling/apidocs/sling5/org/apache/sling/commons/mime/MimeTypeProvider.html" title="Visit page outside Confluence" rel="nofollow"><TT>MimeTypeProvider</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>. Additional mappings may be provided by service implementing the <TT>MimeTypeProvider</TT> interface. The <TT>MimeTypeService</TT> implementation will call these services in turn until a service returns a mapping provided there is no static configuration to responde to the mapping request.</LI>
+</UL>
+
+
+<P>Please note, that existing mappings cannot be overwritten later. Thus mappings have an inherent priority:</P>
+
+<OL>
+	<LI>Mappings provided by the Apache httpd project's <TT>mime.types</TT> file</LI>
+	<LI>Extensions by the Apache Sling MIME type mapping support bundle</LI>
+	<LI>Bundles providing a <TT>META-INF/mime.types</TT> file in the order of their bundle-id (or startup order if started after the MIME type mapping support bundle)</LI>
+	<LI>OSGi Configuration. Note that bundles started <EM>after</EM> the MIME type mapping support bundle may not overwrite mappings provided by the OSGi configuration. This may sounds like a problem, but in reality this should genrally not matter</LI>
+	<LI>Mappings registered calling the <TT>MimeTypeService.registerMimeType</TT> method</LI>
+	<LI>Mappings provided by <TT>MimeTypeProvider</TT> services</LI>
+</OL>
+
+
+
+
+<H2><A name="MIMETypeSupport-MIMETypeMappingFileFormat"></A>MIME Type Mapping File Format</H2>
+
+<P>The file format for MIME type mapping files is rather simple:</P>
+
+<UL>
+	<LI>The files are assumed to be encoded with the <EM>ISO-8859-1</EM> (aka Latin 1) character encoding</LI>
+	<LI>The files consist of lines defining mappings where each line is terminated with either or both of a carriage return (CR, 0x0c) and line feed character (LF, 0x0a). There is no line continuation support &agrave;-la shell scripts or Java properties files.</LI>
+	<LI>Empty lines and lines starting with a hash sign (<TT>#</TT>) are ignored</LI>
+	<LI>Data lines consist of space (any whitespace matching the <TT>\s</TT> regular expression) separated values. The first value is the MIME type name and the remaining values defining mappings to file name extensions. The first listed file name extension is considered the <EM>default mapping</EM> and is returned by the <TT>MimeTypeService.getExtension(String)</TT> method. Entry lines consisting of just a mime type but no extensions are also (currently) ignored.</LI>
+</UL>
+
+
+<P>THe data line format described here also applies to configuration provided by the values of the <TT>mime.types</TT> property of the MIME type service configuration. The file format description applies to all <TT>META-INF/mime.types</TT> files provided by the bundles as well as input streams supplied to the <TT>MimeTypeService.registerMimeType(InputStream)</TT> method.</P>
+
+
+
+<H2><A name="MIMETypeSupport-WebConsolePlugin"></A>Web Console Plugin</H2>
+
+<P>The Apache Sling MIME type mapping support bundle implements a plugin for the Apache Felix Web Console which may be consulted to investigate the current contents of the MIME type mapping tables.</P>
+
+<P><A href="mime-type-support.data/mimetypes.png" target="mimetypes.png" onclick="window.open(&quot;http://cwiki.apache.org/confluence/download/attachments/117870/mimetypes.png&quot;, &quot;mimetypes.png&quot;, &quot;height=641,width=978,menubar=no,status=no,toolbar=no&quot;); return false;"><IMG src="mime-type-support.data/mimetypes.png.jpeg" title="Sample MIME types console page" align="absmiddle" border="0"></A></P>
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by fmeschbe on Mon May 18 00:26:02 PDT 2009
+        </DIV>
+    </DIV>
+  </BODY>
+</HTML>
+