Пример #1
0
  private String showMainPage(
      Context context, ModelMap model, HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException, SQLException, AuthorizeException {
    Group[] groups = Group.findAll(context, Group.NAME);

    // if( groups == null ) { System.out.println("groups are null"); }
    // else System.out.println("# of groups: " + groups.length);
    model.addAttribute("groups", groups);
    context.commit();
    return "pages/admin/group-list";
  }
  /**
   * Displays the form to link groups to workspace items
   *
   * @param context the context of the request
   * @param request the servlet request
   * @param response the servlet response
   */
  private void showLinkPage(
      Context context, HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException, SQLException, AuthorizeException {
    // get all the groups
    Group[] groups = Group.findAll(context, 1);

    // get all the workspace items
    WorkspaceItem[] wsItems = WorkspaceItem.findAll(context);

    // set the attributes for the JSP
    request.setAttribute("groups", groups);
    request.setAttribute("wsItems", wsItems);

    JSPManager.showJSP(request, response, "/dspace-admin/supervise-link.jsp");
  }