25.3. Parameter Types

For each parameter in a command, you can choose a type from its menu under the Type column. The available options and their meanings are listed in Table 25.1.

Table 25.1. Custom Command Parameter Types
TextThe parameter is a text field, into which any string can be entered.
UserThe parameter is a small text field with a user selection button next to it. Only valid UNIX users can be entered or selected from the pop-up user window.
UIDLike the User option, but the username entered will be converted to a UID for substitution into the command when it is run.
GroupThe parameter is a small text field with a group selection button next to it. Only valid UNIX groups can be entered or selected.
GIDLike the Group option, but the group name entered will be converted to a GID for substitution into the command when it is run.
FileA text field with a file chooser button next to it. No validation is done to check that an actual file or valid filename is entered.
DirectoryLike the File option, but the chooser button pops up a directory chooser instead.
Option..The parameter is displayed as a pair of radio buttons, labelled Yes and No. If Yes is chosen, the text entered in the field next to the type menu on the command creation form will be substituted into the command string. If No is chosen, an empty string will be substituted instead. This type can be useful for optional shell command arguments—for example, in a command like rm $force /some/directory. In this example, the force parameter would use the Option type and have – f entered into the text field next to the type menu.
PasswordLike the Text type, but an HTML password field is used instead to hide the text entered by the user.
Menu..If this type is chosen, the parameter is displayed as a drop-down menu in which the choices are taken from the file entered in the field next to the type menu. Each line in the file defines one menu entry. If the line contains a comma, the text after the comma is what appears to the user in the menu, while the text before it is the actual value to which the parameter is set when the command is run. An example file might contain the following lines:
jcameron,Jamie Cameron
emily,Emily Cameron

The menu that appears on the module's main page would contain the choices Jamie Cameron and Emily Cameron, but the actual parameter passed to the command would be either jcameron or emily.
UploadThis type displays a file upload input that the user can use to select a file on his PC. When the command is run, the file is uploaded to the server and placed in a temporary file. The full path to this file is then used as the parameter when the command is run, so that it can be copied to some directory, converted to a different format, or whatever you like. When the command completes, the temporary file will be deleted.
Text boxA parameter of this type is shown as a text box into which anything can be entered. However, any newline characters are replaced with spaces before the parameter is passed to your command.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.40.32