[Zope3-dev] RFC: Heads up! Major changes coming!

Casey Duncan casey@zope.com
Tue, 28 May 2002 09:30:45 -0400


+1 on all counts.

One question, what about views on the root folder? Didn't we determine th=
at=20
colons are not legal in the first uri path segment?

-Casey

On Tuesday 28 May 2002 09:05 am, Jim Fulton wrote:
> Over the last couple of months, there has been a lot of good
> discussion about making Zope 3 easier for the Python programmer. I've
> been trying to capture much of this in the recent flurry of Zope 3
> proposals. I want to get a number of these ideas incoprated before
> EuroPython and before a sprint I'll be conducting in a couple of weeks.=
=20
>=20
> This weekend, I worked on updating the tutoria; to reflect a number of
> the recent changes. In doing so, I came up with some additional ideas
> for which I posted proposals this morning, including providing a class
> directive to collect configuration for classes, especially content
> classes, and a simplification of the view API.
>=20
> I've posted a copy of the updated slides at=20
>=20
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Tutorial=
Slides/index.html.=20
> for your review and comment here. (They aren't Wiki pages. :(.
>=20
> Some things to note.
>=20
> - The configuration file has become a good bit more readable.
>=20
>   Here's the old step 5 configuration::
>=20
>     <zopeConfigure=20
>        xmlns=3D'http://namespaces.zope.org/zope'
>        xmlns:security=3D'http://namespaces.zope.org/security'
>        xmlns:zmi=3D'http://namespaces.zope.org/zmi'
>        xmlns:browser=3D'http://namespaces.zope.org/browser'>
>=20
>     <security:permission
>        permission_id=3D".Contact.ManageContacts"=20
>        title=3D"Manage Contacts" />
>=20
>     <security:protectClass name=3D".Contact.">
>       <security:protect interface=3D".Contact.IContactInfo." =20
>                         permission_id=3D"Zope.View" />
>       <security:instances permission_id=3D"Zope.View"/>
>       <security:protect methods=3D"update"
>                         permission_id=3D".Contact.ManageContacts"/>
>     </security:protectClass>
>=20
>     <zmi:factoryFromClass name=3D".Contact."=20
>                       permission_id=3D".Contact.ManageContacts"
>                       title=3D"Personal Contact Information" />
>=20
>     <security:protectClass name=3D".Contact.ContactInfoView."
>                            permission_id=3D"Zope.View" />
>=20
>     <browser:defaultView for=3D".Contact.IContactInfo."
>                          name=3D"info"
>                          factory=3D".Contact.ContactInfoView." />
>=20
>     <security:protectClass name=3D".Contact.ContactEditView."
>                            permission_id=3D".Contact.ManageContacts"
>                            methods=3D"index, action" />
>=20
>     <browser:view for=3D".Contact.IContactEdit."
>                   name=3D"edit"
>                   factory=3D".Contact.ContactEditView." />
>=20
>     <zmi:tabs for=3D".Contact.IContact.">
>       <zmi:tab label=3D"Edit"     action=3D"edit;view"/>
>       <zmi:tab label=3D"View"     action=3D"info;view"/>=20
>       <zmi:tab label=3D"Undo"     action=3D"undo"/>
>    </zmi:tabs>
>=20
>     <zmi:icon for=3D".Contact.IContact." file=3D"Contact/contact.gif" /=
>
>=20
>     <security:protectClass=20
>         name=3D".Contact.stubpostal.Lookup"
>         interface=3D".Contact.IPostal.IPostalLookup."
>         permission_id=3D"Zope.Public"  />
>=20
>     <security:protectClass
>         name=3D".Contact.stubpostal.Info"
>         interface=3D".Contact.IPostal.IPostalInfo"=20
>         permission_id=3D"Zope.Public" />
>=20
>     <utility
>         component=3D".Contact.stubpostal.lookup"=20
>         provides=3D".Contact.IPostal.IPostalLookup" />
>=20
>     <security:protectClass name=3D".Contact.ContactCityState."
>       interface=3D".Contact.IPostal.IPostalInfo"
>       permission_id=3D"Zope.Public"  />
>=20
>     <adapter
>       factory=3D".Contact.ContactCityState."
>       provides=3D".Contact.IPostal.IPostalInfo"=20
>       for=3D".Contact.IContactInfo." />
>=20
>     </zopeConfigure>
>=20
>   and here's the new one::
>=20
>     <zopeConfigure=20
>        xmlns=3D'http://namespaces.zope.org/zope'
>        xmlns:security=3D'http://namespaces.zope.org/security'
>        xmlns:zmi=3D'http://namespaces.zope.org/zmi'
>        xmlns:browser=3D'http://namespaces.zope.org/browser'>
>=20
>     <security:permission
>        permission_id=3D".Contact.ManageContacts"=20
>        title=3D"Manage Contacts" />
>=20
>     <class class=3D".Contact.">
>       <zmi:factory permission_id=3D".Contact.ManageContacts"
>                    title=3D"Personal Contact Information" />
>=20
>       <security:allow interface=3D".Contact.IContactInfo." =20
>                       permission_id=3D"Zope.View" />
>       <security:allow method=3D"update"
>                       permission_id=3D".Contact.ManageContacts"/>
>     </class>
>=20
>     <browser:defaultView for=3D".IContact.IContactInfo."
>                          name=3D"info.html"=20
>                          PageTemplate=3D"info.pt"
>                          permission_id=3D"Zope.View" />
>=20
>     <browser:view for=3D".IContact."
>                   factory=3D".Contact.ContactEditView."
>                   permission_id=3D".Contact.ManageContacts" >
>        <browser:page name=3D"editForm.html" attribute=3D"editForm" />
>        <browser:page name=3D"edit.html"     attribute=3D"edit" />
>     </browser:view>
>=20
>     <zmi:tabs for=3D".IContact.">
>       <zmi:tab label=3D"Edit"     action=3D"edit"/>
>       <zmi:tab label=3D"View"     action=3D"info"/>
>       <zmi:tab label=3D"Undo"     action=3D"undo"/>
>     </zmi:tabs>
>=20
>     <zmi:icon for=3D".IContact." file=3D"Contact/contact.gif" />
>=20
>     <security:allow
>           class=3D".Contact.stubpostal.Info"
>           interface=3D".Contact.IPostal.IPostalInfo"=20
>           permission_id=3D"Zope.Public" />
>=20
>     <utility
>         component=3D".Contact.stubpostal.LookupUtility"=20
>         provides=3D".Contact.IPostal.IPostalLookup"
>         permission_id=3D"Zope.Public" />
>=20
>     <adapter
>       factory=3D".Contact.ContactCityState."
>       provides=3D".Contact.IPostal.IPostalInfo"=20
>       for=3D".Contact.IContactInfo"
>       permission_id=3D"Zope.Public"
>       />
>=20
>     </zopeConfigure>
>=20
>   Note that, in the new version, all components are configured with a
>   single directive.
>=20
> - I really like the idea of explicitly defining the pages provided by
>   views and having the pages appear as pages on the content. This
>   makes page construction feel more natural, eliminating the extra URL
>   step for the view.=20
>=20
>   This also eliminates the need to traverse the view and for the view
>   to control traversal. There's no need for the magic in
>   AttributePublisher.
>=20
>   I'd like to make this view style the default.
>=20
>   One troublesome consequence of this change is that view names are
>   now page names. With the current URI-parameter
>   namespace-qualification syntax, the namespace parameter will appear
>   after the page name, as in::
>=20
>      aFolder/grants.html;view
>=20
>   Because most (all) clients aren't aware of URI parameters, the
>   namespace parameter effectively hides the file-name extension. This
>   is a problem, since Zope 3 is trying to be file-extension
>   friendly. Note that this is only an issue when namespacve
>   qualification is necessary, which might be avoided in many cases.
>=20
>   Given this, I wonder if we should switch to the namespace syntax
>   used by XPath (and perl and C++ ;)::
>=20
>      aFolder/view::grants.html
>=20
>   This syntax is a little nicer looking (to me :) and doesn't mess
>   with the file-extension. The only downside is that we'd have to
>   disallow ids/names that begin with identifier characters followed by
>   "::". I expect that this limitation would be acceptable.
>=20
> Thoughts?
>=20
> --
> Jim Fulton           mailto:jim@zope.com       Python Powered!       =20
> CTO                  (888) 344-4332            http://www.python.org =20
> Zope Corporation     http://www.zope.com       http://www.zope.org
>=20
>=20
> _______________________________________________
> Zope3-dev mailing list
> Zope3-dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope3-dev
>=20