jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Re: Hypermedia Proposals

From: Bill Burke <bburke_at_redhat.com>
Date: Wed, 06 Jul 2011 20:43:09 -0400

With a Restfulie-like approach what would the JAXB/JAX-RS code look like?

<order>
  <link rel="edit" href="..."/>
  <link rel="self" href="..."/>
</order>


@XmlRootElement
public class Order {

   @XmlElement
   @Refs(
     @Ref(rel="edit", ...
     @Ref(rel="self", ...)
   )
   List<Link> getLinks();
}

And then, how would it work with the current API?

Order order = client.request("...").get(Order.class);
client.links(order).getLink("edit").request().body(order).post();


where:

public interface Client {
...
   Links links(Class clazz);
}

public interface Links {
   Link getLink(String rel);
}





On 7/6/11 3:09 PM, Santiago Pericas-Geertsen wrote:
> Hi All,
>
> I've updated the wiki [1] to describe the type of declarative
> hyperlinking supported in Jersey using @Ref and @Link. Declarative
> hyperlinking in Jersey supports both links in representations and link
> headers.
>
> Hyperlinking is a first step, but HATEOAS is more than that. I've also
> added some links to related work towards the end of the page. Please
> feel free to include other links there.
>
> Guilherme: I came across [2]. Is this the latest on your research in
> this area?
>
> -- Santiago
>
> [1] http://java.net/projects/jax-rs-spec/pages/Hypermedia
> [2] https://github.com/caelum/restfulie-java/wiki/java_hypermedia
>
> On Jul 5, 2011, at 12:47 PM, Guilherme Silveira wrote:
>
>> Cant we support link headers? Would already incentivate people doing
>> rest... Even if limited to links.
>>
>> Cant we also incentivate response based links and forms as in
>>
>> Response.getLinksFor(myEntity)
>>
>> An http api withou hypermedia is, in the best case, an http api - not
>> a rest one.
>>
>> Regards
>>
>> Guilherme Silveira
>>
>>
>>> 2011. 7. 5. ¿ÀÈÄ 12:40¿¡ "Bill Burke" <bburke_at_redhat.com
>>> <mailto:bburke_at_redhat.com>>´ÔÀÌ ÀÛ¼º:
>>>
>>> Hypermedia is entity body driven, so, other than Link header support,
>>> I don't see what we can be done in regards to a specification.
>>> XML/JAXB is the only standardized media type JCP has dealt with and
>>> I'm very doubtful meaningful integration can be done with it
>>> considering JAXB's limitations.
>>>
>>>
>>>
>>> On 7/1/11 1:47 PM, Santiago Pericas-Geertsen wrote:
>>> >
>>> > Hello Experts,
>>> >
>>> > Even though we are stil...
>>>
>>> --
>>> Bill Burke
>>> JBoss, a division of Red Hat
>>> http://bill.burkecentral.com <http://bill.burkecentral.com/>
>>
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com