Location:  WebCFG documentation > XML specification

Button

Type: Button
Parent: ButtonSet

A button declaration can be used in annotations in any config file defined in the fileset of this metaconfiguration to place a button in the webfrontend.

Attributes
Attribute Description Usage
id A unique ID to reference this button from config file annotations. required
displayname The text on the button. If not set, defaults to its name. optional
scope Allowed values: local, global

Defines where on the web frontend the button is displayed. When set to local, the button will be displayed on the tab specific part where it is annotated in the config file. If set to global, the button will appear on the bottom of the page and is visible on every tab.

Defaults to local.
optional
successtext An arbitrary text that will be displayed on the edit page when this button has been clicked and all defined actions were successful. optional
Child Elements
Element Description Cardinality
save Save changes before executing the configured action. 0..1
action Declares the action that is executed when the button is pressed. 1
confirm Confirm changes before save or execute an action. 0..1
Examples
<buttonset>
   <button id="checkConfig"
         displayname="Check config">
      <action execute="/usr/local/bin/check.sh"/>
   </button>
   <button id="restartApache"
         displayname="Restart Apache">
      <action execute="/etc/init.d/apache restart"/>
   </button>
   <button id="eject"
         displayname="Eject Tape">
      <action execute="mt eject"/>
   </button>
</buttonset>
    	

This example shows how to define local buttons that can be used in annotations (@WC button name) to display a button in the web frontend at the defined location. These buttons can easily be used to call external scripts or programs that e.g. check the changed configu for validation, restart a service, etc.

top