[Zope-Checkins] CVS: Zope2 - PropertySheets.py:1.74.4.2

andreas@serenade.digicool.com andreas@serenade.digicool.com
Fri, 29 Jun 2001 12:25:30 -0400


Update of /cvs-repository/Zope2/lib/python/OFS
In directory serenade:/tmp/cvs-serv32443/lib/python/OFS

Modified Files:
      Tag: Zope-2_4-branch
	PropertySheets.py 
Log Message:
webdav workaround for GoLive: system object properties placed inside
a CDATA section were not accepted by GoLive



--- Updated File PropertySheets.py in package Zope2 --
--- PropertySheets.py	2001/06/29 15:53:39	1.74.4.1
+++ PropertySheets.py	2001/06/29 16:25:30	1.74.4.2
@@ -375,7 +375,19 @@
             else:
                 # Quote non-xml items here?
                 attrs='' 
-            prop='  <n:%s%s><![CDATA[%s]]></n:%s>' % (name, attrs, xml_escape(value), name)
+
+            # Argh....a litte Hack: some webdav client don't expect
+            # some object properties inside CDATA sections (GoLive !).
+            # For these properties we don't use a CDATA section
+ 
+            if name in ['creationdate', 'displayname','resourcetype','getcontenttype', \
+                        'getcontentlength', 'source', 'supportedlock','lockdiscovery', 
+                        'getlastmodified' ] :
+
+                prop='  <n:%s%s>%s</n:%s>' % (name, attrs, xml_escape(value), name)
+            else:
+                prop='  <n:%s%s><![CDATA[%s]]></n:%s>' % (name, attrs, xml_escape(value), name)
+
             result.append(prop)
         if not result: return ''
         result=join(result, '\n')
@@ -535,7 +547,7 @@
         {'id':'supportedlock',    'mode':'r'},
         {'id':'lockdiscovery',    'mode':'r'},
         )
-
+     
     def getProperty(self, id, default=None):
         method='dav__%s' % id
         if not hasattr(self, method):