First version of collection wizard. Issues/shortcuts:

- Need to put Javascript in <HTML><HEAD> -- I just whacked it in
header-default.jsp for now.  Should probably not be served up for every single
page though!
- E-person list popup page should probably close itself somehow
- No way to access this yet!  Need to update community pages with a button...


git-svn-id: http://scm.dspace.org/svn/repo/trunk@784 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Robert Tansley
2004-03-06 20:29:23 +00:00
parent 582002e23b
commit 700054de58
9 changed files with 1448 additions and 1 deletions

View File

@@ -167,6 +167,11 @@
<servlet-class>org.dspace.app.webui.servlet.X509CertificateServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>collection-wizard</servlet-name>
<servlet-class>org.dspace.app.webui.servlet.admin.CollectionWizardServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>community-list</servlet-name>
<servlet-class>org.dspace.app.webui.servlet.CommunityListServlet</servlet-class>
@@ -197,6 +202,11 @@
<servlet-class>org.dspace.app.webui.servlet.admin.EditItemServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>eperson-list</servlet-name>
<servlet-class>org.dspace.app.webui.servlet.admin.EPersonListServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>feedback</servlet-name>
<servlet-class>org.dspace.app.webui.servlet.FeedbackServlet</servlet-class>
@@ -338,6 +348,11 @@
<url-pattern>/community-list</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>collection-wizard</servlet-name>
<url-pattern>/dspace-admin/collection-wizard</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>dc-registry</servlet-name>
<url-pattern>/dspace-admin/dc-registry</url-pattern>
@@ -358,6 +373,11 @@
<url-pattern>/tools/edit-item</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>eperson-list</servlet-name>
<url-pattern>/dspace-admin/eperson-list</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>feedback</servlet-name>
<url-pattern>/feedback</url-pattern>

View File

@@ -131,7 +131,7 @@
<H1>Edit Collection <%= collection.getHandle() %></H1>
<% } %>
<form method=POST>
<form method=POST action="<%= request.getContextPath() %>/dspace-admin/edit-communities">
<table>
<%-- ===========================================================
Basic metadata

View File

@@ -0,0 +1,183 @@
<%--
- eperson-list.jsp
-
- 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.
--%>
<%--
- Display list of E-people, with pagination
-
- Attributes:
-
- epeople - EPerson[] - all epeople to browse
- sortby - Integer - field to sort by (constant from EPerson.java)
- first - Integer - index of first eperson to display
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
<%@ page import="org.dspace.eperson.EPerson" %>
<%
int PAGESIZE = 50;
EPerson[] epeople =
(EPerson[]) request.getAttribute("epeople");
int sortBy = ((Integer)request.getAttribute("sortby" )).intValue();
int first = ((Integer)request.getAttribute("first")).intValue();
// Make sure we won't run over end of list
int last = first + PAGESIZE;
if (last >= epeople.length) last = epeople.length - 1;
// Index of first eperson on last page
int jumpEnd = ((epeople.length - 1) / PAGESIZE) * PAGESIZE;
// Now work out values for next/prev page buttons
int jumpFiveBack = first - PAGESIZE * 5;
if (jumpFiveBack < 0) jumpFiveBack = 0;
int jumpOneBack = first - PAGESIZE;
if (jumpOneBack < 0) jumpOneBack = 0;
int jumpOneForward = first + PAGESIZE;
if (jumpOneForward > epeople.length) jumpOneForward = first;
int jumpFiveForward = first + PAGESIZE * 5;
if (jumpFiveForward > epeople.length) jumpFiveForward = jumpEnd;
// What's the link?
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=";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<head>
<title>Select E-people</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%= request.getContextPath() %>/styles.css.jsp">
<link rel="shortcut icon" href="<%= request.getContextPath() %>/favicon.ico" type="image/x-icon">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
// Add the selected items to main e-people list by calling method of parent
function addEPerson(id, email, name)
{
self.opener.addEPerson(id, email, name);
}
// End -->
</script>
</head>
<body class="pageContents">
<h3>E-people <%= first + 1 %>-<%= last + 1 %> of <%= epeople.length %></H3>
<%-- Controls for jumping around list--%>
<table width="99%">
<tr>
<td width="17%" align="center"><strong><A HREF="<%= jumpLink %>0">First</A></strong></td>
<td width="17%" align="center"><strong><A HREF="<%= jumpLink %><%= jumpFiveBack %>">&lt; 5 Pages</A></strong></td>
<td width="17%" align="center"><strong><A HREF="<%= jumpLink %><%= jumpOneBack %>">&lt; 1 Page</A></strong></td>
<td width="17%" align="center"><strong><A HREF="<%= jumpLink %><%= jumpOneForward %>">1 Page &gt;</A></strong></td>
<td width="17%" align="center"><strong><A HREF="<%= jumpLink %><%= jumpFiveForward %>">5 Pages &gt;</A></strong></td>
<td width="17%" align="center"><strong><A HREF="<%= jumpLink %><%= jumpEnd %>">Last</A></strong></td>
</tr>
</table>
<form method=GET> <%-- Will never actually be posted, it's just so buttons will appear --%>
<table class="miscTable" align="center">
<tr>
<th class="oddRowOddCol">&nbsp;</th>
<th class="oddRowEvenCol"><%= sortBy == EPerson.ID ? "<strong>ID &uarr;</strong>" : "<A HREF=\"" + sortLink + "id\">ID</A>" %></th>
<th class="oddRowOddCol"><%= sortBy == EPerson.EMAIL ? "<strong>E-mail &uarr;</strong>" : "<A HREF=\"" + sortLink + "email\">E-mail</A>" %></th>
<th class="oddRowEvenCol"><%= sortBy == EPerson.LASTNAME ? "<strong>Last Name &uarr;</strong>" : "<A HREF=\"" + sortLink + "lastname\">Last Name</A>" %></th>
<th class="oddRowOddCol">First Name</th>
</tr>
<%
String row = "even";
for (int i = first; i <= last; i++)
{
EPerson e = epeople[i];
// Make sure no quotes in full name will mess up our Javascript
String fullname = e.getFullName().replace('\'', ' ');
%>
<tr>
<td class="<%= row %>RowOddCol"><input type=button value="Add" onClick="javascript:addEPerson(<%= e.getID() %>, '<%= e.getEmail() %>', '<%= fullname %>');"></td>
<td class="<%= row %>RowEvenCol"><%= e.getID() %></td>
<td class="<%= row %>RowOddCol"><%= e.getEmail() %></td>
<td class="<%= row %>RowEvenCol">
<%= (e.getLastName() == null ? "" : e.getLastName()) %>
</td>
<td class="<%= row %>RowOddCol">
<%= (e.getFirstName() == null ? "" : e.getFirstName()) %>
</td>
</tr>
<%
row = (row.equals("odd") ? "even" : "odd");
}
%>
</table>
<%-- Controls for jumping around list--%>
<table width="99%">
<tr>
<td width="17%" align="center"><strong><A HREF="<%= jumpLink %>0">First</A></strong></td>
<td width="17%" align="center"><strong><A HREF="<%= jumpLink %><%= jumpFiveBack %>">&lt; 5 Pages</A></strong></td>
<td width="17%" align="center"><strong><A HREF="<%= jumpLink %><%= jumpOneBack %>">&lt; 1 Page</A></strong></td>
<td width="17%" align="center"><strong><A HREF="<%= jumpLink %><%= jumpOneForward %>">1 Page &gt;</A></strong></td>
<td width="17%" align="center"><strong><A HREF="<%= jumpLink %><%= jumpFiveForward %>">5 Pages &gt;</A></strong></td>
<td width="17%" align="center"><strong><A HREF="<%= jumpLink %><%= jumpEnd %>">Last</A></strong></td>
</tr>
</table>
<P align="center"><input type="button" value="Close" onClick="window.close();"></P>
</form>
</body>
</html>

View File

@@ -0,0 +1,178 @@
<%--
- wizard-questions.jsp
-
- 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.
--%>
<%--
- basic info for collection creation wizard
-
- attributes:
- collection - collection we're creating
--%>
<%@ page import="org.dspace.app.webui.servlet.admin.CollectionWizardServlet" %>
<%@ page import="org.dspace.content.Collection" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
<% Collection collection = (Collection) request.getAttribute("collection"); %>
<dspace:layout locbar="off" navbar="off" title="Describe the Collection" nocache="true">
<H1>Describe the Collection</H1>
<form action="<%= request.getContextPath() %>/dspace-admin/collection-wizard" method=post enctype="multipart/form-data">
<table>
<tr>
<td><P class="submitFormLabel">Name:</P></td>
<td><input type="text" name="name" size=50></td>
</tr>
<%-- Hints about table width --%>
<tr>
<td width="40%">&nbsp;</td>
<td>&nbsp;</td>
<td width="40%">&nbsp;</td>
</tr>
<tr>
<td colspan=3 class="submitFormHelp">
Shown in list on community home page
</td>
</tr>
<tr>
<td><P class="submitFormLabel">Short Description:</P></td>
<td><input type="text" name="short_description" size=50></td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td colspan=3 class="submitFormHelp">
HTML, shown in center of collection home page. Be sure to enclose in &lt;P&gt; &lt;/P&gt; tags!
</td>
</tr>
<tr>
<td><P class="submitFormLabel">Introductory text:</P></td>
<td><textarea name="introductory_text" rows=4 cols=50></textarea></td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td colspan=3 class="submitFormHelp">
Plain text, shown at bottom of collection home page
</td>
</tr>
<tr>
<td><P class="submitFormLabel">Copyright text:</P></td>
<td><textarea name="copyright_text" rows=3 cols=50></textarea></td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td colspan=3 class="submitFormHelp">
HTML, shown on right-hand side of collection home page. Be sure to enclose in &lt;P&gt; &lt;/P&gt; tags!
</td>
</tr>
<tr>
<td><P class="submitFormLabel">Side bar text:</P></td>
<td><textarea name="side_bar_text" rows=4 cols=50></textarea></td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td colspan=3 class="submitFormHelp">
License that submitters must grant. Leave this blank to use the default license.
</td>
</tr>
<tr>
<td><P class="submitFormLabel">License:</P></td>
<td><textarea name="license" rows=4 cols=50></textarea></td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td colspan=3 class="submitFormHelp">
Plain text, any provenance information about this collection. Not shown on collection pages.
</td>
</tr>
<tr>
<td><P class="submitFormLabel">Provenance:</P></td>
<td><textarea name="provenance_description" rows=4 cols=50></textarea></td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td colspan=3 class="submitFormHelp">
Choose a JPEG or GIF logo for the collection home page. Should be quite small.
</td>
</tr>
<tr>
<td><P class="submitFormLabel">Logo:</P></td>
<td><input type=file size=40 name="file"></td>
</tr>
</table>
<P>&nbsp;</P>
<%-- Hidden fields needed for servlet to know which collection and page to deal with --%>
<input type=hidden name="collection_id" value=<%= ((Collection) request.getAttribute("collection")).getID() %>>
<input type=hidden name="stage" value=<%= CollectionWizardServlet.BASIC_INFO %>>
<center>
<table border=0 width="80%">
<tr>
<td width="100%">
&nbsp;
</td>
<td>
<input type=submit name="submit_next" value="Next &gt;">
</td>
</tr>
</table>
</center>
</form>
</dspace:layout>

View File

@@ -0,0 +1,188 @@
<%--
- wizard-permissions.jsp
-
- 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.
--%>
<%--
- set up a group with particular permissions
-
- attributes:
- collection - collection we're creating
- permission - one of the constants starting PERM_ at the top of
- org.dspace.app.webui.servlet.admin.CollectionWizardServlet
--%>
<%@ page import="org.dspace.app.webui.servlet.admin.CollectionWizardServlet" %>
<%@ page import="org.dspace.content.Collection" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
<%
Collection collection = (Collection) request.getAttribute("collection");
int perm = ((Integer) request.getAttribute("permission")).intValue();
boolean mitGroup = (request.getAttribute("mitgroup") != null);
%>
<dspace:layout locbar="off" navbar="off" title="Collection Authorization" nocache="true">
<%
switch (perm)
{
case CollectionWizardServlet.PERM_READ:
%>
<H1>Authorization to Read</H1>
<P>Who has (by default) permission to read new items submitted to this collection?</P>
<%
break;
case CollectionWizardServlet.PERM_SUBMIT:
%>
<H1>Authorization to Submit</H1>
<P>Who has permission to submit new items to this collection?</P>
<%
break;
case CollectionWizardServlet.PERM_WF1:
%>
<H1>Workflow Reviewers</H1>
<P>Who are the workflow reviews for this collection? They be able to accept or reject
incoming submissions. They will not be able to edit item metadata, however.</P>
<%
break;
case CollectionWizardServlet.PERM_WF2:
%>
<H1>Workflow Approvers</H1>
<P>Who are the workflow approvers for this collection? They be able to accept or reject
incoming submissions, and edit item metadata.</P>
<%
break;
case CollectionWizardServlet.PERM_WF3:
%>
<H1>Workflow Metadata Editors</H1>
<P>Who are the workflow metadata editors for this collection? They be able to edit item metadata of
incoming submissions, but will not be able to reject them.</P>
<%
break;
}
%>
<P>You can change this later using the relevant sections of the DSpace admin UI.</P>
<form action="<%= request.getContextPath() %>/dspace-admin/collection-wizard" method=post>
<center>
<table>
<%
// MIT group checkbox - only if there's an MIT group and on the READ and SUBMIT pages
// (Sorry, everyone who isn't running DSpace at MIT, I know this isn't very elegant!)
if (mitGroup &&
(perm == CollectionWizardServlet.PERM_READ || perm == CollectionWizardServlet.PERM_SUBMIT))
{
%>
<tr>
<td></td>
<td><input type=checkbox name="mitgroup" value="true">&nbsp;<span class="submitFormLabel">All MIT users</span>
</td>
</tr>
<tr>
<td colspan=3>&nbsp;</td>
</tr>
<tr>
<td colspan=3 class="submitFormHelp"><STRONG>OR</STRONG></td>
</tr>
<tr>
<td colspan=3>&nbsp;</td>
</tr>
<%
}
%>
<%-- width=40% centres table nicely --%>
<tr>
<td width="40%"></td>
<td class="submitFormHelp">
Click on the 'Add E-people' button to start adding to the list.</td>
<td width="40%"></td>
</tr>
<tr>
<td></td>
<td align=center class="submitFormLabel">
<select size=10 name="epersonList" multiple>
</select>
</td>
</tr>
<tr>
<td></td>
<td align=center>
<input type=button value="Add E-people" onclick="javascript:eperson_window();">
<input type=button value="Remove Selected" onclick="javascript:removeSelected(epersonList);">
</td>
</tr>
</table>
</center>
<%-- Hidden fields needed for servlet to know which collection and page to deal with --%>
<input type=hidden name="collection_id" value=<%= ((Collection) request.getAttribute("collection")).getID() %>>
<input type=hidden name="stage" value=<%= CollectionWizardServlet.PERMISSIONS %>>
<input type=hidden name="permission" value=<%= perm %>>
<center>
<table border=0 width="80%">
<tr>
<td width="100%">
&nbsp;
</td>
<td>
<input type=submit name="submit_next" value="Next &gt;" onclick="javascript:selectList(epersonList);">
</td>
</tr>
</table>
</center>
</form>
</dspace:layout>

View File

@@ -0,0 +1,142 @@
<%--
- wizard-questions.jsp
-
- 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.
--%>
<%--
- initial questions page for collection creation wizard
-
- attributes:
- collection - collection we're creating
--%>
<%@ page import="org.dspace.app.webui.servlet.admin.CollectionWizardServlet" %>
<%@ page import="org.dspace.content.Collection" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
<% Collection collection = (Collection) request.getAttribute("collection"); %>
<dspace:layout locbar="off" navbar="off" title="Describe the Collection" nocache="true">
<H1>Describe the Collection</H1>
<form action="<%= request.getContextPath() %>/dspace-admin/collection-wizard" method=post>
<P>Please check the boxes next to the statements that apply to the collection.</P>
<center>
<table class="miscTable">
<tr class="oddRowOddCol">
<td class="oddRowOddCol" align="left">
<table border=0>
<tr>
<td valign=top><input type=checkbox name="public_read" value="true" CHECKED></td>
<td class="submitFormLabel" nowrap>New items should be publicly readable</td>
</tr>
</table>
</td>
</tr>
<tr class="evenRowOddCol">
<td class="evenRowOddCol" align="left">
<table border=0>
<tr>
<td valign=top><input type=checkbox name="submitters" value="true" CHECKED></td>
<td class="submitFormLabel" nowrap>Some users will be able to submit to this collection</td>
</tr>
</table>
</td>
</tr>
<tr class="oddRowOddCol">
<td class="oddRowOddCol" align="left">
<table border=0>
<tr>
<td valign=top><input type=checkbox name="workflow1" value="true"></td>
<td class="submitFormLabel" nowrap>This collection will have reviewers</td>
</tr>
</table>
</td>
</tr>
<tr class="evenRowOddCol">
<td class="evenRowOddCol" align="left">
<table border=0>
<tr>
<td valign=top><input type=checkbox name="workflow2" value="true"></td>
<td class="submitFormLabel" nowrap>This collection will have approvers</td>
</tr>
</table>
</td>
</tr>
<tr class="oddRowOddCol">
<td class="oddRowOddCol" align="left">
<table border=0>
<tr>
<td valign=top><input type=checkbox name="workflow3" value="true"></td>
<td class="submitFormLabel" nowrap>This collection will have metadata editors</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
<P>&nbsp;</P>
<%-- Hidden fields needed for servlet to know which collection and page to deal with --%>
<input type=hidden name="collection_id" value=<%= ((Collection) request.getAttribute("collection")).getID() %>>
<input type=hidden name="stage" value=<%= CollectionWizardServlet.INITIAL_QUESTIONS %>>
<center>
<table border=0 width="80%">
<tr>
<td width="100%">
&nbsp;
</td>
<td>
<input type=submit name="submit_next" value="Next &gt;">
</td>
</tr>
</table>
</center>
</form>
</dspace:layout>

View File

@@ -63,6 +63,63 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%= request.getContextPath() %>/styles.css.jsp">
<link rel="shortcut icon" href="<%= request.getContextPath() %>/favicon.ico" type="image/x-icon">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
// Open eperson popup window
function eperson_window()
{
var newWindow;
var props = 'scrollBars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,width=640,height=480';
newWindow = window.open("<%= request.getContextPath() %>/dspace-admin/eperson-list", "dspace_epeople", props);
}
// 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].epersonList.options.length;
// First we check to see if e-person is already there
for (var i = 0; i < window.document.forms[0].epersonList.options.length; i++)
{
if (window.document.forms[0].epersonList.options[i].value == id)
{
newplace = -1;
}
}
if (newplace > -1)
{
window.document.forms[0].epersonList.options[newplace] = new Option(name + " (" + email + ")", id);
}
}
// Marks all the epeople as selected for the submit button.
function selectList()
{
sourceList = window.document.forms[0].epersonList;
for(var i = 0; i < sourceList.options.length; i++)
{
if (sourceList.options[i] != null)
sourceList.options[i].selected = true;
}
return true;
}
// Deletes the selected items of supplied 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;
}
}
}
// End -->
</script>
</head>
<%-- HACK: leftmargin, topmargin: for non-CSS compliant Microsoft IE browser --%>

View File

@@ -0,0 +1,578 @@
/*
* EditItemServlet.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.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.StringTokenizer;
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.administer.DCType;
import org.dspace.app.webui.servlet.DSpaceServlet;
import org.dspace.app.webui.util.FileUploadRequest;
import org.dspace.app.webui.util.JSPManager;
import org.dspace.app.webui.util.UIUtil;
import org.dspace.authorize.AuthorizeException;
import org.dspace.authorize.AuthorizeManager;
import org.dspace.content.Bitstream;
import org.dspace.content.BitstreamFormat;
import org.dspace.content.Bundle;
import org.dspace.content.Community;
import org.dspace.content.Collection;
import org.dspace.content.FormatIdentifier;
import org.dspace.content.Item;
import org.dspace.content.DSpaceObject;
import org.dspace.core.ConfigurationManager;
import org.dspace.core.Constants;
import org.dspace.core.Context;
import org.dspace.core.LogManager;
import org.dspace.eperson.EPerson;
import org.dspace.eperson.Group;
import org.dspace.handle.HandleManager;
/**
* Collection creation wizard UI
*
* @author Robert Tansley
* @version $Revision$
*/
public class CollectionWizardServlet extends DSpaceServlet
{
/** Initial questions page */
public final static int INITIAL_QUESTIONS = 1;
/** Basic information page */
public final static int BASIC_INFO = 2;
/** Permissions pages */
public final static int PERMISSIONS = 3;
/** Default item page */
public final static int DEFAULT_ITEM = 4;
/** Summary page */
public final static int SUMMARY = 5;
/** Permissions page for who gets read permissions on new items */
public final static int PERM_READ = 10;
/** Permissions page for submitters */
public final static int PERM_SUBMIT = 11;
/** Permissions page for workflow step 1 */
public final static int PERM_WF1 = 12;
/** Permissions page for workflow step 2 */
public final static int PERM_WF2 = 13;
/** Permissions page for workflow step 3 */
public final static int PERM_WF3 = 14;
/** Logger */
private static Logger log = Logger.getLogger(CollectionWizardServlet.class);
protected void doDSPost(Context context,
HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException, SQLException, AuthorizeException
{
/*
* For POST, we expect from the form:
*
* community_id DB ID if it was a 'create a new collection'
* button press
*
* OR
*
* collection_id DB ID of collection we're dealing with
* stage Stage we're at (from constants above)
*/
// First, see if we have a multipart request
// (the 'basic info' page which might include uploading a logo)
String contentType = request.getContentType();
if (contentType != null &&
contentType.indexOf("multipart/form-data") != -1)
{
// This is a multipart request, so it's a file upload
processBasicInfo(context, request, response);
return;
}
int communityID = UIUtil.getIntParameter(request, "community_id");
if (communityID > -1)
{
// We have a community ID, "create new collection" button pressed
Community c = Community.find(context, communityID);
if (c == null)
{
log.warn(LogManager.getHeader(context,
"integrity_error",
UIUtil.getRequestLogInfo(request)));
JSPManager.showIntegrityError(request, response);
return;
}
// Create the collection
Collection newCollection = c.createCollection();
Group g = newCollection.createSubmitters();
request.setAttribute("collection", newCollection);
JSPManager.showJSP(request, response, "/dspace-admin/wizard-questions.jsp");
context.complete();
}
else
{
// Collection already created, dealing with one of the wizard pages
int collectionID = UIUtil.getIntParameter(request, "collection_id");
int stage = UIUtil.getIntParameter(request, "stage");
// Get the collection
Collection collection = Collection.find(context, collectionID);
// Put it in request attributes, as most JSPs will need it
request.setAttribute("collection", collection);
if (collection == null)
{
log.warn(LogManager.getHeader(context,
"integrity_error",
UIUtil.getRequestLogInfo(request)));
JSPManager.showIntegrityError(request, response);
return;
}
// All pages will need this attribute
request.setAttribute("collection.id", String.valueOf(collection.getID()));
switch (stage)
{
case INITIAL_QUESTIONS:
processInitialQuestions(context, request, response, collection);
break;
case PERMISSIONS:
processPermissions(context, request, response, collection);
break;
case DEFAULT_ITEM:
//processDefaultItem(context, request, response, collection);
break;
default:
log.warn(LogManager.getHeader(context,
"integrity_error",
UIUtil.getRequestLogInfo(request)));
JSPManager.showIntegrityError(request, response);
}
}
}
/**
* Process input from initial questions page
*
* @param context DSpace context
* @param request HTTP request
* @param response HTTP response
* @param collection Collection we're editing
*/
private void processInitialQuestions(Context context,
HttpServletRequest request,
HttpServletResponse response,
Collection collection)
throws SQLException, ServletException, IOException, AuthorizeException
{
Group anonymousGroup = Group.find(context, 0);
// "Public read" checkbox. Only need to do anything
// if it's not checked.
if (!UIUtil.getBoolParameter(request, "public_read"))
{
// Remove anonymous default policies for new items
AuthorizeManager.removePoliciesActionFilter(
context, collection, Constants.DEFAULT_ITEM_READ);
AuthorizeManager.removePoliciesActionFilter(
context, collection, Constants.DEFAULT_BITSTREAM_READ);
}
// Some people authorised to submit
if (UIUtil.getBoolParameter(request, "submitters"))
{
// Create submitters group
Group g = collection.createSubmitters();
// Give them ADD permission
AuthorizeManager.addPolicy(context, collection, Constants.ADD, g);
}
// Check for the workflow steps
for (int i = 1; i <= 3; i++)
{
if (UIUtil.getBoolParameter(request, "workflow" + i))
{
// should have workflow step i
Group g = collection.createWorkflowGroup(i);
// FIXME: Might need to do some authorisation stuff?
}
}
// Default item stuff?
if (UIUtil.getBoolParameter(request, "default.item"))
{
collection.createTemplateItem();
}
// Need to set a name so that the indexer won't throw an exception
collection.setMetadata("name", "");
collection.update();
// Now display "basic info" screen
JSPManager.showJSP(request, response, "/dspace-admin/wizard-basicinfo.jsp");
context.complete();
}
/**
* Process input from one of the permissions pages
*
* @param context DSpace context
* @param request HTTP request
* @param response HTTP response
* @param collection Collection we're editing
*/
private void processPermissions(Context context,
HttpServletRequest request,
HttpServletResponse response,
Collection collection)
throws SQLException, ServletException, IOException, AuthorizeException
{
// Which permission are we dealing with?
int permission = UIUtil.getIntParameter(request, "permission");
// First, we deal with the special case of the MIT group...
if (UIUtil.getBoolParameter(request, "mitgroup"))
{
Group mitGroup = Group.findByName(context, "MIT Users");
int action;
if (permission == PERM_READ)
{
AuthorizeManager.addPolicy(context, collection, Constants.READ, mitGroup);
}
else
{
// Must be submit
AuthorizeManager.addPolicy(context, collection, Constants.ADD, mitGroup);
}
}
//We need to add the selected people to the group.
// First, get the relevant group
Group g = null;
switch (permission)
{
case PERM_READ:
// Actually need to create a group for this.
g = Group.create(context);
// Name it according to our conventions
g.setName("COLLECTION_" + collection.getID() + "_READ");
// Give it the needed permission
AuthorizeManager.addPolicy(context, collection, Constants.READ, g);
break;
case PERM_SUBMIT:
g = collection.getSubmitters();
break;
case PERM_WF1:
g = collection.getWorkflowGroup(1);
break;
case PERM_WF2:
g = collection.getWorkflowGroup(2);
break;
case PERM_WF3:
g = collection.getWorkflowGroup(3);
break;
}
// Add people from the form to the group
int[] ids = UIUtil.getIntParameters(request, "epersonList");
if (ids != null)
{
for (int i = 0; i < ids.length; i++)
{
EPerson eperson = EPerson.find(context, ids[i]);
if (eperson != null)
{
g.addMember(eperson);
}
}
}
// Update group
g.update();
showNextPage(context, request, response, collection, permission);
context.complete();
}
/**
* process input from basic info page
*
* @param context
* @param request
* @param response
* @param collection
* @throws SQLException
* @throws ServletException
* @throws IOException
* @throws AuthorizeException
*/
private void processBasicInfo(Context context,
HttpServletRequest request,
HttpServletResponse response)
throws SQLException, ServletException, IOException, AuthorizeException
{
// Wrap multipart request to get the submission info
FileUploadRequest wrapper = new FileUploadRequest(request);
Collection collection = Collection.find(context,
UIUtil.getIntParameter(wrapper, "collection_id"));
if (collection == null)
{
log.warn(LogManager.getHeader(context,
"integrity_error",
UIUtil.getRequestLogInfo(wrapper)));
JSPManager.showIntegrityError(request, response);
return;
}
// Get metadata
collection.setMetadata("name", wrapper.getParameter("name"));
collection.setMetadata("short_description",
wrapper.getParameter("short_description"));
collection.setMetadata("introductory_text",
wrapper.getParameter("introductory_text"));
collection.setMetadata("copyright_text",
wrapper.getParameter("copyright_text"));
collection.setMetadata("side_bar_text",
wrapper.getParameter("side_bar_text"));
collection.setMetadata("provenance_description",
wrapper.getParameter("provenance_description"));
// Need to be more careful about license -- make sure it's null if
// nothing was entered
String license = wrapper.getParameter("license");
if (license != null)
{
collection.setLicense(null);
}
File temp = wrapper.getFile("file");
if (temp != null)
{
// Read the temp file as logo
InputStream is = new BufferedInputStream(new FileInputStream(
temp));
Bitstream logoBS = collection.setLogo(is);
// Strip all but the last filename. It would be nice
// to know which OS the file came from.
String noPath = wrapper.getFilesystemName("file");
while (noPath.indexOf('/') > -1)
{
noPath = noPath.substring(
noPath.indexOf('/') + 1);
}
while (noPath.indexOf('\\') > -1)
{
noPath = noPath.substring(
noPath.indexOf('\\') + 1);
}
logoBS.setName(noPath);
logoBS.setSource(wrapper.getFilesystemName("file"));
// Identify the format
BitstreamFormat bf = FormatIdentifier.guessFormat(context, logoBS);
logoBS.setFormat(bf);
logoBS.update();
// Remove temp file
temp.delete();
}
collection.update();
// Now work out what next page is
showNextPage(context, request, response, collection, BASIC_INFO);
context.complete();
}
/**
* Work out which page to show next, and show it
*
* @param context
* @param request
* @param response
* @param collection
* @param stage the stage the user just finished, or if PERMISSIONS, the
* particular permissions page
* @throws SQLException
* @throws ServletException
* @throws IOException
* @throws AuthorizeException
*/
private void showNextPage(Context context,
HttpServletRequest request,
HttpServletResponse response,
Collection collection,
int stage)
throws SQLException, ServletException, IOException, AuthorizeException
{
// Put collection in request attributes, as most JSPs will need it
request.setAttribute("collection", collection);
// FIXME: Not a nice hack -- do we show the MIT users checkbox?
if (Group.findByName(context, "MIT Users") != null)
{
request.setAttribute("mitgroup", new Boolean(true));
}
log.debug(LogManager.getHeader(context, "nextpage", "stage=" + stage));
switch(stage)
{
case BASIC_INFO:
// Next page is 'permission to read' page iff ITEM_DEFAULT_READ
// for anonymous group is NOT there
List anonReadPols = AuthorizeManager.getPoliciesActionFilter(
context, collection, Constants.DEFAULT_ITEM_READ);
// At this stage, if there's any ITEM_DEFAULT_READ, it can only
// be an anonymous one.
if (anonReadPols.size() == 0)
{
request.setAttribute("permission", new Integer(PERM_READ));
JSPManager.showJSP(request, response, "/dspace-admin/wizard-permissions.jsp");
break;
}
case PERM_READ:
// Next page is 'permission to submit' iff there's a submit group defined
if (collection.getSubmitters() != null)
{
request.setAttribute("permission", new Integer(PERM_SUBMIT));
JSPManager.showJSP(request, response, "/dspace-admin/wizard-permissions.jsp");
break;
}
case PERM_SUBMIT:
// Next page is 'workflow step 1' iff there's a wf step 1 group defined
if (collection.getWorkflowGroup(1) != null)
{
request.setAttribute("permission", new Integer(PERM_WF1));
JSPManager.showJSP(request, response, "/dspace-admin/wizard-permissions.jsp");
break;
}
case PERM_WF1:
// Next page is 'workflow step 2' iff there's a wf step 2 group defined
if (collection.getWorkflowGroup(2) != null)
{
request.setAttribute("permission", new Integer(PERM_WF2));
JSPManager.showJSP(request, response, "/dspace-admin/wizard-permissions.jsp");
break;
}
case PERM_WF2:
// Next page is 'workflow step 3' iff there's a wf step 2 group defined
if (collection.getWorkflowGroup(3) != null)
{
request.setAttribute("permission", new Integer(PERM_WF3));
JSPManager.showJSP(request, response, "/dspace-admin/wizard-permissions.jsp");
break;
}
case PERM_WF3:
// Next page is 'default item' iff there's a default item
if (collection.getTemplateItem() != null)
{
JSPManager.showJSP(request, response, "/dspace-admin/wizard-default-item.jsp");
break;
}
case DEFAULT_ITEM:
// Next page is 'summary page (the last page)
JSPManager.showJSP(request, response, "/dspace-admin/edit-collection.jsp");
break;
}
}
}

View File

@@ -0,0 +1,101 @@
/*
* EPeopleList.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 browsing through e-people and selecting them
*
* @author Robert Tansley
* @version $Revision$
*/
public class EPersonListServlet extends DSpaceServlet
{
protected void doDSGet(Context context,
HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException, SQLException, AuthorizeException
{
// What are we sorting by. Lastname is default
int sortBy = EPerson.LASTNAME;
String sbParam = request.getParameter("sortby");
if (sbParam != null && sbParam.equals("lastname"))
{
sortBy = EPerson.LASTNAME;
}
else if (sbParam != null && sbParam.equals("email"))
{
sortBy = EPerson.EMAIL;
}
// What's the index of the first eperson to show? Default is 0
int first = UIUtil.getIntParameter(request, "first");
if (first == -1) first = 0;
// Retrieve the e-people in the specified order
EPerson[] epeople = EPerson.findAll(context, sortBy);
// Set attributes for JSP
request.setAttribute("sortby", new Integer(sortBy));
request.setAttribute("first", new Integer(first));
request.setAttribute("epeople", epeople);
JSPManager.showJSP(request, response, "/dspace-admin/eperson-list.jsp");
}
}