ServerResource conditional mode

2009-04-02 Thread Tal Liron
Hi, Does someone have a grasp on what conditional mode is for and how it used? It's enabled by default, but I had to disable it for one of my resources to work with PUT and POST. The issue is that it always calls doGetInfo first, which for my particular resource will fail, and so calls to P

Re: ServerResource conditional mode

2009-04-02 Thread David Fogel
Hi Tal- I've been struggling with that very question, as I, too had trouble with POSTing to my new ServerResource subclass. I also noticed that getPreferredVariant(Method.GET) is called during processing of the POST request, and I couldn't figure out why. At first I thought that was the cause of

Re: ServerResource conditional mode

2009-04-02 Thread Tal Liron
David, The MediaType extension as an argument for the @Get, @Post, @Put and @Delete annotation is always for the returned representation, not for the entity sent from the client. Restlet does not do anything with what the client sends you -- it's up to you to process the entity, support vari

Re: ServerResource conditional mode

2009-04-03 Thread David Fogel
Hi Tal- I will definitely take a look at your script extension, thanks for the suggestion! I think I understand the general deal with the mediatype annotation argument. But like I said, I was trying to define a Post method that doesn't return content (and which therefore wouldn't make sense to d

Re: ServerResource conditional mode

2009-04-03 Thread Tal Liron
You don't need to put a media type if you're using void (although, you could potentially have more than one @Post handler, for several media types, to be used depending on the expectation of a media type from the client...). But, you do need to disable conditional mode: @Post public void han

RE: ServerResource conditional mode

2009-04-08 Thread Jerome Louvel
gies ~ Co-founder ~ <http://www.noelios.com/> http://www.noelios.com _ De : Tal Liron [mailto:tal.li...@threecrickets.com] Envoyé : jeudi 2 avril 2009 23:20 À : discuss@restlet.tigris.org Objet : ServerResource conditional mode Hi, Does someone have a grasp on what conditi

RE: ServerResource conditional mode

2009-04-08 Thread Jerome Louvel
developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : David Fogel [mailto:carrotsa...@gmail.com] Envoyé : vendredi 3 avril 2009 07:27 À : discuss@restlet.tigris.org Objet : Re: ServerResource conditional mode Hi

RE: ServerResource conditional mode

2009-04-08 Thread Jerome Louvel
on [mailto:tal.li...@threecrickets.com] Envoyé : vendredi 3 avril 2009 09:46 À : discuss@restlet.tigris.org Objet : Re: ServerResource conditional mode You don't need to put a media type if you're using void (although, you could potentially have more than one @Post handler, for several med

Re: ServerResource conditional mode

2009-04-08 Thread Tal Liron
com] Envoyé : jeudi 2 avril 2009 23:20 À : discuss@restlet.tigris.org Objet : ServerResource conditional mode Hi, Does someone have a grasp on what conditional mode is for and how it used? It's enabled by default, but I had to disable it for one of my resources to work wi

Re: ServerResource conditional mode

2009-04-08 Thread Tal Liron
Jerome, regarding exceptions caught -- You've implemented this only for when users override methods in non-annotated mode. In annotated mode, exceptions are still not allowed. This leads to different ways of doing things if you're in annotated or non-annotated mode. Personally, I think that d

RE: ServerResource conditional mode

2009-04-10 Thread Jerome Louvel
mercredi 8 avril 2009 23:55 À : discuss@restlet.tigris.org Objet : Re: ServerResource conditional mode Jerome, I understand If-Match, but I'm still confused by ServerResource's support of it in conditional mode. Logically, POST and PUT should work even if there is no entity, ri

RE: ServerResource conditional mode

2009-04-10 Thread Jerome Louvel
estlet.tigris.org Objet : Re: ServerResource conditional mode Jerome, regarding exceptions caught -- You've implemented this only for when users override methods in non-annotated mode. In annotated mode, exceptions are still not allowed. This leads to different ways of doing things if you&

Re: ServerResource conditional mode

2009-04-10 Thread Tal Liron
s.com] Envoyé : jeudi 9 avril 2009 00:06 À : discuss@restlet.tigris.org Objet : Re: ServerResource conditional mode Jerome, regarding exceptions caught -- You've implemented this only for when users override methods in non-annotated mode. In annotated mode, exceptions are

RE: ServerResource conditional mode

2009-04-10 Thread Jerome Louvel
om/> http://www.noelios.com _ De : Tal Liron [mailto:tal.li...@threecrickets.com] Envoyé : vendredi 10 avril 2009 20:09 À : discuss@restlet.tigris.org Objet : Re: ServerResource conditional mode Pretty good... except what if the user throws a ResourceException with a specific status cod

Re: ServerResource conditional mode

2009-04-10 Thread Tal Liron
developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com   De : Tal Liron [mailto:tal.li...@threecrickets.com] Envoyé : vendredi 10 avril 2009 20:09 À : discuss@restlet.tigris.org Objet : Re: ServerResource conditional mode Pretty good

Re: ServerResource conditional mode

2009-04-10 Thread David Bordoley
Have you considered that having a generic server resource might be a bit to simplistic or not granular enough? I guess from my point of view the resource class is really the implementation of the gritty protocol details of your application. I'm wondering if at least in addition to ServerResource, i

Re: ServerResource conditional mode

2009-04-10 Thread David Fogel
That's a funny coincidence- I was just looking at Restlet's Atom extension and wondering why there weren't any Resource implementations there. Unless I'm missing something, it looks like the ext.atom package is a set of java objects modeling the data in APP xml, that know how to serialize/deserial

RE: ServerResource conditional mode

2009-04-15 Thread Jerome Louvel
di 10 avril 2009 21:36 À : discuss@restlet.tigris.org Objet : Re: ServerResource conditional mode That's a funny coincidence- I was just looking at Restlet's Atom extension and wondering why there weren't any Resource implementations there. Unless I'm missing something, i