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

Issue 50047: OSAPI Metadata-generation of apis

Can't Edit
Can't Publish+Mail
Start Review
Created:
16 years, 9 months ago by bobevans
Modified:
16 years, 9 months ago
Reviewers:
lryan, louiscryan, awiner
Base URL:
http://svn.apache.org/repos/asf/incubator/shindig/trunk/
Visibility:
Public.

Description

This patch allows the gadget server to rewrite the client js, passing in a list of services supported by the server, as specified in endpoints in the container config. This list of services is then used by osapi to generate client apis for the services provided by the server. For example, osapi.people, et.al, are no longer written statically as js, but are generated dynamically, based on the injected service list.

Patch Set 1 #

Total comments: 94

Patch Set 2 : with feedback changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2526 lines, -1776 lines) Patch
config/container.js View 1 chunk +4 lines, -2 lines 0 comments Download
features/bin/README View 1 chunk +16 lines, -0 lines 0 comments Download
features/bin/Rhino_License View 1 chunk +512 lines, -0 lines 0 comments Download
features/bin/runner.sh View 1 chunk +1 line, -1 line 0 comments Download
features/pom.xml View 1 3 chunks +12 lines, -8 lines 0 comments Download
features/src/main/javascript/features/core/util.js View 2 chunks +13 lines, -0 lines 0 comments Download
features/src/main/javascript/features/features.txt View 1 chunk +0 lines, -4 lines 0 comments Download
features/src/main/javascript/features/osapi.activities/activities.js View 1 chunk +0 lines, -57 lines 0 comments Download
features/src/main/javascript/features/osapi.activities/feature.xml View 1 chunk +0 lines, -26 lines 0 comments Download
features/src/main/javascript/features/osapi.appdata/appdata.js View 1 chunk +0 lines, -92 lines 0 comments Download
features/src/main/javascript/features/osapi.appdata/feature.xml View 1 chunk +0 lines, -26 lines 0 comments Download
features/src/main/javascript/features/osapi.base/batch.js View 1 chunk +0 lines, -198 lines 0 comments Download
features/src/main/javascript/features/osapi.base/feature.xml View 1 chunk +0 lines, -29 lines 0 comments Download
features/src/main/javascript/features/osapi.base/jsonrequest.js View 1 chunk +0 lines, -200 lines 0 comments Download
features/src/main/javascript/features/osapi.base/makerequest.js View 1 chunk +0 lines, -36 lines 0 comments Download
features/src/main/javascript/features/osapi.base/util.js View 1 chunk +0 lines, -72 lines 0 comments Download
features/src/main/javascript/features/osapi.people/feature.xml View 1 chunk +0 lines, -26 lines 0 comments Download
features/src/main/javascript/features/osapi.people/people.js View 1 chunk +0 lines, -107 lines 0 comments Download
features/src/main/javascript/features/osapi.ui/feature.xml View 1 chunk +1 line, -1 line 0 comments Download
features/src/main/javascript/features/osapi/batch.js View 1 1 chunk +217 lines, -0 lines 0 comments Download
features/src/main/javascript/features/osapi/feature.xml View 1 1 chunk +9 lines, -3 lines 0 comments Download
features/src/main/javascript/features/osapi/jsonrequest.js View 1 chunk +206 lines, -0 lines 0 comments Download
features/src/main/javascript/features/osapi/osapi.js View 1 1 chunk +51 lines, -0 lines 0 comments Download
features/src/main/javascript/features/osapi/peoplehelpers.js View 1 chunk +98 lines, -0 lines 0 comments Download
features/src/main/javascript/features/osapi/util.js View 1 chunk +59 lines, -0 lines 0 comments Download
features/src/test/javascript/features/alltests.js View 1 3 chunks +11 lines, -12 lines 0 comments Download
features/src/test/javascript/features/osapi.activities/activitiestest.js View 1 chunk +0 lines, -237 lines 0 comments Download
features/src/test/javascript/features/osapi.appdata/appdatatest.js View 1 chunk +0 lines, -191 lines 0 comments Download
features/src/test/javascript/features/osapi.base/batchtest.js View 1 chunk +0 lines, -167 lines 0 comments Download
features/src/test/javascript/features/osapi.people/peopletest.js View 1 chunk +0 lines, -185 lines 0 comments Download
features/src/test/javascript/features/osapi/activitiestest.js View 1 1 chunk +235 lines, -0 lines 0 comments Download
features/src/test/javascript/features/osapi/appdatatest.js View 1 1 chunk +191 lines, -0 lines 0 comments Download
features/src/test/javascript/features/osapi/batchtest.js View 1 1 chunk +133 lines, -0 lines 0 comments Download
features/src/test/javascript/features/osapi/osapitest.js View 1 1 chunk +99 lines, -0 lines 0 comments Download
features/src/test/javascript/features/osapi/peopletest.js View 1 1 chunk +184 lines, -0 lines 0 comments Download
java/common/src/main/java/org/apache/shindig/common/JsonSerializer.java View 3 chunks +13 lines, -0 lines 0 comments Download
java/common/src/main/java/org/apache/shindig/protocol/RpcServiceFetcher.java View 1 1 chunk +145 lines, -0 lines 0 comments Download
java/common/src/main/java/org/apache/shindig/protocol/RpcServiceLookup.java View 1 1 chunk +111 lines, -0 lines 0 comments Download
java/common/src/test/java/org/apache/shindig/common/JsonSerializerTest.java View 2 chunks +13 lines, -0 lines 0 comments Download
java/common/src/test/java/org/apache/shindig/protocol/RpcServiceLookupTest.java View 1 1 chunk +137 lines, -0 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/DefaultGuiceModule.java View 1 chunk +1 line, -1 line 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/render/RenderingGadgetRewriter.java View 1 6 chunks +33 lines, -11 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/render/RenderingGadgetRewriterTest.java View 1 chunk +1 line, -1 line 0 comments Download
java/server/src/test/java/org/apache/shindig/server/endtoend/EndToEndTest.java View 2 chunks +0 lines, -6 lines 0 comments Download
java/server/src/test/resources/endtoend/osapi/activitiesTest.xml View 2 chunks +5 lines, -5 lines 0 comments Download
java/server/src/test/resources/endtoend/osapi/appdataTest.xml View 1 chunk +1 line, -1 line 0 comments Download
java/server/src/test/resources/endtoend/osapi/batchTest.xml View 3 chunks +4 lines, -4 lines 0 comments Download
java/server/src/test/resources/endtoend/osapi/makeRequestTest.xml View 1 chunk +0 lines, -43 lines 0 comments Download
java/server/src/test/resources/endtoend/osapi/peopleTest.xml View 3 chunks +3 lines, -3 lines 0 comments Download
java/server/src/test/resources/endtoend/osapi/personTest.xml View 5 chunks +5 lines, -5 lines 0 comments Download
java/social-api/src/main/java/org/apache/shindig/social/core/config/SocialApiGuiceModule.java View 1 chunk +2 lines, -0 lines 0 comments Download
site/src/site/xdoc/developers/features/index.xml View 1 chunk +0 lines, -16 lines 0 comments Download

Messages

Total messages: 7
bobevans
16 years, 9 months ago (2009-04-24 18:10:02 UTC) #1
bobevans
This patch allows the gadget server to rewrite the client js, passing in a list ...
16 years, 9 months ago (2009-04-24 19:03:26 UTC) #2
awiner
http://codereview.appspot.com/50047/diff/1/38 File features/src/main/javascript/features/osapi/makerequest.js (right): http://codereview.appspot.com/50047/diff/1/38#newcode23 Line 23: osapi.makeRequest = function() { why not switch to ...
16 years, 9 months ago (2009-04-24 21:33:05 UTC) #3
louiscryan
First batch. I need to noodle on the bindig/dispatch JS code some more. http://codereview.appspot.com/50047/diff/1/43 File ...
16 years, 9 months ago (2009-04-24 22:01:25 UTC) #4
bobevans
left out the el and httpfetcher suggestions for a later date given the magnitude of ...
16 years, 9 months ago (2009-04-29 19:55:04 UTC) #5
bobevans
with feedback changes
16 years, 9 months ago (2009-04-29 20:23:24 UTC) #6
louiscryan
16 years, 9 months ago (2009-04-29 20:57:14 UTC) #7
Much better. Still need to cleanup the per-endpoint caching of services and use
of HttpClient

http://codereview.appspot.com/50047/diff/1/9
File
java/common/src/main/java/org/apache/shindig/protocol/RpcServiceFetcher.java
(right):

http://codereview.appspot.com/50047/diff/1/9#newcode80
Line 80: public Map<String, Set<String>> getServicesForContainer(String
container, String host) {
The steps you outline for fixing this seem correct. Performing the substitution
client-side is pretty straightforward and is done for other services. I'd prefer
to see that done in this checkin.

On 2009/04/29 19:55:04, bobevans wrote:
> On 2009/04/24 21:33:05, awiner wrote:
> > in practice, we don't need or want this to be host-relative.  For example,
> > locked domains puts every gadget on a different domain, but we don't want to
> > recompute services for each such gadget.  Store this once per-container, not
> > once per-container-and-host.
> 
> This is a problematic tradeoff. 
> I see the side you mention, even though locked domain is in actuality bounded
to
> a pretty low number of domains right?
> 
> The other side of this is that the endpoint is needed per host to actually
make
> the rpc call, so it's quite convenient to store the service methods under the
> actual endpoint that's going to be called for the purpose of then constructing
> the rpc calls in the client, and also this is necessary for breaking up the
> calls in a batch into the distinct endpoints. We don't have any good way to
> distinguish a unique host at the moment, other than that the container
specifies
> the endpoints which reflect different hosts. I'll think about this some more,
it
> seems solvable without much difficulty, but I'd like to get this patch done,
> then come back and do that rework since it stripes through end-to-end. 
> 
> I think one solution would be to
> 1) Store only by container, with parameterized endpoints (as they are in the
> container config).
> 2) Expand the host to make the actual calls to retrieve the services.
> 3) attach the endpoints as a property of the service method structure which
gets
> stored.
> 4) re-do the substitution on the client for a given endpoint
> 5) use the property for distinguishing the batching of calls to the same
> endpoint (similar to the way its done now).

http://codereview.appspot.com/50047/diff/1/9#newcode111
Line 111: HttpClient client = new HttpClient();
On 2009/04/29 19:55:04, bobevans wrote:
> On 2009/04/24 21:33:05, awiner wrote:
> > any particular reason not to just inject HttpFetcher (or RequestPipeline)?
> 
> No good reason, I just didn't know about it. Is it worth changing?

Yes, definitely worth changing
Sign in to reply to this message.

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