[Zope3-checkins] CVS: Zope3/src/zope/app/content - configure.zcml:1.25 folder.py:1.14

Fred L. Drake, Jr. fred at zope.com
Fri Aug 15 13:45:15 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/content
In directory cvs.zope.org:/tmp/cvs-serv8446

Modified Files:
	configure.zcml folder.py 
Log Message:
include service managers in the fssync serialization for service manager
containers; this mirrors the directory adapter for WebDAV, and makes them
much easier to work with


=== Zope3/src/zope/app/content/configure.zcml 1.24 => 1.25 ===
--- Zope3/src/zope/app/content/configure.zcml:1.24	Sun Aug  3 13:50:18 2003
+++ Zope3/src/zope/app/content/configure.zcml	Fri Aug 15 12:45:09 2003
@@ -420,12 +420,9 @@
 
 <fssync:adapter class=".image.Image" factory=".fssync.FileAdapter" />
 
-<fssync:adapter class=".folder.Folder" factory=".fssync.DirectoryAdapter" />
+<fssync:adapter class=".folder.Folder" factory=".folder.FolderAdapter" />
 
-<fssync:adapter
-    class=".folder.RootFolder"
-    factory=".fssync.DirectoryAdapter"
-    />
+<fssync:adapter class=".folder.RootFolder" factory=".folder.FolderAdapter" />
 
 <fssync:adapter class=".zpt.ZPTPage" factory=".fssync.ZPTPageAdapter" />
 
@@ -438,4 +435,4 @@
 
 <!-- Further Directives -->
 
-</configure>
\ No newline at end of file
+</configure>


=== Zope3/src/zope/app/content/folder.py 1.13 => 1.14 ===
--- Zope3/src/zope/app/content/folder.py:1.13	Tue Jun  3 10:21:44 2003
+++ Zope3/src/zope/app/content/folder.py	Fri Aug 15 12:45:09 2003
@@ -14,9 +14,11 @@
 
 from persistence import Persistent
 from zodb.btrees.OOBTree import OOBTree
+from zope.app.content.fssync import DirectoryAdapter
 from zope.app.interfaces.content.folder import IFolder, IRootFolder, \
      ICloneWithoutChildren
 from zope.app.services.servicecontainer import ServiceManagerContainer
+from zope.app.zapi import ContextWrapper
 from zope.exceptions import DuplicationError
 from zope.interface import implements
 
@@ -161,3 +163,14 @@
     def __contains__(self, key):
         return self.get(key) is not None
 
+# Adapter to provide an fssync interpretation of folders
+
+class FolderAdapter(DirectoryAdapter):
+
+    def contents(self):
+        result = super(FolderAdapter, self).contents()
+        if self.context.hasServiceManager():
+            sm = self.context.getServiceManager()
+            w = ContextWrapper(sm, self.context, name='++etc++site')
+            result.append(('++etc++site', w))
+        return result




More information about the Zope3-Checkins mailing list