On Thu, Sep 1, 2011 at 12:54 PM, Reto Bachmann-Gmür <[email protected]> wrote:
> Hello
>
> I've recently wrote a wink-based patch to integrate jax-rs support in
> Sling [1]. In a very similar way Wink could be used in Clerezza where
> we're currently using our own jax-rs implementation.
>

+1, very good initiative.

> In both projects there are in my view the following requirement:
>
> 1. Possibility for jax-rs components (providers and resources) and/or
> applications to be registered and unregistered in an OSGi environment
> 2. Possibility to handle a request with a Jax-RS resource other than
> the one with matching @Path annotation
>
> The second requirements might need a bit more explanation. In sling
> servlets are typically bound to a type of JCR-resources even though
> this goes beyond the jax-rs spec it would be nice to bind jax-rs style
> classes to such a JCR-resource type, the patch I attached to
> SLING-2192 allows this, see my blog post [2] for an example usage.
> Similarly in Clerezza jax-rs style resource can be bound to an
> RDF-Type [3].
>

As for your second example, maybe a simple way would be to have
JCR-resource types defined as specific media types, in this way, you
could envision having a single endpoint for CRUD operations in your
JCR repository to work based on the media type being requested. WDYT ?

> It would be good to implement the basic support for these two
> requirements directly in wink. Roughly this would correspond to the
> org.apache.sling.jaxrs.wink package in the sling-patch. The following
> I think could be discussed and improved:
> - Unregistration of components cause the a new RequestProcessor to be created
> - Setting a root-resource shadowing the one that would be located
> using the path is done with a ThreadLocal variable, this might better
> be passed as property of the ServletRequest
>
> Before creating an issue and attaching a patch I though I ask here if
> this functionality would be welcomed in Wink.
>
> Cheers,
> Reto
>
> 1. 
> https://issues.apache.org/jira/secure/attachment/12492153/SLING-2192-with-sling-style-style-registration.patch
> 2. https://farewellutopia.com/2011/08/23/Add-some-jax-rs-support-to-sling
> 3. For an example see:
> http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/ScriptGeneratedResourceTypeHandler.java
>



-- 
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/

Reply via email to