[Seaside] Tiny URL processing ala Seaside
Nevin Pratt
nevin at bountifulbaby.com
Sun Jan 29 21:56:51 CET 2006
Hi All!
I think we are all familiar with the service offered by
http://www.tinyurl.com, for transforming huge URL's into tiny ones.
I've been running a similar mechanism in my Seaside app for maybe half a
year now. For example, on my site, both of the following URL's do the
same thing:
http://www.bountifulbaby.com?tiny=100
and
http://www.bountifulbaby.com/seaside/index/birthingsupplies?searchstring=1007&searchtype=items&searchall=f
If you try both of the above URL's, you will see that the URL arguments
"searchstring=1007&searchtype=items&searchall=f" (from the second URL)
are used by the Seaside component to prepopulate the search panel. The
URL argument "tiny=100" will cause the Seaside component to reference a
dictionary, where the "100" is a key, and
"/seaside/index/birthingsupplies?searchstring=1007&searchtype=items&searchall=f"
is the value. So, the 100 is transformed into the bigger URL, which in
turn is then looked at for arguments for populating the search panel.
Using a dictionary in this manner, it is trivially easy to support tiny
URL's.
Should a mechanism like this be put into the general Squeak distribution?
Nevin
More information about the Seaside
mailing list