[Zope3-Users] Zope 3.3.0 - Adding Utilities to Content Space
Baiju M
baiju.m.mail at gmail.com
Mon Oct 9 00:11:18 EDT 2006
On 9/28/06, Philipp von Weitershausen <philipp at weitershausen.de> wrote:
> Lennart Regebro wrote:
> > On 9/28/06, Tom Dossis <td at yoma.com.au> wrote:
> >> I've noticed the following changes in the zope 3.3 ZMI
> >>
> >> Zope 3.3 - Can add utilities anywhere, e.g. to Folders (content space).
> >> Zope 3.2 - Can only add utilities to a Site Mgmt Folder
> >
> > You can see it like this: The difference between a folder and a site
> > has lessened.
> > Folders are no more or less content space than sites. Any thing you
> > can browse too is content. ;-)
>
> No, Lennart, this is wrong. A site is still very much a site (ISite
> determines "site-ness", nothing else). They're still regular folders
> that contain content. The only difference between sites and folders is
> that sites are a palce where you can make local component registrations.
> This is still the same in Zope 3.3, only the constraint *where* these
> components live has changed.
So, the concept of 'site' is part of component architecture
and not specific to application server?
Then, can we move up zope.app.component.interfaces.ISite to
zope.component.interfaces.ISite or any other place?
If we can do like this, the zope.location's dependency on
zope.app can be removed.
We are implementing 'IPhysicallyLocatable' in
zope.location.traversing.LocationPhysicallyLocatable
And there is 'getNearestSite' site method, which actually
get the 'ISite.providedBy' object.
Here is the code snip:
def getNearestSite(self):
"""return the nearest site, see IPhysicallyLocatable"""
if ISite.providedBy(self.context):
return self.context
for parent in getParents(self.context):
if ISite.providedBy(parent):
return parent
return self.getRoot()
Regards,
Baiju M
More information about the Zope3-users
mailing list