>>
>> apologies if it is an off-topic post, I can easily forward this
>> email to a more appropriate list.
>
> For future discussion I suggest users_at_wadl.dev.java.net. Answers
> inline below.
sure, will post there next if I have any more questions.
thanks for the answers, Sergey
>
>> I used this one as the question is specifcally about maping a JAX-RS
>> resource.
>>
>> here is a sample resource :
>>
>> @Path("/books")
>> public class Books {
>>
>> @GET public Books getAll() {}
>> @POST public void addBook() {}
>>
>> @GET @PATH("{id}") public Book getBook(@PathParam("id") String id,
>> @QueryParam("name") String name) {};
>>
>> @PATH("chapters") public Chapters getBooks(@QueryParam("id") String
>> id) {}
>> }
>>
>> public class Chapters {
>> @GET @Path("/content") public Chapters getl() {}
>> }
>>
>> here is a possible mapping, with some questions in the copmments, I
>> reread the wadl spec only yesterday so be patient please :-)
>>
>> <application xmlns="wadl ns">
>> <grammar>
>> <!-- schemas for Books, Book -->
>> </grammar>
>>
>> <resources base="http://localhost:8080/rest">
>>
>> <resource path="/books">
>> <!-- Books.getAll -->
>> <method name="GET">
>> <response><representation id="books"/></response>
>> </method>
>> <!-- Books.addBook -->
>> <method name="POST">
>> <request><representation id="book"/></request>
>> </method>
>> </resource>
>>
>> <!-- Books.getBook -->
>> <resource path="/books/{id}">
>> <param name="id" style="template"/>
>> <method name="GET">
>> <param name="name" style="query"/>
>> <response><representation id="book"/></response>
>> </method>
>> </resources>
>>
>> <!-- Books.getChapters, Chapters.get() -->
>> <resource path="/books/chapters/content">
>> <method name="GET">
>> <param name="id" style="query"/>
>> <response><representation id="chapters"/></response>
>> </method>
>> </resources>
>>
>> </application>
>>
>> Few questions :
>>
>> - Can a resource "books/{id}" be a sibling of /books resource or
>> does it have to be embedded in it with path {id} ? I think both
>> options are valid
>
> Both options are valid.
>
>> - Is it correct that any unique Path combination in a given JAX-RS
>> resource class has to be represented as an indibidual wadl
>> <resource> instance ?
>
> Yes.
>
>> - Is the mapping for a subresource Chapters correct ? I'm presuming
>> it can also be embedded inside "books" with path="/chapters/content"
>>
> It look correct and yes you could embed it inside "books" instead.
>
> HTH,
> Marc.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>