incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r818667 [2/18] - in /websites/staging/sling/trunk/content: ./ authentication/ documentation/ documentation/bundles/ documentation/development/ documentation/getting-started/ documentation/the-sling-engine/ documentation/the-sling-engine/aut...
Date Tue, 22 May 2012 09:41:27 GMT
Added: websites/staging/sling/trunk/content/documentation/bundles/content-loading-jcr-contentloader.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/bundles/content-loading-jcr-contentloader.html (added)
+++ websites/staging/sling/trunk/content/documentation/bundles/content-loading-jcr-contentloader.html Tue May 22 09:41:22 2012
@@ -0,0 +1,293 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+  <head>
+    <title>Apache Sling - Content Loading and Nodetype Support (jcr.contentloader)</title>
+    <link rel="stylesheet" href="/css/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><strong>Documentation</strong> <br />
+<a href="/getting-started.html">Getting Started</a> <br />
+<a href="/the-sling-engine.html">The Sling Engine</a> <br />
+<a href="/development.html">Development</a> <br />
+<a href="/bundles.html">Bundles</a> <br />
+<a href="/tutorials-how-tos.html">Tutorials &amp; How-Tos</a> <br />
+<a href="/configuration.html">Configuration</a> <br />
+<a href="http://s.apache.org/sling.wiki">Wiki</a> <br />
+<a href="http://s.apache.org/sling.faq">FAQ</a> <br />
+<a href="/sitemap.html">Site Map</a></p>
+<p><strong>API Docs</strong>  <br />
+<a href="http://sling.apache.org/apidocs/sling6/index.html">Sling 6</a> <br />
+<a href="http://sling.apache.org/apidocs/sling5/index.html">Sling 5</a> <br />
+</p>
+<p><strong>Project info</strong> <br />
+<a href="http://sling.apache.org/site/downloads.cgi">Downloads</a> <br />
+<a href="http://www.apache.org/licenses/">License</a> <br />
+<a href="/contributing.html">Contributing</a> <br />
+<a href="/news.html">News</a> <br />
+<a href="/links.html">Links</a> <br />
+<a href="/project-information.html">Project Information</a> <br />
+<a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a> <br />
+<a href="http://svn.apache.org/viewvc/sling/trunk">Browse Source Repository</a> <br />
+<a href="/security.html">Security</a> <br />
+</p>
+<p><strong>Sponsorship</strong> <br />
+<a href="http://www.apache.org/foundation/thanks.html">Thanks</a> <br />
+<a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a> <br />
+<a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a> <br />
+</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>
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/bundles.html">Bundles</a>
+      </div>
+      <h1>Content Loading and Nodetype Support (jcr.contentloader)</h1>
+      <p>Apache Sling provides support for initial content loading into a repository and for registering node types. The <code>sling-jcr-contentloader</code> bundle provides loading of content from a bundle into the repository and the <code>sling-jcr-base</code> bundle provides node type registration.</p>
+<h2 id="initial-content-loading">Initial Content Loading</h2>
+<p>Bundles can provide initial content, which is loaded into the repository when the bundle has entered the <em>started</em> state. Such content is expected to be contained in the bundles accessible through the Bundle entry API methods. Content to be loaded is declared in the <code>Sling-Initial-Content</code> bundle manifest header. This header takes a comma-separated list of bundle entry paths. Each entry and all its child entries are accessed and entered into starting with the child entries of the listed entries.</p>
+<p>Adding this content preserves the paths of the entries as show in this table, which assumes a <code>Sling-Initial-Content</code> header entry of <code>SLING-INF/content</code>:
+| Entry | Repository Path |
+|--|--|
+| <code>SLING-INF/content/home</code> | <code>/home</code> |
+| <code>SLING-INF/content/content/playground/en/home</code> | <code>/content/playground/en/home</code> |
+Bundle entries are installed as follows:
+| Entry Type | Installation method |
+|--|--|
+| Directory | Created as a node of type <code>nt:folder</code> unless a content definition file of the same name exists in the same directory as the directory to be installed. Example: A directory <code>SLING-INF/content/dir</code> is installed as node <code>/dir</code> of type <code>nt:folder</code> unless a <code>SLING-INF/content/dir.xml</code> or <code>SLING-INF/content/dir.json</code> file exists which defines the content for the <code>/dir</code> node. |
+| File | Unless the file is a content definition file (see below) an <code>nt:file</code> node is created for the file and an <code>nt:resource</code> node is created as its <code>jcr:content</code> child node to take the contents of the bundle file. The properties of the <code>nt:resource</code> node are set from file information as available. If the file is a content definition file, the content is created as defined in the file. See below for the content definition file specification. |
+It is possible to modify the intial content loading default behaviour by using certain optional directives. Directives should be specified separated by semicolon. They are defined as follows:
+| Directive | Definition | Default value | Description |
+|--|--|--|--|
+| <code>overwrite</code> | <code>overwrite:=(true\|false)</code> | <code>false</code> | The overwrite directive specifies if content nodes should be overwritten or just initially added.  If this is true, existing nodes are deleted and a new node is created in the same place. |
+| <code>overwriteProperties</code> | <code>overwriteProperties:=(true\|false)</code> | <code>false</code> | The overwriteProperties directive specifying if content properties should be overwritten or just initially added. |
+| <code>uninstall</code> | <code>uninstall:=(true\|false)</code> | <code>overwrite</code> | The uninstall directive specifies if content should be uninstalled when bundle is unregistered. This value defaults to the value of the <code>overwrite</code> directive. |
+| <code>path</code> | <code>path:=*/target/location{*</code>} | <code>/</code> | The path directive specifies the target node where initial content will be loaded. If the path does not exist yet in the repository, it is created by the content loader. The intermediate nodes are of type <code>nt:folder</code>. |
+| <code>checkin</code> | <code>checkin:=(true\|false)</code> | <code>false</code> | The checkin directive specifies whether versionable nodes should be checked in. |
+| <code>ignoreImportProviders</code> | <code>ignoreImportProviders:=list of extensions</code> | <code>empty</code> | This directive can be used to not run one of the configured extractors (see below). |
+Examples of these directives uses could be (assumes a Sling-Initial-Content header entry of SLING-INF/content):
+| Entry | Behaviour |
+|--|--|
+| <code>SLING-INF/content/home;overwrite:=true;uninstall:=true</code> | Overwrites already existing content in <em>/home</em> and uninstalls the content when the bundle is unregistered. |
+| <code>SLING-INF/content/home;overwriteProperties:=true</code> | Overwrites properties of existing content in <em>/home</em>. |
+| <code>SLING-INF/content/home;path:=/sites/sling*website</code> | if <em>/sites/sling</em>website<em> exists it loads the content into it. Otherwise, it loads the content into root node </em>/*. |
+| <code>SLING-INF/content/home;checkin:=true</code> | After content loading, versionable nodes are checked in. |</p>
+<h2 id="loading-initial-content-from-bundles">Loading initial content from bundles</h2>
+<p>Repository items to be loaded into the repository, when the bundle is first installed, may be defined in four ways:
+1. Directories
+1. Files
+1. XML descriptor files
+1. JSON descriptor files</p>
+<p>Depending on the bundle entry found in the location indicated by the Sling-Initial-Content bundle manifest header, nodes are created (and/or updated) as follows:</p>
+<h3 id="directories">Directories</h3>
+<p>Unless a node with the name of the directory already exists or has been defined in an XML or JSON descriptor file (see below) a directory is created as a node with the primary node type "nt:folder" in the repository.</p>
+<h3 id="files">Files</h3>
+<p>Unless a node with the name of the file already exists or has been defined in an XML or JSON descriptor file (see below) a file is created as two nodes in the repository. The node bearing the name of the file itself is created with the
+primary node type "nt:file". Underneath this file node, a resource node with the primary node type "nt:resource" is created, which is set to the contents of the file.</p>
+<p>The MIME type is derived from the file name extension by first trying to resolve it from the Bundle entry URL. If this does not resolve to a MIME type, the Sling MIME type resolution service is used to try to find a mime type. If all fals, the MIME type is defaulted to "application/octet-stream".&nbsp;&nbsp;</p>
+<h3 id="xml-descriptor-files">XML Descriptor Files</h3>
+<p>Nodes, Properties and in fact complete subtrees may be described in XML files using either the JCR SystemView format, or the format described below. In either case, the file must have the .xml extension.</p>
+<div class="codehilite"><pre><span class="nt">&lt;node&gt;</span>
+        <span class="c">&lt;!--</span>
+<span class="c">            optional on top level, defaults to XML file name without .xml extension</span>
+<span class="c">            required for child nodes</span>
+<span class="c">        --&gt;</span>
+        <span class="nt">&lt;name&gt;</span>xyz<span class="nt">&lt;/name&gt;</span>
+
+        <span class="c">&lt;!--</span>
+<span class="c">            optional, defaults to nt:unstructured</span>
+<span class="c">        --&gt;</span>
+        <span class="nt">&lt;primaryNodeType&gt;</span>nt:file<span class="nt">&lt;/primaryNodeType&gt;</span>
+
+        <span class="c">&lt;!--</span>
+<span class="c">            optional mixin node type</span>
+<span class="c">            may be repeated for multiple mixin node types</span>
+<span class="c">        --&gt;</span>
+        <span class="nt">&lt;mixinNodeType&gt;</span>mix:versionable<span class="nt">&lt;/mixinNodeType&gt;</span>
+        <span class="nt">&lt;mixinNodeType&gt;</span>mix:lockable<span class="nt">&lt;/mixinNodeType&gt;</span>
+
+        <span class="c">&lt;!--</span>
+<span class="c">            Optional properties for the node. Each &lt;property&gt; element defines</span>
+<span class="c">            a single property of the node. The element may be repeated.</span>
+<span class="c">        --&gt;</span>
+        <span class="nt">&lt;property&gt;</span>
+            <span class="c">&lt;!--</span>
+<span class="c">                required property name</span>
+<span class="c">            --&gt;</span>
+            <span class="nt">&lt;name&gt;</span>prop<span class="nt">&lt;/name&gt;</span>
+
+            <span class="c">&lt;!--</span>
+<span class="c">                value of the property.</span>
+<span class="c">                For multi-value properties, the values are defined by multiple</span>
+<span class="c">                &lt;value&gt; elements nested inside a &lt;values&gt; element instead of a</span>
+<span class="c">                single &lt;value&gt; element</span>
+<span class="c">            --&gt;</span>
+            <span class="nt">&lt;value&gt;</span>property value as string<span class="nt">&lt;/value&gt;</span>
+
+            <span class="c">&lt;!--</span>
+<span class="c">                Optional type of the property value, defaults to String.</span>
+<span class="c">                This must be one of the property type strings defined in the</span>
+<span class="c">                JCR PropertyType interface.</span>
+<span class="c">            &lt;type&gt;String&lt;/type&gt;</span>
+<span class="c">        &lt;/property&gt;</span>
+
+<span class="c">        &lt;!--</span>
+<span class="c">            Additional child nodes. May be further nested.</span>
+<span class="c">        --&gt;</span>
+        <span class="nt">&lt;node&gt;</span>
+        ....
+        <span class="nt">&lt;/node&gt;</span>
+    <span class="nt">&lt;/node&gt;</span>
+</pre></div>
+
+
+<h4 id="using-a-custom-xml-format">Using a custom XML format</h4>
+<p>By writing an XSLT stylesheet file, you can use whatever XML format you prefer. The XML file references an XSLT stylesheet by using the xml-stylesheet processing instruction: </p>
+<div class="codehilite"><pre><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
+<span class="cp">&lt;?xml-stylesheet href=&quot;my-transform.xsl&quot; type=&quot;text/xsl&quot;?&gt;</span> <span class="c">&lt;!-- The path to my-transform.xsl is relative to this file --&gt;</span>
+
+<span class="nt">&lt;your_custom_root_node&gt;</span>
+   <span class="nt">&lt;your_custom_element&gt;</span>
+   ...
+   <span class="nt">&lt;/your_custom_element&gt;</span>
+...
+<span class="nt">&lt;/your_custom_root_node&gt;</span>
+</pre></div>
+
+
+<p>The my-transform.xsl file is then responsible for translating your format into one of the supported XML formats:</p>
+<div class="codehilite"><pre><span class="k">&lt;xsl:stylesheet</span> <span class="na">version=</span><span class="s">&quot;1.0&quot;</span> <span class="na">xmlns:jcr=</span><span class="s">&quot;http://www.jcp.org/jcr/1.0&quot;</span> <span class="na">xmlns:mix=</span><span class="s">&quot;http://www.jcp.org/jcr/mix/1.0&quot;</span> 
+  <span class="na">xmlns:sv=</span><span class="s">&quot;http://www.jcp.org/jcr/sv/1.0&quot;</span> <span class="na">xmlns:sling=</span><span class="s">&quot;http://sling.apache.org/jcr/sling/1.0&quot;</span>
+  <span class="na">xmlns:rep=</span><span class="s">&quot;internal&quot;</span> <span class="na">xmlns:nt=</span><span class="s">&quot;http://www.jcp.org/jcr/nt/1.0&quot;</span> <span class="na">xmlns:xsl=</span><span class="s">&quot;http://www.w3.org/1999/XSL/Transform&quot;</span><span class="nt">&gt;</span>
+
+  <span class="k">&lt;xsl:template</span> <span class="na">match=</span><span class="s">&quot;your_custom_element&quot;</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;node&gt;</span>
+      ...
+    <span class="nt">&lt;/node&gt;</span>
+  <span class="k">&lt;/xsl:template&gt;</span>
+  ...
+<span class="k">&lt;/xsl:stylesheet&gt;</span>
+</pre></div>
+
+
+<h3 id="json-descriptor-files">JSON Descriptor Files</h3>
+<p>Nodes, Properties and in fact complete subtrees may be described in JSON files using the following skeleton structure (see <a href="">http://www.json.org</a> or information on the syntax of JSON) :</p>
+<div class="codehilite"><pre><span class="p">{</span>
+        <span class="sr">//</span> <span class="n">optional</span> <span class="n">node</span> <span class="n">name</span> <span class="n">on</span> <span class="n">top</span> <span class="n">level</span><span class="p">,</span> <span class="n">default</span> <span class="n">is</span> <span class="n">file</span> <span class="n">name</span> <span class="n">without</span> <span class="o">.</span><span class="n">json</span> <span class="n">ext</span><span class="o">.</span>
+        <span class="s">&quot;name&quot;</span><span class="p">:</span> <span class="s">&quot;nodename&quot;</span><span class="p">,</span>
+
+        <span class="sr">//</span> <span class="n">optional</span> <span class="n">primary</span> <span class="n">node</span> <span class="n">type</span><span class="p">,</span> <span class="n">default</span> <span class="s">&quot;nt:unstructured&quot;</span>
+        <span class="s">&quot;primaryNodeType&quot;</span><span class="p">:</span> <span class="s">&quot;sling:ScriptedComponent&quot;</span><span class="p">,</span>
+
+        <span class="sr">//</span> <span class="n">optional</span> <span class="n">mixin</span> <span class="n">node</span> <span class="n">types</span> <span class="n">as</span> <span class="n">array</span>
+        <span class="s">&quot;mixinNodeTypes&quot;</span><span class="p">:</span> <span class="p">[</span> <span class="p">],</span>
+
+        <span class="sr">//</span> <span class="n">the</span> <span class="s">&quot;properties&quot;</span> <span class="n">property</span> <span class="n">is</span> <span class="n">an</span> <span class="n">object</span> <span class="n">indexed</span> <span class="n">by</span> <span class="n">property</span> <span class="n">name</span> <span class="n">whose</span>
+        <span class="sr">//</span> <span class="n">value</span> <span class="n">is</span> <span class="n">either</span> <span class="n">the</span> <span class="n">string</span> <span class="n">property</span> <span class="n">value</span><span class="p">,</span> <span class="n">array</span> <span class="k">for</span> <span class="n">multi</span><span class="o">-</span><span class="nb">values</span> <span class="ow">or</span>
+        <span class="sr">//</span> <span class="n">an</span> <span class="n">object</span> <span class="n">whose</span> <span class="n">value</span><span class="p">[</span><span class="n">s</span><span class="p">]</span> <span class="n">property</span> <span class="n">denotes</span> <span class="n">the</span> <span class="n">property</span> <span class="n">value</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="ow">and</span>
+        <span class="sr">//</span> <span class="n">whose</span> <span class="n">type</span> <span class="n">property</span> <span class="n">denotes</span> <span class="n">the</span> <span class="n">property</span> <span class="n">type</span>
+        <span class="s">&quot;properties&quot;</span><span class="p">:</span> <span class="p">{</span>
+            <span class="s">&quot;sling:contentClass&quot;</span><span class="p">:</span> <span class="s">&quot;com.day.sling.jcr.test.Test&quot;</span><span class="p">,</span>
+            <span class="s">&quot;sampleMulti&quot;</span><span class="p">:</span> <span class="p">[</span> <span class="s">&quot;v1&quot;</span><span class="p">,</span> <span class="s">&quot;v2&quot;</span> <span class="p">],</span>
+            <span class="s">&quot;sampleStruct&quot;</span><span class="p">:</span> <span class="p">{</span>
+                <span class="s">&quot;value&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
+                <span class="s">&quot;type&quot;</span><span class="p">:</span> <span class="s">&quot;Long&quot;</span>
+            <span class="p">}</span>
+            <span class="s">&quot;sampleStructMulti&quot;</span><span class="p">:</span> <span class="p">{</span>
+                <span class="s">&quot;value&quot;</span><span class="p">:</span> <span class="p">[</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span> <span class="p">],</span>
+                <span class="s">&quot;type&quot;</span><span class="p">:</span> <span class="s">&quot;Long&quot;</span>
+            <span class="p">}</span>
+        <span class="p">},</span>
+
+        <span class="sr">//</span> <span class="n">the</span> <span class="s">&quot;nodes&quot;</span> <span class="n">property</span> <span class="n">is</span> <span class="n">an</span> <span class="n">array</span> <span class="n">of</span> <span class="n">objects</span> <span class="n">denoting</span> <span class="n">child</span> <span class="n">nodes</span><span class="o">.</span> <span class="n">Nodes</span>
+        <span class="sr">//</span> <span class="n">may</span> <span class="n">be</span> <span class="n">further</span> <span class="n">nested</span><span class="o">.</span>
+        <span class="s">&quot;nodes&quot;</span><span class="p">:</span> <span class="p">[</span>
+            <span class="p">{</span>
+                <span class="sr">//</span> <span class="n">the</span> <span class="n">name</span> <span class="n">property</span> <span class="n">is</span> <span class="n">required</span> <span class="n">on</span> <span class="p">(</span><span class="n">nested</span><span class="p">)</span> <span class="n">child</span> <span class="n">nodes</span>
+                <span class="s">&quot;name&quot;</span><span class="p">:</span> <span class="s">&quot;sling:scripts&quot;</span><span class="p">,</span>
+
+                <span class="s">&quot;primaryNodeType&quot;</span><span class="p">:</span> <span class="s">&quot;sling:ScriptList&quot;</span><span class="p">,</span>
+
+                <span class="s">&quot;nodes&quot;</span><span class="p">:</span> <span class="p">[</span>
+                    <span class="p">{</span>
+                        <span class="s">&quot;primaryNodeType&quot;</span><span class="p">:</span> <span class="s">&quot;sling:Script&quot;</span><span class="p">,</span>
+                        <span class="s">&quot;properties&quot;</span><span class="p">:</span> <span class="p">{</span>
+                            <span class="s">&quot;sling:name&quot;</span><span class="p">:</span> <span class="s">&quot;/test/content/jsp/start.jsp&quot;</span><span class="p">,</span>
+                            <span class="s">&quot;sling:type&quot;</span><span class="p">:</span> <span class="s">&quot;jsp&quot;</span><span class="p">,</span>
+                            <span class="s">&quot;sling:glob&quot;</span><span class="p">:</span> <span class="s">&quot;*&quot;</span>
+                        <span class="p">}</span>
+                    <span class="p">}</span>
+                <span class="p">]</span>
+            <span class="p">}</span>
+        <span class="p">]</span>
+    <span class="p">}</span>
+</pre></div>
+
+
+<h3 id="extractors">Extractors</h3>
+<p>By default, the <code>sling-jcr-contentloader</code> bundle tries to extract certain file types during content loading. These include <code>json</code>, <code>xml</code>, <code>zip</code>, and <code>jar</code> files. Therefore all available extractors are used for content processing. However if some files should be put into the repository unextracted, the <code>ignoreImportProviders</code> directive can be used with a comma separated list of extensions that should not be extracted, like <code>ignoreImportProviders:="jar,zip"</code>. Please note that the value needs to be put into quotation marks if more than one value is used like in the example.</p>
+<h3 id="workspace-targetting">Workspace Targetting</h3>
+<p>By default, initial content will be loaded into the default workspace. To override this, add a <code>Sling-Initial-Content-Workspace</code> bundle manifest header to specify the manifest. Note that <em>all</em> content from a bundle will be loaded into the same workspace. </p>
+<h2 id="declared-node-type-registration">Declared Node Type Registration</h2>
+<p>The <code>sling-jcr-base</code> bundle provides low-level repository operations which are at the heart of the functionality of Sling:
+<em> </em>Node Type Definitions* - The class <code>org.apache.sling.content.jcr.base.NodeTypeLoader</code> provides methods to register custom node types with a repository given a repository session and a node type definition file in CND format. This class is also used by this bundle to register node types on behalf of other bundles.</p>
+<p>Bundles may list node type definition files in CND format in the <code>Sling-Nodetypes</code> bundle header. This header is a comma-separated list of resources in the respective bundle. Each resource is taken and fed to the <code>NodeTypeLoader</code> to define the node types.</p>
+<p>After a bundle has entered the <em>resolved</em> state, the node types listed in the <code>Sling-Nodetypes</code> bundle header are registered with the repository.</p>
+<p>Node types installed by this mechanism will never be removed again by the <code>sling-jcr-base</code> bundle. </p>
+<p>Starting with revision 911430, re-registration of existing node types is enabled by default. To disable this, add <code>;rereigster:=false</code> to the resource names for which re-registration should be disabled.</p>
+<p>{warning}
+Support for re-registration of node types is relatively limited. In Jackrabbit, for example, only "trivial" changes are allowed.
+{warning}</p>
+<h3 id="automated-tests">Automated tests</h3>
+<p>The initial content found in the <a href="">sling-test folder of the launchpad initial content</a> is verified by the [InitialContentTest|http://svn.apache.org/repos/asf/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/InitialContentTest.java] when running the <em>launchpad/testing</em> integration tests.</p>
+<p>Those tests can be used as verified examples of initial content loading. Contributions are welcome to improve the coverage of those tests.</p>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+        Rev. 1341376 by fmeschbe on Tue, 22 May 2012 09:41:06 +0000
+      </div>
+      <div class="trademarkFooter"> 
+        Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project
+        logo are trademarks of The Apache Software Foundation. All other marks mentioned
+        may be trademarks or registered trademarks of their respective owners.
+      </div>
+    </div>
+  </body>
+</html>

Added: websites/staging/sling/trunk/content/documentation/bundles/internationalization-support-i18n.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/bundles/internationalization-support-i18n.html (added)
+++ websites/staging/sling/trunk/content/documentation/bundles/internationalization-support-i18n.html Tue May 22 09:41:22 2012
@@ -0,0 +1,208 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+  <head>
+    <title>Apache Sling - Internationalization Support (i18n)</title>
+    <link rel="stylesheet" href="/css/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><strong>Documentation</strong> <br />
+<a href="/getting-started.html">Getting Started</a> <br />
+<a href="/the-sling-engine.html">The Sling Engine</a> <br />
+<a href="/development.html">Development</a> <br />
+<a href="/bundles.html">Bundles</a> <br />
+<a href="/tutorials-how-tos.html">Tutorials &amp; How-Tos</a> <br />
+<a href="/configuration.html">Configuration</a> <br />
+<a href="http://s.apache.org/sling.wiki">Wiki</a> <br />
+<a href="http://s.apache.org/sling.faq">FAQ</a> <br />
+<a href="/sitemap.html">Site Map</a></p>
+<p><strong>API Docs</strong>  <br />
+<a href="http://sling.apache.org/apidocs/sling6/index.html">Sling 6</a> <br />
+<a href="http://sling.apache.org/apidocs/sling5/index.html">Sling 5</a> <br />
+</p>
+<p><strong>Project info</strong> <br />
+<a href="http://sling.apache.org/site/downloads.cgi">Downloads</a> <br />
+<a href="http://www.apache.org/licenses/">License</a> <br />
+<a href="/contributing.html">Contributing</a> <br />
+<a href="/news.html">News</a> <br />
+<a href="/links.html">Links</a> <br />
+<a href="/project-information.html">Project Information</a> <br />
+<a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a> <br />
+<a href="http://svn.apache.org/viewvc/sling/trunk">Browse Source Repository</a> <br />
+<a href="/security.html">Security</a> <br />
+</p>
+<p><strong>Sponsorship</strong> <br />
+<a href="http://www.apache.org/foundation/thanks.html">Thanks</a> <br />
+<a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a> <br />
+<a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a> <br />
+</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>
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/bundles.html">Bundles</a>
+      </div>
+      <h1>Internationalization Support (i18n)</h1>
+      <p>Internationalization support in Sling consists of four methods in the <code>SlingHttpServletRequest</code> interface:</p>
+<ul>
+<li><code>getLocale()</code> -- Returns the primary <code>Locale</code> for the current request. This method is inherited from the <code>javax.servlet.ServletRequest</code> interface.</li>
+<li><code>getLocales()</code> -- Returns the <code>Locale</code> instances for the current request. This method is inherited from the <code>javax.servlet.ServletRequest</code> interface.</li>
+<li><code>getResourceBundle(Locale)</code> -- Returns a <code>ResourceBundle</code> for the given <code>Locale</code>. This method is specific to Sling.</li>
+<li><code>getResourceBundle(String, Locale)</code> -- Returns a <code>ResourceBundle</code> of a given base name for the given <code>Locale</code>. This method is specific to Sling.</li>
+</ul>
+<p>These methods have a default implementation in the <code>org.apache.sling.core</code> bundle and an extended and extensible implementation in the <code>org.apache.sling.i18n</code> bundle.</p>
+<h2 id="default-implementation-in-the-orgapacheslingengine-bundle">Default Implementation in the <code>org.apache.sling.engine</code> Bundle</h2>
+<p>The default implementation of the above mentioned four methods in the Sling Engine bundle is contained in the bundle-private class <code>org.apache.sling.engine.impl.SlingHttpServletRequestImpl</code> which is the primary implementation of the <code>SlingHttpServletRequest</code> interface:</p>
+<ul>
+<li><code>getLocale()</code> -- Returns the <code>Locale</code> from the request object of the servlet container in which Sling is running. As per the Servlet API specification, this is either the primary Locale of the <code>Accept-Language</code> request header or the server default locale.</li>
+<li><code>getLocales()</code> -- Returns the <code>Enumeration</code> from the request object of the servlet container in which Sling is running. As per the Servlet API specification, this is either based on the <code>Accept-Language</code> request header or just the server default locale.</li>
+<li><code>getResourceBundle(Locale)</code> -- Returns a <code>ResourceBundle</code> whose <code>getString(String key)</code> method returns the <code>key</code> as the message and whose <code>getKeys()</code> method returns an empty <code>Enumeration</code>.</li>
+<li><code>getResourceBundle(String, Locale)</code> -- Returns a <code>ResourceBundle</code> whose <code>getString(String key)</code> method returns the <code>key</code> as the message and whose <code>getKeys()</code> method returns an empty <code>Enumeration</code>.</li>
+</ul>
+<p>NOTE: Unlike the default implementations of the <code>ResourceBundle</code> abstract class in the Java Runtime -- <code>PropertyResourceBundle</code> and <code>ListResourceBundle</code> -- the <code>ResourceBundle</code> returned by the default implementation of the <code>getResourceBundle(Locale)</code> and <code>getResourceBundle(String, Locale)</code> always returns a string message for any key, which is the key itself. This prevents throwing <code>MissingResourceException</code>.</p>
+<h2 id="extensible-implementation-in-the-orgapacheslingi18n-bundle">Extensible Implementation in the <code>org.apache.sling.i18n</code> Bundle</h2>
+<p>The <code>org.apache.sling.i18n</code> Bundle implements a request level <code>Filter</code> providing extensible implementations of the above mentioned three methods. Extensibility is attained by defining two service interfaces:</p>
+<ul>
+<li>
+<p><code>LocaleResolver</code> -- The <code>LocaleResolver</code> interface defines a method which may be implemented by a service outside of the sling.i18n bundle. If no such service is registered the default behaviour is as described above for the sling.core bundle. The service described by this interface is used to implement the <code>getLocale()</code> and <code>getLocales()</code> method. </p>
+</li>
+<li>
+<p><code>ResourceBundleProvider</code> -- The <code>ResourceBundleProvider</code> interface defines two methods to acquire a <code>ResourceBundle</code> for any <code>Locale</code> and an optional base name. This service interface is not intended to be implemented outside of the sling.i18n bundle: A JCR Repository based implementation is contained in the sling.i18n bundle. The <code>ResourceBundleProvider</code> service is not only used within the sling.i18n bundle to implement the <code>SlingHttpServletRequest.getResourceBundle(Locale)</code> and  <code>SlingHttpServletRequest.getResourceBundle(String, Locale)</code> methods. The service may also be used by Sling applications to acquire <code>ResourceBundle</code> instances without having a request object by getting the service and calling its <code>getResourceBundle(Locale)</code> or <code>getResourceBundle(String, Locale)</code> method directly.</p>
+</li>
+</ul>
+<h3 id="jcr-repository-based-resourcebundleprovider">JCR Repository based <code>ResourceBundleProvider</code></h3>
+<p>The sling.i18n Bundle provides the implementation of the <code>ResourceBundleProvider</code> interface, which may also be used outside of Sling requests for service tasks. This implementation gets the messages from a JCR Repository stored below nodes of the mixin node type <code>mix:language</code>. These language nodes have a <code>jcr:language</code> property naming the language of the resources. In the context of the JCR based <code>ResourceBundleProvider</code> this is of course expected to be the string value of respective <code>Locale</code>.</p>
+<p>The (direct) child nodes of the <code>mix:language</code> node must contain two special properties naming the key string and the message:</p>
+<ul>
+<li><code>sling:key</code> -- The <code>sling:key</code> property is a string property being the key for which the node contains the message(s).</li>
+<li><code>sling:message</code> -- The <code>sling:message</code> property represents the resource for the key.</li>
+</ul>
+<p>The exact location of these nodes is not relevant as the <code>ResourceBundleProvider</code> finds them by applying a JCR search. It is only required that the message nodes are located below <code>mix:language</code> nodes. Such structures may also be scattered in the repository to allow storing message resources next to where they are most likely used, such as request scripts.</p>
+<h3 id="resourcebundle-with-base-names"><code>ResourceBundle</code> with base names</h3>
+<p>Similar to standard Java <code>ResourceBundle</code> instances, Sling <code>ResourceBundle</code> instances may be created for base names through any of the <code>getResourceBundle(String, Locale)</code> methods. These methods use the base name parameter as a selector for the values of the <code>sling:basename</code> property of the <code>mix:language</code> nodes.</p>
+<p>The base name argument can take one three values:</p>
+<table>
+<thead>
+<tr>
+<th>Value</th>
+<th><code>ResourceBundle</code> selection</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>null</code></td>
+<td>Selects messages of <code>mix:language</code> nodes ignoring the existence or absence of <code>sling:basename</code> properties</td>
+</tr>
+<tr>
+<td>Empty String</td>
+<td>Selects messages of <code>mix:language</code> nodes which have <code>sling:basename</code> properties, ignoring the actual values</td>
+</tr>
+<tr>
+<td>Any other Value</td>
+<td>Selects messages of <code>mix:language</code> nodes whose <code>sling:basename</code> properties has any value which matches the base name string</td>
+</tr>
+</tbody>
+</table>
+<p>The <code>sling:basename</code> property may be multi-valued, that is the messages of a <code>mix:language</code> nodes may belong to multiple base names and thus <code>ResourceBundle</code> instances.</p>
+<h3 id="sample-resources">Sample Resources</h3>
+<p>Consider the following repository content:</p>
+<div class="codehilite"><pre>   <span class="sr">/libs/</span><span class="n">languages</span>
+           <span class="o">+--</span> <span class="n">English</span> <span class="p">(</span><span class="n">nt:folder</span><span class="p">,</span> <span class="n">mix:language</span><span class="p">)</span>
+           <span class="o">|</span>    <span class="o">+--</span> <span class="n">jcr:language</span> <span class="o">=</span> <span class="n">en</span>
+           <span class="o">|</span>    <span class="o">+--</span> <span class="n">m1</span> <span class="p">(</span><span class="n">sling:messageEntry</span><span class="p">)</span>
+           <span class="o">|</span>    <span class="o">|</span>    <span class="o">+--</span> <span class="n">sling:key</span> <span class="o">=</span> <span class="s">&quot;msg001&quot;</span>
+           <span class="o">|</span>    <span class="o">|</span>    <span class="o">+--</span> <span class="n">slign:message</span> <span class="o">=</span> <span class="s">&quot;This is a message&quot;</span>
+           <span class="o">|</span>    <span class="o">+--</span> <span class="n">m2</span> <span class="p">(</span><span class="n">sling:messageEntry</span><span class="p">)</span>
+           <span class="o">|</span>         <span class="o">+--</span> <span class="n">sling:key</span> <span class="o">=</span> <span class="s">&quot;msg002&quot;</span>
+           <span class="o">|</span>         <span class="o">+--</span> <span class="n">slign:message</span> <span class="o">=</span> <span class="s">&quot;Another message&quot;</span>
+           <span class="o">+--</span> <span class="n">Deutsch</span> <span class="p">(</span><span class="n">nt:folder</span><span class="p">,</span> <span class="n">mix:language</span><span class="p">)</span>
+                <span class="o">+--</span> <span class="n">jcr:language</span> <span class="o">=</span> <span class="n">de</span>
+                <span class="o">+--</span> <span class="n">m1</span> <span class="p">(</span><span class="n">sling:messageEntry</span><span class="p">)</span>
+                <span class="o">|</span>    <span class="o">+--</span> <span class="n">sling:key</span> <span class="o">=</span> <span class="s">&quot;msg001&quot;</span>
+                <span class="o">|</span>    <span class="o">+--</span> <span class="n">slign:message</span> <span class="o">=</span> <span class="s">&quot;Das ist ein Text&quot;</span>
+                <span class="o">+--</span> <span class="n">m2</span> <span class="p">(</span><span class="n">sling:messageEntry</span><span class="p">)</span>
+                     <span class="o">+--</span> <span class="n">sling:key</span> <span class="o">=</span> <span class="s">&quot;msg002&quot;</span>
+                     <span class="o">+--</span> <span class="n">slign:message</span> <span class="o">=</span> <span class="s">&quot;Ein anderer Text&quot;</span>
+
+   <span class="sr">/apps/m</span><span class="n">yApp</span>
+           <span class="o">+--</span> <span class="n">English</span> <span class="p">(</span><span class="n">nt:folder</span><span class="p">,</span> <span class="n">mix:language</span><span class="p">)</span>
+           <span class="o">|</span>    <span class="o">+--</span> <span class="n">jcr:language</span> <span class="o">=</span> <span class="n">en</span>
+           <span class="o">|</span>    <span class="o">+--</span> <span class="n">mx</span> <span class="p">(</span><span class="n">sling:messageEntry</span><span class="p">)</span>
+           <span class="o">|</span>         <span class="o">+--</span> <span class="n">sling:key</span> <span class="o">=</span> <span class="s">&quot;msgXXX&quot;</span>
+           <span class="o">|</span>         <span class="o">+--</span> <span class="n">slign:message</span> <span class="o">=</span> <span class="s">&quot;An Application Text&quot;</span>
+           <span class="o">+--</span> <span class="n">Deutsch</span> <span class="p">(</span><span class="n">nt:folder</span><span class="p">,</span> <span class="n">mix:language</span><span class="p">)</span>
+                <span class="o">+--</span> <span class="n">jcr:language</span> <span class="o">=</span> <span class="n">de</span>
+                <span class="o">+--</span> <span class="n">mx</span> <span class="p">(</span><span class="n">sling:messageEntry</span><span class="p">)</span>
+                     <span class="o">+--</span> <span class="n">sling:key</span> <span class="o">=</span> <span class="s">&quot;msgXXX&quot;</span>
+                     <span class="o">+--</span> <span class="n">slign:message</span> <span class="o">=</span> <span class="s">&quot;Ein Anwendungstext&quot;</span>
+</pre></div>
+
+
+<p>This content defines two languages <em>en</em> and <em>de</em> with three messages <em>msg001</em>, <em>msg002</em> and <em>msgXXX</em> each. The names of the respective nodes have no significance at all because all information required is extracted from the <code>jcr:language</code>, <code>sling:key</code> and <code>sling:message</code> properties.</p>
+<h3 id="jcr-node-types-supporting-the-jcr-repository-based-resourcebundleprovider">JCR Node Types supporting the JCR Repository based <code>ResourceBundleProvider</code></h3>
+<p>The sling.i18n bundle asserts the following node types:</p>
+<p><DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>mix:language</B></DIV><DIV class="codeContent panelContent">
+    [mix:language]
+        mixin
+      - jcr:language (string)</p>
+<p>The <code>mix:language</code> mixin node type allows setting the <code>jcr:language</code> property required by the <code>ResourceBundleProvider</code> implementation to identify the message <code>Locale</code>.</p>
+<p><DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>sling:message and sling:messageEntry</B></DIV><DIV class="codeContent panelContent">
+    [sling:message]
+        mixin
+      - sling:key (string)
+      - sling:message (undefined)</p>
+<div class="codehilite"><pre><span class="p">[</span><span class="n">sling:messageEntry</span><span class="p">]</span> <span class="o">&gt;</span> <span class="n">nt:hierarchyNode</span><span class="p">,</span> <span class="n">sling:message</span>
+</pre></div>
+
+
+<p>The <code>sling:message</code> and <code>slign:messageEntry</code> are helper node types which may be used to create the nodes with the <code>sling:key</code> and <code>sling:message</code> properties required by the <code>ResourceBundleProvider</code>. The node types themselves are not required but by defining the required properties, they may be of use.</p>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+        Rev. 1341376 by fmeschbe on Tue, 22 May 2012 09:41:06 +0000
+      </div>
+      <div class="trademarkFooter"> 
+        Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project
+        logo are trademarks of The Apache Software Foundation. All other marks mentioned
+        may be trademarks or registered trademarks of their respective owners.
+      </div>
+    </div>
+  </body>
+</html>

Added: websites/staging/sling/trunk/content/documentation/bundles/jcr-installer-provider.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/bundles/jcr-installer-provider.html (added)
+++ websites/staging/sling/trunk/content/documentation/bundles/jcr-installer-provider.html Tue May 22 09:41:22 2012
@@ -0,0 +1,201 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+  <head>
+    <title>Apache Sling - JCR Installer Provider</title>
+    <link rel="stylesheet" href="/css/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><strong>Documentation</strong> <br />
+<a href="/getting-started.html">Getting Started</a> <br />
+<a href="/the-sling-engine.html">The Sling Engine</a> <br />
+<a href="/development.html">Development</a> <br />
+<a href="/bundles.html">Bundles</a> <br />
+<a href="/tutorials-how-tos.html">Tutorials &amp; How-Tos</a> <br />
+<a href="/configuration.html">Configuration</a> <br />
+<a href="http://s.apache.org/sling.wiki">Wiki</a> <br />
+<a href="http://s.apache.org/sling.faq">FAQ</a> <br />
+<a href="/sitemap.html">Site Map</a></p>
+<p><strong>API Docs</strong>  <br />
+<a href="http://sling.apache.org/apidocs/sling6/index.html">Sling 6</a> <br />
+<a href="http://sling.apache.org/apidocs/sling5/index.html">Sling 5</a> <br />
+</p>
+<p><strong>Project info</strong> <br />
+<a href="http://sling.apache.org/site/downloads.cgi">Downloads</a> <br />
+<a href="http://www.apache.org/licenses/">License</a> <br />
+<a href="/contributing.html">Contributing</a> <br />
+<a href="/news.html">News</a> <br />
+<a href="/links.html">Links</a> <br />
+<a href="/project-information.html">Project Information</a> <br />
+<a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a> <br />
+<a href="http://svn.apache.org/viewvc/sling/trunk">Browse Source Repository</a> <br />
+<a href="/security.html">Security</a> <br />
+</p>
+<p><strong>Sponsorship</strong> <br />
+<a href="http://www.apache.org/foundation/thanks.html">Thanks</a> <br />
+<a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a> <br />
+<a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a> <br />
+</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>
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/bundles.html">Bundles</a>
+      </div>
+      <h1>JCR Installer Provider</h1>
+      <p>The JCR installer provider scans the JCR repository for artifacts and provides them to the <a href="">OSGI installer</a>.</p>
+<h2 id="configuration-and-scanning">Configuration and Scanning</h2>
+<p>The JCR installer provider can be configured with weighted paths which are scanned. By default, the installer scans in <em>/apps</em> and <em>/libs</em> where artifacts found in <em>/apps</em> get a higher priority. The installer does a deep scan and uses a regular expression to detect folders containing artifacts to be installed. By default, artifacts from within a folder named <em>install</em> are provided to the OSGi installer.</p>
+<p>If such an install folder contains a binary artifact (e.g. a bundle) this is provided to the OSGi installer. In addition a node of type <em>sling:OsgiConfig</em> is provided as a configuration to the installer.</p>
+<p>The jcr installer provider does not check or scan the artifacts itself, the detection and installation is deferred to the OSGi installer.</p>
+<h3 id="runmode-support">Runmode Support</h3>
+<p>The JCR installer supports run modes for installing artifacts. By default folders named <em>install</em> are checked for artifacts. If Apache Sling is started with one (or more run modes), all folders named <em>install.<a href="">RUNMODE</a></em> are scanned as well. To be precise, the folder name can be followed by any number of run modes separated by comma. For example, if started with run modes <em>dev</em>, <em>a1</em>, and <em>public</em>, folders like <em>install.dev</em>, <em>install.a1</em>, <em>install.public</em> are searched as well as <em>install.dev.a1</em>, or <em>install.a1.dev</em>.</p>
+<p>Artifacts from folders with a run mode get a higher priority. For example by default, an <em>install</em> folder underneath <em>/libs</em> gets the priority <em>50</em>. For each run mode in the folder name, this priority is increased by <em>1</em>, so <em>install.dev</em> has <em>51</em> and <em>install.a1.dev</em> is <em>52</em>.</p>
+<h1 id="example">Example</h1>
+<p>Here's a quick walkthrough of the JCR installer functionality.</p>
+<h2 id="installation">Installation</h2>
+<p>Start the Sling <a href="">launchpad/app</a> and install and start the following additional bundles:
+<em> <a href="/old-stuff/run-modes-org-apache-sling-runmode.html">RunMode service</a>
+</em> OSGi installer service (<a href="">org.apache.sling.osgi.installer</a>)
+* JCR installer provider (<a href="">org.apache.sling.jcr.jcrinstall</a>)</p>
+<p>To watch the logs produced by these modules, you can filter <code>sling/logs/error.log</code> using <code>egrep 'jcrinstall|osgi.installer'</code>.</p>
+<h2 id="install-and-remove-a-bundle">Install and remove a bundle</h2>
+<p>We'll use the <a href="">Knopflerfish Desktop</a> bundle for this example, it is convenient as it displays a graphical user interface when started.</p>
+<p>We use <code>curl</code> to create content, to make it easy to reproduce the example by copying and pasting the <code>curl</code> commands. Any other way to create content in the repository will work, of course.</p>
+<p>By default, JCRInstall picks up bundles found in folders named <em>install</em> under <code>/libs</code> and <code>/apps</code>, so we start by creating such a folder:</p>
+<div class="codehilite"><pre><span class="n">curl</span> <span class="o">-</span><span class="n">X</span> <span class="n">MKCOL</span>  <span class="n">http:</span><span class="sr">//</span><span class="n">admin:admin</span><span class="nv">@localhost:8888</span><span class="sr">/apps/</span><span class="n">jcrtest</span>
+<span class="n">curl</span> <span class="o">-</span><span class="n">X</span> <span class="n">MKCOL</span>  <span class="n">http:</span><span class="sr">//</span><span class="n">admin:admin</span><span class="nv">@localhost:8888</span><span class="sr">/apps/</span><span class="n">jcrtest</span><span class="o">/</span><span class="n">install</span>
+</pre></div>
+
+
+<p>And we copy the bundle to install in that folder (a backslash in command lines means <em>continued on next line</em>):</p>
+<div class="codehilite"><pre><span class="n">curl</span> <span class="o">-</span><span class="n">T</span> <span class="n">desktop_awt_all</span><span class="o">-</span><span class="mf">2.0.0</span><span class="o">.</span><span class="n">jar</span> <span class="o">\</span>
+  <span class="n">http:</span><span class="sr">//</span><span class="n">admin:admin</span><span class="nv">@localhost:8888</span><span class="sr">/apps/</span><span class="n">jcrtest</span><span class="sr">/install/</span><span class="n">desktop_awt_all</span><span class="o">-</span><span class="mf">2.0.0</span><span class="o">.</span><span class="n">jar</span>
+</pre></div>
+
+
+<p>That's it. After 2-3 seconds, the bundle should be picked up by JCRInstall, installed and started. If this works you'll see a small <em>Knopflerfish Desktop</em> window on your desktop, and Sling's OSGi console can of course be used to check the details.</p>
+<p>Removing the bundle from the repository will cause it to be uninstalled, so:</p>
+<div class="codehilite"><pre><span class="n">curl</span> <span class="o">-</span><span class="n">X</span> <span class="n">DELETE</span> <span class="o">\</span>
+  <span class="n">http:</span><span class="sr">//</span><span class="n">admin:admin</span><span class="nv">@localhost:8888</span><span class="sr">/apps/</span><span class="n">jcrtest</span><span class="sr">/install/</span><span class="n">desktop_awt_all</span><span class="o">-</span><span class="mf">2.0.0</span><span class="o">.</span><span class="n">jar</span>
+</pre></div>
+
+
+<p>Should cause the <em>Knopflerfish Desktop</em> window to disappear as the bundle is uninstalled.</p>
+<h2 id="install-modify-and-remove-a-configuration">Install, modify and remove a configuration</h2>
+<p>JCRInstall installs OSGi configurations from nodes having the <em>sling:OsgiConfig</em> node type, found in folders named <em>install</em> under the installation roots (/apps and /libs).</p>
+<p>Let's try this feature by creating a configuration with two properties:</p>
+<div class="codehilite"><pre><span class="n">curl</span> <span class="o">\</span>
+  <span class="o">-</span><span class="n">F</span> <span class="s">&quot;jcr:primaryType=sling:OsgiConfig&quot;</span> <span class="o">\</span>
+  <span class="o">-</span><span class="n">F</span> <span class="n">foo</span><span class="o">=</span><span class="n">bar</span> <span class="o">-</span><span class="n">F</span> <span class="n">works</span><span class="o">=</span><span class="n">yes</span> <span class="o">\</span>
+  <span class="n">http:</span><span class="sr">//</span><span class="n">admin:admin</span><span class="nv">@localhost:8888</span><span class="sr">/apps/</span><span class="n">jcrtest</span><span class="sr">/install/som</span><span class="n">e</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">pid</span>
+</pre></div>
+
+
+<p>And verify the contents of our config node:</p>
+<div class="codehilite"><pre><span class="n">curl</span> <span class="o">\</span>
+  <span class="n">http:</span><span class="sr">//</span><span class="n">admin:admin</span><span class="nv">@localhost:8888</span><span class="sr">/apps/</span><span class="n">jcrtest</span><span class="sr">/install/som</span><span class="n">e</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">pid</span><span class="o">.</span><span class="n">json</span>
+</pre></div>
+
+
+<p>Which should display something like</p>
+<div class="codehilite"><pre><span class="p">{</span><span class="s">&quot;foo&quot;</span><span class="p">:</span><span class="s">&quot;bar&quot;</span><span class="p">,</span>
+<span class="s">&quot;jcr:created&quot;</span><span class="p">:</span><span class="s">&quot;Wed Aug 26 2009 17:06:40GMT+0200&quot;</span><span class="p">,</span>
+<span class="s">&quot;jcr:primaryType&quot;</span><span class="p">:</span><span class="s">&quot;sling:OsgiConfig&quot;</span><span class="p">,</span><span class="s">&quot;works&quot;</span><span class="p">:</span><span class="s">&quot;yes&quot;</span><span class="p">}</span>
+</pre></div>
+
+
+<p>At this point, JCRInstall should have picked up our new config and installed it. The logs would confirm that, but we can also use the OSGi console's config status page (http://localhost:8888/system/console/config) to check it. That page should now contain:</p>
+<div class="codehilite"><pre><span class="n">PID</span><span class="o">=</span><span class="n">some</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">pid</span>
+  <span class="n">BundleLocation</span><span class="o">=</span><span class="n">Unbound</span>
+  <span class="n">_jcr_config_path</span><span class="o">=</span><span class="n">jcrinstall:</span><span class="sr">/apps/</span><span class="n">jcrtest</span><span class="sr">/install/som</span><span class="n">e</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">pid</span>
+  <span class="n">foo</span><span class="o">=</span><span class="n">bars</span>
+  <span class="n">service</span><span class="o">.</span><span class="n">pid</span><span class="o">=</span><span class="n">some</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">pid</span>
+  <span class="n">works</span><span class="o">=</span><span class="n">yes</span>
+</pre></div>
+
+
+<p>Indicating that the configuration has been installed.</p>
+<p>Let's try modifying the configuration parameters:</p>
+<div class="codehilite"><pre><span class="n">curl</span> <span class="o">\</span>
+  <span class="o">-</span><span class="n">F</span> <span class="n">works</span><span class="o">=</span><span class="n">updated</span> <span class="o">-</span><span class="n">F</span> <span class="n">even</span><span class="o">=</span><span class="n">more</span> <span class="o">\</span>
+  <span class="n">http:</span><span class="sr">//</span><span class="n">admin:admin</span><span class="nv">@localhost:8888</span><span class="sr">/apps/</span><span class="n">jcrtest</span><span class="sr">/install/som</span><span class="n">e</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">pid</span>
+</pre></div>
+
+
+<p>And check the changes in the console page:</p>
+<div class="codehilite"><pre><span class="n">PID</span><span class="o">=</span><span class="n">some</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">pid</span>
+  <span class="n">BundleLocation</span><span class="o">=</span><span class="n">Unbound</span>
+  <span class="n">_jcr_config_path</span><span class="o">=</span><span class="n">jcrinstall:</span><span class="sr">/apps/</span><span class="n">jcrtest</span><span class="sr">/install/som</span><span class="n">e</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">pid</span>
+  <span class="n">even</span><span class="o">=</span><span class="n">more</span>
+  <span class="n">foo</span><span class="o">=</span><span class="n">bars</span>
+  <span class="n">service</span><span class="o">.</span><span class="n">pid</span><span class="o">=</span><span class="n">some</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">pid</span>
+  <span class="n">works</span><span class="o">=</span><span class="n">updated</span>
+</pre></div>
+
+
+<p>We can now delete the configuration node:</p>
+<div class="codehilite"><pre><span class="n">curl</span> <span class="o">-</span><span class="n">X</span> <span class="n">DELETE</span> <span class="o">\</span>
+  <span class="n">http:</span><span class="sr">//</span><span class="n">admin:admin</span><span class="nv">@localhost:8888</span><span class="sr">/apps/</span><span class="n">jcrtest</span><span class="sr">/install/som</span><span class="n">e</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">pid</span>
+</pre></div>
+
+
+<p>And verify that the corresponding configuration is gone in the console page (after 1-2 seconds, like for all other JCRInstall operations).</p>
+<p><em>TODO:</em> A node named like <code>o.a.s.foo.bar-a</code> uses <em>o.a.s.foo.bar</em> as its factory PID creating a configuration with an automatically generated PID. The value of <em>a</em> is stored as an alias property in the configuration to correlate the configuration object with the repository node - demonstrate that.</p>
+<h1 id="automated-tests">Automated Tests</h1>
+<p>The following modules contain lots of automated tests (under <code>src/test</code>, as usual):</p>
+<ul>
+<li>OSGi installer integration tests (<a href="">org.apache.sling.installer.it</a>)</li>
+<li>JCR installer service (<a href="">org.apache.sling.installer.providers.jcr</a>)</li>
+</ul>
+<p>Many of these tests are fairly readable, and can be used to find out in more detail how these modules work.</p>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+        Rev. 1341376 by fmeschbe on Tue, 22 May 2012 09:41:06 +0000
+      </div>
+      <div class="trademarkFooter"> 
+        Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project
+        logo are trademarks of The Apache Software Foundation. All other marks mentioned
+        may be trademarks or registered trademarks of their respective owners.
+      </div>
+    </div>
+  </body>
+</html>

Added: websites/staging/sling/trunk/content/documentation/bundles/managing-permissions-jackrabbit-accessmanager.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/bundles/managing-permissions-jackrabbit-accessmanager.html (added)
+++ websites/staging/sling/trunk/content/documentation/bundles/managing-permissions-jackrabbit-accessmanager.html Tue May 22 09:41:22 2012
@@ -0,0 +1,206 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+  <head>
+    <title>Apache Sling - Managing permissions (jackrabbit.accessmanager)</title>
+    <link rel="stylesheet" href="/css/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><strong>Documentation</strong> <br />
+<a href="/getting-started.html">Getting Started</a> <br />
+<a href="/the-sling-engine.html">The Sling Engine</a> <br />
+<a href="/development.html">Development</a> <br />
+<a href="/bundles.html">Bundles</a> <br />
+<a href="/tutorials-how-tos.html">Tutorials &amp; How-Tos</a> <br />
+<a href="/configuration.html">Configuration</a> <br />
+<a href="http://s.apache.org/sling.wiki">Wiki</a> <br />
+<a href="http://s.apache.org/sling.faq">FAQ</a> <br />
+<a href="/sitemap.html">Site Map</a></p>
+<p><strong>API Docs</strong>  <br />
+<a href="http://sling.apache.org/apidocs/sling6/index.html">Sling 6</a> <br />
+<a href="http://sling.apache.org/apidocs/sling5/index.html">Sling 5</a> <br />
+</p>
+<p><strong>Project info</strong> <br />
+<a href="http://sling.apache.org/site/downloads.cgi">Downloads</a> <br />
+<a href="http://www.apache.org/licenses/">License</a> <br />
+<a href="/contributing.html">Contributing</a> <br />
+<a href="/news.html">News</a> <br />
+<a href="/links.html">Links</a> <br />
+<a href="/project-information.html">Project Information</a> <br />
+<a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a> <br />
+<a href="http://svn.apache.org/viewvc/sling/trunk">Browse Source Repository</a> <br />
+<a href="/security.html">Security</a> <br />
+</p>
+<p><strong>Sponsorship</strong> <br />
+<a href="http://www.apache.org/foundation/thanks.html">Thanks</a> <br />
+<a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a> <br />
+<a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a> <br />
+</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>
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/bundles.html">Bundles</a>
+      </div>
+      <h1>Managing permissions (jackrabbit.accessmanager)</h1>
+      <p>The <code>jackrabbit-accessmanager</code> bundle delivers a REST interface to manipulate users permissions in the JCR. After installing the <code>jackrabbit-accessmanager</code> bundle the REST services are exposed under the path of the node where you will manipulate the permissions for a user with a specific selector like <code>modifyAce</code>, <code>acl</code> and <code>deleteAce</code>.
+[TOC]</p>
+<h2 id="privileges">Privileges</h2>
+<table>
+<thead>
+<tr>
+<th>privilagename</th>
+<th>description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>jcr:read</td>
+<td>the privilege to retrieve a node and get its properties and their values</td>
+</tr>
+<tr>
+<td>jcr:readAccessControl</td>
+<td>the privilege to get the access control policy of a node</td>
+</tr>
+<tr>
+<td>jcr:modifyProperties</td>
+<td>the privilege to create, modify and remove the properties of a node</td>
+</tr>
+<tr>
+<td>jcr:addChildNodes</td>
+<td>the privilege to create child nodes of a node</td>
+</tr>
+<tr>
+<td>jcr:removeChildNodes</td>
+<td>the privilege to remove child nodes of a node</td>
+</tr>
+<tr>
+<td>jcr:removeNode</td>
+<td>the privilege to remove a node</td>
+</tr>
+<tr>
+<td>jcr:write</td>
+<td>an aggregate privilege that contains: jcr:modifyProperties  jcr:addChildNodes  jcr:removeNode  jcr:removeChildNodes</td>
+</tr>
+<tr>
+<td>jcr:modifyAccessControl</td>
+<td>the privilege to modify the access control policies of a node</td>
+</tr>
+<tr>
+<td>jcr:lockManagement</td>
+<td>the privilege to lock and unlock a node</td>
+</tr>
+<tr>
+<td>jcr:versionManagement</td>
+<td>the privilege to perform versioning operations on a node</td>
+</tr>
+<tr>
+<td>jcr:nodeTypeManagement</td>
+<td>the privilege to add and remove mixin node types and change the primary node type of a node</td>
+</tr>
+<tr>
+<td>jcr:retentionManagement</td>
+<td>the privilege to perform retention management operations on a node</td>
+</tr>
+<tr>
+<td>jcr:lifecycleManagement</td>
+<td>the privilege to perform lifecycle operations on a node</td>
+</tr>
+<tr>
+<td>jcr:all</td>
+<td>an aggregate privilege that contains all predefined privileges</td>
+</tr>
+</tbody>
+</table>
+<h2 id="add-or-modify-permissions">Add or modify permissions</h2>
+<p>To modify the permissions for a node POST a request to <code>/&lt;path-to-the-node&gt;.modifyAce.&lt;html or json&gt;</code>. The following parameters are available:</p>
+<ul>
+<li><em>numeric</em> - Place the target ACE at the specified numeric index. |</li>
+</ul>
+<p>Responses:
+| 200 | Success |
+| 500  | Failure, HTML (or JSON) explains failure. |
+Example with curl:</p>
+<div class="codehilite"><pre><span class="n">curl</span> <span class="o">-</span><span class="n">FprincipalId</span><span class="o">=</span><span class="n">myuser</span> <span class="o">-</span><span class="n">Fprivilege</span><span class="nv">@jcr:read</span><span class="o">=</span><span class="n">granted</span> <span class="n">http:</span><span class="sr">//</span><span class="n">localhost:8080</span><span class="sr">/test/</span><span class="n">node</span><span class="o">.</span><span class="n">modifyAce</span><span class="o">.</span><span class="n">html</span>
+</pre></div>
+
+
+<h2 id="delete-permissions">Delete permissions</h2>
+<p>To delete permissions for a node POST a request to <code>/&lt;path-to-the-node&gt;.deleteAce.&lt;html or json&gt;</code>. The following parameters are available:</p>
+<p>Responses:
+| 200 | Success |
+| 500  | Failure, HTML (or JSON) explains failure. |
+Example with curl:</p>
+<div class="codehilite"><pre><span class="n">curl</span> <span class="o">-</span><span class="n">F:applyTo</span><span class="o">=</span><span class="n">myuser</span> <span class="n">http:</span><span class="sr">//</span><span class="n">localhost:8080</span><span class="sr">/test/</span><span class="n">node</span><span class="o">.</span><span class="n">deleteAce</span><span class="o">.</span><span class="n">html</span>
+</pre></div>
+
+
+<h2 id="get-permissions">Get permissions</h2>
+<h3 id="bound-permissions">Bound Permissions</h3>
+<p>To get the permissions bound to a particular node in a json format for a node send a GET request to <code>/&lt;path-to-the-node&gt;.acl.json</code>. </p>
+<p>Example:</p>
+<div class="codehilite"><pre><span class="n">http:</span><span class="sr">//</span><span class="n">localhost:8080</span><span class="sr">/test/</span><span class="n">node</span><span class="o">.</span><span class="n">acl</span><span class="o">.</span><span class="n">json</span>
+</pre></div>
+
+
+<h3 id="effective-permissions">Effective Permissions</h3>
+<p>To get the permissions which are effective for a particular node in a json format for a node send a GET request to <code>/&lt;path-to-the-node&gt;.eacl.json</code>. </p>
+<p>Example:</p>
+<div class="codehilite"><pre><span class="n">http:</span><span class="sr">//</span><span class="n">localhost:8080</span><span class="sr">/test/</span><span class="n">node</span><span class="o">.</span><span class="n">eacl</span><span class="o">.</span><span class="n">json</span>
+</pre></div>
+
+
+<p>{note}See section 16.3 of the JCR 2.0 specification for an explanation of the difference between bound and effective policies.{note}</p>
+<h2 id="sample-user-interface-implementation">Sample User Interface Implementation</h2>
+<p><em>Since Version 2.1.1</em></p>
+<p>A sample implementation of ui pages for permissions management is provided @ http://svn.apache.org/viewvc/sling/trunk/samples/accessmanager-ui/</p>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+        Rev. 1341376 by fmeschbe on Tue, 22 May 2012 09:41:06 +0000
+      </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>



Mime
View raw message