1
2
3
4
5
6
7
8
9
10
11
12
13
14 from Globals import DTMLFile
15 from Globals import InitializeClass
16 from AccessControl import ClassSecurityInfo, Permissions
17 from Products.ZenModel.ZenossSecurity import *
18
19 from ZenModelRM import ZenModelRM
20 from Products.ZenRelations.RelSchema import *
21 from ZenPackable import ZenPackable
22
23
24 manage_addUserCommand = DTMLFile('dtml/addUserCommand',globals())
25
26
28
29 meta_type = 'UserCommand'
30
31 security = ClassSecurityInfo()
32
33 description = ""
34 command = ''
35
36 _properties = (
37 {'id':'description', 'type':'text', 'mode':'w'},
38 {'id':'command', 'type':'text', 'mode':'w'},
39 )
40
41 _relations = ZenPackable._relations + (
42 ("commandable", ToOne(
43 ToManyCont, 'Products.ZenModel.Commandable', 'userCommands')),
44 )
45
46
47
48 factory_type_information = (
49 {
50 'immediate_view' : 'userCommandDetailNew',
51 'actions' :
52 (
53 {'id' : 'overview',
54 'name' : 'User Command',
55 'action' : 'userCommandDetailNew',
56 'permissions' : ( Permissions.view, ),
57 },
58 )
59 },
60 )
61
62 security.declareProtected('View', 'breadCrumbs')
64 """Return the breadcrumb links for this object
65 [('url','id'), ...]
66 """
67 crumbs = super(UserCommand, self).breadCrumbs(terminator)
68 aqParent = self.getPrimaryParent()
69 while aqParent.meta_type == 'ToManyContRelationship':
70 aqParent = aqParent.getPrimaryParent()
71 url = aqParent.absolute_url_path() + '/dataRootManage'
72 return [(url, 'Commands')]
73
74
75 InitializeClass(UserCommand)
76