1 40 41 package org.dspace.app.webui.servlet.admin; 42 43 import java.io.IOException ; 44 import java.sql.SQLException ; 45 import javax.servlet.ServletException ; 46 import javax.servlet.http.HttpServletRequest ; 47 import javax.servlet.http.HttpServletResponse ; 48 49 import org.dspace.app.webui.servlet.DSpaceServlet; 50 import org.dspace.app.webui.util.JSPManager; 51 import org.dspace.app.webui.util.UIUtil; 52 import org.dspace.authorize.AuthorizeException; 53 import org.dspace.core.Context; 54 import org.dspace.eperson.Group; 55 56 61 public class GroupListServlet extends DSpaceServlet 62 { 63 protected void doDSGet(Context context, 64 HttpServletRequest request, 65 HttpServletResponse response) 66 throws ServletException , IOException , SQLException , AuthorizeException 67 { 68 boolean multiple = UIUtil.getBoolParameter(request, "multiple"); 70 71 int sortBy = Group.NAME; 73 74 String sbParam = request.getParameter("sortby"); 75 76 if (sbParam != null && sbParam.equals("id")) 77 { 78 sortBy = Group.ID; 79 } 80 81 int first = UIUtil.getIntParameter(request, "first"); 83 if (first == -1) first = 0; 84 85 Group[] groups = Group.findAll(context, sortBy); 87 88 request.setAttribute("sortby", new Integer (sortBy)); 90 request.setAttribute("first", new Integer (first)); 91 request.setAttribute("groups", groups); 92 if (multiple) 93 { 94 request.setAttribute("multiple", new Boolean (true)); 95 } 96 97 JSPManager.showJSP(request, response, "/tools/group-select-list.jsp"); 98 } 99 } 100 | Popular Tags |