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:
Graham Triggs
2007-08-19 21:25:58 +00:00
parent 009e066a5f
commit 4d3985d466
23 changed files with 1232 additions and 1678 deletions

View File

@@ -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;
}