Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
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;
 }
 /**
  * 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;
 }
Exemplo n.º 4
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;
 }