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

Source Code for Module 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 as published by 
  8  # 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 AccessControl import Permissions as permissions 
 26   
 27  from Products.ZenRelations.RelSchema import * 
 28   
 29  from ProductClass import ProductClass 
 30   
31 -def manage_addSoftwareClass(context, id, title = None, REQUEST = None):
32 """make a SoftwareClass""" 33 d = SoftwareClass(id, title) 34 context._setObject(id, d) 35 36 if REQUEST is not None: 37 REQUEST['RESPONSE'].redirect(context.absolute_url() 38 +'/manage_main')
39 40 addSoftwareClass = DTMLFile('dtml/addSoftwareClass',globals()) 41
42 -class SoftwareClass(ProductClass):
43 """SoftwareClass object""" 44 portal_type = meta_type = 'SoftwareClass' 45 46 build="" 47 version="" 48 49 _properties = ProductClass._properties + ( 50 {'id':'version', 'type':'string', 'mode':'w'}, 51 {'id':'build', 'type':'string', 'mode':'w'}, 52 ) 53 54 # factory_type_information = ( 55 # { 56 # 'id' : 'SoftwareClass', 57 # 'meta_type' : 'SoftwareClass', 58 # 'description' : """Class to manage product information""", 59 # 'icon' : 'SoftwareClass_icon.gif', 60 # 'product' : 'ZenModel', 61 # 'factory' : 'manage_addSoftwareClass', 62 # 'immediate_view' : 'viewProductOverview', 63 # 'actions' : 64 # ( 65 # { 'id' : 'overview' 66 # , 'name' : 'Overview' 67 # , 'action' : 'viewSoftwareClassOverview' 68 # , 'permissions' : ( 69 # permissions.view, ) 70 # }, 71 # { 'id' : 'viewHistory' 72 # , 'name' : 'Modifications' 73 # , 'action' : 'viewHistory' 74 # , 'permissions' : ( 75 # permissions.view, ) 76 # }, 77 # ) 78 # }, 79 # ) 80
81 - def type(self):
82 """Return the type name of this product (Hardware, Software). 83 """ 84 if self.isOS: 85 return "Operating System" 86 else: 87 return self.meta_type[:-5]
88 89 90 InitializeClass(SoftwareClass) 91 92
93 -class OSSoftwareClass(SoftwareClass):
94 95 """OSSoftwareClass object""" 96 97 portal_type = meta_type = 'OSSoftwareClass' 98 isOS = True
99 100 InitializeClass(OSSoftwareClass) 101