Andrew Jaquith wrote:
[...]
For 3.0, my preference has been to use a plain addressing scheme like
the current DefaultURLConstructor. It doesn't require any special
decoding/remapping on the inbound side, and outbound URL construction is
easy. However, an URL scheme like the one you suggested is good too. In
theory, we could use URLRewrite. Janne has also raised concerns about
performance because of its reliance on regular expressions. I am less
concerned about that, and more concerned about the fact that you need to
be able to reference the HTTP response object (and its encodeURL()
method) to make it work.
I'm not so concerned about regex parsing simply because I *think* it's
possible to design a URL schema that doesn't require it, iff that schema
is pretty exacting. I would myself prefer to avoid regex if possible, for
the reasons Janne has suggested, partly because the service I'm looking
at could become a real bottleneck since it's effectively being proposed
for use as a kind of proxy for a high-traffic web service (e.g., it
could in theory be a pass-through for all of a site's traffic).
The other approach would be a new ("better") URL constructor scheme.
Either way, we will continue to need 1) a filter (to remap the incoming
URLs to a proper request format and forward the correct destination JSP)
and 2) some kind of URL construction algorithm.
On Jul 7, 2008, at 4:24 PM, Murray Altheim wrote:
baseURL collectionHierarchy [objectId] action ['?' parameters]
e.g.,
http://www.acme.org/wiki/ pages/ PageName/ get/
In the above scheme we can obtain the base URL, the collection hierarchy
and object identifier all without regex, just parsing the '/' delimiters
via indexOf(). If we use the '?' as the delimiter between the absolute
identifier of the intellectual entity (IE, to use the term we're using
here locally), then everything after that is parseable either by going
one '/' forward or backward, and everything else is a parameter available
via the HTTPServletRequest.
For example, we either assume the second-to-last '/'-delimited token is
the oid ("PageName"), with the last token the action:
http://www.acme.org/wiki/pages/PageName/put/
or we obtain the action as a parameter and assume the last token is
the oid:
http://www.acme.org/wiki/pages/PageName/?action=get
The former is *slightly* problematic if there is no oid, e.g.,
http://www.acme.org/wiki/pages/search/?q=term
but that's possibly handled by counting tokens or simply not using an
oid at all
http://www.acme.org/wiki/pages/?action=search?q=term
or
http://www.acme.org/wiki/pages/?q=term (search is implied by
the presence of 'q')
The devil may be in the details but this *seems* like a workable plan.
If we want to permit a collection hierarchy rather than simply a flat
namespace this might get more complicated, but only if we permit an
arbitrary depth (something I don't need).
Murray
...........................................................................
Murray Altheim <murray07 at altheim.com> === = =
http://www.altheim.com/murray/ = = ===
SGML Grease Monkey, Banjo Player, Wantanabe Zen Monk = = = =
Boundless wind and moon - the eye within eyes,
Inexhaustible heaven and earth - the light beyond light,
The willow dark, the flower bright - ten thousand houses,
Knock at any door - there's one who will respond.
-- The Blue Cliff Record