mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
91354: WIP: basic fix for reindexing older versions of items
This commit is contained in:
@@ -245,6 +245,10 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
|
|||||||
return itemDAO.findAll(context, true, true);
|
return itemDAO.findAll(context, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Iterator<Item> findAllRegularItems(Context context) throws SQLException {
|
||||||
|
return itemDAO.findAllRegularItems(context);
|
||||||
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Iterator<Item> findBySubmitter(Context context, EPerson eperson) throws SQLException {
|
public Iterator<Item> findBySubmitter(Context context, EPerson eperson) throws SQLException {
|
||||||
return itemDAO.findBySubmitter(context, eperson);
|
return itemDAO.findBySubmitter(context, eperson);
|
||||||
|
@@ -32,8 +32,22 @@ public interface ItemDAO extends DSpaceObjectLegacySupportDAO<Item> {
|
|||||||
|
|
||||||
public Iterator<Item> findAll(Context context, boolean archived, int limit, int offset) throws SQLException;
|
public Iterator<Item> findAll(Context context, boolean archived, int limit, int offset) throws SQLException;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public Iterator<Item> findAll(Context context, boolean archived, boolean withdrawn) throws SQLException;
|
public Iterator<Item> findAll(Context context, boolean archived, boolean withdrawn) throws SQLException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find all items that are:
|
||||||
|
* - NOT in the workspace
|
||||||
|
* - NOT in the workflow
|
||||||
|
* - NOT a template item for e.g. a collection
|
||||||
|
*
|
||||||
|
* This implies that the result also contains older versions of items and withdrawn items.
|
||||||
|
* @param context the DSpace context.
|
||||||
|
* @return iterator over all regular items.
|
||||||
|
* @throws SQLException if database error.
|
||||||
|
*/
|
||||||
|
public Iterator<Item> findAllRegularItems(Context context) throws SQLException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find all Items modified since a Date.
|
* Find all Items modified since a Date.
|
||||||
*
|
*
|
||||||
|
@@ -79,6 +79,13 @@ public class ItemDAOImpl extends AbstractHibernateDSODAO<Item> implements ItemDA
|
|||||||
return iterate(query);
|
return iterate(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Iterator<Item> findAllRegularItems(Context context) throws SQLException {
|
||||||
|
// TODO exclude workspace, workflow, template items
|
||||||
|
Query query = createQuery(context, "FROM Item ORDER BY id");
|
||||||
|
return iterate(query);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Iterator<Item> findAll(Context context, boolean archived,
|
public Iterator<Item> findAll(Context context, boolean archived,
|
||||||
boolean withdrawn, boolean discoverable, Date lastModified)
|
boolean withdrawn, boolean discoverable, Date lastModified)
|
||||||
|
@@ -112,8 +112,22 @@ public interface ItemService
|
|||||||
* @return an iterator over the items in the archive.
|
* @return an iterator over the items in the archive.
|
||||||
* @throws SQLException if database error
|
* @throws SQLException if database error
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public Iterator<Item> findAllUnfiltered(Context context) throws SQLException;
|
public Iterator<Item> findAllUnfiltered(Context context) throws SQLException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find all items that are:
|
||||||
|
* - NOT in the workspace
|
||||||
|
* - NOT in the workflow
|
||||||
|
* - NOT a template item for e.g. a collection
|
||||||
|
*
|
||||||
|
* This implies that the result also contains older versions of items and withdrawn items.
|
||||||
|
* @param context the DSpace context.
|
||||||
|
* @return iterator over all regular items.
|
||||||
|
* @throws SQLException if database error.
|
||||||
|
*/
|
||||||
|
public Iterator<Item> findAllRegularItems(Context context) throws SQLException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find all the items in the archive by a given submitter. The order is
|
* Find all the items in the archive by a given submitter. The order is
|
||||||
* indeterminate. Only items with the "in archive" flag set are included.
|
* indeterminate. Only items with the "in archive" flag set are included.
|
||||||
|
@@ -103,7 +103,7 @@ public class ItemIndexFactoryImpl extends DSpaceObjectIndexFactoryImpl<Indexable
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Iterator<IndexableItem> findAll(Context context) throws SQLException {
|
public Iterator<IndexableItem> findAll(Context context) throws SQLException {
|
||||||
Iterator<Item> items = itemService.findAllUnfiltered(context);
|
Iterator<Item> items = itemService.findAllRegularItems(context);
|
||||||
return new Iterator<IndexableItem>() {
|
return new Iterator<IndexableItem>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean hasNext() {
|
public boolean hasNext() {
|
||||||
|
Reference in New Issue
Block a user