Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 11 Custom Adapter Example: zapadapter : Specifying Configuration Information

Specifying Configuration Information
Before running any adapter application, you need to specify its configuration information. Configuration information and metadata information are specified using the TIBCO Designer software.
Creating a configuration for zapAdapter consists of the following tasks:
 
Task A Configure Schema
All schema data can be configured using the resources in the AESchemas folder. It is recommended to place your schema data for each adapter in a separate folder inside the AESchemas/ae folder.
1.
2.
Go to AESchemas/ae, create an examples folder.
Figure 26 Create a Folder for Schema Data
3.
Open the new folder and drag an AESchema icon from the Palettes panel into the Design panel. Name it zapadapter and click Apply.
4.
a.
Double-click to select zapadapter, then double-click the Classes folder.
b.
Drag the Generic Class object from the Palettes panel to the Design panel.
c.
In the Class Type filed, select Schema and click Apply.
d.
Change the name to Contract. Click Apply.
Figure 27 Create a Class
5.
Add a ContractId attribute.
a.
Double-click the Contract class
b.
Drag a Generic Scalar object from the Palettes panel to the Design panel.
c.
d.
For the Type, choose i4(32-bit integer) from the drop-down list.
e.
Click Apply.
6.
Add a ContractDate attribute of type Date (same procedure as above).
7.
Create another new class named Customer with the following attributes:
CustomerId (Type i4 32-bit integer)
CustomerName (Type string)
CustomerAddress (Type string)
8.
Add a Contract attribute to the class named Customer.
You can drag a Contract class from the project tree into the Design panel.
Alternatively, you can add a generic class attribute and click the Browse button, then select the Contract class.
Figure 28 Add an Attribute
9.
Task B Configure non-Schema Data
To configure the non-Schema data, that is, the adapter itself and its services, endpoints, and sessions:
1.
2.
In the Project panel, double-click the zapAdapter folder, then drag a Generic Adapter Configuration from the Adapter Resources palette into the Design panel.
3.
4.
In the SDK AppName field, type zapAdapter. This is the short name of the adapter and will be used in the source code. Click Apply.
Figure 29 Adapter Configuration
5.
In the project panel, expand zapone, then click the Adapter Services folder.
6.
Drag a Publication Service from the Palettes panel into the Design panel. In the Configuration Name field, change the name to zappublisher.
7.
Select the Transport tab. The fields should have the following values:
a.
b.
c.
Click Apply.
TIBCO Designer creates the service and a corresponding endpoint and session. Endpoint and session are placed in the Advanced folder.
Figure 30 Add a Publication Service
8.
To add a timer, double-click the Timers folder (inside the Advanced folder) and drag a Timer into the Design panel. In the Configuration tab:
a.
b.
Interval field, type 2000 (in millisecond).
c.
d.
Click Apply.
Figure 31 Add a Timer
9.
To add custom information, select the zapone and click Edit Adapter XML.
Click Source and add the following information to the XML file, under <AESDK:adapter name = "zapAdapter">:
 
   <zapconnection>
      <hostname>rio</hostname>
      <port>9900</port>
      <instance>UIJ23</instance>
   </zapconnection>
Figure 32 Edit Adapter XML
10.
Task C Link Schema and Publisher
The final step in the adapter configuration is to link the schema to the publisher.
1.
In the Project panel, Expand zapone > Adapter Services.
2.
Select zappublisher and click the Schema tab.
3.
Click the Browse resources button. In the popup dialog, navigate to the Customer class and select it. Click Apply and save the project.
Figure 33 Link Schema and Publisher

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved