criteria.addFilterVersion(getFilter(request, "version", String.class));
criteria.addFilterParentResourceCategory(getFilter(request, FILTER_PARENT_CATEGORY, ResourceCategory.class));
// we never want to filter on null status - that would return resources for every status (committed, new, deleted, etc).
// we want to rely on whatever the default setting is for the criteria and only override that if we explicitly have a status to filter.
InventoryStatus invStatusFilter = getFilter(request, INVENTORY_STATUS.propertyName(), InventoryStatus.class);
if (invStatusFilter != null) {
criteria.addFilterInventoryStatus(invStatusFilter);
}
InventoryStatus parentInvStatusFilter = getFilter(request, PARENT_INVENTORY_STATUS.propertyName(),
InventoryStatus.class);
if (parentInvStatusFilter != null) {
List<InventoryStatus> statuses = new ArrayList<InventoryStatus>(1);
statuses.add(parentInvStatusFilter);
criteria.addFilterParentInventoryStatuses(statuses);