return formation;
}
private static void setInstitution(AlumniFormation bean, Formation dbFormation) {
Unit institution = dbFormation.getInstitution();
if (institution instanceof AcademicalInstitutionUnit) {
AcademicalInstitutionType academicalInstitutionType = dbFormation.getInstitutionType();
switch (academicalInstitutionType) {
case NATIONAL_PUBLIC_INSTITUTION:
case NATIONAL_PRIVATE_INSTITUTION:
if (AcademicalInstitutionUnit.readOfficialParentUnitsByType(academicalInstitutionType).contains(institution)) {
bean.setParentInstitution((AcademicalInstitutionUnit) institution);
bean.setInstitutionSchema("alumni.formation.national.institution.parent");
} else {
bean.setChildInstitution((AcademicalInstitutionUnit) institution);
bean.setInstitutionSchema("alumni.formation.national.institution.both");
}
break;
case FOREIGN_INSTITUTION:
setNonNationalInstitution(bean, institution, "alumni.formation.foreign.institution", dbFormation.getCountryUnit());
break;
case OTHER_INSTITUTION:
setNonNationalInstitution(bean, institution, "alumni.formation.other.institution", dbFormation.getCountryUnit());
break;
}
} else {
if (institution != null) {
bean.setForeignUnit(institution.getName());
if (institution.hasParentUnit(CountryUnit.getDefault())) {
bean.setInstitutionSchema("alumni.formation.other.institution");
} else {
bean.setInstitutionSchema("alumni.formation.foreign.institution");
}
} else {