[Zope-dev] PROPOSAL: Site objects

Adam Feuer adamf@pobox.com
Tue, 21 Sep 1999 13:57:05 -0700


> Looks like different needs have spawned different approaches, here. I
> didn't even think about IP/port issues, since I operate all of my sites from
> a single address/port through Apache.  Obviously both cases will need to be
> handled.

evan,
  i don't use apache and zope together (but i should, i guess? :-)

  how do you want it to work? from your comments, you obviously don't
want to do all your URI remapping in apache. how does apache let zope
know what host has been contacted, if the sites use different IP
numbers...?
  if HTTP 1.1 is used, the HTTP_HOST variable will be set, so that
isn't a problem. i'll add the code to look at the HTTP_HOST variable
first, and check for a symbolic mapping before using the IP
address...

> See my other post, where I lay out something roughly like this, except that
> the method doesn't return the new path, it passes it to a (new) method of
> REQUEST.

  is one way better than the other...? i just returned the new path
because it seemed like i could tread lightly on the Zope code... :-)
but perhaps not...

> I have hit the same wall, and I'm climbing it now.  This looks like a
> standard problem/pattern for Zope Products; How do you keep 'global'
> information available to instances of classes defined in the Product,
> preferably in a standard object in the standard storage.  I surmise that
> this isn't a problem for ZClass-based Products <sigh>.

  yes, i started with a ZClass for that reason, but then it seemed
more straightforward to just make the product in python... 
  the ZClass acquisition link is very appealing, though.

> I quite agree.  On the other hand, I think it's a Good Thing to separate the
> act of path extension ('www.site.com/thing' => '/here/is/the/site/thing')
> from that of logical URL definition ("Everything inside me starts with
> 'www.site.com/'").  That way, you can define logical URLs once and for all
> at the location of the site root, while handling direct-to-ZServer requests
> differently from pre-rewritten through-Apache ones.

  mmmmm... i am not sure i understand this! :-) or perhaps this
doesn't apply to my approach. in my scheme, every request goes thru
the Remapper, and the (relative) path gets rewritten (to be an
absolute path) depending on which VirtualHost the request wants. then
everything proceeds as normal.
  all the URLs inside the VirtualHost (or site) are still all
relative...

> Only the path-extension/rewriting part needs a central dictionary. 

  yes.

> Does it
> really need to be invisible to non-managers, or is it enough that they can't
> mess with it?  Only users with "Add new <whatever>" permissions on a folder
> should be allowed to view/change/delete the <whatever> object.

  yes, that's true. but i wanted to make it invisible if possible,
just to be cleaner. but it is not strictly necessary.

  by the way, it seems like you want to be able to specify multiple
symbolic URLs for the site, as well as multiple IP addresses (if you
use the IP address method). is that right?

cheers
adam
--
Adam Feuer
adamf@pobox.com