Skip to main content

Web UI Overview

Web UI Overview

The Web UI is part of the CICS Bank Sample Application (CBSA) and is implemented using the WebSphere Liberty Profile application. It includes various web resources such as HTML files, images, and JSON manifests that define the structure and appearance of the web interface. The Web UI provides a user-friendly interface for interacting with the bank's functionalities, allowing users to perform tasks such as viewing account information and processing transactions. The source code for the Web UI is organized under the src/webui/ directory, which contains all the necessary files and directories to build and deploy the web application.

Web UI Endpoints

The Web UI includes several endpoints that facilitate interaction with the bank's functionalities. These endpoints are implemented as RESTful APIs and are defined in the src/webui/src/main/java/com/ibm/cics/cip/bankliberty/api/json/ directory.

getAccountCounter

The getAccountCounter endpoint is a GET request that retrieves the current account counter. It uses the Program class to link to a COBOL program named NEWACCNO to get the account number.


The getAccountCounter endpoint implementation shows how the Program class is used to link to the COBOL program NEWACCNO and retrieve the account number.

	@GET
@Path("/account")
@Produces("application/json")
public Response getAccountCounter()
{
logger.entering(this.getClass().getName(), GET_ACCOUNT_COUNTER);
JSONObject response = new JSONObject();
Response myResponse = null;

Program newaccnoProgam = new Program();
newaccnoProgam.setName(NEWACCNO);

NewAccountNumber myNEWACCNO = new NewAccountNumber();

myNEWACCNO.setNewaccnoFunction("C");
byte[] data = myNEWACCNO.getByteBuffer();
try
{
newaccnoProgam.link(data);
myNEWACCNO = new NewAccountNumber(data);
logger.fine(NEW_ACCNO_PREFIX + myNEWACCNO.getAccountNumber());

createCustomerExternal

The createCustomerExternal endpoint is a POST request that creates a new customer. It calls the createCustomerInternal method to handle the creation logic and then terminates the HBankDataAccess session.


The createCustomerExternal endpoint implementation demonstrates how the createCustomerInternal method is called to handle the creation logic and how the HBankDataAccess session is terminated.

	@POST
@Produces(MediaType.APPLICATION_JSON)
public Response createCustomerExternal(CustomerJSON customer)
{
logger.entering(this.getClass().getName(),
CREATE_CUSTOMER_EXTERNAL + customer.toString());
Response myResponse = createCustomerInternal(customer);
HBankDataAccess myHBankDataAccess = new HBankDataAccess();
myHBankDataAccess.terminate();
logger.exiting(this.getClass().getName(), CREATE_CUSTOMER_EXTERNAL_EXIT,
myResponse);
return myResponse;

 

This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human