Package Products ::
Package ZenModel
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13 __doc__="""__init__
14
15 Initialize the Confmon Product
16
17 Products must follow the following standard
18 The name of the module (file) and the name of the product class inside
19 the file must be the same.
20
21 If there is a ZMI add screen it must be called "add" + class name (ie addDevice)and it must be defined at the module level.
22
23 the class factory must be a function at the module level called
24 manage_add + class name (ie manage_addDevice)
25
26 If there is an icon for the product it should be called class name + _icon.gif
27 """
28
29 import os
30 import logging
31 log = logging.getLogger("zenmodel")
32
33 if 0:
34 __path__ = None
35
36 from Products.CMFCore.DirectoryView import registerDirectory
37
38 confmon_globals = globals()
39
40 productNames = (
41 'AdministrativeRole',
42 'AdministrativeRoleable',
43 'AreaGraphPoint',
44 'BasicDataSource',
45 'BasicDeviceLoader',
46 'BatchDeviceLoader',
47 'BuiltInDS',
48 'CPU',
49 'CdefGraphPoint',
50 'CiscoLoader',
51 'Classifier',
52 'ClassifierEntry',
53 'Collection',
54 'CollectionItem',
55 'Commandable',
56 'CommentGraphPoint',
57 'ComplexGraphPoint',
58 'ConfigurationError',
59 'ConfmonPropManager',
60 'CustomDeviceReportClass',
61 'DataPointGraphPoint',
62 'DataRoot',
63 'DefGraphPoint',
64 'Device',
65 'DeviceClass',
66 'DeviceComponent',
67 'DeviceGroup',
68 'DeviceHW',
69 'DeviceManagerBase',
70 'DeviceOrganizer',
71 'DeviceReport',
72 'DeviceReportClass',
73 'DeviceResultInt',
74 'DmdBuilder',
75 'EventView',
76 'Exceptions',
77 'ExpansionCard',
78 'Fan',
79 'FileSystem',
80 'GprintGraphPoint',
81 'GraphDefinition',
82 'GraphGroup',
83 'GraphPoint',
84 'GraphReport',
85 'GraphReportClass',
86 'GraphReportElement',
87 'HWComponent',
88 'HardDisk',
89 'Hardware',
90 'HardwareClass',
91 'HruleGraphPoint',
92 'IpAddress',
93 'IpInterface',
94 'IpNetwork',
95 'IpRouteEntry',
96 'IpService',
97 'IpServiceClass',
98 'IpServiceLoader',
99 'LineGraphPoint',
100 'Link',
101 'LinkManager',
102 'Linkable',
103 'Location',
104 'Lockable',
105 'MEProduct',
106 'MaintenanceWindow',
107 'MaintenanceWindowable',
108 'ManagedEntity',
109 'Manufacturer',
110 'ManufacturerRoot',
111 'MibBase',
112 'MibModule',
113 'MibNode',
114 'MibNotification',
115 'MibOrganizer',
116 'MinMaxThreshold',
117 'Monitor',
118 'MonitorClass',
119 'MultiGraphReport',
120 'MultiGraphReportClass',
121 'OSComponent',
122 'OSProcess',
123 'OSProcessClass',
124 'OSProcessOrganizer',
125 'OperatingSystem',
126 'Organizer',
127 'PerformanceConf',
128 'PerformanceView',
129 'PingDataSource',
130 'PowerSupply',
131 'PrintGraphPoint',
132 'ProductClass',
133 'RRDDataPoint',
134 'RRDDataSource',
135 'RRDGraph',
136 'RRDTemplate',
137 'RRDThreshold',
138 'RRDView',
139 'Report',
140 'ReportClass',
141 'Service',
142 'ServiceClass',
143 'ServiceOrganizer',
144 'ShiftGraphPoint',
145 'SiteError',
146 'Software',
147 'SoftwareClass',
148 'StatusColor',
149 'System',
150 'TemperatureSensor',
151 'TemplateContainer',
152 'ThresholdClass',
153 'ThresholdGraphPoint',
154 'ThresholdInstance',
155 'TickGraphPoint',
156 'UserCommand',
157 'UserSettings',
158 'VdefGraphPoint',
159 'VruleGraphPoint',
160 'WinService',
161 'XmlDataLoader',
162 'ZDeviceLoader',
163 'ZVersion',
164 'ZenDate',
165 'ZenMenu',
166 'ZenMenuItem',
167 'ZenMenuable',
168 'ZenModelBase',
169 'ZenModelItem',
170 'ZenModelRM',
171 'ZenPack',
172 'ZenPackLoader',
173 'ZenPackManager',
174 'ZenPackPersistence',
175 'ZenPackable',
176 'ZenPacker',
177 'ZenStatus',
178 'ZenossInfo',
179 'ZenossSecurity',
180 'ZentinelPortal',
181 )
182
183
184 registerDirectory('skins', globals())
185 registerDirectory('help', globals())
186
187
188 confmonModules = []
194
195
197 contentClasses = ()
198 contentConstructors = ()
199
200 registrar.registerHelp()
201 registrar.registerHelpTitle('Zentinel Portal Help')
202
203 if not confmonModules: loadConfmonModules()
204
205 for module in confmonModules:
206 args = []
207 kwargs = {}
208 className = module.__name__.split('.')[-1]
209 addDtmlName = "add%s" % className
210 factoryName = "manage_add%s" % className
211 iconName = "www/%s_icon.gif" % className
212 confclass = getattr(module, className, None)
213
214 if not confclass: continue
215 args.append(confclass)
216 constructors = []
217 addDtml = getattr(module, addDtmlName, None)
218 if addDtml: constructors.append(addDtml)
219 factory = getattr(module, factoryName, None)
220 if factory: constructors.append(factory)
221 if not constructors: continue
222 kwargs['constructors'] = constructors
223 kwargs['permission'] = "Add DMD Objects"
224 if os.path.exists(os.path.join(__path__[0], iconName)):
225 kwargs['icon'] = iconName
226 log.debug("Register Class=%s",className)
227 log.debug("kwargs=%s", constructors)
228 apply(registrar.registerClass, args, kwargs)
229