@Test public void testCountItems() throws Exception { assertTrue("testCountItems 0", c.countItems() == 0); }
public int countItems() throws SQLException { int itemcount = 0; PreparedStatement statement = null; ResultSet rs = null; try { String query = "SELECT count(*) FROM collection2item, item WHERE " + "collection2item.collection_id = ? " + "AND collection2item.item_id = item.item_id " + "AND in_archive ='1' AND item.withdrawn='0' "; statement = ourContext.getDBConnection().prepareStatement(query); statement.setInt(1,getID()); rs = statement.executeQuery(); if (rs != null) { rs.next(); itemcount = rs.getInt(1); } } finally { if (rs != null) { try { rs.close(); } catch (SQLException sqle) { } } if (statement != null) { try { statement.close(); } catch (SQLException sqle) { } } } return itemcount; }
Collection extends DSpaceObject { public int countItems() throws SQLException { int itemcount = 0; PreparedStatement statement = null; ResultSet rs = null; try { String query = "SELECT count(*) FROM collection2item, item WHERE " + "collection2item.collection_id = ? " + "AND collection2item.item_id = item.item_id " + "AND in_archive ='1' AND item.withdrawn='0' "; statement = ourContext.getDBConnection().prepareStatement(query); statement.setInt(1,getID()); rs = statement.executeQuery(); if (rs != null) { rs.next(); itemcount = rs.getInt(1); } } finally { if (rs != null) { try { rs.close(); } catch (SQLException sqle) { } } if (statement != null) { try { statement.close(); } catch (SQLException sqle) { } } } return itemcount; } }
Collection extends DSpaceObject { public int countItems() throws SQLException { int itemcount = 0; PreparedStatement statement = null; ResultSet rs = null; try { String query = "SELECT count(*) FROM collection2item, item WHERE " + "collection2item.collection_id = ? " + "AND collection2item.item_id = item.item_id " + "AND in_archive ='1' AND item.withdrawn='0' "; statement = ourContext.getDBConnection().prepareStatement(query); statement.setInt(1,getID()); rs = statement.executeQuery(); if (rs != null) { rs.next(); itemcount = rs.getInt(1); } } finally { if (rs != null) { try { rs.close(); } catch (SQLException sqle) { } } if (statement != null) { try { statement.close(); } catch (SQLException sqle) { } } } return itemcount; } Collection(Context context, TableRow row); }
Collection extends DSpaceObject { public int countItems() throws SQLException { int itemcount = 0; PreparedStatement statement = null; ResultSet rs = null; try { String query = "SELECT count(*) FROM collection2item, item WHERE " + "collection2item.collection_id = ? " + "AND collection2item.item_id = item.item_id " + "AND in_archive ='1' AND item.withdrawn='0' "; statement = ourContext.getDBConnection().prepareStatement(query); statement.setInt(1,getID()); rs = statement.executeQuery(); if (rs != null) { rs.next(); itemcount = rs.getInt(1); } } finally { if (rs != null) { try { rs.close(); } catch (SQLException sqle) { } } if (statement != null) { try { statement.close(); } catch (SQLException sqle) { } } } return itemcount; } Collection(Context context, TableRow row); static Collection find(Context context, int id); static Collection[] findAll(Context context); ItemIterator getItems(); ItemIterator getAllItems(); int getID(); String getHandle(); String getMetadata(String field); void setMetadata(String field, String value); String getName(); Bitstream getLogo(); Bitstream setLogo(InputStream is); Group createWorkflowGroup(int step); void setWorkflowGroup(int step, Group g); Group getWorkflowGroup(int step); Group createSubmitters(); void removeSubmitters(); Group getSubmitters(); Group createAdministrators(); void removeAdministrators(); Group getAdministrators(); String getLicense(); String getLicenseCollection(); boolean hasCustomLicense(); void setLicense(String license); Item getTemplateItem(); void createTemplateItem(); void removeTemplateItem(); void addItem(Item item); void removeItem(Item item); void update(); boolean canEditBoolean(); boolean canEditBoolean(boolean useInheritance); void canEdit(); void canEdit(boolean useInheritance); Community[] getCommunities(); @Override boolean equals(Object other); @Override int hashCode(); int getType(); static Collection[] findAuthorized(Context context, Community comm,
            int actionID); int countItems(); DSpaceObject getAdminObject(int action); @Override DSpaceObject getParentObject(); }
Collection extends DSpaceObject { public int countItems() throws SQLException { int itemcount = 0; PreparedStatement statement = null; ResultSet rs = null; try { String query = "SELECT count(*) FROM collection2item, item WHERE " + "collection2item.collection_id = ? " + "AND collection2item.item_id = item.item_id " + "AND in_archive ='1' AND item.withdrawn='0' "; statement = ourContext.getDBConnection().prepareStatement(query); statement.setInt(1,getID()); rs = statement.executeQuery(); if (rs != null) { rs.next(); itemcount = rs.getInt(1); } } finally { if (rs != null) { try { rs.close(); } catch (SQLException sqle) { } } if (statement != null) { try { statement.close(); } catch (SQLException sqle) { } } } return itemcount; } Collection(Context context, TableRow row); static Collection find(Context context, int id); static Collection[] findAll(Context context); ItemIterator getItems(); ItemIterator getAllItems(); int getID(); String getHandle(); String getMetadata(String field); void setMetadata(String field, String value); String getName(); Bitstream getLogo(); Bitstream setLogo(InputStream is); Group createWorkflowGroup(int step); void setWorkflowGroup(int step, Group g); Group getWorkflowGroup(int step); Group createSubmitters(); void removeSubmitters(); Group getSubmitters(); Group createAdministrators(); void removeAdministrators(); Group getAdministrators(); String getLicense(); String getLicenseCollection(); boolean hasCustomLicense(); void setLicense(String license); Item getTemplateItem(); void createTemplateItem(); void removeTemplateItem(); void addItem(Item item); void removeItem(Item item); void update(); boolean canEditBoolean(); boolean canEditBoolean(boolean useInheritance); void canEdit(); void canEdit(boolean useInheritance); Community[] getCommunities(); @Override boolean equals(Object other); @Override int hashCode(); int getType(); static Collection[] findAuthorized(Context context, Community comm,
            int actionID); int countItems(); DSpaceObject getAdminObject(int action); @Override DSpaceObject getParentObject();  }