Class 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
    • 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. Use ItemFilter.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 Context
        item - DSpace Object to evaluate
        restItem - 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 Context
        servletContext - Context of the servlet container.
        childItems - Collection of Items to Evaluate
        save - If true, save the details of each item that is evaluated
        expand - 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 Context
        servletContext - Context of the servlet container.
        childItems - Collection of Items to Evaluate
        items - List of items to contain saved results
        save - If true, save the details of each item that is evaluated
        expand - 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.