@RequiresPermissions("plug:resume:list") @RequestMapping("list.do") public String list( @PageableDefaults(sort = "id", sortDir = Direction.DESC) Pageable pageable, HttpServletRequest request, org.springframework.ui.Model modelMap) { Integer siteId = Context.getCurrentSiteId(request); Map<String, String[]> params = Servlets.getParameterValuesMap(request, Constants.SEARCH_PREFIX); Page<Resume> pagedList = service.findAll(siteId, params, pageable); modelMap.addAttribute("pagedList", pagedList); return "plug/resume/resume_list"; }
@RequiresPermissions("plug:resume:save") @RequestMapping("save.do") public String save( @Valid Resume bean, String redirect, HttpServletRequest request, RedirectAttributes ra) { Integer siteId = Context.getCurrentSiteId(request); service.save(bean, siteId); logger.info("save Resume, name={}.", bean.getName()); ra.addFlashAttribute(MESSAGE, SAVE_SUCCESS); if (Constants.REDIRECT_LIST.equals(redirect)) { return "redirect:list.do"; } else if (Constants.REDIRECT_CREATE.equals(redirect)) { return "redirect:create.do"; } else { ra.addAttribute("id", bean.getId()); return "redirect:edit.do"; } }
@RequiresPermissions("plug:resume:edit") @RequestMapping("edit.do") public String edit( Integer id, Integer position, @PageableDefaults(sort = "id", sortDir = Direction.DESC) Pageable pageable, HttpServletRequest request, org.springframework.ui.Model modelMap) { Integer siteId = Context.getCurrentSiteId(request); Resume bean = service.get(id); Map<String, String[]> params = Servlets.getParameterValuesMap(request, Constants.SEARCH_PREFIX); RowSide<Resume> side = service.findSide(siteId, params, bean, position, pageable.getSort()); modelMap.addAttribute("bean", bean); modelMap.addAttribute("side", side); modelMap.addAttribute("position", position); modelMap.addAttribute(OPRT, EDIT); return "plug/resume/resume_form"; }