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  import urllib 
21   
22  from Globals import InitializeClass 
23  from AccessControl import ClassSecurityInfo 
24   
25  from Products.ZenUtils.Utils import getObjByPath 
26   
27  from ZenModelBase import ZenModelBase 
28   
29 -class ZenModelItem(ZenModelBase):
30 """ 31 Simple class that non RelationshipManager items inherit from to 32 provide primary path functionality. 33 """ 34 35 meta_type = 'ZenModelItem' 36 37 security = ClassSecurityInfo() 38 39
40 - def __init__(self, id):
41 self.id = id
42 43 44 security.declareProtected('View', 'getPrimaryPath')
45 - def getPrimaryPath(self):
46 return self.getPhysicalPath()
47 48 49 security.declareProtected('View', 'getPrimaryUrlPath')
50 - def getPrimaryUrlPath(self):
51 """get the physicalpath as a url""" 52 return self.absolute_url_path()
53 54
55 - def primaryAq(self):
56 """return this object with is acquisition path set to primary path""" 57 return self
58 59 60 InitializeClass(ZenModelItem) 61