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 >>
signature.asc
Description: OpenPGP digital signature
