[Zope3-dev] Re: Views on Views ;-)

Jim Fulton jim@zope.com
Thu, 30 May 2002 16:52:04 -0400


Chris Withers wrote:
> 
> Jim Fulton wrote:
> >
> > > My impression of Zope 3 URLs was that it would let you do:
> > >
> > > http://server/folder/something/view1;view/page_in_view.html
> > > ...which submits to the method:
> > > http://server/folder/something/view1;view/method_in_view1
> > > ...which in turn returns to a second view of the object:
> > > http://server/folder/something/view2;view/page_in_view.html
> > >
> > > How would that look in the new way of doing things?
> > > How would you distinguish between page_in_view from view1 and page_in_view from
> > > view2?
> >
> > http://server/folder/something/page_in_view1.html;view
> >
> > which submits to some method in view 1
> 

...

> What happens if you have two methods from _different_ view objects that have the same
> name? How would you distinguish between them in this new way of doing things so that the
> right one gets used?

You say what the page names will be. The page names don't have to be the same
as the method names. If two people pick the same names, the conflict will be
caught when the configuration file is processed.  This is no different than
if people picked the same view name, which is exactly what's happening.
 
> Isn't this simplification recreating some of the namespace confusion we suffered from so
> badly in Zope 2? (ie: which view does this method come from?)

This is avoided by making people spell out the page/view name to method
mapping in the configuration file and reporting conflicts.
 
> > which in turn returns (gives a link? redirects?)
> > to a second view of the object:
> >
> > http://server/folder/something/page_in_view2.html;view
> >
> > Note that if the view and content namespaces of something (e.g.
> > something is not a container), you can omit the namespace
> > qualification:
> 
> I'm sorry, there's a bit of that sentence which is missing :-S Can you put it in?

It's all there as far as I can tell. If the view and content namespaces don't
overlap, you don't need namespace qualification.
 
> > > Hmmm... does that mean if I have:
> > >
> > > myDoc/view::pdf.pdf
> > >
> > > ...when I click to download I get a file called view::pdf.pdf?
> >
> > Yup, except that myDoc is probably not a container, so you should be
> > able to use::
> >
> >   myDoc/pdf.pdf
> 
> Hmm... this strikes me as sucking somewhat :-(
> 
> For starters, having files called pdf.pdf is about as useful as having a file called
> 'download'.

<shrug>

> Secondly, saying that the :: bit isn't important 'cos you'll never use it on containers
> isn't true, certainly in some of the usecases I can think of :-S

I said you don't need :: on non-containers. I'd say this is true. What use
cases would dictate ::?
 
> > > That in turn raises the question of what happened to the idea of:
> > >
> > > myDoc.pdf
> > >
> > > meaning "give me the 'pdf' view of the 'myDoc' object?"
> >
> > Well, I wrote up a proposal at:
> >
> > http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/NameExtensionViews
> >
> > So far, I'd say the response has been luke-warm. I see you haven't
> > commented. ;]
> 
> I pretty sure I did comment. Maybe the HTTP POST didn't get trough. In any case, I've
> commented now.
> Even if the majority don't go for this method of URL traversal, will it still be possible
> for me to easily plug it in when I start using Zope 3?

Of course.

Jim

--
Jim Fulton           mailto:jim@zope.com       Python Powered!        
CTO                  (888) 344-4332            http://www.python.org  
Zope Corporation     http://www.zope.com       http://www.zope.org