1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2017 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
package eu.etaxonomy.cdm.vaadin.util;
|
11
|
|
12
|
import java.util.List;
|
13
|
import java.util.UUID;
|
14
|
|
15
|
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;
|
16
|
|
17
|
import eu.etaxonomy.cdm.api.application.CdmRepository;
|
18
|
import eu.etaxonomy.cdm.model.location.NamedArea;
|
19
|
|
20
|
/**
|
21
|
* The {@link LazyQueryDefinition} to be used by {@link DistributionStatusQuery}.
|
22
|
* @author freimeier
|
23
|
* @since 22.11.2017
|
24
|
*
|
25
|
*/
|
26
|
public class DistributionStatusQueryDefinition extends LazyQueryDefinition {
|
27
|
|
28
|
private CdmRepository repo;
|
29
|
private List<UUID> nodeUuids;
|
30
|
private List<NamedArea> namedAreas;
|
31
|
|
32
|
/**
|
33
|
* Creates a new {@link LazyQueryDefinition} to be used by {@link DistributionStatusQuery}.
|
34
|
* @param namedAreas The {@link NamedArea}s to get distribution information for.
|
35
|
* @param compositeItems True if native items should be wrapped to CompositeItems.
|
36
|
* @param batchSize Value for batch size.
|
37
|
*/
|
38
|
public DistributionStatusQueryDefinition(List<NamedArea> namedAreas,
|
39
|
boolean compositeItems, int batchSize) {
|
40
|
super(compositeItems, batchSize, DistributionStatusQuery.UUID_COLUMN);
|
41
|
this.addProperty(DistributionStatusQuery.UUID_COLUMN, UUID.class, null, true, false);
|
42
|
this.addProperty(DistributionStatusQuery.TAXON_COLUMN, String.class, null, true, false);
|
43
|
namedAreas.forEach(na -> this.addProperty(na.getUuid(), UUID.class, null, false, false));
|
44
|
}
|
45
|
}
|