1
2
3
4
5
6
7
8
9
10
11
12
13
14 __doc__="""GraphGroup
15
16 GraphGroup contains the settings, graphDefinitions and collections
17 that form part of an UberReport.
18 """
19
20
21 from AccessControl import Permissions
22 from Globals import InitializeClass
23 from AccessControl import ClassSecurityInfo
24 from Products.ZenRelations.RelSchema import *
25 from ZenModelRM import ZenModelRM
26
27
35
36
38 '''
39 '''
40
41 meta_type = 'GraphGroup'
42
43 sequence = 0
44 collectionId = ''
45 graphDefId = ''
46 combineDevices = False
47
48 _properties = (
49 {'id':'sequence', 'type':'long', 'mode':'w'},
50 {'id':'collectionId', 'type':'string', 'mode':'w'},
51 {'id':'graphDefId', 'type':'string', 'mode':'w'},
52 {'id':'combineDevices', 'type':'boolean', 'mode':'w'},
53 )
54
55 _relations = (
56 ('report',
57 ToOne(ToMany, 'Products.ZenModel.MultiGraphReport', 'graphGroups')),
58 )
59
60 factory_type_information = (
61 {
62 'immediate_view' : 'editGraphGroup',
63 'actions' :
64 (
65 { 'id' : 'edit'
66 , 'name' : 'Graph Group'
67 , 'action' : 'editGraphGroup'
68 , 'permissions' : ( Permissions.view, )
69 },
70 )
71 },
72 )
73
74 security = ClassSecurityInfo()
75
76 - def __init__(self, newId, collectionId='', graphDefId='', sequence=0,
77 title=None, buildRelations=True):
82
83
85 ''' Return the referenced collection or None if it doesn't exist
86 '''
87 return getattr(self.report.collections, self.collectionId, None)
88
89
91 ''' Return the referenced graphDef or None if it doesn't exist
92 '''
93 return getattr(self.report().graphDefs, self.graphDefId, None)
94
95
104
105
114
115
116
117
118
119
120
121
122
123
124
125 InitializeClass(GraphGroup)
126