コード例 #1
0
  private boolean validateRolodex(
      PersonMassChange personMassChange, String propertyName, String typeText) {
    boolean isValid = true;

    if (!isReplaceeRolodex(
        personMassChange.getReplaceePersonId(), personMassChange.getReplaceeRolodexId())) {
      isValid = false;
      reportError(
          propertyName,
          KeyConstants.ERROR_PERSON_MASS_CHANGE_REPLACEE_SELECTION,
          EMPLOYEE,
          typeText);
    }

    if (!isReplacerRolodex(
        personMassChange.getReplacerPersonId(), personMassChange.getReplacerRolodexId())) {
      isValid = false;
      reportError(
          propertyName,
          KeyConstants.ERROR_PERSON_MASS_CHANGE_REPLACER_SELECTION,
          typeText,
          EMPLOYEE);
    }

    return isValid;
  }
コード例 #2
0
  private boolean validateReplaceeReplacer(PersonMassChange personMassChange) {
    boolean isValid = true;

    if (personMassChange.getReplaceePersonId() == null
        && personMassChange.getReplaceeRolodexId() == null) {
      isValid = false;
      reportError(REPLACEE_FULL_NAME_FIELD, KeyConstants.ERROR_PERSON_MASS_CHANGE_REPLACEE_EMPTY);
      return isValid;
    }

    if (personMassChange.getReplacerPersonId() == null
        && personMassChange.getReplacerRolodexId() == null) {
      isValid = false;
      reportError(REPLACER_FULL_NAME_FIELD, KeyConstants.ERROR_PERSON_MASS_CHANGE_REPLACER_EMPTY);
      return isValid;
    }

    if ((personMassChange.getReplacerPersonId() != null
            && StringUtils.equalsIgnoreCase(
                personMassChange.getReplacerPersonId(), personMassChange.getReplaceePersonId()))
        || (personMassChange.getReplacerRolodexId() != null
            && StringUtils.equalsIgnoreCase(
                String.valueOf(personMassChange.getReplacerRolodexId()),
                String.valueOf(personMassChange.getReplaceeRolodexId())))) {
      isValid = false;
      reportError(REPLACER_FULL_NAME_FIELD, KeyConstants.ERROR_PERSON_MASS_CHANGE_SAME_PERSONS);
    }

    return isValid;
  }
コード例 #3
0
  private boolean validateUnitAdministratorMassChange(PersonMassChange personMassChange) {
    boolean isValid = true;

    UnitAdministratorPersonMassChange unitPersonMassChange =
        personMassChange.getUnitAdministratorPersonMassChange();

    if (unitPersonMassChange.isAdministrativeOfficer()) {
      isValid &=
          validatePerson(
              personMassChange,
              UNIT_ADMINISTRATOR_ADMINISTRATIVE_OFFICER_FIELD,
              UNIT_ADMINISTRATOR_ADMINISTRATIVE_OFFICER);
    }

    if (unitPersonMassChange.isOspAdministrator()) {
      isValid &=
          validatePerson(
              personMassChange,
              UNIT_ADMINISTRATOR_OSP_ADMINISTRATOR_FIELD,
              UNIT_ADMINISTRATOR_OSP_ADMINISTRATOR);
    }

    if (unitPersonMassChange.isUnitHead()) {
      isValid &=
          validatePerson(
              personMassChange, UNIT_ADMINISTRATOR_UNIT_HEAD_FIELD, UNIT_ADMINISTRATOR_UNIT_HEAD);
    }

    if (unitPersonMassChange.isDeanVP()) {
      isValid &=
          validatePerson(
              personMassChange, UNIT_ADMINISTRATOR_DEAN_VP_FIELD, UNIT_ADMINISTRATOR_DEAN_VP);
    }

    if (unitPersonMassChange.isOtherIndividualToNotify()) {
      isValid &=
          validatePerson(
              personMassChange,
              UNIT_ADMINISTRATOR_OTHER_INDIVIDUAL_TO_NOTIFY_FIELD,
              UNIT_ADMINISTRATOR_OTHER_INDIVIDUAL_TO_NOTIFY);
    }

    if (unitPersonMassChange.isAdministrativeContact()) {
      isValid &=
          validatePerson(
              personMassChange,
              UNIT_ADMINISTRATOR_ADMINISTRATIVE_CONTACT_FIELD,
              UNIT_ADMINISTRATOR_ADMINISTRATIVE_CONTACT);
    }

    if (unitPersonMassChange.isFinancialContact()) {
      isValid &=
          validatePerson(
              personMassChange,
              UNIT_ADMINISTRATOR_FINANCIAL_CONTACT_FIELD,
              UNIT_ADMINISTRATOR_FINANCIAL_CONTACT);
    }

    return isValid;
  }
コード例 #4
0
  private boolean validateInstitutionalProposalMassChange(PersonMassChange personMassChange) {
    boolean isValid = true;

    InstitutionalProposalPersonMassChange institutionalProposalPersonMassChange =
        personMassChange.getInstitutionalProposalPersonMassChange();

    if (institutionalProposalPersonMassChange.isMailingInformation()) {
      isValid &=
          validateRolodex(
              personMassChange,
              INSTITUTIONAL_PROPOSAL_MAILING_INFORMATION_FIELD,
              INSTITUTIONAL_PROPOSAL_MAILING_INFORMATION);
    }

    if (institutionalProposalPersonMassChange.isUnitContact()) {
      isValid &=
          validatePerson(
              personMassChange,
              INSTITUTIONAL_PROPOSAL_UNIT_CONTACT_FIELD,
              INSTITUTIONAL_PROPOSAL_UNIT_CONTACT);
    }

    if (institutionalProposalPersonMassChange.isIpReviewer()) {
      isValid &=
          validatePerson(
              personMassChange,
              INSTITUTIONAL_PROPOSAL_IP_REVIEWER_FIELD,
              INSTITUTIONAL_PROPOSAL_IP_REVIEWER);
    }

    return isValid;
  }
コード例 #5
0
  private boolean validateNegotiationMassChange(PersonMassChange personMassChange) {
    boolean isValid = true;

    NegotiationPersonMassChange negotiationPersonMassChange =
        personMassChange.getNegotiationPersonMassChange();

    if (negotiationPersonMassChange.isNegotiator()) {
      isValid &=
          validatePerson(personMassChange, NEGOTIATION_NEGOTIATOR_FIELD, NEGOTIATION_NEGOTIATOR);
    }

    return isValid;
  }
コード例 #6
0
  private boolean validateProposalDevelopmentMassChange(PersonMassChange personMassChange) {
    boolean isValid = true;

    ProposalDevelopmentPersonMassChange proposalDevelopmentPersonMassChange =
        personMassChange.getProposalDevelopmentPersonMassChange();

    if (proposalDevelopmentPersonMassChange.isMailingInformation()) {
      isValid &=
          validateRolodex(
              personMassChange,
              PROPOSAL_DEVELOPMENT_MAILING_INFORMATION_FIELD,
              PROPOSAL_DEVELOPMENT_MAILING_INFORMATION);
    }

    return isValid;
  }
コード例 #7
0
  private boolean validateAwardMassChange(PersonMassChange personMassChange) {
    boolean isValid = true;

    AwardPersonMassChange awardPersonMassChange = personMassChange.getAwardPersonMassChange();

    if (awardPersonMassChange.isUnitContact()) {
      isValid &= validatePerson(personMassChange, AWARD_UNIT_CONTACT_FIELD, AWARD_UNIT_CONTACT);
    }

    if (awardPersonMassChange.isSponsorContact()) {
      isValid &=
          validateRolodex(personMassChange, AWARD_SPONSOR_CONTACT_FIELD, AWARD_SPONSOR_CONTACT);
    }

    return isValid;
  }
コード例 #8
0
  private boolean validateSubawardMassChange(PersonMassChange personMassChange) {
    boolean isValid = true;

    SubawardPersonMassChange subawardPersonMassChange =
        personMassChange.getSubawardPersonMassChange();

    if (subawardPersonMassChange.isContact()) {
      isValid &= validateRolodex(personMassChange, SUBAWARD_CONTACT_FIELD, SUBAWARD_CONTACT);
    }

    if (subawardPersonMassChange.isRequisitioner()) {
      isValid &=
          validatePerson(personMassChange, SUBAWARD_REQUISITIONER_FIELD, SUBAWARD_REQUISITIONER);
    }

    return isValid;
  }