Commit 21becf4c authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: Migrate Products.ERP5Type.WebDAVSupport from filesystem.

parent 48c45fbd
...@@ -33,7 +33,7 @@ from zLOG import LOG, WARNING ...@@ -33,7 +33,7 @@ from zLOG import LOG, WARNING
from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5.Document.Document import Document, ConversionError, _MARKER, DEFAULT_CONTENT_TYPE from Products.ERP5.Document.Document import Document, ConversionError, _MARKER, DEFAULT_CONTENT_TYPE
from Products.ERP5.Document.File import File from Products.ERP5.Document.File import File
from Products.ERP5Type.WebDAVSupport import TextContent from erp5.component.module.WebDAVSupport import TextContent
from Products.ERP5.Document.Document import VALID_IMAGE_FORMAT_LIST, VALID_TEXT_FORMAT_LIST from Products.ERP5.Document.Document import VALID_IMAGE_FORMAT_LIST, VALID_TEXT_FORMAT_LIST
import cStringIO import cStringIO
from string import Template from string import Template
......
...@@ -15,20 +15,17 @@ ...@@ -15,20 +15,17 @@
import collections import collections
import email import email
import re
import transaction import transaction
from lxml import html from lxml import html
from Products.ERP5Type.Utils import formatRFC822Headers from Products.ERP5Type.Utils import formatRFC822Headers
from Acquisition import aq_parent, aq_inner, aq_base from Acquisition import aq_base
from AccessControl import ClassSecurityInfo, ModuleSecurityInfo from AccessControl import ClassSecurityInfo, ModuleSecurityInfo
from Products.ERP5Type.Globals import InitializeClass from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5Type import Permissions, PropertySheet, Constraint from Products.ERP5Type import Permissions
from Products.CMFCore.PortalContent import ResourceLockedError from Products.CMFCore.PortalContent import ResourceLockedError
from Products.CMFCore.utils import getToolByName
from zLOG import LOG
from zExceptions import Forbidden from zExceptions import Forbidden
security = ModuleSecurityInfo( 'Products.ERP5Type.WebDAVSupport' ) security = ModuleSecurityInfo(__name__)
class TextContent: class TextContent:
...@@ -82,7 +79,7 @@ class TextContent: ...@@ -82,7 +79,7 @@ class TextContent:
headers.setdefault('content_type', content_type) headers.setdefault('content_type', content_type)
headers['file'] = body headers['file'] = body
self._edit(**headers) self._edit(**headers)
except ResourceLockedError, msg: except ResourceLockedError:
transaction.abort() transaction.abort()
RESPONSE.setStatus(423) RESPONSE.setStatus(423)
return RESPONSE return RESPONSE
...@@ -120,7 +117,7 @@ class TextContent: ...@@ -120,7 +117,7 @@ class TextContent:
continue continue
elif content is not None: elif content is not None:
# XXX - Bad algorithm - we should use getPropertyMap directly # XXX - Bad algorithm - we should use getPropertyMap directly
if type(content) in (type(()), type([])): if isinstance(content, (list, tuple)):
for content_item in content: for content_item in content:
hdrtext = '%s\n <meta name="%s" content="%s" />' % ( hdrtext = '%s\n <meta name="%s" content="%s" />' % (
hdrtext, name, content_item) hdrtext, name, content_item)
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Module Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>WebDAVSupport</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5Type.WebDAVSupport</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>module.erp5.WebDAVSupport</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Module Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -5,3 +5,4 @@ module.erp5.GeneratedAmountList ...@@ -5,3 +5,4 @@ module.erp5.GeneratedAmountList
module.erp5.Log module.erp5.Log
module.erp5.MovementCollectionDiff module.erp5.MovementCollectionDiff
module.erp5.MovementGroup module.erp5.MovementGroup
module.erp5.WebDAVSupport
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment