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

# Source Code for Module Products.ZenEvents.CustomEventView

     1  ##############################################################################
     2  #
     3  # Copyright (C) Zenoss, Inc. 2007, all rights reserved.
     4  #
     5  # This content is made available according to terms specified in
     6  # License.zenoss under the directory where your Zenoss product is installed.
     7  #
     8  ##############################################################################
     9
    10
    11  import logging
    12  log = logging.getLogger("zen.EventView")
    13
    14  from Globals import DTMLFile, InitializeClass
    15  from AccessControl import ClassSecurityInfo
    16  from Acquisition import aq_parent
    17  from zope.interface import implements
    18
    19  from Products.ZenModel.ZenModelRM import ZenModelRM
    20  from Products.ZenEvents.EventFilter import EventFilter
    21  from Products.ZenModel.EventView import IEventView
    22
    23 -def manage_addCustomEventView(context, id, REQUEST=None):
    24      """Create an aciton rule"""
    25      ed = CustomEventView(id)
    26      context._setObject(id, ed)
    27      if REQUEST is not None:
    28          REQUEST['RESPONSE'].redirect(context.absolute_url() + '/manage_main')
    29
    30  addCustomEventView = DTMLFile('dtml/addCustomEventView',globals())
    31
    32  __pychecker__='no-argsused no-varargsused'
    33
    34 -class CustomEventView(ZenModelRM, EventFilter):
    35
    36      implements(IEventView)
    37
    38      meta_type = "CustomEventView"
    39
    40      type = "status"
    41      evtypes = ("status", "history")
    42      orderby = ""
    43      where = ""
    44      resultFields = ()
    45
    46      _properties = ZenModelRM._properties + (
    47          {'id':'type', 'type':'selection',
    48              'select_variable':'evtypes', 'mode':'w'},
    49          {'id':'orderby', 'type':'string', 'mode':'w'},
    50          {'id':'where', 'type':'text', 'mode':'w'},
    51          {'id':'resultFields', 'type':'lines', 'mode':'w'},
    52      )
    53
    54      security = ClassSecurityInfo()
    55
    56  InitializeClass(CustomEventView)
    57