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 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 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  #    factory_type_information = (
     53  #        {
     54  #            'id'             : 'SoftwareClass',
     55  #            'meta_type'      : 'SoftwareClass',
     56  #            'description'    : """Class to manage product information""",
     57  #            'icon'           : 'SoftwareClass_icon.gif',
     58  #            'product'        : 'ZenModel',
     59  #            'factory'        : 'manage_addSoftwareClass',
     60  #            'immediate_view' : 'viewProductOverview',
     61  #            'actions'        :
     62  #            (
     63  #                { 'id'            : 'overview'
     64  #                , 'name'          : 'Overview'
     65  #                , 'action'        : 'viewSoftwareClassOverview'
     66  #                , 'permissions'   : (
     67  #                  permissions.view, )
     68  #                },
     69  #                { 'id'            : 'viewHistory'
     70  #                , 'name'          : 'Modifications'
     71  #                , 'action'        : 'viewHistory'
     72  #                , 'permissions'   : (
     73  #                  permissions.view, )
     74  #                },
     75  #            )
     76  #          },
     77  #        )
     78
     79 -    def type(self):
     80          """Return the type name of this product (Hardware, Software).
     81          """
     82          if self.isOS:
     83              return "Operating System"
     84          else:
     85              return self.meta_type[:-5]
     86
     87
     88  InitializeClass(SoftwareClass)
     89
     90
     91 -class OSSoftwareClass(SoftwareClass):
     92
     93      """OSSoftwareClass object"""
     94
     95      portal_type = meta_type = 'OSSoftwareClass'
     96      isOS = True
     97
     98  InitializeClass(OSSoftwareClass)
     99