Mystery of @Post...

2012-03-02 Thread Richard Berger
First, the good news.  My code is working.  But I don't understand WHY it
works.  

Using Restlet and the "Annotated Interface" approach, described at
http://wiki.restlet.org/docs_2.0/13-restlet/27-restlet/328-restlet/285-restlet.html.
 
I am also running Restlet GAE (if that matters).

I am using Post to add a new Comment to a collection of Comments, so my
CommentsResource interface has the following:
  @Post("json")
  public Representation postJson(String value); 
  
  @Post("java")
  public Representation postJava(Comment comment);  
  
  @Post("form")
  public Representation postForm(Form form);  
  
And my CommentsServerResource class that implements this interface has three
corresponding implementations, each of which is annotated to match the
methods in the interface.  

Now I write a test case in Java.  The essence is:
ClientResource client4 = new ClientResource("xxx/comments/");
CommentsResource commentsResource =
client4.wrap(CommentsResource.class);
client4.setRequestEntityBuffering(true);  //
stackoverflow.com/questions/6462142
Comment comment = new Comment("Hi there from Java", new Date());
Representation representation4 = commentsResource.postJava(comment);

And the big mystery is that the postJava() method is NOT called, but rather
the postJson() method IS called.  And somehow my Comment object was
magically converted to a Json string.  It's kinda cool that it works this
way, but I am sure I am missing something (in addition to my lack of IQ
points, which must be obvious by now :) :) ).

RB

--
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/Mystery-of-Post-tp7338202p7338202.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2928866


unsubscribe

2012-03-02 Thread Macel Ruff
unsubscribe

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2928780


RE: ProGuard on Android interfering with client proxy method invocation

2012-03-02 Thread Andy Dennie
OK, this is what ended up working:

-keep class org.restlet.resource.* { *; }
-keep class org.restlet.engine.adapter.* { *; }

It's likely that the class specification could be narrowed further with 
additional trial and error, but for me, the returns are diminishing.

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2928769


RE: OAuth extension - update from draft-10 to latest

2012-03-02 Thread Martin Svensson
Hi Lazlo and thank you for the interest in the OAuth2 extension. We would 
definitely like you help. When it comes to your specific question, mainly about 
upgrading to the latest version of the spec. we have decided to wait until it 
is finalized. According to Kristoffer (who is part of the spec group) that will 
happen in the near future. When we do this upgrade we were also planning on 
adding a lot of stuff that has been requested. In terms of your specific 
question about the Flow, that should be fairly easily fixable and can be 
submitted to the trunk. As for other larger changes why don't we start a 
discussion.

About Facebook, I think they took a similar decision. I am for instance using 
the OAuthV2Proxy for this, which is a very early version of OAuth.

Kristoffer, anything you want to add?

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2928755