Пример #1
0
 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;
 }
Пример #2
0
  /** 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;
  }
Пример #3
0
  /**
   * 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;
  }
Пример #4
0
 public String getEftType() {
   return StringUtils.trim(eftType);
 }
Пример #5
0
 public String getPostalAddress5() {
   return StringUtils.trim(postalAddress5);
 }
Пример #6
0
 public String getFaxNumber() {
   return StringUtils.trim(faxNumber);
 }
Пример #7
0
 public String getEmailAddress() {
   return StringUtils.trim(emailAddress);
 }
Пример #8
0
 public String getWorkAreaCode() {
   return StringUtils.trim(workAreaCode);
 }
Пример #9
0
 public String getFaxCountryCode() {
   return StringUtils.trim(faxCountryCode);
 }
Пример #10
0
 public String getPositionHeldByIvw() {
   return StringUtils.trim(positionHeldByIvw);
 }
Пример #11
0
 public String getHomeTelephone() {
   return StringUtils.trim(homeTelephone);
 }
Пример #12
0
 public String getGeographicalArea() {
   return StringUtils.trim(geographicalArea);
 }
Пример #13
0
 public String getInterviewer() {
   return StringUtils.trim(interviewer);
 }
Пример #14
0
 public String getAccountHolder() {
   return StringUtils.trim(accountHolder);
 }
Пример #15
0
 public String getAccountNumber() {
   return StringUtils.trim(accountNumber);
 }
Пример #16
0
 public String getAccountType() {
   return StringUtils.trim(accountType);
 }
Пример #17
0
 public String getHomeCountryCode() {
   return StringUtils.trim(homeCountryCode);
 }
Пример #18
0
 public String getTrainedBy() {
   return StringUtils.trim(trainedBy);
 }
Пример #19
0
 public String getHomeAreaCode() {
   return StringUtils.trim(homeAreaCode);
 }
Пример #20
0
 public String getPositionheldByTrn() {
   return StringUtils.trim(positionheldByTrn);
 }
Пример #21
0
 public String getWorkCountryCode() {
   return StringUtils.trim(workCountryCode);
 }
Пример #22
0
 public String getDescription() {
   return StringUtils.trim(description);
 }
Пример #23
0
 public String getWorkTelephone() {
   return StringUtils.trim(workTelephone);
 }
Пример #24
0
 public String getAttention() {
   return StringUtils.trim(attention);
 }
Пример #25
0
 public String getFaxAreaCode() {
   return StringUtils.trim(faxAreaCode);
 }
Пример #26
0
 public String getPaymentMethod() {
   return StringUtils.trim(paymentMethod);
 }
Пример #27
0
 public String getMobileNumber() {
   return StringUtils.trim(mobileNumber);
 }
Пример #28
0
 public String getPhysicalAddress5() {
   return StringUtils.trim(physicalAddress5);
 }
Пример #29
0
 public String getLanguage() {
   return StringUtils.trim(language);
 }
Пример #30
0
 public String getBankCode() {
   return StringUtils.trim(bankCode);
 }