[PEAK] sitemaps: <content> in non-root <location>

Phillip J. Eby pje at telecommunity.com
Fri Jan 7 11:38:48 EST 2005

At 10:48 AM 1/7/05 +0100, Radek Kanovsky wrote:
>On Thu, Jan 06, 2005 at 12:42:36AM -0500, Phillip J. Eby wrote:
> > I think there's a simpler solution than either; the 'clone()' operation
> > called inside Location.traverseTo() should simply become:
> >
> >             context = ctx.clone(current=cont, viewHandler=self.viewHandler)
> >
> > This should do the right thing in the specific circumstances; i.e. ensure
> > that the traversal into the container and beneath includes the current
> > location's view definitions.
>It works except one special case when container itself implements 

Yeah, I thought about that, but I don't think I care about supporting that 
case.  If you have that scenario you should use <location 
class="containerclass"> instead of tacking the item on as a container to 
the location.  Containers are supposed to be pure containers.

> > A fix (with tests) is now in CVS.
>Then the same fix should be applied to sitemaps.addHelper too.
>Again, helper can implement IViewService directly.

If the helper wants to add names, it can do so directly, it doesn't need to 
offer them as views.  I don't see much use for it being a view service.

Of course, if you have actual use cases for these things, please explain 
them to me and maybe I'll be convinced otherwise.  At the moment they both 
seem quite YAGNI.

More information about the PEAK mailing list