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

Source Code for Module ZenModel.MultiGraphReportClass

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