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

# Source Code for Module Products.ZenEvents.CustomEventView

     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  import logging
    15  log = logging.getLogger("zen.EventView")
    16
    17  from Globals import DTMLFile, InitializeClass
    18  from AccessControl import ClassSecurityInfo
    19  from Acquisition import aq_parent
    20  from zope.interface import implements
    21
    22  from Products.ZenModel.ZenModelRM import ZenModelRM
    23  from Products.ZenEvents.EventFilter import EventFilter
    24  from Products.ZenModel.EventView import IEventView
    25
    26 -def manage_addCustomEventView(context, id, REQUEST=None):
    27      """Create an aciton rule"""
    28      ed = CustomEventView(id)
    29      context._setObject(id, ed)
    30      if REQUEST is not None:
    31          REQUEST['RESPONSE'].redirect(context.absolute_url() + '/manage_main')
    32
    33  addCustomEventView = DTMLFile('dtml/addCustomEventView',globals())
    34
    35  __pychecker__='no-argsused no-varargsused'
    36
    37 -class CustomEventView(ZenModelRM, EventFilter):
    38
    39      implements(IEventView)
    40
    41      meta_type = "CustomEventView"
    42
    43      type = "status"
    44      evtypes = ("status", "history")
    45      orderby = ""
    46      where = ""
    47      resultFields = ()
    48
    49      _properties = ZenModelRM._properties + (
    50          {'id':'type', 'type':'selection',
    51              'select_variable':'evtypes', 'mode':'w'},
    52          {'id':'orderby', 'type':'string', 'mode':'w'},
    53          {'id':'where', 'type':'text', 'mode':'w'},
    54          {'id':'resultFields', 'type':'lines', 'mode':'w'},
    55      )
    56
    57      security = ClassSecurityInfo()
    58
    59  InitializeClass(CustomEventView)
    60