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

Issue 184041: [SHINDIG-1258] Shindig fails to support the "libs" parameter for URL Gadgets

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 3 months ago by Jon Weygandt
Modified:
14 years, 1 month ago
Reviewers:
Paul Lindner, chirag, shindig.remailer, johnfargo
Base URL:
http://svn.apache.org/repos/asf/incubator/shindig/trunk/
Visibility:
Public.

Description

The render of a URL gadget requires "libs", Gadget Specification, Section 3.1.3.6(c): http://www.opensocial.org/Technical-Resources/opensocial-spec-v09/Gadgets-API-Specification.html#process The attached change will generate a libs parameter, suitable for adding to the "JS path", which for Shindig is: http://xxx/gadgets/js/. However the Gadget Specification is silent on what that is, and how it is communicated to the gadget developer. I remember for iGoogle, they simply documented the string. Additionally there are security and trust issues with gadget developers including foreign JavaScript. This patch will not attempt to address these issues. Additionally there is a new parameter "unsup" to report unsupported features to the remote site, reference Gadget Spec 3.1.3.5(a). Overview of the changes: *) RenderingContext - added a new enum URLGADGET **) c=2 ==> URLGADGET for URLs **) Made several changes to propagate that throughout the code base *) For the feature.xml files added <urlgadget> **) Updated the feature.xml for features that should work, in general my thoughts are anything a URL author cannot do another way should be supported (e.g. rpc and related functions like dynamic height, info on views). Things like user prefs, message bundles, etc... all have "another way" and are not supported. Also most of the opensocial calls have "another way" (e.g. REST/RPC). *) JS Servlet now responds to c=2 **) Not only does it return the JS itself, but it will also return the container configuration, which is normally part of the gadget rewriter (which is not called for a URL gadget). *) The URL Generator will return with the remote URL with the metadata, which eliminates the return trip to the server.

Patch Set 1 #

Patch Set 2 : Fixed the parse errors of the first patch #

Total comments: 1

Patch Set 3 : Fixed the leak of internal server error #

Unified diffs Side-by-side diffs Delta from patch set Stats (+234 lines, -55 lines) Patch
features/src/main/javascript/features/core.config/feature.xml View 1 chunk +3 lines, -0 lines 0 comments Download
features/src/main/javascript/features/core.json/feature.xml View 1 chunk +3 lines, -0 lines 0 comments Download
features/src/main/javascript/features/core.log/feature.xml View 1 chunk +3 lines, -0 lines 0 comments Download
features/src/main/javascript/features/core.util/feature.xml View 1 chunk +3 lines, -0 lines 0 comments Download
features/src/main/javascript/features/dynamic-height.util/feature.xml View 1 chunk +3 lines, -0 lines 0 comments Download
features/src/main/javascript/features/dynamic-height/feature.xml View 1 1 chunk +3 lines, -0 lines 0 comments Download
features/src/main/javascript/features/rpc/feature.xml View 1 1 chunk +8 lines, -0 lines 0 comments Download
features/src/main/javascript/features/views/feature.xml View 1 1 chunk +3 lines, -0 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/DefaultUrlGenerator.java View 1 7 chunks +92 lines, -11 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/RenderingContext.java View 1 1 chunk +17 lines, -4 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/features/FeatureRegistry.java View 1 1 chunk +1 line, -1 line 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/HttpGadgetContext.java View 1 1 chunk +4 lines, -3 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/JsServlet.java View 1 2 6 chunks +74 lines, -34 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/DefaultUrlGeneratorTest.java View 1 2 chunks +2 lines, -2 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/features/FeatureRegistryTest.java View 1 3 chunks +15 lines, -0 lines 0 comments Download

Messages

Total messages: 6
Jon Weygandt
14 years, 3 months ago (2010-01-08 20:19:22 UTC) #1
Jon Weygandt
Fixed the parse errors of the first patch
14 years, 3 months ago (2010-01-08 20:20:54 UTC) #2
chirag
http://codereview.appspot.com/184041/diff/18/22 File java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/JsServlet.java (right): http://codereview.appspot.com/184041/diff/18/22#newcode180 java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/JsServlet.java:180: sb.append("//Errors: ").append(e.getMessage()); This means we're leaking the exact internal ...
14 years, 3 months ago (2010-01-09 05:28:34 UTC) #3
Jon Weygandt
Fixed the leak of internal server error
14 years, 3 months ago (2010-01-11 21:45:29 UTC) #4
Paul Lindner
Seems good to me. I'd like to hear what John and Ziv have to say ...
14 years, 1 month ago (2010-03-23 07:38:03 UTC) #5
johnfargo
14 years, 1 month ago (2010-03-24 00:26:23 UTC) #6
IMO this is an interesting approach, but I'm exceedingly skeptical of changes
that continue to bake in what's a rather broken gadget "type" in the first
place.

To some degree this is a philosophical can of worms, but IMO type=url gadgets
aren't really gadgtes. They're in practice an overwrought way to generate an
IFRAME URL that, in turn, performs a <script src> back to some home server.
What's more, existing ones (per iGoogle docs) can really never work w/o iGoogle
perpetually hosting script or the gadgets themselves changing.

The uses I've seen for these are:
1. Auth. IFRAMEs just "happen" to get the same cookies as their containing app,
thereby avoiding having to support OAuth.
2. Traffic/usage measurement.
3. Turning a page-into-a-gadget.

The only real functionality you get from the gadgets framework in this case is
rpc.

#3 typically doesn't really use gadgets JS. Types #1 and #2 can be achieved by
IFRAME-in-a-type-html-IFRAME. This involves a home-baked protocol for talking
btw the "gadget" frame and the "target," which you're essentially inventing
anyway when you write a url gadget (having to sanitize what you script src). If
the target server(s) in #1 support OAuth, you can just convert to type=proxied
(type=html href=<URL>). #2 is largely covered by proxied-mode as well.

So my primary preference is to convert or treat as proxied existing type=url
gadgets. But assuming these things are an inevitability (and they may be, if
only for their uniform packaging format w/ other gadgets; I've been complaining
about them for almost 2 years! :)), code review is:

* Could you sync/resolve and re-upload a patch? Codereview is having trouble w/
old code and the fact that this is on incubator SVN still.
* Note that UrlGenerator is going away in a little bit, replaced by
IframeUriManager and JsUriManager (and OAuthUriManager). A parallel impl in
DefaultJsUriManager would be nice.

Sorry to be a pain; but given the substantial pain we've endured hacking around
type=url's limitations I felt it worthwhile to raise overarching concerns.
Thoughts welcome.

--j
Sign in to reply to this message.

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