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

Source Code for Module ZenModel.UserCommand

 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  from Globals import DTMLFile 
15  from Globals import InitializeClass 
16  from AccessControl import ClassSecurityInfo, Permissions 
17  from ZenModelRM import ZenModelRM 
18  from Products.ZenRelations.RelSchema import * 
19  from ZenPackable import ZenPackable 
20   
21   
22  manage_addUserCommand = DTMLFile('dtml/addUserCommand',globals()) 
23   
24   
25 -class UserCommand(ZenModelRM, ZenPackable):
26 27 meta_type = 'UserCommand' 28 29 security = ClassSecurityInfo() 30 31 description = "" 32 command = '' 33 34 _properties = ( 35 {'id':'description', 'type':'text', 'mode':'w'}, 36 {'id':'command', 'type':'text', 'mode':'w'}, 37 ) 38 39 _relations = ZenPackable._relations + ( 40 ("commandable", ToOne( 41 ToManyCont, 'Products.ZenModel.Commandable', 'userCommands')), 42 ) 43 44 45 # Screen action bindings (and tab definitions) 46 factory_type_information = ( 47 { 48 'immediate_view' : 'userCommandDetail', 49 'actions' : 50 ( 51 {'id' : 'overview', 52 'name' : 'User Command', 53 'action' : 'userCommandDetail', 54 'permissions' : ( Permissions.view, ), 55 }, 56 { 'id' : 'viewHistory', 57 'name' : 'Modifications', 58 'action' : 'viewHistory', 59 'permissions' : ( Permissions.view, ), 60 } 61 ) 62 }, 63 ) 64 65 security.declareProtected('View', 'breadCrumbs')
66 - def breadCrumbs(self, terminator='dmd'):
67 """Return the breadcrumb links for this object 68 [('url','id'), ...] 69 """ 70 crumbs = super(UserCommand, self).breadCrumbs(terminator) 71 return crumbs
72 73 74 InitializeClass(UserCommand) 75