if (formId == null) {
l.warning("null form ID ");
//TODO throw execpton
}
else if (formId.equals(FormName.LOGIN.getId())) {
CustomerHandler h = new CustomerHandler(req);
return h.processLoginRequest();
}
else if (formId.equals(FormName.REGISTER.getId())) {
CustomerHandler h = new CustomerHandler(req);
return h.processRegistrationRequest();
}
else if (formId.equals(FormName.EDIT_CART.getId())) {
CartHandler ch = new CartHandler(req);
return ch.processUpdate();
}
else if (formId.equals(FormName.CUSTOMER_FEEDBACK.getId())) {
ServiceCaseHandler sch = new ServiceCaseHandler(req);
return sch.submitNewCase();
}
else if (formId.equals(FormName.ORDER_SHIPPING.getId())) {
OrderHandler oh = new OrderHandler(req);
return oh.processOrderShipppingRequest();
}
else if (formId.equals(FormName.ORDER_PAYMENT.getId())) {
OrderHandler oh = new OrderHandler(req);
return oh.processOrderPaymentRequest();
}
else if (formId.equals(FormName.ORDER_CONFIRM.getId())) {
OrderHandler oh = new OrderHandler(req);
return oh.processOrderConfirmationRequest();
}
else if (formId.equals(FormName.ADDRESS.getId())) {
AddressHandler oh = new AddressHandler(req);
return oh.processAddAddressRequest();
}
else if (formId.equals(FormName.CREDIT_CARD.getId())) {
CreditCardHandler cch = new CreditCardHandler(req);
return cch.processAddCardRequest();
}
else if (formId.equals(FormName.ADD_TO_CART.getId())) {
CartHandler ch = new CartHandler(req);
return ch.addProduct(null);
}
else if (formId.equals(FormName.ADD_TO_WISHLIST.getId())) {
WishListHandler wh = new WishListHandler(req);
return wh.addProduct(null);
}
else if (formId.equals(FormName.WISHLIST_TO_CART.getId())) {
WishListHandler wh = new WishListHandler(req);
return wh.moveSelectedToCart();
}
else if (formId.equals(FormName.SEARCH.getId())) {
ProductHandler ph = new ProductHandler(req);
return ph.search();
}
else if (formId.equals(FormName.FORGOT_PASSWORD.getId())) {
CustomerHandler ph = new CustomerHandler(req);
return ph.processPasswordRecovery();
}
else {
l.warning("unknown formId:"+formId);