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

Jon Ferraiolo jferrai at us.ibm.com
Thu Aug 6 11:13:50 PDT 2009



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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openajax.org/pipermail/ide/attachments/20090806/ec8c17ec/attachment.html 


More information about the IDE mailing list