You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by fm...@apache.org on 2014/01/27 09:41:16 UTC
svn commit: r1561606 -
/sling/site/trunk/content/documentation/the-sling-engine/featureflags.mdtext
Author: fmeschbe
Date: Mon Jan 27 08:41:16 2014
New Revision: 1561606
URL: http://svn.apache.org/r1561606
Log:
Resource Resolution section
Modified:
sling/site/trunk/content/documentation/the-sling-engine/featureflags.mdtext
Modified: sling/site/trunk/content/documentation/the-sling-engine/featureflags.mdtext
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/the-sling-engine/featureflags.mdtext?rev=1561606&r1=1561605&r2=1561606&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/the-sling-engine/featureflags.mdtext (original)
+++ sling/site/trunk/content/documentation/the-sling-engine/featureflags.mdtext Mon Jan 27 08:41:16 2014
@@ -16,6 +16,8 @@ Feature flags can be provided by registe
Alternatively feature flags can be provided by factory configuration with factory PID
`org.apache.sling.featureflags.Feature` as follows:
+| Property | Description |
+|--|--|
| `name` | 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
@@ -25,3 +27,27 @@ Alternatively feature flags can be provi
to define this property. The default value is the value of the name property. |
| `enabled` | Boolean flag indicating whether the feature is enabled or not by
this configuration|
+
+
+# Resource Resolution
+
+The `ResourceResolver` supports feature flags while looking up resources both in all the
+resource accessor methods if the `org.apache.sling.featueflags.Features` service is
+available to the `ResourceResolver`. Otherwise feature flags are ignored.
+
+To limit visibility of a resource according to feature flags, the `sling:features` property
+can be set to a single or multi-value string. A feature flag to be checked is just listed
+with an optional dash (`-`) 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).
+
+## Examples:
+
+| `sling:features` | Description |
+|--|--|
+`"sample"` | Resource is visible if feature *sample* is enabled. |
+`"-sample"` | Resource is visible if feature *sample* is disabled. |
+`[ "sample1", "sample2" ]` | Resource is visible if feature *sample1* or *sample2* (or both) is enabled. |
+`[ "sample1", "-sample2", "sample3" ]` | Resource is visible if feature *sample1* or *sample3* (or both) is enabled or if *sample2* is disabled. |