@RequestMapping(value = "/feed", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseStatus(HttpStatus.OK)
public void loadFeed(@RequestParam Long providerId)
throws ParserConfigurationException, SAXException, IOException, Exception {
Provider provider = null;
CronTaskReport report = null;
Dump dump = null;
try {
provider = this.providerService.getProviderById(providerId, null);
// CRON REPORT
report = cronTaskReportService.create();
report.setObject_id(providerId);
report.setDate(new Date());
report.setType(CronTaskReport.TYPE.PROVIDER_FEED);
report.setDescription(new StringBuffer("Proveedor: ").append(provider.getName()).toString());
// DUMP
dump = this.dumpService.createDump();
String message = "Proceso de importacion del proveedor: " + provider.getName() + " (" +
provider.getId() + "-" + " " + ")";
dump.setDescription(message);
dump.setLaunched(Calendar.getInstance(new Locale("es")).getTime());
dump.setOwner(provider.getId());
dump.setOwnerClass(Provider.class.getName());
this.dumpService.save(dump);
// IMPORT PROVIDER'S SCHOOLS FROM FEED
providerImporter.importSchools(provider, dump);