mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 23:13:10 +00:00
Fixed browse index for withdrawn items. Moved DB access from BrowseItem into a DAO. Added jsp interface for browsing withdrawn items.
git-svn-id: http://scm.dspace.org/svn/repo/trunk@2144 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -138,6 +138,11 @@ public class BrowseDAOOracle implements BrowseDAO
|
||||
/** whether the query (above) needs to be regenerated */
|
||||
private boolean rebuildQuery = true;
|
||||
|
||||
// FIXME Would be better to join to item table and get the correct values
|
||||
/** flags for what the items represent */
|
||||
private boolean itemsInArchive = true;
|
||||
private boolean itemsWithdrawn = false;
|
||||
|
||||
public BrowseDAOOracle(Context context)
|
||||
throws BrowseException
|
||||
{
|
||||
@@ -254,7 +259,9 @@ public class BrowseDAOOracle implements BrowseDAO
|
||||
while (tri.hasNext())
|
||||
{
|
||||
TableRow row = tri.next();
|
||||
BrowseItem browseItem = new BrowseItem(context, row.getIntColumn("item_id"));
|
||||
BrowseItem browseItem = new BrowseItem(context, row.getIntColumn("item_id"),
|
||||
itemsInArchive,
|
||||
itemsWithdrawn);
|
||||
results.add(browseItem);
|
||||
}
|
||||
|
||||
@@ -579,6 +586,21 @@ public class BrowseDAOOracle implements BrowseDAO
|
||||
public void setTable(String table)
|
||||
{
|
||||
this.table = table;
|
||||
|
||||
// FIXME Rather than assume from the browse table, join the query to item to get the correct values
|
||||
// Check to see if this is the withdrawn browse index - if it is,
|
||||
// we need to set the flags appropriately for when we create the BrowseItems
|
||||
if (table.equals(BrowseIndex.getWithdrawnBrowseIndex().getTableName()))
|
||||
{
|
||||
itemsInArchive = false;
|
||||
itemsWithdrawn = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
itemsInArchive = true;
|
||||
itemsWithdrawn = false;
|
||||
}
|
||||
|
||||
this.rebuildQuery = true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user