IBM WebSphere Multichannel Bank Transformation Toolkit, Version 7.1

Creating the Sign-in View

About this task

PerspectiveActivity.java creates the Sign In Dialog, which launch the signinClientOp operation. In the Sign In Dialog, RCP property broker is used to communicate between PerspectiveActivity.java and the Sign In Dialog. For more information, see Using RCP property broker to communicate with BTT Version 4.3 teller application.

To perform the sign in transaction, you need to provide the input data: username and password. The context and format definitions that are needed are defined in Configuring the BTT definition files.

Do the following steps to create the sign-in view:

Procedure

  1. Copy the PropertyConstants.java from <toolkit_root>\samples\BTTJumpStartSampleRCPClient.zip\ BTTJumpStartSampleRCPClient/src/com/ibm/btt/jumpstart/sample to com.ibm.btt.jumpstart.sample package of BTTJumpStartSampleRCPClient Project. This java file defines some constants used in RCP property broker.
  2. Right-click the BTTJumpStartSampleRCPClient Project, and select New > package. In the dialog box that pop up, enter com.ibm.btt.jumpstart.sample.operation in the Package field, and click Finish. Copy the StartupClientOp.java, StartupClientOp.java, SignInClientOperation.java and LogoffClientOp.java from <toolkit_root>\samples\BTTJumpStartSampleRCPClient.zip\ BTTJumpStartSampleRCPClient/src/com/ibm/btt/jumpstart/sample/operation to the BTTJumpStartSampleRCPClient Project:
    • StartupClientOp.java, is responding to client operation startupClientOp, which calls server operation startupClientOp to create BTT session context, and binds the context to HTTP session.
    • SignInClientOperation.java, is responding to client operation signinClientOp, which calls server operation signInOp to validate user right.
    • LogoffClientOp.java, is responding to client operation logoffClientOp, which calls server operation LogoutOp to log out.
  3. Right-click the BTTJumpStartSampleRCPClient Project, and select New > Package. In the dialog box that pops up, enter com.ibm.btt.jumpstart.sample.dialog in the Package field, and click Finish. Copy SignInDialog.java from <toolkit_root>\samples\BTTJumpStartSampleRCPClient.zip\ BTTJumpStartSampleRCPClient/src/com/ibm/btt/jumpstart/sample/dialog to com.ibm.btt.jumpstart.sample.dialog package of BTTJumpStartSampleRCPClient Project.
    1. In SignInDialog(Shell shell) method, a PropertyListener is added to listen PropertyConstants.LOGIN and PropertyConstants.CLOSE event, which will be fired in SignInComposite.
    2. In createDialogArea(Composite parent) method, SignInComposite is created.
    3. The handlePropertyChange(IPropertyValue value) method is invoked when PropertyConstants.LOGIN or PropertyConstants.CLOSE event is fired in SignInComposite.
  4. Right-click the BTTJumpStartSampleRCPClient Project, and select New > package. In the dialog box that pops up, enter com.ibm.btt.jumpstart.sample.composite in the Package field, and click Finish. Copy the SignInComposite.java from <toolkit_root>\samples\BTTJumpStartSampleRCPClient.zip\ BTTJumpStartSampleRCPClient/src/com/ibm/btt/jumpstart/sample/composite to the BTTJumpStartSampleRCPClient Project.
  5. Update SignInComposite.java:
    1. Import file import com.ibm.btt.jumpstart.sample.Activator to import com.ibm.btt.tools.aw.sample.Activator.
    2. Change the code in initialize() method from label.setImage(com.ibm.btt.jumpstart.sample.Activator.getImageDescriptor("icons/logo.jpg").createImage()); to label.setImage(com.ibm.btt.tools.aw.sample.Activator.getImageDescriptor("icons/logo.jpg").createImage());.
  6. The function of SignInComposite.java is as follows:
    1. In the initialize() method, keyReleased listeners are added to listen keyPressed event on User Name and Password field, which will enable Submit button when some conditions are met.
    2. In the initialize() method, widgetSelected listeners are added to listen mouse-click event on Cancel button, which will fire PropertyConstants.CLOSE event to SignInDialog.
    3. In the initialize() method, widgetSelected listeners are added to listen mouse-click event on Login button, which will call shandleLogin() method.
    4. In the handleLogin() method, the following functions are executed:
      1. Calls signinClientOp operation, which launches server side operation to authenticate the user name and password. If the authentication is successful, PropertyConstants.CLOSE event is fired to SignInDialog.
      2. Judges whether the user has the right to deal with override request or not, and sets the configuration of Override request view.
      3. Calls the Access Control function, and gets the item list which the user has right to use. The RCP framework will show the items in the list to the user.
    5. In addDisplayFilter() method, a global listener is added. When the "Alt+c" is pressed, current Active View is closed. When "Alt+n" is pressed, the mouse focus is moved to the Navigator bar.
  7. Update the content of start() method in com.ibm.btt.tools.aw.sample.Activator.java of BTTJumpStartSampleRCPClient Project. Add the following method:
    private String currentUser = "user01";
    public String getCurrentUser() {
    	return this.currentUser;
    }
    
    public void setCurrentUser(String user) {
    	this.currentUser = user;
    	BCActivity.setUserID(user);
    	}


Feedback