/**
   * Create HumanNameDataType from DepartmentalPerson object
   *
   * @param person DepartmentalPerson
   * @return HumanNameDataType corresponding to the DepartmentalPerson object
   */
  public HumanNameDataType getHumanNameDataType(DepartmentalPerson person) {

    HumanNameDataType humanName = HumanNameDataType.Factory.newInstance();
    if (person != null) {
      humanName.setFirstName(person.getFirstName());
      humanName.setLastName(person.getLastName());
      String middleName = person.getMiddleName();
      if (middleName != null && !middleName.equals("")) {
        humanName.setMiddleName(middleName);
      }
    }
    return humanName;
  }
  /**
   * This method returns SignatureBlock informations including Name,Title and Signature for the
   * SignatureBlock.
   *
   * @return SignatureBlock authorized representative details.
   */
  private SignatureBlock getSignatureBlock() {

    SignatureBlock signatureBlock = SignatureBlock.Factory.newInstance();
    signatureBlock.setName(globLibV10Generator.getHumanNameDataType(aorInfo));

    if (aorInfo.getPrimaryTitle() != null) {
      if (aorInfo.getPrimaryTitle().length() > PRIMARY_TITLE_MAX_LENGTH) {
        signatureBlock.setTitle(aorInfo.getPrimaryTitle().substring(0, PRIMARY_TITLE_MAX_LENGTH));
      } else {
        signatureBlock.setTitle(aorInfo.getPrimaryTitle());
      }
    }
    signatureBlock.setSignature(aorInfo.getFullName());
    signatureBlock.setSignedDate(s2sUtilService.getCurrentCalendar());
    return signatureBlock;
  }
 /**
  * This method gives the Contact person information such as contact
  * Name,Phone,Fax,EmailAddress,Title,Address.
  *
  * @return ContactPersonInfo object containing contact person details.
  */
 private ContactPersonInfo getContactPersonInfo() {
   ContactPersonInfo contactPersonInfo = ContactPersonInfo.Factory.newInstance();
   DepartmentalPerson person = s2sUtilService.getContactPerson(pdDoc);
   contactPersonInfo.setContactName(globLibV20Generator.getHumanNameDataType(person));
   contactPersonInfo.setContactPhone(person.getOfficePhone());
   if (person.getFaxNumber() != null && !person.getFaxNumber().equals("")) {
     contactPersonInfo.setContactFax(person.getFaxNumber());
   }
   if (person.getEmailAddress() != null && !person.getEmailAddress().equals("")) {
     contactPersonInfo.setContactEmail(person.getEmailAddress());
   }
   contactPersonInfo.setContactTitle(person.getPrimaryTitle());
   contactPersonInfo.setContactAddress(globLibV20Generator.getAddressDataType(person));
   return contactPersonInfo;
 }
 public ContactPersonDataType getContactPersonDataType(
     ProposalDevelopmentDocument proposalDocument) {
   ContactPersonDataType contactPerson = ContactPersonDataType.Factory.newInstance();
   DepartmentalPerson person = s2sUtilService.getContactPerson(proposalDocument);
   if (person != null) {
     contactPerson.setName(getHumanNameDataType(person));
     String phone = person.getOfficePhone();
     if (phone != null && !phone.equals("")) {
       contactPerson.setPhone(phone);
     }
     String fax = person.getFaxNumber();
     if (fax != null && !fax.equals("")) {
       contactPerson.setFax(fax);
     }
     String email = person.getEmailAddress();
     if (email != null && !email.equals("")) {
       contactPerson.setEmail(person.getEmailAddress());
     }
     String title = person.getPrimaryTitle();
     if (title != null && !title.equals("")) {
       contactPerson.setTitle(title);
     }
     contactPerson.setAddress(getAddressDataType(person));
   }
   return contactPerson;
 }
示例#5
0
 /**
  * This method gives the information for an application which consists of personal details
  *
  * @return appInfo(ApplicantInfo) applicant details.
  */
 private ApplicantInfo getApplicationInfo() {
   ApplicantInfo appInfo = ApplicantInfo.Factory.newInstance();
   String contactType = getContactType();
   if (contactType.equals(CONTACT_TYPE_I)) {
     // use organization rolodex contact
     if (pdDoc.getDevelopmentProposal().getApplicantOrganization() != null) {
       appInfo.setContactPersonInfo(
           getContactInfo(pdDoc.getDevelopmentProposal().getApplicantOrganization().getRolodex()));
     }
   } else {
     // contact will come from unit or unit_administrators
     DepartmentalPerson depPerson = getContactPerson(pdDoc);
     ContactPersonInfo contactInfo = ContactPersonInfo.Factory.newInstance();
     if (depPerson != null) {
       contactInfo.setName(globLibV20Generator.getHumanNameDataType(depPerson));
       contactInfo.setPhone(depPerson.getOfficePhone());
       if (depPerson.getFaxNumber() != null) {
         contactInfo.setFax(depPerson.getFaxNumber());
       }
       if (depPerson.getEmailAddress() != null) {
         contactInfo.setEmail(depPerson.getEmailAddress());
       }
     }
     appInfo.setContactPersonInfo(contactInfo);
   }
   OrganizationDataType orgType = OrganizationDataType.Factory.newInstance();
   Rolodex rolodex =
       pdDoc.getDevelopmentProposal().getApplicantOrganization().getOrganization().getRolodex();
   orgType.setAddress(globLibV20Generator.getAddressDataType(rolodex));
   Organization organization =
       pdDoc.getDevelopmentProposal().getApplicantOrganization().getOrganization();
   if (organization != null) {
     orgType.setOrganizationName(organization.getOrganizationName());
     orgType.setDUNSID(organization.getDunsNumber());
   }
   if (pdDoc.getDevelopmentProposal().getOwnedByUnit() != null) {
     String departmentName = pdDoc.getDevelopmentProposal().getOwnedByUnit().getUnitName();
     if (departmentName != null && departmentName.length() > DEPARTMENT_NAME_MAX_LENGTH) {
       departmentName = departmentName.substring(0, DEPARTMENT_NAME_MAX_LENGTH - 1);
     }
     orgType.setDepartmentName(departmentName);
     // divisionName
     String divisionName = s2sUtilService.getDivisionName(pdDoc);
     if (divisionName != null) {
       orgType.setDivisionName(divisionName);
     }
   }
   appInfo.setOrganizationInfo(orgType);
   return appInfo;
 }
  /**
   * Create AddressDataType from rolodex entry
   *
   * @param depPerson Rolodex entry
   * @return The AddressDataType corresponding to the rolodex entry.
   */
  public AddressDataType getAddressDataType(DepartmentalPerson depPerson) {

    AddressDataType addressDataType = AddressDataType.Factory.newInstance();
    if (depPerson != null) {

      String street1 = depPerson.getAddress1();
      addressDataType.setStreet1(street1);
      String street2 = depPerson.getAddress2();
      if (street2 != null && !street2.equals("")) {
        addressDataType.setStreet2(street2);
      }
      String city = depPerson.getCity();
      addressDataType.setCity(city);
      String county = depPerson.getCounty();
      if (county != null && !county.equals("")) {
        addressDataType.setCounty(county);
      }

      String postalCode = depPerson.getPostalCode();
      if (postalCode != null && !postalCode.equals("")) {
        addressDataType.setZipPostalCode(postalCode);
      }
      String country = depPerson.getCountryCode();
      CountryCodeDataType.Enum countryCodeDataType = getCountryCodeDataType(country);
      addressDataType.setCountry(countryCodeDataType);

      String state = depPerson.getState();
      if (state != null && !state.equals("")) {
        if (countryCodeDataType != null) {
          if (countryCodeDataType.equals(CountryCodeDataType.USA_UNITED_STATES)) {
            addressDataType.setState(getStateCodeDataType(country, state));
          } else {
            addressDataType.setProvince(state);
          }
        }
      }
    }
    return addressDataType;
  }
示例#7
0
  /**
   * This method gives information of applications that are used in RRSF424
   *
   * @return rrSF424Document {@link XmlObject} of type RRSF424Document.
   */
  private RRSF424Document getRRSF424() {
    DevelopmentProposal devProp = pdDoc.getDevelopmentProposal();

    RRSF424Document rrSF424Document = RRSF424Document.Factory.newInstance();
    RRSF424 rrsf424 = RRSF424.Factory.newInstance();
    rrsf424.setFormVersion(S2SConstants.FORMVERSION_1_1);
    S2sOpportunity s2sOpportunity = devProp.getS2sOpportunity();
    if (s2sOpportunity != null && s2sOpportunity.getS2sSubmissionTypeCode() != null) {
      s2sOpportunity.refreshNonUpdateableReferences();
      rrsf424.setSubmissionTypeCode(
          SubmissionTypeDataType.Enum.forString(
              devProp.getS2sOpportunity().getS2sSubmissionType().getDescription()));
    }
    rrsf424.setSubmittedDate(Calendar.getInstance());
    Organization applicantOrganization = devProp.getApplicantOrganization().getOrganization();
    if (applicantOrganization != null && applicantOrganization.getRolodex() != null) {
      String state = applicantOrganization.getRolodex().getState();
      rrsf424.setStateID(state);
    }
    String federalId = proposalDevelopmentService.getFederalId(pdDoc);
    if (federalId != null) {
      if (federalId.length() > 30) {
        rrsf424.setFederalID(federalId.substring(0, 30));
      } else {
        rrsf424.setFederalID(federalId);
      }
    }
    rrsf424.setApplicantInfo(getApplicationInfo());
    rrsf424.setApplicantType(getApplicantType());
    rrsf424.setApplicationType(getApplicationType());
    boolean isNih =
        isSponsorInHierarchy(pdDoc.getDevelopmentProposal(), SPONSOR_GROUPS, SPONSOR_NIH);
    if (applicantOrganization != null) {
      if (applicantOrganization.getPhsAccount() != null && isNih) {
        rrsf424.setEmployerID(applicantOrganization.getPhsAccount());
      } else {
        rrsf424.setEmployerID(applicantOrganization.getFedralEmployerId());
      }
    }
    Sponsor sponsor = devProp.getSponsor();
    if (sponsor != null) {
      rrsf424.setFederalAgencyName(sponsor.getSponsorName());
    }
    if (devProp.getCfdaNumber() != null) {
      rrsf424.setCFDANumber(devProp.getCfdaNumber());
    }
    if (devProp.getProgramAnnouncementTitle() != null) {
      String announcementTitle;
      if (devProp.getProgramAnnouncementTitle().length() > 120) {
        announcementTitle = devProp.getProgramAnnouncementTitle().substring(0, 120);
      } else {
        announcementTitle = devProp.getProgramAnnouncementTitle();
      }
      rrsf424.setActivityTitle(announcementTitle);
    }
    rrsf424.setProjectTitle(devProp.getTitle());
    if (devProp.getProposalAbstracts() != null) {
      List<ProposalAbstract> proposalAbstractList = devProp.getProposalAbstracts();
      String state = "";
      for (ProposalAbstract proposalAbstract : proposalAbstractList) {
        if (proposalAbstract.getAbstractTypeCode().equals(AREAS_AFFECTED_ABSTRACT_TYPE_CODE))
          state = proposalAbstract.getAbstractDetails();
      }
      rrsf424.setLocation(state);
    }
    rrsf424.setProposedProjectPeriod(getProjectPeriod());
    rrsf424.setCongressionalDistrict(getCongDistrict());
    rrsf424.setPDPIContactInfo(getPDPI());
    try {
      rrsf424.setEstimatedProjectFunding(getProjectFunding());
    } catch (S2SException e) {
      LOG.error(e.getMessage(), e);
      return rrSF424Document;
    }
    rrsf424.setStateReview(getStateReview());
    // Value is hardcoded
    rrsf424.setTrustAgree(YesNoDataType.Y_YES);
    rrsf424.setAORInfo(getAORInfoType());
    for (Narrative narrative : devProp.getNarratives()) {
      AttachedFileDataType attachedFileDataType = null;
      switch (Integer.parseInt(narrative.getNarrativeTypeCode())) {
        case (PRE_APPLICATION):
          attachedFileDataType = getAttachedFileType(narrative);
          if (attachedFileDataType != null) {
            rrsf424.setPreApplicationAttachment(attachedFileDataType);
          }
          break;
        case (ADDITIONAL_CONGRESSIONAL_DESTRICT):
          attachedFileDataType = getAttachedFileType(narrative);
          if (attachedFileDataType != null) {
            rrsf424.setAdditionalCongressionalDistricts(attachedFileDataType);
          }
          break;
      }
    }
    if (departmentalPerson != null) {
      rrsf424.setAORSignature(departmentalPerson.getFullName());
    } else {
      rrsf424.setAORSignature("");
    }
    rrsf424.setAORSignedDate(Calendar.getInstance());
    rrSF424Document.setRRSF424(rrsf424);
    return rrSF424Document;
  }
示例#8
0
 /**
  * This method is used to get AOR Information for RRSf424
  *
  * @return aorInfoType(AORInfoType) Authorized representative information.
  */
 private AORInfoType getAORInfoType() {
   ProposalSite applicantOrganization = pdDoc.getDevelopmentProposal().getApplicantOrganization();
   AORInfoType aorInfoType = AORInfoType.Factory.newInstance();
   if (departmentalPerson != null) {
     aorInfoType.setName(globLibV20Generator.getHumanNameDataType(departmentalPerson));
     if (departmentalPerson.getPrimaryTitle() != null) {
       if (departmentalPerson.getPrimaryTitle().length() > PRIMARY_TITLE_MAX_LENGTH) {
         aorInfoType.setTitle(
             departmentalPerson.getPrimaryTitle().substring(0, PRIMARY_TITLE_MAX_LENGTH));
       } else {
         aorInfoType.setTitle(departmentalPerson.getPrimaryTitle());
       }
     } else {
       aorInfoType.setTitle("");
     }
     AddressDataType address = AddressDataType.Factory.newInstance();
     address.setStreet1(departmentalPerson.getAddress1());
     address.setStreet2(departmentalPerson.getAddress2());
     address.setCity(departmentalPerson.getCity());
     if (departmentalPerson.getState() != null) {
       address.setState(
           globLibV20Generator.getStateCodeDataType(
               departmentalPerson.getCountryCode(), departmentalPerson.getState()));
     }
     address.setZipPostalCode(departmentalPerson.getPostalCode());
     if (departmentalPerson.getCountryCode() != null) {
       address.setCountry(
           globLibV20Generator.getCountryCodeDataType(departmentalPerson.getCountryCode()));
     }
     aorInfoType.setAddress(address);
     aorInfoType.setPhone(departmentalPerson.getOfficePhone());
     aorInfoType.setFax(departmentalPerson.getFaxNumber());
     aorInfoType.setDepartmentName(departmentalPerson.getDirDept());
     aorInfoType.setEmail(departmentalPerson.getEmailAddress());
     if (departmentalPerson.getHomeUnit() != null) {
       aorInfoType.setDivisionName(departmentalPerson.getHomeUnit());
     }
   }
   if (applicantOrganization != null) {
     aorInfoType.setOrganizationName(applicantOrganization.getLocationName());
   }
   return aorInfoType;
 }