String townName = school.getContactInfo() != null &&
school.getContactInfo().getCity() != null ? school.getContactInfo().getCity() : "";
List<Town> towns = territorialService.findTownsByName(townName, locale);
Town town = new Town();
Province province = new Province();
Region region = new Region();
if(towns != null && towns.size() > 0) {
town = towns.get(0);
region = this.getRegionsMap().get(locale.getLanguage()).get(town.getRegion());
province = this.getProvincesMap().get(locale.getLanguage()).get(town.getProvince());
}
List<CourseCatalog> catCourses = new ArrayList<CourseCatalog>();
for(Course course : courses) {
CourseCatalog catalog = new CourseCatalog(course, locale.getLanguage(),
school, provider.getName(), province.getName(), region.getName(), town.getName());
CourseCatalog catalogOld = catalogService.getCourseCatalogByCourseId(course.getId(), locale);
if(catalogOld != null) {
catalog.setId(catalogOld.getId());
}
catCourses.add(catalog);