IAbsoluteURL for browser view should contain @@?
Hi, the explicit way to address a view is using the /@@viewname namespace traversal. An IAbsoluteURL for a browser view returns an URL without the @@ (i.e. /foo/bar/view instead of /foo/bar/@@view). I think this should be changed so that the URL contains the @@. If you agree with this, where should I place this adapter? The two relevant interfaces are zope.browser.interfaces.IBrowserView zope.traversing.browser.interfaces.IAbsoluteURL But neither package depends on the other, so a different package might be more suiteable? Regards, -- Christian Zagrodnick · cz@gocept.com gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany http://gocept.com · tel +49 345 1229889 4 · fax +49 345 1229889 1 Zope and Plone consulting and development
On Thu, Apr 01, 2010 at 10:25:09AM +0200, Christian Zagrodnick wrote:
the explicit way to address a view is using the /@@viewname namespace traversal.
An IAbsoluteURL for a browser view returns an URL without the @@ (i.e. /foo/bar/view instead of /foo/bar/@@view). I think this should be changed so that the URL contains the @@.
If you agree with this, where should I place this adapter?
The two relevant interfaces are zope.browser.interfaces.IBrowserView
Are you sure that most views provide IBrowserView these days? URL traversal looks them up as multi-adapters providing just Interface.
zope.traversing.browser.interfaces.IAbsoluteURL
But neither package depends on the other, so a different package might be more suiteable?
Marius Gedminas -- http://pov.lt/ -- Zope 3 consulting and development
Marius Gedminas wrote:
Are you sure that most views provide IBrowserView these days? URL traversal looks them up as multi-adapters providing just Interface.
True and you will almost never see a view class using "implements(IBrowserView)" directly. Still, if you use the browser:view or browser:page zcml directives from zope.browserpage (used to live in zope.app.publisher.browser) to register your views, then the magic class that they create for you and that is *actually* registered is a descendant of zope.publisher.browser.BrowserView which *does* implement IBrowserView. In short, all views registered using the classic zcml directives *do* provide IBrowserView. I don't (yet) know enough about Grok to say if something similar applies there. - Jacob
On 2010-04-01 12:31:10 +0200, Jacob Holm <jh@improva.dk> said:
Marius Gedminas wrote:
Are you sure that most views provide IBrowserView these days? URL traversal looks them up as multi-adapters providing just Interface.
True and you will almost never see a view class using "implements(IBrowserView)" directly. Still, if you use the browser:view or browser:page zcml directives from zope.browserpage (used to live in zope.app.publisher.browser) to register your views, then the magic class that they create for you and that is *actually* registered is a descendant of zope.publisher.browser.BrowserView which *does* implement IBrowserView.
Yes indeed. One problem I found already is, that the FileResource is "more" an IBrowserView than an IResources currently. That is currently registering an IAbsoluteURL adapter for IBrowserView will break the URL for file resources. But that's solvable. -- Christian Zagrodnick · cz@gocept.com gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany http://gocept.com · tel +49 345 1229889 4 · fax +49 345 1229889 1 Zope and Plone consulting and development
participants (3)
-
Christian Zagrodnick -
Jacob Holm -
Marius Gedminas