Script Manager

The script manager makes it easy to set up scripts and run dirxcp (DirX Directory Command Line Program) and dirxadm (DirX Directory Administration Program) commands. Moreover, as sort of side effect and not really related to scripts, you can have the script manager decode and view audit log files based on the dirxauddecode command.

Notes:

  • The commands quoted above can only be executed if they are available locally on your machine.

  • (Linux) In order to be able to run dirxcp/dirxadm scripts, DirX Directory Manager must be installed in the same account as DirX Directory.

The script manager is available in a special view that is organized into three panes:

  • Script Explorer
    The script explorer allows you to locate and manage the folders that contain the scripts you want to view/edit/create.

  • Script Editor
    The script editor displays the scripts you have double-clicked in the script explorer. The script editor can manage more than one script at a time. Click the tabs at the top of the dialog to switch between scripts.
    The script editor allows you to edit scripts and provides syntax highlighting to help you keep track of your scripts.
    You also can run scripts provided the suffix is .cp (causes dirxcp to be executed) or .adm (causes dirxadm to be executed). You can cancel a running script at any time.
    Also, the script editor displays audit log files you have right-clicked in the script explorer (function "Decode DirX Audit Log…​").

  • Structure
    The structure pane displays - where applicable - the "source" statements and the procedures contained in the script that is currently displayed in the script editor. Click a source entry or a procedure entry in the structure pane to move the cursor to the corresponding entry in the script editor.

Here is an example of the script manager view (the current script contains both, source statements and procedures):

Displays the DirX Manager Main Window. The Scripts View is selected and displayed in the Views bar. On the left side of the Views bar there is a Script Explorer displaying the Scripts Folders tree. The script InitVar.tcl is selected in the tree. Below the Script Explorer the Structure Pane is displayed. Here it displays "source" statements and Procedures. The procedure add++_++new++_++element is selected. On the right side of the the Script Editor displays the procedure add++_++new++_++element of the script InitVar.tcl.
Figure 1. Script Manager View

Script Explorer

The script explorer displays a root entry called "Script Folders". The first level underneath Script Folders consists of links to "real" file system folders that contain your scripts.

Here is an example of the script explorer display:

Displays the Script Folders in tree fromat starting with the root entry Sript Folders. Below Script Folders there are the folders My DirX Scripts and scripts. The scripts folder is expanded. The folders AuditingMonitoring
Figure 2. Script Explorer

"Link" Folders

  • Link folders are like links or shortcuts (look at a link folder’s tool tip to see where it points to). This is why this kind of folder’s icon looks like this: Linked Folder Icon (as opposed to a real file system folder’s icon, which is: Real Folder Icon).

  • Initially, there is one link folder present (called "My DirX Scripts").

  • To add a link folder whose real counterpart exists in the file system, right-click the topmost node (Scripts Folders), click "Add Folder" and select a folder in the file selection box that pops up.

  • To create a new link folder with no real counterpart, right-click the topmost node (Scripts Folders) and click "Add Folder". In the file selection box that pops up, click the button whose tool tip is "Create New Folder" (or the like).

  • To remove a link folder, right-click the folder you want to remove and click "Remove".
    This action deletes only the link that the corresponding folder represents.

  • To rename a link folder, right-click it and click "Rename".

  • You cannot delete the "real" counterpart of a "linked" folder with this application.

  • You can cut/copy/paste and drag/drop script files.

Managing Scripts

Displays the operations New Script
Figure 3. Managing Scripts Menu
  • To create a new script, right-click a link folder, any other folder or a script, then click "New Script".

  • To organize your scripts, you can create intermediate folders by right-clicking any folder but "Script folders" and then clicking "New Folder".

  • To view a script, double-click the entry or right-click it, then click "Open". The script is displayed in the Script Editor pane.

  • To view a DirX Directory audit log, right-click "Decode DirX Audit Log…​" and fill out the form that appears. Primarily, this form allows you to reduce the size of text you are going to face by specifying filters (note that the size of the text displayable in the editor is limited, whereas the size of the original audit log file usually doesn’t matter).

    When creating csv output, only a limited number of parameters such as UniqueID, StartTime, Duration and OpType will be reported (equals the "-Z" command line switch in dirxauddecode)

    "Other options" allows you to specify options in a command line like style. This field is primarily intended for use by vendor staff.

    Here is an example:

Displays fields and check boxes for specifying the optionions for decoding DirX audit log files. The fields are: Audit log file
Figure 4. Decode DirX Audit Log Options Dialog Box
  • To delete any file or folder except a link folder, right-click the file or folder and click "Delete". Deleting a folder deletes all of its contents.

  • To rename a folder or a file, right-click it and click "Rename".

Script Editor

You can use the script editor to display, edit, and run scripts and display audit log files. Here is an example dialog:

Opens an editor for text files. Here the source of InitVar.tcl script is displayed. There is the source tab and the output tab. Below the tabs there are the buttons save
Figure 5. Script Editor

You can use the script editor on any text file. The script editor supports syntax highlighting for the file types .tcl,.cp,.adm (TCL Syntax: http://www.tcl.tk); .xml ;.js (JavaScript); .java; and .ini:

  • Lines that begin with "#" are highlighted in green.

  • Recognized keywords are highlighted in blue.

  • Text enclosed in quotation marks is highlighted in red.

  • Clicking a bracket, brace or parenthesis highlights it and its counterpart in pink.

  • Click the right mouse button for numerous convenience functions. Here is an example:

Displays numerous functions. Selectable are New Window
Figure 6. Context-sensitive Menu of the Script Editor

Most functions are fairly straightforward.

  • Go to insertion point
    Positions to the current insertion point of the mouse cursor. Note that you might lose track of this point when scrolling the script editor window. You will not notice any effect unless the current insertion point is outside the area that is currently visible.

  • Find other block end
    When you click a bracket, brace or parenthesis whose counterpart is not in the currently visible area, this function positions the cursor on the counterpart.

  • The Insert TCL command functions shown in the example menu dialog are TCL-related.

To save the script that is currently visible, click Save button

To save all scripts that are currently open, click Save All Button

To run a script, click Run Button or press F12 (the script suffix must be *.cp or *.adm, otherwise this button is disabled)
Running a script implies saving it.

To stop a script that is currently running, click Stop Button.

To close a script file currently opened in the script editor click Close Buttonin the respective tab or right-click the respective tab and select "Close"

To close all script files currently opened in the script editor at once right-click the respective tab and select "Close All"

Click the Output tab to see the output the actual script is creating or - if already finished - has created.

Press F11 to toggle between the Source and Output tabs.

Script Structure

The structure pane shows the "source" statements and procedures in the *.cp or *.adm script that is currently displayed in the Script Editor pane Click an entry in the structure pane to position the script editor to that entry.

The following sample structure pane shows four source statements and three procedures:

Displays the structure of the script. Here the following "source" statements are displayed: $EntrustScripts/$EntrustDefFile
Figure 7. Structure Pane