[Zope3-dev] Ugly URLs

Jim Fulton jim@zope.com
Thu, 06 Dec 2001 07:21:25 -0500


Chris Withers wrote:
> 
> Jim Fulton wrote:
> >
(snip)
> > > -presentation
> > > -attributes
> >
> > If a content object doesn't have presentation logic
> > in it, why would an attribute be published directly?
> 
> *shrugs* I was thinking this is gonna apply to paths in ZPT and the like as
> well?

Good question. I think that the rules used will vary somewhat depending 
on context. My inclination is that in a well designed system, browser
URLs will only point (possibly indirectly) at (methods of) presentation 
components.

ZPT and (un)restrictedTraverse will provide access to
methods and other attributes that you wouldn't traverse to with a Browser
URL. This is an area that needs more exploration. Our current thinking is that
there are lower-level traversal interfaces that would be used by ZPT and
other software.  It's not clear whether the lower-level traversal APIs
will also support namespace control.
 
> > If you use implicit acquisition. I expect implicit
> > acquisition to fade from usage. Acquisition will still
> > be important, but will be more explicit, more predictable, and
> > ultimately, more useful.
> 
> Indeed, if this lookup is easily configurable, all you have to do is drop
> acquisition from the list and you're left with explicit acquisition ;-)

Assuming that you can spell it. The spelling would involve semi-colons.
 
(snip)
> > Note that with the policy above, you will *always* need to use semicolons
> > to get to presentation components unless you can arrange that the item
> > and presentation namespaces don't overlap (e.g. by using integer item
> > names).
> 
> Well, surely the default presentation requires no extra URL bit of any sort?

Right.

> I reckon for containers, you'll usually only get the one 'view' mode, and that's
> where nice URLs are important. For 'edit' modes, I can live with the ; 'cos
> accessing items is gonna be a lot mroe common than editing the container,
> wouldn't you say?

Yup, except that for some containers, I can imagine lots of "view" modes:

- normal/default view

- summary

- browse

- search

- ... other application views

> Of course, the default presentation should depend on what protocol the object
> was acessed through, is that possible?

Absolutely. See IComponentArchitecture:

  pres = getPresentation(ob, name, type)

where 'type' is a presentation type, expressed as an interface.
You would pass different types for browsers, FTP, xml-rpc, wxwindows
etc.

> > > BTW, I think bavarian (who are ya, bavarian?) 's suggestion is absolute genius.
> > > I wonder how it could be woven in?
> >
> > I'm going to write a separate proposal on this.
> > Stay tuned.
> 
> Cool :-) I really hope those Fishbowl notification tools show up soon or I'm
> gonna miss it :-S

I'll announce the proposal to this list. 
 
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