Author: buildbot Date: Thu Aug 18 12:07:52 2016 New Revision: 995383 Log: Staging update by buildbot for sling
Modified: websites/staging/sling/trunk/content/ (props changed) websites/staging/sling/trunk/content/documentation/bundles/repository-initialization.html Propchange: websites/staging/sling/trunk/content/ ------------------------------------------------------------------------------ --- cms:source-revision (original) +++ cms:source-revision Thu Aug 18 12:07:52 2016 @@ -1 +1 @@ -1756736 +1756765 Modified: websites/staging/sling/trunk/content/documentation/bundles/repository-initialization.html ============================================================================== --- websites/staging/sling/trunk/content/documentation/bundles/repository-initialization.html (original) +++ websites/staging/sling/trunk/content/documentation/bundles/repository-initialization.html Thu Aug 18 12:07:52 2016 @@ -189,11 +189,24 @@ of the repoinit parser to a JCR reposito </pre></div> -<h2 id="embedding-repoinit-statements-in-the-sling-provisioning-model">Embedding repoinit statements in the Sling provisioning model<a class="headerlink" href="#embedding-repoinit-statements-in-the-sling-provisioning-model" title="Permanent link">¶</a></h2> -<p>The <code>slingstart-maven-plugin</code>, from V1.4.2 on, allows for embedding "special" sections in the Sling provisioning model by starting +<h2 id="providing-repoinit-statements-from-the-sling-provisioning-model-or-other-urls">Providing repoinit statements from the Sling provisioning model or other URLs<a class="headerlink" href="#providing-repoinit-statements-from-the-sling-provisioning-model-or-other-urls" title="Permanent link">¶</a></h2> +<p>This requires the <code>org.apache.sling.provisioning.model</code> bundle, version 1.4.2 or later.</p> +<p>All bundles required for this feature need to be active before the <code>SlingRepository</code> service starts.</p> +<p>From version 1.0.2 of the <code>org.apache.sling.jcr.repoinit</code> bundle, the <code>o.a.s.jcr.repoinit.RepositoryInitializer</code> component uses an OSGi +configuration as shown in this example to define where to read repoinit statements:</p> +<div class="codehilite"><pre><span class="n">org</span><span class="p">.</span><span class="n">apache</span><span class="p">.</span><span class="n">sling</span><span class="p">.</span><span class="n">jcr</span><span class="p">.</span><span class="n">repoinit</span><span class="p">.</span><span class="n">impl</span><span class="p">.</span><span class="n">RepositoryInitializer</span> + <span class="n">references</span><span class="p">=[</span>"<span class="n">model</span><span class="p">:</span><span class="n">context</span><span class="p">:</span><span class="o">/</span><span class="n">resources</span><span class="o">/</span><span class="n">provisioning</span><span class="o">/</span><span class="n">model</span><span class="p">.</span><span class="n">txt</span>"<span class="p">,</span>"<span class="n">model</span><span class="p">@</span><span class="n">repoinitTwo</span><span class="p">:</span><span class="n">context</span><span class="p">:</span><span class="o">/</span><span class="n">resources</span><span class="o">/</span><span class="n">provisioning</span><span class="o">/</span><span class="n">model</span><span class="p">.</span><span class="n">txt</span>"<span class="p">]</span> +</pre></div> + + +<p>This example defines two <em>references</em> to URLs that supply repoinit statements. Their syntax is described below.</p> +<p>By default the <code>RepositoryInitializer</code> uses the first URL shown in the above example, which points to the provisioning model that's embedded by default in the Sling Launchpad runnable jar.</p> +<p>Note that previous versions of the <code>org.apache.sling.jcr.repoinit</code> bundle used different configuration parameters. From version 1.0.2 on, warnings are logged if those old parameters (<em>text.url,text.format,model.section.name</em>) are used.</p> +<h3 id="references-to-sling-provisioning-model-additional-sections">References to Sling Provisioning Model additional sections<a class="headerlink" href="#references-to-sling-provisioning-model-additional-sections" title="Permanent link">¶</a></h3> +<p>The <code>slingstart-maven-plugin</code>, from V1.4.2 on, allows for embedding so-called "additional sections" in the Sling provisioning model by starting their name with a colon.</p> -<p>The <code>o.a.s.jcr.repoinit</code> bundle uses this feature to execute <code>repoinit</code> statements provided by Sling provisioning models, as in this -example:</p> +<p>The <code>o.a.s.jcr.repoinit</code> bundle can use this feature to execute <code>repoinit</code> statements provided by Sling provisioning models, as in this +provisioning model example fragment:</p> <div class="codehilite"><pre><span class="k">[:repoinit]</span> <span class="err">create</span> <span class="err">path</span> <span class="err">/repoinit/provisioningModelTest</span> @@ -201,12 +214,23 @@ example:</p> </pre></div> -<p>The <code>org.apache.sling.repoinit.jcr.RepositoryInitializer</code> component reads the provisioning model text using a configurable URL, which defaults to <code>context:/resources/provisioning/model.txt</code>, to get the model that our <code>maven-slingstart-plugin</code> embeds in the Sling launchpad, the <code>context:</code> protocol being handled by the launchpad's <code>ContextProtocolHandler</code> by default.</p> -<p>Configuring a different URL and if needed creating a protocol handler will allow other launchers to provide the provisioning model, or directly provide repoinit statements. See that component's OSGi config descriptions for details.</p> -<p>This also requires the <code>org.apache.sling.provisioning.model</code> bundle, version 1.4.2 or later.</p> -<p>All bundles required for this feature need to be active before the <code>SlingRepository</code> service starts.</p> +<p>To read repoinit statements from such an additional provisioning model section, the <code>RepositoryInitializer</code> configuration shown above uses references like</p> +<div class="codehilite"><pre><span class="n">model</span><span class="p">@</span><span class="n">repoinitTwo</span><span class="p">:</span><span class="n">context</span><span class="p">:</span><span class="o">/</span><span class="n">resources</span><span class="o">/</span><span class="n">provisioning</span><span class="o">/</span><span class="n">model</span><span class="p">.</span><span class="n">txt</span> +</pre></div> + + +<p>Where <em>model</em> means "use the provisioning model format", <em>repoinitTwo</em> is the name of the additional section to read statements from in the provisioning +model (without the leading colon) and <em>context:/resources/...</em> is the URL to use to retrieve the provisioning model. </p> +<p>The section name in that reference is optional and defaults to <em>repoinit</em>. If it's not specified the <code>@</code> should be omitted as well.</p> +<h3 id="references-to-urls-providing-raw-repoinit-statements">References to URLs providing raw repoinit statements<a class="headerlink" href="#references-to-urls-providing-raw-repoinit-statements" title="Permanent link">¶</a></h3> +<p>Configuring <code>RepositoryInitializer</code> like in this example, with the <em>raw</em> prefix, means that its content is passed as is to the repoinit parser:</p> +<div class="codehilite"><pre><span class="n">raw</span><span class="o">:</span><span class="n">classpath</span><span class="o">://</span><span class="n">some</span><span class="o">-</span><span class="n">repoinit</span><span class="o">-</span><span class="n">file</span><span class="o">.</span><span class="na">txt</span> +</pre></div> + + +<p>Which points to a <code>classpath:</code> URL to provide the raw repoinit statements.</p> <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;"> - Rev. 1754506 by bdelacretaz on Fri, 29 Jul 2016 12:33:42 +0000 + Rev. 1756765 by bdelacretaz on Thu, 18 Aug 2016 12:07:39 +0000 </div> <div class="trademarkFooter"> Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project