Customer List Feature Overview
Overview
The Customer List in the WebUI is a feature that allows users to view and manage a list of customers. It retrieves customer data from the backend and displays it in a user-friendly format. The Customer List can be filtered by customer name or customer number to narrow down the search results. It also provides functionality to count the number of customers that match the given filter criteria.
Implementation
The Customer List is implemented in the CustomerListCustomerListCustomerResourceCustomer
The CustomerListCustomerResourceCustomer
public class CustomerList
{
private static Logger logger = Logger
.getLogger("com.ibm.cics.cip.bankliberty.webui.dataAccess");
private List<Customer> listOfCustomers = new ArrayList<>();
private static String sortcode = null;
private int count;
private static final String JSON_SORT_CODE = "sortCode";
private static final String JSON_ID = "id";
private static final String JSON_CUSTOMER_NAME = "customerName";
private static final String JSON_CUSTOMER_ADDRESS = "customerAddress";
Main Functions
There are several main functions in the CustomerListgetCounthowManydoGetgetCustomersizegetCounthowMany
getCount
getCountThe getCounthowMany
The getCounthowMany
public int getCount(String filter)
{
if (this.listOfCustomers.isEmpty())
{
howMany(filter);
}
return this.count;
}
howMany
howManyThe howManyCustomerResource
The howManyCustomerResource
private void howMany(String filter)
{
CustomerResource myCustomerResource = new CustomerResource();
Response myCustomerResponse = null;
// 0123456789012345678901234
try
{
if (filter.startsWith(" AND CUSTOMER_NAME like '"))
{
String customerNameFilter = filter.substring(25);
customerNameFilter = customerNameFilter.substring(0,
customerNameFilter.length() - 1);
myCustomerResponse = myCustomerResource
.getCustomersByNameExternal(customerNameFilter, 0, 0,
true);
String myCustomersString = myCustomerResponse.getEntity()
doGet
doGetThe doGetCustomerResource
The doGetCustomerResource
public void doGet(int limit, int offset, String filter) throws IOException
{
CustomerResource myCustomerResource = new CustomerResource();
Response myCustomerResponse = null;
String myCustomerString = null;
try
{
if (filter.length() == 0)
{
myCustomerResponse = myCustomerResource
.getCustomersExternal(limit, offset, false);
}
if (filter.startsWith(" AND CUSTOMER_NUMBER = "))
{
getCustomer
getCustomerThe getCustomer
The getCustomer
public Customer getCustomer(int i)
{
return this.listOfCustomers.get(i);
}
size
The size
The size
public int size()
{
return this.listOfCustomers.size();
}
This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human