[Erp5-report] r39002 arnaud.fontaine - in /erp5/trunk/products: ERP5/Document/ ERP5Type/Dyn...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Oct 8 14:28:11 CEST 2010


Author: arnaud.fontaine
Date: Fri Oct  8 14:28:11 2010
New Revision: 39002

URL: http://svn.erp5.org?rev=39002&view=rev
Log:
Use zodb instead of web for new-style Property Sheets

Modified:
    erp5/trunk/products/ERP5/Document/AcquiredProperty.py
    erp5/trunk/products/ERP5/Document/DynamicCategoryProperty.py
    erp5/trunk/products/ERP5/Document/StandardProperty.py
    erp5/trunk/products/ERP5Type/Dynamic/portaltypeclass.py
    erp5/trunk/products/ERP5Type/Tool/PropertySheetTool.py

Modified: erp5/trunk/products/ERP5/Document/AcquiredProperty.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/AcquiredProperty.py?rev=39002&r1=39001&r2=39002&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/AcquiredProperty.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/AcquiredProperty.py [utf8] Fri Oct  8 14:28:11 2010
@@ -34,9 +34,8 @@ from Products.ERP5.Document.StandardProp
 
 class AcquiredProperty(StandardProperty):
   """
-  Define an Acquired Property Document for a web-based Property Sheet
-  (an Acquired Property only brings new attributes to a Standard
-  Property)
+  Define an Acquired Property Document for a ZODB Property Sheet (an
+  Acquired Property only brings new attributes to a Standard Property)
   """
   meta_type = 'ERP5 Acquired Property'
   portal_type = 'Acquired Property'
@@ -54,12 +53,11 @@ class AcquiredProperty(StandardProperty)
                                    'translation_acquired_property')
 
   # Add names specific to 'content' type (see StandardProperty)
-  _name_mapping_filesystem_to_web_dict = \
+  _name_mapping_filesystem_to_zodb_dict = \
       dict([ (name, 'content_' + name,) for name in _content_type_attribute_tuple ],
-           **StandardProperty._name_mapping_filesystem_to_web_dict)
+           **StandardProperty._name_mapping_filesystem_to_zodb_dict)
 
-  # Web-based name of attributes whose value is a TALES Expression
-  # string
+  # ZODB name of attributes whose value is a TALES Expression string
   _expression_attribute_tuple = \
       StandardProperty._expression_attribute_tuple + \
       ('acquisition_portal_type', 'content_portal_type')
@@ -79,7 +77,7 @@ class AcquiredProperty(StandardProperty)
                             'exportToFilesystemDefinition')
   def exportToFilesystemDefinition(self):
     """
-    Return the filesystem definition of this web-based property
+    Return the filesystem definition of this ZODB property
     """
     filesystem_property_dict = \
         StandardProperty.exportToFilesystemDefinition(self)

Modified: erp5/trunk/products/ERP5/Document/DynamicCategoryProperty.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/DynamicCategoryProperty.py?rev=39002&r1=39001&r2=39002&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/DynamicCategoryProperty.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/DynamicCategoryProperty.py [utf8] Fri Oct  8 14:28:11 2010
@@ -34,7 +34,7 @@ from Products.ERP5Type.XMLObject import 
 
 class DynamicCategoryProperty(XMLObject):
   """
-  Define a Dynamic Category Property Document for a web-based Property
+  Define a Dynamic Category Property Document for a ZODB Property
   Sheets (a dynamic category is defined by a TALES expression rather
   than a string and is being used by Item and Movement for example)
   """

Modified: erp5/trunk/products/ERP5/Document/StandardProperty.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/StandardProperty.py?rev=39002&r1=39001&r2=39002&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/StandardProperty.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/StandardProperty.py [utf8] Fri Oct  8 14:28:11 2010
@@ -34,7 +34,7 @@ from Products.ERP5Type.XMLObject import 
 
 class StandardProperty(XMLObject):
   """
-  Define an Acquired Property Document for a web-based Property Sheet
+  Define an Acquired Property Document for a ZODB Property Sheet
   """
   meta_type = 'ERP5 Standard Property'
   portal_type = 'Standard Property'
@@ -47,22 +47,20 @@ class StandardProperty(XMLObject):
                      PropertySheet.StandardProperty,
                      PropertySheet.TranslatableProperty)
 
-  # Names mapping between filesystem to web-based property, only
-  # meaningful when importing a property from its filesystem
-  # definition
-  _name_mapping_filesystem_to_web_dict = {'id': 'reference',
-                                          'type': 'elementary_type',
-                                          'default': 'property_default'}
+  # Names mapping between filesystem to ZODB property, only meaningful
+  # when importing a property from its filesystem definition
+  _name_mapping_filesystem_to_zodb_dict = {'id': 'reference',
+                                           'type': 'elementary_type',
+                                           'default': 'property_default'}
 
-  # Web-based name of attributes whose value is a TALES Expression
-  # string
+  # ZODB name of attributes whose value is a TALES Expression string
   _expression_attribute_tuple = ('property_default',)
 
   security.declareProtected(Permissions.AccessContentsInformation,
                             'exportToFilesystemDefinition')
   def exportToFilesystemDefinition(self):
     """
-    Return the filesystem definition of this web-based property
+    Return the filesystem definition of this ZODB property
     """
     return {'id': self.getReference(),
             'description': self.getDescription(),
@@ -80,10 +78,10 @@ class StandardProperty(XMLObject):
   def _convertFromFilesytemPropertyDict(self, filesystem_property_dict):
     """
     Convert a property dict coming from a Property Sheet on the
-    filesystem to a web-based property dict
+    filesystem to a ZODB property dict
     """
-    # Prepare a dictionnary of the web-based property
-    web_property_dict = {}
+    # Prepare a dictionnary of the ZODB property
+    zodb_property_dict = {}
 
     for fs_property_name, value in filesystem_property_dict.iteritems():
       # Property Sheets on the filesystem defined attributes whose
@@ -92,21 +90,21 @@ class StandardProperty(XMLObject):
       if not value:
         continue
 
-      # Convert filesystem property name to web-based if necessary
-      web_property_name = \
-          fs_property_name in self._name_mapping_filesystem_to_web_dict and \
-          self._name_mapping_filesystem_to_web_dict[fs_property_name] or \
+      # Convert filesystem property name to ZODB if necessary
+      zodb_property_name = \
+          fs_property_name in self._name_mapping_filesystem_to_zodb_dict and \
+          self._name_mapping_filesystem_to_zodb_dict[fs_property_name] or \
           fs_property_name
 
       # Convert existing TALES expression class or primitive type to a
       # TALES expression string
-      if web_property_name in self._expression_attribute_tuple:
+      if zodb_property_name in self._expression_attribute_tuple:
         value = isinstance(value, Expression) and \
             value.text or 'python: ' + repr(value)
 
-      web_property_dict[web_property_name] = value
+      zodb_property_dict[zodb_property_name] = value
 
-    return web_property_dict
+    return zodb_property_dict
 
   security.declareProtected(Permissions.AccessContentsInformation,
                             'importFromFilesystemDefinition')

Modified: erp5/trunk/products/ERP5Type/Dynamic/portaltypeclass.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Dynamic/portaltypeclass.py?rev=39002&r1=39001&r2=39002&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Dynamic/portaltypeclass.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Dynamic/portaltypeclass.py [utf8] Fri Oct  8 14:28:11 2010
@@ -137,7 +137,7 @@ def portal_type_factory(portal_type_name
     # Initialize Property Sheets accessor holders
     import erp5.accessor_holder
 
-    # Get the web-based Property Sheets for this Portal Type
+    # Get the ZODB Property Sheets for this Portal Type
     property_sheet_name_set = set(
       portal_type.getNewStyleTypePropertySheetList() or [])
 
@@ -194,7 +194,7 @@ def initializeDynamicModules():
       for example classes created through ClassTool that are in
       $INSTANCE_HOME/Document
     erp5.accessor_holder
-      holds accessors of web-based Property Sheet
+      holds accessors of ZODB Property Sheet
   """
   def portal_type_loader(portal_type_name):
     """
@@ -290,7 +290,7 @@ def synchronizeDynamicModules(context, f
       klass.__bases__ = ghostbase
       type(ExtensionBase).__init__(klass, klass)
 
-  # Clear accessor holders of web-based Property Sheets
+  # Clear accessor holders of ZODB Property Sheets
   for accessor_name in erp5.accessor_holder.__dict__.keys():
     if not accessor_name.startswith('__'):
       delattr(erp5.accessor_holder, accessor_name)

Modified: erp5/trunk/products/ERP5Type/Tool/PropertySheetTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Tool/PropertySheetTool.py?rev=39002&r1=39001&r2=39002&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Tool/PropertySheetTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Tool/PropertySheetTool.py [utf8] Fri Oct  8 14:28:11 2010
@@ -148,8 +148,8 @@ class PropertySheetTool(BaseTool):
                             'exportPropertySheetToFilesystemDefinitionTuple')
   def exportPropertySheetToFilesystemDefinitionTuple(self, property_sheet):
     """
-    Export a given web-based Property Sheet to its filesystem
-    definition as tuple (properties, categories, constraints)
+    Export a given ZODB Property Sheet to its filesystem definition as
+    tuple (properties, categories, constraints)
 
     XXX: Implement constraints
     """




More information about the Erp5-report mailing list