On Tue, 2002-10-15 at 19:47, Jerome Kerdreux wrote:
> Yeah not really clear i know **oups**, in fact i want to do something
> like catch 404 and proxy this. In zope i'll do this with a
> # special handle
> if str(attr) =='toto.jpg':
> return self.proxy.get('http://toto.com/toto.jpg')
Hmm... that seems really inefficient to me, as you go through WebKit to
do something Apache can much more quickly. But if you want to catch
404s, then probably again the best way would be in Apache -- by changing
the error handler to point to WebKit.
> w/ using Acquisition , you got a folder that can handler
> a lot of misc stuff
> You understand what i mean, by this way my server will handle query
> that isn't for it, w/ this method i can include some html that come
> from other product (main my cvs frontend)
Mmm... again, it's going to be faster with Apache. CGIWrapper might do
a bit of what you are thinking -- but no one seems to ever use it, and
it might not even be working condition at the moment.
> IB>You can put some code in the __init__.py file in your context, which
> IB>will be loaded during startup. You can extend the path there. I
> IB>usually change PYTHONPATH to do this (but I'm not sure how that works if
> IB>you're using Windows).
> That's for the WebKit way, but all of you use webkit ?
> How can I change default handler (ExceptionHandler for
> example) without changing Webkit ?
You can do that -- probably the best way is to use a mixin to change the
functionality. It's a bit more intrusive than inheritance, but it
generally works. MiscUtils.MixIn can help with this. Most of the stuff
doesn't need to be changed that much -- ExceptionHandler, for instance,
should really only occur when there's a programming error.
> IB>> - Is there any plan to include zope page template
> IB>> as template system ? I have spend 2 hours on having
> IB>> it working in Webware (you can check my example
> IB>> page at http://larsen-b.com/Pt/). It seems to
> IB>> work nice, but I want to know what webware
> IB>> users usually use, I ever used Cheetah a couple
> IB>> of time to generated some .py but i don't really
> IB>> understand the way to have it nicelly integrated
> IB>> w/ webkit and my python class
> IB>People have thought about it, and as you probably saw ZPT seems pretty
> IB>simple to use outside of Zope.
> Yeah but but ZPT use some code that is zope only like tranversal or
> even ComputedAttribute. I don't know why the ZPT team use this way
> this isn't any wrapper or other stuff, to use ZPT without any C code
> coming from zope :(
I haven't looked at ZPT for some time. If I remember the terminology,
TALES would be the part attached to Zope, but the HTML-attribute aspect
of the language seemed pretty separable. Plugging a simple dictionary
in place of TALES would probably be a good starting point.
> IB> Right now most people are using
> IB>templates without integrating them closely with Webware. Integration
> IB>might be possible using a new factory for ZPT files -- but I'm not
> IB>entirely sure how that might best work.
> What kind of template does they use ? and how.
> In zope you can't leave without dtml/pt but in webware this is a bit
> fuzzy in my mind. I ever try to build some class to do render, but
> this is awfull to maintain. I look at PSP to but i don't why to use
> this, cause they are really verbose and i don't know the way to wrap
> them to my class
Some people use Cheetah, and several people use PSP as a templating
language (keeping most of the logic in a SitePage or other class, and
using PSP just for presentation). If you do that sort of separation,
PSP isn't as awkward as PHP.