1
|
/**
|
2
|
* Copyright (C) 2017 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.api.service.config;
|
10
|
|
11
|
import java.util.HashSet;
|
12
|
import java.util.Set;
|
13
|
import java.util.UUID;
|
14
|
|
15
|
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
|
16
|
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
|
17
|
|
18
|
/**
|
19
|
* Configurator for the setPublishForSubtree operation.
|
20
|
*
|
21
|
* @author a.mueller
|
22
|
* @since 13.09.2017
|
23
|
*/
|
24
|
public class PublishForSubtreeConfigurator
|
25
|
extends ForSubtreeConfiguratorBase{
|
26
|
|
27
|
private static final long serialVersionUID = 1202667588493272030L;
|
28
|
|
29
|
private boolean publish = false;
|
30
|
private boolean includeMisapplications = true;
|
31
|
private boolean includeProParteSynonyms = true;
|
32
|
//for now, we keep hybrids here, maybe moved to superclass in future
|
33
|
private boolean includeHybrids = true;
|
34
|
|
35
|
|
36
|
|
37
|
|
38
|
//TODO UUIDs ??
|
39
|
private Set<TaxonRelationshipType> includedRelationTypes = new HashSet<>();
|
40
|
|
41
|
|
42
|
public static PublishForSubtreeConfigurator NewInstance(UUID subtreeUuid, boolean publish,
|
43
|
IProgressMonitor monitor) {
|
44
|
PublishForSubtreeConfigurator result = new PublishForSubtreeConfigurator(subtreeUuid, publish, monitor);
|
45
|
return result;
|
46
|
}
|
47
|
|
48
|
public static PublishForSubtreeConfigurator NewInstance(UUID subtreeUuid, boolean publish,
|
49
|
boolean includeAcceptedTaxa, boolean includeSynonyms,
|
50
|
boolean includeSharedTaxa, IProgressMonitor monitor) {
|
51
|
PublishForSubtreeConfigurator result = new PublishForSubtreeConfigurator(subtreeUuid, publish, includeAcceptedTaxa,
|
52
|
includeSynonyms, includeSharedTaxa, monitor);
|
53
|
return result;
|
54
|
}
|
55
|
|
56
|
// ****************************** CONSTRUCTOR ******************************/
|
57
|
|
58
|
/**
|
59
|
* @param subtreeUuid
|
60
|
* @param newSecundum
|
61
|
*/
|
62
|
private PublishForSubtreeConfigurator(UUID subtreeUuid, boolean publish, IProgressMonitor monitor) {
|
63
|
super(subtreeUuid, monitor);
|
64
|
this.publish = publish;
|
65
|
}
|
66
|
|
67
|
private PublishForSubtreeConfigurator(UUID subtreeUuid, boolean publish, boolean includeAcceptedTaxa, boolean includeSynonyms,
|
68
|
boolean includeSharedTaxa, IProgressMonitor monitor) {
|
69
|
super(subtreeUuid, includeAcceptedTaxa, includeSynonyms, includeSharedTaxa, monitor);
|
70
|
this.publish = publish;
|
71
|
}
|
72
|
|
73
|
// ******************************* GETTER / SETTER **************************/
|
74
|
|
75
|
public boolean isPublish() {
|
76
|
return publish;
|
77
|
}
|
78
|
|
79
|
public void setPublish(boolean publish) {
|
80
|
this.publish = publish;
|
81
|
|
82
|
}
|
83
|
|
84
|
public Set<TaxonRelationshipType> getIncludedRelationTypes() {
|
85
|
return includedRelationTypes;
|
86
|
}
|
87
|
public PublishForSubtreeConfigurator setIncludedRelationTypes(Set<TaxonRelationshipType> includedRelationTypes) {
|
88
|
this.includedRelationTypes = includedRelationTypes;
|
89
|
return this;
|
90
|
}
|
91
|
|
92
|
public boolean isIncludeMisapplications() {
|
93
|
return includeMisapplications;
|
94
|
}
|
95
|
public void setIncludeMisapplications(boolean includeMisapplications) {
|
96
|
this.includeMisapplications = includeMisapplications;
|
97
|
|
98
|
}
|
99
|
|
100
|
public boolean isIncludeProParteSynonyms() {
|
101
|
return includeProParteSynonyms;
|
102
|
}
|
103
|
public void setIncludeProParteSynonyms(boolean includeProParteSynonyms) {
|
104
|
this.includeProParteSynonyms = includeProParteSynonyms;
|
105
|
|
106
|
}
|
107
|
|
108
|
public boolean isIncludeHybrids() {
|
109
|
return includeHybrids;
|
110
|
}
|
111
|
|
112
|
public void setIncludeHybrids(boolean includeHybrids) {
|
113
|
this.includeHybrids = includeHybrids;
|
114
|
|
115
|
}
|
116
|
|
117
|
}
|