[Zope3-Users] Inheritance conflict between Interface and Skin
Florian Lindner
mailinglists at xgm.de
Fri Aug 11 06:52:41 EDT 2006
Hello,
I have the following situation.
an ICentershockSkin derived from Rotterdam:
class ICentershockSkin(zope.app.rotterdam.Rotterdam):
an IContentItem that works as base interface for all items:
class IContentItem(Interface):
an ILink that is such an item:
class ILink(IContentItem):
the ILink has an edit view on the default layer:
<editform
schema="..interfaces.ILink"
name="edit.html"
permission="zope.ManageContent"
menu="zmi_views" title="Edit"
/>
intended only for use withing the ZMI.
The IContentItem has also registered a view called edit.html on the
ICentershockSkin:
<page
name="edit.html"
for="CS.ContentItem.interfaces.IContentItem"
layer="CS.skin.interfaces.ICentershockSkin"
permission="CS.Edit"
class=".views.Edit"
/>
another interface derived from IContentItem is the IContentFolder which has no
edit view registered for the ZMI (on the default layer).
The goal:
All objects derived from IContentItem should use the edit.html registered for
IContentItem unless they want to provide their own view. (all request are for
the ICentershockSkin)
The problem:
This works fine when I call the edit view on a IContentFolder, which has no
edit view registered on the default layer.
However is does not work for the ILink, the edit view defined by IContentItem
on the ICentershockSkin is never called.
The cause:
There are 2 edit.html views around for the ILink.
The first one on the default layer which is also on the ICentershockLayer
since Rotterdam is derived from the default layer.
The second one comes from the IContentItem from which the ILink is derived.
Obviously always the second one is called.
The solution
1) Rename edit.html to something else to avoid this name clash
2) Do not derive ICentershockSkin from Rotterdam instead only from Interface.
That caused TraversalErrors here.
3) ???
Is this intended behavior? (that Skin inheritance is over Interface
intheritance) or is the behavior undefined? Any other ways to solve that
beside renaming?
Or do I get the entire problem wrong?
Thanks,
Florian
More information about the Zope3-users
mailing list