![]() |
Cisco Customer Response Applications Editor Step Reference Guide (3.1)
|
||||||||||||||||||||||||||||||||||||||||||||
Java Step Descriptions
![]() |
|||||||||||||||||||||||||||||||||||||||||||||
|
Table of ContentsJava Step DescriptionsCreate Java Object Create Remote Java Object Execute Java Method Set/Get Java Property Java Step DescriptionsThe steps in the JAVA palette of the Cisco Customer Response Applications (CRA) Editor provide script designers with a way to create Java objects and use Java classes. The JAVA palette contains the following steps:
Figure 15-1 shows the steps in the JAVA palette as they appear in the Palette pane of the Cisco CRA Editor. Figure 15-1 JAVA Palette Steps Create Java ObjectUse the Create Java Object step to instantiate a variable or an object of a specified Java class. You can create object instances for any variables or Java classes that you defined in the Variable pane of the CRA Editor or that are included in the definitions of the steps in your palette. The Variable pane of the CRA Editor supports 20 built-in data types:
The Create Java Object customizer window contains two tabs: The following sections describe these tabs. Class Assignment TabUse the Class Assignment tab of the Create Java Object customizer window to assign a class to the object. Figure 15-2 shows the Class Assignment tab of the Create Java Object customizer window. Figure 15-2 Create Java Object Customizer WindowClass Assignment Tab Table 15-1 describes the properties of the Class Assignment tab of the Create Java Object customizer window. Table 15-1 Create Java Object PropertiesClass Assignment Tab
To use the Class Assignment tab of the Create Java Object customizer window to assign a class to the object, perform the following procedure: ProcedureStep 1 If necessary, click the Class Assignment tab. The Class Assignment tab of the Create Java Object customizer window appears. Step 2 From the Variable Name drop-down menu, choose the variable to represent the specific Java class. The corresponding Java class appears next to the Variable Type label. Step 3 Click Apply. You are now ready to configure the Class Information tab of the Create Java Object customizer window. Class Information TabUse the Class Information tab of the Create Java Object customizer window to choose the constructor for your chosen Java class. A constructor is a function that allows you to instantiate an instance of this class.
If any of the parameters to be passed to a constructor is of type InputStream or Reader, the Create Java Object step allows you to select a Document object and automatically convert the document to an InputStream or Reader object. If the type created is an instance of InputStream or Reader, the Create Java Object step allows you to assign the result to a Document variable by converting the result into the appropriate format. However, the resulting document will only be accessible once by a single output step (unless cached in memory using the Cache Document step). Figure 15-3 shows the Class Information tab of the Create Java Object customizer window. Figure 15-3 Create Java Object Customizer WindowClass Information Tab Table 15-2 describes the properties of the Class Information tab of the Create Java Object customizer window. Table 15-2 Create Java Object PropertiesClass Information Tab
To use the Class Information tab of the Create Java Object customizer window to choose the constructor for your chosen Java class, perform the following procedure: ProcedureStep 1 If necessary, click the Class Information tab. The Class Information tab of the Create Java Object customizer window appears. Step 2 From the Constructor drop-down menu, choose the constructor for the specific Java class. The Argument and Type appear automatically under their respective columns in the Argument list box. Step 3 To assign the value to or to modify the value of an argument, double-click the entry in the Argument list box. The Enter Variable dialog box appears. (See Figure 15-4 .) Figure 15-4 Enter Variable Dialog Box Step 4 In the Enter Variable or Expression field, enter a value directly or take one of the following actions: Step 5 Click OK. The Enter Variable dialog box closes, and the value appears in the Value column of the Arguments list box of the Class Information tab of the Create Java Object customizer window. Step 6 Click OK. The Create Java Object customizer window closes, and the variable name and value appear next to the Create Java Object step icon in the Design pane of the CRA Editor. Create Remote Java ObjectUse the Create Remote Java Object step to create a Java object representing an object hosted on a remote computer. You can then use the Execute Java Method step on the returned object to invoke methods on this remote object. Figure 15-5 shows the customizer window for the Create Remote Java Object step. Figure 15-5 Create Remote Java Object Customizer Window Table 15-3 describes the properties of the Create Remote Java Object customizer window. Table 15-3 Create Remote Java Object Properties
To use the Create Remote Java Object customizer window to create a Java object representing an object hosted on a remote computer, perform the following procedure: ProcedureStep 1 From the Variable Name drop-down menu, choose the variable to represent the remote Java object. The corresponding Java class appears next to the Variable Type label. Step 2 In the Host Name field, enter a value directly or take one of the following actions: Step 3 In the Port Number field, enter a value directly or take one of the following actions: Step 4 In the Service Name field, enter a value directly or take one of the following actions: Step 5 Click OK. The Create Remote Java Object customizer window closes, and the selected variable names appear next to the Create Remote Java Object step icon in the Design pane of the CRA Editor. Execute Java MethodUse the Execute Java Method step to execute a specified static or non-static method of a Java class for a defined variable.
The Execute Java Method customizer window contains two tabs: The following sections describe these tabs. Explore TabUse the Explore tab of the Execute Java Method customizer window to select a variable for which you want to execute a specific Java method. Figure 15-6 shows the Explore tab of the Execute Java Method customizer window. Figure 15-6 Execute Java Method Customizer WindowExplore Tab Table 15-4 describes the properties of the Explore tab of the Execute Java Method customizer window. To use the Explore tab of the Execute Java Method customizer window to specify the variable for which you want to execute a specific Java method, perform the following procedure: ProcedureStep 1 If necessary, click the Explore tab. The Explore tab of the Execute Java Method customizer window appears. Step 2 From the Select Variable drop-down menu, choose the variable to represent the specific Java class. The Variable Name and Variable Type fields are automatically filled, and the members for the class assigned to this variable appear in the Browse the Class text field along with a plus (+) sign. Step 3 To view the different members, click the plus sign (+) in this box. You are now ready to configure the Explore Class Information tab of the Execute Java Method customizer window. Explore Class Information TabUse the Explore Class Information tab of the Execute Java Method customizer window to choose a method to execute from the class selected in the Explore tab. If any of the parameters to be passed to a constructor is of type InputStream or Reader, the Execute Java Method step allows you to select a Document object and automatically convert the document to an InputStream or Reader object. If the return type is an instance of InputStream or Reader, the Execute Java Method step allows you to assign the result to a Document variable by converting the result into the appropriate format. Figure 15-7 shows the Explore Class Information tab of the Execute Java Method customizer window. Figure 15-7 Execute Java Method Customizer WindowExplore Class Information Tab Table 15-5 describes the properties of the Explore Class Information tab of the Execute Java Method customizer window. To use the Explore Class Information tab of the Execute Java Method customizer window to choose a method to execute on the variable you selected in the Explore tab, perform the following procedure: ProcedureStep 1 If necessary, click the Explore Class Information tab. The Explore Class Information tab of the Execute Java Method customizer window appears, and the variable you selected in the Select Variable field of the Explore tab appears in the Object field. Step 2 From the Method drop-down menu, choose the name of the method to call. The list contains the methods available for the specified variable in Create Java Object steps. You cannot call methods that require unsupported data types, such as short and array. The Argument and Type appear automatically under their respective columns in the Argument list box, and the method return type appears next to the Method Return Type name. Step 3 To assign the value to or to modify the value of an argument, double-click the entry in the Argument list box. The Enter Variable dialog box appears. (See Figure 15-4 .) Step 4 In the Enter Variable or Expression field, enter a value directly or take one of the following actions: Step 5 Click OK. The Enter Variable dialog box closes, and the value appears in the Value column of the Arguments list box in the Explore Class Information tab of the Execute Java Method customizer window. Step 6 Click OK. The Execute Java Method customizer window closes, and the variable name and value appear next to the Execute Java Method step icon in the Design pane of the CRA Editor. Set/Get Java PropertyUse the Set/Get Java Property step to obtain and/or modify the value of a property defined in a variable.
If an attribute of a class of type InputStream or Reader is set, the Set/Get Java Property step accepts a parameter of type Document and automatically convert it to either an InputStream or a Reader. If the attribute retrieved is an instance of InputStream or Reader, the Set/Get Java Property step allows you to assign the result to a Document variable by converting the result into the appropriate format. However, the resulting document will only be accessible once by a single output step (unless cached in memory using the Cache Document step). The Set/Get Java Property customizer window contains two tabs: The following sections describe these tabs. Source TabUse the Source tab the Set/Get Java Property customizer window to select a source variable or field with the value you want to obtain. Figure 15-8 shows the Source tab of the Set/Get Java Property customizer window. Figure 15-8 Set/Get Java Property Customizer WindowSource Tab Table 15-6 describes the properties of the Source tab of the Set/Get Java Property customizer window. Table 15-6 Set/Get Java Property PropertiesSource Tab
To use the Source tab of the Set/Get Java Property customizer window to obtain and/or modify the value of a property defined in a variable, perform the following procedure: ProcedureStep 1 If necessary, click the Source tab. The Source tab of the Set/Get Java Property customizer window appears. Step 2 From the Variable Name drop-down menu, choose the variable for which you want to obtain and/or modify the value of a Java property. The variable name and type are automatically displayed, and the members for the class assigned to this variable appear in the Browse the Class text field along with a plus (+) sign. Step 3 To view the different members of the class in the Browse the Class display box, click the plus sign (+) in this box. You are now ready to configure the Destination tab of the Set/Get Java Property customizer window. Destination TabUse the Destination tab of the Set/Get Java Property customizer window to select the variable or a field to receive the value of the source variable. Figure 15-9 shows the Destination tab of the Set/Get Java Property customizer window. Figure 15-9 Set/Get Java Property Customizer WindowDestination Tab Table 15-7 describes the properties of the Destination tab of the Set/Get Java Property customizer window. Table 15-7 Set/Get Java Property PropertiesDestination Tab
To use the Destination tab of the Set/Get Java Property customizer window to select the variable or a field to receive the value of the source variable, perform the following procedure: ProcedureStep 1 If necessary, click the Destination tab. The Destination tab of the Set/Get Java Property customizer window appears. Step 2 From the Variable Name drop-down menu, choose the variable that stores the value of the specified Java property. The variable name and type are automatically displayed, and the members for the class assigned to this variable appear in the Browse the Class text field along with a plus (+) sign. Step 3 To view the different members of the class in the Browse the Class display box, click the plus sign (+) in this box. Step 4 Click OK. The Set/Get Java Property customizer window closes, and the selected variables appear next to the Set/Get Java Object step icon in the Design pane of the CRA Editor.
|
||||||||||||||||||||||||||||||||||||||||||||
|
|