You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bu...@apache.org on 2015/08/27 08:02:55 UTC

svn commit: r963228 - in /websites/staging/sling/trunk/content: ./ documentation/development/slingstart.html

Author: buildbot
Date: Thu Aug 27 06:02:54 2015
New Revision: 963228

Log:
Staging update by buildbot for sling

Modified:
    websites/staging/sling/trunk/content/   (props changed)
    websites/staging/sling/trunk/content/documentation/development/slingstart.html

Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Aug 27 06:02:54 2015
@@ -1 +1 @@
-1697566
+1698080

Modified: websites/staging/sling/trunk/content/documentation/development/slingstart.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/development/slingstart.html (original)
+++ websites/staging/sling/trunk/content/documentation/development/slingstart.html Thu Aug 27 06:02:54 2015
@@ -39,7 +39,18 @@
     </div>
     
     <div class="menu"> 
-      <p><strong><a href="/documentation.html">Documentation</a></strong> <br />
+      <style type="text/css">
+/* The following code is added by mdx_elementid.py
+   It was originally lifted from http://subversion.apache.org/style/site.css */
+/*
+ * Hide class="elementid-permalink", except when an enclosing heading
+ * has the :hover property.
+ */
+.headerlink, .elementid-permalink {
+  visibility: hidden;
+}
+h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
+<p><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 />
@@ -90,10 +101,21 @@
       
       
       <h1>The Apache Sling Provisioning Model and Apache SlingStart</h1>
-      <p>The Apache Sling provisioning model is a model to describe OSGi based application. It can also be used to define a partial application aka feature (or subsystem in OSGi terms).</p>
+      <style type="text/css">
+/* The following code is added by mdx_elementid.py
+   It was originally lifted from http://subversion.apache.org/style/site.css */
+/*
+ * Hide class="elementid-permalink", except when an enclosing heading
+ * has the :hover property.
+ */
+.headerlink, .elementid-permalink {
+  visibility: hidden;
+}
+h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
+<p>The Apache Sling provisioning model is a model to describe OSGi based application. It can also be used to define a partial application aka feature (or subsystem in OSGi terms).</p>
 <p>The model is describing an instance, it is not directly related to any particular tooling or packaging/provisioning vehicle.</p>
 <p>For Apache Maven users, the slingstart-maven-plugin uses the model to create an executable application and/or a web application based on the model. Sling's Launchpad is defined using the model and built by this Maven plugin.</p>
-<h2 id="the-model">The Model</h2>
+<h2 id="the-model">The Model<a class="headerlink" href="#the-model" title="Permanent link">&para;</a></h2>
 <p>The model is a simple API consisting of data objects:</p>
 <ul>
 <li>Model: This is the central object. It consists of features.</li>
@@ -105,7 +127,7 @@
 <li>Configuration: A OSGi configuration</li>
 <li>Settings : Framework settings for the OSGi framework</li>
 </ul>
-<h3 id="run-modes">Run Modes</h3>
+<h3 id="run-modes">Run Modes<a class="headerlink" href="#run-modes" title="Permanent link">&para;</a></h3>
 <p>The default run mode is always active, and all information provided there will be used/started.
 Custom run modes can be used to configure for different situations. Depending on which run mode is used to start the instance a different set of artifacts or configurations is used.
 Each run mode is associated with a set of run mode names. Only if all listed run modes are active, the definition is used.</p>
@@ -115,26 +137,26 @@ Each run mode is associated with a set o
 <li>:webapp Artifacts for the webapp only</li>
 </ul>
 <p>Other special run modes can be defined by using a single run mode name which starts with a colon, like :test. These run modes can be used by special tooling.</p>
-<h3 id="start-levels">Start Levels</h3>
+<h3 id="start-levels">Start Levels<a class="headerlink" href="#start-levels" title="Permanent link">&para;</a></h3>
 <p>Each run mode has start levels. These start levels correspond to OSGi start levels. The default start level has the level 0 and should be used for all non bundle artifacts. If a non bundle artifact is configured with a start level, it's still provisioned, however the start level information might not have any meaning. As usually the provisioned artifacts are bundles and as start levels are pretty handy, this was conscious design decision in order to keep the model files small.</p>
-<h3 id="artifacts">Artifacts</h3>
+<h3 id="artifacts">Artifacts<a class="headerlink" href="#artifacts" title="Permanent link">&para;</a></h3>
 <p>An artifact is defined by Maven coordinates, that is group id, artifact id and version. Type and classifier can be specified, too. Type defaults to "jar". Although the maven way of referring to an artifact is used, the model is in no way tied to Maven and can be used with any tooling.</p>
-<h3 id="configurations">Configurations</h3>
+<h3 id="configurations">Configurations<a class="headerlink" href="#configurations" title="Permanent link">&para;</a></h3>
 <p>A configuration has a pid, or a factory pid and an alias and of course the properties of the configuration object.</p>
 <p>Special configurations can be marked with a leading ":" of the pid. Special configurations are not added to the OSGi config admin. There are some predefined special configurations</p>
 <ul>
 <li>:web.xml This configuration must be part of the :webapp runmode and contains a complete web.xml for the web application</li>
 <li>:bootstrap This configuration must be part of either the :boot, :base, :standalone, or :webapp run mode and define the contents for bootstrap command file executed by Launchpad.</li>
 </ul>
-<h3 id="settings">Settings</h3>
+<h3 id="settings">Settings<a class="headerlink" href="#settings" title="Permanent link">&para;</a></h3>
 <p>Settings are key value pairs that are added to the framework properties. For now, only settings for the run modes :boot, :base, :standalone, or :webapp are supported.</p>
-<h3 id="features">Features</h3>
+<h3 id="features">Features<a class="headerlink" href="#features" title="Permanent link">&para;</a></h3>
 <p>Features group run modes and define a special functionality. The model also defines two special features:</p>
 <ul>
 <li>:launchpad This feature contains the dependency to Sling's launchpad artifact to be used. This mode is required if Apache Sling Launchpad should be used to start the application.</li>
 <li>:boot The artifacts that are installed before the framework is started. They're used to bootstrap the system.</li>
 </ul>
-<h2 id="model-files">Model Files</h2>
+<h2 id="model-files">Model Files<a class="headerlink" href="#model-files" title="Permanent link">&para;</a></h2>
 <p>The model comes also with a textual description language:</p>
 <div class="codehilite"><pre><span class="k">[feature name=my-feature]</span>
     <span class="k">[variables]</span>
@@ -172,9 +194,9 @@ Each run mode is associated with a set o
 </pre></div>
 
 
-<h3 id="comments">Comments</h3>
+<h3 id="comments">Comments<a class="headerlink" href="#comments" title="Permanent link">&para;</a></h3>
 <p>Each object in the model can be annotated with comments. A comment is a line starting with a '#'. Leading spaces are ignored.</p>
-<h3 id="configurations-in-the-model-file">Configurations in the Model file</h3>
+<h3 id="configurations-in-the-model-file">Configurations in the Model file<a class="headerlink" href="#configurations-in-the-model-file" title="Permanent link">&para;</a></h3>
 <p>Configuration names are related to the PID and factory PID. The structure of the name is as follows:</p>
 <div class="codehilite"><pre><span class="n">name</span> <span class="p">::=</span> <span class="o">&lt;</span><span class="n">pid</span><span class="o">&gt;</span> <span class="p">(</span> <span class="s">&#39;-&#39;</span> <span class="o">&lt;</span><span class="n">subname</span><span class="o">&gt;</span> <span class="p">)</span>
 </pre></div>
@@ -189,7 +211,7 @@ Each run mode is associated with a set o
 </pre></div>
 
 
-<h3 id="default-configuration-format">Default Configuration Format</h3>
+<h3 id="default-configuration-format">Default Configuration Format<a class="headerlink" href="#default-configuration-format" title="Permanent link">&para;</a></h3>
 <p>Configurations use by default the format of the Apache Felix ConfigAdmin implementation. It allows to specify the type and cardinality of a configuration property and is not limited to string values.</p>
 <p>The first line of such a file might start with a comment line (a line starting with a #). Comments within the file are not allowed.</p>
 <p>The format is:</p>
@@ -219,7 +241,7 @@ Each run mode is associated with a set o
 <li>'C' : Character</li>
 <li>'B' : Boolean</li>
 </ul>
-<h3 id="configurations-defined-through-properties">Configurations Defined through Properties</h3>
+<h3 id="configurations-defined-through-properties">Configurations Defined through Properties<a class="headerlink" href="#configurations-defined-through-properties" title="Permanent link">&para;</a></h3>
 <p>While the default configuration form is very powerful, it might also sometimes be a little bit too heavy to specify a configuration. For these usage cases, the configuration can be described as properties:</p>
 <div class="codehilite"><pre><span class="n">com</span><span class="p">.</span><span class="n">acme</span><span class="p">.</span><span class="n">xyz</span> <span class="p">[</span><span class="n">format</span><span class="p">=</span><span class="k">properties</span><span class="p">]</span>     
     <span class="n">ftp</span><span class="p">.</span><span class="n">port</span> <span class="p">=</span> 21
@@ -227,7 +249,7 @@ Each run mode is associated with a set o
 
 
 <p>Notice that this definition only supports string properties. Therefore the service consuming the configuration needs to be able to adapt a string value to the correct type.</p>
-<h2 id="slingstart-and-slingfeature-projects">Slingstart and Slingfeature projects</h2>
+<h2 id="slingstart-and-slingfeature-projects">Slingstart and Slingfeature projects<a class="headerlink" href="#slingstart-and-slingfeature-projects" title="Permanent link">&para;</a></h2>
 <p>The slingstart Maven plugin introduces two new packaging types:</p>
 <ul>
 <li>slingstart : This type requires a model at src/main/provisioning. It reads all text files in that directory and merges them in alphabetical order. The resulting artifact is a runnable jar. The assembled model is also attached to the project artifacts.</li>
@@ -238,16 +260,17 @@ Each run mode is associated with a set o
        org.apache.sling/org.apache.sling.launchpad/8-SNAPSHOT/slingstart
        org.apache.sling/org.apache.sling.launchpad.test-bundles/0.0.1-SNAPSHOT/slingfeature</p>
 <p>The resulting model is a merged model, starting with the dependencies and then merging in the current model.</p>
-<h3 id="model-merging">Model Merging</h3>
-<p>Two models are merged feature by feature - each feature is treated as a separate unit. Within a feature each run mode is treated separately as well. Within a run mode a model can overwrite definitions from the base model. For example, it can define a different configuration or a different version and/or start level for an artifact.
-In addition, it can also remove artifacts and configurations. For this the special runmode :remove needs to be used together with all run modes the artifact or configuration is currently in.</p>
+<h2 id="model-merging">Model Merging<a class="headerlink" href="#model-merging" title="Permanent link">&para;</a></h2>
+<p>Two models are merged feature by feature - each feature is treated as a separate unit. Within a feature each run mode is treated separately as well. Within a run mode a model can overwrite definitions from the base model. For example, it can define a different configuration or a different version and/or start level for an artifact.</p>
+<h3 id="removing-and-changing-of-artifacts">Removing and Changing of Artifacts<a class="headerlink" href="#removing-and-changing-of-artifacts" title="Permanent link">&para;</a></h3>
+<p>In addition, it can also remove artifacts and configurations. For this the special runmode :remove needs to be used together with all run modes the artifact or configuration is currently in.</p>
 <p>Let's look at an example base model</p>
 <p>[artifacts]
        my/special/artifact/1.0.0
        commons/library/1.0.0</p>
 <p>[artifacts runModes=test]
        another/one/2.1.0</p>
-<p>Now, another model wants to use the above model as it's base but:</p>
+<p>Another model wants to use the above model as it's base but:</p>
 <ul>
 <li>Change the version of the commons library to 1.1.0 and move it to a different start level.</li>
 <li>Remove the "special artifact"</li>
@@ -264,17 +287,35 @@ In addition, it can also remove artifact
 </pre></div>
 
 
-<p>Note that the version for removal does not play a role, it's not compared for an exact match. Configurations can be removed in the same way by just specifying their PID in the :remove run mode.</p>
-<h2 id="known-issues">Known Issues</h2>
-<h3 id="support-of-configuration-formats">Support of configuration formats</h3>
+<p>Note that the version for removal does not play a role, it's not compared for an exact match. But please keep in mind that the remove directive needs to be specified in the same feature and run mode as the original.</p>
+<h3 id="removing-and-changing-of-configurations">Removing and Changing of Configurations<a class="headerlink" href="#removing-and-changing-of-configurations" title="Permanent link">&para;</a></h3>
+<p>Configurations can be removed in the same way by just specifying their PID in the :remove run mode. This is the base model:</p>
+<p>[configurations]
+       my.special.configuration.b
+          foo="bar"
+       another.special.configuration.a
+          x="y"</p>
+<p>When this model is merged with the following model, the resulting model has a different configuration for my.special.configuration.b and no configuration for another.special.configuration.a:</p>
+<p>[configurations]
+       my.special.configuration.b
+          a="b"</p>
+<p>[configurations runModes=:remove]
+       another.special.configuration.a</p>
+<p>By default if a model inherits from another and uses the same configuration pid, the configuration is overwritten! In the above example, the configuration my.special.configuration.b contains a single property named "a". It is also possible to merge configurations:</p>
+<p>[configurations]
+       my.special.configuration.b [mode=merge]
+          a="b"</p>
+<p>When the merge directive is used, the configurations are merged and the properties are applied as a delta to the base configuration. Therefore the configuration my.special.configuration.b will have two properties "a" and "foo".</p>
+<h2 id="known-issues">Known Issues<a class="headerlink" href="#known-issues" title="Permanent link">&para;</a></h2>
+<h3 id="support-of-configuration-formats">Support of configuration formats<a class="headerlink" href="#support-of-configuration-formats" title="Permanent link">&para;</a></h3>
 <p>The provisioning model supports two formats to define configurations, properties and the format of the Apache Felix ConfigAdmin implementation.</p>
-<p>Starting with version 1.2.0 of the provisioning model and version 1.2.0 of the slingstart maven plugin, the implementation uses the latest format from Apache Felix, version 1.8.6 of the ConfigAdmin. This requires you to use version 3.6.6 (or higher) of the OSGi installer core bundle to handle these configurations.</p>
+<p>Starting with version 1.2.0 of the provisioning model and version 1.2.0 of the slingstart maven plugin, the implementation uses the latest format from Apache Felix, version 1.8.6 (or higher) of the ConfigAdmin. This requires you to use version 3.6.6 (or higher) of the OSGi installer core bundle to handle these configurations.</p>
 <p>If you want to stick with the old format from config admin, you can configure the maven plugin as follows:</p>
 <div class="codehilite"><pre><span class="nt">&lt;plugin&gt;</span>
     <span class="nt">&lt;groupId&gt;</span>org.apache.sling<span class="nt">&lt;/groupId&gt;</span>
     <span class="nt">&lt;artifactId&gt;</span>slingstart-maven-plugin<span class="nt">&lt;/artifactId&gt;</span>
     <span class="nt">&lt;extensions&gt;</span>true<span class="nt">&lt;/extensions&gt;</span>
-    <span class="nt">&lt;version&gt;</span>1.2.0<span class="nt">&lt;/version&gt;</span>
+    <span class="nt">&lt;version&gt;</span>1.3.4<span class="nt">&lt;/version&gt;</span>
     <span class="nt">&lt;dependencies&gt;</span>
         <span class="nt">&lt;dependency&gt;</span>
             <span class="nt">&lt;groupId&gt;</span>org.apache.felix<span class="nt">&lt;/groupId&gt;</span>
@@ -285,7 +326,7 @@ In addition, it can also remove artifact
 <span class="nt">&lt;/plugin&gt;</span>
 </pre></div>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1684885 by cziegeler on Thu, 11 Jun 2015 13:21:16 +0000
+        Rev. 1698080 by cziegeler on Thu, 27 Aug 2015 06:02:40 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project