Back to index

plone3  3.1.7
Classes | Functions | Variables
PlonePAS.sheet Namespace Reference

Classes

class  PropertyValueError
class  PropertySchemaTypeMap
class  MutablePropertySheet
class  SchemaMutablePropertySheet

Functions

def validateProperty
 def init(self, id, **kw): UserPropertySheet.__init__(self, id, **kw)
def setProperty
def setProperties
def _getPropertyProviderForUser

Variables

tuple PropertySchema = PropertySchemaTypeMap()
 validateValue = PropertySchema.validate
 _properties

Class Documentation

class PlonePAS::sheet::PropertyValueError

Definition at line 35 of file sheet.py.


Function Documentation

def PlonePAS.sheet._getPropertyProviderForUser (   self,
  user 
) [private]

Definition at line 115 of file sheet.py.

00115 
00116     def _getPropertyProviderForUser(self, user):
00117         # XXX This assumes that the acl_users that we want is in the portal
00118         # root. This may not always be the case.
00119         portal = getUtility(ISiteRoot)
00120         return portal.acl_users._getOb(self._id)
00121 
00122 classImplements(MutablePropertySheet,
00123                 IMutablePropertySheet)

Here is the call graph for this function:

def PlonePAS.sheet.setProperties (   self,
  user,
  mapping 
)

Definition at line 99 of file sheet.py.

00099 
00100     def setProperties(self, user, mapping):
00101         prop_keys = self._properties.keys()
00102         prop_update = mapping.copy()
00103 
00104         for key, value in tuple(prop_update.items()):
00105             if key not in prop_keys:
00106                 prop_update.pop(key)
00107                 continue
00108             self.validateProperty(key, value)
00109 
00110         self._properties.update(prop_update)
00111 
00112         # cascade to plugin
00113         provider = self._getPropertyProviderForUser(user)
00114         provider.setPropertiesForUser(user, self)

Here is the caller graph for this function:

def PlonePAS.sheet.setProperty (   self,
  user,
  id,
  value 
)

Definition at line 89 of file sheet.py.

00089 
00090     def setProperty(self, user, id, value):
00091         self.validateProperty(id, value)
00092 
00093         self._properties[id] = value
00094         self._properties = self._properties
00095 
00096         # cascade to plugin
00097         provider = self._getPropertyProviderForUser(user)
00098         provider.setPropertiesForUser(user, self)

Here is the caller graph for this function:

def PlonePAS.sheet.validateProperty (   self,
  id,
  value 
)

def init(self, id, **kw): UserPropertySheet.__init__(self, id, **kw)

Definition at line 79 of file sheet.py.

00079 
00080     def validateProperty(self, id, value):
00081         if not self._properties.has_key(id):
00082             raise PropertyValueError, 'No such property found on this schema'
00083 
00084         proptype = self.getPropertyType(id)
00085         if not validateValue(proptype, value):
00086             raise PropertyValueError, ("Invalid value (%s) for "
00087                                        "property '%s' of type %s" %
00088                                        (value, id, proptype))


Variable Documentation

Definition at line 93 of file sheet.py.

Definition at line 61 of file sheet.py.

PlonePAS.sheet.validateValue = PropertySchema.validate

Definition at line 72 of file sheet.py.