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 2014/01/27 09:41:22 UTC

svn commit: r895534 - in /websites/staging/sling/trunk/content: ./ documentation/the-sling-engine/featureflags.html

Author: buildbot
Date: Mon Jan 27 08:41:22 2014
New Revision: 895534

Log:
Staging update by buildbot for sling

Modified:
    websites/staging/sling/trunk/content/   (props changed)
    websites/staging/sling/trunk/content/documentation/the-sling-engine/featureflags.html

Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Jan 27 08:41:22 2014
@@ -1 +1 @@
-1561603
+1561606

Modified: websites/staging/sling/trunk/content/documentation/the-sling-engine/featureflags.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/the-sling-engine/featureflags.html (original)
+++ websites/staging/sling/trunk/content/documentation/the-sling-engine/featureflags.html Mon Jan 27 08:41:22 2014
@@ -99,17 +99,92 @@ continuosly deploy new features of an ap
 <p>Feature flags can be provided by registering <code>org.apache.sling.featureflags.Feature</code> services.
 Alternatively feature flags can be provided by factory configuration with factory PID
 <code>org.apache.sling.featureflags.Feature</code> as follows:</p>
-<p>| <code>name</code> | Short name of this feature. This name is used to refer to this feature
-          when checking for it to be enabled or not. This property is required
-          and defaults to a name derived from the feature's class name and object
-          identity. It is strongly recommended to define a useful and unique for the feature|
-| <code>description</code> | Description for the feature. The intent is to descibe the behaviour
-          of the application if this feature would be enabled. It is recommended
-          to define this property. The default value is the value of the name property. |
-| <code>enabled</code> | Boolean flag indicating whether the feature is enabled or not by
-          this configuration|</p>
+<table>
+<thead>
+<tr>
+<th>Property</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>name</code></td>
+<td>Short name of this feature. This name is used to refer to this feature</td>
+</tr>
+<tr>
+<td>when checking for it to be enabled or not. This property is required</td>
+<td></td>
+</tr>
+<tr>
+<td>and defaults to a name derived from the feature's class name and object</td>
+<td></td>
+</tr>
+<tr>
+<td>identity. It is strongly recommended to define a useful and unique for the feature</td>
+<td></td>
+</tr>
+<tr>
+<td><code>description</code></td>
+<td>Description for the feature. The intent is to descibe the behaviour</td>
+</tr>
+<tr>
+<td>of the application if this feature would be enabled. It is recommended</td>
+<td></td>
+</tr>
+<tr>
+<td>to define this property. The default value is the value of the name property.</td>
+<td></td>
+</tr>
+<tr>
+<td><code>enabled</code></td>
+<td>Boolean flag indicating whether the feature is enabled or not by</td>
+</tr>
+<tr>
+<td>this configuration</td>
+<td></td>
+</tr>
+</tbody>
+</table>
+<h1 id="resource-resolution">Resource Resolution</h1>
+<p>The <code>ResourceResolver</code> supports feature flags while looking up resources both in all the
+resource accessor methods if the <code>org.apache.sling.featueflags.Features</code> service is
+available to the <code>ResourceResolver</code>. Otherwise feature flags are ignored.</p>
+<p>To limit visibility of a resource according to feature flags, the <code>sling:features</code> property
+can be set to a single or multi-value string. A feature flag to be checked is just listed
+with an optional dash (<code>-</code>) prefix. Without the dash the named feature must be enabled to
+have the resource visible. If the feature name is prefixed with a dash the resoure is only
+visible if the feature flag is disabled. If multiple feature flag names are given, the
+resource is visible if at least one of the features is enabled (or disabled if prefixed with
+a dash).</p>
+<h2 id="examples">Examples:</h2>
+<table>
+<thead>
+<tr>
+<th><code>sling:features</code></th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>"sample"</code></td>
+<td>Resource is visible if feature <em>sample</em> is enabled.</td>
+</tr>
+<tr>
+<td><code>"-sample"</code></td>
+<td>Resource is visible if feature <em>sample</em> is disabled.</td>
+</tr>
+<tr>
+<td><code>[ "sample1", "sample2" ]</code></td>
+<td>Resource is visible if feature <em>sample1</em> or <em>sample2</em> (or both) is enabled.</td>
+</tr>
+<tr>
+<td><code>[ "sample1", "-sample2", "sample3" ]</code></td>
+<td>Resource is visible if feature <em>sample1</em> or <em>sample3</em> (or both) is enabled or if <em>sample2</em> is disabled.</td>
+</tr>
+</tbody>
+</table>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1561603 by fmeschbe on Mon, 27 Jan 2014 08:26:12 +0000
+        Rev. 1561606 by fmeschbe on Mon, 27 Jan 2014 08:41:16 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project