From c97c8f38a92036fd5baeb074172be9bb90be5787 Mon Sep 17 00:00:00 2001 From: Robert Tansley Date: Mon, 21 Oct 2002 13:56:10 +0000 Subject: [PATCH] Item deletion and tombstones supported. SF feature request #620656 git-svn-id: http://scm.dspace.org/svn/repo/trunk@453 9c30dcfa-912a-0410-8fc2-9e0234be79fd --- dspace/etc/database_schema.sql | 8 +- dspace/jsp/admin/confirm-delete-item.jsp | 7 +- dspace/jsp/admin/confirm-withdraw-item.jsp | 84 ++++++++++ dspace/jsp/admin/edit-item-form.jsp | 43 ++++- dspace/jsp/browse/items-by-date.jsp | 3 +- dspace/jsp/layout/navbar-admin.jsp | 2 +- dspace/jsp/tombstone.jsp | 61 +++++++ .../org/dspace/app/oai/DSpaceOAICatalog.java | 24 ++- .../dspace/app/oai/DSpaceRecordFactory.java | 4 +- .../app/webui/servlet/DisplayItemServlet.java | 9 + .../webui/servlet/admin/EditItemServlet.java | 29 ++++ dspace/src/org/dspace/content/Collection.java | 3 +- dspace/src/org/dspace/content/Item.java | 156 +++++++++++++++++- dspace/src/org/dspace/eperson/Subscribe.java | 3 +- dspace/src/org/dspace/search/Harvest.java | 87 ++++++++-- .../org/dspace/search/HarvestedItemInfo.java | 3 + 16 files changed, 491 insertions(+), 35 deletions(-) create mode 100644 dspace/jsp/admin/confirm-withdraw-item.jsp create mode 100644 dspace/jsp/tombstone.jsp diff --git a/dspace/etc/database_schema.sql b/dspace/etc/database_schema.sql index c35198f692..05d8637c0b 100644 --- a/dspace/etc/database_schema.sql +++ b/dspace/etc/database_schema.sql @@ -183,9 +183,11 @@ CREATE TABLE EPersonGroup ------------------------------------------------------- CREATE TABLE Item ( - item_id INTEGER PRIMARY KEY, - submitter_id INTEGER REFERENCES EPerson(eperson_id), - in_archive BOOL + item_id INTEGER PRIMARY KEY, + submitter_id INTEGER REFERENCES EPerson(eperson_id), + in_archive BOOL, + withdrawn BOOL, + withdrawal_date VARCHAR(21) ); ------------------------------------------------------- diff --git a/dspace/jsp/admin/confirm-delete-item.jsp b/dspace/jsp/admin/confirm-delete-item.jsp index d011bbe0fc..440a17073b 100644 --- a/dspace/jsp/admin/confirm-delete-item.jsp +++ b/dspace/jsp/admin/confirm-delete-item.jsp @@ -57,15 +57,16 @@ -

Delete Item: <%= (handle == null ? item.getID() : handle) %>

+

Delete Item: <%= (handle == null ? String.valueOf(item.getID()) : handle) %>

-

Are you sure this item should be completely deleted?

+

Are you sure this item should be completely deleted? Caution: + At present, no tombstone would be left.

- +
diff --git a/dspace/jsp/admin/confirm-withdraw-item.jsp b/dspace/jsp/admin/confirm-withdraw-item.jsp new file mode 100644 index 0000000000..97e4164977 --- /dev/null +++ b/dspace/jsp/admin/confirm-withdraw-item.jsp @@ -0,0 +1,84 @@ +<%-- + - confirm-withdraw-item.jsp + - + - Version: $Revision$ + - + - Date: $Date$ + - + - Copyright (c) 2001, 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. + --%> + +<%-- + - Confirm withdrawal of a item + - + - Attributes: + - item - item we may withdraw + --%> + +<%@ page import="org.dspace.app.webui.servlet.admin.EditItemServlet" %> +<%@ page import="org.dspace.content.Item" %> + +<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %> + +<% + String handle = (String) request.getAttribute("handle"); + Item item = (Item) request.getAttribute("item"); +%> + + + +

Withdraw Item: <%= (handle == null ? String.valueOf(item.getID()) : handle) %>

+ +

Are you sure this item should be withdrawn from the archive?

+ + + + + + + +
+
+ + + + +
+ + + +
+
+
+
+ diff --git a/dspace/jsp/admin/edit-item-form.jsp b/dspace/jsp/admin/edit-item-form.jsp index 8ed0dbdd3d..59d775d158 100644 --- a/dspace/jsp/admin/edit-item-form.jsp +++ b/dspace/jsp/admin/edit-item-form.jsp @@ -50,6 +50,7 @@ <%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %> +<%@ page import="java.util.Date" %> <%@ page import="java.util.HashMap" %> <%@ page import="java.util.Map" %> @@ -59,6 +60,7 @@ <%@ page import="org.dspace.content.BitstreamFormat" %> <%@ page import="org.dspace.content.Bundle" %> <%@ page import="org.dspace.content.Collection" %> +<%@ page import="org.dspace.content.DCDate" %> <%@ page import="org.dspace.content.DCValue" %> <%@ page import="org.dspace.content.Item" %> <%@ page import="org.dspace.core.ConfigurationManager" %> @@ -68,6 +70,8 @@ String handle = (String) request.getAttribute("handle"); Collection[] collections = (Collection[]) request.getAttribute("collections"); DCType[] dcTypes = (DCType[]) request.getAttribute("dc.types"); + + DCDate withdrawalDate = item.getWithdrawalDate(); %> Item internal ID: <%= item.getID() %> -
+<% + if (withdrawalDate == null) + { +%> + - + + +
+<% + } + else + { +%> +
+ + + +
+<% + } +%> +
+
+ +
@@ -121,8 +148,20 @@ +<% + + + if (withdrawalDate != null) + { +%> +

This item was withdrawn from DSpace on +

+<% + } +%>

 

+
diff --git a/dspace/jsp/browse/items-by-date.jsp b/dspace/jsp/browse/items-by-date.jsp index 06e44bf2c8..b48f8ba2cd 100644 --- a/dspace/jsp/browse/items-by-date.jsp +++ b/dspace/jsp/browse/items-by-date.jsp @@ -135,7 +135,8 @@