/** * 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; }
/** * 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; }