Page History
...
This is a fairly straightforward implementation of the above interface. As much as possible, code from the original Item
class will be used. For instance, this is how getItems()
is implemented:
Code Block |
---|
public List<Item> getItems() { try { TableRowIterator tri = DatabaseManager.queryTable(context, "item", "SELECT item_id FROM item WHERE in_archive = '1'"); List<Item> items = new ArrayList<Item>(); for (TableRow row : tri.toList()) { int id = row.getIntColumn("item_id"); items.add(retrieve(id)); } return items; } catch (SQLException sqle){ // Need to think more carefully about how we deal with SQLExceptions throw new RuntimeException(sqle); } } |
Some changes have been made to eliminate {{ItemIterator
}}s, and to generally make things a little more consistent with the rest of the code (this looks almost identical to, eg, CollectionDAO.getCollections()
.
org.dspace.core
org.dspace.core.ArchiveManager
...
Overview
Content Tools