From 57e4c22be804b4878b238e95577b026b6301ef3d Mon Sep 17 00:00:00 2001 From: Robert Tansley Date: Wed, 24 Mar 2004 17:22:44 +0000 Subject: [PATCH] - Added JSP tag, similar-ish to HTML + + OR + - + + + + then  + + + - diff --git a/dspace/jsp/dspace-admin/wizard-permissions.jsp b/dspace/jsp/dspace-admin/wizard-permissions.jsp index 085c783355..11fabf082c 100644 --- a/dspace/jsp/dspace-admin/wizard-permissions.jsp +++ b/dspace/jsp/dspace-admin/wizard-permissions.jsp @@ -146,21 +146,13 @@ incoming submissions, but will not be able to reject them.

- Click on the 'Choose E-people' button to choose e-people to add to the list. + Click on the 'Select E-people' button to choose e-people to add to the list. - - - - - - - - + @@ -178,7 +170,7 @@ incoming submissions, but will not be able to reject them.

  - + diff --git a/dspace/jsp/layout/header-default.jsp b/dspace/jsp/layout/header-default.jsp index d1c9fffb78..ce8aefbd4c 100644 --- a/dspace/jsp/layout/header-default.jsp +++ b/dspace/jsp/layout/header-default.jsp @@ -63,63 +63,7 @@ - + <%-- HACK: leftmargin, topmargin: for non-CSS compliant Microsoft IE browser --%> diff --git a/dspace/jsp/dspace-admin/eperson-list.jsp b/dspace/jsp/tools/eperson-list.jsp similarity index 87% rename from dspace/jsp/dspace-admin/eperson-list.jsp rename to dspace/jsp/tools/eperson-list.jsp index eb6a7f5aa7..b3556e5eab 100644 --- a/dspace/jsp/dspace-admin/eperson-list.jsp +++ b/dspace/jsp/tools/eperson-list.jsp @@ -47,6 +47,7 @@ - epeople - EPerson[] - all epeople to browse - sortby - Integer - field to sort by (constant from EPerson.java) - first - Integer - index of first eperson to display + - multiple - if non-null, this is for selecting multiple epeople --%> <%@ page contentType="text/html;charset=UTF-8" %> @@ -62,6 +63,7 @@ (EPerson[]) request.getAttribute("epeople"); int sortBy = ((Integer)request.getAttribute("sortby" )).intValue(); int first = ((Integer)request.getAttribute("first")).intValue(); + boolean multiple = (request.getAttribute("multiple") != null); // Make sure we won't run over end of list int last = first + PAGESIZE; @@ -87,9 +89,9 @@ String sortByParam = "lastname"; if (sortBy == EPerson.EMAIL) sortByParam = "email"; if (sortBy == EPerson.ID) sortByParam = "id"; - - String jumpLink = request.getContextPath() + "/dspace-admin/eperson-list?sortby=" + sortByParam + "&first="; - String sortLink = request.getContextPath() + "/dspace-admin/eperson-list?first=" + first + "&sortby="; + + String jumpLink = request.getContextPath() + "/dspace-admin/eperson-list?multiple=" + multiple + "&sortby=" + sortByParam + "&first="; + String sortLink = request.getContextPath() + "/dspace-admin/eperson-list?multiple=" + multiple + "&first=" + first + "&sortby="; %> @@ -108,6 +110,17 @@ function addEPerson(id, email, name) { self.opener.addEPerson(id, email, name); } + +// Clear selected items from main e-people list +function clearEPeople() +{ + var list = self.opener.document.forms[0].eperson_id; + while (list.options.length > 0) + { + list.options[0] = null; + } +} + // End --> @@ -140,6 +153,15 @@ function addEPerson(id, email, name) <% String row = "even"; + + String buttonText = (multiple ? "Add" : "Select"); + // If this is a dialogue to select a *single* e-person, we want + // to clear any existing entry in the e-person list, and + // to close this window when a 'select' button is clicked + String clearList = (multiple ? "" : "clearEPeople();"); + String closeWindow = (multiple ? "" : "window.close();"); + + for (int i = first; i <= last; i++) { EPerson e = epeople[i]; @@ -147,7 +169,7 @@ function addEPerson(id, email, name) String fullname = e.getFullName().replace('\'', ' '); %> - + <%= e.getID() %> <%= e.getEmail() %> diff --git a/dspace/jsp/utils.js b/dspace/jsp/utils.js new file mode 100644 index 0000000000..baa77569e7 --- /dev/null +++ b/dspace/jsp/utils.js @@ -0,0 +1,116 @@ +/* + * utils.js + * + * Version: $Revision$ + * + * Date: $Date$ + * + * Copyright (c) 2004, Hewlett-Packard Company and Massachusetts + * Institute of Technology. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Hewlett-Packard Company nor the name of the + * Massachusetts Institute of Technology nor the names of their + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + */ + +/* + * Utility Javascript methods for DSpace + */ + +// Popup window - here so it can be referred to by several methods +var popupWindow; + +// ========================================================= +// Methods for e-person popup window +// ========================================================= + +// Add to list of e-people on this page -- invoked by eperson popup window +function addEPerson(id, email, name) +{ + var newplace = window.document.forms[0].eperson_id.options.length; + + // First we check to see if e-person is already there + for (var i = 0; i < window.document.forms[0].eperson_id.options.length; i++) + { + if (window.document.forms[0].eperson_id.options[i].value == id) + { + newplace = -1; + } + } + + if (newplace > -1) + { + window.document.forms[0].eperson_id.options[newplace] = new Option(name + " (" + email + ")", id); + } +} + +// This needs to be invoked in the 'onClick' javascript event for buttons +// on pages with a dspace:selecteperson element in them +function finishEPerson() +{ + selectAll(window.document.forms[0].eperson_id); + popupWindow.close(); +} + + +// ========================================================= +// Miscellaneous utility methods +// ========================================================= + +// Open a popup window (or bring to front if already open) +function popup_window(winURL, winName) +{ + var props = 'scrollBars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,width=640,height=480'; + popupWindow = window.open(winURL, winName, props); + popupWindow.focus(); +} + + +// Select all options in a list +function removeSelected(sourceList) +{ + var maxCnt = sourceList.options.length; + for(var i = maxCnt - 1; i >= 0; i--) + { + if ((sourceList.options[i] != null) && (sourceList.options[i].selected == true)) + { + sourceList.options[i] = null; + } + } +} diff --git a/dspace/src/org/dspace/app/webui/jsptag/SelectEPersonTag.java b/dspace/src/org/dspace/app/webui/jsptag/SelectEPersonTag.java new file mode 100644 index 0000000000..74c2245303 --- /dev/null +++ b/dspace/src/org/dspace/app/webui/jsptag/SelectEPersonTag.java @@ -0,0 +1,181 @@ +/* + * SelectEPersonTag + * + * Version: $Revision$ + * + * Date: $Date$ + * + * Copyright (c) 2002, Hewlett-Packard Company and Massachusetts + * Institute of Technology. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Hewlett-Packard Company nor the name of the + * Massachusetts Institute of Technology nor the names of their + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + */ + +package org.dspace.app.webui.jsptag; + +import java.io.IOException; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.JspWriter; +import javax.servlet.jsp.tagext.TagSupport; + +import org.dspace.eperson.EPerson; + +/** + *

Tag for producing an e-person select widget in a form. Somewhat + * analogous to the HTML SELECT element. An input + * field is produced with a button which pops up a window from which + * e-people can be selected. Selected e-epeople are added to the field + * in the form. If the selector is for multiple e-people, a 'remove + * selected from list' button is also added.

+ * + *

On any form that has a selecteperson tag (only one allowed per page), + * you need to include the following Javascript code on all of the submit + * buttons, to ensure that the e-people IDs are posted and that the popup + * window is closed:

+ * + *

onclick="javascript:finishEPerson();"

+ * + * @author Robert Tansley + * @version $Revision$ + */ +public class SelectEPersonTag extends TagSupport +{ + /** Multiple e-people? */ + private boolean multiple; + + /** Which eperson/epeople are initially in the list? */ + private EPerson[] epeople; + + + public SelectEPersonTag() + { + super(); + } + + + /** + * Setter for multiple attribute + * + * @param s attribute from JSP + */ + public void setMultiple(String s) + { + if (s != null && (s.equalsIgnoreCase("yes") || s.equalsIgnoreCase("true"))) + { + multiple = true; + } + else + { + multiple = false; + } + } + + /** + * Setter for e-people in list + * + * @param e attribute from JSP + */ + public void setMultiple(Object e) + { + if (e instanceof EPerson) + { + epeople = new EPerson[1]; + epeople[0] = (EPerson) e; + } + else if(e instanceof EPerson[]) + { + epeople = (EPerson[]) e; + } + } + + + public void release() + { + multiple = false; + epeople = null; + } + + + public int doStartTag() + throws JspException + { + try + { + JspWriter out = pageContext.getOut(); + HttpServletRequest req = (HttpServletRequest) pageContext.getRequest(); + + out.print(""); + + if (multiple) + { + out.print("
"); + } + else + { + out.print(""); + } + + String p = (multiple ? "people" : "person"); + out.print(""); + + if (multiple) + { + out.print(""); + out.print(""); + } + + out.println("
"); + } + catch (IOException ie) + { + throw new JspException(ie); + } + + return SKIP_BODY; + } +} diff --git a/dspace/src/org/dspace/app/webui/servlet/admin/CollectionWizardServlet.java b/dspace/src/org/dspace/app/webui/servlet/admin/CollectionWizardServlet.java index d67b19c481..c2ff3faff3 100644 --- a/dspace/src/org/dspace/app/webui/servlet/admin/CollectionWizardServlet.java +++ b/dspace/src/org/dspace/app/webui/servlet/admin/CollectionWizardServlet.java @@ -343,7 +343,7 @@ public class CollectionWizardServlet extends DSpaceServlet } // Add people from the form to the group - int[] ids = UIUtil.getIntParameters(request, "epersonList"); + int[] ids = UIUtil.getIntParameters(request, "eperson_id"); if (ids != null) { diff --git a/dspace/src/org/dspace/app/webui/servlet/admin/EPersonAdminServlet.java b/dspace/src/org/dspace/app/webui/servlet/admin/EPersonAdminServlet.java index 98b4141b25..5c3b38dcf5 100644 --- a/dspace/src/org/dspace/app/webui/servlet/admin/EPersonAdminServlet.java +++ b/dspace/src/org/dspace/app/webui/servlet/admin/EPersonAdminServlet.java @@ -45,7 +45,6 @@ package org.dspace.app.webui.servlet.admin; import java.io.IOException; import java.sql.SQLException; import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -56,7 +55,6 @@ import org.dspace.app.webui.util.JSPManager; import org.dspace.app.webui.util.UIUtil; import org.dspace.authorize.AuthorizeException; import org.dspace.core.Context; -import org.dspace.core.LogManager; import org.dspace.eperson.EPerson; /** @@ -75,10 +73,7 @@ public class EPersonAdminServlet extends DSpaceServlet HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException { - doDSPost(context, request, response); - - // GET just displays the list of e-people - //showMain(context, request, response); + showMain(context, request, response); } @@ -97,8 +92,6 @@ public class EPersonAdminServlet extends DSpaceServlet // create clever name and do update before continuing e.setEmail("newuser"+e.getID()); e.update(); - - //showEPeople(context, request, response); request.setAttribute("eperson", e); @@ -229,58 +222,6 @@ public class EPersonAdminServlet extends DSpaceServlet showMain(context, request, response); context.complete(); } - else if (button.equals("submit_browse")) - { - // user wants to browse - - String pageRequest = request.getParameter("page_request"); - int pageIndex = UIUtil.getIntParameter(request, "page_index"); - String sortby = request.getParameter("sortby"); - int sortField = EPerson.EMAIL; // default - int pageSize = 50; - - if (sortby == null) - { - } - else if (sortby.equals("lastname")) - { - sortField = EPerson.LASTNAME; - } - else if (sortby.equals("id")) - { - sortField = EPerson.ID; - } - - if (pageIndex == -1) - { - pageIndex = 0; // default page is 0 - } - - // get back "next" and "previous" messages - // can also insert numbers here - if (pageRequest != null) - { - if (pageRequest.equals("next")) - { - pageIndex++; - } - else - { - pageIndex--; - } - } - - EPerson[] epeople = EPerson.findAll(context, sortField); - - int pageCount = ((epeople.length-1)/pageSize)+1; - - request.setAttribute("epeople", epeople ); - request.setAttribute("page_size", new Integer(pageSize )); - request.setAttribute("page_count", new Integer(pageCount)); - request.setAttribute("page_index", new Integer(pageIndex)); - - JSPManager.showJSP(request, response, "/dspace-admin/eperson-browse.jsp"); - } else { // Cancel etc. pressed - show list again @@ -288,38 +229,6 @@ public class EPersonAdminServlet extends DSpaceServlet } } - - /** - * Show list of E-people - * - * @param context Current DSpace context - * @param request Current HTTP request - * @param response Current HTTP response - */ - private void showEPeople(Context context, - HttpServletRequest request, - HttpServletResponse response) - throws ServletException, IOException, SQLException, AuthorizeException - { - // First get the sort field - String sortFieldParam = request.getParameter("sortby"); - int sortField = EPerson.LASTNAME; - - if (sortFieldParam != null && sortFieldParam.equals("email")) - { - sortField = EPerson.EMAIL; - } - else if (sortFieldParam != null && sortFieldParam.equals("id")) - { - sortField = EPerson.ID; - } - - EPerson[] epeople = EPerson.findAll(context, sortField); - - request.setAttribute("epeople", epeople); - JSPManager.showJSP(request, response, "/dspace-admin/list-epeople.jsp"); - } - private void showMain(Context c, HttpServletRequest request, HttpServletResponse response ) diff --git a/dspace/src/org/dspace/app/webui/servlet/admin/EPersonListServlet.java b/dspace/src/org/dspace/app/webui/servlet/admin/EPersonListServlet.java index 6494dc5e6c..498ec39f61 100644 --- a/dspace/src/org/dspace/app/webui/servlet/admin/EPersonListServlet.java +++ b/dspace/src/org/dspace/app/webui/servlet/admin/EPersonListServlet.java @@ -66,6 +66,9 @@ public class EPersonListServlet extends DSpaceServlet HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException { + // Are we for selecting a single or multiple epeople? + boolean multiple = UIUtil.getBoolParameter(request, "multiple"); + // What are we sorting by. Lastname is default int sortBy = EPerson.LASTNAME; @@ -95,7 +98,11 @@ public class EPersonListServlet extends DSpaceServlet request.setAttribute("sortby", new Integer(sortBy)); request.setAttribute("first", new Integer(first)); request.setAttribute("epeople", epeople); + if (multiple) + { + request.setAttribute("multiple", new Boolean(true)); + } - JSPManager.showJSP(request, response, "/dspace-admin/eperson-list.jsp"); + JSPManager.showJSP(request, response, "/tools/eperson-list.jsp"); } } diff --git a/dspace/src/org/dspace/app/webui/servlet/admin/EditEPersonServlet.java b/dspace/src/org/dspace/app/webui/servlet/admin/EditEPersonServlet.java deleted file mode 100644 index 772d10b297..0000000000 --- a/dspace/src/org/dspace/app/webui/servlet/admin/EditEPersonServlet.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * EditEPersonServlet.java - * - * Version: $Revision$ - * - * Date: $Date$ - * - * Copyright (c) 2002, Hewlett-Packard Company and Massachusetts - * Institute of Technology. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Hewlett-Packard Company nor the name of the - * Massachusetts Institute of Technology nor the names of their - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - */ - -package org.dspace.app.webui.servlet.admin; - -import java.io.IOException; -import java.sql.SQLException; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.log4j.Logger; - -import org.dspace.app.webui.servlet.DSpaceServlet; -import org.dspace.app.webui.util.JSPManager; -import org.dspace.app.webui.util.UIUtil; -import org.dspace.authorize.AuthorizeException; -import org.dspace.core.Context; -import org.dspace.core.LogManager; -import org.dspace.eperson.EPerson; - -/** - * Servlet for editing and creating e-people - * - * @author Robert Tansley - * @version $Revision$ - */ -public class EditEPersonServlet extends DSpaceServlet -{ - /** Logger */ - private static Logger log = Logger.getLogger(EditEPersonServlet.class); - - - protected void doDSGet(Context context, - HttpServletRequest request, - HttpServletResponse response) - throws ServletException, IOException, SQLException, AuthorizeException - { - // GET just displays the list of e-people - showEPeople(context, request, response); - } - - - protected void doDSPost(Context context, - HttpServletRequest request, - HttpServletResponse response) - throws ServletException, IOException, SQLException, AuthorizeException - { - String button = UIUtil.getSubmitButton(request, "submit"); - - if (button.equals("submit_update")) - { - // Update the metadata for an e-person - EPerson e = EPerson.find(context, - UIUtil.getIntParameter(request, "eperson_id")); - - e.setEmail(request.getParameter("email").trim()); - - e.setFirstName(request.getParameter("firstname").equals("") - ? null - : request.getParameter("firstname")); - - e.setLastName(request.getParameter("lastname").equals("") - ? null - : request.getParameter("lastname")); - - // FIXME: More data-driven? - e.setMetadata("phone", - request.getParameter("phone").equals("") - ? null - : request.getParameter("phone")); - - e.setCanLogIn(request.getParameter("active") != null && - request.getParameter("active").equals("true")); - - e.setRequireCertificate( - request.getParameter("require_certificate") != null && - request.getParameter("require_certificate").equals("true")); - - e.update(); - - showEPeople(context, request, response); - context.complete(); - } - else if (button.equals("submit_add")) - { - // Add a new E-person - simply add to the list, and let the user - // edit with the main form - EPerson e = EPerson.create(context); - - e.update(); - - showEPeople(context, request, response); - context.complete(); - } - else if (button.equals("submit_delete")) - { - // Start delete process - go through verification step - EPerson e = EPerson.find(context, - UIUtil.getIntParameter(request, "eperson_id")); - - request.setAttribute("eperson", e); - - JSPManager.showJSP(request, response, - "/dspace-admin/confirm-delete-eperson.jsp"); - } - else if (button.equals("submit_confirm_delete")) - { - // User confirms deletion of type - EPerson e = EPerson.find(context, - UIUtil.getIntParameter(request, "eperson_id")); - - e.delete(); - - showEPeople(context, request, response); - context.complete(); - } - else - { - // Cancel etc. pressed - show list again - showEPeople(context, request, response); - } - } - - - /** - * Show list of E-people - * - * @param context Current DSpace context - * @param request Current HTTP request - * @param response Current HTTP response - */ - private void showEPeople(Context context, - HttpServletRequest request, - HttpServletResponse response) - throws ServletException, IOException, SQLException, AuthorizeException - { - // First get the sort field - String sortFieldParam = request.getParameter("sortby"); - int sortField = EPerson.LASTNAME; - - if (sortFieldParam != null && sortFieldParam.equals("email")) - { - sortField = EPerson.EMAIL; - } - else if (sortFieldParam != null && sortFieldParam.equals("id")) - { - sortField = EPerson.ID; - } - - EPerson[] epeople = EPerson.findAll(context, sortField); - - request.setAttribute("epeople", epeople); - JSPManager.showJSP(request, response, "/dspace-admin/list-epeople.jsp"); - } -}