1 40 package org.dspace.app.webui.servlet.admin; 41 42 import java.io.IOException ; 43 import java.sql.SQLException ; 44 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.EPerson; 55 56 62 public class EPersonListServlet extends DSpaceServlet 63 { 64 protected void doDSGet(Context context, HttpServletRequest request, 65 HttpServletResponse response) throws ServletException , IOException , 66 SQLException , AuthorizeException 67 { 68 boolean multiple = UIUtil.getBoolParameter(request, "multiple"); 70 71 int sortBy = EPerson.LASTNAME; 73 74 String sbParam = request.getParameter("sortby"); 75 76 if ((sbParam != null) && sbParam.equals("lastname")) 77 { 78 sortBy = EPerson.LASTNAME; 79 } 80 else if ((sbParam != null) && sbParam.equals("email")) 81 { 82 sortBy = EPerson.EMAIL; 83 } 84 else if ((sbParam != null) && sbParam.equals("id")) 85 { 86 sortBy = EPerson.ID; 87 } 88 89 int first = UIUtil.getIntParameter(request, "first"); 91 92 if (first == -1) 93 { 94 first = 0; 95 } 96 97 EPerson[] epeople = EPerson.findAll(context, sortBy); 99 100 request.setAttribute("sortby", new Integer (sortBy)); 102 request.setAttribute("first", new Integer (first)); 103 request.setAttribute("epeople", epeople); 104 105 if (multiple) 106 { 107 request.setAttribute("multiple", new Boolean (true)); 108 } 109 110 JSPManager.showJSP(request, response, "/tools/eperson-list.jsp"); 111 } 112 } 113 | Popular Tags |