From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/48869 Path: main.gmane.org!not-for-mail From: Wes Hardaker Newsgroups: gmane.emacs.gnus.general Subject: Re: ... and now for something completely different: User Friendliness Date: Tue, 07 Jan 2003 07:27:38 -0800 Organization: Network Associates Laboratories Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1041953285 25775 80.91.224.249 (7 Jan 2003 15:28:05 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 7 Jan 2003 15:28:05 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18Vve4-0006gx-00 for ; Tue, 07 Jan 2003 16:28:01 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 18VveB-00009F-00; Tue, 07 Jan 2003 09:28:07 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 07 Jan 2003 09:29:01 -0600 (CST) Original-Received: from sclp3.sclp.com (sclp3.sclp.com [66.230.238.2]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id JAA11039 for ; Tue, 7 Jan 2003 09:28:48 -0600 (CST) Original-Received: (qmail 35642 invoked by alias); 7 Jan 2003 15:27:49 -0000 Original-Received: (qmail 35635 invoked from network); 7 Jan 2003 15:27:45 -0000 Original-Received: from adsl-66-127-127-227.dsl.scrm01.pacbell.net (HELO localhost.localdomain) (@66.127.127.227) by 66.230.238.6 with SMTP; 7 Jan 2003 15:27:45 -0000 Original-Received: (from hardaker@localhost) by localhost.localdomain (8.11.6/8.11.6) id h07FRcY02825; Tue, 7 Jan 2003 07:27:38 -0800 Original-To: ding@gnus.org X-Face: #qW^}a%m*T^{A:Cp}$R\"38+d}41-Z}uU8,r%F#c#s:~Nzp0G9](s?,K49KJ]s"*7gvRgA SrAvQc4@/}L7Qc=w{)]ACO\R{LF@S{pXfojjjGg6c;q6{~C}CxC^^&~(F]`1W)%9j/iS/ IM",B1M.?{w8ckLTYD'`|kTr\i\cgY)P4 In-Reply-To: (Lars Magne Ingebrigtsen's message of "Tue, 07 Jan 2003 06:23:31 +0100") User-Agent: Gnus/5.090008 (Oort Gnus v0.08) XEmacs/21.5 (brussels sprouts, i686-pc-linux) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:48869 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:48869 >>>>> On Tue, 07 Jan 2003 06:23:31 +0100, Lars Magne Ingebrigtsen said: Lars> I didn't find any examples on the page as to what the config Lars> generating language looks like -- do you have an example? Oh, uh, yeah... This is defined in perl structures: add_primary('notification_destinations', title => "Setting up a notification receiver", sub_modules => 'target_addr', questions => [{ name => 'destination', type => 'menu', text => 'enter the notification destination', # inline at-run-time value extraction values => [\&net_policy_select,"select name from cli ents"] }, { name => 'snmpNotifyType', text => 'What type of notification do you want to send?', type => 'radio', values => [qw(1 2)], labels => {'1' => 'trap', '2' => 'inform'}}, { name => 'SNMPVersion', type => 'menu', text => 'What version of the SNMP protocol should th e notification be sent over?', values => [qw(0 1 3)], labels => {'0' => 'SNMP version 1', '1' => 'SNMP version 2c', '3' => 'SNMP version 3', } }], post_answers => [ sub { my $wiz = shift; if (param(SNMPVersion) eq '3') { $wiz->add_late_todos('target_param_3'); } else { $wiz->add_late_todos('target_param_commun ity'); } return 'OK'; } ], actions_descr => ['Adding the notification receiver mapping'], actions => [[\&net_policy_sql,'insert into snmpNotifyTable(snmpNotif yName,snmpNotifyTag,snmpNotifyType,snmpNotifyStorageType,snmpNotifyRowStatus) va lues(@destination@,@destination@,@snmpNotifyType@,3,4)'], 'Adding the notification receiver']); add_primary('target_addr', title => 'Configure the notification destination', questions => [ { text => "Timeout length", type => text, name => 'snmpTargetAddrTimeout', # default value: values => 1500 }, { text => "Number of Retries", type => text, name => 'snmpTargetAddrRetryCount', values => 3 } { type => 'hidden', # hard coded value name => 'snmpTargetAddrTAddress', # inline at-run-time value extraction values => [sub {my $x = net_policy_select('bogus','select ipaddr from clients where name = @destination@'); $x->[0] .= "00A2"; return $x}] } ], actions => [[sub {do_something_with(param('snmpTargetAddrTimeout')); #...}], # prints to the users screen 'Configuring the notification receiver\'s address']); I actually need to write the documentation for the module, but my coworker needs that asap as well so it'll be done shortly. Also, ignore the net_policy_select and net_policy_sql functions referenced above. They're project specific. This data will be hard to read because you don't understand what it's trying to do (it's very SNMP specific, which is certainly a protocol you don't likely grok). -- "The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it." -- Terry Pratchett