You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2017/06/21 07:22:26 UTC

[20/25] sling-site git commit: Testing with /ng/ context path for temporary https://sling.apache.org/ng/ setup

http://git-wip-us.apache.org/repos/asf/sling-site/blob/3a935d04/documentation/bundles/context-aware-configuration/context-aware-configuration.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/context-aware-configuration/context-aware-configuration.html b/documentation/bundles/context-aware-configuration/context-aware-configuration.html
index 2836168..bec9e19 100644
--- a/documentation/bundles/context-aware-configuration/context-aware-configuration.html
+++ b/documentation/bundles/context-aware-configuration/context-aware-configuration.html
@@ -2,22 +2,22 @@
     <head>
 <meta charset="utf-8"/>
         <title>Apache Sling on JBake</title>
-        <link rel="stylesheet" href="/res/css/site.css"/>
-        <link rel="stylesheet" href="/res/css/codehilite.css"/>
+        <link rel="stylesheet" href="/ng/res/css/site.css"/>
+        <link rel="icon" href="/ng/res/favicon.ico"/>
         <div class="title">
             <div class="logo">
                 <a href="http://sling.apache.org">
-                    <img border="0" alt="Apache Sling" src="/res/logos/sling.svg"/>
+                    <img border="0" alt="Apache Sling" src="/ng/res/logos/sling.svg"/>
                 </a>
             </div><div class="header">
                 <a href="http://www.apache.org">
-                    <img border="0" alt="Apache" src="/res/logos/apache.png"/>
+                    <img border="0" alt="Apache" src="/ng/res/logos/apache.png"/>
                 </a>
             </div>
         </div>        
     </head><body>
 <div class="menu">
-            <strong><a href="/documentation.html">Documentation</a></strong><br/><a href="/documentation/getting-started.html">Getting Started</a><br/><a href="/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/documentation/development.html">Development</a><br/><a href="/documentation/bundles.html">Bundles</a><br/><a href="/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/><a href="/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/apidocs/sling9/index.html">Sling 9</a><br/><a href="/apidocs/sling8/index.html">Sling 8</a><br/><a href="/apidocs/sling7/index.html">Sling 7</a><br/><a href="/apidocs/sling6/index.html">Sling 6</a><br/><a href="/apidocs/sling5/index.html">Sling 5</a><br/><a href="/javadoc-io.html">Archive at javadoc.io</a><br/><p></p><strong>Project info</strong><br/><a h
 ref="/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://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</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="https://donate.apache.org/">Donate!</a><br/><a href="http://www.apache.org/foun
 dation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/sitemap.html">Site Map</a></strong>
+            <strong><a href="/ng/documentation.html">Documentation</a></strong><br/><a href="/ng/documentation/getting-started.html">Getting Started</a><br/><a href="/ng/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/ng/documentation/development.html">Development</a><br/><a href="/ng/documentation/bundles.html">Bundles</a><br/><a href="/ng/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/><a href="/ng/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/ng/apidocs/sling9/index.html">Sling 9</a><br/><a href="/ng/apidocs/sling8/index.html">Sling 8</a><br/><a href="/ng/apidocs/sling7/index.html">Sling 7</a><br/><a href="/ng/apidocs/sling6/index.html">Sling 6</a><br/><a href="/ng/apidocs/sling5/index.html">Sling 5</a><br/><a href="/ng/javadoc-io.html">Archive at javadoc.io</a><br/><p></p
 ><strong>Project info</strong><br/><a href="/ng/downloads.cgi">Downloads</a><br/><a href="http://www.apache.org/licenses/">License</a><br/><a href="/ng/contributing.html">Contributing</a><br/><a href="/ng/news.html">News</a><br/><a href="/ng/links.html">Links</a><br/><a href="/ng/project-information.html">Project Information</a><br/><a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/ng/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</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="https://donate.apache.
 org/">Donate!</a><br/><a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/ng/sitemap.html">Site Map</a></strong>
         </div>        <div class="main">
 <div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>Apache Sling Context-Aware Configuration</h1></header><p>[TOC]</p>
 <h1>About</h1>
@@ -41,23 +41,29 @@
   <li>getting all child resources of a named configuration resource.</li>
 </ul>
 <p>For example to get a configuration resource for a content resource at /content/mysite/page1, you would get a reference to the OSGi service <code>org.apache.sling.caconfig.resource.ConfigurationResourceResolver</code> and write:</p>
-<h1>!java</h1>
-<p>Resource contentResource = resourceResolver.getResource("/content/mysite/page1");</p>
-<p>Resource configResource = configurationResourceResolver.getResource(contentResource, "my-bucket", "my-config");</p>
+<pre><code>#!java
+Resource contentResource = resourceResolver.getResource(&quot;/content/mysite/page1&quot;);
+
+Resource configResource = configurationResourceResolver.getResource(contentResource, &quot;my-bucket&quot;, &quot;my-config&quot;);
+</code></pre>
 <p>Or if you have several configuration resources of the same type and you need all of them:</p>
-<h1>!java</h1>
-<p>Collection<Resource> configResources = configurationResourceResolver.getResourceCollection(contentResource, "my-bucket", "my-config");</p>
+<pre><code>#!java
+Collection&lt;Resource&gt; configResources = configurationResourceResolver.getResourceCollection(contentResource, &quot;my-bucket&quot;, &quot;my-config&quot;);
+</code></pre>
 <p>The ConfigurationResourceResolver has a concept of "buckets" (2nd parameter in the method signatures) that allows to separate different types of configuration resources into different resource hierarchies, so you have a separate "namespaces" for the named configuration resources. For example one bucket for workflow definitions, one bucket for template definitions, one for key/value-pairs.</p>
 <p>The configuration name (3rd parameter) defines which configuration you are interested in. The name can be a relative path as well (e.g. <code>&quot;sub1/my-config&quot;</code>).</p>
 <h2>Context-Aware Configurations</h2>
 <p>While context-aware resources give you pure resources and your application code can decide what to do with it, the most common use case is some configuration. A configuration is usually described by an annotation class (like Declarative Services does for component configurations). These are typed configuration objects and the context-aware configuration support automatically converts resources into the wanted configuration type.</p>
 <p>Context-aware configurations are built on top of context-aware resources. The same concept is used: configurations are named and the service to get them is the ConfigurationResolver. You can get a reference to the OSGi service <code>org.apache.sling.caconfig.ConfigurationResolver</code> - it has a single method to get a ConfigurationBuilder. Alternatively you can directly adapt your content resource directly to the ConfigurationBuilder interface and get the configuration:</p>
-<h1>!java</h1>
-<p>Resource contentResource = resourceResolver.getResource("/content/mysite/page1");</p>
-<p>MyConfig config = contentResource.adaptTo(ConfigurationBuilder.class).as(MyConfig.class);</p>
+<pre><code>#!java
+Resource contentResource = resourceResolver.getResource(&quot;/content/mysite/page1&quot;);
+
+MyConfig config = contentResource.adaptTo(ConfigurationBuilder.class).as(MyConfig.class);
+</code></pre>
 <p>Or if you want to get a list of configurations:</p>
-<h1>!java</h1>
-<p>Collection<MyConfig> configs = contentResource.adaptTo(ConfigurationBuilder.class).asCollection(MyConfig.class);</p>
+<pre><code>#!java
+Collection&lt;MyConfig&gt; configs = contentResource.adaptTo(ConfigurationBuilder.class).asCollection(MyConfig.class);
+</code></pre>
 <p>The ConfigurationBuilder also supports getting the configurations as ValueMap or by adapting the configuration resources e.g. to a Sling Model. In this case you have to specify a configuration name which is otherwise derived automatically from the annotation class.</p>
 <p>Internally the ConfigurationResolver used the ConfigurationResourceResolver to get the configuration resources. It uses always the bucket name <code>sling:configs</code>.</p>
 <h1>Contexts and configuration references</h1>
@@ -68,48 +74,73 @@
 <h1>Describe configurations via annotation classes</h1>
 <p>You need an annotation class for each configuration you want to read via the ConfigurationBuilder. The annotation classes may be provided by the applications/libraries you use, or you can define your own annotation classes for your application.</p>
 <p>The annotation class may look like this:</p>
-<h1>!java</h1>
-<p>@Configuration(label="My Configuration", description="Describe me") public @interface MyConfig {</p>
-<p>@Property(label="Parameter #1", description="Describe me") String param1();</p>
-<p>@Property(label="Parameter with Default value", description="Describe me") String paramWithDefault() default "defValue";</p>
-<p>@Property(label="Integer parameter", description="Describe me") int intParam();</p>
-<p>}</p>
-<p>The <code>@Configuration</code> annotation is mandatory. All properties on the <code>@Configuration</code> annotation and the <code>@Property</code> annotations are optional - they provide additional metadata for tooling e.g. configuration editors.</p>
+<pre><code>#!java
+</code></pre>
+<p> @Configuration(label="My Configuration", description="Describe me")  public @interface MyConfig {</p>
+<p> @Property(label="Parameter #1", description="Describe me")  String param1();</p>
+<p> @Property(label="Parameter with Default value", description="Describe me")  String paramWithDefault() default "defValue";</p>
+<p> @Property(label="Integer parameter", description="Describe me")  int intParam();</p>
+<p> }</p>
+<p>The <code>@Configuration</code> annotation is mandatory. All properties on the <code>@Configuration</code> annotation and the <code>@Property</code> annotations are optional - they provide additional metadata for tooling e.g. configuration editors. </p>
 <p>By default the annotation class name is used as configuration name, which is also the recommended option. If you want to use an arbitrary configuration name you can specify it via a <code>name</code> property on the <code>@Configuration</code> annotation.</p>
 <p>You may specify custom properties (via <code>property</code> string array) for the configuration class or each properties. They are not used by the Sling Context-Aware configuration implementation, but may be used by additional tooling to manage the configurations.</p>
 <p>If you provide your own configuration annotation classes in your bundle, you have to export them and list all class names in a bundle header named <code>Sling-ContextAware-Configuration-Classes</code> - example:</p>
-<p>Sling-ContextAware-Configuration-Classes: x.y.z.MyConfig, x.y.z.MyConfig2</p>
-<p>To automate this you can use the Context-Aware Configuration bnd plugin (see next chapter).</p>
+<pre><code>Sling-ContextAware-Configuration-Classes: x.y.z.MyConfig, x.y.z.MyConfig2
+</code></pre>
+<p>To automate this you can use the Context-Aware Configuration bnd plugin (see next chapter). </p>
 <h1>Accessing configuration from HTL/Sightly templates</h1>
 <p>Context-Aware configuration contains a Scripting Binding Values provider with automatically registeres a <code>caconfig</code> variable in your HTL/Sightly scripts to directly access context-aware configurations. It supports both singleton configurations and configuration lists. Please note that configuration lists are only supported when configuration metadata is present (e.g. via an annotation class).</p>
 <p>Example for accessing a property of a singleton configuration (with a config name <code>x.y.z.ConfigSample</code>):</p>
-<h1>!html</h1>
-<dl>
-<dt>stringParam:</dt>
-<dd>${caconfig['x.y.z.ConfigSample'].stringParam}</dd>
-</dl>
+<p> #!html  <dl>  <dt>stringParam:</dt>  <dd>${caconfig['x.y.z.ConfigSample'].stringParam}</dd>  </dl></p>
 <p>Example for accessing a property of a configuration list (with a config name <code>x.y.z.ConfigSampleList</code>):</p>
-<h1>!html</h1>
-<p>&lt;ul data-sly-list.item="${caconfig['x.y.z.ConfigSampleList']}"&gt; <li>stringParam: ${item.stringParam}</li> </ul></p>
+<p> #!html  &lt;ul data-sly-list.item="${caconfig['x.y.z.ConfigSampleList']}"&gt;  <li>stringParam: ${item.stringParam}</li>  </ul></p>
 <p>If you want to access nested configurations you have to use a slash "/" as separator in the property name. Example:</p>
-<h1>!html</h1>
-<p>${caconfig['x.y.z.ConfigSample']['nestedConfig/stringParam']}</p>
+<pre><code>#!html
+${caconfig[&#39;x.y.z.ConfigSample&#39;][&#39;nestedConfig/stringParam&#39;]}
+</code></pre>
 <h1>Context-Aware Configuration bnd plugin</h1>
 <p>A <a href="http://bnd.bndtools.org/">bnd</a> plugin is provided that scans the classpath of a bundle Maven project at build time and automatically generates a <code>Sling-ContextAware-Configuration-Classes</code> bundle header for all annotation classes annotated with <code>@Configuration</code>. It can be used by both <a href="http://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html">maven-bundle-plugin</a> and <a href="https://github.com/bndtools/bnd/tree/master/maven">bnd-maven-plugin</a>, as both use the bnd library internally.</p>
 <p>Example configuration:</p>
-<h1>!xml</h1>
-<p><plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <configuration> <instructions> <!-- Generate bundle header containing all configuration annotation classes --> &lt;_plugin&gt;org.apache.sling.caconfig.bndplugin.ConfigurationClassScannerPlugin&lt;/_plugin&gt; </instructions> </configuration> <dependencies> <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.caconfig.bnd-plugin</artifactId> <version>1.0.2</version> </dependency> </dependencies> </plugin></p>
+<pre><code>#!xml
+&lt;plugin&gt;
+    &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
+    &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
+    &lt;extensions&gt;true&lt;/extensions&gt;
+    &lt;configuration&gt;
+        &lt;instructions&gt;
+            &lt;!-- Generate bundle header containing all configuration annotation classes --&gt;
+            &lt;_plugin&gt;org.apache.sling.caconfig.bndplugin.ConfigurationClassScannerPlugin&lt;/_plugin&gt;
+        &lt;/instructions&gt;
+    &lt;/configuration&gt;
+    &lt;dependencies&gt;
+        &lt;dependency&gt;
+            &lt;groupId&gt;org.apache.sling&lt;/groupId&gt;
+            &lt;artifactId&gt;org.apache.sling.caconfig.bnd-plugin&lt;/artifactId&gt;
+            &lt;version&gt;1.0.2&lt;/version&gt;
+        &lt;/dependency&gt;
+    &lt;/dependencies&gt;
+&lt;/plugin&gt;
+</code></pre>
 <h1>Unit Tests with Context-Aware Configuration</h1>
 <p>When your code depends on Sling Context-Aware Configuration and you want to write Sling Mocks-based unit tests running against the Context-Aware configuration implementation you have to register the proper OSGi services to use them. To make this easier, a "Apache Sling Context-Aware Configuration Mock Plugin" is provided which does this job for you.</p>
 <p>Example for setting up the unit test context rule:</p>
-<h1>!java</h1>
-<p>import static org.apache.sling.testing.mock.caconfig.ContextPlugins.CACONFIG;</p>
-<p>public class MyTest {</p>
-<p>@Rule public SlingContext context = new SlingContextBuilder().plugin(CACONFIG).build();</p>
-<p>@Before public void setUp() { // register configuration annotation class MockContextAwareConfig.registerAnnotationClasses(context, SimpleConfig.class); } ...</p>
+<pre><code>#!java
+import static org.apache.sling.testing.mock.caconfig.ContextPlugins.CACONFIG;
+
+public class MyTest {
+
+    @Rule
+    public SlingContext context = new SlingContextBuilder().plugin(CACONFIG).build();
+
+    @Before
+    public void setUp() {
+       // register configuration annotation class
+       MockContextAwareConfig.registerAnnotationClasses(context, SimpleConfig.class);
+    }
+...
+</code></pre>
 <p>In you project define a test dependency (additionally the sling-mock dependency is required):</p>
-<h1>!xml</h1>
-<p><dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.testing.caconfig-mock-plugin</artifactId> <scope>test</scope> </dependency></p>
+<p> #!xml  <dependency>  <groupId>org.apache.sling</groupId>  <artifactId>org.apache.sling.testing.caconfig-mock-plugin</artifactId>  <scope>test</scope>  </dependency></p>
 <p>Full example: <a href="https://github.com/apache/sling/blob/trunk/testing/mocks/caconfig-mock-plugin/src/test/java/org/apache/sling/testing/mock/caconfig/ContextPluginsTest.java">Apache Sling Context-Aware Configuration Mock Plugin Test</a></p>
 <h1>Customizing the configuration lookup</h1>
 <p>The Context-Aware Configuration implementation provides a set of Service Provider Interfaces (SPI) that allows you to overlay, enhance or replace the default implementation and adapt it to your needs.</p>

http://git-wip-us.apache.org/repos/asf/sling-site/blob/3a935d04/documentation/bundles/datasource-providers.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/datasource-providers.html b/documentation/bundles/datasource-providers.html
index 16256c9..d976bb3 100644
--- a/documentation/bundles/datasource-providers.html
+++ b/documentation/bundles/datasource-providers.html
@@ -2,22 +2,22 @@
     <head>
 <meta charset="utf-8"/>
         <title>Apache Sling on JBake</title>
-        <link rel="stylesheet" href="/res/css/site.css"/>
-        <link rel="stylesheet" href="/res/css/codehilite.css"/>
+        <link rel="stylesheet" href="/ng/res/css/site.css"/>
+        <link rel="icon" href="/ng/res/favicon.ico"/>
         <div class="title">
             <div class="logo">
                 <a href="http://sling.apache.org">
-                    <img border="0" alt="Apache Sling" src="/res/logos/sling.svg"/>
+                    <img border="0" alt="Apache Sling" src="/ng/res/logos/sling.svg"/>
                 </a>
             </div><div class="header">
                 <a href="http://www.apache.org">
-                    <img border="0" alt="Apache" src="/res/logos/apache.png"/>
+                    <img border="0" alt="Apache" src="/ng/res/logos/apache.png"/>
                 </a>
             </div>
         </div>        
     </head><body>
 <div class="menu">
-            <strong><a href="/documentation.html">Documentation</a></strong><br/><a href="/documentation/getting-started.html">Getting Started</a><br/><a href="/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/documentation/development.html">Development</a><br/><a href="/documentation/bundles.html">Bundles</a><br/><a href="/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/><a href="/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/apidocs/sling9/index.html">Sling 9</a><br/><a href="/apidocs/sling8/index.html">Sling 8</a><br/><a href="/apidocs/sling7/index.html">Sling 7</a><br/><a href="/apidocs/sling6/index.html">Sling 6</a><br/><a href="/apidocs/sling5/index.html">Sling 5</a><br/><a href="/javadoc-io.html">Archive at javadoc.io</a><br/><p></p><strong>Project info</strong><br/><a h
 ref="/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://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</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="https://donate.apache.org/">Donate!</a><br/><a href="http://www.apache.org/foun
 dation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/sitemap.html">Site Map</a></strong>
+            <strong><a href="/ng/documentation.html">Documentation</a></strong><br/><a href="/ng/documentation/getting-started.html">Getting Started</a><br/><a href="/ng/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/ng/documentation/development.html">Development</a><br/><a href="/ng/documentation/bundles.html">Bundles</a><br/><a href="/ng/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/><a href="/ng/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/ng/apidocs/sling9/index.html">Sling 9</a><br/><a href="/ng/apidocs/sling8/index.html">Sling 8</a><br/><a href="/ng/apidocs/sling7/index.html">Sling 7</a><br/><a href="/ng/apidocs/sling6/index.html">Sling 6</a><br/><a href="/ng/apidocs/sling5/index.html">Sling 5</a><br/><a href="/ng/javadoc-io.html">Archive at javadoc.io</a><br/><p></p
 ><strong>Project info</strong><br/><a href="/ng/downloads.cgi">Downloads</a><br/><a href="http://www.apache.org/licenses/">License</a><br/><a href="/ng/contributing.html">Contributing</a><br/><a href="/ng/news.html">News</a><br/><a href="/ng/links.html">Links</a><br/><a href="/ng/project-information.html">Project Information</a><br/><a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/ng/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</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="https://donate.apache.
 org/">Donate!</a><br/><a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/ng/sitemap.html">Site Map</a></strong>
         </div>        <div class="main">
 <div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>DataSource Provider</h1></header><p>DataSource provider bundle supports creation of <code>DataSource</code> instance and registering them with the OSGi service registry. Application using the DataSource just obtains it from OSGi while an administrator can configure the DataSource via Felix WebConsole configuration UI.</p>
 <p>[TOC]</p>
@@ -32,7 +32,8 @@
 <h3>Driver Loading</h3>
 <p>Loading of JDBC driver is tricky on OSGi env. Mostly one has to attach the Driver bundle as a fragment bundle to the code which creates the JDBC Connection.</p>
 <p>With JDBC 4 onwards the Driver class can be loaded via Java SE Service Provider mechanism (SPM) JDBC 4.0 drivers must include the file META-INF/services/java.sql.Driver. This file contains the name of the JDBC driver's implementation of java.sql.Driver. For example, to load the JDBC driver to connect to a Apache Derby database, the META-INF/services/java.sql.Driver file would contain the following entry:</p>
-<p>org.apache.derby.jdbc.EmbeddedDriver</p>
+<pre><code>org.apache.derby.jdbc.EmbeddedDriver
+</code></pre>
 <p>Sling DataSource Provider bundles maintains a <code>DriverRegistry</code> which contains mapping of Driver bundle to Driver class supported by it. With this feature there is no need to wrap the Driver bundle as fragment to DataSource provider bundle</p>
 <h3>Configuration</h3>
 <ol>
@@ -46,7 +47,16 @@
 <h3>Convert Driver jars to Bundle</h3>
 <p>Most of the JDBC driver jars have the required OSGi headers and can be directly deployed to OSGi container as bundles. However some of the drivers e.g. Postgres are not having such headers and hence need to be converted to OSGi bundles. For them we can use the <a href="http://bnd.bndtools.org/chapters/390-wrapping.html">Bnd Wrap</a> command.</p>
 <p>For example to convert the Postgres driver jar follow the steps below</p>
-<p>$ wget https://github.com/bndtools/bnd/releases/download/2.3.0.REL/biz.aQute.bnd-2.3.0.jar -O bnd.jar $ wget http://jdbc.postgresql.org/download/postgresql-9.3-1101.jdbc41.jar $ cat &gt; bnd.bnd &lt;&lt;EOT Bundle-Version: 9.3.1101 Bundle-SymbolicName: org.postgresql Export-Package: org.postgresql Include-Resource: @postgresql-9.3-1101.jdbc41.jar EOT $ java -jar bnd.jar bnd.bnd</p>
+<pre><code>$ wget https://github.com/bndtools/bnd/releases/download/2.3.0.REL/biz.aQute.bnd-2.3.0.jar -O bnd.jar
+$ wget http://jdbc.postgresql.org/download/postgresql-9.3-1101.jdbc41.jar
+$ cat &gt; bnd.bnd &lt;&lt;EOT
+Bundle-Version: 9.3.1101
+Bundle-SymbolicName: org.postgresql
+Export-Package: org.postgresql
+Include-Resource: @postgresql-9.3-1101.jdbc41.jar
+EOT
+$ java -jar bnd.jar bnd.bnd
+</code></pre>
 <p>In the steps above we</p>
 <ol>
   <li>Download the bnd jar and postgres driver jar</li>
@@ -65,12 +75,25 @@
 <h2>Usage</h2>
 <p>Once the required configuration is done the <code>DataSource</code> would be registered as part of the OSGi Service Registry The service is registered with service property <code>datasource.name</code> whose value is the name of datasource provided in OSGi config.</p>
 <p>Following snippet demonstrates accessing the DataSource named <code>foo</code> via DS annotation</p>
-<p>::java import javax.sql.DataSource; import org.apache.felix.scr.annotations.Reference;</p>
-<p>public class DSExample {</p>
-<p>@Reference(target = "(&amp;(objectclass=javax.sql.DataSource)(datasource.name=foo))") private DataSource dataSource; }</p>
+<pre><code>::java
+import javax.sql.DataSource;
+import org.apache.felix.scr.annotations.Reference;
+
+public class DSExample {
+
+    @Reference(target = &quot;(&amp;(objectclass=javax.sql.DataSource)(datasource.name=foo))&quot;)
+    private DataSource dataSource;
+}
+</code></pre>
 <h2>Installation</h2>
 <p>Download the bundle from <a href="http://sling.apache.org/downloads.cgi">here</a> or use following Maven dependency</p>
-<p>::xml <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.datasource</artifactId> <version>1.0.0</version> </dependency></p></section></div></div>            
+<pre><code>::xml
+&lt;dependency&gt;
+    &lt;groupId&gt;org.apache.sling&lt;/groupId&gt;
+    &lt;artifactId&gt;org.apache.sling.datasource&lt;/artifactId&gt;
+    &lt;version&gt;1.0.0&lt;/version&gt;
+&lt;/dependency&gt;
+</code></pre></section></div></div>            
 <div class="footer">
                 <div class="timestamp">
                     TODO display revision number here

http://git-wip-us.apache.org/repos/asf/sling-site/blob/3a935d04/documentation/bundles/discovery-api-and-impl.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/discovery-api-and-impl.html b/documentation/bundles/discovery-api-and-impl.html
index 2f4d082..94535d1 100644
--- a/documentation/bundles/discovery-api-and-impl.html
+++ b/documentation/bundles/discovery-api-and-impl.html
@@ -2,22 +2,22 @@
     <head>
 <meta charset="utf-8"/>
         <title>Apache Sling on JBake</title>
-        <link rel="stylesheet" href="/res/css/site.css"/>
-        <link rel="stylesheet" href="/res/css/codehilite.css"/>
+        <link rel="stylesheet" href="/ng/res/css/site.css"/>
+        <link rel="icon" href="/ng/res/favicon.ico"/>
         <div class="title">
             <div class="logo">
                 <a href="http://sling.apache.org">
-                    <img border="0" alt="Apache Sling" src="/res/logos/sling.svg"/>
+                    <img border="0" alt="Apache Sling" src="/ng/res/logos/sling.svg"/>
                 </a>
             </div><div class="header">
                 <a href="http://www.apache.org">
-                    <img border="0" alt="Apache" src="/res/logos/apache.png"/>
+                    <img border="0" alt="Apache" src="/ng/res/logos/apache.png"/>
                 </a>
             </div>
         </div>        
     </head><body>
 <div class="menu">
-            <strong><a href="/documentation.html">Documentation</a></strong><br/><a href="/documentation/getting-started.html">Getting Started</a><br/><a href="/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/documentation/development.html">Development</a><br/><a href="/documentation/bundles.html">Bundles</a><br/><a href="/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/><a href="/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/apidocs/sling9/index.html">Sling 9</a><br/><a href="/apidocs/sling8/index.html">Sling 8</a><br/><a href="/apidocs/sling7/index.html">Sling 7</a><br/><a href="/apidocs/sling6/index.html">Sling 6</a><br/><a href="/apidocs/sling5/index.html">Sling 5</a><br/><a href="/javadoc-io.html">Archive at javadoc.io</a><br/><p></p><strong>Project info</strong><br/><a h
 ref="/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://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</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="https://donate.apache.org/">Donate!</a><br/><a href="http://www.apache.org/foun
 dation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/sitemap.html">Site Map</a></strong>
+            <strong><a href="/ng/documentation.html">Documentation</a></strong><br/><a href="/ng/documentation/getting-started.html">Getting Started</a><br/><a href="/ng/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/ng/documentation/development.html">Development</a><br/><a href="/ng/documentation/bundles.html">Bundles</a><br/><a href="/ng/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/><a href="/ng/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/ng/apidocs/sling9/index.html">Sling 9</a><br/><a href="/ng/apidocs/sling8/index.html">Sling 8</a><br/><a href="/ng/apidocs/sling7/index.html">Sling 7</a><br/><a href="/ng/apidocs/sling6/index.html">Sling 6</a><br/><a href="/ng/apidocs/sling5/index.html">Sling 5</a><br/><a href="/ng/javadoc-io.html">Archive at javadoc.io</a><br/><p></p
 ><strong>Project info</strong><br/><a href="/ng/downloads.cgi">Downloads</a><br/><a href="http://www.apache.org/licenses/">License</a><br/><a href="/ng/contributing.html">Contributing</a><br/><a href="/ng/news.html">News</a><br/><a href="/ng/links.html">Links</a><br/><a href="/ng/project-information.html">Project Information</a><br/><a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/ng/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</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="https://donate.apache.
 org/">Donate!</a><br/><a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/ng/sitemap.html">Site Map</a></strong>
         </div>        <div class="main">
 <div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>Discovery API and its implementations</h1></header><p>In many situations a particular Sling-based deployment consists of several Sling instances: typically a number of instances would form a <code>cluster</code> that share a common content repository - in other situations, or additionally, instances might be loosely coupled, each with their own repository.</p>
 <p>The <code>discovery-api</code> bundle introduces an abstraction for such scenarios called <code>topology</code>. It provides access to the current topology, allows to be informed of any changes in the topology (such as joining or leaving instances) and contains a simple property exchange mechanism, e.g. to allow building communication services on top of it.</p>
@@ -49,33 +49,63 @@
 <p>If different clusters in the topology should represent different 'types of clusters' (eg a publish or an author cluster), then that is not explicitly handled by the discovery API. Instead, applications can define properties on each instance that model such cluster types or other aspects.</p>
 <h2>Cluster Leader and Instance Ordering</h2>
 <p>As mentioned the discovery API introduces support for a <code>cluster leader</code>: within each cluster, the API guarantees that one and only one instance is leader at any time. That leader is guaranteed to be <code>stable</code>, ie as long as it stays alive and is visible by other instances of the same cluster, it will stay leader. As soon as it leaves the cluster (or the corresponding implementation bundle is deactivated), another instance in that cluster is elected leader. The leader can be used to deal with work that must be guaranteed to only execute on one (but any) instance in the cluster.</p>
-<p>Additionally each cluster (<code>ClusterView</code>) orders its instances in a stable list: each newly joined instances is added at the end of the list and retains its order in the list as long as it doesn't leave the cluster. This can be used to distribute "singleton" work amongst the cluster to more than just the leader.</p>
+<p>Additionally each cluster (<code>ClusterView</code>) orders its instances in a stable list: each newly joined instances is added at the end of the list and retains its order in the list as long as it doesn't leave the cluster. This can be used to distribute "singleton" work amongst the cluster to more than just the leader. </p>
 <h2>Topology Changes</h2>
 <p>The <code>DiscoveryService</code> provides access to the currently valid <code>TopologyView</code>. Additionally, applications can register a <code>TopologyEventListener</code> and thus be informed about any changes in the topology. Whenever the discovery service detects that an instance is no longer responding or has newly joined, or a new leader has been elected, it sends a <code>TOPOLOGY_CHANGING</code> event, starts settling the change within the topology (i.e. making sure everybody else in the topology agrees with the change) and finally sends a <code>TOPOLOGY_CHANGED</code> event with the new topology.</p>
 <p>Additionally, when "only" properties have changed, a <code>PROPERTIES_CHANGED</code> event is sent.</p>
 <p>Note that the detection of topology (or properties) changes will incur a delay which is implementation dependent.</p>
 <p>The following is an example of a listener. Note that the binding is done automatically by OSGi, as soon as a <code>TopologyEventListener</code> is registered.</p>
-<p>import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.Service; import org.apache.sling.discovery.TopologyEvent; import org.apache.sling.discovery.TopologyEventListener;</p>
-<p>@Component @Service(value = { TopologyEventListener.class }) public class MyTopologyEventListener implements TopologyEventListener {</p>
-<p>public void handleTopologyEvent(final TopologyEvent event) { // your code here }</p>
-<p>}</p>
+<pre><code>import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.discovery.TopologyEvent;
+import org.apache.sling.discovery.TopologyEventListener;
+
+@Component
+@Service(value = { TopologyEventListener.class })
+public class MyTopologyEventListener implements TopologyEventListener {
+
+    public void handleTopologyEvent(final TopologyEvent event) {
+        // your code here
+    }
+
+}
+</code></pre>
 <h2>Properties</h2>
 <p>The discovery API not only lists all clusters and instances that are part of a topology but also provides a simple mechanism for announcing properties of each instance to the topology, via the <code>PropertyProvider</code> service interface.</p>
 <p>Typical use cases for this are announcements of endpoint URLs or ports such that applications can communicate to other instances in the topology.</p>
 <p>Note that the properties mechanism is not meant be used as a messaging tool: both from an API point of view and the implementation of it are not optimized for frequent changes and its use for messaging is discouraged. It is only meant to be used to announce configuration information for accessing proper messaging services.</p>
 <p>The following is an example of a <code>PropertyProvider</code> that provides <code>sample.value1</code> and <code>sample.value2</code> properties:</p>
-<p>import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.Service; import org.apache.sling.discovery.PropertyProvider;</p>
-<p>@Component @Service(value = { PropertyProvider.class }) @Property(name = PropertyProvider.PROPERTY_PROPERTIES, value = {"sample.value1", "sample.value2" }) public class SamplePropertyProvider implements PropertyProvider {</p>
-<p>public String getProperty(final String name) { if ("sample.value1".equals(name)) { return "foo"; } else if ("sample.value2".equals(name)) { return "bar"; } else { return null; } } }</p>
+<pre><code>import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.discovery.PropertyProvider;
+
+@Component
+@Service(value = { PropertyProvider.class })
+@Property(name = PropertyProvider.PROPERTY_PROPERTIES, 
+          value = {&quot;sample.value1&quot;, &quot;sample.value2&quot; })
+public class SamplePropertyProvider implements PropertyProvider {
+
+    public String getProperty(final String name) {
+       if (&quot;sample.value1&quot;.equals(name)) {
+         return &quot;foo&quot;;
+       } else if (&quot;sample.value2&quot;.equals(name)) {
+         return &quot;bar&quot;;
+       } else {
+         return null;
+       }
+    }
+}
+</code></pre>
 <h2>Deployment and configuration</h2>
 <p>The discovery API makes no assumptions as to how the instances and clusters discover each other. This is entirely up to the implementations. Some might choose automatic discovery within a LAN using IP multicast, others might choose explicit configuration via a central service etc.</p>
 <h2>discovery.impl: Resource-based, OOTB Implementation</h2>
-<p>The <code>discovery.impl</code> bundle is a resource-based, out of the box implementation of the <code>discovery.api</code> using standard Sling.</p>
+<p>The <code>discovery.impl</code> bundle is a resource-based, out of the box implementation of the <code>discovery.api</code> using standard Sling. </p>
 <p>The discovery within a cluster is done by writing heartbeat information into the (common) repository (there's no other form of communication within a cluster). The establishment of a clusterview is done by analyzing these heartbeats, initiating a voting within the cluster (such that each instance can agree that it sees the same number of instances) and by concluding the voting by promoting it as the new "established" view.</p>
 <p>The discovery of instances and clusters outside the local cluster requires explicit configuration of what is termed 'topology connectors', which are HTTP PUTs (see below).</p>
 <h3>Location in Repository</h3>
 <p>Administrative note: All the information about the topology is stored at the following location in the repository:</p>
-<p>/var/discovery/impl</p>
+<pre><code>/var/discovery/impl
+</code></pre>
 <h4>/var/discovery/impl/clusterInstances/&lt;slingId&gt;</h4>
 <p>Each instance has its own node under <code>clusterInstances/</code> where it stores:</p>
 <ul>
@@ -108,7 +138,7 @@
   <li>a 'heartbeat' that has not yet timed out is considered a signal that the instance is alive</li>
   <li>as soon as a 'heartbeat' is timed out, the assumption is that the corresponding instance is dead/shutdown</li>
 </ul>
-<p>To avoid having each instance make it's own, perhaps differing conclusions as to which instance/heartbeat is dead or not, there is an explicit, unanimous voting mechanism that agrees upon a list of alive instances. This list of alive instances is called cluster view.</p>
+<p>To avoid having each instance make it's own, perhaps differing conclusions as to which instance/heartbeat is dead or not, there is an explicit, unanimous voting mechanism that agrees upon a list of alive instances. This list of alive instances is called cluster view. </p>
 <ul>
   <li>as soon as any instance notices a change in the list of active instances, it is free to calculate a new such list and start a voting in the cluster - each voting carries a unique votingId</li>
   <li>since any instance can do this, you can have concurrent creation of new votings</li>
@@ -140,21 +170,21 @@
 <p>The following properties can be configured (at <a href="http://localhost:8888/system/console/configMgr/org.apache.sling.discovery.impl.Config">/system/console/configMgr/org.apache.sling.discovery.impl.Config</a>):</p>
 <ul>
   <li>
-  <p>heartbeatInterval: the time in seconds between two heartbeats (both cluster-internal and for HTTP-connectors). Default value is 15 seconds.</p></li>
+  <p>heartbeatInterval: the time in seconds between two heartbeats (both cluster-internal and for HTTP-connectors). Default  value is 15 seconds.</p></li>
   <li>
-  <p>heartbeatTimeout: the time in seconds after which an instance is considered dead if no heartbeat was sent since. Default value is 20 seconds.</p></li>
+  <p>heartbeatTimeout: the time in seconds after which an instance is considered dead if no heartbeat was sent since. Default  value is 20 seconds.</p></li>
   <li>
-  <p>topologyConnectorUrls: a list of connector URLs to which this instance should connect to. The list can contain multiple instances of the same cluster (for fallback configurations). If the list is empty, no connector will be created. The default relative URL is /libs/sling/topology/connector. Note that this URL is accessible without authentication - to avoid having to configure administrative username/passwords in all instances. Instead, a whitelist approach is used (see next item).</p></li>
+  <p>topologyConnectorUrls: a list of connector URLs to which this instance should connect to. The list can contain multiple  instances of the same cluster (for fallback configurations). If the list is empty, no connector will be created.  The default relative URL is /libs/sling/topology/connector. Note that this URL is accessible without authentication -  to avoid having to configure administrative username/passwords in all instances. Instead, a whitelist approach is used  (see next item).</p></li>
   <li>
-  <p>topologyConnectorWhitelist: As mentioned above, the path /libs/sling/topology/connector does not require authentication. To assure that only trusted instances can connect to the topology, its hostname or IP address must be in a whitelist. By default this whitelist only contains localhost and 127.0.0.1.</p></li>
+  <p>topologyConnectorWhitelist: As mentioned above, the path /libs/sling/topology/connector does not require authentication.  To assure that only trusted instances can connect to the topology, its hostname or IP address must be in a whitelist.  By default this whitelist only contains localhost and 127.0.0.1.</p></li>
   <li>
-  <p>minEventDelay: To reduce the number of events sent during changes, there is a delay (in seconds) before the event is sent. If additional changes happen during this delay, the change will be combined in one event.</p></li>
+  <p>minEventDelay: To reduce the number of events sent during changes, there is a delay (in seconds) before the event is sent.  If additional changes happen during this delay, the change will be combined in one event.</p></li>
   <li>
-  <p>leaderElectionRepositoryDescriptor: this is an advanced parameter. It denotes a repository descriptor that is evaluated and taken into account for leader Election: the corresponding value of the descriptor is sorted by first.</p></li>
+  <p>leaderElectionRepositoryDescriptor: this is an advanced parameter. It denotes a repository descriptor that is evaluated  and taken into account for leader Election: the corresponding value of the descriptor is sorted by first.</p></li>
   <li>
-  <p>hmacEnabled: If this is true, and sharedKey is set to a value on all Sling instances within the same topology, then messages are validates using a signature of the content of the message based on the shared key. The signature and the digest of the content appear as http headers. When hmac message validation is enabled, whitelisting is disabled. This use useful where the topology messages are transported through multiple reverse proxy layers or the topology is dynamic. The Hmac algorithm in use is HmacSHA256. The JVM is expected to have a provider implementing this algorithm (The Standard JDKs do).</p></li>
+  <p>hmacEnabled: If this is true, and sharedKey is set to a value on all Sling instances within the same topology, then messages are  validates using a signature of the content of the message based on the shared key. The signature and the digest of the content  appear as http headers. When hmac message validation is enabled, whitelisting is disabled. This use useful where the topology  messages are transported through multiple reverse proxy layers or the topology is dynamic. The Hmac algorithm in use is HmacSHA256.  The JVM is expected to have a provider implementing this algorithm (The Standard JDKs do).</p></li>
   <li>
-  <p>sharedKey: If hmacEnabled is true, this must be set to a secret value, shared amongst all Sling instances that are members of the same topology.</p></li>
+  <p>sharedKey: If hmacEnabled is true, this must be set to a secret value, shared amongst all Sling instances that are members of the  same topology.</p></li>
   <li>
   <p>enableEncryption: If hmacEnabled is true, and sharedKey is set, setting this to true will encrypt the body of the message using 128 Bit AES encryption. The encryption key is derived from the sharedKey using a 9 byte random salt, giving 2^^72 potential salt values.</p></li>
   <li>
@@ -178,7 +208,8 @@
 </ul>
 <h4>Accessing discovery-lite</h4>
 <p>The <code>oak.discoverylite.clusterview</code> descriptor is exposed as a JCR repository descriptor and can be accessed like so:</p>
-<p>getRepository().getDescriptor("oak.discoverylite.clusterview")</p>
+<pre><code>getRepository().getDescriptor(&quot;oak.discoverylite.clusterview&quot;)
+</code></pre>
 <p>which will return the json-formatted clusterview as described above.</p>
 <p>Note however, that this API is not meant to be a public, stable API and changes will be done without prior notice. It is merely an internal information exposed by oak and not standardized nor guaranteed to remain supported or unchanged!</p>
 <h3>Sling's discovery.oak</h3>

http://git-wip-us.apache.org/repos/asf/sling-site/blob/3a935d04/documentation/bundles/dynamic-includes.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/dynamic-includes.html b/documentation/bundles/dynamic-includes.html
index 413bc11..a581eac 100644
--- a/documentation/bundles/dynamic-includes.html
+++ b/documentation/bundles/dynamic-includes.html
@@ -2,24 +2,24 @@
     <head>
 <meta charset="utf-8"/>
         <title>Apache Sling on JBake</title>
-        <link rel="stylesheet" href="/res/css/site.css"/>
-        <link rel="stylesheet" href="/res/css/codehilite.css"/>
+        <link rel="stylesheet" href="/ng/res/css/site.css"/>
+        <link rel="icon" href="/ng/res/favicon.ico"/>
         <div class="title">
             <div class="logo">
                 <a href="http://sling.apache.org">
-                    <img border="0" alt="Apache Sling" src="/res/logos/sling.svg"/>
+                    <img border="0" alt="Apache Sling" src="/ng/res/logos/sling.svg"/>
                 </a>
             </div><div class="header">
                 <a href="http://www.apache.org">
-                    <img border="0" alt="Apache" src="/res/logos/apache.png"/>
+                    <img border="0" alt="Apache" src="/ng/res/logos/apache.png"/>
                 </a>
             </div>
         </div>        
     </head><body>
 <div class="menu">
-            <strong><a href="/documentation.html">Documentation</a></strong><br/><a href="/documentation/getting-started.html">Getting Started</a><br/><a href="/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/documentation/development.html">Development</a><br/><a href="/documentation/bundles.html">Bundles</a><br/><a href="/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/><a href="/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/apidocs/sling9/index.html">Sling 9</a><br/><a href="/apidocs/sling8/index.html">Sling 8</a><br/><a href="/apidocs/sling7/index.html">Sling 7</a><br/><a href="/apidocs/sling6/index.html">Sling 6</a><br/><a href="/apidocs/sling5/index.html">Sling 5</a><br/><a href="/javadoc-io.html">Archive at javadoc.io</a><br/><p></p><strong>Project info</strong><br/><a h
 ref="/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://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</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="https://donate.apache.org/">Donate!</a><br/><a href="http://www.apache.org/foun
 dation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/sitemap.html">Site Map</a></strong>
+            <strong><a href="/ng/documentation.html">Documentation</a></strong><br/><a href="/ng/documentation/getting-started.html">Getting Started</a><br/><a href="/ng/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/ng/documentation/development.html">Development</a><br/><a href="/ng/documentation/bundles.html">Bundles</a><br/><a href="/ng/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/><a href="/ng/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/ng/apidocs/sling9/index.html">Sling 9</a><br/><a href="/ng/apidocs/sling8/index.html">Sling 8</a><br/><a href="/ng/apidocs/sling7/index.html">Sling 7</a><br/><a href="/ng/apidocs/sling6/index.html">Sling 6</a><br/><a href="/ng/apidocs/sling5/index.html">Sling 5</a><br/><a href="/ng/javadoc-io.html">Archive at javadoc.io</a><br/><p></p
 ><strong>Project info</strong><br/><a href="/ng/downloads.cgi">Downloads</a><br/><a href="http://www.apache.org/licenses/">License</a><br/><a href="/ng/contributing.html">Contributing</a><br/><a href="/ng/news.html">News</a><br/><a href="/ng/links.html">Links</a><br/><a href="/ng/project-information.html">Project Information</a><br/><a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/ng/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</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="https://donate.apache.
 org/">Donate!</a><br/><a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/ng/sitemap.html">Site Map</a></strong>
         </div>        <div class="main">
-<div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>Apache Sling Dynamic Include</h1></header><p>Notice: 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.</p>
+<div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>Apache Sling Dynamic Include</h1></header><p>Notice: 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.</p>
 <h1>Sling Dynamic Include (org.apache.sling.dynamic-include)</h1>
 <p>For now the Sling Dynamic Include documentation can be found <a href="https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/sling-dynamic-include/README.md">in the Sling codebase</a> or <a href="https://github.com/apache/sling/tree/trunk/contrib/extensions/sling-dynamic-include">on our GitHub mirror</a> if that's in sync.</p></section></div></div>            
 <div class="footer">

http://git-wip-us.apache.org/repos/asf/sling-site/blob/3a935d04/documentation/bundles/file-installer-provider.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/file-installer-provider.html b/documentation/bundles/file-installer-provider.html
index 8e1a489..94c5606 100644
--- a/documentation/bundles/file-installer-provider.html
+++ b/documentation/bundles/file-installer-provider.html
@@ -2,22 +2,22 @@
     <head>
 <meta charset="utf-8"/>
         <title>Apache Sling on JBake</title>
-        <link rel="stylesheet" href="/res/css/site.css"/>
-        <link rel="stylesheet" href="/res/css/codehilite.css"/>
+        <link rel="stylesheet" href="/ng/res/css/site.css"/>
+        <link rel="icon" href="/ng/res/favicon.ico"/>
         <div class="title">
             <div class="logo">
                 <a href="http://sling.apache.org">
-                    <img border="0" alt="Apache Sling" src="/res/logos/sling.svg"/>
+                    <img border="0" alt="Apache Sling" src="/ng/res/logos/sling.svg"/>
                 </a>
             </div><div class="header">
                 <a href="http://www.apache.org">
-                    <img border="0" alt="Apache" src="/res/logos/apache.png"/>
+                    <img border="0" alt="Apache" src="/ng/res/logos/apache.png"/>
                 </a>
             </div>
         </div>        
     </head><body>
 <div class="menu">
-            <strong><a href="/documentation.html">Documentation</a></strong><br/><a href="/documentation/getting-started.html">Getting Started</a><br/><a href="/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/documentation/development.html">Development</a><br/><a href="/documentation/bundles.html">Bundles</a><br/><a href="/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/><a href="/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/apidocs/sling9/index.html">Sling 9</a><br/><a href="/apidocs/sling8/index.html">Sling 8</a><br/><a href="/apidocs/sling7/index.html">Sling 7</a><br/><a href="/apidocs/sling6/index.html">Sling 6</a><br/><a href="/apidocs/sling5/index.html">Sling 5</a><br/><a href="/javadoc-io.html">Archive at javadoc.io</a><br/><p></p><strong>Project info</strong><br/><a h
 ref="/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://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</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="https://donate.apache.org/">Donate!</a><br/><a href="http://www.apache.org/foun
 dation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/sitemap.html">Site Map</a></strong>
+            <strong><a href="/ng/documentation.html">Documentation</a></strong><br/><a href="/ng/documentation/getting-started.html">Getting Started</a><br/><a href="/ng/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/ng/documentation/development.html">Development</a><br/><a href="/ng/documentation/bundles.html">Bundles</a><br/><a href="/ng/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/><a href="/ng/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/ng/apidocs/sling9/index.html">Sling 9</a><br/><a href="/ng/apidocs/sling8/index.html">Sling 8</a><br/><a href="/ng/apidocs/sling7/index.html">Sling 7</a><br/><a href="/ng/apidocs/sling6/index.html">Sling 6</a><br/><a href="/ng/apidocs/sling5/index.html">Sling 5</a><br/><a href="/ng/javadoc-io.html">Archive at javadoc.io</a><br/><p></p
 ><strong>Project info</strong><br/><a href="/ng/downloads.cgi">Downloads</a><br/><a href="http://www.apache.org/licenses/">License</a><br/><a href="/ng/contributing.html">Contributing</a><br/><a href="/ng/news.html">News</a><br/><a href="/ng/links.html">Links</a><br/><a href="/ng/project-information.html">Project Information</a><br/><a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/ng/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</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="https://donate.apache.
 org/">Donate!</a><br/><a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/ng/sitemap.html">Site Map</a></strong>
         </div>        <div class="main">
 <div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>File Installer Provider</h1></header><p>The file installer provider scans configured directories and provides the found artifacts (files) to the <a href="/documentation/bundles/osgi-installer.html">OSGI installer</a>. The functionality is very similar to Apache Felix FileInstall, with the major difference that this service implements just the task of scanning a file directory. All the management logic is implemented in the OSGi installer and support of various artifact types like bundles, configurations or custom formats is implemented by plugins for the OSGi installer.</p>
 <h2>Setup</h2>
@@ -56,7 +56,7 @@
 <h2>Custom Artifacts</h2>
 <p>Custom artifacts are handled by the OSGi installer depending on the installed plugins. Have a look at the OSGi installer and its plugins for more information.</p>
 <h2>Runmode Support</h2>
-<p>The file installer supports run modes for installing artifacts (added with <a href="https://issues.apache.org/jira/browse/SLING-4478">SLING-4478</a>). Within the scanned directory, a folder prefixed with "install." and followed by one or more run modes (separated by ".") will only be considered if all the respective run modes are active. For example artifacts below a folder named <code>install.a1.dev</code> are only taken into account if the run modes <code>a1</code> and <code>dev</code> are both active.</p>
+<p>The file installer supports run modes for installing artifacts (added with <a href="https://issues.apache.org/jira/browse/SLING-4478">SLING-4478</a>). Within the scanned directory, a folder prefixed with "install." and followed by one or more run modes (separated by ".") will only be considered if all the respective run modes are active. For example artifacts below a folder named <code>install.a1.dev</code> are only taken into account if the run modes <code>a1</code> and <code>dev</code> are both active. </p>
 <p>You can even combine start level and run mode support. Just pay attention that the run mode foldername must be set on a direct child folder of <code>sling.fileinstall.dir</code> while the start level must be set directly on the parent folder of the artifact you want to install. E.g. <code>&lt;sling.fileinstall.dir&gt;/install.a1.dev/3/mybundle.jar</code> will only be considered if both run modes <code>a1</code> and <code>dev</code> are set. If this is the case then the according artifact will be installed in start level 3.</p>
 <h1>Project Info</h1>
 <ul>

http://git-wip-us.apache.org/repos/asf/sling-site/blob/3a935d04/documentation/bundles/internationalization-support-i18n.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/internationalization-support-i18n.html b/documentation/bundles/internationalization-support-i18n.html
index b07933a..3b41d87 100644
--- a/documentation/bundles/internationalization-support-i18n.html
+++ b/documentation/bundles/internationalization-support-i18n.html
@@ -2,22 +2,22 @@
     <head>
 <meta charset="utf-8"/>
         <title>Apache Sling on JBake</title>
-        <link rel="stylesheet" href="/res/css/site.css"/>
-        <link rel="stylesheet" href="/res/css/codehilite.css"/>
+        <link rel="stylesheet" href="/ng/res/css/site.css"/>
+        <link rel="icon" href="/ng/res/favicon.ico"/>
         <div class="title">
             <div class="logo">
                 <a href="http://sling.apache.org">
-                    <img border="0" alt="Apache Sling" src="/res/logos/sling.svg"/>
+                    <img border="0" alt="Apache Sling" src="/ng/res/logos/sling.svg"/>
                 </a>
             </div><div class="header">
                 <a href="http://www.apache.org">
-                    <img border="0" alt="Apache" src="/res/logos/apache.png"/>
+                    <img border="0" alt="Apache" src="/ng/res/logos/apache.png"/>
                 </a>
             </div>
         </div>        
     </head><body>
 <div class="menu">
-            <strong><a href="/documentation.html">Documentation</a></strong><br/><a href="/documentation/getting-started.html">Getting Started</a><br/><a href="/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/documentation/development.html">Development</a><br/><a href="/documentation/bundles.html">Bundles</a><br/><a href="/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/><a href="/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/apidocs/sling9/index.html">Sling 9</a><br/><a href="/apidocs/sling8/index.html">Sling 8</a><br/><a href="/apidocs/sling7/index.html">Sling 7</a><br/><a href="/apidocs/sling6/index.html">Sling 6</a><br/><a href="/apidocs/sling5/index.html">Sling 5</a><br/><a href="/javadoc-io.html">Archive at javadoc.io</a><br/><p></p><strong>Project info</strong><br/><a h
 ref="/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://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</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="https://donate.apache.org/">Donate!</a><br/><a href="http://www.apache.org/foun
 dation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/sitemap.html">Site Map</a></strong>
+            <strong><a href="/ng/documentation.html">Documentation</a></strong><br/><a href="/ng/documentation/getting-started.html">Getting Started</a><br/><a href="/ng/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/ng/documentation/development.html">Development</a><br/><a href="/ng/documentation/bundles.html">Bundles</a><br/><a href="/ng/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/><a href="/ng/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/ng/apidocs/sling9/index.html">Sling 9</a><br/><a href="/ng/apidocs/sling8/index.html">Sling 8</a><br/><a href="/ng/apidocs/sling7/index.html">Sling 7</a><br/><a href="/ng/apidocs/sling6/index.html">Sling 6</a><br/><a href="/ng/apidocs/sling5/index.html">Sling 5</a><br/><a href="/ng/javadoc-io.html">Archive at javadoc.io</a><br/><p></p
 ><strong>Project info</strong><br/><a href="/ng/downloads.cgi">Downloads</a><br/><a href="http://www.apache.org/licenses/">License</a><br/><a href="/ng/contributing.html">Contributing</a><br/><a href="/ng/news.html">News</a><br/><a href="/ng/links.html">Links</a><br/><a href="/ng/project-information.html">Project Information</a><br/><a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/ng/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</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="https://donate.apache.
 org/">Donate!</a><br/><a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/ng/sitemap.html">Site Map</a></strong>
         </div>        <div class="main">
 <div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>Internationalization Support (i18n)</h1></header><p>Internationalization support in Sling consists of four methods in the <code>SlingHttpServletRequest</code> interface:</p>
 <ul>
@@ -57,20 +57,65 @@
 <p>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>
 <h5>Sample Resources</h5>
 <p>Content for dictionaries in this format might look like this:</p>
-<p>/libs/languages +-- English (nt:folder, mix:language) | +-- jcr:language = en | +-- m1 (sling:MessageEntry) | | +-- sling:key = "msg001" | | +-- sling:message = "This is a message" | +-- m2 (sling:MessageEntry) | +-- sling:key = "msg002" | +-- sling:message = "Another message" +-- Deutsch (nt:folder, mix:language) +-- jcr:language = de +-- m1 (sling:MessageEntry) | +-- sling:key = "msg001" | +-- sling:message = "Das ist ein Text" +-- m2 (sling:MessageEntry) +-- sling:key = "msg002" +-- sling:message = "Ein anderer Text"</p>
-<p>/apps/myApp +-- English (nt:folder, mix:language) | +-- jcr:language = en | +-- mx (sling:MessageEntry) | +-- sling:key = "msgXXX" | +-- sling:message = "An Application Text" +-- Deutsch (nt:folder, mix:language) +-- jcr:language = de +-- mx (sling:MessageEntry) +-- sling:key = "msgXXX" +-- sling:message = "Ein Anwendungstext"</p>
+<pre><code>   /libs/languages
+           +-- English (nt:folder, mix:language)
+           |    +-- jcr:language = en
+           |    +-- m1 (sling:MessageEntry)
+           |    |    +-- sling:key = &quot;msg001&quot;
+           |    |    +-- sling:message = &quot;This is a message&quot;
+           |    +-- m2 (sling:MessageEntry)
+           |         +-- sling:key = &quot;msg002&quot;
+           |         +-- sling:message = &quot;Another message&quot;
+           +-- Deutsch (nt:folder, mix:language)
+                +-- jcr:language = de
+                +-- m1 (sling:MessageEntry)
+                |    +-- sling:key = &quot;msg001&quot;
+                |    +-- sling:message = &quot;Das ist ein Text&quot;
+                +-- m2 (sling:MessageEntry)
+                     +-- sling:key = &quot;msg002&quot;
+                     +-- sling:message = &quot;Ein anderer Text&quot;
+
+   /apps/myApp
+           +-- English (nt:folder, mix:language)
+           |    +-- jcr:language = en
+           |    +-- mx (sling:MessageEntry)
+           |         +-- sling:key = &quot;msgXXX&quot;
+           |         +-- sling:message = &quot;An Application Text&quot;
+           +-- Deutsch (nt:folder, mix:language)
+                +-- jcr:language = de
+                +-- mx (sling:MessageEntry)
+                     +-- sling:key = &quot;msgXXX&quot;
+                     +-- sling:message = &quot;Ein Anwendungstext&quot;
+</code></pre>
 <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 resources have no significance (in case the <code>sling:key</code> is set).</p>
 <h4>JSON-file based</h4>
 <p>Since Version 2.4.2 the i18n bundle supports dictionaries in JSON-format (<a href="https://issues.apache.org/jira/browse/SLING-4543">SLING-4543</a>). Since loading such dictionaries is much faster than loading the ones based on <code>sling:MessageEntry</code>s this format should be used preferably. This format is assumed if the <code>mix:language</code> resource name is ending with the extension <code>.json</code>. The parser will take any "key":"value" pair in the JSON file, including those in nested objects or arrays. Normally, a dictionary will be just a single json object = hash map though.</p>
 <h5>Sample Resources</h5>
 <p>Content for this format might look like this:</p>
-<p>/libs/languages +-- english.json (nt:file, mix:language) | +-- jcr:language = en | +-- jcr:content (nt:resource) | + jcr:data (containing the actual JSON file) +-- deutsch.json (nt:file, mix:language) +-- jcr:language = de +-- jcr:content (nt:resource) + jcr:data (containing the actual JSON file)</p>
+<pre><code>   /libs/languages
+           +-- english.json (nt:file, mix:language)
+           |    +-- jcr:language = en
+           |    +-- jcr:content (nt:resource)
+           |         + jcr:data (containing the actual JSON file)
+           +-- deutsch.json (nt:file, mix:language)
+                +-- jcr:language = de
+                +-- jcr:content (nt:resource)
+                    + jcr:data (containing the actual JSON file)
+</code></pre>
 <h4>JCR Node Types supporting the JCR Repository based <code>ResourceBundleProvider</code></h4>
 <p>The sling.i18n bundle asserts the following node types:</p>
-<p>[mix:language] mixin - jcr:language (string)</p>
+<pre><code>[mix:language]
+    mixin
+  - jcr:language (string)
+</code></pre>
 <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>[sling:Message] mixin - sling:key (string) - sling:message (undefined)</p>
-<p>[sling:MessageEntry] &gt; nt:hierarchyNode, sling:Message</p>
+<pre><code>[sling:Message]
+    mixin
+  - sling:key (string)
+  - sling:message (undefined)
+
+[sling:MessageEntry] &gt; nt:hierarchyNode, sling:Message  
+</code></pre>
 <p>The <code>sling:Message</code> and <code>sling:MessageEntry</code> are helper node types. The latter must be used to create the nodes for the <code>sling:MessageEntry</code> based format.</p>
 <h3><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>