Package Products :: Package ZenModel :: Module MultiGraphReportClass |
[hide private]
[frames] | no frames]

# Source Code for Module Products.ZenModel.MultiGraphReportClass

     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  __doc__="""MultiGraphReportClass
    12
    13  MultiGraphReportClass contain MultiGraphReports.
    14  """
    15
    16  from AccessControl import ClassSecurityInfo
    17  from Globals import DTMLFile
    18  from ReportClass import ReportClass
    19  from Products.ZenRelations.RelSchema import *
    20  from Globals import InitializeClass
    21  from Products.ZenWidgets import messaging
    22  from Products.ZenMessaging.audit import audit
    23  from Products.ZenUtils.Utils import getDisplayType
    24  from Products.ZenUtils.deprecated import deprecated
    25  from Products.ZenModel.MultiGraphReport import MultiGraphReport
    26
    27  @deprecated
    28 -def manage_addMultiGraphReportClass(context, id, title = None, REQUEST = None):
    29      """ Construct a new MultiGraphreportclass
    30      """
    31      frc = MultiGraphReportClass(id, title)
    32      context._setObject(id, frc)
    33      if REQUEST is not None:
    34          audit('UI.ReportClass.Add', frc.id, title=title, organizer=context)
    35          messaging.IMessageSender(self).sendToBrowser(
    36              'Organizer Created',
    37              'Report organizer %s was created.' % id
    38          )
    39          REQUEST['RESPONSE'].redirect(context.absolute_url() + '/manage_main')
    40
    41  addMultiGraphReportClass = DTMLFile('dtml/addMultiGraphReportClass',globals())
    42
    43 -class MultiGraphReportClass(ReportClass):
    44
    45      portal_type = meta_type = "MultiGraphReportClass"
    46
    47      # Remove this relationship after version 2.1
    48      _relations = ReportClass._relations +  (
    49          ('graphDefs',
    50              ToManyCont(ToOne, 'Products.ZenModel.GraphDefinition', 'reportClass')),
    51          )
    52
    53      security = ClassSecurityInfo()
    54
    55 -    def getReportClass(self):
    56          """ Return the class to instantiate for new report classes
    57          """
    58          return MultiGraphReportClass
    59
    60
    61      security.declareProtected('Manage DMD', 'manage_addMultiGraphReport')
    62 -    def manage_addMultiGraphReport(self, id, REQUEST=None):
    63          """Add a MultiGraph report to this object.
    64          """
    65          fr = MultiGraphReport(id)
    66          self._setObject(id, fr)
    67          if REQUEST:
    68              audit('UI.Report.Add', fr.id, reportType=getDisplayType(fr))
    69              url = '%s/%s/editMultiGraphReport' % (self.getPrimaryUrlPath(), id)
    70              return REQUEST['RESPONSE'].redirect(url)
    71          return self._getOb(id)
    72
    73
    74  InitializeClass(MultiGraphReportClass)
    75