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

Kris Vishwanathan v2kris at us.ibm.com
Thu Aug 6 11:30:23 PDT 2009

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

             Park/IBM at IBMUS                                             To 
             Sent by:                  ide at openajax.org,                   
             gadgets-bounces at o         gadgets at openajax.org                
             penajax.org                                                cc 
             08/06/2009 02:13          [OpenAjaxGadgets] PROPOSAL:         
             PM                        getProxyURL() -> rewriteURI()       


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

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.)


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.


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

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openajax.org/pipermail/ide/attachments/20090806/37811ebc/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20090806/37811ebc/attachment.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic24856.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20090806/37811ebc/attachment-0001.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20090806/37811ebc/attachment-0002.gif 

More information about the IDE mailing list