Hi Simon On Thu, Apr 14, 2011 at 8:28 PM, Simon Chen <[email protected]> wrote:
> Hi all, > > Is there something in CXF that is similar to RESTServiceDiscovery in > RESTEasy? > > I think the idea is to put something in your class def: > @XmlElementRef > private RESTServiceDiscovery rest; > > and it will automatically expand to XML elements like: > <atom:link href="http://localhost:8081/books" rel="add"/> // POST > <atom:link href="http://localhost:8081/book/foo" rel="self"/> // GET > > Basically exposing the allowed operations, in addition to the data alone... > > I like this capability of RESTEasy, but don't want to go that route yet... > > I've read the docs. The thing I like about it is that it's an idea which has been implemented. I thought it was to do with the atom links expansion, but either way, it is just something interesting to try. However, it seems like a fairly intrusive approach to me, resource classes and beans have to be annotated, and of course the scema for a Book/etc has to be open enough, for the validation be enabled. As I said, the idea is interesting, not sure how I'd consider approaching it. It depends on whether you want a Book state browseable or returned as is. In the former case, I'd consider wrapping the actual beans with the wrapper adding link attributes or elements. In this case we have links not pointing to book's state, they point to a higher level resource which manipulates the Book...Thus may be I'd have a dedicated method on the root resource class returning the links. Actually, looks like this is what WADL can do really well. Bill - your comments are welcome Cheers, Sergey > Thanks. > -Simon > -- Sergey Beryozkin Application Integration Division of Talend <http://www.talend.com/> http://sberyozkin.blogspot.com
