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

# Source Code for Module Products.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
     23 -class BetterEventDetail(EventDetail):
     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
     61 -    def breadCrumbs(self):
     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              #crumbs = self.dmd.ZenEventManager.breadCrumbs('dmd')
     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
     88 -    def zentinelTabs(self, templateName):
     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