/Script ODB tree: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 21: | Line 21: | ||
<div id="Script-button"></div> | <div id="Script-button"></div> | ||
Any key created in the <span style="color:purple; font-style:italic">/Script</span> tree will appear as a '''''script-button''''' <span style="color: #444444; background-color: #CCCCCC; font-style:italic; font-size: 90; padding:0.25em;padding-left: 0.5em;padding-right: 0.5em;border:1px solid #808080;border-radius: 5px;margin-bottom:1px;"><script-name></span> | Any key created in the <span style="color:purple; font-style:italic">/Script</span> tree will appear as a '''''script-button''''' <span style="color: #444444; background-color: #CCCCCC; font-style:italic; font-size: 90; padding:0.25em;padding-left: 0.5em;padding-right: 0.5em;border:1px solid #808080;border-radius: 5px;margin-bottom:1px;"><script-name></span> | ||
on the default [[mhttpd]] | on the default [[mhttpd]] [[Status Page]]. | ||
;Either | ;Either |
Revision as of 14:56, 24 September 2014
Links
- Online Database
- mhttpd status page
- script-button
- ODB
- /Customscript ODB tree
Purpose
The optional /Script ODB tree provides the user with a way to execute a script when a button on the mhttpd Status Page is clicked, including the capability of passing parameters from the ODB to the user-written script.
Creating the /Script tree
The /Script ODB tree is created by the user. This tree is optional, and the names of any keys in this tree are chosen by the user.
<script-name> key or subtree
Any key created in the /Script tree will appear as a script-button <script-name> on the default mhttpd Status Page.
- Either
- The key can contain the name and path of the script to be executed when the script-button is pressed, e.g.
[local:midas:S]>ls /script Stop Now odbedit -c 'stop now' Tune X40 /home/midas/perl/tunes.sh tune X40
- In this case, two script-buttons would appear on the Status Page, i.e. Stop Now and Tune X40,
- or
- the key may be a subtree, in which case the first key in the subtree must contain the name and path of the script to be
- executed. Any further keys in the subtree contain parameters (which may include links) to be passed as arguments to the script, e.g.
[local:midas:S]>ls "/script/change mode" cmd /home/midas/online/perl/change_mode.pl include path /home/midas/online/perl experiment name -> /experiment/name test_exp select mode -> /experiment/edit on start/select mode 1h mode file tag none
- In this case, one script-button would be created, i.e. change mode. Pressing this button would result in the script "change_mode.pl" executed with the following key contents as parameters, equivalent to the command:
/home/pol/online/perl/change_mode.pl /home/pol/online/perl pol 1h mode