[Zope] Simplifying complex contexts/urls

Michel Pelletier michel@digicool.com
Mon, 13 Sep 1999 19:09:16 -0400


Chris Fassnacht wrote:
> 
> I'm developing a site with Zope that has a lot of interlinking between
> objects, and after clicking around for a while, the context (aka, the url
> path in the browser's address display) gets really long and complex.  So
> far, I haven't had any problems with it, but I do have two concerns.
> 
> 1. It starts to look pretty ungainly.  This doesn't bother me too much, but
> I don't know how users will respond.
> 
> 2. There must be some limit on the length of the allowable url in the
> browser's display.  What are the chances that an extended session of
> clicking around will run into that limit?

Who knows?  I don't think the HTTP spec has a limit on URL length, it's
probably implimentation defined.
 
> So, I'm wondering if there's some way to automatically simplify a path to
> its most elemental form.  For example,
> www.mysite.edu/main/topicA/topicB/topicC/topicA/topicB becomes
> www.mysite.edu/main/topicA/topicB.

In your app, they may produce the same results, but these are two
different scenarios.  These requests both have different 'acquisition
paths' which will cause different things to happen (for example, even
though two images may be the same image in the two paths, they would
both have different absolute_url values, because absolute_url is built
from the acquisition path).

I would suggest not allowing your application to build such complex
queries if they are essentialy redundant and you are not using any
particular feature that redundent paths give you (I can't think of one
off the top of my head...).  You might end up in a situation like:

http://www.mysite.com/main/topicA/topicA/topicA/topicA/...

Which can happen, but only if you build your app to 'leak' path
elements.

-Michel