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