Ejemplo n.º 1
0
  @RequestMapping("user-status-list")
  public String list(
      @ModelAttribute Page page, @RequestParam Map<String, Object> parameterMap, Model model) {
    List<PropertyFilter> propertyFilters = PropertyFilter.buildFromMap(parameterMap);
    propertyFilters.add(new PropertyFilter("EQS_scopeId", ScopeHolder.getScopeId()));
    page = userStatusManager.pagedQuery(page, propertyFilters);

    List<UserStatus> userStatuses = (List<UserStatus>) page.getResult();
    List<UserStatusDTO> userStatusDtos =
        userStatusConverter.createUserStatusDtos(
            userStatuses, ScopeHolder.getUserRepoRef(), ScopeHolder.getScopeId());
    page.setResult(userStatusDtos);
    model.addAttribute("page", page);

    return "auth/user-status-list";
  }
Ejemplo n.º 2
0
  @RequestMapping("user-status-export")
  public void export(
      @ModelAttribute Page page,
      @RequestParam Map<String, Object> parameterMap,
      HttpServletResponse response)
      throws Exception {
    List<PropertyFilter> propertyFilters = PropertyFilter.buildFromMap(parameterMap);
    page = userStatusManager.pagedQuery(page, propertyFilters);

    List<UserStatus> userStatuses = (List<UserStatus>) page.getResult();
    List<UserStatusDTO> userStatusDtos =
        userStatusConverter.createUserStatusDtos(
            userStatuses, ScopeHolder.getUserRepoRef(), ScopeHolder.getScopeId());
    TableModel tableModel = new TableModel();
    tableModel.setName("user status");
    tableModel.addHeaders("id", "username", "enabled", "authorities");
    tableModel.setData(userStatusDtos);
    exportor.export(response, tableModel);
  }