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

Source Code for Module ZenModel.ZenModelItem

 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__="""ZenModelItem 
15   
16  $Id: ZenModelItem.py,v 1.3 2003/10/04 15:54:36 edahl Exp $""" 
17   
18  __version__ = "$Revision: 1.3 $"[11:-2] 
19   
20  from Globals import InitializeClass 
21  from AccessControl import ClassSecurityInfo 
22   
23  from ZenModelBase import ZenModelBase 
24   
25 -class ZenModelItem(ZenModelBase):
26 """ 27 Simple class that non RelationshipManager items inherit from to 28 provide primary path functionality. 29 """ 30 31 meta_type = 'ZenModelItem' 32 33 security = ClassSecurityInfo() 34 35
36 - def __init__(self, id):
37 self.id = id
38 39 40 security.declareProtected('View', 'getPrimaryPath')
41 - def getPrimaryPath(self):
42 return self.getPhysicalPath()
43 44 45 security.declareProtected('View', 'getPrimaryUrlPath')
46 - def getPrimaryUrlPath(self, ignored=None):
47 """get the physicalpath as a url""" 48 return self.absolute_url_path()
49 50
51 - def primaryAq(self):
52 """return this object with is acquisition path set to primary path""" 53 return self
54 55 56 InitializeClass(ZenModelItem) 57