ECMAScript objects are supported only with servers that have Identity Manager 3.5.1 version. If a server in a selected driver set is earlier than Identity Manager 3.5.1, an error message is displayed, and Designer does not allow the object to be created. Change the version of the server to Identity Manager 3.5.1 on the properties of the server, then the ECMAScript object can be created.
Designer provides an ECMAScript editor, which also includes an ECMA Expression Builder. You use both to create the ECMAScript.
To access the ECMAScript editor:
Right-click an ECMAScript object in the
view, then select .or
When creating an ECMAScript object, select the check box
.The ECMAScript editor provides different types of functionality depending upon which section you are using.
The ECMAScript editor provides a main scripting area where the ECMAScript is created. You can type a new script, or copy an existing one.
Figure 11-1 Main Scripting Area
Open the ECMAScript in a text editor, then copy the script.
Paste the ECMAScript into the ECMAScript editor.
Press Ctrl+S to save the ECMAScript.
Right-click in the main scripting area, then select the desired option.
Undo Typing: Undoes the typing that has occurred.
Redo: Redoes the last action.
Cut: Cuts the selected area.
Copy: Copies the selected area.
Paste: Pastes the information in the Clipboard into the main scripting area.
Delete: Deletes the selected information from the main scripting area.
Select All: Selects all of the information in the main scripting area.
Find/Replace: Finds and replaces the specified information.
Show Expression Builder: Launches the Expression Builder. For more information, see Section 11.2.2, Expression Builder.
Right-click in the left margin of the main scripting area, then select the desired option.
Toggle Breakpoints: To be implemented.
Enable Breakpoints: Set breakpoints in the ECMAScript.
Breakpoint Properties: View the properties of the breakpoints.
Add Bookmark: Places a bookmark icon on a line in the ECMAScript editor.
Add Task: Places a task icon in a line as a reminder of additional work that needs to be done. If you open the
view from the toolbar, by selecting , the task is displayed.Show Quick Diff: To be implemented.
Show Line Numbers: Displays line numbers in the main scripting area.
Preferences: Sets the line delimitation and sets the suffix for the files created in the ECMAScript editor. By default, there is no translation for line delimiters, and the suffix is js.
The Expression Builder helps in creating ECMAScript expressions. The Expression Builder can be accessed in two ways through the ECMAScript editor, it can also be accessed through the Policy Builder and the Argument Builder.
To access the Expression Builder in the ECMAScript editor:
Right-click in the main scripting area of the ECMAScript editor.
or
Right-click the shell area of the ECMAScript editor.
To access the Expression Builder through the Policy Builder:
Click the
icon next to the following actions or conditions:.XPath expression
append XML element
append XML text
clone by XPath expressions
set XML attribute
strip XPath expression
To access the Expression Builder through the Argument Builder:
Double click the XPath noun token.
Click the
icon in the Argument Builder.The Expression Builder has three panes;
, , and .Figure 11-2 Expression Builder
lists all of the current defined functions in the ECMAScript. contains the standard ECMAScript functions and the DirXML Script functions. displays the standard ECMAScript operators.
To use the Expression Builder:
(Optional) Click the desired
.(Optional) Click the desired
.(Optional) Click the desired
Click
to validate the expression.Click
to close the Expression Builder.In the following example, the join ECMAScript variable is used with the NodeSet function or method, but there is no ECMAScript operator selected.
Figure 11-3 Expression Builder Example
As functions and variables are defined in the ECMAScript, they are displayed on the left side of the ECMAScript editor.
Figure 11-4 Functions and Variables
All of the variables that are stored in a function are grouped together. You can expand a function to view all of the variables, by clicking the plus icon (arrow icon in Linux). You can view the function without the variables by clicking the minus icon (arrow icon in Linux).
As the ECMAScript is created, errors are displayed in the main scripting area and in the
view. The main scripting area displays the errors as a red X on the line where the error occurs.Figure 11-5 Main Scripting Area Errors
The
view accumulates the errors as the ECMAScript is typed, displays the cause of the error.Double-click the error in the
view. The cursor jumps to the problem line in the main scripting area.To access the
view:In the toolbar select
.The
view is displayed below the ECMAScript editor.The shell area of the ECMAScript area allows you execute the ECMAScript. After the ECMAScript is created, you can test the functionality of the script.
Figure 11-6 Shell Area
Figure 11-6 contains an example of a function that determines the area of a circle. The function is tested by specifying a value of areaOfCircle(10). The shell displays the value of 628.3185307179587.
To execute the expression, press the Enter key. If you want to enter more than one line of code in the console, press Enter on the numeric-keypad.