Perform the following steps to develop this sample:
To develop the sample, prepare the backend application first.
This sample provides service for Account Transfer transaction and Credit Card Application transaction. These transactions are implemented with BTT and converted into BTT operations or BTT processors, which can be invoked by BTT platform. A sign is added into the transaction implementation to verify the user identity. The definitions for the operations or processors are obtained from BTT MultiChannel Sample. The transactions are integrated with BTT Channels, including developing the required web pages for each transactions for HTML Channel, necessary XML or JSON formatter definitions for Web2.0 Channel and so on. Besides, the corresponding BTT Channel request handling servlet is registered in the web.xml file. For more detailed information about how to develop the backend application for the sample, see the document for MultiChannel Sample. Most files have already been added into the sample project.
The BTT ODW javascript library is required to support what is delivered as the product in the BTT version 6.1.2. The ODW javascript library can be found in the <BTT installation path>\lib\bttweb2.zip directory. In this sample, the library can be found in the BTTWeb2InternetBankWeb project as highlighted in the following figure.
There are two themes in this sample, which can be found in the BTTWeb2InternetBankWeb project. Developing the theme can referred to CSS helpBTT Web2.0 On-Demond Workplace CSS Doc.
The main page is in the BTTWeb2InternetBankWeb project, which is named defaultTestPage.jsp (see the following figure). You can use this file as a prototype for your own Workplace.
BTT HTML Channel support is required by this jsp file, and some content should be added to support HTML Channel. In the following example, this field is used in the BTT HTML Widget, which is used to support the service delivered by the BTT HTML Channel. Two other javascript files are also required as highlighted in the following figure.
<input type="hidden" id="sessionId" value="<%=utb.getSessionId()%>"/>
The configuration XML files highlighted in the following figure are required. These files decide the layout of the Workplace, the items in the service list, some attributes of the service instance and so on. More detailed information, see Reference.
Besides the BTT Channel request handler, this sample needs some servlets for support of loading or saving the XML configuration on the server as highlighted in the following figure.
In the sample, the XML configuration is preserved on the server side in the format of XML. These servlets obtain the XML configuration from the repository (where the XML files are), return them to the browser, and save the XML configuration into the repository. You can utilize these servlets as prototype to extent to meet your requirements.
In this sample, there are four defined widgets as shown in the following figure, which are Basic Tab Widget, HTML Connector Widget, BTT HTML Widget, and Account Transfer Widget.
The Basic Tab Widget is used to demonstrate the basic service, which can not be found in the service list but can be seen when the user enters. The HTML Connector Widget is used to implement HTML Service in the service list. The HTML Connector Widget is the basis of the Transfer and Credit Card under the Web 1.0 Transactions folder. The Account Transfer Widget corresponds to the Account Transfer under the Web2 Transaction folder. See the following figure.
One widget is defined in one XML file, in which the attributes, required resource files (javascript files and CSS files), presentation content and so on are described. See the Widget definition XML file for reference.
The javascirpt files contain the function implementation for the widget. Each of them is used as the logic entry indicated in the widget XML definition file. See the Widget Definition Doc for reference.
The defined widget should be registered in the widget category definition file indicated in the Config.js in the ODW javascript library as highlighted in the following figure. You can edit the javascript file to associate the definition files as required.
In this sample, it is the WidgetCatalog.xml file that serves as the widget category file. The following method can be used to register one widget in category.
<entry id='simpleHTMLWgt' definition='../widget/basic/HTMLWgt.xml'></entry>
For configuration of the config.js file, see Configuration for Config.js.
The services can be added based on the defined widgets, by configuring the necessary parameters for the widget and registering it in the service list definition file.
The service list definition file is Service.xml in this sample. For example, the Credit Card service corresponds to the following definition in the XML file.
<Service id="1.3" name="credit_card" desc="credit_card" logo="theme/servicelogo/navlogo.gif"> <Widget name="simpleBTTHTMLWgt"> <attribute name="url" value="Request?&dse_applicationId=-1&dse_pageId=2&dse_operationName=creditCardsProc&dse_errorPage=menu.jsp&dse_processorState=initial&dse_nextEventName=start" /> </Widget> </Service>