1
2
3
4
5
6
7
8
9
10
11
12
13
14 __doc__="""Location
15
16 $Id: Location.py,v 1.12 2004/04/22 19:08:47 edahl Exp $"""
17
18 __version__ = "$Revision: 1.12 $"[11:-2]
19
20 from Globals import InitializeClass
21 from Globals import DTMLFile
22
23 from AccessControl import ClassSecurityInfo
24
25 from AccessControl import Permissions as permissions
26
27 from Products.ZenRelations.RelSchema import *
28
29 from DeviceOrganizer import DeviceOrganizer
30 from ZenPackable import ZenPackable
31
41
42
43 addLocation = DTMLFile('dtml/addLocation',globals())
44
45
46 -class Location(DeviceOrganizer, ZenPackable):
47 """
48 Location is a DeviceGroup Organizer that manages physical device Locations.
49 """
50
51
52 dmdRootName = "Locations"
53
54 address = ''
55
56 portal_type = meta_type = event_key = 'Location'
57
58 _properties = DeviceOrganizer._properties + (
59 {'id':'address','type':'string','mode':'w'},
60 )
61
62 _relations = DeviceOrganizer._relations + ZenPackable._relations + (
63 ("devices", ToMany(ToOne,"Products.ZenModel.Device","location")),
64 ("networks", ToMany(ToOne,"Products.ZenModel.IpNetwork","location")),
65 )
66
67
68 factory_type_information = (
69 {
70 'immediate_view' : 'deviceOrganizerStatus',
71 'actions' :
72 (
73 { 'id' : 'status'
74 , 'name' : 'Status'
75 , 'action' : 'deviceOrganizerStatus'
76 , 'permissions' : (permissions.view,)
77 },
78 { 'id' : 'events'
79 , 'name' : 'Events'
80 , 'action' : 'viewEvents'
81 , 'permissions' : (permissions.view,)
82 },
83
84
85
86
87
88 { 'id' : 'manage'
89 , 'name' : 'Administration'
90 , 'action' : 'deviceOrganizerManage'
91 , 'permissions' : ('Manage DMD',)
92 },
93 { 'id' : 'geomap'
94 , 'name' : 'Map'
95 , 'action' : 'locationGeoMap'
96 , 'permissions' : (permissions.view,)
97 },
98 )
99 },
100 )
101
102 security = ClassSecurityInfo()
103
105 """Sets the mailing address for this location"""
106 self.address = address
107
109 """ Returns child link data ready for GMaps """
110 return self.dmd.ZenLinkManager.getChildLinks(self)
111
117
135
145
147 """ Returns geomap info on cousin nodes that should be
148 included in the view due to outside linking.
149 """
150 data = []
151
152 return data
153
154 InitializeClass(Location)
155