package net.sourceforge.fenixedu.dataTransferObject.administrativeOffice; import java.io.Serializable; import net.sourceforge.fenixedu.domain.Country; import net.sourceforge.fenixedu.domain.County; import net.sourceforge.fenixedu.domain.District; import net.sourceforge.fenixedu.domain.DomainReference; import net.sourceforge.fenixedu.domain.LiteraryHabilitationType; import net.sourceforge.fenixedu.domain.Parish; import net.sourceforge.fenixedu.domain.Person; import net.sourceforge.fenixedu.domain.ProfessionConditionType; import net.sourceforge.fenixedu.domain.ProfessionSectorType; import net.sourceforge.fenixedu.domain.contacts.PhysicalAddress; import org.joda.time.YearMonthDay; /** * * @author rjmvo * */ public class StudentPersonalInfoBean implements Serializable { private YearMonthDay dateOfBirth; private DomainReference districtOfBirth; private DomainReference countyOfBirth; private DomainReference parishOfBirth; private DomainReference countryOfBirth; private DomainReference nationality; private DomainReference secondNationality; private String fatherName; private String fatherProfession; private ProfessionConditionType fatherProfessionConditionType; private ProfessionSectorType fatherProfessionSectorType; private LiteraryHabilitationType fatherLiteraryHabilitationType; private String motherName; private String motherProfession; private ProfessionConditionType motherProfessionConditionType; private ProfessionSectorType motherProfessionSectorType; private LiteraryHabilitationType motherLiteraryHabilitationType; private String address; private String areaCode; // zip code private String locationOfAreaCode; // location of zip code private String location; // location private DomainReference districtOfResidence; private DomainReference countyOfResidence; private DomainReference parishOfResidence; private DomainReference countryOfResidence; public StudentPersonalInfoBean() { } public StudentPersonalInfoBean(Person person) { setDateOfBirth(person.getDateOfBirthYearMonthDay()); setParishOfBirth(Parish.readParishByName(person.getParishOfBirth())); setCountyOfBirth(County.readCountyByName(person.getDistrictSubdivisionOfBirth())); setDistrictOfBirth(District.readDistrictByName(person.getDistrictOfBirth())); setCountryOfBirth(person.getCountryOfBirth()); setNationality(person.getCountry()); setSecondNationality(person.getSecondNationality()); setFatherName(person.getNameOfFather()); setFatherProfession(person.getFatherProfession()); setFatherProfessionConditionType(person.getFatherProfessionConditionType()); setFatherProfessionSectorType(person.getFatherProfessionSectorType()); setFatherLiteraryHabilitationType(person.getFatherLiteraryHabilitationType()); setMotherName(person.getNameOfMother()); setMotherProfession(person.getMotherProfession()); setMotherProfessionConditionType(person.getMotherProfessionConditionType()); setMotherProfessionSectorType(person.getMotherProfessionSectorType()); setMotherLiteraryHabilitationType(person.getMotherLiteraryHabilitationType()); if (person.hasDefaultPhysicalAddress()) { PhysicalAddress physicalAddress = person.getDefaultPhysicalAddress(); setAddress(physicalAddress.getAddress()); setLocation(physicalAddress.getArea()); setAreaCode(physicalAddress.getAreaCode()); setLocationOfAreaCode(physicalAddress.getAreaOfAreaCode()); setParishOfResidence(Parish.readParishByName(physicalAddress.getParishOfResidence())); setCountyOfResidence(County.readCountyByName(physicalAddress.getDistrictSubdivisionOfResidence())); setDistrictOfResidence(District.readDistrictByName(physicalAddress.getDistrictOfResidence())); setCountryOfResidence(physicalAddress.getCountryOfResidence()); } } public YearMonthDay getDateOfBirth() { return dateOfBirth; } public void setDateOfBirth(YearMonthDay dateOfBirth) { this.dateOfBirth = dateOfBirth; } public District getDistrictOfBirth() { return districtOfBirth == null ? null : districtOfBirth.getObject(); } public void setDistrictOfBirth(District districtOfBirth) { this.districtOfBirth = districtOfBirth == null ? null : new DomainReference(districtOfBirth); } public County getCountyOfBirth() { return countyOfBirth == null ? null : countyOfBirth.getObject(); } public void setCountyOfBirth(County county) { countyOfBirth = county == null ? null : new DomainReference(county); } public Parish getParishOfBirth() { return parishOfBirth == null ? null : parishOfBirth.getObject(); } public void setParishOfBirth(Parish parishOfBirth) { this.parishOfBirth = parishOfBirth == null ? null : new DomainReference(parishOfBirth); } public Country getCountryOfBirth() { return countryOfBirth == null ? null : countryOfBirth.getObject(); } public void setCountryOfBirth(Country countryOfBirth) { this.countryOfBirth = countryOfBirth == null ? null : new DomainReference(countryOfBirth); } public Country getNationality() { return nationality == null ? null : nationality.getObject(); } public void setNationality(Country nationality) { this.nationality = nationality == null ? null : new DomainReference(nationality); } public Country getSecondNationality() { return secondNationality == null ? null : secondNationality.getObject(); } public void setSecondNationality(Country secondNationality) { this.secondNationality = secondNationality == null ? null : new DomainReference(secondNationality); } public String getFatherName() { return fatherName; } public void setFatherName(String fatherName) { this.fatherName = fatherName; } public String getFatherProfession() { return fatherProfession; } public void setFatherProfession(String fatherProfession) { this.fatherProfession = fatherProfession; } public ProfessionConditionType getFatherProfessionConditionType() { return fatherProfessionConditionType; } public void setFatherProfessionConditionType(ProfessionConditionType type) { fatherProfessionConditionType = type; } public ProfessionSectorType getFatherProfessionSectorType() { return fatherProfessionSectorType; } public void setFatherProfessionSectorType(ProfessionSectorType type) { fatherProfessionSectorType = type; } public LiteraryHabilitationType getFatherLiteraryHabilitationType() { return fatherLiteraryHabilitationType; } public void setFatherLiteraryHabilitationType(LiteraryHabilitationType type) { fatherLiteraryHabilitationType = type; } public String getMotherName() { return motherName; } public void setMotherName(String motherName) { this.motherName = motherName; } public String getMotherProfession() { return motherProfession; } public void setMotherProfession(String motherProfession) { this.motherProfession = motherProfession; } public ProfessionConditionType getMotherProfessionConditionType() { return motherProfessionConditionType; } public void setMotherProfessionConditionType(ProfessionConditionType type) { motherProfessionConditionType = type; } public ProfessionSectorType getMotherProfessionSectorType() { return motherProfessionSectorType; } public void setMotherProfessionSectorType(ProfessionSectorType type) { motherProfessionSectorType = type; } public LiteraryHabilitationType getMotherLiteraryHabilitationType() { return motherLiteraryHabilitationType; } public void setMotherLiteraryHabilitationType(LiteraryHabilitationType type) { motherLiteraryHabilitationType = type; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getLocation() { return location; } public void setLocation(String location) { this.location = location; } public String getAreaCode() { return areaCode; } public void setAreaCode(String areaCode) { this.areaCode = areaCode; } public String getLocationOfAreaCode() { return locationOfAreaCode; } public void setLocationOfAreaCode(String locationOfAreaCode) { this.locationOfAreaCode = locationOfAreaCode; } public District getDistrictOfResidence() { return districtOfResidence == null ? null : districtOfResidence.getObject(); } public void setDistrictOfResidence(District district) { districtOfResidence = district == null ? null : new DomainReference(district); } public County getCountyOfResidence() { return countyOfResidence == null ? null : countyOfResidence.getObject(); } public void setCountyOfResidence(County county) { countyOfResidence = county == null ? null : new DomainReference(county); } public Parish getParishOfResidence() { return parishOfResidence == null ? null : parishOfResidence.getObject(); } public void setParishOfResidence(Parish parish) { parishOfResidence = parish == null ? null : new DomainReference(parish); } public Country getCountryOfResidence() { return countryOfResidence == null ? null : countryOfResidence.getObject(); } public void setCountryOfResidence(Country countryOfResidence) { this.countryOfResidence = countryOfResidence == null ? null : new DomainReference(countryOfResidence); } }