Package ZenModel :: Module ConfmonPropManager :: Class ConfmonPropManager
[show private | hide private]
[frames | no frames]

Type ConfmonPropManager

           object --+        
                    |        
                 Base --+    
                        |    
         Node --+       |    
                |       |    
          Element --+   |    
                    |   |    
ElementWithAttributes --+    
                        |    
          PropertyManager --+
                            |
                           ConfmonPropManager


The PropertyManager mixin class provides an object with transparent property management. An object which wants to have properties should inherit from PropertyManager.

An object may specify that it has one or more predefined properties, by specifying an _properties structure in its class:
 _properties=({'id':'title', 'type': 'string', 'mode': 'w'},
              {'id':'color', 'type': 'string', 'mode': 'w'},
              )

The _properties structure is a sequence of dictionaries, where each dictionary represents a predefined property. Note that if a predefined property is defined in the _properties structure, you must provide an attribute with that name in your class or instance that contains the default value of the predefined property.

Each entry in the _properties structure must have at least an 'id' and a 'type' key. The 'id' key contains the name of the property, and the 'type' key contains a string representing the object's type. The 'type' string must be one of the values: 'float', 'int', 'long', 'string', 'lines', 'text', 'date', 'tokens', 'selection', or 'multiple section'.

For 'selection' and 'multiple selection' properties, there is an addition item in the property dictionay, 'select_variable' which provides the name of a property or method which returns a list of strings from which the selection(s) can be chosen.

Each entry in the _properties structure may *optionally* provide a 'mode' key, which specifies the mutability of the property. The 'mode' string, if present, must contain 0 or more characters from the set 'w','d'.

A 'w' present in the mode string indicates that the value of the property may be changed by the user. A 'd' indicates that the user can delete the property. An empty mode string indicates that the property and its value may be shown in property listings, but that it is read-only and may not be deleted.

Entries in the _properties structure which do not have a 'mode' key are assumed to have the mode 'wd' (writeable and deleteable).

To fully support property management, including the system-provided tabs and user interfaces for working with properties, an object which inherits from PropertyManager should include the following entry in its manage_options structure:
 {'label':'Properties', 'action':'manage_propertiesForm',}
to ensure that a 'Properties' tab is displayed in its management interface. Objects that inherit from PropertyManager should also include the following entry in its __ac_permissions__ structure:
 ('Manage properties', ('manage_addProperty',
                        'manage_editProperties',
                        'manage_delProperties',
                        'manage_changeProperties',)),

Method Summary
  manage_editProperties(self, REQUEST)
Edit object properties via the web.
Inherited from PropertyManager: getProperty, getPropertyType, hasProperty, manage_addProperty, manage_changeProperties, manage_changePropertyTypes, manage_delProperties, propdict, propertyIds, propertyItems, propertyLabel, propertyMap, propertyValues, valid_property_id
Inherited from ElementWithAttributes: getAttribute, getAttributeNode, getAttributes
Inherited from Element: getChildNodes, getElementsByTagName, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeType, getParentNode, getPreviousSibling, getTagName
Inherited from Node: getNodeValue, getOwnerDocument, hasChildNodes
Inherited from Base: __getattribute__, __getnewargs__, __getstate__, __new__, __reduce__, __setstate__
Inherited from object: __init__, __delattr__, __hash__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variable Summary
tuple manage_editProperties__roles__ = ('Manager',)
DTMLFile manage_propertiesForm = <App.special_dtml.DTMLFile objec...
tuple manage_propertiesForm__roles__ = ('Manager',)
Inherited from PropertyManager: __ac_permissions__, __implemented__, __propsets__, __provides__, __roles__, getProperty__roles__, getPropertyType__roles__, hasProperty__roles__, manage_addProperty__roles__, manage_changeProperties__roles__, manage_changePropertyTypes__roles__, manage_delProperties__roles__, manage_options, manage_propertyTypeForm, manage_propertyTypeForm__roles__, propdict__roles__, propertyIds__roles__, propertyItems__roles__, propertyLabel__roles__, propertyMap__roles__, propertysheets, propertyValues__roles__, title, valid_property_id__roles__
Inherited from Node: __providedBy__

Method Details

manage_editProperties(self, REQUEST)

Edit object properties via the web. The purpose of this method is to change all property values, even those not listed in REQUEST; otherwise checkboxes that get turned off will be ignored. Use manage_changeProperties() instead for most situations.
Overrides:
OFS.PropertyManager.PropertyManager.manage_editProperties

Class Variable Details

manage_editProperties__roles__

Type:
tuple
Value:
('Manager',)                                                           

manage_propertiesForm

Type:
DTMLFile
Value:
<App.special_dtml.DTMLFile object at 0x3070150>                        

manage_propertiesForm__roles__

Type:
tuple
Value:
('Manager',)                                                           

Generated by Epydoc 2.1 on Thu Aug 16 09:55:15 2007 http://epydoc.sf.net