[Zope3-dev] difference between view and page
Garrett Smith
garrett@mojave-corp.com
Sun, 4 May 2003 13:46:11 -0500
I got my namespaces mixed up. The declaration for IHTTPPresentation is
from the zope namespace, not browser. Oops
But...I did find another example of what I'm actually confused about:
<browser:page=20
name=3D"_traverse"=20
for=3D"zope.interface.Interface"
class=3D"zope.app.publication.traversers.SimpleComponentTraverser"=20
permission=3D"zope.Public"
/>
<browser:view=20
name=3D"_traverse"=20
for=3D"zope.app.interfaces.content.file.IFileContent"
class=3D"zope.app.publication.traversers.FileContentTraverser"=20
permission=3D"zope.Public"
/>
Here, it looks like view and page (both in browser namespace) are
interchangeable.
-- Garrett
Steve Alexander wrote:
> Garrett Smith wrote:
>> I've read through the documentation in view.stx and page.stx, but I'm
>> not clear on their differences.
>>=20
>> The issue never bothered me until I saw the following in
>> zope/app/browser/traversal.zcml:
>=20
> The following declaration is for a component architecture view.
>=20
> The view's type is given as IHTTPPresentation. So, it is an HTTP view.
>=20
>> <view
>> for=3D"*"
>> name=3D"absolute_url"
>> factory=3D".absoluteurl.AbsoluteURL"
>> type=3D"zope.publisher.interfaces.http.IHTTPPresentation" =20
>> permission=3D"zope.Public"=20
>>=20
>>=20
> allowed_interface=3D"zope.app.interfaces.browser.absoluteurl.IAb
> soluteURL"
>>=20
>> />
>=20
> The following declaration is for a browser page.
>=20
> The the page directive implies creating browser views. That is, views
> of type zope.publisher.interfaces.browser.IBrowserPresentation.
>=20
>> <browser:page
>> for=3D"*"
>> name=3D"absolute_url"
>> class=3D".absoluteurl.AbsoluteURL"
>> permission=3D"zope.Public"
>>=20
>>=20
> allowed_interface=3D"zope.app.interfaces.browser.absoluteurl.IAb
> soluteURL"
>>=20
>> />