<CSClient id="realCSClient" serverName="http://localhost:9080/BTTSampleWeb" sessionType="NonSecure" retryOnError="true" csAssignServletName="/servlet/com.ibm.btt.cs.servlet.CSAssignServiceIdAndServerTIDProtocolServlet" csNotifClToSrvServletName="/servlet/com.ibm.btt.event.CSNotifClToSrvProtocolServlet" csNotifSrvToClServletName="/servlet/com.ibm.btt.event.CSNotifSrvToClProtocolServlet" csReqProtocolServletName="/servlet/com.ibm.btt.cs.servlet.CSReqProtocolServlet" usedForServerToClientEventNotification="true" reconnectionAttempts="20" timeBetweenReconnectionAttempts="10000" userAgent="CSClient" useProxy="false" proxyHost="localhost" proxyPort="9080" serverCredentials="cred:cred" proxyCredentials="cred:cred" defaultOperationTimeout="10000" keepAliveConnection="false" runInSession="true" setTcpNoDelay="true" sendBufferSize="0" permanentConnectionForEvents="true" eventsPort="8082"/>
//init btt configuration files InitManager.reset("jar:///btt/btt.xml"); //create root context, the first context which created is the root. ContextFactory.createContext("branchClientCtx"); //establish Client/Server connectivity CSClientService cs = CSClient.getCSClient("realCSClient"); cs.setKeepAliveConnection(false); cs.establishSession(); //send client info to server to create session context BTTOperation oper = (BTTOperation) BTTOperation.readObject("startupClientOp"); oper.execute(); oper.close();Where:
//logoff and dispose session context in server side. BTTOperation oper = (BTTOperation) BTTOperation.readObject("logoffClientOp"); oper.execute(); oper.close(); //close Client/Server connectivity CSClientService cs = CSClient.getCSClient("realCSClient"); cs.closeSession();
package com.ibm.btt.rcp.sample.operation; import com.ibm.btt.base.BTTClientOperation; import com.ibm.btt.base.OperationRepliedEvent; import com.ibm.btt.clientserver.CSClientService; import com.ibm.btt.cs.servlet.CSClient; public class SignInClientOperation extends BTTClientOperation { private static final long serialVersionUID = -4709541432084340756L; public void execute() throws Exception { CSClientService csClientService = CSClient.getCSClient("realCSClient"); csClientService.sendAndWait(this,60000); fireHandleOperationRepliedEvent(new OperationRepliedEvent(this)); } }Where, the sendAndWait() method is used to send client information to the server side, and when the server side replies, an operation replied event will be fired.
<operation id="signInClientOp" context="signInCtx" implClass="com.ibm.btt.rcp.sample.operation.SignInClientOperation" serverOperation="signInOp"> <refFormat name="csRequestFormat" refId="signInRecFmt" /> </operation>
You can develop SWT based transaction panels using the SWT Visual Beans Editor. This tools is used to graphically develop SWT based transaction panels. Following is the screen capture of sign in dialog. The main logic of this dialog is SignInComposite class. For steps to develop SWT UI panels with SWT Visual Beans Editor, refer to the Tasks of the SWT Visual Beans Editor.
To deploy a transaction panel to Rich Client application by extending the extension points:
The layout of the perspective can be specified by configuring an XML file. The path of this file can be set in extension points. BTT also provides a pre-activity for you to launch an activity before initializing the perspective. This activity is to specify which perspective definition file will be used. Different definition files create different perspective layouts.
For more information about the parameters of Rich Client Perspective Definition, see Creating a navigation item in the Rich Client Infrastructure document.
BTT Rich Client supports changing theme for SWT widgets. The themes are differentiated by their ID. There is only one default theme. It applies to navigator view, working area view and other BTT pre-built views. For other non-default themes, you can use them by calling the Theme API.
To use default theme, use the ThemeManager.applyDefaultTheme(Control control API. To use non-default theme, use the ThemeManager.applyTheme(Control control, String themeId) API.
For more information about BTT SWT Theme, see Configuring SWT Theme in the Rich Client Infrastructure document.
For more information about complex application integration, see Integrating complex application in the Rich Client Infrastructure document.