You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2012/12/12 10:14:44 UTC

svn commit: r1420577 [19/30] - in /sling/site/trunk/content/site: ./ 46-line-blog.data/ authentication.data/ documentation.data/ first-steps.data/ getting-and-building-sling.data/ how-to-manage-events-in-sling.data/ index.data/ links.data/ manipulating...

Added: sling/site/trunk/content/site/mime-type-support-commonsmime.html
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/mime-type-support-commonsmime.html?rev=1420577&view=auto
==============================================================================
--- sling/site/trunk/content/site/mime-type-support-commonsmime.html (added)
+++ sling/site/trunk/content/site/mime-type-support-commonsmime.html Wed Dec 12 09:13:50 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>
+

Propchange: sling/site/trunk/content/site/mime-type-support-commonsmime.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/site/trunk/content/site/mime-type-support-commonsmime.html
------------------------------------------------------------------------------
    svn:keywords = Id

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

Added: sling/site/trunk/content/site/mime-type-support.data/mimetypes.png
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/mime-type-support.data/mimetypes.png?rev=1420577&view=auto
==============================================================================
Binary file - no diff available.

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

Added: sling/site/trunk/content/site/mime-type-support.data/mimetypes.png.jpeg
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/mime-type-support.data/mimetypes.png.jpeg?rev=1420577&view=auto
==============================================================================
Binary file - no diff available.

Propchange: sling/site/trunk/content/site/mime-type-support.data/mimetypes.png.jpeg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: sling/site/trunk/content/site/mime-type-support.html
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/mime-type-support.html?rev=1420577&view=auto
==============================================================================
--- sling/site/trunk/content/site/mime-type-support.html (added)
+++ sling/site/trunk/content/site/mime-type-support.html Wed Dec 12 09:13:50 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>
+

Propchange: sling/site/trunk/content/site/mime-type-support.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/site/trunk/content/site/mime-type-support.html
------------------------------------------------------------------------------
    svn:keywords = Id

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

Added: sling/site/trunk/content/site/modifying-content-the-slingpostservlet.html
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/modifying-content-the-slingpostservlet.html?rev=1420577&view=auto
==============================================================================
--- sling/site/trunk/content/site/modifying-content-the-slingpostservlet.html (added)
+++ sling/site/trunk/content/site/modifying-content-the-slingpostservlet.html Wed Dec 12 09:13:50 2012
@@ -0,0 +1,411 @@
+
+<!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 - Modifying Content - The SlingPostServlet</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>
+
+<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><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://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">
+</LI>
+</UL>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    </DIV>
+    <DIV class="main">
+<H1><A name="ModifyingContent-TheSlingPostServlet-ModifyingContent%3ATheSlingPostServlet"></A>Modifying Content: The SlingPostServlet</H1>
+
+<TABLE cellpadding="5" width="85%" cellspacing="8px" class="noteMacro" border="0" align="center"><COLGROUP><COL width="24"><COL></COLGROUP><TR><TD valign="top"><IMG src="http://cwiki.apache.org/confluence/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></TD><TD><B class="strong">Work In Progress</B><BR>
+<P>This page is work in progress to explain how the SlingPostServlet works after the refactoring as per <SPAN class="nobr"><A href="https://issues.apache.org/jira/browse/SLING-422" title="Visit page outside Confluence" rel="nofollow">SLING-422<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>Please also note, that the contents of this page reflects the status of the SlingPostServlet after implementing SLING-422 and does not yet reflect the updates implicated by <SPAN class="nobr"><A href="https://issues.apache.org/jira/browse/SLING-394" title="Visit page outside Confluence" rel="nofollow">SLING-394<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN> and <SPAN class="nobr"><A href="https://issues.apache.org/jira/browse/SLING-458" title="Visit page outside Confluence" rel="nofollow">SLING-458<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></TD></TR></TABLE>
+
+
+<DIV>
+<UL>
+  <LI><A href="#ModifyingContent-TheSlingPostServlet-MultipleWaystoModifyContent">Multiple Ways to Modify Content</A></LI>
+  <LI><A href="#ModifyingContent-TheSlingPostServlet-Quickstart%253ACreatingContent">Quickstart: Creating Content</A></LI>
+  <LI><A href="#ModifyingContent-TheSlingPostServlet-SlingPostServletOperations">SlingPostServlet Operations</A></LI>
+  <LI><A href="#ModifyingContent-TheSlingPostServlet-SpecialParameters">Special Parameters</A></LI>
+</UL></DIV>
+
+
+
+<H2><A name="ModifyingContent-TheSlingPostServlet-MultipleWaystoModifyContent"></A>Multiple Ways to Modify Content</H2>
+
+<P>As always in life there is more than one way to do it. So to modify content in a JCR repository underlying Sling, you have multiple options, two of which are WebDAV and the Sling default POST Servlet also called the <EM>SlingPostServlet</EM>. This page is about how you can modify - create, modify, copy, move, delete - content through the <EM>SlingPostServlet</EM>. In addition it also explains how to extend the SlingPostServlet with new operations.</P>
+
+
+<P>What is Content anyway ? In the following discussion, I use the terms <EM>Content</EM> and <EM>Item</EM> interchangeably. With <EM>Content</EM> I just mean some data to be stored in the JCR repository to be later used as the basis for some presentation. In this sense <EM>Content</EM> is a rather conceptual term. <EM>Item</EM> is the name of the parent interface of the JCR <EM>Node</EM> and <EM>Property</EM> interfaces. When speaking of <EM>Items</EM> we mean some actual data stored in the repository ignoring whether the data is actually stored as a <EM>Node</EM> with child nodes and properties or just a single <EM>Property</EM>.</P>
+
+
+<H2><A name="ModifyingContent-TheSlingPostServlet-Quickstart%3ACreatingContent"></A>Quickstart: Creating Content</H2>
+
+<P>To create content you simply send an HTTP request using the path of the node to store the content in and include the actual content as request parameters. So one possibility to do just that is by having an HTML Form like the following:</P>
+
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">&lt;form method=<SPAN class="code-quote">&quot;POST&quot;</SPAN> action=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//host/some/<SPAN class="code-keyword">new</SPAN>/content&quot;</SPAN> &gt;
+</SPAN>   &lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;title&quot;</SPAN> value=&quot;&quot; /&gt;
+   &lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;text&quot;</SPAN> value=&quot;&quot; /&gt;
+&lt;/form&gt;</PRE>
+</DIV></DIV>
+
+
+<P>This simple form will set the <TT>title</TT> and <TT>text</TT> properties on a node at <TT>/some/new/content</TT>. If this node does not exist it is just created otherwise the existing content would be modified.</P>
+
+<P>Similarly you can do this using the <TT>curl</TT> command line tool:</P>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">$ curl -Ftitle=<SPAN class="code-quote">&quot;some title text&quot;</SPAN> -Ftext=<SPAN class="code-quote">&quot;some body text content&quot;</SPAN> http:<SPAN class="code-comment">//host/some/<SPAN class="code-keyword">new</SPAN>/content</SPAN></PRE>
+</DIV></DIV>
+
+
+<P>You might want to use a specific JCR node type for a newly created node. This is possibly by simply setting a <TT>jcr:primaryType</TT> property on the request, e.g.</P>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">$ curl -F<SPAN class="code-quote">&quot;jcr:primaryType=nt:unstructured&quot;</SPAN> -Ftitle=<SPAN class="code-quote">&quot;some title text&quot;</SPAN> -Ftext=<SPAN class="code-quote">&quot;some body text content&quot;</SPAN> http:<SPAN class="code-comment">//host/some/<SPAN class="code-keyword">new</SPAN>/content</SPAN></PRE>
+</DIV></DIV>
+
+<P>Similary you may assing JCR mixin node types using the <TT>jcr:mixinTypes</TT> property and a Sling resource type using the <TT>sling:resourceType</TT> property. For example:</P>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">$ curl -F<SPAN class="code-quote">&quot;sling:resourceType=sling:sample&quot;</SPAN> -Ftitle=<SPAN class="code-quote">&quot;some title text&quot;</SPAN> -Ftext=<SPAN class="code-quote">&quot;some body text content&quot;</SPAN> http:<SPAN class="code-comment">//host/some/<SPAN class="code-keyword">new</SPAN>/content</SPAN></PRE>
+</DIV></DIV>
+
+
+
+
+<H2><A name="ModifyingContent-TheSlingPostServlet-SlingPostServletOperations"></A>SlingPostServlet Operations</H2>
+
+
+<P>The SlingPostServlet is actually just a frontend to the actual operations. To select the actual operation to execute, the <TT>:operation</TT> request parameter is used. Out of the box, the SlingPostServlet supports the following operations:</P>
+
+<UL>
+	<LI>property not set or empty &ndash; Create new content or modify existing content</LI>
+	<LI><TT>delete</TT> &ndash; Remove existing content</LI>
+	<LI><TT>move</TT> &ndash; Move existing content to a new location</LI>
+	<LI><TT>copy</TT> &ndash; Copy existing content to a new location</LI>
+</UL>
+
+
+<P>All these operations always operate on the resource of the request as returned by <TT>SlingHttpServletRequest.getResource()</TT>. Some operations require additional parameters to be set to operate completely.</P>
+
+
+<H3><A name="ModifyingContent-TheSlingPostServlet-ContentCreationorModification"></A>Content Creation or Modification</H3>
+
+
+<P>The simplest and most common use case, probably, is content creation and modification. We already saw an example above in the quickstart section. In this section we elaborate more on the concrete stuff.</P>
+
+<P>First, the request URL indicates the actual repository node to be handled. If the URL addresses an existing node, the request parameters just provide values for the properties to be set on the existing node.</P>
+
+<P>If the resource of the request is a synthetic resource, e.g. <TT>NonExistingResource</TT> or <TT>StarResource</TT>, a new item is created. The path (including name) of the item to be created is derived from the resource path:</P>
+
+<UL>
+	<LI>If the resource path ends with a <TT>/*</TT> or <TT>/</TT> the name of the item is automatically created using a name creation algorithm taking into account various request parameters.</LI>
+	<LI>Otherwise the resource path is used as the path and name of the new item.</LI>
+</UL>
+
+
+<P>In both cases the path may still include selectors and extensions, which are cut off the path before finding out, what to do.</P>
+
+<P>To illustrate this algorithm, lets look at some examples:</P>
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Resource Path </TH>
+<TH class="confluenceTh"> Item path </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/new</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/new</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/new.html</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/new</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/new.print.a4.html</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/new</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/xxx</TT> where <TT>xxx</TT> is a generated name </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/*</TT></TD>
+<TD class="confluenceTd"> <TT>/content/xxx</TT> where <TT>xxx</TT> is a generated name </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/*.html</TT></TD>
+<TD class="confluenceTd"> <TT>/content/xxx</TT> where <TT>xxx</TT> is a generated name </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/*.print.a4.html</TT></TD>
+<TD class="confluenceTd"> <TT>/content/xxx</TT> where <TT>xxx</TT> is a generated name </TD>
+</TR>
+</TBODY></TABLE>
+
+
+
+<P>TDB: How parameters are used to define content to be stored.</P>
+
+
+
+<H4><A name="ModifyingContent-TheSlingPostServlet-ResponseStatus"></A>Response Status</H4>
+
+<P>The delete operation has the following status responses:</P>
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Explanation </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> 200/OK </TD>
+<TD class="confluenceTd"> An existing node has been updated with content </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 201/CREATED </TD>
+<TD class="confluenceTd"> A new node has been created and filled with content </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 500/INTERNAL SERVER ERROR </TD>
+<TD class="confluenceTd"> Some exception, for example a <TT>RepositoryException</TT>, occurred while processing the request </TD>
+</TR>
+</TBODY></TABLE>
+
+
+<H3><A name="ModifyingContent-TheSlingPostServlet-ContentRemoval"></A>Content Removal</H3>
+
+<P>To remove existing content just address the item to be removed and set the <TT>:operation</TT> parameter to <TT>delete</TT>. For example the following command line removes the <TT>/content/sample</TT> page:</P>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">$ curl -F<SPAN class="code-quote">&quot;:operation=delete&quot;</SPAN> http:<SPAN class="code-comment">//host/content/sample</SPAN></PRE>
+</DIV></DIV>
+
+
+<H4><A name="ModifyingContent-TheSlingPostServlet-ResponseStatus"></A>Response Status</H4>
+
+<P>The delete operation has the following status responses:</P>
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Explanation </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> 200/OK </TD>
+<TD class="confluenceTd"> The resource (and all its descendents) has been removed </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 404/NOT FOUND </TD>
+<TD class="confluenceTd"> The request URL does not address an existing repository item </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 500/INTERNAL SERVER ERROR </TD>
+<TD class="confluenceTd"> Some exception, for example a <TT>RepositoryException</TT>, occurred while processing the request </TD>
+</TR>
+</TBODY></TABLE>
+
+
+<H3><A name="ModifyingContent-TheSlingPostServlet-CopyingContent"></A>Copying Content</H3>
+
+
+<P>To copy existing content to a new location, the <TT>copy</TT> operation is specified. This operation copies the item addressed by the request URL to a new location indicated by the <TT>:dest</TT> parameter. The <TT>:dest</TT> parameter is the absolute or relative path to which the resource is copied. If the path is relative it is assumed to be below the same parent as the request resource. If it is terminated with a <TT>/</TT> character the request resource is copied to an item of the same name under the destination path.</P>
+
+<P>To illustrate the <TT>:dest</TT> parameter handling, lets look at a few examples. All examples are based on addressing the <TT>/content/sample</TT> item:</P>
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> <TT>:dest</TT> Parameter </TH>
+<TH class="confluenceTh"> Destination Absolute Path </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/newSample</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/newSample</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>different/newSample</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/different/newSample</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/different/</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/different/sample</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>different/</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/different/sample</TT> </TD>
+</TR>
+</TBODY></TABLE>
+
+
+<P>If an item already exists at the location derived from the <TT>:dest</TT> parameter, the copy operation fails unless the <TT>:replace</TT> parameter is set to <TT>true</TT> (case is ignored when checking the parameter value).</P>
+
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Explanation </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> 200/OK </TD>
+<TD class="confluenceTd"> The node has been copied to the new location replacing an existing item at the destination </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 201/CREATED </TD>
+<TD class="confluenceTd"> The node has been copied to the new location creating a new item at the destination </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 412/PRECONDITION FAILED </TD>
+<TD class="confluenceTd"> An item already exists at the destination and the <TT>:replace</TT> parameter is not set to <TT>true</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 500/INTERNAL SERVER ERROR </TD>
+<TD class="confluenceTd"> Some exception, for example a <TT>RepositoryException</TT>, occurred while processing the request </TD>
+</TR>
+</TBODY></TABLE>
+
+
+
+
+<H3><A name="ModifyingContent-TheSlingPostServlet-MovingContent"></A>Moving Content</H3>
+
+
+<P>To move existing content to a new location, the <TT>move</TT> operation is specified. This operation moves the item addressed by the request URL to a new location indicated by the <TT>:dest</TT> parameter. The <TT>:dest</TT> parameter is the absolute or relative path to which the resource is moved. If the path is relative it is assumed to be below the same parent as the request resource. If it is terminated with a <TT>/</TT> character the request resource is moved to an item of the same name under the destination path.</P>
+
+<P>To illustrate the <TT>:dest</TT> parameter handling, lets look at a few examples. All examples are based on addressing the <TT>/content/sample</TT> item:</P>
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> <TT>:dest</TT> Parameter </TH>
+<TH class="confluenceTh"> Destination Absolute Path </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/newSample</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/newSample</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>different/newSample</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/different/newSample</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/different/</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/different/sample</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>different/</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/different/sample</TT> </TD>
+</TR>
+</TBODY></TABLE>
+
+
+<P>If an item already exists at the location derived from the <TT>:dest</TT> parameter, the move operation fails unless the <TT>:replace</TT> parameter is set to <TT>true</TT> (case is ignored when checking the parameter value).</P>
+
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Explanation </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> 200/OK </TD>
+<TD class="confluenceTd"> The node has been moved to the new location replacing an existing item at the destination </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 201/CREATED </TD>
+<TD class="confluenceTd"> The node has been moved to the new location creating a new item at the destination </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 412/PRECONDITION FAILED </TD>
+<TD class="confluenceTd"> An item already exists at the destination and the <TT>:replace</TT> parameter is not set to <TT>true</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 500/INTERNAL SERVER ERROR </TD>
+<TD class="confluenceTd"> Some exception, for example a <TT>RepositoryException</TT>, occurred while processing the request </TD>
+</TR>
+</TBODY></TABLE>
+
+
+
+<H2><A name="ModifyingContent-TheSlingPostServlet-SpecialParameters"></A>Special Parameters</H2>
+
+
+<P>Some parameters have special significance for the complete processing of the SlingPostServlet or are used by multiple operations. This section summarizes these parameters:</P>
+
+
+<H3><A name="ModifyingContent-TheSlingPostServlet-%7B%7B%3Aorder%7D%7D"></A><TT>:order</TT></H3>
+
+<P>Child nodes may be ordered if the primary node type of their common parent node is defined as having orderable child nodes. To employ such ordering, the content creation/modification, move and copy operations support the <TT>:order</TT> parameter which apply child node ordering amongst its sibblings of the target node.</P>
+
+<P>The <TT>:order</TT> parameter may have the following values:</P>
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Value </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>first</TT> </TD>
+<TD class="confluenceTd"> Place the target node as the first amongst its sibblings </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>last</TT> </TD>
+<TD class="confluenceTd"> Place the target node as the last amongst its sibblings </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>before <EM>xyz</EM></TT> </TD>
+<TD class="confluenceTd"> Place the target node immediately before the sibbling whose name is <EM>xyz</EM> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>after <EM>xyz</EM></TT> </TD>
+<TD class="confluenceTd"> Place the target node immediately after the sibbling whose name is <EM>xyz</EM> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> numeric </TD>
+<TD class="confluenceTd"> Place the target node at the indicated numeric place amongst its sibblings where <EM>0</EM> is equivalent to <TT>first</TT> and <EM>1</EM> means the second place </TD>
+</TR>
+</TBODY></TABLE>
+
+
+<H3><A name="ModifyingContent-TheSlingPostServlet-%7B%7B%3Aredirect%7D%7D"></A><TT>:redirect</TT></H3>
+
+<P>Instructs the SlingPostServlet to redirect the client to the indicated location if the operation succeeds. That is the reponse status is set to <EM>302/FOUND</EM> and the <TT>Location</TT> header is set to the value of the <TT>:redirect</TT> parameter.</P>
+
+
+<H3><A name="ModifyingContent-TheSlingPostServlet-%7B%7B%3Astatus%7D%7D"></A><TT>:status</TT></H3>
+
+<P>By default the SlingPostServlet sets response status according to the status of the operation executed. In some cases, it may be desirable to not have the real status codes (e.g. 404 or 505) but a normal <EM>200/OK</EM> to trick the client browser into displaying the response content generated by the SlingPostServlet.</P>
+
+<P>To not send the actual response status back to the client, the <TT>:status</TT> request parameter should be set to <TT>browser</TT>. If this parameter is not set, is empty, is set to <TT>standard</TT> or to any other value, the actual status code is sent back to the client.</P>
+    </DIV>
+  </BODY>
+</HTML>
+

Propchange: sling/site/trunk/content/site/modifying-content-the-slingpostservlet.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/site/trunk/content/site/modifying-content-the-slingpostservlet.html
------------------------------------------------------------------------------
    svn:keywords = Id

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

Added: sling/site/trunk/content/site/module-reorganization-proposal.html
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/module-reorganization-proposal.html?rev=1420577&view=auto
==============================================================================
--- sling/site/trunk/content/site/module-reorganization-proposal.html (added)
+++ sling/site/trunk/content/site/module-reorganization-proposal.html Wed Dec 12 09:13:50 2012
@@ -0,0 +1,476 @@
+
+<!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 - Module Reorganization Proposal</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>
+
+<UL>
+	<LI><A href="index.html" title="Index">Home</A></LI>
+	<LI><A href="project-information.html" title="Project Information">Project Information</A></LI>
+	<LI><A href="usecases.html" title="UseCases">Use Cases</A></LI>
+	<LI><A href="guides.html" title="Guides">Guides</A></LI>
+	<LI><A href="documentation.html" title="Documentation">Documentation</A></LI>
+	<LI><A href="plugins.html" title="Plugins">Plugins</A></LI>
+	<LI><A href="faq.html" title="FAQ">FAQ</A></LI>
+	<LI><A href="links.html" title="Links">Links</A></LI>
+	<LI><A href="old-documentation.html" title="Old Documentation">Old Documentation</A></LI>
+	<LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/x/GAUB" 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><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></LI>
+</UL>
+
+
+<P>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </DIV>
+    <DIV class="main">
+<P>In issue SLING-83 Betrand proposes to improve our project layout to make it easier to developers to find their way through the projects making up Sling. On this page, I would like to propose a new structure for further discussion.</P>
+
+<DIV>[ <A href="#ModuleReorganizationProposal-NamingConventions">Naming Conventions</A> ] [ <A href="#ModuleReorganizationProposal-TopLevelProjects">Top Level Projects</A> ] [ <A href="#ModuleReorganizationProposal-SlingCommonsProjects">Sling Commons Projects</A> ] [ <A href="#ModuleReorganizationProposal-JCRRelatedProjects">JCR Related Projects</A> ] [ <A href="#ModuleReorganizationProposal-SlingLauncherProjects">Sling Launcher Projects</A> ] [ <A href="#ModuleReorganizationProposal-MavenPluginProjects">Maven Plugin Projects</A> ] [ <A href="#ModuleReorganizationProposal-microslingProjects">microsling Projects</A> ] [ <A href="#ModuleReorganizationProposal-OSGiProjects">OSGi Projects</A> ] [ <A href="#ModuleReorganizationProposal-ScriptingEngineProjects">Scripting Engine Projects</A> ] [ <A href="#ModuleReorganizationProposal-SlingMainProjects">Sling Main Projects</A> ] [ <A href="#ModuleReorganizationProposal-RemovedandReplacedProjects">Removed and Replaced Projects</A> ]<
 /DIV>
+
+<H2><A name="ModuleReorganizationProposal-NamingConventions"></A>Naming Conventions</H2>
+
+<H3><A name="ModuleReorganizationProposal-Projects"></A>Projects</H3>
+
+<UL>
+	<LI><EM>groupId</EM>: All projects have the same <EM>groupId</EM> <TT>org.apache.sling</TT></LI>
+	<LI><EM>artifactId</EM>: The <EM>artifactId</EM> is fully qualified with the <EM>groupId</EM> plus a name built from the project folder as listed below with slashes <TT>/</TT> and dashes <TT>-</TT> replaced by dots <TT>.</TT>. See below for exceptions.</LI>
+</UL>
+
+
+<P>The final artifact name - <TT>pom.build.finalName</TT> - is the Maven 2 default consisting of the <EM>artifactId</EM> and the <EM>version</EM>. The <TT>Bundle-SymbolicName</TT> is defined in the parent pom as being just the <EM>artifactId</EM>.</P>
+
+<P><B>Exceptions to <EM>artifactId</EM> rule</B></P>
+<UL>
+	<LI>The parent project's <EM>artifactId</EM> is <TT>sling</TT></LI>
+	<LI>The <EM>artifactId</EM> of the projets in the <TT>sling</TT> folder is just the project name without the parent folder <TT>sling</TT>, e.g <TT>core</TT> for the Sling core project.</LI>
+	<LI>The Maven 2 plugin projects in the <TT>maven</TT> folder follow the naming convention for Maven 2 plugins.</LI>
+</UL>
+
+
+
+<H3><A name="ModuleReorganizationProposal-JavaPackages"></A>Java Packages</H3>
+
+<P>Each project consists of a series of Java Packages. To prevent collision between projects with respect to Java Packages, each project has a root Java Package which is the fully qualified Maven 2 project name consisting of the <EM>artifactId</EM> such that the Bundle symbolic name and the root Java Package are the same.</P>
+
+
+<H2><A name="ModuleReorganizationProposal-TopLevelProjects"></A>Top Level Projects</H2>
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Who </TH>
+<TH class="confluenceTh"> Folder </TH>
+<TH class="confluenceTh"> Artifact ID </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>parent</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.sling</TT> </TD>
+<TD class="confluenceTd"> Parent Project </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>api</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.api</TT> </TD>
+<TD class="confluenceTd"> Core API </TD>
+</TR>
+</TBODY></TABLE>
+
+<P>The Sling parent project and the Sling API projects are the only remaining projects at the top level of the repository.</P>
+
+
+<H2><A name="ModuleReorganizationProposal-SlingCommonsProjects"></A>Sling Commons Projects</H2>
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Who </TH>
+<TH class="confluenceTh"> Folder </TH>
+<TH class="confluenceTh"> Artifact ID </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>commons/json</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.commons.json</TT> </TD>
+<TD class="confluenceTd"> JSON support from json.org </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>commons/mime</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.commons.mime</TT> </TD>
+<TD class="confluenceTd"> Generalized MIME type mapping service </TD>
+</TR>
+</TBODY></TABLE>
+
+<P>These projects in the <TT>commons</TT> folder contain common functionality used by multiple other projects and may be either referred to by way of OSGi package import or by inlining the respective packages/classes into the bundle.</P>
+
+
+<H2><A name="ModuleReorganizationProposal-JCRRelatedProjects"></A>JCR Related Projects</H2>
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Who </TH>
+<TH class="confluenceTh"> Folder </TH>
+<TH class="confluenceTh"> Artifact ID </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>jcr/api</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.jcr.api</TT> </TD>
+<TD class="confluenceTd"> Bundle-ized JCR/Jackrabbit API + Session Pooling </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>jcr/resource</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.jcr.resource</TT> </TD>
+<TD class="confluenceTd"> JCR based ResourceResolver, Mapping (formerly the <TT>sling-content-jcr</TT> bundle in the <TT>content</TT> folder) </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>jcr/classloader</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.jcr.classloader</TT> </TD>
+<TD class="confluenceTd"> JCR based ClassLoader </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>jcr/jackrabbit-client</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.jcr.jackrabbit.client</TT> </TD>
+<TD class="confluenceTd"> Access existing JCR Repository </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>jcr/jackrabbit-server</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.jcr.jackrabbit.server</TT> </TD>
+<TD class="confluenceTd"> Embedded JCR Repository </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>jcr/jackrabbit-extractor</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.jcr.jackrabbit.extractor</TT> </TD>
+<TD class="confluenceTd"> Jackrabbit Query Extensions </TD>
+</TR>
+</TBODY></TABLE>
+
+<P>The projects in the <TT>jcr</TT> folder are related to JCR.</P>
+
+
+<H2><A name="ModuleReorganizationProposal-SlingLauncherProjects"></A>Sling Launcher Projects</H2>
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Who </TH>
+<TH class="confluenceTh"> Folder </TH>
+<TH class="confluenceTh"> Artifact ID </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>launcher/app</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.launcher.app</TT> </TD>
+<TD class="confluenceTd"> Command line Sling launcher (embedded Jetty) (formerly the <TT>sling-app</TT> project) </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>launcher/webapp</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.launcher.webapp</TT> </TD>
+<TD class="confluenceTd"> Sling launcher Web Application (formerly the <TT>sling-servlet</TT> project) </TD>
+</TR>
+</TBODY></TABLE>
+
+<P>Launchers for Sling are located in the <TT>launcher</TT> folder. Two projects currently exist. The <TT>app</TT> project which launches Sling from the command line and the <TT>webapp</TT> project which is a web application which launches Sling as a web application in a servlet container.</P>
+
+
+<H2><A name="ModuleReorganizationProposal-MavenPluginProjects"></A>Maven Plugin Projects</H2>
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Who </TH>
+<TH class="confluenceTh"> Folder </TH>
+<TH class="confluenceTh"> Artifact ID </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> cziegeler </TD>
+<TD class="confluenceTd"> <TT>maven/maven-jcrocm-plugin</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.maven-jcrocm-plugin</TT> </TD>
+<TD class="confluenceTd"> JavaDoc Tag support for JCR OCM Mapping </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>maven/maven-jspc-plugin</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.maven-jspc-plugin</TT> </TD>
+<TD class="confluenceTd"> JSP Compiler for bundled JSPs </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> cziegeler </TD>
+<TD class="confluenceTd"> <TT>maven/maven-sling-plugin</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.maven-sling-plugin</TT> </TD>
+<TD class="confluenceTd"> Various helper goals </TD>
+</TR>
+</TBODY></TABLE>
+
+<P>The <TT>maven</TT> folder contains Maven 2 plugin projects which simplify development of Sling itself as well as applications extending Sling.</P>
+
+
+<H2><A name="ModuleReorganizationProposal-microslingProjects"></A>microsling Projects</H2>
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Who </TH>
+<TH class="confluenceTh"> Folder </TH>
+<TH class="confluenceTh"> Artifact ID </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>microsling</TT> </TD>
+<TD class="confluenceTd"> &ndash; </TD>
+<TD class="confluenceTd"> Container for microsling </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> &ndash; </TD>
+<TD class="confluenceTd"> &ndash; </TD>
+<TD class="confluenceTd"> <TT>microsling/core</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.microsling.core</TT> </TD>
+<TD class="confluenceTd"> microsling Core Implementation </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> &ndash; </TD>
+<TD class="confluenceTd"> &ndash; </TD>
+<TD class="confluenceTd"> <TT>microsling/webapp</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.microsling.webapp</TT> </TD>
+<TD class="confluenceTd"> microsling Web Application </TD>
+</TR>
+</TBODY></TABLE>
+
+<P>The <TT>microsling</TT> folder contains the microsling projects which is a very simple implementation of the Sling API. microsling is only statically extensible (as opposed to Sling, which is extensible dynamically at run time).</P>
+
+
+<H2><A name="ModuleReorganizationProposal-OSGiProjects"></A>OSGi Projects</H2>
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Who </TH>
+<TH class="confluenceTh"> Folder </TH>
+<TH class="confluenceTh"> Artifact ID </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>osgi/log</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.osgi.log</TT> </TD>
+<TD class="confluenceTd"> LogService impl and Log API provider </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>osgi/assembly</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.osgi.assembly</TT> </TD>
+<TD class="confluenceTd">Assembly packaging (this project will be removed in the future because it provides a subset of the functionality of the new Deployment Package Service contained in the OSGi Compendium Service Specification R 4.1) </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>osgi/obr</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.osgi.obr</TT> </TD>
+<TD class="confluenceTd"> OSGi Bundle Repository server </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>osgi/console-web</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.osgi.onsole.web</TT> </TD>
+<TD class="confluenceTd"> Web Based OSGi management console </TD>
+</TR>
+</TBODY></TABLE>
+
+<P>The projects in the <TT>osgi</TT> folder are used to extend the functionality of an OSGi framework. These projects are used to implement running Sling instances but do not directly influence Sling itself.</P>
+
+
+<H2><A name="ModuleReorganizationProposal-ScriptingEngineProjects"></A>Scripting Engine Projects</H2>
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Who </TH>
+<TH class="confluenceTh"> Folder </TH>
+<TH class="confluenceTh"> Artifact ID </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> In Progress </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>scripting/resolver</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.scripting.resolver</TT> </TD>
+<TD class="confluenceTd"> ScriptResolver implementation and Engine support </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>scripting/jsp</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.scripting.jsp</TT> </TD>
+<TD class="confluenceTd"> JSP (includes Jasper) </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> cziegeler/fmeschbe </TD>
+<TD class="confluenceTd"> <TT>scripting/jsp-taglib</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.scripting.jsp.taglib</TT> </TD>
+<TD class="confluenceTd"> JSP TagLib for Sling </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> cziegeler </TD>
+<TD class="confluenceTd"> <TT>scripting/javascript</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.scripting.javascript</TT> </TD>
+<TD class="confluenceTd"> JavaScript using Rhino (includes ESP support) </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> cziegeler </TD>
+<TD class="confluenceTd"> <TT>scripting/velocity</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.scripting.velocity</TT> </TD>
+<TD class="confluenceTd"> Velocity Templating </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> cziegeler </TD>
+<TD class="confluenceTd"> <TT>scripting/freemarker</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.scripting.freemarker</TT> </TD>
+<TD class="confluenceTd"> Freemarker Templating </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> cziegeler </TD>
+<TD class="confluenceTd"> <TT>scripting/ruby</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.scripting.ruby</TT> </TD>
+<TD class="confluenceTd"> Ruby Templating </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> &ndash; </TD>
+<TD class="confluenceTd"> &ndash; </TD>
+<TD class="confluenceTd"> <TT>scripting/<EM>???</EM></TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.scripting.<EM>???</EM></TT> </TD>
+<TD class="confluenceTd"> more scripting engines, e.g. JSR-223 </TD>
+</TR>
+</TBODY></TABLE>
+
+<P>One of the most notable extensions of the Sling API compared to the Component API is the better definition of implementing scripting. Formerly scripting was supported as just a special way of a Component requiring more or less complex setup in the repository. The projects in the <TT>scripting</TT> folder implement the new <TT>SlingScriptingEngine</TT> interface for various script languages. The <TT>resolver</TT> project implements the <TT>SlingScriptResolver</TT> interface for Sling.</P>
+
+
+<H2><A name="ModuleReorganizationProposal-SlingMainProjects"></A>Sling Main Projects</H2>
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Who </TH>
+<TH class="confluenceTh"> Folder </TH>
+<TH class="confluenceTh"> Artifact ID </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>sling/core</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.core</TT> </TD>
+<TD class="confluenceTd"> The Core Sling engine. See note below. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> &ndash; </TD>
+<TD class="confluenceTd"> &ndash; </TD>
+<TD class="confluenceTd"> <TT>sling/cache</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.cache</TT> </TD>
+<TD class="confluenceTd"> Output caching of response data (currently empty) </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> cziegeler </TD>
+<TD class="confluenceTd"> <TT>sling/event</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.event</TT> </TD>
+<TD class="confluenceTd"> Distributed Eventing using JCR </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>sling/sample</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.sample</TT> </TD>
+<TD class="confluenceTd"> Sample Servlets and JSPs </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> cziegeler </TD>
+<TD class="confluenceTd"> <TT>sling/scheduler</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.scheduler</TT> </TD>
+<TD class="confluenceTd"> Quartz-based Scheduler for Sling </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> OK </TD>
+<TD class="confluenceTd"> fmeschbe </TD>
+<TD class="confluenceTd"> <TT>sling/servlets-standard</TT> </TD>
+<TD class="confluenceTd"> <TT>org.apache.sling.servlets.standard</TT> </TD>
+<TD class="confluenceTd"> Standard Servlets, e.g. <TT>nt:file</TT>, <TT>nt:folder</TT> </TD>
+</TR>
+</TBODY></TABLE>
+
+<P>The projects in the <TT>sling</TT> folder are the core Sling API implementation projects. In addition added value projects such as scheduling and distributed eventing projects are also located in this folder.</P>
+
+
+<P><B>Note on <TT>sling/core</TT></B>: The core project is currently almost a complete implementation of the Sling framework. Only the JCR Repository access and Object Content Mapping functionality is not part of the core. This project should be broken apart such that only the bare minimum of the functionality is contained. This is to be further analyzed.</P>
+
+
+<H2><A name="ModuleReorganizationProposal-RemovedandReplacedProjects"></A>Removed and Replaced Projects</H2>
+
+<UL>
+	<LI>The <TT>component-api</TT> project defining the old Component API is replaced by the new <TT>api</TT> project defining the Sling API. Therefore the <TT>component-api</TT> project is removed.</LI>
+	<LI>The project JSP compiler (Jasper plus Eclipse Java Compiler) project <TT>jasper-sling</TT> is not a standalone project any more. It has been integrated into the project implementing the <TT>SlingScriptingEngine</TT> for JSP <TT>script/jsp</TT>.</LI>
+</UL>
+
+
+    </DIV>
+  </BODY>
+</HTML>
+

Propchange: sling/site/trunk/content/site/module-reorganization-proposal.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/site/trunk/content/site/module-reorganization-proposal.html
------------------------------------------------------------------------------
    svn:keywords = Id

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

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

Propchange: sling/site/trunk/content/site/monitoring-requests.data/sling-requests-plugin.jpg
------------------------------------------------------------------------------
    svn:mime-type = image/jpeg

Added: sling/site/trunk/content/site/monitoring-requests.data/sling-requests-plugin.jpg.jpeg
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/monitoring-requests.data/sling-requests-plugin.jpg.jpeg?rev=1420577&view=auto
==============================================================================
Binary file - no diff available.

Propchange: sling/site/trunk/content/site/monitoring-requests.data/sling-requests-plugin.jpg.jpeg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: sling/site/trunk/content/site/monitoring-requests.html
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/monitoring-requests.html?rev=1420577&view=auto
==============================================================================
--- sling/site/trunk/content/site/monitoring-requests.html (added)
+++ sling/site/trunk/content/site/monitoring-requests.html Wed Dec 12 09:13:50 2012
@@ -0,0 +1,79 @@
+
+<!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 - Monitoring Requests</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="Monitoring Requests">Monitoring Requests</A>
+        </DIV>
+<H1><A name="MonitoringRequests-MonitoringRequests"></A>Monitoring Requests</H1>
+
+<P>Sling provides a simple OSGi console plugin to monitor recent requests. This is quite useful when debugging and to understand how things work, though it's obviously not a replacement for full-blown HTTP trafic monitoring tools.</P>
+
+<P>The console plugin is available at /system/console/requests, listed as <EM>Recent Requests</EM> in the console menu.</P>
+
+<P>The plugin keeps track of the latest 20 requests processed by Sling, and displays the information provided by the RequestProgressTracker, for the selected request. The screenshot below shows an example.</P>
+
+<P>Any information that's added to the RequestProgressTracker (which is available from the SlingHttpServletRequest object) during request processing will be displayed by this plugin.</P>
+
+<P><SPAN class="image-wrap" style="float: left"><IMG src="monitoring-requests.data/sling-requests-plugin.jpg" alt="Recent Requests plugin" style="border: 0px solid black"></SPAN></P>
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by bdelacretaz on 2009-06-09 13:37:18.0
+        </DIV>
+        <DIV class="trademarkFooter">
+Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
+        </DIV>
+    </DIV>
+  </BODY>
+</HTML>
+

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

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

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