felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Leangen <o...@leangen.net>
Subject Re: [Converter] Use of Codec
Date Sat, 20 Aug 2016 01:54:51 GMT

Awesome, David B., thanks!

I tried it and it worked. I just had a problem with empty objects, so I patched the code up
a bit. Will submit the patch later today.


Cheers,
=David



> On Aug 19, 2016, at 11:46 PM, David Bosschaert <david.bosschaert@gmail.com> wrote:
> 
> Hi David,
> 
> The Codecs are to be used as OSGi services, where you can look up the type
> via the mime-type. It's described in section 5.2 of RFC 215 :)
> 
> Having said that, this was not yet implemented in the Felix Converter, so
> I've added that just now [1].
> 
> The only thing is that there is no official mime type for yaml yet, so I
> just went with a few aliases that I think are commonly used.
> 
> Basically the Felix converter bundle now provides these Codec services:
> 
> g! inspect cap * 5
> org.apache.felix.converter [5] provides:
> ----------------------------------------
> ...
> service; org.osgi.service.converter.Codec with properties:
> osgi.codec.mimetype = application/json, application/x-javascript,
> text/javascript, text/x-javascript, text/x-json
>   service.bundleid = 5
>   service.id = 20
>   service.scope = singleton
> service; org.osgi.service.converter.Codec with properties:
>   osgi.codec.mimetype = text/yaml, text/x-yaml, application/yaml,
> application/x-yaml
>   service.bundleid = 5
>   service.id = 21
>   service.scope = singleton
> 
> Hope this works for you.
> 
> Cheers,
> 
> David
> 
> [1]
> https://svn.apache.org/viewvc/felix/trunk/converter/src/main/java/org/apache/felix/converter/impl/Activator.java?r1=1756920&r2=1756919&pathrev=1756920
> 
> On 19 August 2016 at 06:36, David Leangen <osgi@leangen.net> wrote:
> 
>> 
>> Hi!
>> 
>> I am probably missing something obvious, but how am I supposed to get a
>> reference to the Codec, and tell it that I want JSON?
>> 
>> IIUC, this has not yet been implemented. Again, happy to help out if you
>> show me the way...
>> 
>> Cheers,
>> =David
>> 
>> 


Mime
View raw message