if(towns != null && towns.size() > 0) {
town = towns.get(0);
region = this.serviceLocator.getTransversalService().getRegionsMap().get(locale.getLanguage()).get(town.getRegion());
province = this.serviceLocator.getTransversalService().getProvincesMap().get(locale.getLanguage()).get(town.getProvince());
}
CourseCatalog catalog = new CourseCatalog(course, locale.getLanguage(),
school, provider.getName(), province.getName(), region.getName(), town.getName());
CourseCatalog catalogOld =
this.serviceLocator.getCatalogService().getCourseCatalogByCourseId(course.getId(), locale);
if(catalogOld != null) {
catalog.setId(catalogOld.getId());
}
LOGGER.info(new StringBuffer("Fin generacion instancia de catalago del curso: ")
.append(course.getId()).append(" y locale: ").append(locale).toString());
this.serviceLocator.getCatalogService().save(catalog);