Commit 0c1d0c1f authored by Matija Obreza's avatar Matija Obreza

Merge branch 'ui-213-display-accession-data-provider'

* ui-213-display-accession-data-provider:
  Added partner filter to institute
parents e9bfa3c4 5650ac5b
...@@ -22,6 +22,7 @@ import java.util.Set; ...@@ -22,6 +22,7 @@ import java.util.Set;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.genesys.blocks.model.filters.BasicModelFilter; import org.genesys.blocks.model.filters.BasicModelFilter;
import org.genesys.blocks.model.filters.StringFilter; import org.genesys.blocks.model.filters.StringFilter;
import org.genesys.catalog.model.filters.PartnerFilter;
import org.genesys2.server.model.impl.FaoInstitute; import org.genesys2.server.model.impl.FaoInstitute;
import org.genesys2.server.model.impl.QFaoInstitute; import org.genesys2.server.model.impl.QFaoInstitute;
...@@ -49,6 +50,9 @@ public class InstituteFilter extends BasicModelFilter<InstituteFilter, FaoInstit ...@@ -49,6 +50,9 @@ public class InstituteFilter extends BasicModelFilter<InstituteFilter, FaoInstit
/** The networks. */ /** The networks. */
public Set<String> networks; public Set<String> networks;
/** The owner. */
public PartnerFilter owner;
/** /**
* Builds the query. * Builds the query.
* *
...@@ -84,6 +88,9 @@ public class InstituteFilter extends BasicModelFilter<InstituteFilter, FaoInstit ...@@ -84,6 +88,9 @@ public class InstituteFilter extends BasicModelFilter<InstituteFilter, FaoInstit
and.and(institute.accessionCount.eq(0L)); and.and(institute.accessionCount.eq(0L));
} }
} }
if (owner != null && institute.owner != null) {
and.and(owner.buildQuery(institute.owner));
}
if (CollectionUtils.isNotEmpty(networks)) { if (CollectionUtils.isNotEmpty(networks)) {
and.and(institute.networks.any().slug.in(networks)); and.and(institute.networks.any().slug.in(networks));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment