[Zope3-checkins] CVS: Zope3/src/zope/app/content - configure.zcml:1.22 xmldocument.py:1.5

Fred L. Drake, Jr. fred@zope.com
Thu, 17 Jul 2003 14:34:27 -0400


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

Modified Files:
	configure.zcml xmldocument.py 
Log Message:
Add an fssync adapter for XMLDocument, so the document source is not
presented as XML embedded in an XML pickle.


=== Zope3/src/zope/app/content/configure.zcml 1.21 => 1.22 ===
--- Zope3/src/zope/app/content/configure.zcml:1.21	Thu Jun 12 05:33:25 2003
+++ Zope3/src/zope/app/content/configure.zcml	Thu Jul 17 14:34:21 2003
@@ -430,6 +430,11 @@
 
 <fssync:adapter class=".dtmlpage.DTMLPage" factory=".fssync.DTMLPageAdapter" />
 
+<fssync:adapter
+    class=".xmldocument.XMLDocument"
+    factory=".xmldocument.XMLDocumentAdapter"
+    />
+
 <!-- Further Directives -->
 
 </zopeConfigure>


=== Zope3/src/zope/app/content/xmldocument.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/content/xmldocument.py:1.4	Sat Jun  7 02:37:23 2003
+++ Zope3/src/zope/app/content/xmldocument.py	Thu Jul 17 14:34:21 2003
@@ -15,6 +15,8 @@
 $Id$
 """
 from persistence import Persistent
+from zope.app.fssync.classes import ObjectEntryAdapter
+from zope.app.interfaces.fssync import IObjectFile
 from zope.app.interfaces.content.xmldocument import IXMLDocument
 from zope.app.xml.w3cschemalocations import setInstanceInterfacesForXMLText
 from zope.interface import implements
@@ -42,3 +44,17 @@
         return self._source
 
     source = property(_getSource, _setSource)
+
+
+class XMLDocumentAdapter(ObjectEntryAdapter):
+
+    implements(IObjectFile)
+
+    def getBody(self):
+        return self.context.source
+
+    def setBody(self, data):
+        self.context.source = data
+
+    def extra(self):
+        return None