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 [7/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/discover-sling-in-15-minutes.html
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/discover-sling-in-15-minutes.html?rev=1420577&view=auto
==============================================================================
--- sling/site/trunk/content/site/discover-sling-in-15-minutes.html (added)
+++ sling/site/trunk/content/site/discover-sling-in-15-minutes.html Wed Dec 12 09:13:50 2012
@@ -0,0 +1,297 @@
+
+<!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 - Discover Sling in 15 minutes</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="getting-started.html" title="Getting Started">Getting Started</A>&nbsp;&gt;&nbsp;<A href="" title="Discover Sling in 15 minutes">Discover Sling in 15 minutes</A>
+        </DIV>
+<H1><A name="DiscoverSlingin15minutes-DiscoverSlingin15minutestheSlingLaunchpad"></A>Discover Sling in 15 minutes - the Sling Launchpad</H1>
+
+<P>The Sling Launchpad is a ready-to-run Sling configuration, providing an embedded JCR content repository and web server, a selection of Sling components, documentation and examples. The Launchpad makes it easy to get started with Sling and to develop script-based applications.</P>
+
+<P>This page will help you get started with the Launchpad. Fifteen minutes should be enough to get an overview of what Sling does.</P>
+
+<P>While simple to run and understand, the Launchpad is a full-featured instance of Sling, an example configuration that we have created with the most common modules and configurations. The full functionality of Sling is available by loading additional Sling (or custom) OSGi bundles as needed, using the Launchpad's web-based OSGi management console.</P>
+
+<H2><A name="DiscoverSlingin15minutes-SeeAlso"></A>See Also</H2>
+
+
+<P>Example applications and mini-applications for Sling can be found under <A href="http://svn.apache.org/repos/asf/sling/trunk/samples/" class="external-link" rel="nofollow">http://svn.apache.org/repos/asf/sling/trunk/samples/</A> (each application has a <TT>README.txt</TT> file, see these for more details).</P>
+
+<P>Once you grok the basic examples of this page, we recommend studying the <EM>espblog</EM> and <EM>webloader</EM> samples for more complete examples. The <EM>javashell</EM> sample is useful to play with JCR java code (or any java code, for that matter) interactively.</P>
+
+<H2><A name="DiscoverSlingin15minutes-Prerequisites"></A>Prerequisites</H2>
+
+<P>We'll start with the self-runnable jar from the Sling distribution, you only need a Java 5 JDK. Download the latest release from the Sling <A href="http://sling.apache.org/site/downloads.cgi" class="external-link" rel="nofollow">Downloads</A> page or by clicking this link: <A href="http://www.apache.org/dyn/closer.cgi/sling/org.apache.sling.launchpad-6-standalone.jar" class="external-link" rel="nofollow">org.apache.sling.launchpad-6-standalone.jar</A>. Alternatively you can deploy the <A href="http://www.apache.org/dyn/closer.cgi/sling/org.apache.sling.launchpad-6.war" class="external-link" rel="nofollow">Sling Web application</A> into any decent Servlet Container such as Jetty or Tomcat or you can <A href="getting-and-building-sling.html" title="Getting and Building Sling">build the current source yourself</A>.</P>
+
+<P>To show the simplicity of the REST-style approach taken by Sling the examples below will be using <A href="http://curl.haxx.se/" class="external-link" rel="nofollow">cURL</A>. Any HTTP client would do, but cURL is the easiest to document in a reproducible way.</P>
+
+<P>A WebDAV client makes editing server-side scripts much more convenient, but to make our examples easy to reproduce, we're using cURL below to create and update files in the JCR repository, via the Sling WebDAV server.</P>
+
+
+<H2><A name="DiscoverSlingin15minutes-StarttheLaunchpad"></A>Start the Launchpad</H2>
+
+<P>After downloading the Sling Launchpad self-runnable jar just start it as follows:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ java -jar org.apache.sling.launchpad-6-standalone.jar
+</PRE>
+</DIV></DIV>
+
+<P>This starts the Sling embedded Web Server on port 8080 and writes application files into the <TT>sling</TT> folder found in the current working directory.</P>
+
+<P>Once started, look at <A href="http://localhost:8080/system/console/bundles" class="external-link" rel="nofollow">http://localhost:8080/system/console/bundles</A> with your browser. Use <EM>admin</EM> with password <EM>admin</EM> if Sling asks you for a login. Sling then displays the <EM>Felix Web Management Console</EM> page.</P>
+
+
+<P>On the bundles page, all bundles should be marked <EM>Active</EM>. They're all <A href="http://www.osgi.org/" class="external-link" rel="nofollow">OSGi</A> bundles powered by <A href="http://felix.apache.org/" class="external-link" rel="nofollow">Apache Felix</A>, but that doesn't really matter to us right now.</P>
+
+<DIV class="panelMacro"><TABLE class="tipMacro"><COLGROUP><COL width="24"><COL></COLGROUP><TR><TD valign="top"><IMG src="https://cwiki.apache.org/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></TD><TD><B>Log files</B><BR>If things go wrong, have a look at the <TT>sling/logs/error.log</TT> log file &#45; that's where Sling writes any error messages.</TD></TR></TABLE></DIV>
+
+<H2><A name="DiscoverSlingin15minutes-Createsomecontent"></A>Create some content</H2>
+
+<P>Until we have ready-to-test forms, you can create content with cURL, or you can create an HTML form that posts to the specified URL.</P>
+
+<P>To create a content node (nodes are a <A href="http://jackrabbit.apache.org/" class="external-link" rel="nofollow">JCR</A> concept, a unit of storage) with cURL, use:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>curl -u admin:admin -F&quot;sling:resourceType=foo/bar&quot; -F&quot;title=some title&quot; http://localhost:8080/content/mynode
+</PRE>
+</DIV></DIV>
+
+<P>The resulting node can be seen at <A href="http://localhost:8080/content/mynode.html" class="external-link" rel="nofollow">http://localhost:8080/content/mynode.html</A>, or as json format under <A href="http://localhost:8080/content/mynode.json" class="external-link" rel="nofollow">http://localhost:8080/content/mynode.json</A>. Lets try with cURL:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ curl http://localhost:8080/content/mynode.json
+{&quot;title&quot;:&quot;some title&quot;,&quot;sling:resourceType&quot;:&quot;foo/bar&quot;,&quot;jcr:primaryType&quot;:&quot;nt:unstructured&quot;}
+</PRE>
+</DIV></DIV>
+
+<P>This returns the properties of the <TT>/content/mynode</TT> in JSON format as we have created it above. The additional property <TT>jcr:primaryType</TT> is a special JCR property indicating the JCR primary node type.</P>
+
+<DIV class="panelMacro"><TABLE class="tipMacro"><COLGROUP><COL width="24"><COL></COLGROUP><TR><TD valign="top"><IMG src="https://cwiki.apache.org/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></TD><TD><B>Monitoring requests</B><BR>Sling provides a simple tool (an OSGi console plugin) to monitor HTTP requests, which helps understand how things work internally. See the <A href="monitoring-requests.html" title="Monitoring Requests">Monitoring Requests</A> page for details.</TD></TR></TABLE></DIV>
+
+<H2><A name="DiscoverSlingin15minutes-Renderyourcontentusingserversidejavascript%28ESP%29"></A>Render your content using server-side javascript (ESP)</H2>
+
+<P>Sling uses scripts or servlets to render and process content.</P>
+
+<P>Several scripting languages are available as additional Sling modules (packaged as OSGi <EM>bundles</EM> that can be installed via the Sling management console), but the launchpad currently includes the ESP (server-side ECMAscript), JSP (Java Server Pages), and Groovy language modules by default.</P>
+
+<P>To select a script, Sling uses the node's <EM>sling:resourceType</EM> property, if it is set.</P>
+
+<P>That is the case in our example, so the following script will be used by Sling to render the node in HTML, if the script is found at <EM>/apps/foo/bar/html.esp</EM> in the repository.</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;"><B>html.esp</B></DIV><DIV class="codeContent panelContent">
+<PRE class="code-java">
+&lt;html&gt;
+  &lt;body&gt;
+    &lt;h1&gt;&lt;%= currentNode.title %&gt;&lt;/h1&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
+</PRE>
+</DIV></DIV>
+
+<P>To select the script, Sling:</P>
+<UL>
+	<LI>looks under <EM>/apps</EM></LI>
+	<LI>and appends the <EM>sling:resourceType</EM> value of our node ( which is <EM>foo/bar</EM> )</LI>
+	<LI>and appends <EM>html.esp</EM>, as the extension of our URL is <EM>html</EM> and the language of our script is <EM>esp</EM>.</LI>
+</UL>
+
+
+<P>Store this script under <EM>/apps/foo/bar/html.esp</EM>, either using a WebDAV client (connected to <A href="http://admin:admin@localhost:8080/" class="external-link" rel="nofollow">http://admin:admin@localhost:8080/</A>), or using cURL as shown here, after creating the <EM>html.esp</EM> script in the current directory on your system:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>curl -X MKCOL -u admin:admin http://localhost:8080/apps/foo
+curl -X MKCOL -u admin:admin http://localhost:8080/apps/foo/bar
+</PRE>
+</DIV></DIV>
+
+<P>create a local file <EM>html.esp</EM> and copy above content.</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>curl -u admin:admin -T html.esp http://localhost:8080/apps/foo/bar/html.esp
+</PRE>
+</DIV></DIV>
+
+<P>The HTML rendering of your node, at <A href="http://localhost:8080/content/mynode.html" class="external-link" rel="nofollow">http://localhost:8080/content/mynode.html</A>, is now created by this ESP script. You should see the node's title alone as an &lt;h1&gt; element in that page.</P>
+
+<P>A script named <EM>POST.esp</EM> instead of <EM>html.esp</EM> would be called for a POST request, <EM>DELETE.esp</EM> for DELETE, <EM>xml.esp</EM> for a GET request with a <EM>.xml</EM> extension, etc. See <A href="http://cwiki.apache.org/SLING/url-to-script-resolution.html" class="external-link" rel="nofollow">URL to Script Resolution</A> on the Sling wiki for more info.</P>
+
+<P>Servlets can also be easily &quot;wired&quot; to handle specific resource types, extensions, etc., in the simplest case by using SCR annotations in the servlet source code. Servlets and scripts are interchangeable when it comes to processing Sling requests.</P>
+
+
+<H2><A name="DiscoverSlingin15minutes-Whatnext%3F"></A>What next?</H2>
+
+<P>These simple examples show how Sling uses scripts to work with JCR data, based on <EM>sling:resourceType</EM> or node types.</P>
+
+<P>There's much more to Sling of course - you'll find some additional simple examples below, and above in the <EM>see also</EM> section.</P>
+
+<P>We are working on debugging features to help trace the way Sling processes requests. Have a look at <A href="https://issues.apache.org/jira/browse/SLING-3" class="external-link" rel="nofollow">SLING-3</A> to see what's possible already.</P>
+
+
+<H1><A name="DiscoverSlingin15minutes-Additionalexamples"></A>Additional examples</H1>
+
+<H2><A name="DiscoverSlingin15minutes-LetSlinggeneratethepathofanewlycreatednode."></A>Let Sling generate the path of a newly created node.</H2>
+
+<P>To create a node with a unique path at a given location, end the URL of the POST request with <EM>/</EM>.</P>
+
+<P>In this case, the Sling response redirects to the URL of the created node.</P>
+
+<P>Start by creating a new <EM>/blog</EM> folder:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>curl -X POST -u admin:admin &quot;http://localhost:8080/content/blog&quot;
+</PRE>
+</DIV></DIV>
+
+<P>And create a node with a Sling-generated name under it:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>curl -D - -u admin:admin -F&quot;title=Adventures with Sling&quot; &quot;http://localhost:8080/content/blog/&quot;
+</PRE>
+</DIV></DIV>
+
+<P>Using cURL's <EM>&#45;D</EM> option shows the full HTTP response, which includes a <EM>Location</EM> header to indicate where the new node was created:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>Location: /blog/adventures_with_slin
+</PRE>
+</DIV></DIV>
+
+<P>The actual node name might not be <EM>adventures_with_slin</EM> &#45; depending on existing content in your repository, Sling will find a unique name for this new node, based on several well-know property values like title, description, etc. which are used for this if provided.</P>
+
+<P>So, in our case, our new node can be displayed in HTML via the <A href="http://localhost:8080/blog/adventures_with_slin.html" class="external-link" rel="nofollow">http://localhost:8080/blog/adventures_with_slin.html</A> URL.</P>
+
+<P>Note that we didn't set a <EM>sling:resourceType</EM> property on our node, so if you want to render that node with a script, you'll have to store the script under <EM>/apps/nt/unstructured/html.esp</EM>.</P>
+
+
+<H2><A name="DiscoverSlingin15minutes-Addapageheaderwithsling.include"></A>Add a page header with sling.include</H2>
+
+<P>The <EM>sling.include</EM> function can be called from scripts to include the rendered result of another node.</P>
+
+<P>In this example, we create a node at <EM>/content/header</EM>, rendered with a logo using an <EM>html.esp</EM> script, then use that header at the top of the <EM>html.esp</EM> script that we created previously for the <EM>foo/bar</EM> resource type.</P>
+
+<P>Start by checking that <A href="http://localhost:8080/content/mynode.html" class="external-link" rel="nofollow">http://localhost:8080/content/mynode.html</A> is rendered using the <EM>html.esp</EM> script created above.</P>
+
+<P>Create this script and name it <EM>header.esp</EM>:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;"><B>header.esp</B></DIV><DIV class="codeContent panelContent">
+<PRE class="code-java">
+&lt;div&gt;
+  &lt;p style=<SPAN class="code-quote">&quot;color:blue;&quot;</SPAN>&gt;
+    &lt;img src=<SPAN class="code-quote">&quot;/images/sling.jpg&quot;</SPAN> align=<SPAN class="code-quote">&quot;right&quot;</SPAN>/&gt;
+    &lt;%= currentNode.headline %&gt;
+  &lt;/p&gt;
+&lt;/div&gt;
+</PRE>
+</DIV></DIV>
+
+<P>Upload it so that it is used to render resources having <EM>sling:resourceType=foo/header</EM>:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>curl -X MKCOL -u admin:admin http://localhost:8080/apps/foo/header/
+curl -u admin:admin -T header.esp http://localhost:8080/apps/foo/header/html.esp
+</PRE>
+</DIV></DIV>
+
+<P>Create the header node:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>curl -u admin:admin -F&quot;sling:resourceType=foo/header&quot; -F&quot;headline=Hello, Sling world&quot; http://localhost:8080/content/header
+</PRE>
+</DIV></DIV>
+
+<P>Upload the logo that the script uses (using sling.jpg or another logo in the current directory):</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>curl -X MKCOL -u admin:admin http://localhost:8080/images/
+curl -u admin:admin -T sling.jpg http://localhost:8080/images/sling.jpg
+</PRE>
+</DIV></DIV>
+
+<P>And check that the header is rendered with the logo at <A href="http://localhost:8080/content/header.html" class="external-link" rel="nofollow">http://localhost:8080/content/header.html</A>.</P>
+
+<P>Now, update the html.esp script that we created for our first example above, to include the header:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;"><B>html.esp</B></DIV><DIV class="codeContent panelContent">
+<PRE class="code-java">
+&lt;html&gt;
+  &lt;body&gt;
+    &lt;div id=<SPAN class="code-quote">&quot;header&quot;</SPAN>&gt;
+      &lt;% sling.include(<SPAN class="code-quote">&quot;/content/header&quot;</SPAN>); %&gt;
+    &lt;/div&gt;
+    &lt;h1&gt;&lt;%= currentNode.title %&gt;&lt;/h1&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
+</PRE>
+</DIV></DIV>
+
+<P>And upload it again to replace the previous version:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>curl -u admin:admin -T html.esp http://localhost:8080/apps/foo/bar/html.esp
+</PRE>
+</DIV></DIV>
+
+<P>The <A href="http://localhost:8080/content/mynode.html" class="external-link" rel="nofollow">http://localhost:8080/content/mynode.html</A>, once refreshed, now shows the blue headline and logo, and this layout also applies to any node created with <EM>sling:resourceType=foo/bar</EM>.</P>
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by cziegeler@apache.org on Thu Nov 15 08:39:41 EST 2012
+        </DIV>
+        <DIV class="trademarkFooter">
+Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
+        </DIV>
+    </DIV>
+  </BODY>
+</HTML>
+

Propchange: sling/site/trunk/content/site/discover-sling-in-15-minutes.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/site/trunk/content/site/discover-sling-in-15-minutes.html
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: sling/site/trunk/content/site/discover-sling-in-15-minutes.html
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: sling/site/trunk/content/site/dispatching-requests.html
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/dispatching-requests.html?rev=1420577&view=auto
==============================================================================
--- sling/site/trunk/content/site/dispatching-requests.html (added)
+++ sling/site/trunk/content/site/dispatching-requests.html Wed Dec 12 09:13:50 2012
@@ -0,0 +1,224 @@
+
+<!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 - Dispatching 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="the-sling-engine.html" title="The Sling Engine">The Sling Engine</A>&nbsp;&gt;&nbsp;<A href="" title="Dispatching Requests">Dispatching Requests</A>
+        </DIV>
+<H1><A name="DispatchingRequests-RequestProcessing"></A>Request Processing</H1>
+
+<H2><A name="DispatchingRequests-Mainprocess"></A>Main process</H2>
+
+<P>The following steps should give you an overview how a request is processed in Sling. Details can be found under provided links.</P>
+
+<H3><A name="DispatchingRequests-Step1"></A>Step 1</H3>
+
+<P>The client sends the request</P>
+
+<H3><A name="DispatchingRequests-Step2"></A>Step 2</H3>
+
+<P>This step applies only if a Servlet Container is installed and Sling is embedded:<BR>
+Servlet Container gets request and forwards to OSGi HttpService</P>
+
+<H3><A name="DispatchingRequests-Step3"></A>Step 3</H3>
+
+<P>OSGi HttpService looks for responsible registered Servlet or resource (see 102.4 of the OSGi compendium)</P>
+
+<H3><A name="DispatchingRequests-Step4"></A>Step 4</H3>
+
+<P>OSGi HttpService calls <TT>handleSecurity</TT> of the HttpContext associated with the servlet/resource. In case of Sling this calls into SlingMainServlet.handleSecurity and then into SlingAuthenticator.authenticate</P>
+
+<H3><A name="DispatchingRequests-Step4a"></A>Step 4a</H3>
+
+<P>SlingAuthenticator selects an authentication handler for the request and forwards the authenticate call. On success a <TT>javax.jcr.Session</TT> is created, the request attributes required by the HTTP Service spec are set (like <TT>org.osgi.service.http.authentication.remote.user</TT> and <TT>org.osgi.service.http.authentication.type}}and also the {{javax.jcr.Session</TT> which is used later is set in the request attributes.<BR>
+On success, continue with step 5.</P>
+
+<H3><A name="DispatchingRequests-Step4b"></A>Step 4b</H3>
+
+<P>If authentication fails either an anonymous session is acquired (if anonymous is allowed per configuration) or the login method is called.<BR>
+If anonymous is allowed, continue with step 5.</P>
+
+<H3><A name="DispatchingRequests-Step4c"></A>Step 4c</H3>
+
+<P>The login method selects an AuthenticationHandler and forwards the login call to the AuthenticationHandler.requestAuthentication method to cause the client to authenticate. Request processing stops here (<TT>SlingMainServlet.handleSecurity</TT> returns false).</P>
+
+<H3><A name="DispatchingRequests-Step5"></A>Step 5</H3>
+
+<P>After getting a response the HttpService either terminates the request (if authentication failed and <TT>SlingMainServlet.handleSecurity</TT> returned false) or continues by either spooling the resource or in the case of Sling calling the <TT>SlingMainServlet.service</TT> method.</P>
+
+<H3><A name="DispatchingRequests-Step6"></A>Step 6</H3>
+
+<P>The <TT>SlingMainServlet.service</TT> method is the entry point into the Sling proper. This method sets up the request:</P>
+<UL>
+	<LI>Wraps the <TT>HttpServletRequest</TT> and the <TT>HttpServletResponse</TT> into the <TT>SlingHttpServletRequest</TT> and the <TT>SlingHttpServletResponse</TT></LI>
+	<LI>Checks if Sling is ready for processing the request (checks at the moment for an existing ResourceResolverFactory service, a ServletResolver service and a MimeTypeService)</LI>
+	<LI>Create the ResourceResolver based on the Session (by default creates a <TT>JcrResourceResolver2</TT>)</LI>
+	<LI>Locate the <A href="resources.html" title="Resources">Resource</A> on the basis of the request by calling <TT>ResourceResovler.resolve</TT> through <TT>RequestData.initResource</TT> (see also <A href="url-decomposition.html" title="URL decomposition">URL decomposition</A>)</LI>
+	<LI>Locate the servlet or script (see <A href="servlets.html" title="Servlets">Servlets</A>) by calling <TT>ServletResolver.resolveServlet</TT> through <TT>RequestData.initServlet</TT></LI>
+</UL>
+
+
+<H3><A name="DispatchingRequests-Step7"></A>Step 7</H3>
+
+<P>After this setup, the request level filters are called (the ones registered as <TT>javax.servlet.Filter</TT> with the property <TT>filter.scope=request</TT>, see <A href="filters.html" title="Filters">Filters</A> for details).<BR>
+If any called filter doesn't call <TT>FilterChain.doFilter</TT> at the end of the <TT>Filter.doFilter</TT> method request processing stops here.</P>
+
+<H3><A name="DispatchingRequests-Step8"></A>Step 8</H3>
+
+<P>After having called all request level filters, the component level filters (registered with the property <TT>filter.scope=component</TT>, see <A href="filters.html" title="Filters">Filters</A> for details) are called.</P>
+
+<H3><A name="DispatchingRequests-Step9"></A>Step 9</H3>
+
+<P>After having called the component level filters, the request servlet or script is finally called to process the request.</P>
+
+<H2><A name="DispatchingRequests-Include%2FForward"></A>Include/Forward</H2>
+
+<P>If a servlet or script is including another resource for processing through the <TT>RequestDispatcher.include</TT> or <TT>RequestDispatcher.forward</TT> (or any JSP or feature of another scripting language which relies on one of this two methods) the following processing takes place:</P>
+
+<H3><A name="DispatchingRequests-Step1"></A>Step 1</H3>
+
+<P>Code in the processing servlet or script calls <TT>RequestDispatcher.include</TT> or <TT>RequestDispatcher.forward</TT>.</P>
+
+<H3><A name="DispatchingRequests-Step2"></A>Step 2</H3>
+
+<P>The resource is resolved though ResourceResolver.getResource (if the RequestDispatcher has not been created with a resource already)</P>
+
+<H3><A name="DispatchingRequests-Step3"></A>Step 3</H3>
+
+<P>The servlet or script to handle the resource is resolved calling the <TT>ServletResolver.resolverServlet</TT> method.</P>
+
+<H3><A name="DispatchingRequests-Step4"></A>Step 4</H3>
+
+<P>The component level filters (registered with the property <TT>filter.scope=component</TT>) are called again (see <A href="filters.html" title="Filters">Filters</A> for details).</P>
+
+<H3><A name="DispatchingRequests-Step5"></A>Step 5</H3>
+
+<P>The servlet or script is called to process the request.</P>
+
+<P>Note that these steps are processed for every include or forward call.</P>
+
+
+<H2><A name="DispatchingRequests-IncludedRequestAttributes"></A>Included Request Attributes</H2>
+
+<P>When servlet or script is called as a result of <TT>RequestDispatcher.include</TT> the following request attributes are set:</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TD class="confluenceTd"> Attribute Name<BR>
+Attribute Type </TD>
+<TD class="confluenceTd"> Description </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>org.apache.sling.api.include.servlet</TT><BR>
+<TT>javax.servlet.Servlet</TT> </TD>
+<TD class="confluenceTd"> The name of the request attribute containing the <TT>Servlet</TT> which included the servlet currently being active. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>org.apache.sling.api.include.resource</TT><BR>
+<TT>org.apache.sling.api.resource.Resource</TT> </TD>
+<TD class="confluenceTd"> The name of the request attribute containing the <TT>Resource</TT> underlying the <TT>Servlet</TT> which included the servlet currently being active. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>org.apache.sling.api.include.request_path_info</TT><BR>
+<TT>org.apache.sling.api.request.RequestPathInfo</TT> </TD>
+<TD class="confluenceTd"> The name of the request attribute containing the <TT>RequestPathInfo</TT> underlying the <TT>Servlet</TT> which included the servlet currently being active </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>javax.servlet.include.request_uri</TT><BR>
+<TT>String</TT> </TD>
+<TD class="confluenceTd"> The name of the request attribute containing the <TT>HttpServletRequest.getRequestURI()</TT> of the request which included the servlet currently being active underlying the <TT>Servlet</TT> which included the servlet currently being active.<BR>
+<B>Note:</B> In Sling, the <TT>HttpServletRequest.getRequestURI()</TT> method will always return the same result regardless of whether it is called from the client request processing servlet or script or from an included servlet or script. This request attribute is set for compatibility with the Servlet API specification. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>javax.servlet.include.context_path</TT><BR>
+<TT>String</TT> </TD>
+<TD class="confluenceTd"> The name of the request attribute containing the <TT>HttpServletRequest.getContextPath()</TT> of the request which included the servlet currently being active underlying the <TT>Servlet</TT> which included the servlet currently being active.<BR>
+<B>Note:</B> In Sling, the <TT>HttpServletRequest.getContextPath()</TT> method will always return the same result regardless of whether it is called from the client request processing servlet or script or from an included servlet or script. This request attribute is set for compatibility with the Servlet API specification. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>javax.servlet.include.servlet_path</TT><BR>
+<TT>String</TT> </TD>
+<TD class="confluenceTd"> The name of the request attribute containing the <TT>HttpServletRequest.getServletPath()</TT> of the request which included the servlet currently being active underlying the <TT>Servlet</TT> which included the servlet currently being active.<BR>
+<B>Note:</B> In Sling, the <TT>HttpServletRequest.getServletPath()</TT> method will always return the same result regardless of whether it is called from the client request processing servlet or script or from an included servlet or script. This request attribute is set for compatibility with the Servlet API specification. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>javax.servlet.include.path_info</TT><BR>
+<TT>String</TT> </TD>
+<TD class="confluenceTd"> The name of the request attribute containing the <TT>HttpServletRequest.getPathInfo()</TT> of the request which included the servlet currently being active underlying the <TT>Servlet</TT> which included the servlet currently being active.<BR>
+<B>Note:</B> In Sling, the <TT>HttpServletRequest.getPathInfo()</TT> method will always return the same result regardless of whether it is called from the client request processing servlet or script or from an included servlet or script. This request attribute is set for compatibility with the Servlet API specification.</TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>javax.servlet.include.query_string</TT><BR>
+<TT>String</TT> </TD>
+<TD class="confluenceTd"> The name of the request attribute containing the <TT>HttpServletRequest.getQueryString()</TT> of the request which included the servlet currently being active underlying the <TT>Servlet</TT> which included the servlet currently being active.<BR>
+<B>Note:</B> In Sling, the <TT>HttpServletRequest.getQueryString()</TT> method will always return the same result regardless of whether it is called from the client request processing servlet or script or from an included servlet or script. This request attribute is set for compatibility with the Servlet API specification. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+<P>Constants are defined in the <TT>org.apache.sling.api.SlingConstants</TT> class for these request attributes.</P>
+
+<P><B>Note:</B> These request attributes are not set if the servlet or script is called to handle the request or as a result of <TT>RequestDispatcher.forward</TT>.</P>
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by fmeschbe on 2010-03-25 10:11:00.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/dispatching-requests.html
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

Added: sling/site/trunk/content/site/documentation.data/sling.sh
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/documentation.data/sling.sh?rev=1420577&view=auto
==============================================================================
--- sling/site/trunk/content/site/documentation.data/sling.sh (added)
+++ sling/site/trunk/content/site/documentation.data/sling.sh Wed Dec 12 09:13:50 2012
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# Synchronizes the Confluence Export of the
+# Sling site to the site folder and fixes
+# the mirror link settings of the downloads.html
+# page which are incorrectly expanded to absolute
+# links by the confluence export 
+
+# Site Mirror Sources
+MIRROR_SOURCE=/x1/www
+
+# Site folder
+SITE=${MIRROR_SOURCE}/sling.apache.org/site
+
+# downloads page location
+DLPAGE=${SITE}/downloads.html
+DLCGI=${SITE}/downloads.cgi
+
+# temporary copy of the downloads page
+DLTMP=/home/fmeschbe/d.html 
+
+# synchronized from Confluence export
+#/usr/local/bin/rsync -rt --out-format='%n %l %M' ${MIRROR_SOURCE}/confluence-exports/SLINGxSITE/ ${SITE}
+#/usr/local/bin/rsync -rt ${MIRROR_SOURCE}/confluence-exports/SLINGxSITE/ ${SITE}
+
+# add -p option according to INFRA-2518
+/usr/local/bin/rsync -rtp --chmod=Dg+s,g+w ${MIRROR_SOURCE}/confluence-exports/SLINGxSITE/ ${SITE}
+
+# copy downloads page and replace with patched
+cp ${DLPAGE} ${DLTMP}
+cat ${DLTMP} | sed  's/http:\/\/cwiki.apache.org\/confluence\/display\/SLINGxSITE\/%5Bpreferred%5D/[preferred]/g' > ${DLPAGE}
+
+# copy apache-sling.html to index.html
+cp ${SITE}/apache-sling.html ${SITE}/index.html
+
+# ensure the download.cgi script exists
+if [ ! -f ${DLCGI} ] ; then
+    cat >${DLCGI} <<-'EOF'
+	!/bin/sh
+	# Wrapper script around mirrors.cgi script
+	# (we must change to that directory in order for python to pick up the
+	#  python includes correctly)
+	cd /www/www.apache.org/dyn/mirrors
+	/www/www.apache.org/dyn/mirrors/mirrors.cgi $*
+EOF
+    chmod 775 ${DLCGI}
+fi
+

Propchange: sling/site/trunk/content/site/documentation.data/sling.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/site/trunk/content/site/documentation.data/sling.sh
------------------------------------------------------------------------------
    svn:executable = *

Propchange: sling/site/trunk/content/site/documentation.data/sling.sh
------------------------------------------------------------------------------
    svn:keywords = Id

Added: sling/site/trunk/content/site/documentation.html
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/documentation.html?rev=1420577&view=auto
==============================================================================
--- sling/site/trunk/content/site/documentation.html (added)
+++ sling/site/trunk/content/site/documentation.html Wed Dec 12 09:13:50 2012
@@ -0,0 +1,210 @@
+
+<!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 - Documentation</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="Documentation">Documentation</A>
+        </DIV>
+<H1><A name="Documentation-Documentation"></A>Documentation</H1>
+
+<P>The documentation is split into different parts:</P>
+
+<UL>
+	<LI><A href="getting-started.html" title="Getting Started">Getting Started</A>, the right place to start!</LI>
+	<LI><A href="the-sling-engine.html" title="The Sling Engine">The Sling Engine</A>, all about the heart of Sling</LI>
+	<LI><A href="development.html" title="Development">Development</A>, how do I get and develop with Sling</LI>
+	<LI><A href="bundles.html" title="Bundles">Bundles</A>, which bundle delivers which features to Sling</LI>
+	<LI><A href="tutorials-how-tos.html" title="Tutorials & How-Tos">Tutorials &amp; How&#45;Tos</A></LI>
+	<LI><A href="http://cwiki.apache.org/SLING/" class="external-link" rel="nofollow">Wiki</A></LI>
+	<LI><A href="configuration.html" title="Configuration">Configuration</A></LI>
+	<LI><A href="http://sling.apache.org/apidocs/sling5/index.html" class="external-link" rel="nofollow">API Doc</A></LI>
+</UL>
+
+
+
+<H2><A name="Documentation-Howcanyoucontribute"></A>How can you contribute</H2>
+
+<P>We're on the way to improve the documentation, but it's a long way. If you would like to contribute to the documentation you are very welcome. Please directly post your proposals to the <A href="http://cwiki.apache.org/SLING/" class="external-link" rel="nofollow">public wiki</A> or post your suggestions to the mailing list.</P>
+
+
+<H2><A name="Documentation-Howisthedocumentationgenerated"></A>How is the documentation generated</H2>
+
+<P>The basic documentation of Sling is made up of four parts:</P>
+
+<OL>
+	<LI>The Sling Site at <A href="http://sling.apache.org/" class="external-link" rel="nofollow">http://sling.apache.org/</A> (you are here)</LI>
+	<LI>The Public Wiki at <A href="http://cwiki.apache.org/SLING" class="external-link" rel="nofollow">http://cwiki.apache.org/SLING</A></LI>
+	<LI>The JavaDoc</LI>
+	<LI>The Bundle documentation</LI>
+</OL>
+
+
+<P>This page is about how this documentation is maintained and who is allowed to do what.</P>
+
+
+<H3><A name="Documentation-TheSlingSite"></A>The Sling Site</H3>
+
+<H4><A name="Documentation-MainSite"></A>Main Site</H4>
+
+<P>The main Sling Site is maintained in the Confluence Wiki Space <EM>SLINGxSITE</EM>. The content of this space is automatically synchronized with the web server with a simple shell script <A href="documentation.data/sling.sh">sling.sh</A> which is called regularly as per the following <TT>crontab</TT> entry:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+# sync wiki autoexport to Sling site
+1 * * * * (/home/fmeschbe/sling.sh)
+</PRE>
+</DIV></DIV>
+
+<P>Thus, after editing the site source in the Wiki, the rest happens automatically, it just takes some time &ndash; in the order 2 hours or so &ndash; before the changes are visible at <A href="http://sling.apache.org/" class="external-link" rel="nofollow">http://sling.apache.org/</A>.</P>
+
+<P>Everybody is allowed to read the SLINGxSITE wiki and to add comments; but only committers of the Apache Sling project are allowed to edit the content and to manage the comments.</P>
+
+<P>The main site is located in the <TT>site</TT> folder below the Site URL <A href="http://sling.apache.org/" class="external-link" rel="nofollow">http://sling.apache.org/</A> to which users are redirected automatically.</P>
+
+<H4><A name="Documentation-SecondarySite"></A>Secondary Site</H4>
+
+<P>The Sling site contains secondary site parts that are maintained in the Apache SVN repository at <A href="http://svn.apache.org/repos/asf/sling/site" class="external-link" rel="nofollow">http://svn.apache.org/repos/asf/sling/site</A>. Updates to secondary parts of the site have to be done in the following steps:</P>
+
+<P>1. Checkout or update the <A href="https://svn.apache.org/repos/asf/sling/site" class="external-link" rel="nofollow">site</A> tree form SVN.</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+$ svn checkout https:<SPAN class="code-comment">//svn.apache.org/repos/asf/sling/site</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>2. Apply your changes.</P>
+
+<P>3. Commit the changes back into SVN.</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+$ svn commit -m<SPAN class="code-quote">&quot;&lt;enter your message here&gt;&quot;</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>4. Login to <TT>people.apache.org</TT></P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+$ ssh people.apache.org
+</PRE>
+</DIV></DIV>
+
+<P>5. Go to the location from where infrastructure mirroring is getting the actual sites and update from SVN.</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+$ cd /x1/www/sling.apache.org
+$ svn update
+</PRE>
+</DIV></DIV>
+
+<P>After some time, the updates will be synchronized to the web servers and can be accessed.</P>
+
+
+<H3><A name="Documentation-ThePublicWiki"></A>The Public Wiki</H3>
+
+<P>The public wiki of Sling is available at <A href="http://cwiki.apache.org/SLING" class="external-link" rel="nofollow">http://cwiki.apache.org/SLING</A> and is maintained in the Confluence space <EM>SLING</EM>. This is a public wiki, in that after self-registration, everybody is allowed to edit content.</P>
+
+
+<H3><A name="Documentation-TheJavaDoc"></A>The JavaDoc</H3>
+
+<P>Up until now the JavaDoc of the Sling Bundles has not been published.</P>
+
+<P>I just polished the JavaDoc generation setup of Sling a bit, so that I could generate a first shot of aggregate JavaDocs. This draft can currently be found on my site at <A href="http://people.apache.org/~fmeschbe/slingdocs.762729/" class="external-link" rel="nofollow">http://people.apache.org/~fmeschbe/slingdocs.762729/</A>. This JavaDoc has been generated as follows:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+$ svn export -r 762729 http:<SPAN class="code-comment">//svn.apache.org/repos/asf/incubator/sling/trunk sling
+</SPAN>$ mvn -DexcludePackageNames=<SPAN class="code-quote">&quot;*.impl:*.internal:*.jsp:sun.misc:*.juli&quot;</SPAN> org.apache.maven.plugins:maven-javadoc-plugin:2.5:aggregate
+</PRE>
+</DIV></DIV>
+
+<P>I am still unsure whether it makes sense to generate aggregate JavaDoc for all (or part of) the bundles of Sling. See also below regarding the Sites.</P>
+
+
+<H3><A name="Documentation-TheBundleDocumentation"></A>The Bundle Documentation</H3>
+
+<P>Apart from the documentation of Sling on the Site and in the Wiki, it would also be thinkable that we accompany the source modules with some documentation and generate this using the Maven Site plugin. My tests so far for generating a multi-module site have not been very successful. But generating the site in a module-by-module manner might be a good thing, at least to get the per-module JavaDoc and some more code-oriented information like Surefire Reports, fixed bugs, etc.</P>
+
+<P>To prepare such Bundle Documentation I added a first shot at site generation setup to the parent project. For now, this includes the module's JavaDoc (of course), the Surefire reports and a report on the issues fixed (or open) with respect to some version. This site generation setup can be configured per module with two properties:</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Property </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>site.jira.version.id</TT> </TD>
+<TD class="confluenceTd"> The ID of the JIRA version whose bugs are to be listed in the JIRA report. This is a number, such as 12313306 (Sling API version 2.0.4). </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>site.javadoc.exclude</TT> </TD>
+<TD class="confluenceTd"> The Java packages to not include with the JavaDoc generation. By default all packages containing <TT>impl</TT> or <TT>internal</TT> in their name are excluded. To add more packages for exclusion, list them in the format suitable for the <A href="http://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html#excludePackageNames" class="external-link" rel="nofollow"><TT>excludePackageNames</TT></A> property of the Maven JavaDoc plugin. For example, to exclude any <TT>jsp</TT> and <TT>juli</TT> packages (see the <EM>scripting/jsp</EM> bundle), this property would be set to <TT>&#42;.jsp:&#42;.juli</TT>. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+        <DIV class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+Last modified by aheimoz on 2010-08-13 06:37:06.0
+        </DIV>
+        <DIV class="trademarkFooter">
+Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
+        </DIV>
+    </DIV>
+  </BODY>
+</HTML>
+

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

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

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

Added: sling/site/trunk/content/site/downloads.cgi
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/site/downloads.cgi?rev=1420577&view=auto
==============================================================================
--- sling/site/trunk/content/site/downloads.cgi (added)
+++ sling/site/trunk/content/site/downloads.cgi Wed Dec 12 09:13:50 2012
@@ -0,0 +1,6 @@
+!/bin/sh
+# Wrapper script around mirrors.cgi script
+# (we must change to that directory in order for python to pick up the
+#  python includes correctly)
+cd /www/www.apache.org/dyn/mirrors
+/www/www.apache.org/dyn/mirrors/mirrors.cgi $*

Propchange: sling/site/trunk/content/site/downloads.cgi
------------------------------------------------------------------------------
    svn:eol-style = LF

Propchange: sling/site/trunk/content/site/downloads.cgi
------------------------------------------------------------------------------
    svn:keywords = Id