[z3-five] local utility with zope 2.9.5
Rocky Burt
rocky at serverzen.com
Tue Jan 16 12:47:27 CET 2007
On Tue, 2007-16-01 at 10:40 +0100, Dennis Schulz wrote:
> I tried it out (see below code) and I get always the message
> "IPossibleSite" not provided.
> Do I have to register the utility on my Application or on the Plone
> Site? Both of them do not provide IPossibleSite.
> When I explicitly provide IPossibleSite
> (directlyProvides(app,IPossibleSite)) the call sm =
> app.getSiteManager() raises an attribute error afterwards.....
>
> Below there code of the registration is attached.
> I call it in the Extensions/install.py of my archetype based product.
> Anything wrong with this?
Your install code looks good and yes on Zope 2.10 that would just work.
The problem is that none of the container classes provided by Zope 2.9
are actually proper IPossibleSite's. But Five provides a way to make
them IPossibleSite's properly.
I believe the two steps you're missing are better suited to ZCML.
1) make the class implement IPossibleSite
<class class="OFS.Application.Application">
<implements
interface="zope.app.site.interfaces.IPossibleSite"
/>
</class>
2) monkey patch Application class to properly meet the IPossibleSite
contract
<five:localsite
class="OFS.Application.Application"
/>
Basically in Zope 2.9 you need to do those steps before you can try to
treat any class instance as an IPossibleSite (in my apps I tend to make
the plone site a local site by doing something similar).
- Rocky
--
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://codespeak.net/pipermail/z3-five/attachments/20070116/800c8d40/attachment.pgp
More information about the z3-five
mailing list