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

Source Code for Module Products.ZenModel.SoftwareClass

 1  ############################################################################## 
 2  #  
 3  # Copyright (C) Zenoss, Inc. 2007, all rights reserved. 
 4  #  
 5  # This content is made available according to terms specified in 
 6  # License.zenoss under the directory where your Zenoss product is installed. 
 7  #  
 8  ############################################################################## 
 9   
10   
11  __doc__="""SoftwareClass 
12   
13  SoftwareClass represents a software vendor's product. 
14   
15  $Id: SoftwareClass.py,v 1.5 2003/03/08 18:34:24 edahl Exp $""" 
16   
17  __version__ = "$Revision: 1.5 $"[11:-2] 
18   
19  from Globals import DTMLFile 
20  from Globals import InitializeClass 
21   
22  from Products.ZenRelations.RelSchema import * 
23   
24  from ProductClass import ProductClass 
25   
26 -def manage_addSoftwareClass(context, id, title = None, REQUEST = None):
27 """make a SoftwareClass""" 28 d = SoftwareClass(id, title) 29 context._setObject(id, d) 30 31 if REQUEST is not None: 32 REQUEST['RESPONSE'].redirect(context.absolute_url() 33 +'/manage_main')
34 35 addSoftwareClass = DTMLFile('dtml/addSoftwareClass',globals()) 36
37 -class SoftwareClass(ProductClass):
38 """SoftwareClass object""" 39 portal_type = meta_type = 'SoftwareClass' 40 41 build="" 42 version="" 43 44 _properties = ProductClass._properties + ( 45 {'id':'version', 'type':'string', 'mode':'w'}, 46 {'id':'build', 'type':'string', 'mode':'w'}, 47 ) 48
49 - def __init__(self, id, title="", prodName=None, 50 productKey=None, partNumber="",description="", isOS=False):
51 super(SoftwareClass, self).__init__(id, title, prodName, productKey, partNumber, description) 52 self.isOS = isOS
53
54 - def type(self):
55 """Return the type name of this product (Hardware, Software). 56 """ 57 if self.isOS: 58 return "Operating System" 59 else: 60 return self.meta_type[:-5]
61 62 63 InitializeClass(SoftwareClass) 64 65
66 -class OSSoftwareClass(SoftwareClass):
67 68 """OSSoftwareClass object""" 69 70 portal_type = meta_type = 'OSSoftwareClass' 71
72 - def __init__(self, id, title="", prodName=None, 73 productKey=None, partNumber="",description="", isOS=True):
74 super(OSSoftwareClass, self).__init__(id, title, prodName, productKey, partNumber, description, isOS)
75 76 77 InitializeClass(OSSoftwareClass) 78