예제 #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);
 }