[Zope3-dev] difference between view and page

Steve Alexander steve@cat-box.net
Sun, 04 May 2003 20:32:54 +0200


Garrett Smith wrote:
> I've read through the documentation in view.stx and page.stx, but I'm
> not clear on their differences.
> 
> The issue never bothered me until I saw the following in
> zope/app/browser/traversal.zcml:

The following declaration is for a component architecture view.

The view's type is given as IHTTPPresentation. So, it is an HTTP view.

> <view
>     for="*"	
>     name="absolute_url"
>     factory=".absoluteurl.AbsoluteURL"
>     type="zope.publisher.interfaces.http.IHTTPPresentation"
>     permission="zope.Public"
>  
> allowed_interface="zope.app.interfaces.browser.absoluteurl.IAbsoluteURL"
> 
>     />

The following declaration is for a browser page.

The the page directive implies creating browser views. That is, views of 
type zope.publisher.interfaces.browser.IBrowserPresentation.

> <browser:page
>     for="*"
>     name="absolute_url"
>     class=".absoluteurl.AbsoluteURL"
>     permission="zope.Public"
>  
> allowed_interface="zope.app.interfaces.browser.absoluteurl.IAbsoluteURL"
> 
>     />

--
Steve Alexander