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

Source Code for Module Products.ZenEvents.EventDetail

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