[Zope-dev] How to automatically redirect publishing request to another folder?

Craeg K. Strong cstrong@arielpartners.com
Fri, 25 Jan 2002 01:51:53 -0500


Hello:

We have a Slideshow product that is similar to OrderedFolder in that it 
maintains an ordered
list of contents.  Each subfolder represents a slide.   To view a 
particular slide, you navigate to the
subfolder, it automatically calls "index_html,"  and there's your slide.

All of the slides actually acquire their index_html DTMLDocument from
high up on the food chain.   The index_html in turn calls <dtml-var 
body>   and the body is, of
course, different for each slide.   This is convenient, b/c each slide 
shares header/footer/etc.

My problem is this.  When you type in the URL of the top level folder 
(that is, the slideshow folder itself)
I want Zope to behave as if you typed in the URL of the first slide 
automagically.   The Slideshow product
has an easy way to get our mitts on the firstSlide object, so that part 
is not a problem, but I cannot get it to work.

Of course, if I create an index_html() method directly in my 
Slideshow.py, that screws up my acquisition.
Zope dies with an infinite recursion.  

Next try: using __bobo_traverse__()   That is a little bit nasty, b/c 
you have to figure out whether you are
the "end destination" or if Zope is just "passin' thru."  
[ See http://www.zope.org//Members/andym/wiki/MessingWithTraversal ]

Nothing works quite right.   Conceptually I know what I want to do:   
call index_html on firstSlide()
in the _context_ of firstSlide().   However, my Zope Zen is failing me. 
   Has anyone done something like this?

Thanks in advance!

--Craeg