Commit 5f83c156 authored by Mame Coumba Sall's avatar Mame Coumba Sall

took care of methods that were removed in previous commit

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26078 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4ee8d48a
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
# #
############################################################################## ##############################################################################
# Required modules - some modules are imported later to prevent circular deadlocks # Required modules - some modules are imported later to prevent circular
deadlocks
import os import os
import re import re
import string import string
...@@ -57,7 +58,8 @@ from Products.ERP5Type import Constraint ...@@ -57,7 +58,8 @@ from Products.ERP5Type import Constraint
from Products.ERP5Type.Cache import getReadOnlyTransactionCache from Products.ERP5Type.Cache import getReadOnlyTransactionCache
from zLOG import LOG, BLATHER, PROBLEM, WARNING from zLOG import LOG, BLATHER, PROBLEM, WARNING
from AccessControl.SecurityManagement import newSecurityManager, getSecurityManager from AccessControl.SecurityManagement import newSecurityManager,
getSecurityManager
##################################################### #####################################################
# Compatibility - XXX - BAD # Compatibility - XXX - BAD
...@@ -175,7 +177,8 @@ def convertToUpperCase(key): ...@@ -175,7 +177,8 @@ def convertToUpperCase(key):
except KeyError: except KeyError:
if not isinstance(key, basestring): if not isinstance(key, basestring):
raise TypeError, '%s is not a string' % (key,) raise TypeError, '%s is not a string' % (key,)
_cached_convertToUpperCase[key] = ''.join([part.capitalize() for part in key.split('_')]) _cached_convertToUpperCase[key] = ''.join([part.capitalize() for part in
key.split('_')])
return _cached_convertToUpperCase[key] return _cached_convertToUpperCase[key]
UpperCase = convertToUpperCase UpperCase = convertToUpperCase
...@@ -264,13 +267,20 @@ def getPath(object_or_path, **kw): ...@@ -264,13 +267,20 @@ def getPath(object_or_path, **kw):
return path.split('/') return path.split('/')
return path return path
# Get Message Id for Workflow State def int2letters(i):
def getMessageIdForWorkflowState(title, workflow_id): """
return '%s [state in %s]' % (title, workflow_id) Convert an integer to letters, to generate spreadsheet column id
A, B, C ..., Z, AA, AB, ..., AZ, BA, ..., ZZ, AAA ...
"""
if i < 26:
return (chr(i + ord('A')))
d, m = divmod(i, 26)
return int2letter(d - 1) + int2letter(m)
#Get message id for translation
def getMessageIdWithContext(msg_id,context,workflow_id): def getMessageIdWithContext(msg_id,context,workflow_id):
return '%s [%s in %s]' % (msg_id,context, workflow_id) return '%s [%s in %s]' % (msg_id,context, workflow_id)
#Get translation of msg id
def getTranslationStringWithContext(self,msg_id, context, context_id): def getTranslationStringWithContext(self,msg_id, context, context_id):
portal = self.getPortalObject() portal = self.getPortalObject()
portal_workflow = portal.portal_workflow portal_workflow = portal.portal_workflow
...@@ -418,9 +428,8 @@ class TempDocumentConstructor(DocumentConstructor): ...@@ -418,9 +428,8 @@ class TempDocumentConstructor(DocumentConstructor):
# Make some methods public. # Make some methods public.
for method_id in ('reindexObject', 'recursiveReindexObject', for method_id in ('reindexObject', 'recursiveReindexObject',
'activate', 'setUid', 'setTitle', 'getTitle', 'activate', 'setUid', 'setTitle', 'getTitle',
'edit', 'setProperty', 'getUid', 'edit', 'setProperty', 'getUid', 'setCriterion',
'setCriterion', 'setCriterionPropertyList'):
'setCriterionPropertyList','manage_delObjects'):
setattr(TempDocument, '%s__roles__' % method_id, None) setattr(TempDocument, '%s__roles__' % method_id, None)
self.klass = TempDocument self.klass = TempDocument
...@@ -478,6 +487,7 @@ def writeLocalPropertySheet(class_id, text, create=1, instance_home=None): ...@@ -478,6 +487,7 @@ def writeLocalPropertySheet(class_id, text, create=1, instance_home=None):
if not os.path.exists(path): if not os.path.exists(path):
os.mkdir(path) os.mkdir(path)
LOG('ERP5Type', WARNING, 'Created missing but required directory: %s' %path) LOG('ERP5Type', WARNING, 'Created missing but required directory: %s' %path)
path = os.path.join(path, "%s.py" % class_id) path = os.path.join(path, "%s.py" % class_id)
if create: if create:
if os.path.exists(path): if os.path.exists(path):
...@@ -810,7 +820,8 @@ def importLocalDocument(class_id, document_path = None): ...@@ -810,7 +820,8 @@ def importLocalDocument(class_id, document_path = None):
temp_document_constructor_name, temp_document_constructor_name,
temp_document_constructor) temp_document_constructor)
ModuleSecurityInfo('Products.ERP5Type.Document').declarePublic( ModuleSecurityInfo('Products.ERP5Type.Document').declarePublic(
temp_document_constructor_name,) # XXX Probably bad security temp_document_constructor_name,) # XXX Probably bad
security
# Update Meta Types # Update Meta Types
new_meta_types = [] new_meta_types = []
...@@ -949,7 +960,8 @@ def initializeProduct( context, ...@@ -949,7 +960,8 @@ def initializeProduct( context,
contentFactoryTypeInformations.append(content.factory_type_information) contentFactoryTypeInformations.append(content.factory_type_information)
# Aggregate # Aggregate
content_constructors = list(content_constructors) + list(extra_content_constructors) content_constructors = list(content_constructors) +
list(extra_content_constructors)
# Begin the initialization steps # Begin the initialization steps
bases = tuple(content_classes) bases = tuple(content_classes)
...@@ -1151,7 +1163,8 @@ def getExistingBaseCategoryList(portal, base_cat_list): ...@@ -1151,7 +1163,8 @@ def getExistingBaseCategoryList(portal, base_cat_list):
except KeyError: except KeyError:
value = category_tool._getOb(base_cat, None) value = category_tool._getOb(base_cat, None)
if value is None: if value is None:
LOG('ERP5Type.Utils.getExistingBaseCategoryList', PROBLEM, 'base_category "%s" is missing, can not generate Accessors' % (base_cat)) LOG('ERP5Type.Utils.getExistingBaseCategoryList', PROBLEM,
'base_category "%s" is missing, can not generate Accessors' % (base_cat))
cache[key] = value cache[key] = value
if value is not None: if value is not None:
new_base_cat_list.append(base_cat) new_base_cat_list.append(base_cat)
...@@ -1191,9 +1204,12 @@ def setDefaultProperties(property_holder, object=None, portal=None): ...@@ -1191,9 +1204,12 @@ def setDefaultProperties(property_holder, object=None, portal=None):
# Copy the dict so that Expression objects are not overwritten. # Copy the dict so that Expression objects are not overwritten.
prop_list.append(prop.copy()) prop_list.append(prop.copy())
cat_list = [] cat_list = []
cat_list += property_holder.__dict__.get('_categories',[]) # Do not consider superclass _categories definition cat_list += property_holder.__dict__.get('_categories',[]) # Do not consider
constraint_list = [] # a list of declarative consistency definitions (ie. constraints) superclass _categories definition
constraint_list += property_holder.__dict__.get('_constraints',[]) # Do not consider superclass _constraints definition constraint_list = [] # a list of declarative consistency definitions (ie.
constraints)
constraint_list += property_holder.__dict__.get('_constraints',[]) # Do not
consider superclass _constraints definition
for base in property_holder.property_sheets: for base in property_holder.property_sheets:
for prop in base._properties: for prop in base._properties:
# Copy the dict so that Expression objects are not overwritten. # Copy the dict so that Expression objects are not overwritten.
...@@ -1431,11 +1447,13 @@ def setDefaultProperties(property_holder, object=None, portal=None): ...@@ -1431,11 +1447,13 @@ def setDefaultProperties(property_holder, object=None, portal=None):
for prop in converted_prop_list: for prop in converted_prop_list:
if prop['type'] in legalTypes: if prop['type'] in legalTypes:
#if not hasattr(property_holder, prop['id']): #if not hasattr(property_holder, prop['id']):
# setattr(property_holder, prop['id'], None) # This makes sure no acquisition will happen # setattr(property_holder, prop['id'], None) # This makes sure no
acquisition will happen
# but is wrong when we use storage_id ..... # but is wrong when we use storage_id .....
storage_id = prop.get('storage_id', prop['id']) storage_id = prop.get('storage_id', prop['id'])
#if not hasattr(BaseClass, storage_id): #if not hasattr(BaseClass, storage_id):
# setattr(property_holder, storage_id, None) # This breaks things with aq_dynamic # setattr(property_holder, storage_id, None) # This breaks things with
aq_dynamic
#setattr(BaseClass, storage_id, None) # This blocks acquisition #setattr(BaseClass, storage_id, None) # This blocks acquisition
#else: #else:
#LOG('existing property',0,str(storage_id)) #LOG('existing property',0,str(storage_id))
...@@ -1507,62 +1525,76 @@ def createDefaultAccessors(property_holder, id, prop = None, ...@@ -1507,62 +1525,76 @@ def createDefaultAccessors(property_holder, id, prop = None,
# Base Getter # Base Getter
accessor_name = 'get' + UpperCase(id) accessor_name = 'get' + UpperCase(id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Acquired.DefaultGetter, accessor_args) property_holder.registerAccessor(accessor_name, id,
Acquired.DefaultGetter, accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGet' + UpperCase(id) accessor_name = '_baseGet' + UpperCase(id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Acquired.DefaultGetter, accessor_args) property_holder.registerAccessor(accessor_name, id,
Acquired.DefaultGetter, accessor_args)
# Default Getter # Default Getter
accessor_name = 'getDefault' + UpperCase(id) accessor_name = 'getDefault' + UpperCase(id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Acquired.DefaultGetter, accessor_args) property_holder.registerAccessor(accessor_name, id,
Acquired.DefaultGetter, accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGetDefault' + UpperCase(id) accessor_name = '_baseGetDefault' + UpperCase(id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Acquired.DefaultGetter, accessor_args) property_holder.registerAccessor(accessor_name, id,
Acquired.DefaultGetter, accessor_args)
# List Getter # List Getter
if prop['type'] in list_types or prop.get('multivalued', 0): if prop['type'] in list_types or prop.get('multivalued', 0):
accessor_name = 'get' + UpperCase(id) + 'List' accessor_name = 'get' + UpperCase(id) + 'List'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Acquired.ListGetter, accessor_args) property_holder.registerAccessor(accessor_name, id, Acquired.ListGetter,
accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGet' + UpperCase(id) + 'List' accessor_name = '_baseGet' + UpperCase(id) + 'List'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Acquired.ListGetter, accessor_args) property_holder.registerAccessor(accessor_name, id, Acquired.ListGetter,
accessor_args)
# Set Getter # Set Getter
accessor_name = 'get' + UpperCase(id) + 'Set' accessor_name = 'get' + UpperCase(id) + 'Set'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Acquired.SetGetter, accessor_args) property_holder.registerAccessor(accessor_name, id, Acquired.SetGetter,
accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGet' + UpperCase(id) + 'Set' accessor_name = '_baseGet' + UpperCase(id) + 'Set'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Acquired.SetGetter, accessor_args) property_holder.registerAccessor(accessor_name, id, Acquired.SetGetter,
accessor_args)
if prop['type'] == 'content': if prop['type'] == 'content':
#LOG('Value Object Accessor', 0, prop['id']) #LOG('Value Object Accessor', 0, prop['id'])
# Base Getter # Base Getter
accessor_name = 'get' + UpperCase(id) + 'Value' accessor_name = 'get' + UpperCase(id) + 'Value'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Acquired.DefaultGetter, accessor_args) property_holder.registerAccessor(accessor_name, id,
Acquired.DefaultGetter, accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGet' + UpperCase(id) + 'Value' accessor_name = '_baseGet' + UpperCase(id) + 'Value'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Acquired.DefaultGetter, accessor_args) property_holder.registerAccessor(accessor_name, id,
Acquired.DefaultGetter, accessor_args)
# Default Getter # Default Getter
accessor_name = 'getDefault' + UpperCase(id) + 'Value' accessor_name = 'getDefault' + UpperCase(id) + 'Value'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Acquired.DefaultGetter, accessor_args) property_holder.registerAccessor(accessor_name, id,
Acquired.DefaultGetter, accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGetDefault' + UpperCase(id) + 'Value' accessor_name = '_baseGetDefault' + UpperCase(id) + 'Value'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Acquired.DefaultGetter, accessor_args) property_holder.registerAccessor(accessor_name, id,
Acquired.DefaultGetter, accessor_args)
# List Getter # List Getter
accessor_name = 'get' + UpperCase(id) + 'ValueList' accessor_name = 'get' + UpperCase(id) + 'ValueList'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Acquired.ListGetter, accessor_args) property_holder.registerAccessor(accessor_name, id, Acquired.ListGetter,
accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGet' + UpperCase(id) + 'ValueList' accessor_name = '_baseGet' + UpperCase(id) + 'ValueList'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Acquired.ListGetter, accessor_args) property_holder.registerAccessor(accessor_name, id, Acquired.ListGetter,
accessor_args)
# AcquiredProperty Getters # AcquiredProperty Getters
if prop.has_key('acquired_property_id'): if prop.has_key('acquired_property_id'):
for aq_id in prop['acquired_property_id']: for aq_id in prop['acquired_property_id']:
...@@ -1587,44 +1619,64 @@ def createDefaultAccessors(property_holder, id, prop = None, ...@@ -1587,44 +1619,64 @@ def createDefaultAccessors(property_holder, id, prop = None,
(prop['type'] in list_types or prop.get('multivalued', 0)), (prop['type'] in list_types or prop.get('multivalued', 0)),
(prop['type'] == 'tales') (prop['type'] == 'tales')
) )
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or
property_holder.registerAccessor(accessor_name, composed_id, AcquiredProperty.Getter, accessor_args) prop.get('override',0):
property_holder.registerAccessor(accessor_name, composed_id,
AcquiredProperty.Getter, accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGet' + UpperCase(composed_id) accessor_name = '_baseGet' + UpperCase(composed_id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or
property_holder.registerAccessor(accessor_name, composed_id, AcquiredProperty.Getter, accessor_args) prop.get('override',0):
property_holder.registerAccessor(accessor_name, composed_id,
AcquiredProperty.Getter, accessor_args)
# Default Getter # Default Getter
accessor_name = 'getDefault' + UpperCase(composed_id) accessor_name = 'getDefault' + UpperCase(composed_id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or
property_holder.registerAccessor(accessor_name, composed_id, AcquiredProperty.DefaultGetter, accessor_args) prop.get('override',0):
property_holder.registerAccessor(accessor_name, composed_id,
AcquiredProperty.DefaultGetter, accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGetDefault' + UpperCase(composed_id) accessor_name = '_baseGetDefault' + UpperCase(composed_id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or
property_holder.registerAccessor(accessor_name, composed_id, AcquiredProperty.DefaultGetter, accessor_args) prop.get('override',0):
property_holder.registerAccessor(accessor_name, composed_id,
AcquiredProperty.DefaultGetter, accessor_args)
# List Getter # List Getter
################# NOT YET ################# NOT YET
# Setter # Setter
accessor_name = 'set' + UpperCase(composed_id) accessor_name = 'set' + UpperCase(composed_id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or
property_holder.registerAccessor(accessor_name, '_' + accessor_name, Alias.Reindex, ()) prop.get('override',0):
property_holder.registerAccessor(accessor_name, '_' + accessor_name,
Alias.Reindex, ())
property_holder.declareProtected( write_permission, accessor_name ) property_holder.declareProtected( write_permission, accessor_name )
accessor_name = '_set' + UpperCase(composed_id) accessor_name = '_set' + UpperCase(composed_id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or
property_holder.registerAccessor(accessor_name, composed_id, AcquiredProperty.Setter, accessor_args) prop.get('override',0):
property_holder.registerAccessor(accessor_name, composed_id,
AcquiredProperty.Setter, accessor_args)
accessor_name = '_baseSet' + UpperCase(composed_id) accessor_name = '_baseSet' + UpperCase(composed_id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or
property_holder.registerAccessor(accessor_name, composed_id, AcquiredProperty.Setter, accessor_args) prop.get('override',0):
property_holder.registerAccessor(accessor_name, composed_id,
AcquiredProperty.Setter, accessor_args)
# Default Setter # Default Setter
accessor_name = 'setDefault' + UpperCase(composed_id) accessor_name = 'setDefault' + UpperCase(composed_id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or
property_holder.registerAccessor(accessor_name, '_' + accessor_name, Alias.Reindex, ()) prop.get('override',0):
property_holder.registerAccessor(accessor_name, '_' + accessor_name,
Alias.Reindex, ())
property_holder.declareProtected( write_permission, accessor_name ) property_holder.declareProtected( write_permission, accessor_name )
accessor_name = '_setDefault' + UpperCase(composed_id) accessor_name = '_setDefault' + UpperCase(composed_id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or
property_holder.registerAccessor(accessor_name, composed_id, AcquiredProperty.DefaultSetter, accessor_args) prop.get('override',0):
property_holder.registerAccessor(accessor_name, composed_id,
AcquiredProperty.DefaultSetter, accessor_args)
accessor_name = '_baseSetDefault' + UpperCase(composed_id) accessor_name = '_baseSetDefault' + UpperCase(composed_id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or
property_holder.registerAccessor(accessor_name, composed_id, AcquiredProperty.DefaultSetter, accessor_args) prop.get('override',0):
property_holder.registerAccessor(accessor_name, composed_id,
AcquiredProperty.DefaultSetter, accessor_args)
# List Getter # List Getter
################# NOT YET ################# NOT YET
...@@ -1637,110 +1689,148 @@ def createDefaultAccessors(property_holder, id, prop = None, ...@@ -1637,110 +1689,148 @@ def createDefaultAccessors(property_holder, id, prop = None,
# Create getters for a list property # Create getters for a list property
accessor_name = 'get' + UpperCase(id) accessor_name = 'get' + UpperCase(id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, List.Getter, accessor_args) property_holder.registerAccessor(accessor_name, id, List.Getter,
accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGet' + UpperCase(id) accessor_name = '_baseGet' + UpperCase(id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, List.Getter, accessor_args) property_holder.registerAccessor(accessor_name, id, List.Getter,
accessor_args)
accessor_name = 'getDefault' + UpperCase(id) accessor_name = 'getDefault' + UpperCase(id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, List.DefaultGetter, accessor_args) property_holder.registerAccessor(accessor_name, id, List.DefaultGetter,
accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGetDefault' + UpperCase(id) accessor_name = '_baseGetDefault' + UpperCase(id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, List.DefaultGetter, accessor_args) property_holder.registerAccessor(accessor_name, id, List.DefaultGetter,
accessor_args)
accessor_name = 'get' + UpperCase(id) + 'List' accessor_name = 'get' + UpperCase(id) + 'List'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, List.ListGetter, accessor_args) property_holder.registerAccessor(accessor_name, id, List.ListGetter,
accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGet' + UpperCase(id) + 'List' accessor_name = '_baseGet' + UpperCase(id) + 'List'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, List.ListGetter, accessor_args) property_holder.registerAccessor(accessor_name, id, List.ListGetter,
accessor_args)
accessor_name = 'get' + UpperCase(id) + 'Set' accessor_name = 'get' + UpperCase(id) + 'Set'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, List.SetGetter, accessor_args) property_holder.registerAccessor(accessor_name, id, List.SetGetter,
accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGet' + UpperCase(id) + 'Set' accessor_name = '_baseGet' + UpperCase(id) + 'Set'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, List.SetGetter, accessor_args) property_holder.registerAccessor(accessor_name, id, List.SetGetter,
accessor_args)
elif prop['type'] == 'content': elif prop['type'] == 'content':
accessor_args = (prop['type'], prop.get('portal_type'), prop.get('storage_id')) accessor_args = (prop['type'], prop.get('portal_type'),
prop.get('storage_id'))
# Create getters for a list property # Create getters for a list property
accessor_name = 'get' + UpperCase(id) accessor_name = 'get' + UpperCase(id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Content.Getter, accessor_args) property_holder.registerAccessor(accessor_name, id, Content.Getter,
accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGet' + UpperCase(id) accessor_name = '_baseGet' + UpperCase(id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Content.Getter, accessor_args) property_holder.registerAccessor(accessor_name, id, Content.Getter,
accessor_args)
accessor_name = 'getDefault' + UpperCase(id) accessor_name = 'getDefault' + UpperCase(id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Content.DefaultGetter, accessor_args) property_holder.registerAccessor(accessor_name, id, Content.DefaultGetter,
accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGetDefault' + UpperCase(id) accessor_name = '_baseGetDefault' + UpperCase(id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Content.DefaultGetter, accessor_args) property_holder.registerAccessor(accessor_name, id, Content.DefaultGetter,
accessor_args)
accessor_name = 'get' + UpperCase(id) + 'List' accessor_name = 'get' + UpperCase(id) + 'List'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Content.ListGetter, accessor_args) property_holder.registerAccessor(accessor_name, id, Content.ListGetter,
accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGet' + UpperCase(id) + 'List' accessor_name = '_baseGet' + UpperCase(id) + 'List'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Content.ListGetter, accessor_args) property_holder.registerAccessor(accessor_name, id, Content.ListGetter,
accessor_args)
# Create value getters for a list property # Create value getters for a list property
accessor_name = 'get' + UpperCase(id) + 'Value' accessor_name = 'get' + UpperCase(id) + 'Value'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Content.ValueGetter, accessor_args) property_holder.registerAccessor(accessor_name, id, Content.ValueGetter,
accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGet' + UpperCase(id) + 'Value' accessor_name = '_baseGet' + UpperCase(id) + 'Value'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Content.ValueGetter, accessor_args) property_holder.registerAccessor(accessor_name, id, Content.ValueGetter,
accessor_args)
accessor_name = 'getDefault' + UpperCase(id) + 'Value' accessor_name = 'getDefault' + UpperCase(id) + 'Value'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Content.DefaultValueGetter, accessor_args) property_holder.registerAccessor(accessor_name, id,
Content.DefaultValueGetter, accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGetDefault' + UpperCase(id) + 'Value' accessor_name = '_baseGetDefault' + UpperCase(id) + 'Value'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Content.DefaultValueGetter, accessor_args) property_holder.registerAccessor(accessor_name, id,
Content.DefaultValueGetter, accessor_args)
accessor_name = 'get' + UpperCase(id) + 'ValueList' accessor_name = 'get' + UpperCase(id) + 'ValueList'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Content.ValueListGetter, accessor_args) property_holder.registerAccessor(accessor_name, id,
Content.ValueListGetter, accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGet' + UpperCase(id) + 'ValueList' accessor_name = '_baseGet' + UpperCase(id) + 'ValueList'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Content.ValueListGetter, accessor_args) property_holder.registerAccessor(accessor_name, id,
Content.ValueListGetter, accessor_args)
if prop.has_key('acquired_property_id'): if prop.has_key('acquired_property_id'):
for aq_id in prop['acquired_property_id']: for aq_id in prop['acquired_property_id']:
for composed_id in ("%s_%s" % (id, aq_id), "default_%s_%s" % (id, aq_id)) : for composed_id in ("%s_%s" % (id, aq_id), "default_%s_%s" % (id,
aq_id)) :
accessor_name = 'get' + UpperCase(composed_id) accessor_name = 'get' + UpperCase(composed_id)
accessor_args = (prop['type'], aq_id, prop.get('portal_type'), prop.get('storage_id')) accessor_args = (prop['type'], aq_id, prop.get('portal_type'),
if not hasattr(property_holder, accessor_name) or prop.get('override',0): prop.get('storage_id'))
property_holder.registerAccessor(accessor_name, composed_id, ContentProperty.Getter, accessor_args) if not hasattr(property_holder, accessor_name) or
prop.get('override',0):
property_holder.registerAccessor(accessor_name, composed_id,
ContentProperty.Getter, accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = 'get' + UpperCase(composed_id) + 'List' accessor_name = 'get' + UpperCase(composed_id) + 'List'
list_accessor_args = (prop['type'], aq_id + '_list', prop.get('portal_type'), prop.get('storage_id')) list_accessor_args = (prop['type'], aq_id + '_list',
if not hasattr(property_holder, accessor_name) or prop.get('override',0): prop.get('portal_type'), prop.get('storage_id'))
property_holder.registerAccessor(accessor_name, composed_id + '_list', if not hasattr(property_holder, accessor_name) or
ContentProperty.Getter, list_accessor_args) prop.get('override',0):
property_holder.registerAccessor(accessor_name, composed_id +
'_list',
ContentProperty.Getter,
list_accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
# No default getter YET XXXXXXXXXXXXXX # No default getter YET XXXXXXXXXXXXXX
# No list getter YET XXXXXXXXXXXXXX # No list getter YET XXXXXXXXXXXXXX
accessor_name = '_set' + UpperCase(composed_id) accessor_name = '_set' + UpperCase(composed_id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or
property_holder.registerAccessor(accessor_name, composed_id, ContentProperty.Setter, accessor_args) prop.get('override',0):
property_holder.registerAccessor(accessor_name, composed_id,
ContentProperty.Setter, accessor_args)
property_holder.declareProtected( write_permission, accessor_name ) property_holder.declareProtected( write_permission, accessor_name )
accessor_name = '_set' + UpperCase(composed_id) + 'List' accessor_name = '_set' + UpperCase(composed_id) + 'List'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or
property_holder.registerAccessor(accessor_name, composed_id + '_list', prop.get('override',0):
ContentProperty.Setter, list_accessor_args) property_holder.registerAccessor(accessor_name, composed_id +
'_list',
ContentProperty.Setter,
list_accessor_args)
property_holder.declareProtected( write_permission, accessor_name ) property_holder.declareProtected( write_permission, accessor_name )
accessor_name = 'set' + UpperCase(composed_id) accessor_name = 'set' + UpperCase(composed_id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or
property_holder.registerAccessor(accessor_name, '_' + accessor_name, Alias.Reindex, ()) prop.get('override',0):
property_holder.registerAccessor(accessor_name, '_' + accessor_name,
Alias.Reindex, ())
property_holder.declareProtected( write_permission, accessor_name ) property_holder.declareProtected( write_permission, accessor_name )
accessor_name = 'set' + UpperCase(composed_id) + 'List' accessor_name = 'set' + UpperCase(composed_id) + 'List'
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or
property_holder.registerAccessor(accessor_name, '_' + accessor_name, Alias.Reindex, ()) prop.get('override',0):
property_holder.registerAccessor(accessor_name, '_' + accessor_name,
Alias.Reindex, ())
property_holder.declareProtected( write_permission, accessor_name ) property_holder.declareProtected( write_permission, accessor_name )
# No default getter YET XXXXXXXXXXXXXX # No default getter YET XXXXXXXXXXXXXX
# No list getter YET XXXXXXXXXXXXXX # No list getter YET XXXXXXXXXXXXXX
...@@ -1749,30 +1839,36 @@ def createDefaultAccessors(property_holder, id, prop = None, ...@@ -1749,30 +1839,36 @@ def createDefaultAccessors(property_holder, id, prop = None,
# Create getters for a simple property # Create getters for a simple property
accessor_name = 'get' + UpperCase(id) accessor_name = 'get' + UpperCase(id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Base.Getter, accessor_args) property_holder.registerAccessor(accessor_name, id, Base.Getter,
accessor_args)
property_holder.declareProtected( read_permission, accessor_name ) property_holder.declareProtected( read_permission, accessor_name )
accessor_name = '_baseGet' + UpperCase(id) accessor_name = '_baseGet' + UpperCase(id)
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
property_holder.registerAccessor(accessor_name, id, Base.Getter, accessor_args) property_holder.registerAccessor(accessor_name, id, Base.Getter,
accessor_args)
###################################################### ######################################################
# Create Setters # Create Setters
if prop['type'] in list_types or prop.get('multivalued', 0): if prop['type'] in list_types or prop.get('multivalued', 0):
# Create setters for a list property by aliasing # Create setters for a list property by aliasing
setter_name = 'set' + UpperCase(id) setter_name = 'set' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
setter_name = 'setDefault' + UpperCase(id) setter_name = 'setDefault' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
setter_name = 'set' + UpperCase(id) + 'List' setter_name = 'set' + UpperCase(id) + 'List'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
setter_name = 'set' + UpperCase(id) + 'Set' setter_name = 'set' + UpperCase(id) + 'Set'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
# Create setters for a list property (no reindexing) # Create setters for a list property (no reindexing)
# The base accessor sets the list to a singleton # The base accessor sets the list to a singleton
...@@ -1781,52 +1877,65 @@ def createDefaultAccessors(property_holder, id, prop = None, ...@@ -1781,52 +1877,65 @@ def createDefaultAccessors(property_holder, id, prop = None,
# Create setters for a list property # Create setters for a list property
setter_name = '_set' + UpperCase(id) setter_name = '_set' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, List.Setter, accessor_args) property_holder.registerAccessor(setter_name, id, List.Setter,
accessor_args)
setter_name = '_baseSet' + UpperCase(id) setter_name = '_baseSet' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, List.Setter, accessor_args) property_holder.registerAccessor(setter_name, id, List.Setter,
accessor_args)
setter_name = '_setDefault' + UpperCase(id) setter_name = '_setDefault' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, List.DefaultSetter, accessor_args) property_holder.registerAccessor(setter_name, id, List.DefaultSetter,
accessor_args)
setter_name = '_baseSetDefault' + UpperCase(id) setter_name = '_baseSetDefault' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, List.DefaultSetter, accessor_args) property_holder.registerAccessor(setter_name, id, List.DefaultSetter,
accessor_args)
setter_name = '_set' + UpperCase(id) + 'List' setter_name = '_set' + UpperCase(id) + 'List'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, List.ListSetter, accessor_args) property_holder.registerAccessor(setter_name, id, List.ListSetter,
accessor_args)
setter_name = '_baseSet' + UpperCase(id) + 'List' setter_name = '_baseSet' + UpperCase(id) + 'List'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, List.ListSetter, accessor_args) property_holder.registerAccessor(setter_name, id, List.ListSetter,
accessor_args)
setter_name = '_set' + UpperCase(id) + 'Set' setter_name = '_set' + UpperCase(id) + 'Set'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, List.SetSetter, accessor_args) property_holder.registerAccessor(setter_name, id, List.SetSetter,
accessor_args)
setter_name = '_baseSet' + UpperCase(id) + 'Set' setter_name = '_baseSet' + UpperCase(id) + 'Set'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, List.SetSetter, accessor_args) property_holder.registerAccessor(setter_name, id, List.SetSetter,
accessor_args)
elif prop['type'] == 'content': elif prop['type'] == 'content':
# Create setters for an object property # Create setters for an object property
# Create setters for a list property (reindexing) # Create setters for a list property (reindexing)
# The base accessor sets the list to a singleton # The base accessor sets the list to a singleton
# and allows simulates a simple property # and allows simulates a simple property
base_setter_name = 'set' + UpperCase(id) base_setter_name = 'set' + UpperCase(id)
# The default setter sets the first item of a list without changing other items # The default setter sets the first item of a list without changing other
items
default_setter_name = 'setDefault' + UpperCase(id) default_setter_name = 'setDefault' + UpperCase(id)
# Create setters for an object property # Create setters for an object property
setter_name = 'set' + UpperCase(id) setter_name = 'set' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + base_setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + base_setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
setter_name = 'setDefault' + UpperCase(id) setter_name = 'setDefault' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + default_setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + default_setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
setter_name = 'set' + UpperCase(id) + 'Value' setter_name = 'set' + UpperCase(id) + 'Value'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + base_setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + base_setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
setter_name = 'setDefault' + UpperCase(id) + 'Value' setter_name = 'setDefault' + UpperCase(id) + 'Value'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + default_setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + default_setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
# Create setters for a list property (no reindexing) # Create setters for a list property (no reindexing)
# The base accessor sets the list to a singleton # The base accessor sets the list to a singleton
...@@ -1835,41 +1944,52 @@ def createDefaultAccessors(property_holder, id, prop = None, ...@@ -1835,41 +1944,52 @@ def createDefaultAccessors(property_holder, id, prop = None,
# Create setters for an object property # Create setters for an object property
setter_name = '_set' + UpperCase(id) setter_name = '_set' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Content.Setter, accessor_args) property_holder.registerAccessor(setter_name, id, Content.Setter,
accessor_args)
setter_name = '_baseSet' + UpperCase(id) setter_name = '_baseSet' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Content.Setter, accessor_args) property_holder.registerAccessor(setter_name, id, Content.Setter,
accessor_args)
setter_name = '_setDefault' + UpperCase(id) setter_name = '_setDefault' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Content.DefaultSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Content.DefaultSetter,
accessor_args)
setter_name = '_baseSetDefault' + UpperCase(id) setter_name = '_baseSetDefault' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Content.DefaultSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Content.DefaultSetter,
accessor_args)
setter_name = '_set' + UpperCase(id) + 'Value' setter_name = '_set' + UpperCase(id) + 'Value'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Content.Setter, accessor_args) property_holder.registerAccessor(setter_name, id, Content.Setter,
accessor_args)
setter_name = '_baseSet' + UpperCase(id) + 'Value' setter_name = '_baseSet' + UpperCase(id) + 'Value'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Content.Setter, accessor_args) property_holder.registerAccessor(setter_name, id, Content.Setter,
accessor_args)
setter_name = '_setDefault' + UpperCase(id) + 'Value' setter_name = '_setDefault' + UpperCase(id) + 'Value'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Content.DefaultSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Content.DefaultSetter,
accessor_args)
setter_name = '_baseSetDefault' + UpperCase(id) + 'Value' setter_name = '_baseSetDefault' + UpperCase(id) + 'Value'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Content.DefaultSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Content.DefaultSetter,
accessor_args)
else: else:
accessor_args = (prop['type'], prop.get('storage_id'), 0) accessor_args = (prop['type'], prop.get('storage_id'), 0)
# Create setters for a simple property # Create setters for a simple property
setter_name = 'set' + UpperCase(id) setter_name = 'set' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
setter_name = '_set' + UpperCase(id) setter_name = '_set' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Base.Setter, accessor_args) property_holder.registerAccessor(setter_name, id, Base.Setter,
accessor_args)
setter_name = '_baseSet' + UpperCase(id) setter_name = '_baseSet' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Base.Setter, accessor_args) property_holder.registerAccessor(setter_name, id, Base.Setter,
accessor_args)
###################################################### ######################################################
# Create testers # Create testers
if prop['type'] == 'content': if prop['type'] == 'content':
...@@ -1877,7 +1997,8 @@ def createDefaultAccessors(property_holder, id, prop = None, ...@@ -1877,7 +1997,8 @@ def createDefaultAccessors(property_holder, id, prop = None,
# should be created upfront rather than on demand # should be created upfront rather than on demand
tester_name = 'has' + UpperCase(id) tester_name = 'has' + UpperCase(id)
tester = Content.Tester(tester_name, id, prop['type'], tester = Content.Tester(tester_name, id, prop['type'],
storage_id = prop.get('storage_id')) storage_id =
prop.get('storage_id'))
if not hasattr(BaseClass, tester_name): if not hasattr(BaseClass, tester_name):
setattr(BaseClass, tester_name, tester) setattr(BaseClass, tester_name, tester)
BaseClass.security.declareProtected(read_permission, tester_name) BaseClass.security.declareProtected(read_permission, tester_name)
...@@ -1887,7 +2008,8 @@ def createDefaultAccessors(property_holder, id, prop = None, ...@@ -1887,7 +2008,8 @@ def createDefaultAccessors(property_holder, id, prop = None,
else: else:
tester_name = 'has' + UpperCase(id) tester_name = 'has' + UpperCase(id)
tester = Base.Tester(tester_name, id, prop['type'], tester = Base.Tester(tester_name, id, prop['type'],
storage_id = prop.get('storage_id')) storage_id =
prop.get('storage_id'))
if not hasattr(BaseClass, tester_name): if not hasattr(BaseClass, tester_name):
setattr(BaseClass, tester_name, tester) setattr(BaseClass, tester_name, tester)
BaseClass.security.declareProtected(read_permission, tester_name) BaseClass.security.declareProtected(read_permission, tester_name)
...@@ -1915,12 +2037,14 @@ def createDefaultAccessors(property_holder, id, prop = None, ...@@ -1915,12 +2037,14 @@ def createDefaultAccessors(property_holder, id, prop = None,
tester_name = 'is' + UpperCase(id) tester_name = 'is' + UpperCase(id)
if not hasattr(property_holder, tester_name): if not hasattr(property_holder, tester_name):
property_holder.registerAccessor(tester_name, id, Base.Getter, property_holder.registerAccessor(tester_name, id, Base.Getter,
(prop['type'], prop.get('default'), prop.get('storage_id'))) (prop['type'], prop.get('default'),
prop.get('storage_id')))
property_holder.declareProtected(read_permission, tester_name) property_holder.declareProtected(read_permission, tester_name)
tester_name = '_baseIs' + UpperCase(id) tester_name = '_baseIs' + UpperCase(id)
if not hasattr(property_holder, tester_name): if not hasattr(property_holder, tester_name):
property_holder.registerAccessor(tester_name, id, Base.Getter, property_holder.registerAccessor(tester_name, id, Base.Getter,
(prop['type'], prop.get('default'), prop.get('storage_id'))) (prop['type'], prop.get('default'),
prop.get('storage_id')))
from Accessor import Category from Accessor import Category
...@@ -1949,24 +2073,29 @@ def createCategoryAccessors(property_holder, id, ...@@ -1949,24 +2073,29 @@ def createCategoryAccessors(property_holder, id,
accessor_name = 'get' + UpperCase(id) + 'ItemList' accessor_name = 'get' + UpperCase(id) + 'ItemList'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Category.ItemListGetter, ()) property_holder.registerAccessor(accessor_name, id, Category.ItemListGetter,
())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = 'getDefault' + UpperCase(id) accessor_name = 'getDefault' + UpperCase(id)
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Category.DefaultGetter, ()) property_holder.registerAccessor(accessor_name, id, Category.DefaultGetter,
())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGetDefault' + UpperCase(id) accessor_name = '_categoryGetDefault' + UpperCase(id)
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Category.DefaultGetter, ()) property_holder.registerAccessor(accessor_name, id, Category.DefaultGetter,
())
accessor_name = 'get' + UpperCase(id) accessor_name = 'get' + UpperCase(id)
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Category.DefaultGetter, ()) property_holder.registerAccessor(accessor_name, id, Category.DefaultGetter,
())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGet' + UpperCase(id) accessor_name = '_categoryGet' + UpperCase(id)
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Category.DefaultGetter, ()) property_holder.registerAccessor(accessor_name, id, Category.DefaultGetter,
())
accessor_name = 'has' + UpperCase(id) accessor_name = 'has' + UpperCase(id)
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
...@@ -1975,52 +2104,64 @@ def createCategoryAccessors(property_holder, id, ...@@ -1975,52 +2104,64 @@ def createCategoryAccessors(property_holder, id,
setter_name = 'set' + UpperCase(id) setter_name = 'set' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
setter_name = 'set' + UpperCase(id) + 'List' setter_name = 'set' + UpperCase(id) + 'List'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
setter_name = 'setDefault' + UpperCase(id) setter_name = 'setDefault' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
setter_name = 'set' + UpperCase(id) + 'Set' setter_name = 'set' + UpperCase(id) + 'Set'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
accessor_args = (0,) accessor_args = (0,)
setter_name = '_set' + UpperCase(id) setter_name = '_set' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Category.Setter, accessor_args) property_holder.registerAccessor(setter_name, id, Category.Setter,
accessor_args)
setter_name = '_categorySet' + UpperCase(id) setter_name = '_categorySet' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Category.Setter, accessor_args) property_holder.registerAccessor(setter_name, id, Category.Setter,
accessor_args)
setter_name = '_set' + UpperCase(id) + 'List' setter_name = '_set' + UpperCase(id) + 'List'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Category.ListSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Category.ListSetter,
accessor_args)
setter_name = '_categorySet' + UpperCase(id) + 'List' setter_name = '_categorySet' + UpperCase(id) + 'List'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Category.ListSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Category.ListSetter,
accessor_args)
setter_name = '_set' + UpperCase(id) + 'Set' setter_name = '_set' + UpperCase(id) + 'Set'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Category.SetSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Category.SetSetter,
accessor_args)
setter_name = '_categorySet' + UpperCase(id) + 'Set' setter_name = '_categorySet' + UpperCase(id) + 'Set'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Category.SetSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Category.SetSetter,
accessor_args)
setter_name = '_setDefault' + UpperCase(id) setter_name = '_setDefault' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Category.DefaultSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Category.DefaultSetter,
accessor_args)
setter_name = '_categorySetDefault' + UpperCase(id) setter_name = '_categorySetDefault' + UpperCase(id)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Category.DefaultSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Category.DefaultSetter,
accessor_args)
from Accessor import Value, Related, RelatedValue, Translation from Accessor import Value, Related, RelatedValue, Translation
...@@ -2057,51 +2198,63 @@ def createValueAccessors(property_holder, id, ...@@ -2057,51 +2198,63 @@ def createValueAccessors(property_holder, id,
accessor_name = 'get' + UpperCase(id) + 'TitleList' accessor_name = 'get' + UpperCase(id) + 'TitleList'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.TitleListGetter, ()) property_holder.registerAccessor(accessor_name, id, Value.TitleListGetter,
())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGet' + UpperCase(id) + 'TitleList' accessor_name = '_categoryGet' + UpperCase(id) + 'TitleList'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.TitleListGetter, ()) property_holder.registerAccessor(accessor_name, id, Value.TitleListGetter,
())
accessor_name = 'get' + UpperCase(id) + 'TitleSet' accessor_name = 'get' + UpperCase(id) + 'TitleSet'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.TitleSetGetter, ()) property_holder.registerAccessor(accessor_name, id, Value.TitleSetGetter,
())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGet' + UpperCase(id) + 'TitleSet' accessor_name = '_categoryGet' + UpperCase(id) + 'TitleSet'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.TitleSetGetter, ()) property_holder.registerAccessor(accessor_name, id, Value.TitleSetGetter,
())
accessor_name = 'get' + UpperCase(id) + 'TranslatedTitleList' accessor_name = 'get' + UpperCase(id) + 'TranslatedTitleList'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.TranslatedTitleListGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.TranslatedTitleListGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGet' + UpperCase(id) + 'TranslatedTitleList' accessor_name = '_categoryGet' + UpperCase(id) + 'TranslatedTitleList'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.TranslatedTitleListGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.TranslatedTitleListGetter, ())
accessor_name = 'get' + UpperCase(id) + 'TranslatedTitleSet' accessor_name = 'get' + UpperCase(id) + 'TranslatedTitleSet'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.TranslatedTitleSetGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.TranslatedTitleSetGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGet' + UpperCase(id) + 'TranslatedTitleSet' accessor_name = '_categoryGet' + UpperCase(id) + 'TranslatedTitleSet'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.TranslatedTitleSetGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.TranslatedTitleSetGetter, ())
accessor_name = 'get' + UpperCase(id) + 'ReferenceList' accessor_name = 'get' + UpperCase(id) + 'ReferenceList'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.ReferenceListGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.ReferenceListGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGet' + UpperCase(id) + 'ReferenceList' accessor_name = '_categoryGet' + UpperCase(id) + 'ReferenceList'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.ReferenceListGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.ReferenceListGetter, ())
accessor_name = 'get' + UpperCase(id) + 'ReferenceSet' accessor_name = 'get' + UpperCase(id) + 'ReferenceSet'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.ReferenceSetGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.ReferenceSetGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGet' + UpperCase(id) + 'ReferenceSet' accessor_name = '_categoryGet' + UpperCase(id) + 'ReferenceSet'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.ReferenceSetGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.ReferenceSetGetter, ())
accessor_name = 'get' + UpperCase(id) + 'IdList' accessor_name = 'get' + UpperCase(id) + 'IdList'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
...@@ -2126,19 +2279,23 @@ def createValueAccessors(property_holder, id, ...@@ -2126,19 +2279,23 @@ def createValueAccessors(property_holder, id,
accessor_name = 'get' + UpperCase(id) + 'LogicalPathList' accessor_name = 'get' + UpperCase(id) + 'LogicalPathList'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.LogicalPathListGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.LogicalPathListGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGet' + UpperCase(id) + 'LogicalPathList' accessor_name = '_categoryGet' + UpperCase(id) + 'LogicalPathList'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.LogicalPathListGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.LogicalPathListGetter, ())
accessor_name = 'get' + UpperCase(id) + 'LogicalPathSet' accessor_name = 'get' + UpperCase(id) + 'LogicalPathSet'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.LogicalPathSetGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.LogicalPathSetGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGet' + UpperCase(id) + 'LogicalPathSet' accessor_name = '_categoryGet' + UpperCase(id) + 'LogicalPathSet'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.LogicalPathSetGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.LogicalPathSetGetter, ())
accessor_name = 'get' + UpperCase(id) + 'UidList' accessor_name = 'get' + UpperCase(id) + 'UidList'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
...@@ -2158,19 +2315,23 @@ def createValueAccessors(property_holder, id, ...@@ -2158,19 +2315,23 @@ def createValueAccessors(property_holder, id,
accessor_name = 'get' + UpperCase(id) + 'PropertyList' accessor_name = 'get' + UpperCase(id) + 'PropertyList'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.PropertyListGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.PropertyListGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGet' + UpperCase(id) + 'PropertyList' accessor_name = '_categoryGet' + UpperCase(id) + 'PropertyList'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.PropertyListGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.PropertyListGetter, ())
accessor_name = 'get' + UpperCase(id) + 'PropertySet' accessor_name = 'get' + UpperCase(id) + 'PropertySet'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.PropertySetGetter, ()) property_holder.registerAccessor(accessor_name, id, Value.PropertySetGetter,
())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGet' + UpperCase(id) + 'PropertySet' accessor_name = '_categoryGet' + UpperCase(id) + 'PropertySet'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.PropertySetGetter, ()) property_holder.registerAccessor(accessor_name, id, Value.PropertySetGetter,
())
accessor_name = 'getDefault' + UpperCase(id) + 'Value' accessor_name = 'getDefault' + UpperCase(id) + 'Value'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
...@@ -2189,227 +2350,285 @@ def createValueAccessors(property_holder, id, ...@@ -2189,227 +2350,285 @@ def createValueAccessors(property_holder, id,
accessor_name = 'getDefault' + UpperCase(id) + 'Title' accessor_name = 'getDefault' + UpperCase(id) + 'Title'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultTitleGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultTitleGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = 'get' + UpperCase(id) + 'Title' accessor_name = 'get' + UpperCase(id) + 'Title'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultTitleGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultTitleGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGetDefault' + UpperCase(id) + 'Title' accessor_name = '_categoryGetDefault' + UpperCase(id) + 'Title'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultTitleGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultTitleGetter, ())
accessor_name = '_categoryGet' + UpperCase(id) + 'Title' accessor_name = '_categoryGet' + UpperCase(id) + 'Title'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultTitleGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultTitleGetter, ())
accessor_name = 'getDefault' + UpperCase(id) + 'TranslatedTitle' accessor_name = 'getDefault' + UpperCase(id) + 'TranslatedTitle'
accessor = Value.DefaultTranslatedTitleGetter(accessor_name, id) accessor = Value.DefaultTranslatedTitleGetter(accessor_name, id)
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultTranslatedTitleGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultTranslatedTitleGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = 'get' + UpperCase(id) + 'TranslatedTitle' accessor_name = 'get' + UpperCase(id) + 'TranslatedTitle'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultTranslatedTitleGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultTranslatedTitleGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGetDefault' + UpperCase(id) + 'TranslatedTitle' accessor_name = '_categoryGetDefault' + UpperCase(id) + 'TranslatedTitle'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultTranslatedTitleGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultTranslatedTitleGetter, ())
accessor_name = '_categoryGet' + UpperCase(id) + 'TranslatedTitle' accessor_name = '_categoryGet' + UpperCase(id) + 'TranslatedTitle'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultTranslatedTitleGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultTranslatedTitleGetter, ())
accessor_name = 'getDefault' + UpperCase(id) + 'Reference' accessor_name = 'getDefault' + UpperCase(id) + 'Reference'
accessor = Value.DefaultReferenceGetter(accessor_name, id) accessor = Value.DefaultReferenceGetter(accessor_name, id)
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultReferenceGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultReferenceGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = 'get' + UpperCase(id) + 'Reference' accessor_name = 'get' + UpperCase(id) + 'Reference'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultReferenceGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultReferenceGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGetDefault' + UpperCase(id) + 'Reference' accessor_name = '_categoryGetDefault' + UpperCase(id) + 'Reference'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultReferenceGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultReferenceGetter, ())
accessor_name = '_categoryGet' + UpperCase(id) + 'Reference' accessor_name = '_categoryGet' + UpperCase(id) + 'Reference'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultReferenceGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultReferenceGetter, ())
accessor_name = 'getDefault' + UpperCase(id) + 'Uid' accessor_name = 'getDefault' + UpperCase(id) + 'Uid'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultUidGetter, ()) property_holder.registerAccessor(accessor_name, id, Value.DefaultUidGetter,
())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = 'get' + UpperCase(id) + 'Uid' accessor_name = 'get' + UpperCase(id) + 'Uid'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultUidGetter, ()) property_holder.registerAccessor(accessor_name, id, Value.DefaultUidGetter,
())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGetDefault' + UpperCase(id) + 'Uid' accessor_name = '_categoryGetDefault' + UpperCase(id) + 'Uid'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultUidGetter, ()) property_holder.registerAccessor(accessor_name, id, Value.DefaultUidGetter,
())
accessor_name = '_categoryGet' + UpperCase(id) + 'Uid' accessor_name = '_categoryGet' + UpperCase(id) + 'Uid'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultUidGetter, ()) property_holder.registerAccessor(accessor_name, id, Value.DefaultUidGetter,
())
accessor_name = 'getDefault' + UpperCase(id) + 'Id' accessor_name = 'getDefault' + UpperCase(id) + 'Id'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultIdGetter, ()) property_holder.registerAccessor(accessor_name, id, Value.DefaultIdGetter,
())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = 'get' + UpperCase(id) + 'Id' accessor_name = 'get' + UpperCase(id) + 'Id'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultIdGetter, ()) property_holder.registerAccessor(accessor_name, id, Value.DefaultIdGetter,
())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGetDefault' + UpperCase(id) + 'Id' accessor_name = '_categoryGetDefault' + UpperCase(id) + 'Id'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultIdGetter, ()) property_holder.registerAccessor(accessor_name, id, Value.DefaultIdGetter,
())
accessor_name = '_categoryGet' + UpperCase(id) + 'Id' accessor_name = '_categoryGet' + UpperCase(id) + 'Id'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultIdGetter, ()) property_holder.registerAccessor(accessor_name, id, Value.DefaultIdGetter,
())
accessor_name = 'getDefault' + UpperCase(id) + 'TitleOrId' accessor_name = 'getDefault' + UpperCase(id) + 'TitleOrId'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultTitleOrIdGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultTitleOrIdGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = 'get' + UpperCase(id) + 'TitleOrId' accessor_name = 'get' + UpperCase(id) + 'TitleOrId'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultTitleOrIdGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultTitleOrIdGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGetDefault' + UpperCase(id) + 'TitleOrId' accessor_name = '_categoryGetDefault' + UpperCase(id) + 'TitleOrId'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultTitleOrIdGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultTitleOrIdGetter, ())
accessor_name = '_categoryGet' + UpperCase(id) + 'TitleOrId' accessor_name = '_categoryGet' + UpperCase(id) + 'TitleOrId'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultTitleOrIdGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultTitleOrIdGetter, ())
accessor_name = 'getDefault' + UpperCase(id) + 'Property' accessor_name = 'getDefault' + UpperCase(id) + 'Property'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultPropertyGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultPropertyGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = 'get' + UpperCase(id) + 'Property' accessor_name = 'get' + UpperCase(id) + 'Property'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultPropertyGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultPropertyGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGetDefault' + UpperCase(id) + 'Property' accessor_name = '_categoryGetDefault' + UpperCase(id) + 'Property'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultPropertyGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultPropertyGetter, ())
accessor_name = '_categoryGet' + UpperCase(id) + 'Property' accessor_name = '_categoryGet' + UpperCase(id) + 'Property'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultPropertyGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultPropertyGetter, ())
accessor_name = 'getDefault' + UpperCase(id) + 'LogicalPath' accessor_name = 'getDefault' + UpperCase(id) + 'LogicalPath'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultLogicalPathGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultLogicalPathGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = 'get' + UpperCase(id) + 'LogicalPath' accessor_name = 'get' + UpperCase(id) + 'LogicalPath'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultLogicalPathGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultLogicalPathGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_categoryGetDefault' + UpperCase(id) + 'LogicalPath' accessor_name = '_categoryGetDefault' + UpperCase(id) + 'LogicalPath'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultLogicalPathGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultLogicalPathGetter, ())
accessor_name = '_categoryGet' + UpperCase(id) + 'LogicalPath' accessor_name = '_categoryGet' + UpperCase(id) + 'LogicalPath'
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Value.DefaultLogicalPathGetter, ()) property_holder.registerAccessor(accessor_name, id,
Value.DefaultLogicalPathGetter, ())
setter_name = 'set' + UpperCase(id) + 'Value' setter_name = 'set' + UpperCase(id) + 'Value'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
setter_name = 'set' + UpperCase(id) + 'ValueList' setter_name = 'set' + UpperCase(id) + 'ValueList'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
setter_name = 'set' + UpperCase(id) + 'ValueSet' setter_name = 'set' + UpperCase(id) + 'ValueSet'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
setter_name = 'setDefault' + UpperCase(id) + 'Value' setter_name = 'setDefault' + UpperCase(id) + 'Value'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
accessor_args = (0,) accessor_args = (0,)
setter_name = '_set' + UpperCase(id) + 'Value' setter_name = '_set' + UpperCase(id) + 'Value'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Value.Setter, accessor_args) property_holder.registerAccessor(setter_name, id, Value.Setter,
accessor_args)
setter_name = '_categorySet' + UpperCase(id) + 'Value' setter_name = '_categorySet' + UpperCase(id) + 'Value'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Value.Setter, accessor_args) property_holder.registerAccessor(setter_name, id, Value.Setter,
accessor_args)
setter_name = '_set' + UpperCase(id) + 'ValueList' setter_name = '_set' + UpperCase(id) + 'ValueList'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Value.ListSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Value.ListSetter,
accessor_args)
setter_name = '_categorySet' + UpperCase(id) + 'ValueList' setter_name = '_categorySet' + UpperCase(id) + 'ValueList'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Value.ListSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Value.ListSetter,
accessor_args)
setter_name = '_set' + UpperCase(id) + 'ValueSet' setter_name = '_set' + UpperCase(id) + 'ValueSet'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Value.SetSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Value.SetSetter,
accessor_args)
setter_name = '_categorySet' + UpperCase(id) + 'ValueSet' setter_name = '_categorySet' + UpperCase(id) + 'ValueSet'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Value.SetSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Value.SetSetter,
accessor_args)
setter_name = '_setDefault' + UpperCase(id) + 'Value' setter_name = '_setDefault' + UpperCase(id) + 'Value'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Value.DefaultSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Value.DefaultSetter,
accessor_args)
setter_name = '_categorySetDefault' + UpperCase(id) + 'Value' setter_name = '_categorySetDefault' + UpperCase(id) + 'Value'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Value.DefaultSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Value.DefaultSetter,
accessor_args)
# Uid setters # Uid setters
setter_name = 'set' + UpperCase(id) + 'Uid' setter_name = 'set' + UpperCase(id) + 'Uid'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
setter_name = 'setDefault' + UpperCase(id) + 'Uid' setter_name = 'setDefault' + UpperCase(id) + 'Uid'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
setter_name = 'set' + UpperCase(id) + 'UidList' setter_name = 'set' + UpperCase(id) + 'UidList'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
setter_name = 'set' + UpperCase(id) + 'UidSet' setter_name = 'set' + UpperCase(id) + 'UidSet'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, '_' + setter_name, Alias.Reindex, ()) property_holder.registerAccessor(setter_name, '_' + setter_name,
Alias.Reindex, ())
property_holder.declareProtected(write_permission, setter_name) property_holder.declareProtected(write_permission, setter_name)
setter_name = '_set' + UpperCase(id) + 'Uid' setter_name = '_set' + UpperCase(id) + 'Uid'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Value.UidSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Value.UidSetter,
accessor_args)
setter_name = '_categorySet' + UpperCase(id) + 'Uid' setter_name = '_categorySet' + UpperCase(id) + 'Uid'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Value.UidSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Value.UidSetter,
accessor_args)
setter_name = '_setDefault' + UpperCase(id) + 'Uid' setter_name = '_setDefault' + UpperCase(id) + 'Uid'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Value.UidDefaultSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Value.UidDefaultSetter,
accessor_args)
setter_name = '_categorySetDefault' + UpperCase(id) + 'Uid' setter_name = '_categorySetDefault' + UpperCase(id) + 'Uid'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Value.UidDefaultSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Value.UidDefaultSetter,
accessor_args)
setter_name = '_set' + UpperCase(id) + 'UidList' setter_name = '_set' + UpperCase(id) + 'UidList'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Value.UidListSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Value.UidListSetter,
accessor_args)
setter_name = '_categorySet' + UpperCase(id) + 'UidList' setter_name = '_categorySet' + UpperCase(id) + 'UidList'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Value.UidListSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Value.UidListSetter,
accessor_args)
setter_name = '_set' + UpperCase(id) + 'UidSet' setter_name = '_set' + UpperCase(id) + 'UidSet'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Value.UidSetSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Value.UidSetSetter,
accessor_args)
setter_name = '_categorySet' + UpperCase(id) + 'UidSet' setter_name = '_categorySet' + UpperCase(id) + 'UidSet'
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
property_holder.registerAccessor(setter_name, id, Value.UidSetSetter, accessor_args) property_holder.registerAccessor(setter_name, id, Value.UidSetSetter,
accessor_args)
def createRelatedValueAccessors(id, read_permission=Permissions.AccessContentsInformation, def createRelatedValueAccessors(id,
write_permission=Permissions.ModifyPortalContent): read_permission=Permissions.AccessContentsInformation,
write_permission=Permissions.ModifyPortalContent):
upper_case_id = UpperCase(id) upper_case_id = UpperCase(id)
# Related Values (ie. reverse relation getters) # Related Values (ie. reverse relation getters)
...@@ -2551,11 +2770,13 @@ def createTranslationAccessors(property_holder, id, ...@@ -2551,11 +2770,13 @@ def createTranslationAccessors(property_holder, id,
if 'translated' in id: if 'translated' in id:
accessor_name = 'get' + UpperCase(id) accessor_name = 'get' + UpperCase(id)
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Translation.TranslatedPropertyGetter, ()) property_holder.registerAccessor(accessor_name, id,
Translation.TranslatedPropertyGetter, ())
property_holder.declareProtected(read_permission, accessor_name) property_holder.declareProtected(read_permission, accessor_name)
accessor_name = '_baseGet' + UpperCase(id) accessor_name = '_baseGet' + UpperCase(id)
if not hasattr(property_holder, accessor_name): if not hasattr(property_holder, accessor_name):
property_holder.registerAccessor(accessor_name, id, Translation.TranslatedPropertyGetter, ()) property_holder.registerAccessor(accessor_name, id,
Translation.TranslatedPropertyGetter, ())
if 'translation_domain' in id: if 'translation_domain' in id:
# Getter # Getter
......
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