1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 from EventDetail import EventDetail
19 from Globals import InitializeClass
20 from AccessControl import ClassSecurityInfo
21 from AccessControl import Permissions as permissions
22
24 security = ClassSecurityInfo()
25 security.setDefaultAccess("allow")
26
27 factory_type_information = (
28 {
29 'id' : 'BetterEventDetail',
30 'meta_type' : 'BetterEventDetail',
31 'description' : """Detail view of event""",
32 'icon' : 'EventDetail_icon.gif',
33 'product' : 'ZenEvents',
34 'factory' : '',
35 'immediate_view' : 'eventFields',
36 'actions' :
37 (
38 { 'id' : 'fields'
39 , 'name' : 'Fields'
40 , 'action' : 'eventFields'
41 , 'permissions' : (
42 permissions.view, )
43 },
44 { 'id' : 'details'
45 , 'name' : 'Details'
46 , 'action' : 'eventDetail'
47 , 'permissions' : (
48 permissions.view, )
49 },
50 { 'id' : 'log'
51 , 'name' : 'Log'
52 , 'action' : 'eventLog'
53 , 'permissions' : (
54 permissions.view, )
55 },
56 )
57 },
58 )
59
60
62 """Return the breadcrumb links for this object add event.
63 [('url','id'), ...]
64 """
65 device = self.device and self.dmd.Devices.findDevice(self.device)
66 if device:
67 crumbs = device.breadCrumbs('dmd')
68 else:
69 crumbs = []
70
71 url = self.dmd.ZenEventManager.absolute_url_path() + \
72 "/eventFields?evid=%s" % self.evid
73 crumbs.append((url,'Event %s' % self.evid))
74 return crumbs
75
76
77 - def getContext(self):
78 '''something here to get this published'''
79 device = self.device and self.dmd.Devices.findDevice(self.device)
80 if device:
81 context = device.primaryAq()
82 else:
83 context = self.dmd.ZenEventManager.primaryAq()
84 context = self.__of__(context)
85 return context
86
87
89 """Return a list of hashs that define the screen tabs for this object.
90 [{'name':'Name','action':'template','selected':False},...]
91 """
92 tabs = EventDetail.zentinelTabs(self, templateName)
93 for tab in tabs:
94 tab['action'] += '?evid=%s' % self.evid
95 return tabs
96
97
98 InitializeClass(BetterEventDetail)
99