@RequestMapping(value = "/parser/getModel", method = RequestMethod.GET) public String getModelAttrByUrl(@RequestParam("pageUrl") String url, Model model) { log.info(url); dao.clearModelAttr(); dao.downloadModelAttr(url); return "redirect:/parser"; }
@RequestMapping(value = "/parser", method = RequestMethod.GET) public String parse(Model model) { model.addAttribute("manufacturers", dao.getManufacturers()); model.addAttribute("models", dao.getModels()); model.addAttribute("bikeModel", dao.getModelAttr()); return "parser"; }
@RequestMapping(value = "/parser/getModelPages", method = RequestMethod.POST) public String getModelListByCheckbox( @ModelAttribute("checkedWrapper") CheckedWrapper manufacturers, BindingResult bindingResult, Model model) { if (bindingResult.hasErrors()) { model.addAttribute("bindRes", bindingResult); return "error"; } for (String manufacturerUrl : manufacturers.getManufacturersList()) { dao.downloadModels(manufacturerUrl); } return "redirect:/parser"; }
@RequestMapping(value = "/parser/saveModelAttr", method = RequestMethod.GET) public String saveModelAttr(Model model) { dao.saveModelAttr(); return "redirect:/parser"; }
@RequestMapping(value = "/parser/getModelsAttr", method = RequestMethod.GET) public String getModels(Model model) { dao.downloadModelsAttr(); return "redirect:/parser"; }
@RequestMapping(value = "/parser/clearModelList", method = RequestMethod.GET) public String clearModels(Model model) { dao.clearModels(); return "redirect:/parser"; }
@RequestMapping(value = "/parser/getModelPages", method = RequestMethod.GET) public String getModelsByManufacturer( @RequestParam("manufacturerUrl") String manufacturerUrl, Model model) { dao.downloadModels(manufacturerUrl); return "redirect:/parser"; }
@RequestMapping(value = "/parser/getManufacturerList", method = RequestMethod.GET) public String getManufacturers(Model model) { dao.downloadManufacturers(); return "redirect:/parser"; }