IBM WebSphere Multichannel Bank Transformation Toolkit, Version 7.1

Client side configuration of business component application

About this task

In the client side, Business component provides common and integrated configuration way for different subcomponents.

See the following figure for example of the Eclipse plug-in extension configuration.

Screen capture shows the example of the extension configuration

To display the navigator item in RCP, the RCP activity should be defined. Business Component provides a common BCActivity. The parameter of the activity should be com.ibm.btt.bc.ej.viewer.impl.EJViewerCompositeFactory;ejvconfig. The first part of parameter before the semicolon defines the factory to create the SWT composite. The second part, ejvconfig, is the configuration object ID in element factory configuration file.

When RCP is launched, the client application should initialize the configuration by following example code in Activator class.

elementFactory = new UniversalElementFactory("jar:///bttconfig/bttconfig.xml");
BTTFactory.setElementFactory(elementFactory);
XUIEngine.init("jar:///bttconfig/xuiengine.xml");

The following is the root configuration file example, bttconfig.xml. It imports sub configuration and defines a macro definition of BTT Remote service. This BTT Remote macro definition can be used by EJ, Override, Access Control, Cash Draw configuration.

<root>
	<import file="ejViewer.xml" />
	<import file="override.xml" />
	<import file="accessControl.xml" />
	<import file="cashDrawerManagment.xml"/>
	
	<macroDef id="remote">
		<tagName name="interface" />
		<attribute name="serviceId" />
		<interface Instantiate="factoryElement"
			FactoryClass="com.ibm.btt.remote.RemoteProxyFactory"
			serviceId="@{serviceId}">
			<ref Injection="httpClient" refId="httpClient"/>
			<ref Injection="remoteConnectorUrl" refId="serviceUrl" />
		</interface>
	</macroDef>
	
	<org.apache.commons.httpclient.HttpClient id="httpClient" />

	<string id="serviceUrl"  value="http://localhost:9080/BTTTellerSampleWeb/BTTRemoteConnector" />

	<macro:remote id="postEngine"  interface="com.ibm.btt.poc.postengine.PostEngine"  serviceId="poc.postengine" />
</root>

The following is the content of EJ Viewer configuration file, ejViewer.xml. Note that configuration object, ejvconfig, referenced by the BCActivity parameter is defined here. In this example, the EJ service is deployed in server side. So in the first line, there is a definition of EJ service proxy by BTT remote macro definition. Through the EJ viewer configuration, the application can control the layout and EJ fields of query condition and query result UI panel. For example, the application can set the width or height of the panel, and set the column number and field name and order.

<macro:remote id="ejEngine" interface="com.ibm.btt.bc.ej.BTTEJ" serviceId="ejJdbcT1" />

<com.ibm.btt.bc.ej.viewer.config.EJViewerConfigurationObject
		id="ejvconfig"  width="800" hight="600" >
		<ref Injection="queryConditionLayout" refId="conditionUIlayout" />
		<ref Injection="queryResultLayout" refId="resultUIlayout" />
		<ref Injection="ejInstance" refId="ejEngine" />
		<com.ibm.btt.demo.xui.EJRestoreTransactionXUIDemoImpl
			Injection="restoreHandler" initPath="jar://bttconfig/xuiengine.xml" />
	</com.ibm.btt.bc.ej.viewer.config.EJViewerConfigurationObject>

	<com.ibm.btt.bc.ej.viewer.config.QueryConditionLayout   
id="conditionUIlayout" colum="2">
		<list Injection="fieldsList">
			<com.ibm.btt.bc.ej.viewer.config.QueryConditionFieldDescriptor  fieldName="ACCOUNT" />
			<com.ibm.btt.bc.ej.viewer.config.QueryConditionFieldDescriptor  fieldName="TxnID" />
			<com.ibm.btt.bc.ej.viewer.config.QueryConditionFieldDescriptor  fieldName="ACCOUNT2" />
			<com.ibm.btt.bc.ej.viewer.config.QueryConditionFieldDescriptor  fieldName="Status" />
			<com.ibm.btt.bc.ej.viewer.config.QueryConditionFieldDescriptor  fieldName="AMOUNT" />
			<com.ibm.btt.bc.ej.viewer.config.QueryConditionFieldDescriptor  fieldName="BankID" />
		</list>
	</com.ibm.btt.bc.ej.viewer.config.QueryConditionLayout>

	<com.ibm.btt.bc.ej.viewer.config.QueryResultLayout
		id="resultUIlayout">
		<list Injection="fieldsList">
			<com.ibm.btt.bc.ej.viewer.config.QueryResultFieldDescriptor 	fieldName="TxnID" width="100" />
			<com.ibm.btt.bc.ej.viewer.config.QueryResultFieldDescriptor	fieldName="ACCOUNT" width="130" />
			<com.ibm.btt.bc.ej.viewer.config.QueryResultFieldDescriptor	fieldName="AMOUNT" width="100" />
			<com.ibm.btt.bc.ej.viewer.config.QueryResultFieldDescriptor	fieldName="Status" width="100" />
			<com.ibm.btt.bc.ej.viewer.config.QueryResultFieldDescriptor	fieldName="ACCOUNT2" width="150" />
			<com.ibm.btt.bc.ej.viewer.config.QueryResultFieldDescriptor	fieldName="BankID" />
		</list>
	</com.ibm.btt.bc.ej.viewer.config.QueryResultLayout>

XUI Definition for transaction

As mentioned above, the transaction UI on the teller desktop is implemented with RCP XUI. So we need to define the following XUI definition files for the example. Each transaction has two XUI files; one is for the request, and the other for response. The following figure shows how to define the activity property for transactions with XUI.

Screen capture shows how to define the activity property for transactions with XUI

The following is the sample content of the DepositeReq.xui file. Note the items with dataName defined, XUI engine will automatically creates a keyed Collection with the fields with the same name and values as the XUI fields with dataName defined when submission is executed.

<XUI>
	<Composite id="DepositeRequest" bounds="41,32,757,571"font="Arial,9,NORMAL">
		<Label bounds="211,38,244,33" text="Cash Deposit" alignment="CENTER"  font="Arial,16,NORMAL"/>
		<Label bounds="38,88,128,22"  text="Account" alignment="RIGHT" />
		<Text bounds="203,89,266,21"  dataName="account"></Text>
		<Label bounds="37,132,135,25" alignment="RIGHT" text="Dep. Book Number" />
		<Text bounds="201,124,144,21"  dataName="depositID" />
		<Label bounds="36,172,137,28"  text="Currency" alignment="RIGHT" />
		<Combo bounds="200,166,99,24"  text="RMB"  dataName="currency"
			dataNameForList="currencyTypeList" items="RMB;US$;EURO;HK$;pound"  />
		<Label bounds="35,210,145,27" text="Amount" alignment="RIGHT"></Label>
		<Text bounds="197,210,157,22"  dataName="amount" text="" enabled="true" editable="false"/>
		<Button bounds="340,400,78,26" text="Submit" disableInError="true">
	         <list Injection="actions">
				        <com.ibm.btt.demo.action.DepositeAction />
	         </list>
		</Button>
		<Button bounds="376,204,138,29" text="Denomination Info">
	         <list Injection="actions">
				        <com.ibm.btt.demo.action.CashDrawerDepositAction />
	         </list>
  </Button>
  </Composite>
</XUI>

According to the above XUI definition, when the Submit button is clicked, the DepositeAction action is executed. In the implementation of the transaction action class, the code should check if override is needed. Then the application can call the server side operation or command chain to send the transaction request data to the host. After transaction response data is returned, the action displays the transaction response UI with the XUI engine.



Feedback