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

# Source Code for Module Products.ZenModel.ConfmonPropManager

     1  ###########################################################################
     2  #
     3  # This program is part of Zenoss Core, an open source monitoring platform.
     4  # Copyright (C) 2007, Zenoss Inc.
     5  #
     6  # This program is free software; you can redistribute it and/or modify it
     7  # under the terms of the GNU General Public License version 2 as published by
     8  # the Free Software Foundation.
     9  #
    10  # For complete information please visit: http://www.zenoss.com/oss/
    11  #
    12  ###########################################################################
    13
    14  __doc__="""ConfonPropManager
    15
    16  add keyedselect to property manager
    17
    18  $Id: ConfmonPropManager.py,v 1.4 2002/12/08 18:27:53 edahl Exp $"""
    19
    20  __version__ = "$Revision: 1.4 $"[11:-2]
    21
    22  from OFS.PropertyManager import PropertyManager
    23  from Globals import DTMLFile
    24  from Globals import InitializeClass
    25
    26 -class ConfmonPropManager(PropertyManager):
    27
    28      manage_propertiesForm=DTMLFile('dtml/properties', globals(),
    29                                     property_extensible_schema__=1)
    30
    31 -    def _setPropValue(self, id, value):
    32          """override from PerpertyManager to handle checks and ip creation"""
    33          self._wrapperCheck(value)
    34          if self.getPropertyType(id) == 'keyedselection':
    35              value = int(value)
    36          setattr(self,id,value)
    37
    38
    39 -    def manage_editProperties(self, REQUEST):
    40          """Edit object properties via the web.
    41          The purpose of this method is to change all property values,
    42          even those not listed in REQUEST; otherwise checkboxes that
    43          get turned off will be ignored.  Use manage_changeProperties()
    44          instead for most situations.
    45          """
    46          for prop in self._propertyMap():
    47              name=prop['id']
    48              if 'w' in prop.get('mode', 'wd'):
    49                  value=REQUEST.get(name, '')
    50                  self._updateProperty(name, value)
    51          self.index_object()
    52          if REQUEST:
    53              message="Saved changes."
    54              return self.manage_propertiesForm(self,REQUEST,
    55                                                manage_tabs_message=message)
    56
    57
    58  InitializeClass(ConfmonPropManager)
    59