Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3543)

Issue 1722041: JSON-RPC Gadgets Handler

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 10 months ago by Paul Lindner
Modified:
13 years, 9 months ago
Reviewers:
johnfargo, zhoresh, dev-remailer, mhermanto
Visibility:
Public.

Description

This is a new gadgets handler that can be batched with other json-rpc, jsonp, rest and other requests. It inherits heavily from JsonRpcHandler and provides most of it's functionality.

Patch Set 1 #

Patch Set 2 : Code complete! #

Patch Set 3 : fix one last failing test.. #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+788 lines, -161 lines) Patch
M java/common/src/main/java/org/apache/shindig/common/JsonSerializer.java View 1 6 chunks +9 lines, -3 lines 0 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/DefaultGuiceModule.java View 1 2 chunks +2 lines, -0 lines 0 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/render/RenderingGadgetRewriter.java View 2 chunks +2 lines, -1 line 0 comments Download
A java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/GadgetsHandler.java View 1 1 chunk +355 lines, -0 lines 7 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/JsonRpcHandler.java View 1 chunk +1 line, -1 line 0 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/spec/GadgetSpec.java View 6 chunks +11 lines, -15 lines 0 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/uri/DefaultIframeUriManager.java View 1 chunk +1 line, -1 line 0 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/variables/UserPrefSubstituter.java View 1 chunk +1 line, -1 line 0 comments Download
A java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/FakeIframeUriManager.java View 1 chunk +44 lines, -0 lines 1 comment Download
A java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/FakeProcessor.java View 1 chunk +92 lines, -0 lines 0 comments Download
A java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/GadgetsHandlerTest.java View 1 chunk +224 lines, -0 lines 0 comments Download
M java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/HttpRequestHandlerTest.java View 12 chunks +23 lines, -23 lines 0 comments Download
M java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/JsonRpcHandlerTest.java View 10 chunks +18 lines, -111 lines 0 comments Download
M java/gadgets/src/test/java/org/apache/shindig/gadgets/spec/GadgetSpecTest.java View 2 chunks +2 lines, -2 lines 0 comments Download
M java/gadgets/src/test/java/org/apache/shindig/gadgets/uri/UriManagerTestBase.java View 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 9
Paul Lindner
13 years, 10 months ago (2010-06-16 18:11:29 UTC) #1
Paul Lindner
13 years, 10 months ago (2010-06-24 01:03:50 UTC) #2
zhoresh
It looks pretty good. But I still not sure about the structure. Here are few ...
13 years, 10 months ago (2010-06-24 18:04:01 UTC) #3
Paul Lindner
I think it's logical to couple the Gadget Spec parser/generator to the metadata output and ...
13 years, 10 months ago (2010-06-24 18:51:17 UTC) #4
zhoresh
On Thu, Jun 24, 2010 at 11:51 AM, Paul Lindner <lindner@inuus.com> wrote: > I think ...
13 years, 10 months ago (2010-06-24 20:53:04 UTC) #5
Paul Lindner
On Thu, Jun 24, 2010 at 1:52 PM, Ziv Horesh <zhoresh@gmail.com> wrote: > How is ...
13 years, 10 months ago (2010-06-24 21:23:45 UTC) #6
mhermanto
Sorry for the tardy response, but this looks good. Agree with Ziv's comments. We have ...
13 years, 9 months ago (2010-07-07 22:02:18 UTC) #7
johnfargo
Hey Paul: Just committed this CL on your behalf, since A) it's new and thus ...
13 years, 9 months ago (2010-07-14 18:32:51 UTC) #8
Paul Lindner
13 years, 9 months ago (2010-07-14 23:48:05 UTC) #9
not a problem.  thanks!

Starting to catch up with a big backlog now.


On Wed, Jul 14, 2010 at 11:32 AM, <johnfargo@gmail.com> wrote:

> Hey Paul:
>
> Just committed this CL on your behalf, since A) it's new and thus won't
> break anyone, B) we'd like to iterate on it re: comments from Ziv and
> Michael, as well as other shared ideas; C) we're testing it out in our
> installation and wanted to use the Shindig version ASAP.
>
> Cheers,
> John
>
>
> On 2010/07/07 22:02:18, mhermanto wrote:
>
>> Sorry for the tardy response, but this looks good. Agree with Ziv's
>>
> comments. We
>
>> have an endpoint which clients talk to via protocol buffer. That data
>>
> model is
>
>> unfortunately not quit the same as the one expressed here
>>
> (MetadataGadgetSpec,
>
>> FilteringGadgetSpec), but since we build on top of Shindig, we should
>>
> continue
>
>> use this data model. Let's have this submitted, and we'll make the
>> appropriate/further changes as we go through our exercise in
>>
> converting these
>
>> model objects to ours. Thanks Paul for doing this.
>>
>
>  http://codereview.appspot.com/1722041/diff/6001/7004
>> File
>>
>
>
>
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/GadgetsHandler.java
>
>> (right):
>>
>
>  http://codereview.appspot.com/1722041/diff/6001/7004#newcode73
>>
>
>
>
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/GadgetsHandler.java:73:
>
>> @Operation(httpMethods = {"POST","GET"}, path = "/metadata/{view}")
>> FMI mostly, CC JS will call an endpoint using OSAPI lib, via a POST
>>
> /api/rpc,
>
>> which is fixed. Can this path /metadata/{view} (which is seems to vary
>>
> with
>
>> view) be expressed by that OSAPI call?
>>
>
>  http://codereview.appspot.com/1722041/diff/6001/7004#newcode75
>>
>
>
>
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/GadgetsHandler.java:75:
>
>> Set<String> gadgetUrls =
>>
> ImmutableSet.copyOf(request.getListParameter("ids"));
>
>> Is the order of the response preserved, since we're turning a list
>>
> into a set?
>
>  http://codereview.appspot.com/1722041/diff/6001/7004#newcode96
>>
>
>
>
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/GadgetsHandler.java:96:
>
>> throw new
>>
> ProtocolException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
>
>> "Processing interrupted", e);
>> Instead of throwing one error due to error from subset of gadget
>>
> requests, let's
>
>> throw per-gadget error. This will allow common container code to only
>>
> render
>
>> gadget that work successfully (should be better than failing
>>
> altogether). It
>
>> seems like you're already doing this for ExecutionException below.
>>
>
>  http://codereview.appspot.com/1722041/diff/6001/7004#newcode116
>>
>
>
>
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/GadgetsHandler.java:116:
>
>> return ALL_METADATA_FIELDS;
>> What's the use case for this?
>>
>
>  http://codereview.appspot.com/1722041/diff/6001/7004#newcode168
>>
>
>
>
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/GadgetsHandler.java:168:
>
>> this.ignoreCache =
>>
> Boolean.valueOf(request.getParameter("ignoreCache"));
>
>> Rename to nocache to keep it consistent with the iframe query param.
>>
>
>  http://codereview.appspot.com/1722041/diff/6001/7004#newcode169
>>
>
>
>
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/GadgetsHandler.java:169:
>
>> this.debug = Boolean.valueOf(request.getParameter("debug"));
>> This should be fine, but CC will not need to call this endpoint upon
>>
> variables
>
>> that don't require server-generated URI, and save HTTP request.
>>
>
>  http://codereview.appspot.com/1722041/diff/6001/7004#newcode215
>>
>
>
>
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/GadgetsHandler.java:215:
>
>> // TODO
>> TODO: extract from request?
>>
>
>  http://codereview.appspot.com/1722041/diff/6001/7009
>> File
>>
>
>
>
java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/FakeIframeUriManager.java
>
>> (right):
>>
>
>  http://codereview.appspot.com/1722041/diff/6001/7009#newcode27
>>
>
>
>
java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/FakeIframeUriManager.java:27:
>
>> public class FakeIframeUriManager implements IframeUriManager {
>> Is this used by anything? If only by one class, just have it as an
>>
> inner class.
>
>
>
> http://codereview.appspot.com/1722041/show
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b