[OpenAjaxIDE] [OpenAjaxGadgets] PROPOSAL: getProxyURL() -> rewriteURI()

Rich Thompson richt2 at us.ibm.com
Fri Aug 7 04:04:13 PDT 2009


The key issue is that the widget can not really figure that out, while the 
container can easily know it. The solution we took on the IBM internal 
spec is to always have the widget ask to have its URIs rewritten, the 
container determines what it needs to do so that widget can access that 
URI.

Rich 



From:
Kris Vishwanathan/Fairfax/IBM at IBMUS
To:
Jon Ferraiolo/Menlo Park/IBM at IBMUS
Cc:
gadgets at openajax.org, ide at openajax.org, gadgets-bounces at openajax.org
Date:
08/06/2009 03:39 PM
Subject:
Re: [OpenAjaxIDE] [OpenAjaxGadgets] PROPOSAL: getProxyURL() -> 
rewriteURI()
Sent by:
ide-bounces at openajax.org



Hi Jon,

If the widgets are hosted on the same server as container then the 
relative URL need not be routed through the proxy. rewriteURI() logic 
should be intelligent enough to figure if the widget is hosted locally or 
remote, basing on that the absolute URL needs to be formed.

Thanks and regards

Kris Vishwanathan, PMP
Certified IT Architect
IBM Software Group, WPLC
Ph: 919 543 1081 (T/L: 441-1081)
Ph; 877-316-0046 (T/L: 349-4847)
Cell: 919 830 2890

In a day, if you don't come across any problems - you can be sure that you 
are traveling in a wrong path - Swamy Vivekananda
Jon Ferraiolo/Menlo Park/IBM at IBMUS


Jon Ferraiolo/Menlo Park/IBM at IBMUS 
Sent by: gadgets-bounces at openajax.org 
08/06/2009 02:13 PM



To

ide at openajax.org, gadgets at openajax.org

cc


Subject

[OpenAjaxGadgets] PROPOSAL: getProxyURL() -> rewriteURI()





BACKGROUND

Javier has been doing the final work on the open source for the OA Widget 
loader project. One of his tasks has been to resurrect the sample mashup 
application (now at http://www.openajax.org/samples/mashupapp) and upgrade 
all of the sample widgets to work with the widget loader (and the latest 
spec).

He ran into a problem with a few widgets, such as the validator widget 
(which invokes the OpenAjax Metadata validator utility in the background). 
The old code used to process the widget XML on the server, but the new 
code does so on the client. What he discovered is that in some cases the 
client JavaScript can't figure out the path to the metadata file, and 
therefore can't convert relative URIs into appropriate absolute URI 
strings in order to access and invoke server resources.

We studied IBM's internal widget format and OpenSocial to see how they 
dealt with these scenarios. IBM's widget format has a routine rewriteURI() 
that accepts both absolute and relative paths. If the parameter is an 
absolute path, then it does the same thing as our current getProxyUrl(). 
If the parameter is a relative path, then it converts to an absolute path 
and then figures out the appropriate proxy URL. Our guess is that IBM 
discovered the same problem that Javier discovered and as a result 
included relative-to-absolute conversion within rewriteURI().

Regarding OpenSocial, the spec didn't talk about this issue directly, and 
we didn't fully figure out what's happening with the source code, but it 
looks like OpenSocial creates a pseudo web server such that the relative 
URL of "/" is always the root of the widget's subtree. (A trick that can't 
be used with a client-side implementation.)

PROPOSAL

Change the name of getProxyURL() to rewriteURI(), and include additional 
text within the writeup for this API to say that if the parameter is a 
relative URI, then the function will first convert into an absolute URI 
and then convert into an appropriate proxy URI.

RATIONALE

Javier and I debated about whether to propose a whole new function to deal 
with relative URIs and felt it was better from a simplicity and 
understandability perspective to rename and add a sentence to the existing 
function.

We are proposing the name 'rewriteURI' because that's the function name 
that IBM is using. If we keep the same name, it will be easier to migrate 
legacy widgets. However, this is not a major requirement. Not a big deal 
if people prefer a different name.
_______________________________________________
gadgets mailing list
gadgets at openajax.org
http://openajax.org/mailman/listinfo/gadgets
[attachment "pic24856.gif" deleted by Rich Thompson/Watson/IBM] 
_______________________________________________
IDE mailing list
IDE at openajax.org
http://openajax.org/mailman/listinfo/ide


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openajax.org/pipermail/ide/attachments/20090807/ddeeb27b/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 105 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20090807/ddeeb27b/attachment-0009.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20090807/ddeeb27b/attachment-0010.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20090807/ddeeb27b/attachment-0011.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20090807/ddeeb27b/attachment-0012.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20090807/ddeeb27b/attachment-0013.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20090807/ddeeb27b/attachment-0014.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20090807/ddeeb27b/attachment-0015.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20090807/ddeeb27b/attachment-0016.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20090807/ddeeb27b/attachment-0017.gif 


More information about the IDE mailing list