[ 
https://issues.apache.org/jira/browse/SLING-2477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13582013#comment-13582013
 ] 

Carsten Ziegeler commented on SLING-2477:
-----------------------------------------

I still think this is something that has to be fixed in the JCR spec, although 
the name is "Java" content repository it does not support the basic 
types....but well, definitely not something we can fix here.
I think, Ian's first approach to use the " like I"100" seems to cause the least 
problems. Having a separate property for each property with the type is too 
confusing.
Now, in addition we only need the type information if the type is not supported 
by JCR, so no extra information required for strings, longs or booleans - we 
need it for float, int, byte, char, and short.
So we either store these as string properties in the format 
[TYPE_INFO]"[value]" - or the other solution I see is we store a single 
additional property containing the type information. Like a string array with 
values in the format [name]:[type]. The value itself is then stored as a string.
However, having a single property is easier to handle and maintain.

Once we have this, I agree we should create a new issue to improve SLING-1971 
and support write back of both, config nodes and config files - depending on 
their previous format.
                
> Configuration via sling:OsgiConfig nodes does not support all types
> -------------------------------------------------------------------
>
>                 Key: SLING-2477
>                 URL: https://issues.apache.org/jira/browse/SLING-2477
>             Project: Sling
>          Issue Type: Bug
>          Components: Installer
>    Affects Versions: JCR Installer 3.1.2
>            Reporter: Alexander Klimetschek
>            Assignee: Ian Boston
>
> Most notably, the common "service.ranking" needs to be an Integer, while the 
> jcr property mapping only allows for "Long" types at the moment. The problem 
> is that JCR has a smaller set of property types than the OSGi config admin 
> (JCR: String, Boolean, Long, Double, Decimal; OSGi: String, Boolean, Long, 
> Integer, Float, Double, and probably more differences...).
> Similarly to properties files (which do it in the value like 
> 'service.ranking=I"-10000"' with I=Integer), there must be a way to 
> explicitly specify the type regardless of the JCR type. For example, encoding 
> it in the property name like "service.ranking{int}".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to