public void loadProviderFeed(@RequestParam Long providerId, @RequestParam(required=false, defaultValue="false") String manual, @RequestParam(required=false, defaultValue="true") String register)
throws ParserConfigurationException, SAXException, IOException, Exception {
LOGGER.info("Updating provider with id: " + providerId);
Provider provider = null;
CronTaskReport report = null;
Dump dump = null;
try {
// CRON REPORT
report = cronTaskReportService.create();
provider = this.providerService.getProviderById(providerId, null);
report.setObject_id(providerId);
report.setDate(new Date());
if(("true").equals(manual)) {
report.setType(CronTaskReport.TYPE.INTERNAL_FEED);
} else {
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);