You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Konrad Windszus <ko...@gmx.de> on 2018/06/28 14:57:04 UTC

Configuration File Format for OSGi Installer: https://issues.apache.org/jira/browse/SLING-7757

Currently the OSGi Installer is relying on the ConfigurationHandler from the ConfigAdmin to parse *.config files (https://github.com/apache/sling-org-apache-sling-installer-core/blob/0a34e33dd26092437be5180e34979abbf9a88300/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java#L257). 

According to https://issues.apache.org/jira/browse/FELIX-5306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16526093#comment-16526093 it seems that now the Felix Utils ConfigurationHandler (https://github.com/apache/felix/blob/trunk/utils/src/main/java/org/apache/felix/utils/properties/ConfigurationHandler.java) is the more stable parser, as it is used by the FileInstaller (so even in the future, we can rely on it being backwards compatible) while the ConfigurationHandler of the ConfigAdmin should only be used by Felix internally. Also the latter supports user-friendly float/double notation.

Does anything speak against switching from the CA one to the Felix Utils one (https://issues.apache.org/jira/browse/SLING-7757)?
IIUC both should be compatible (as the latter is a fork from the former).

The initial driver really is user-friendly float/double value support but I think in general it is preferable to rely on a stable parser/serializer.

The write-back would need to be modified at the same time in the File Installer (https://github.com/apache/sling-org-apache-sling-installer-provider-file/blob/ba2153071d71251c1c31402b6f39cc2061bf63cf/src/main/java/org/apache/sling/installer/provider/file/impl/FileInstaller.java#L204) and the JCR installer (https://github.com/apache/sling-org-apache-sling-installer-provider-jcr/blob/7fbd3963466ccd5ef8cf7eae6498f2f565e04931/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java#L780).

What do you think?
Thanks in advance for the input,
Konrad

Re: Configuration File Format for OSGi Installer: https://issues.apache.org/jira/browse/SLING-7757

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Mon, Jul 2, 2018 at 12:01 PM Konrad Windszus <ko...@gmx.de> wrote:
> ...There are quite some tests in https://github.com/apache/felix/blob/trunk/utils/src/test/java/org/apache/felix/utils/properties/ConfigurationHandlerTest.java <https://github.com/apache/felix/blob/trunk/utils/src/test/java/org/apache/felix/utils/properties/ConfigurationHandlerTest.java>.

Ok, those look extensive indeed!

-Bertrand

Re: Configuration File Format for OSGi Installer: https://issues.apache.org/jira/browse/SLING-7757

Posted by Konrad Windszus <ko...@gmx.de>.
There are quite some tests in https://github.com/apache/felix/blob/trunk/utils/src/test/java/org/apache/felix/utils/properties/ConfigurationHandlerTest.java <https://github.com/apache/felix/blob/trunk/utils/src/test/java/org/apache/felix/utils/properties/ConfigurationHandlerTest.java>.

> On 2. Jul 2018, at 11:40, Bertrand Delacretaz <bd...@apache.org> wrote:
> 
> Hi,
> 
> On Thu, Jun 28, 2018 at 4:57 PM Konrad Windszus <ko...@gmx.de> wrote:
>> ...Does anything speak against switching from the CA one to the Felix Utils one (https://issues.apache.org/jira/browse/SLING-7757)?
>> IIUC both should be compatible (as the latter is a fork from the former). ...
> 
> Do we (or Felix) have tests that demonstrate that?
> 
> -Bertrand


Re: Configuration File Format for OSGi Installer: https://issues.apache.org/jira/browse/SLING-7757

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Thu, Jun 28, 2018 at 4:57 PM Konrad Windszus <ko...@gmx.de> wrote:
> ...Does anything speak against switching from the CA one to the Felix Utils one (https://issues.apache.org/jira/browse/SLING-7757)?
> IIUC both should be compatible (as the latter is a fork from the former). ...

Do we (or Felix) have tests that demonstrate that?

-Bertrand

Re: Configuration File Format for OSGi Installer: https://issues.apache.org/jira/browse/SLING-7757

Posted by Eugen Stan <ie...@netdava.com>.
Hello,


On 25.07.2018 12:15, Carsten Ziegeler wrote:
> I think if we really want to do something about the format, we should
> rather embrace the JSON format as defined in the OSGi Configurator
> specification. It allows to define floats/doubles together with
> additional type handling in a nicely way.
>
> Carsten
I second this. I would go even further to suggest YAML support, which is
a JSON super set and has some nice features (support for comments,
multiline support, etc. )

Of course there is also toml / ini (isn't this current format !?) file
formats that are also popular and might be added as back-ends. TOML is
nicer to parse and has less ambiguities than YAML from what I have read.

Supporting both YAML and JSON should be easy as most JSON libraries
offer support for YAML as well.


Regards,
>
> Konrad Windszus wrote
>> Currently the OSGi Installer is relying on the ConfigurationHandler from the ConfigAdmin to parse *.config files (https://github.com/apache/sling-org-apache-sling-installer-core/blob/0a34e33dd26092437be5180e34979abbf9a88300/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java#L257). 
>>
>> According to https://issues.apache.org/jira/browse/FELIX-5306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16526093#comment-16526093 it seems that now the Felix Utils ConfigurationHandler (https://github.com/apache/felix/blob/trunk/utils/src/main/java/org/apache/felix/utils/properties/ConfigurationHandler.java) is the more stable parser, as it is used by the FileInstaller (so even in the future, we can rely on it being backwards compatible) while the ConfigurationHandler of the ConfigAdmin should only be used by Felix internally. Also the latter supports user-friendly float/double notation.
>>
>> Does anything speak against switching from the CA one to the Felix Utils one (https://issues.apache.org/jira/browse/SLING-7757)?
>> IIUC both should be compatible (as the latter is a fork from the former).
>>
>> The initial driver really is user-friendly float/double value support but I think in general it is preferable to rely on a stable parser/serializer.
>>
>> The write-back would need to be modified at the same time in the File Installer (https://github.com/apache/sling-org-apache-sling-installer-provider-file/blob/ba2153071d71251c1c31402b6f39cc2061bf63cf/src/main/java/org/apache/sling/installer/provider/file/impl/FileInstaller.java#L204) and the JCR installer (https://github.com/apache/sling-org-apache-sling-installer-provider-jcr/blob/7fbd3963466ccd5ef8cf7eae6498f2f565e04931/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java#L780).
>>
>> What do you think?
>> Thanks in advance for the input,
>> Konrad
>>



Re: Configuration File Format for OSGi Installer: https://issues.apache.org/jira/browse/SLING-7757

Posted by Carsten Ziegeler <cz...@apache.org>.
I think if we really want to do something about the format, we should
rather embrace the JSON format as defined in the OSGi Configurator
specification. It allows to define floats/doubles together with
additional type handling in a nicely way.

Carsten


Konrad Windszus wrote
> Currently the OSGi Installer is relying on the ConfigurationHandler from the ConfigAdmin to parse *.config files (https://github.com/apache/sling-org-apache-sling-installer-core/blob/0a34e33dd26092437be5180e34979abbf9a88300/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java#L257). 
> 
> According to https://issues.apache.org/jira/browse/FELIX-5306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16526093#comment-16526093 it seems that now the Felix Utils ConfigurationHandler (https://github.com/apache/felix/blob/trunk/utils/src/main/java/org/apache/felix/utils/properties/ConfigurationHandler.java) is the more stable parser, as it is used by the FileInstaller (so even in the future, we can rely on it being backwards compatible) while the ConfigurationHandler of the ConfigAdmin should only be used by Felix internally. Also the latter supports user-friendly float/double notation.
> 
> Does anything speak against switching from the CA one to the Felix Utils one (https://issues.apache.org/jira/browse/SLING-7757)?
> IIUC both should be compatible (as the latter is a fork from the former).
> 
> The initial driver really is user-friendly float/double value support but I think in general it is preferable to rely on a stable parser/serializer.
> 
> The write-back would need to be modified at the same time in the File Installer (https://github.com/apache/sling-org-apache-sling-installer-provider-file/blob/ba2153071d71251c1c31402b6f39cc2061bf63cf/src/main/java/org/apache/sling/installer/provider/file/impl/FileInstaller.java#L204) and the JCR installer (https://github.com/apache/sling-org-apache-sling-installer-provider-jcr/blob/7fbd3963466ccd5ef8cf7eae6498f2f565e04931/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java#L780).
> 
> What do you think?
> Thanks in advance for the input,
> Konrad
> 
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org