Commit e1bb3e5b authored by Arnaud Fontaine's avatar Arnaud Fontaine

Add missing default values for core properties of ZODB Property Sheets

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39735 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f9f758ed
...@@ -50,7 +50,7 @@ class AcquiredProperty(StandardProperty): ...@@ -50,7 +50,7 @@ class AcquiredProperty(StandardProperty):
# Filesystem-based name of attributes specific to 'content' type # Filesystem-based name of attributes specific to 'content' type
_content_type_attribute_tuple = ('portal_type', _content_type_attribute_tuple = ('portal_type',
'acquired_property_id', 'acquired_property_id',
'translation_acquired_property') 'translation_acquired_property_id')
# Add names specific to 'content' type (see StandardProperty) # Add names specific to 'content' type (see StandardProperty)
_name_mapping_filesystem_to_zodb_dict = \ _name_mapping_filesystem_to_zodb_dict = \
...@@ -83,15 +83,15 @@ class AcquiredProperty(StandardProperty): ...@@ -83,15 +83,15 @@ class AcquiredProperty(StandardProperty):
StandardProperty.exportToFilesystemDefinition(self) StandardProperty.exportToFilesystemDefinition(self)
filesystem_property_dict.update( filesystem_property_dict.update(
{'acquisition_base_category': self.getAcquisitionBaseCategoryList() or None, {'acquisition_base_category': self.getAcquisitionBaseCategoryList(),
'acquisition_object_id': self.getAcquisitionObjectIdList() or None, 'acquisition_object_id': self.getAcquisitionObjectIdList(),
'acquisition_portal_type': self._convertValueToTalesExpression(self.getAcquisitionPortalType()), 'acquisition_portal_type': self._convertValueToTalesExpression(self.getAcquisitionPortalType()),
'acquisition_accessor_id': self.getAcquisitionAccessorId(), 'acquisition_accessor_id': self.getAcquisitionAccessorId(),
'alt_accessor_id': self.getAltAccessorIdList() or None, 'alt_accessor_id': self.getAltAccessorIdList(),
'acquisition_copy_value': self.getAcquisitionCopyValue(), 'acquisition_copy_value': self.getAcquisitionCopyValue(),
'acquisition_mask_value': self.getAcquisitionMaskValue(), 'acquisition_mask_value': self.getAcquisitionMaskValue(),
'portal_type': self._convertValueToTalesExpression(self.getContentPortalType()), 'portal_type': self._convertValueToTalesExpression(self.getContentPortalType()),
'acquired_property_id': self.getContentAcquiredPropertyIdList() or None, 'acquired_property_id': self.getContentAcquiredPropertyIdList(),
'translation_acquired_property_id': self.getContentTranslationAcquiredPropertyIdList() or None}) 'translation_acquired_property_id': self.getContentTranslationAcquiredPropertyIdList()})
return filesystem_property_dict return filesystem_property_dict
...@@ -33,34 +33,44 @@ class AcquiredProperty: ...@@ -33,34 +33,44 @@ class AcquiredProperty:
_properties = ( _properties = (
{ 'id': 'acquisition_base_category', { 'id': 'acquisition_base_category',
'type': 'lines', 'type': 'lines',
'description' : 'The base categories to browse' }, 'description' : 'The base categories to browse',
'default': None },
{ 'id': 'acquisition_object_id', { 'id': 'acquisition_object_id',
'type': 'lines', 'type': 'lines',
'description' : 'The default contained object id to look up' }, 'description' : 'The default contained object id to look up',
'default': None },
# TALES expression # TALES expression
{ 'id': 'acquisition_portal_type', { 'id': 'acquisition_portal_type',
'type': 'string', 'type': 'string',
'description' : 'The portal types to browse' }, 'description' : 'The portal types to browse',
'default': None },
{ 'id': 'acquisition_accessor_id', { 'id': 'acquisition_accessor_id',
'type': 'string', 'type': 'string',
'description' : 'Property to get from source' }, 'description' : 'Property to get from source',
'default': None },
{ 'id': 'alt_accessor_id', { 'id': 'alt_accessor_id',
'type': 'lines', 'type': 'lines',
'description' : 'Alternative accessor ids' }, 'description' : 'Alternative accessor ids',
'default': None },
{ 'id': 'acquisition_copy_value', { 'id': 'acquisition_copy_value',
'type': 'boolean', 'type': 'boolean',
'description' : 'Determines if acquired value should be copied' }, 'description' : 'Determines if acquired value should be copied',
'default': False },
{ 'id': 'acquisition_mask_value', { 'id': 'acquisition_mask_value',
'type': 'boolean', 'type': 'boolean',
'description' : 'Determines if the local value have priority' }, 'description' : 'Determines if the local value have priority',
'default': False },
# TALES expression # TALES expression
{ 'id': 'content_portal_type', { 'id': 'content_portal_type',
'type': 'string', 'type': 'string',
'description' : 'Portal type of the object to create' }, 'description' : 'Portal type of the object to create',
'default': None },
{ 'id': 'content_acquired_property_id', { 'id': 'content_acquired_property_id',
'type': 'lines', 'type': 'lines',
'description' : 'Properties to be synchronized with the current object' }, 'description' : 'Properties to be synchronized with the current object',
'default': None },
{ 'id': 'content_translation_acquired_property_id', { 'id': 'content_translation_acquired_property_id',
'type': 'lines', 'type': 'lines',
'description' : 'Properties to be translated' }, 'description' : 'Properties to be translated',
'default': None },
) )
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
# #
############################################################################## ##############################################################################
from Products.ERP5Type import Permissions
class StandardProperty: class StandardProperty:
""" """
Define a Standard Property for ZODB Property Sheets Define a Standard Property for ZODB Property Sheets
...@@ -39,26 +41,33 @@ class StandardProperty: ...@@ -39,26 +41,33 @@ class StandardProperty:
# TALES expression # TALES expression
{ 'id': 'property_default', { 'id': 'property_default',
'type': 'string', 'type': 'string',
'description': 'Default value if not set' }, 'description': 'Default value if not set',
'default': None },
{ 'id': 'multivalued', { 'id': 'multivalued',
'type': 'boolean', 'type': 'boolean',
'description': 'Determines if the property is multivalued' }, 'description': 'Determines if the property is multivalued',
'default': False },
{ 'id': 'range', { 'id': 'range',
'type': 'boolean', 'type': 'boolean',
'description': 'Determines if the range accessors should be created' }, 'description': 'Determines if the range accessors should be created' ,
'default': False },
{ 'id': 'preference', { 'id': 'preference',
'type': 'boolean', 'type': 'boolean',
'description': 'Determines if the preference accessors should be created' }, 'description': 'Determines if the preference accessors should be created',
'default': False },
# CMF compatibility # CMF compatibility
{ 'id': 'storage_id', { 'id': 'storage_id',
'type': 'string', 'type': 'string',
'description' : 'Name to be used instead of the Reference' }, 'description' : 'Name to be used instead of the Reference',
'default': None },
{ 'id': 'read_permission', { 'id': 'read_permission',
'type': 'string', 'type': 'string',
'description' : 'Permission needed to access Getters' }, 'description' : 'Permission needed to access Getters',
'default': Permissions.AccessContentsInformation },
{ 'id': 'write_permission', { 'id': 'write_permission',
'type': 'string', 'type': 'string',
'description' : 'Permission needed to access Setters' }, 'description' : 'Permission needed to access Setters',
'default': Permissions.ModifyPortalContent },
) )
_categories = ('elementary_type',) _categories = ('elementary_type',)
...@@ -33,8 +33,10 @@ class TranslatableProperty: ...@@ -33,8 +33,10 @@ class TranslatableProperty:
_properties = ( _properties = (
{ 'id': 'translatable', { 'id': 'translatable',
'type': 'boolean', 'type': 'boolean',
'description' : 'Determines if the value is translatable' }, 'description' : 'Determines if the value is translatable',
'default': False },
{ 'id': 'translation_domain', { 'id': 'translation_domain',
'type': 'string', 'type': 'string',
'description' : 'Define the translation domain' }, 'description' : 'Define the translation domain',
'default': None },
) )
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