Creating a menu command
This section describes how to create a menu command using the PATROL Developer Console for Windows and UNIX.
Menu command properties
The menu command properties are divided into the following groups:
- General
- Command
- Security
- Environment
- Icon
The following table describes the menu command properties.
Menu command properties
Property | Required/Optional | Default | Description |
---|---|---|---|
General properties | |||
Command Name | Required | None | The name that the PATROL product uses to manage the command and it is the title of the command as it appears on |
Command or Task | Command | Click Command to create a menu to execute as a command. Click Task to create a menu command that is a task. | |
Task Options | None | If you specify that the command is executed as a task the following options are available:
| |
Availability | Required | ALWAYS_AVAILABLE | Availability indicates when the command is enabled on the object's command menu. A command can be available:
|
Command properties | |||
Computer Class | Required | ALL_COMPUTERS | The computer class against which the menu command is to be executed. Choose ALL_COMPUTERS to execute the same |
Command Type | Required | OS | Choose the language used to write the command script from the list of installed command types. |
Command | Required | None | Click the Command button to access the Command Text Editor window to define the menu command procedure. |
Save in KM or Save in File | Required | Save in KM | Click Save in KM to save the parameter command as part of the PATROL KM file. Click Save to File to save the parameter |
Security properties | |||
Security Type | Required | SECURITY_INHERIT | Choose the appropriate Security Type for the menu command:
|
User Name | Conditional | None | If the Security Type SECURITY_THIS is selected, type the user name of the account under whose authority the menu |
Password | Conditional | None | If the Security Type SECURITY_THIS is selected, type the password of the account under whose authority the command is to be executed. |
Environment properties | |||
Name | Optional | None | The name of the environment variable. |
Value | Optional | None | The value assigned to the environment variable. To change an existing environment variable, choose the variable from the |
Icon properties | |||
Select OK Icon for Task | Required | Default standard PATROL task icon | Type the file name for the OK Icon to be used for the menu command task. |
Select Attention Icon for Task | Required | Default standard PATROL task icon | Type the file name for the Attention (Not OK) Icon to be used for the menu command task. |
Adding a menu command on Windows
In this task, you add a menu command to an application class.
To create a menu command for an application class
- In the KM tree, choose the application class you want to add the new command to.
- Expand the Global folder view.
- Expand the Commands folder view.
- Right-click the Menu Commands folder and then choose New from the shortcut menu as shown in the following figure.
New Menu Command selection from the KM Tree
The Command Properties dialog box appears, as shown in the following figure.
Command Properties dialog box, General tab - Select the appropriate values for the Command Properties General tab.
- Click the Command tab on the Command Properties dialog box as shown in the following figure.
Command Properties dialog box, Command tab - Select the appropriate options for the Computer Class and the Command Type properties that appear on the Command tab.
- Type the commands the Command text box.
- Click Apply to save the changes to the PATROL KM.
- Click the Security tab on the Command Properties dialog box as shown in the following figure.
Command Properties dialog box, Security tab - Define appropriate options that appear on the Security tab.
- Click Apply to save the changes to the PATROL KM.
- Click the Environment tab on the Command Properties dialog box as shown in the following figure.
Command Properties dialog box, Environment tab - Select, add, or modify the appropriate options that appear on the Environment tab.
- To add an environment variable, type it name and its value in the Name and Value text boxes.
- To change an existing environment variable, choose the variable from the Name/Value list and make the changes in the Name and Value text boxes.
- Click Apply to save the changes to the PATROL KM.
- For Recovery Action Tasks only, click the Icons tab on the Commands Properties dialog box as shown in the following figure.
Command Properties dialog box, Icons tab - Select, add, or modify the appropriate options that appear on the Icons tab.
- Click Apply to save the changes to the PATROL KM.
- When commands are created, they appear in the KM Tree. The following figure shows the KM Tree after the Help sub-menu, About command, and Refresh Parameters command were added.
New menu commands on the KM Tree
Adding a menu command on UNIX
In this task, you create a menu command to an application class.
To create a menu command for an application class
- In the PATROL Main Console window, choose Attributes > Application Classes from the menu bar. The List of Application Classes window appears as in the following figure.
List of Application Classes window - Select the application class to which you want to add the new menu item.
- Choose Attributes > Commands > Menu Commands from the List of Applications Classes menu bar.
The List of Menu Commands window displays as shown in the following figure.
List of Menu Commands window
The window lists the menu commands currently available in the object's menu, either for the selected object instance (at the local level) or for all objects of that PATROL class (at the global level). - Choose Edit > Add to add a new menu item to the application object's menu. The Menu Commands dialog box is displayed as shown in the following figure.
Menu Commands dialog box
You ca n select the command format to be either a Command, a Task, or a Sub-Menu Header. The Command Definition dialog box that appears depends on the command format that you select. The dialog box displays the fields required for the selected format.
The dialog box fields are described in Menu command properties . - Click the Command button next to the text field on the Menu Commands dialog box. The Command text edit window appears as shown in the following figure.
Command Text Editor window
This window will have different menu options and functions depending on the type of command you are entering. Click Help for more information about the window. - Choose one of the following options to create the command:
- To manually enter the command procedure, type the command string for the command in the window's editing area.
- To load an existing file that contains a procedure, choose File > Load from the Command window menu bar. You can load previously saved scripts into existing commands and save the combined text as a new file. The saved command text is available for new commands.
- Save your command text by, selecting File > Save from the Command window menu bar.
If you are not using PSL for your command type, the Editor exit dialog box appears, as shown in the following figure, prompting you to save the command text in either the KM or a separate file.
If you are using PSL for your command type, the command will be compiled at this time, and the PSL Compiler message displays, as shown in the following figure.
PSL Compiler message
When the PSL compiler is finished, the PSL compiler displays one of the following compilation messages:- Success indicates that you PSL command had no syntax errors.
- Warning indicates that your PSL command had no errors that would prevent it from executing, but there is a potential problem.
- Failure indicates that the PSL script had errors that would prevent it from executing. The following figure shows a successful PSL compiler message.
PSL Compiler Success message
When you click OK on the PSL Compiler Success message or save a non PSL command, the Editor exit dialog box appears, as shown in the following figure, prompting you to save the command text in either the KM or a separate file.
Editor Exit dialog box
- Save the command text in either the KM or a separate file by clicking the appropriate choice.
- Click OK to save dialog box changes and exit the dialog box when finished. The List of Menu Items window appears. The new menu item appears in the list and its command definition has been saved in the PATROL KM file.
- Choose File > Exit to exit the List of Menu Commands window. Access the object's menu and notice that the menu has been updated to include the new item. Execute the menu option to test it.
KM Output-about menu command
The following figure shows sample output created by the PATROL Developer Console when you add an about menu command.
KM Output-about menu command
KM output-refresh parameters menu command
The following figure shows sample output created by the PATROL Developer Console when you add a menu command to refresh parameters.
KM output-refresh parameters menu command
Comments
Log in or register to comment.