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

[jsr339-experts] Re: [jax-rs-spec users] Re: Re: Improving Hypermedia Support

From: Markus KARG <markus_at_headcrashing.eu>
Date: Sun, 6 Nov 2011 14:45:47 +0100

Santiago,

 

this way:

 

Link: <absolute-uri-A1>; rel="name-of-collection-A"

Link: <absolute-uri-A2>; rel="name-of-collection-A"

Link: <absolute-uri-B1>; rel="name-of-collection-B"

Link: <absolute-uri-B2>; rel="name-of-collection-B"

 

Here you have four absolute URIs. A1 and A2 are part of collection A, B1 and
B2 are part of collection B.

 

If the client wants to visit all resources references by collection B, it
would just have to invoke A1 and A2, identified via collection A.

 

An alternative way would be using the anchor attribute to identify the
resource as a fragment of the source resource (e. g.
anchor="#name-of-collection-A").

 

A third option would be a link-extension like "Link: <absolute-uri>;
collection="name-of-collection".

 

Where do you see a problem? No need for neither templates nor client side
application logic.

 

Regards

Markus

 

From: Santiago Pericas-Geertsen [mailto:Santiago.PericasGeertsen_at_oracle.com]

Sent: Dienstag, 1. November 2011 20:17
To: jsr339-experts_at_jax-rs-spec.java.net
Subject: [jsr339-experts] Re: [jax-rs-spec users] Re: Re: Improving
Hypermedia Support

 

* I do not understand the problem with the collection. Why not sending just
several URIs with the same relation in that case (one for each item of the
collection)?

 

 As link headers? How would you know which one corresponds to which item in
the collection? There's no ordering for link headers.

 

-- Santiago