Well, if I read the OSGi metatype spec correctly (https://osgi.org/specification/osgi.cmpn/7.0.0/service.metatype.html#org.osgi.service.metatype.annotations.AttributeType) it is supposed to be a primitive array (serialized e.g. as i[1,2]) for a positive cardinality and a Collection of Objects (serialized e.g. as I[1,2]) for a negative cardinality. AFAICT the write back behaves accordingly to that spec, i.e. it will only emit primitives for types having a positive cardinality and otherwise an array of proper classes.
Is that a wrong understanding? Konrad > On 5. Mar 2019, at 09:21, Karl Pauls <[email protected]> wrote: > > I think the writeback is a bug as it stands right now. AFAICS, the > webconsole always converts arrays to primitive arrays and the > writeback just serialises what is there as is. Given that the > documentation only mentions a capital "I", the writeback should be > converting primitive arrays before writing back. > > I don't mind changing the documentation to allow lower case "i" as > well - assuming that really already works in all places - however, it > will cause some inconsistencies because if you then put a config in > the repository with a capital "I" it will first create a config with a > none primitive array. Next, if you modify it using the webconsole it > will turn into a primitive array which will be written back as lower > case "i". Not sure that is a real problem but it is somewhat confusing > as the config in the repository now has a lower case "i". > > In other words, I think we are really talking about two things - a bug > in the writeback and a potential broadening of the supported types. > > regards, > > Karl > > On Mon, Mar 4, 2019 at 7:06 PM Carsten Ziegeler <[email protected]> wrote: >> >> +1 its always good to document reality...unless its a bug of course :) >> >> Carsten >> >> >> Georg Henzler wrote >>> If it works I'm +1 to document it... >>> >>> On 2019-02-27 14:15, Konrad Windszus wrote: >>>> Despite the documentation at >>>> https://sling.apache.org/documentation/bundles/configuration-installer-factory.html#configuration-files-config >>>> >>>> <https://github.com/apache/felix/blob/trunk/configadmin/src/main/java/org/apache/felix/cm/file/ConfigurationHandler.java> >>>> >>>> also primitive types are supported (with lower-case type information >>>> characters, compare with >>>> https://github.com/apache/felix/blob/ad2aabb04c754f86c6417c437256500dd61a4ffb/configadmin/src/main/java/org/apache/felix/cm/file/ConfigurationHandler.java#L92). >>>> >>>> Is there a reason why this is not documented? >>>> AFAIK the lowercase is also used for the JCR Installer write back, >>>> e.g. in case the metatype defines something like "<AD id="levels" >>>> type="Integer" cardinality="2147483647" name="Absolute Levels" >>>> description="List of absolute parent levels. Example: Absolute parent >>>> level 1 of '/foo/bar/test' is '/foo/bar'."/>" >>>> >>>> In case the cardinality is a large positive integer it is always >>>> supposed to be an array of primitives (compare with >>>> https://osgi.org/specification/osgi.cmpn/7.0.0/service.metatype.html#org.osgi.service.metatype.annotations.AttributeType). >>>> >>>> Does anything speak against extending that documentation in that regard? >>>> >>>> Thanks, >>>> Konrad >> -- >> Carsten Ziegeler >> Adobe Research Switzerland >> [email protected] > > > > -- > Karl Pauls > [email protected]
