Package org.dspace.rest.filter
Class ItemFilterSet
- java.lang.Object
-
- org.dspace.rest.filter.ItemFilterSet
-
public class ItemFilterSet extends Object
The set of Item Filter Use Cases to apply to a collection of items.- Author:
- Terry Brady, Georgetown University
-
-
Field Summary
Fields Modifier and Type Field Description protected AuthorizeService
authorizeService
-
Constructor Summary
Constructors Constructor Description ItemFilterSet(String filterList, boolean reportItems)
Construct a set of Item Filters identified by a list string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ItemFilter
getAllFiltersFilter()
Get the special filter that represents the intersection of all items in the Item Filter Set.List<ItemFilter>
getItemFilters()
Get all of the Item Filters initialized into the Item Filter Setint
processSaveItems(Context context, javax.servlet.ServletContext servletContext, Iterator<Item> childItems, boolean save, String expand)
Evaluate a set of Items against the Item Filters in the Item Filter Set Current DSpace Contextint
processSaveItems(Context context, javax.servlet.ServletContext servletContext, Iterator<Item> childItems, List<Item> items, boolean save, String expand)
Evaluate a set of Items against the Item Filters in the Item Filter Setvoid
testItem(Context context, Item item, Item restItem)
Evaluate an item against the use cases in the Item Filter Set.
-
-
-
Field Detail
-
authorizeService
protected AuthorizeService authorizeService
-
-
Constructor Detail
-
ItemFilterSet
public ItemFilterSet(String filterList, boolean reportItems)
Construct a set of Item Filters identified by a list string.- Parameters:
filterList
- Comma separated list of filter names to include. UseItemFilter.ALL
to retrieve all filters.reportItems
- If true, return item details. If false, return only counts of items.
-
-
Method Detail
-
getAllFiltersFilter
public ItemFilter getAllFiltersFilter()
Get the special filter that represents the intersection of all items in the Item Filter Set.- Returns:
- the special Item Filter that contains items that satisfied every other Item Filter in the Item Filter Set
-
testItem
public void testItem(Context context, Item item, Item restItem)
Evaluate an item against the use cases in the Item Filter Set. If an item satisfies all items in the Item Filter Set, it should also ve added to the special all items filter.- Parameters:
context
- Active DSpace Contextitem
- DSpace Object to evaluaterestItem
- REST representation of the DSpace Object being evaluated
-
getItemFilters
public List<ItemFilter> getItemFilters()
Get all of the Item Filters initialized into the Item Filter Set- Returns:
- a list of Item Filters initialized into the Item Filter Set
-
processSaveItems
public int processSaveItems(Context context, javax.servlet.ServletContext servletContext, Iterator<Item> childItems, boolean save, String expand) throws javax.ws.rs.WebApplicationException, SQLException
Evaluate a set of Items against the Item Filters in the Item Filter Set Current DSpace Context- Parameters:
context
- Current DSpace ContextservletContext
- Context of the servlet container.childItems
- Collection of Items to Evaluatesave
- If true, save the details of each item that is evaluatedexpand
- List of item details to include in the results- Returns:
- The number of items evaluated
- Throws:
javax.ws.rs.WebApplicationException
- Runtime exception for applications.SQLException
- An exception that provides information on a database access error or other errors.
-
processSaveItems
public int processSaveItems(Context context, javax.servlet.ServletContext servletContext, Iterator<Item> childItems, List<Item> items, boolean save, String expand) throws javax.ws.rs.WebApplicationException, SQLException
Evaluate a set of Items against the Item Filters in the Item Filter Set- Parameters:
context
- Current DSpace ContextservletContext
- Context of the servlet container.childItems
- Collection of Items to Evaluateitems
- List of items to contain saved resultssave
- If true, save the details of each item that is evaluatedexpand
- List of item details to include in the results- Returns:
- The number of items evaluated
- Throws:
javax.ws.rs.WebApplicationException
- Runtime exception for applications.SQLException
- An exception that provides information on a database access error or other errors.
-
-