/**
   * Create ContactPersonDataType from Rolodex object
   *
   * @param person Rolodex
   * @return ContactPersonDataType created from Rolodex object
   */
  public ContactPersonDataType getContactPersonDataType(Rolodex rolodex) {

    ContactPersonDataType contactPerson = ContactPersonDataType.Factory.newInstance();
    if (rolodex != null) {

      contactPerson.setName(getHumanNameDataType(rolodex));
      String phone = rolodex.getPhoneNumber();
      if (phone != null && !phone.equals("")) {
        contactPerson.setPhone(phone);
      }
      String fax = rolodex.getFaxNumber();
      if (fax != null && !fax.equals("")) {
        contactPerson.setFax(fax);
      }
      String email = rolodex.getEmailAddress();
      if (email != null && !email.equals("")) {
        contactPerson.setEmail(rolodex.getEmailAddress());
      }
      String title = rolodex.getTitle();
      if (title != null && !title.equals("")) {
        contactPerson.setTitle(title);
      }
      contactPerson.setAddress(getAddressDataType(rolodex));
    }
    return contactPerson;
  }
  /**
   * Create a HumanNameDataType from Rolodex object
   *
   * @param rolodex Rolodex object
   * @return HumanNameDataType corresponding to the rolodex object.
   */
  public HumanNameDataType getHumanNameDataType(Rolodex rolodex) {

    HumanNameDataType humanName = HumanNameDataType.Factory.newInstance();
    if (rolodex != null) {
      humanName.setFirstName(rolodex.getFirstName());
      humanName.setLastName(rolodex.getLastName());
      String middleName = rolodex.getMiddleName();
      if (middleName != null && !middleName.equals("")) {
        humanName.setMiddleName(middleName);
      }
    }
    return humanName;
  }
 protected HtmlData getPrincipalInvestigatorNameInquiryUrl(Award award) {
   HtmlData inquiryUrl = null;
   AwardPerson principalInvestigator = award.getPrincipalInvestigator();
   if (principalInvestigator != null) {
     if (StringUtils.isNotBlank(principalInvestigator.getPersonId())) {
       final KcPerson inqBo =
           this.kcPersonService.getKcPersonByPersonId(principalInvestigator.getPersonId());
       inquiryUrl = super.getInquiryUrl(inqBo, PERSON_ID);
     } else {
       if (principalInvestigator.getRolodexId() != null) {
         Rolodex inqBo = new Rolodex();
         inqBo.setRolodexId(principalInvestigator.getRolodexId());
         inquiryUrl = super.getInquiryUrl(inqBo, ROLODEX_ID);
       }
     }
   }
   return inquiryUrl;
 }
Example #4
0
 /**
  * . This is the Setter Method for siteInvestigator
  *
  * @param siteInvestigator The siteInvestigator to set.
  */
 public void setSiteInvestigator(Integer siteInvestigator) {
   if (siteInvestigator != null) {
     BusinessObjectService businessObjectService =
         KraServiceLocator.getService(BusinessObjectService.class);
     this.rolodex =
         (NonOrganizationalRolodex)
             businessObjectService.findByPrimaryKey(
                 NonOrganizationalRolodex.class,
                 getIdentifierMap(ROLODEX_ID_FIELD_NAME, siteInvestigator));
     this.siteInvestigatorId = rolodex.getRolodexId().toString();
   }
   this.siteInvestigator = siteInvestigator;
 }
Example #5
0
 /**
  * . This is the Getter Method for siteinvestigator
  *
  * @return Returns the siteInvestigator.
  */
 public Integer getSiteInvestigator() {
   if (siteInvestigator != null) {
     BusinessObjectService businessObjectService =
         KraServiceLocator.getService(BusinessObjectService.class);
     this.rolodex =
         (Rolodex)
             businessObjectService.findByPrimaryKey(
                 Rolodex.class, getIdentifierMap(ROLODEX_ID_FIELD_NAME, siteInvestigator));
     this.siteInvestigatorId = rolodex.getRolodexId().toString();
   } else {
     this.rolodex = null;
   }
   return siteInvestigator;
 }
  /**
   * Create AddressDataType from rolodex entry
   *
   * @param rolodex Rolodex entry
   * @return The AddressDataType corresponding to the rolodex entry.
   */
  public AddressDataType getAddressDataType(Rolodex rolodex) {

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

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

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

      String state = rolodex.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;
  }