Package ZenEvents :: Module BetterEventDetail
[hide private]
[frames] | no frames]

Source Code for Module ZenEvents.BetterEventDetail

  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  # This program is part of Zenoss Core, an open source monitoring platform. 
 14  # This program is free software; you can redistribute it and/or modify it 
 15  # under the terms of the GNU General Public License version 2 as published by 
 16  # the Free Software Foundation. 
 17  # For complete information please visit: http://www.zenoss.com/oss/ 
 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   
24 -class BetterEventDetail(EventDetail):
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
62 - def breadCrumbs(self, terminator='dmd'):
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 #crumbs = self.dmd.ZenEventManager.breadCrumbs('dmd') 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
89 - def zentinelTabs(self, templateName):
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