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

# Source Code for Module Products.ZenModel.ConfmonPropManager

     1  ##############################################################################
     2  #
     3  # Copyright (C) Zenoss, Inc. 2007, all rights reserved.
     4  #
     5  # This content is made available according to terms specified in
     6  # License.zenoss under the directory where your Zenoss product is installed.
     7  #
     8  ##############################################################################
     9
    10
    11  __doc__="""ConfonPropManager
    12
    13  add keyedselect to property manager
    14
    15  $Id: ConfmonPropManager.py,v 1.4 2002/12/08 18:27:53 edahl Exp $"""
    16
    17  __version__ = "$Revision: 1.4 $"[11:-2]
    18
    19  from OFS.PropertyManager import PropertyManager
    20  from Globals import DTMLFile
    21  from Globals import InitializeClass
    22
    23 -class ConfmonPropManager(PropertyManager):
    24
    25      manage_propertiesForm=DTMLFile('dtml/properties', globals(),
    26                                     property_extensible_schema__=1)
    27
    28 -    def _setPropValue(self, id, value):
    29          """override from PerpertyManager to handle checks and ip creation"""
    30          self._wrapperCheck(value)
    31          if self.getPropertyType(id) == 'keyedselection':
    32              value = int(value)
    33          setattr(self,id,value)
    34
    35
    36 -    def manage_editProperties(self, REQUEST):
    37          """Edit object properties via the web.
    38          The purpose of this method is to change all property values,
    39          even those not listed in REQUEST; otherwise checkboxes that
    40          get turned off will be ignored.  Use manage_changeProperties()
    41          instead for most situations.
    42          """
    43          for prop in self._propertyMap():
    44              name=prop['id']
    45              if 'w' in prop.get('mode', 'wd'):
    46                  value=REQUEST.get(name, '')
    47                  self._updateProperty(name, value)
    48          self.index_object()
    49          if REQUEST:
    50              message="Saved changes."
    51              return self.manage_propertiesForm(self,REQUEST,
    52                                                manage_tabs_message=message)
    53
    54
    55  InitializeClass(ConfmonPropManager)
    56