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

Source Code for Module Products.ZenModel.SoftwareClass

 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 or (at your 
 8  # option) any later version as published by the Free Software Foundation. 
 9  # 
10  # For complete information please visit: http://www.zenoss.com/oss/ 
11  # 
12  ########################################################################### 
13   
14  __doc__="""SoftwareClass 
15   
16  SoftwareClass represents a software vendor's product. 
17   
18  $Id: SoftwareClass.py,v 1.5 2003/03/08 18:34:24 edahl Exp $""" 
19   
20  __version__ = "$Revision: 1.5 $"[11:-2] 
21   
22  from Globals import DTMLFile 
23  from Globals import InitializeClass 
24   
25  from Products.ZenRelations.RelSchema import * 
26   
27  from ProductClass import ProductClass 
28   
29 -def manage_addSoftwareClass(context, id, title = None, REQUEST = None):
30 """make a SoftwareClass""" 31 d = SoftwareClass(id, title) 32 context._setObject(id, d) 33 34 if REQUEST is not None: 35 REQUEST['RESPONSE'].redirect(context.absolute_url() 36 +'/manage_main')
37 38 addSoftwareClass = DTMLFile('dtml/addSoftwareClass',globals()) 39
40 -class SoftwareClass(ProductClass):
41 """SoftwareClass object""" 42 portal_type = meta_type = 'SoftwareClass' 43 44 build="" 45 version="" 46 47 _properties = ProductClass._properties + ( 48 {'id':'version', 'type':'string', 'mode':'w'}, 49 {'id':'build', 'type':'string', 'mode':'w'}, 50 ) 51
52 - def type(self):
53 """Return the type name of this product (Hardware, Software). 54 """ 55 if self.isOS: 56 return "Operating System" 57 else: 58 return self.meta_type[:-5]
59 60 61 InitializeClass(SoftwareClass) 62 63
64 -class OSSoftwareClass(SoftwareClass):
65 66 """OSSoftwareClass object""" 67 68 portal_type = meta_type = 'OSSoftwareClass' 69 isOS = True
70 71 InitializeClass(OSSoftwareClass) 72