SF patch #1517488 Access Bitstreams in Withdrawn Items SF bug #1408373

git-svn-id: http://scm.dspace.org/svn/repo/trunk@1591 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Claudia Juergen
2006-09-04 12:07:12 +00:00
parent c6e5a20b15
commit 9a7155e9b5
2 changed files with 35 additions and 20 deletions

View File

@@ -29,6 +29,7 @@
(Claudia Juergen) (Claudia Juergen)
- SF patch #1514965 fixes SF bug #1505422. fix typo in SQL for item mapper - SF patch #1514965 fixes SF bug #1505422. fix typo in SQL for item mapper
- SF patch #1516988 Deleting owner of mapped items SF bug #1196724 - SF patch #1516988 Deleting owner of mapped items SF bug #1196724
- SF patch #1517488 Access Bitstreams in Withdrawn Items SF bug #1408373
(Richard Jones) (Richard Jones)
- SF bug #1515075. minor build file fix to copy correct config file - SF bug #1515075. minor build file fix to copy correct config file

View File

@@ -77,6 +77,7 @@ public class BitstreamServlet extends DSpaceServlet
SQLException, AuthorizeException SQLException, AuthorizeException
{ {
Bitstream bitstream = null; Bitstream bitstream = null;
boolean isWithdrawn = false;
// Get the ID from the URL // Get the ID from the URL
String idString = request.getPathInfo(); String idString = request.getPathInfo();
@@ -132,6 +133,9 @@ public class BitstreamServlet extends DSpaceServlet
return; return;
} }
// determine whether the item the bitstream belongs to has been withdrawn
isWithdrawn = item.isWithdrawn();
int sid = Integer.parseInt(sequence); int sid = Integer.parseInt(sequence);
boolean found = false; boolean found = false;
@@ -157,6 +161,8 @@ public class BitstreamServlet extends DSpaceServlet
} }
} }
if (!isWithdrawn)
{
// Did we get a bitstream? // Did we get a bitstream?
if (bitstream != null) if (bitstream != null)
{ {
@@ -177,6 +183,7 @@ public class BitstreamServlet extends DSpaceServlet
is.close(); is.close();
response.getOutputStream().flush(); response.getOutputStream().flush();
} }
// display the tombstone instead of the bitstream if the item is withdrawn
else else
{ {
// No bitstream - we got an invalid ID // No bitstream - we got an invalid ID
@@ -187,4 +194,11 @@ public class BitstreamServlet extends DSpaceServlet
Constants.BITSTREAM); Constants.BITSTREAM);
} }
} }
else
{
log.info(LogManager.getHeader(context, "view_bitstream", "item has been withdrawn"));
JSPManager.showJSP(request, response, "/tombstone.jsp");
}
}
} }