1
|
/**
|
2
|
* Copyright (C) 2007 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
|
|
10
|
package eu.etaxonomy.cdm.persistence.dao.taxon;
|
11
|
|
12
|
import java.util.Collection;
|
13
|
import java.util.List;
|
14
|
import java.util.Map;
|
15
|
import java.util.Set;
|
16
|
import java.util.UUID;
|
17
|
|
18
|
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
|
19
|
import eu.etaxonomy.cdm.model.common.TreeIndex;
|
20
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
21
|
import eu.etaxonomy.cdm.model.taxon.Classification;
|
22
|
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
|
23
|
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
|
24
|
import eu.etaxonomy.cdm.model.taxon.TaxonNodeAgentRelation;
|
25
|
import eu.etaxonomy.cdm.persistence.dao.common.IAnnotatableDao;
|
26
|
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
|
27
|
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
|
28
|
|
29
|
/**
|
30
|
* @author a.mueller
|
31
|
*
|
32
|
*/
|
33
|
public interface ITaxonNodeDao extends IAnnotatableDao<TaxonNode> {
|
34
|
|
35
|
public UUID delete(TaxonNode persistentObject, boolean deleteChildren);
|
36
|
|
37
|
/**
|
38
|
*
|
39
|
* @return
|
40
|
*/
|
41
|
public List<TaxonNode> getTaxonOfAcceptedTaxaByClassification(Classification classification, Integer start, Integer end);
|
42
|
|
43
|
/**
|
44
|
* @param classification
|
45
|
* @return
|
46
|
*/
|
47
|
public int countTaxonOfAcceptedTaxaByClassification(Classification classification);
|
48
|
|
49
|
/**
|
50
|
* Lists all direct child nodes of the given {@link UuidAndTitleCache} which
|
51
|
* represents the parent {@link TaxonNode}
|
52
|
* @param parent a UuidAndTitleCache object which represents a parent {@link TaxonNode}
|
53
|
* @return a list of UuidAndTitleCache objects that represent children of the
|
54
|
* parent
|
55
|
*/
|
56
|
public List<UuidAndTitleCache<TaxonNode>> listChildNodesAsUuidAndTitleCache(UuidAndTitleCache<TaxonNode> parent);
|
57
|
|
58
|
/**
|
59
|
* Retrieves the parent node of the {@link TaxonNode} represented by the given {@link UuidAndTitleCache}.
|
60
|
* @param child the child for which the parent should be retrieved
|
61
|
* @return an UuidAndTitleCache object representing the parent node
|
62
|
*/
|
63
|
public UuidAndTitleCache<TaxonNode> getParentUuidAndTitleCache(UuidAndTitleCache<TaxonNode> child);
|
64
|
|
65
|
/**
|
66
|
* Retrieves a list of {@link UuidAndTitleCache} objects that have a matching titleCache
|
67
|
* @param limit the maximum results
|
68
|
* @param pattern the titleCache that is searched for
|
69
|
* @param classificationUuid if specified only nodes of this classification are retrieved
|
70
|
* @return a list of matches
|
71
|
*/
|
72
|
public List<UuidAndTitleCache<TaxonNode>> getUuidAndTitleCache(Integer limit, String pattern, UUID classificationUuid);
|
73
|
|
74
|
public List<TaxonNode> listChildrenOf(TaxonNode node, Integer pageSize, Integer pageIndex, List<String> propertyPaths, boolean recursive);
|
75
|
|
76
|
public abstract Long countChildrenOf(TaxonNode node, Classification classification, boolean recursive);
|
77
|
|
78
|
/**
|
79
|
* Returns the of TaxonNodeAgentRelation entities which are associated with the TaxonNode for the
|
80
|
* given TaxonUuid in the specified Classification.
|
81
|
*
|
82
|
* @param taxonUuid
|
83
|
* @param agentUuid TODO
|
84
|
* @param relTypeUuid TODO
|
85
|
* @param start
|
86
|
* @param limit
|
87
|
* @param propertyPaths
|
88
|
* @param rankId TODO
|
89
|
* @param classification
|
90
|
* @return
|
91
|
*/
|
92
|
List<TaxonNodeAgentRelation> listTaxonNodeAgentRelations(UUID taxonUuid, UUID classificationUuid,
|
93
|
UUID agentUuid, UUID rankUuid, UUID relTypeUuid, Integer start, Integer limit, List<String> propertyPaths);
|
94
|
|
95
|
/**
|
96
|
* Returns the number of TaxonNodeAgentRelation entities which are associated with the TaxonNode for the
|
97
|
* given TaxonUuid in the specified Classification.
|
98
|
*
|
99
|
* @param taxonUuid
|
100
|
* @param agentUuid TODO
|
101
|
* @param relTypeUuid TODO
|
102
|
* @param rankId TODO
|
103
|
* @param classification
|
104
|
* @return
|
105
|
*/
|
106
|
long countTaxonNodeAgentRelations(UUID taxonUuid, UUID classificationUuid, UUID agentUuid, UUID rankUuid, UUID relTypeUuid);
|
107
|
|
108
|
/**
|
109
|
* Computes a map treeIndex->rank(sortIndex) for each given taxon node treeIndex. Required by #5957.
|
110
|
* If the taxon represented by the treeindex is not in the given rank range no record is returned for the given
|
111
|
* treeindex.
|
112
|
*
|
113
|
* @param treeIndex the list of treeIndexes
|
114
|
* @param minRankOrderIndex min rank
|
115
|
* @param maxRankOrderIndex max rank
|
116
|
* @return
|
117
|
*/
|
118
|
Map<TreeIndex, Integer> rankOrderIndexForTreeIndex(List<TreeIndex> treeIndex, Integer minRankOrderIndex,
|
119
|
Integer maxRankOrderIndex);
|
120
|
|
121
|
/**
|
122
|
* For a given set of taxon node tree indexes the uuid and title cache of the taxon represented
|
123
|
* by this treeindex is returned.
|
124
|
* @param treeIndexSet set of taxon node tree indexes
|
125
|
* @return map with treeindex and uuidAndTitleCache of the represented taxon
|
126
|
*/
|
127
|
public Map<TreeIndex, UuidAndTitleCache<?>> taxonUuidsForTreeIndexes(Collection<TreeIndex> treeIndexSet);
|
128
|
|
129
|
|
130
|
|
131
|
/**
|
132
|
* @param subTreeIndex
|
133
|
* @param newSec
|
134
|
* @param overwriteExistingAccepted
|
135
|
* @param includeSharedTaxa
|
136
|
* @param emptySecundumDetail
|
137
|
* @return
|
138
|
*/
|
139
|
public int countSecundumForSubtreeAcceptedTaxa(TreeIndex subTreeIndex, Reference newSec,
|
140
|
boolean overwriteExistingAccepted, boolean includeSharedTaxa, boolean emptySecundumDetail);
|
141
|
|
142
|
/**
|
143
|
* @param subTreeIndex
|
144
|
* @param newSec
|
145
|
* @param overwriteExistingSynonyms
|
146
|
* @param includeSharedTaxa
|
147
|
* @param emptySecundumDetail
|
148
|
* @return
|
149
|
*/
|
150
|
public int countSecundumForSubtreeSynonyms(TreeIndex subTreeIndex, Reference newSec,
|
151
|
boolean overwriteExistingSynonyms, boolean includeSharedTaxa, boolean emptySecundumDetail);
|
152
|
|
153
|
/**
|
154
|
* @param subTreeIndex
|
155
|
* @param newSec
|
156
|
* @param overwriteExisting
|
157
|
* @param includeSharedTaxa
|
158
|
* @param emptyDetail
|
159
|
* @param monitor
|
160
|
* @return
|
161
|
*/
|
162
|
public Set<TaxonBase> setSecundumForSubtreeAcceptedTaxa(TreeIndex subTreeIndex, Reference newSec, boolean overwriteExisting, boolean includeSharedTaxa, boolean emptyDetail, IProgressMonitor monitor);
|
163
|
|
164
|
public Set<TaxonBase> setSecundumForSubtreeSynonyms(TreeIndex subTreeIndex, Reference newSec, boolean overwriteExisting, boolean includeSharedTaxa, boolean emptyDetail, IProgressMonitor monitor);
|
165
|
|
166
|
|
167
|
/**
|
168
|
* @param subTreeIndex
|
169
|
* @param includeSharedTaxa
|
170
|
* @param includeSharedTaxa2
|
171
|
* @return
|
172
|
*/
|
173
|
public int countPublishForSubtreeAcceptedTaxa(TreeIndex subTreeIndex, boolean publish, boolean includeSharedTaxa);
|
174
|
public Set<TaxonBase> setPublishForSubtreeAcceptedTaxa(TreeIndex subTreeIndex, boolean publish, boolean includeSharedTaxa, IProgressMonitor monitor);
|
175
|
|
176
|
/**
|
177
|
* @param subTreeIndex
|
178
|
* @param includeSharedTaxa
|
179
|
* @return
|
180
|
*/
|
181
|
public int countPublishForSubtreeSynonyms(TreeIndex subTreeIndex, boolean publish, boolean includeSharedTaxa);
|
182
|
public Set<TaxonBase> setPublishForSubtreeSynonyms(TreeIndex subTreeIndex, boolean publish,
|
183
|
boolean includeSharedTaxa, IProgressMonitor monitor);
|
184
|
|
185
|
/**
|
186
|
* @param parent
|
187
|
* @return
|
188
|
*/
|
189
|
public List<TaxonNodeDto> listChildNodesAsTaxonNodeDto(UuidAndTitleCache<TaxonNode> parent);
|
190
|
|
191
|
/**
|
192
|
* @param classification
|
193
|
* @param limit
|
194
|
* @param pattern
|
195
|
* @return
|
196
|
*/
|
197
|
List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(
|
198
|
Classification classification, Integer limit, String pattern, boolean searchForClassifications);
|
199
|
|
200
|
|
201
|
|
202
|
|
203
|
|
204
|
}
|