Package Products :: Package ZenEvents :: Module EventDetail |
[hide private]
[frames] | no frames]

# Source Code for Module Products.ZenEvents.EventDetail

     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  from ZEvent import ZEvent
    12  from Products.ZenModel.ZenModelItem import ZenModelItem
    13  from Acquisition import Implicit
    14
    15  from AccessControl import Permissions as permissions
    16  from Globals import InitializeClass
    17  from AccessControl import ClassSecurityInfo
    18
    19 -class EventDetail(ZEvent, ZenModelItem, Implicit):
    20      security = ClassSecurityInfo()
    21      security.setDefaultAccess("allow")
    22
    23      factory_type_information = (
    24          {
    25              'id'             : 'EventDetail',
    26              'meta_type'      : 'EventDetail',
    27              'description'    : """Detail view of netcool event""",
    28              'icon'           : 'EventDetail_icon.gif',
    29              'product'        : 'ZenEvents',
    30              'factory'        : '',
    31              'immediate_view' : 'viewEventFields',
    32              'actions'        :
    33              (
    34                  { 'id'            : 'fields'
    35                  , 'name'          : 'Fields'
    36                  , 'action'        : 'viewEventFields'
    37                  , 'permissions'   : (
    38                    permissions.view, )
    39                  },
    40              )
    41            },
    42          )
    43
    44 -    def __init__(self, manager, fields, data, details=None, logs=None):
    45          ZEvent.__init__(self, manager, fields, data)
    46          self._details = details
    47          self._logs = logs
    48
    49 -    def getEventDetails(self):
    50          """return array of detail tuples (field,value)"""
    51          return self._details
    52
    53
    54 -    def getEventLogs(self):
    55          """return an array of log tuples (user,date,text)"""
    56          return self._logs
    57
    58
    59  InitializeClass(EventDetail)
    60
    61 -class EventData:
    62      security = ClassSecurityInfo()
    63      security.setDefaultAccess("allow")
    64 -    def __init__(self, field, value):
    65          self.field = field
    66          self.value = value
    67  InitializeClass(EventData)
    68
    69
    70 -class EventLog:
    71      security = ClassSecurityInfo()
    72      security.setDefaultAccess("allow")
    73 -    def __init__(self, user, date, text):
    74          self.user = user
    75          self.date = date
    76          self.text = text
    77  InitializeClass(EventLog)
    78