public static String validate(String data) { try { if (Utility.isEmpty(data)) { return "Title" + ValidationStatusConstant.NOT_EMPTY; } else if (Utility.checkSpecialCharacter(data)) { return "Title [" + data + "]" + ValidationStatusConstant.NOT_VALID_CHAR; } else { List<String> titles = new ArrayList<String>(); titles.add("MR"); titles.add("MRS"); titles.add("MS"); titles.add("DR"); if (!titles.contains(StringUtils.upper(data))) { return "Title [" + data + "] - Invalid title"; } } } catch (Exception ex) { return ex.toString(); } return null; }
/** Finds the error XML file in the specified folder */ private List<BaseError> findErrorXML(LoansXML request, String path) throws ServiceException { List<BaseError> results = new ArrayList<>(); ConfigCredential configCredential = boot.findMount(BayServConstants.rpgService, boot.findMasterEnvironment()); if (configCredential == null) { throw new ServiceException(ErrorCodes.EXA001); } AS400 as400 = AS400IFSUtil.connectToAS400( configCredential.getId(), configCredential.getIdentity(), configCredential.getCredential()); String exportPath = config.findServiceFeature(environmentConfig.getFeatures(), "ExportPath") + "/" + path + "/"; try { String result = StringUtils.leftPad(String.valueOf(request.getLoanID()), 10, '0'); String fileName = result + "err.xml"; fileName = exportPath + "/" + fileName; IFSFile ifsFile = new IFSFile(as400, fileName); if (ifsFile.exists()) { String xml = AS400IFSUtil.readFileToStringFromIFS(as400, fileName); ERRORSXML obj = fromXML(errorCtx, xml); for (ERROR err : obj.getERROR()) { BaseError res = new BaseError(); res.setCode(err.getERRORCODE()); res.setDescription(err.getERRORDESC()); res.setMessage(err.getFIELD()); results.add(res); } } AS400IFSUtil.disconnectAS400(as400); } catch (IOException e) { throw new ServiceException(ErrorCodes.COR027, e); } return results; }
/** * Saves the disbursement XML file in the specified folder * * @return a formatted loan reference number */ private String saveDisbursementFile(LoansXML request, String path) throws ServiceException { ConfigCredential configCredential = boot.findMount(BayServConstants.rpgService, boot.findMasterEnvironment()); if (configCredential == null) { throw new ServiceException(ErrorCodes.EXA001); } AS400 as400 = AS400IFSUtil.connectToAS400( configCredential.getId(), configCredential.getIdentity(), configCredential.getCredential()); String exportPath = config.findServiceFeature(environmentConfig.getFeatures(), "ExportPath") + "/" + path + "/"; String xml = renderDisbursementXML(request); String result = StringUtils.leftPad(String.valueOf(request.getLoanID()), 10, '0'); String fileName = result + ".xml"; fileName = exportPath + "/" + fileName; AS400IFSUtil.writeToIFS(as400, fileName, xml); AS400IFSUtil.disconnectAS400(as400); return result; }
public String getEftType() { return StringUtils.trim(eftType); }
public String getPostalAddress5() { return StringUtils.trim(postalAddress5); }
public String getFaxNumber() { return StringUtils.trim(faxNumber); }
public String getEmailAddress() { return StringUtils.trim(emailAddress); }
public String getWorkAreaCode() { return StringUtils.trim(workAreaCode); }
public String getFaxCountryCode() { return StringUtils.trim(faxCountryCode); }
public String getPositionHeldByIvw() { return StringUtils.trim(positionHeldByIvw); }
public String getHomeTelephone() { return StringUtils.trim(homeTelephone); }
public String getGeographicalArea() { return StringUtils.trim(geographicalArea); }
public String getInterviewer() { return StringUtils.trim(interviewer); }
public String getAccountHolder() { return StringUtils.trim(accountHolder); }
public String getAccountNumber() { return StringUtils.trim(accountNumber); }
public String getAccountType() { return StringUtils.trim(accountType); }
public String getHomeCountryCode() { return StringUtils.trim(homeCountryCode); }
public String getTrainedBy() { return StringUtils.trim(trainedBy); }
public String getHomeAreaCode() { return StringUtils.trim(homeAreaCode); }
public String getPositionheldByTrn() { return StringUtils.trim(positionheldByTrn); }
public String getWorkCountryCode() { return StringUtils.trim(workCountryCode); }
public String getDescription() { return StringUtils.trim(description); }
public String getWorkTelephone() { return StringUtils.trim(workTelephone); }
public String getAttention() { return StringUtils.trim(attention); }
public String getFaxAreaCode() { return StringUtils.trim(faxAreaCode); }
public String getPaymentMethod() { return StringUtils.trim(paymentMethod); }
public String getMobileNumber() { return StringUtils.trim(mobileNumber); }
public String getPhysicalAddress5() { return StringUtils.trim(physicalAddress5); }
public String getLanguage() { return StringUtils.trim(language); }
public String getBankCode() { return StringUtils.trim(bankCode); }