@RequestMapping("/admin_global/v_edit.do") public String edit( Integer id, Integer queryGroupId, Boolean queryDisabled, HttpServletRequest request, ModelMap model) { String queryUsername = RequestUtils.getQueryParam(request, "queryUsername"); String queryEmail = RequestUtils.getQueryParam(request, "queryEmail"); CmsUser currUser = CmsUtils.getUser(request); WebErrors errors = validateEdit(id, request); if (errors.hasErrors()) { return errors.showErrorPage(model); } CmsUser admin = manager.findById(id); List<CmsGroup> groupList = cmsGroupMng.getList(); List<CmsSite> siteList = cmsSiteMng.getList(); List<CmsRole> roleList = cmsRoleMng.getList(); model.addAttribute("cmsAdmin", admin); model.addAttribute("siteIds", admin.getSiteIds()); model.addAttribute("roleIds", admin.getRoleIds()); model.addAttribute("groupList", groupList); model.addAttribute("siteList", siteList); model.addAttribute("roleList", roleList); model.addAttribute("currRank", currUser.getRank()); model.addAttribute("queryUsername", queryUsername); model.addAttribute("queryEmail", queryEmail); model.addAttribute("queryGroupId", queryGroupId); model.addAttribute("queryDisabled", queryDisabled); return "admin/global/edit"; }
@RequestMapping("/admin_global/v_list.do") public String list( String queryUsername, String queryEmail, Integer queryGroupId, Boolean queryDisabled, Integer pageNo, HttpServletRequest request, ModelMap model) { CmsUser currUser = CmsUtils.getUser(request); Pagination pagination = manager.getPage( queryUsername, queryEmail, null, queryGroupId, queryDisabled, true, currUser.getRank(), cpn(pageNo), CookieUtils.getPageSize(request)); model.addAttribute("pagination", pagination); model.addAttribute("queryUsername", queryUsername); model.addAttribute("queryEmail", queryEmail); model.addAttribute("queryGroupId", queryGroupId); model.addAttribute("queryDisabled", queryDisabled); return "admin/global/list"; }
private WebErrors validateUpdate(Integer id, HttpServletRequest request) { WebErrors errors = WebErrors.create(request); CmsSite site = CmsUtils.getSite(request); if (vldExist(id, site.getId(), errors)) { return errors; } return errors; }
@RequestMapping("/advertising_space/v_list.do") public String list(Integer pageNo, HttpServletRequest request, ModelMap model) { CmsSite site = CmsUtils.getSite(request); Pagination pagination = manager.getPageList(site.getId(), cpn(pageNo), CookieUtils.getPageSize(request)); model.addAttribute("pagination", pagination); model.addAttribute("pageNo", pagination.getPageNo()); return "advertising_space/list"; }
@RequestMapping(value = "/lucene/v_index.do") public String index(HttpServletRequest request, ModelMap model) { CmsSite site = CmsUtils.getSite(request); List<Channel> topList = channelMng.getTopList(site.getId(), true); List<Channel> channelList = Channel.getListForSelect(topList, null, true); model.addAttribute("site", site); model.addAttribute("channelList", channelList); return "lucene/index"; }
private WebErrors validateDelete(Integer[] ids, HttpServletRequest request) { WebErrors errors = WebErrors.create(request); CmsSite site = CmsUtils.getSite(request); if (errors.ifEmpty(ids, "ids")) { return errors; } for (Integer id : ids) { vldExist(id, site.getId(), errors); } return errors; }
@RequestMapping("/admin_global/v_add.do") public String add(HttpServletRequest request, ModelMap model) { CmsUser currUser = CmsUtils.getUser(request); List<CmsGroup> groupList = cmsGroupMng.getList(); List<CmsSite> siteList = cmsSiteMng.getList(); List<CmsRole> roleList = cmsRoleMng.getList(); model.addAttribute("groupList", groupList); model.addAttribute("siteList", siteList); model.addAttribute("roleList", roleList); model.addAttribute("currRank", currUser.getRank()); return "admin/global/add"; }
private WebErrors validateSave(CmsAdvertisingSpace bean, HttpServletRequest request) { WebErrors errors = WebErrors.create(request); CmsSite site = CmsUtils.getSite(request); bean.setSite(site); return errors; }