This is an automated email from the ASF dual-hosted git repository.
kwin pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/sling-site.git
The following commit(s) were added to refs/heads/asf-site by this push:
new 2feb50d Improve OSGi Installer .config file format description
2feb50d is described below
commit 2feb50d3c63131a5bf7588b2ecae7e5cb84f4f42
Author: Konrad Windszus <[email protected]>
AuthorDate: Thu Jun 28 10:22:58 2018 +0200
Improve OSGi Installer .config file format description
---
.../bundles/configuration-installer-factory.html | 27 ++++++++++++----------
repolist.html | 3 +++
2 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/documentation/bundles/configuration-installer-factory.html
b/documentation/bundles/configuration-installer-factory.html
index 10959a4..8ff055b 100644
--- a/documentation/bundles/configuration-installer-factory.html
+++ b/documentation/bundles/configuration-installer-factory.html
@@ -103,9 +103,10 @@
com.acme.abc-default.cfg // Managed Service Factory,
// creates an instance for com.acme.abc
</code></pre>
-<p>If a configuration is modified, the file installer will write the
configuration back to a file to ensure peristence across restarts (if
<code>sling.fileinstall.writeback</code> is enabled).</p>
+<p>If a configuration is modified, the file installer will write the
configuration back to a file to ensure persistence across restarts (if
<code>sling.fileinstall.writeback</code> is enabled). A similar writeback
mechanism is supported by the <a href="jcr-installer-provider.html">JCR
installer</a>.</p>
+<p>The code for parsing the configuration files is in <a
href="https://github.com/apache/sling-org-apache-sling-installer-core/blob/0a34e33dd26092437be5180e34979abbf9a88300/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java#L221">InternalResource#readDictionary</a>.</p>
<h3><a href="#property-files-cfg-" name="property-files-cfg-">Property Files
(.cfg)</a></h3>
-<p>Configuration files ending in '.cfg' are plain property files
(<code>java.util.Property</code>). The format is simple:</p>
+<p>Configuration files ending in <code>.cfg</code> are plain property files
(<code>java.util.Property</code>). The format is simple:</p>
<pre><code>file ::= ( header | comment ) *
header ::= <header> ( ':' | '=' ) <value> (
'\<nl> <value> ) *
comment ::= '#' <any>
@@ -114,8 +115,9 @@ comment ::= '#' <any>
<pre><code># default port
ftp.port = 21
</code></pre>
+<p>In addition the XML format defined by
[java.util.Property](https://docs.oracle.com/javase/7/docs/api/java/util/Properties.html#loadFromXML(java.io.InputStream))
is supported if the file starts with the character <code><</code>.</p>
<h3><a href="#configuration-files-config-"
name="configuration-files-config-">Configuration Files (.config)</a></h3>
-<p>Configuration files ending in '.config' use 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>Configuration files ending in <code>.config</code> use the format of the <a
href="https://github.com/apache/felix/blob/trunk/configadmin/src/main/java/org/apache/felix/cm/file/ConfigurationHandler.java">Apache
Felix ConfigAdmin implementation</a>. 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>
<pre><code>file ::= (comment) (header) *
@@ -133,16 +135,17 @@ stringsimple ::= <quoted string representation of the
value where both '&
<p>The quoted string format is equal to the definition from HTTP 1.1 (<a
href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html">RFC2616</a>),
except that both '"' and '=' need to be escaped.</p>
<p>The 1 character type code is one of:</p>
<ul>
- <li>'T' : simple string</li>
- <li>'I' : Integer</li>
- <li>'L' : Long</li>
- <li>'F' : Float</li>
- <li>'D' : Double</li>
- <li>'X' : Byte</li>
- <li>'S' : Short</li>
- <li>'C' : Character</li>
- <li>'B' : Boolean</li>
+ <li><code>T</code> : simple string</li>
+ <li><code>I</code> : Integer</li>
+ <li><code>L</code> : Long</li>
+ <li><code>F</code> : Float</li>
+ <li><code>D</code> : Double</li>
+ <li><code>X</code> : Byte</li>
+ <li><code>S</code> : Short</li>
+ <li><code>C</code> : Character</li>
+ <li><code>B</code> : Boolean</li>
</ul>
+<p>For Float and Double types the methods <a
href="https://docs.oracle.com/javase/7/docs/api/java/lang/Float.html#intBitsToFloat%28int%29">Float.intBitsToFloat</a>
and
[Double.longBitsToDouble](https://docs.oracle.com/javase/7/docs/api/java/lang/Double.html#longBitsToDouble(long))
are being used to convert the numeric string into the correct type. These
methods rely on the IEEE 754 floating-point formats described in <a
href="https://en.wikipedia.org/wiki/Single-precision_floating-point_ [...]
<p>A number of such .config files exist in the Sling codebase and can be used
as examples.</p>
<h1><a href="#project-info" name="project-info">Project Info</a></h1>
<ul>
diff --git a/repolist.html b/repolist.html
index 0fd74d4..f355623 100644
--- a/repolist.html
+++ b/repolist.html
@@ -327,6 +327,7 @@
<li><a
href="https://github.com/apache/sling-maven-sling-plugin.git">maven-sling-plugin</a></li>
<li><a
href="https://github.com/apache/sling-org-apache-sling-adapter.git">org-apache-sling-adapter</a></li>
<li><a
href="https://github.com/apache/sling-org-apache-sling-api.git">org-apache-sling-api</a></li>
+ <li><a
href="https://github.com/apache/sling-org-apache-sling-app-cms.git">org-apache-sling-app-cms</a></li>
<li><a
href="https://github.com/apache/sling-org-apache-sling-auth-core.git">org-apache-sling-auth-core</a></li>
<li><a
href="https://github.com/apache/sling-org-apache-sling-auth-form.git">org-apache-sling-auth-form</a></li>
<li><a
href="https://github.com/apache/sling-org-apache-sling-auth-xing-api.git">org-apache-sling-auth-xing-api</a></li>
@@ -339,12 +340,14 @@
<li><a
href="https://github.com/apache/sling-org-apache-sling-caconfig-impl.git">org-apache-sling-caconfig-impl</a></li>
<li><a
href="https://github.com/apache/sling-org-apache-sling-caconfig-integration-tests.git">org-apache-sling-caconfig-integration-tests</a></li>
<li><a
href="https://github.com/apache/sling-org-apache-sling-caconfig-spi.git">org-apache-sling-caconfig-spi</a></li>
+ <li><a
href="https://github.com/apache/sling-org-apache-sling-capabilities.git">org-apache-sling-capabilities</a></li>
<li><a
href="https://github.com/apache/sling-org-apache-sling-cassandra.git">org-apache-sling-cassandra</a></li>
<li><a
href="https://github.com/apache/sling-org-apache-sling-commons-cache-api.git">org-apache-sling-commons-cache-api</a></li>
<li><a
href="https://github.com/apache/sling-org-apache-sling-commons-cache-container-test.git">org-apache-sling-commons-cache-container-test</a></li>
<li><a
href="https://github.com/apache/sling-org-apache-sling-commons-cache-ehcache.git">org-apache-sling-commons-cache-ehcache</a></li>
<li><a
href="https://github.com/apache/sling-org-apache-sling-commons-cache-impl.git">org-apache-sling-commons-cache-impl</a></li>
<li><a
href="https://github.com/apache/sling-org-apache-sling-commons-cache-portal.git">org-apache-sling-commons-cache-portal</a></li>
+ <li><a
href="https://github.com/apache/sling-org-apache-sling-commons-clam.git">org-apache-sling-commons-clam</a></li>
<li><a
href="https://github.com/apache/sling-org-apache-sling-commons-classloader.git">org-apache-sling-commons-classloader</a></li>
<li><a
href="https://github.com/apache/sling-org-apache-sling-commons-compiler.git">org-apache-sling-commons-compiler</a></li>
<li><a
href="https://github.com/apache/sling-org-apache-sling-commons-contentdetection.git">org-apache-sling-commons-contentdetection</a></li>