[Zope-dev] zope.publisher
Roger Ineichen
dev at projekt01.ch
Thu Mar 5 20:56:09 EST 2009
Hi Martijn
> Betreff: Re: [Zope-dev] zope.publisher
>
> Roger Ineichen wrote:
>
> > Does grok need to register this new adapter somewhere?
> > If the adapter configuration is missing the default skin
> apply pattern
> > will break.
>
> As long as zope.publisher's configure.zcml does it, Grok will
> load that up. Grok isn't different in that respect; it only
> uses Grok-style registration in packages that explicitly use
> grok or grokcore.* libraries.
>
> It's quite possible Grok can start using some of your changes
> for its REST skin implementation (which do apply to
> IBrowserRequest), though I'm not 100% sure.
of corse, all changes are 100% compatible.
The changes allow you to inherit from IHTTPRequest instead of
IBrowserRequest and support a IDefaultSkin. The previous implementation
required that the default skin pattern uses an IBrowserRequest.
REST does normaly depend on IBrowserRequest but JSON-RPC doesn't
have to, or you will get all the IBrwoserRequest parts in JSON-RPC
too which is not good.
Also XML-RPC has to be inherited from IHTTPRequest and not how
it is right now from IBrowserRequest. XML-RPC should also allow
to use it's own default skin and not depend on the IBrowserRequest
default skin implementation. e.g. we do really not need a contents.html
page in XML-RPC skins. But that's another (security) topic which we
can discuss at a later time.
> I'm trying to understand why the default default skin cannot
> be registered as an interface, instead of the introduction of
> an adapter.
> Is this because defaultSkin can only be used for IBrowserRequest?
Because it's not an adapter. It's doens't provide what it
should provide and is registered for.
The following will end in a TypeError:
>>> request BrowserRequest()
>>> defautlSkin = IDefaultskin(request)
TypeError ...
but it should return: IDefaultBrowserLayer
Another side effect is that we get pickled interfaces in
the adapter registry. That really hurts if someone does
the same in a local (persistent) adapter registry and the
interface get removed.
The question is, should we allow to register such *junk* in
the zope adapter registry?
> I think you need to update the upgrade notes in zope3docs too
> to point out this change. If there is anything people should
> change to their code, you need to explain how to find what
> needs to be changed and what change to make. You need to at
> least warn them that something big changed if they get
> problems with their skins and point them to zope.publisher's
> changelog.
will do so soon
> I'll also note that this is *not* a minor bugfix release of
> zope.publisher, so it should be 3.6 not 3.5.7. Also don't use 'dev'
> markers in CHANGES.txt; only in setup.py.
agreed
Regards
Roger Ineichen
> Regards,
>
> Martijn
>
> _______________________________________________
> Zope-Dev maillist - Zope-Dev at zope.org
> http://mail.zope.org/mailman/listinfo/zope-dev
> ** No cross posts or HTML encoding! ** (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope )
>
More information about the Zope-Dev
mailing list