Ejemplo n.º 1
0
 private static int checkPassword(String userid, CandidateEntity candidate) {
   if ((candidate
       .getCandidateGeneralInformation()
       .getPassword()
       .equals(userid))) { // does the password match?
     if (candidate
         .getCandidateGeneralInformation()
         .getResetPassword()
         .equals("Y")) // and is it the first time logging in?
     return FIRST_TIME_LOGIN;
     else return LOGIN_SUCCESSFUL; // password matched and was not the first time login.
   } else {
     return LOGIN_FAILED; // password did not match.
   }
 }
Ejemplo n.º 2
0
  public static Document performUpdateGeneralInformationXMLInjection(CandidateEntity candidate) {

    Document targetXMLDoc = loadTargetXMLTemplate("templates/UpdateGeneralInfo.xml");
    // Inject general information
    injectElementValue(
        targetXMLDoc,
        candidate.getCandidateGeneralInformation().getDOEntityID(),
        XPathExpressions.getString("XMLInjector.candidateCommonReference"));
    injectElementValue(
        targetXMLDoc,
        candidate.getCandidateGeneralInformation().getEmergencyContactName(),
        XPathExpressions.getString("XMLInjector.emergencyContactName"));
    injectElementValue(
        targetXMLDoc,
        candidate.getCandidateGeneralInformation().getEmergencyContactPhone(),
        XPathExpressions.getString("XMLInjector.emergencyContactPhone"));

    return targetXMLDoc;
  }
Ejemplo n.º 3
0
  public static Document performUpdateCandidateXMLInjection(
      CandidateEntity candidate, String countryCode) {
    Document targetXMLDoc = loadTargetXMLTemplate("templates/UpdateDOCandidate.xml");
    CandidateGeneralInformation canGen = candidate.getCandidateGeneralInformation();

    CandidateProfile boProfile = candidate.getCandidateDetailsForCountry(countryCode);

    injectElementValue(
        targetXMLDoc,
        canGen.getDOEntityID(),
        XPathExpressions.getString("XMLInjector.candidateID"));
    injectElementValue(
        targetXMLDoc,
        boProfile.getCountryCode(),
        XPathExpressions.getString("XMLInjector.bocountry"));
    injectElementValue(
        targetXMLDoc,
        boProfile.isEighteenOrOlder(),
        XPathExpressions.getString("XMLInjector.over18"));
    injectElementValue(
        targetXMLDoc,
        boProfile.isLegallyEntiltedToWork(),
        XPathExpressions.getString("XMLInjector.rightToWork"));
    injectElementAttribute(
        targetXMLDoc,
        "different",
        boProfile.isPayAddressDifferentThanMain(),
        XPathExpressions.getString("XMLInjector.payAddressDifferent"));
    injectElementValue(
        targetXMLDoc, boProfile.isCitizen(), XPathExpressions.getString("XMLInjector.isCitizen"));
    injectElementValue(
        targetXMLDoc,
        boProfile.hasGovernmentID(),
        XPathExpressions.getString("XMLInjector.hasNationalID"));
    injectElementValue(
        targetXMLDoc,
        boProfile.hasWorkVisa(),
        XPathExpressions.getString("XMLInjector.hasWorkVisa"));
    injectElementValue(
        targetXMLDoc,
        boProfile.hasCriminalConvictions(),
        XPathExpressions.getString("XMLInjector.hasCriminalConviction"));
    injectElementValue(
        targetXMLDoc,
        boProfile.isWillingToTakeDrugTest(),
        XPathExpressions.getString("XMLInjector.willingDrugTest"));
    injectElementValue(
        targetXMLDoc,
        boProfile.acceptDirectDepositByEmail(),
        XPathExpressions.getString("XMLInjector.electronicStatement"));
    injectElementValue(
        targetXMLDoc,
        boProfile.getWorkVisaExpirationDateXMLValue(),
        XPathExpressions.getString("XMLInjector.workVisaExpiry"));

    injectElementValue(
        targetXMLDoc,
        boProfile.getPayrollAddress().getPostal_code(),
        XPathExpressions.getString("XMLInjector.payPostalCode"));
    injectElementValue(
        targetXMLDoc,
        boProfile.getPayrollAddress().getMunicipality(),
        XPathExpressions.getString("XMLInjector.payMunicipality"));
    injectElementValue(
        targetXMLDoc,
        boProfile.getPayrollAddress().getAddressLine1(),
        XPathExpressions.getString("XMLInjector.payAddressLine1"));
    injectElementValue(
        targetXMLDoc,
        boProfile.getPayrollAddress().getAddressLine2(),
        XPathExpressions.getString("XMLInjector.payAddressLine2"));

    //		System.out.println("INJECTOR:  "+boProfile.getPayrollAddress().getState_province());
    injectElementValue(
        targetXMLDoc,
        boProfile.getPayrollAddress().getState_province(),
        XPathExpressions.getString("XMLInjector.payRegion"));
    injectElementValue(
        targetXMLDoc,
        boProfile.getPayrollAddress().getCountry(),
        XPathExpressions.getString("XMLInjector.payCountryCode"));

    // System.out.println("UPDATE CANDIDATE");
    // System.out.println(targetXMLDoc.asXML());

    injectElementValue(
        targetXMLDoc, canGen.getDateOfBirthString(), XPathExpressions.getString("XMLInjector.dob"));

    return targetXMLDoc;
  }