1
2
3
4
5
6
7
8
9
10
11
12
13
14 import logging
15
16 from Globals import DTMLFile
17 from Globals import InitializeClass
18
19 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
20 from AccessControl import Permissions
21 from AccessControl import ClassSecurityInfo
22
23 from Products.ZenRelations.RelSchema import *
24
25 from ServiceClass import ServiceClass
26 from ZenModelRM import ZenModelRM
27
28
36
37
38 addIpServiceClass = DTMLFile('dtml/addIpServiceClass',globals())
39
41 """IpServiceClass object.
42 """
43
44 port = 0
45 sendString = ""
46 expectRegex = ""
47
48 portal_type = meta_type = 'IpServiceClass'
49
50 _properties = ServiceClass._properties + (
51 {'id':'port', 'type':'int', 'mode':'w'},
52 {'id':'sendString', 'type':'string', 'mode':'w'},
53 {'id':'expectRegex', 'type':'string', 'mode':'w'},
54 )
55
56 factory_type_information = (
57 {
58 'immediate_view' : 'ipServiceClassStatus',
59 'actions' :
60 (
61 { 'id' : 'status'
62 , 'name' : 'Status'
63 , 'action' : 'ipServiceClassStatus'
64 , 'permissions' : (
65 Permissions.view, )
66 },
67 { 'id' : 'edit'
68 , 'name' : 'Edit'
69 , 'action' : 'ipServiceClassEdit'
70 , 'permissions' : ("Manage DMD", )
71 },
72 { 'id' : 'manage'
73 , 'name' : 'Administration'
74 , 'action' : 'ipServiceClassManage'
75 , 'permissions' : ("Manage DMD",)
76 },
77 { 'id' : 'zproperties'
78 , 'name' : 'zProperties'
79 , 'action' : 'zPropertyEdit'
80 , 'permissions' : ("Change Device",)
81 },
82 { 'id' : 'viewHistory'
83 , 'name' : 'Modifications'
84 , 'action' : 'viewHistory'
85 , 'permissions' : (
86 Permissions.view, )
87 },
88 )
89 },
90 )
91
92 security = ClassSecurityInfo()
93
94 - def __init__(self, id, serviceKeys=(), description="", port=0):
97
98
99 security.declareProtected('Manage DMD', 'manage_editServiceClass')
111
112
113
114 InitializeClass(IpServiceClass)
115