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