2011/4/6 Fabian Christ <[email protected]>:
> Hi,
>
> 2011/4/6 Alessandro Adamou <[email protected]>:
>> I would like to ask for some opinion/advice on classes that should be moved
>> out of kres.jersey :
>>
>> * Writers: there are some in commons.base that we had as ducplicates and
>> will gladly drop in favor of common ones. There are a few more in
>> kres.jersey, though:
>> ** JenaModelWriter : serializes a Jena Model into {"application/rdf+xml",
>> "application/xml", "text/xml"}
>> ** JSONJenaWriter, perhaps we could use JsonLdSerializerProvider from
>> commons.web.home instead?
>
> You can contribute your own serializers. Have a look at
> entityhub/jersey which also contributes some serializers. And of
> course you should re-use serializer where appropriate.
Yes, and +1 for using JSON-LD every where as the default JSON
serialization of RDF Graphs.
>> * JerseyEndpoint : we register Clerezza TcManager and Serializer with the
>> servlet context. Perhaps this could be done in the commons.web jersey
>> endpoint?
>
> Have a look at entityhub/jersey and see how this is done there.
To be more precise, now the bundle context is forward into the
servletcontext and you can fetch any OSGi service using the following
snippet:
jobManager =
ContextHelper.getServiceFromContext(EnhancementJobManager.class,
context);
tcManager =
ContextHelper.getServiceFromContext(TcManager.class, context);
serializer =
ContextHelper.getServiceFromContext(Serializer.class, context);
I plan to extend the context lookup of the jersey resources to be able
to inject singleton OSGi services using the @Context annotation
instead but this is not implemented yet.
>> * KRFormat: we have this class with MIME constants for formats such as
>> RDF/XML, OWL/XML, manchester OWL, Turtle, RDF/JSON, OWL functional syntax
>> etc. We use it extensively in former Kres webservices, would it make sense
>> to move to commons.web?
>
> So these are non-standard mime-types not defined by any class yet? I
> think yes - such things should be moved to commons/base.
Yes we should centralize all those mimetypes in commons/web/base,
while not duplicating what's already provided by Clerezza.
--
Olivier
http://twitter.com/ogrisel - http://github.com/ogrisel