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.api.service;
|
11
|
|
12
|
import java.io.IOException;
|
13
|
import java.util.EnumSet;
|
14
|
import java.util.List;
|
15
|
import java.util.Map;
|
16
|
import java.util.Set;
|
17
|
import java.util.UUID;
|
18
|
|
19
|
import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;
|
20
|
import eu.etaxonomy.cdm.api.service.config.IncludedTaxonConfiguration;
|
21
|
import eu.etaxonomy.cdm.api.service.config.MatchingTaxonConfigurator;
|
22
|
import eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator;
|
23
|
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
|
24
|
import eu.etaxonomy.cdm.api.service.dto.IdentifiedEntityDTO;
|
25
|
import eu.etaxonomy.cdm.api.service.dto.IncludedTaxaDTO;
|
26
|
import eu.etaxonomy.cdm.api.service.dto.MarkedEntityDTO;
|
27
|
import eu.etaxonomy.cdm.api.service.dto.TaxonRelationshipsDTO;
|
28
|
import eu.etaxonomy.cdm.api.service.exception.DataChangeNoRollbackException;
|
29
|
import eu.etaxonomy.cdm.api.service.exception.HomotypicalGroupChangeException;
|
30
|
import eu.etaxonomy.cdm.api.service.pager.Pager;
|
31
|
import eu.etaxonomy.cdm.api.service.search.LuceneMultiSearchException;
|
32
|
import eu.etaxonomy.cdm.api.service.search.LuceneParseException;
|
33
|
import eu.etaxonomy.cdm.api.service.search.SearchResult;
|
34
|
import eu.etaxonomy.cdm.api.service.util.TaxonRelationshipEdge;
|
35
|
import eu.etaxonomy.cdm.exception.UnpublishedException;
|
36
|
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
|
37
|
import eu.etaxonomy.cdm.model.common.Language;
|
38
|
import eu.etaxonomy.cdm.model.common.MarkerType;
|
39
|
import eu.etaxonomy.cdm.model.common.RelationshipBase.Direction;
|
40
|
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
|
41
|
import eu.etaxonomy.cdm.model.description.Feature;
|
42
|
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
|
43
|
import eu.etaxonomy.cdm.model.location.NamedArea;
|
44
|
import eu.etaxonomy.cdm.model.media.Media;
|
45
|
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
|
46
|
import eu.etaxonomy.cdm.model.name.Rank;
|
47
|
import eu.etaxonomy.cdm.model.name.TaxonName;
|
48
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
49
|
import eu.etaxonomy.cdm.model.taxon.Classification;
|
50
|
import eu.etaxonomy.cdm.model.taxon.Synonym;
|
51
|
import eu.etaxonomy.cdm.model.taxon.SynonymType;
|
52
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
53
|
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
|
54
|
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
|
55
|
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
|
56
|
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
|
57
|
import eu.etaxonomy.cdm.model.term.DefinedTerm;
|
58
|
import eu.etaxonomy.cdm.persistence.dao.common.Restriction;
|
59
|
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
|
60
|
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
|
61
|
import eu.etaxonomy.cdm.persistence.query.MatchMode;
|
62
|
import eu.etaxonomy.cdm.persistence.query.OrderHint;
|
63
|
import eu.etaxonomy.cdm.persistence.query.TaxonTitleType;
|
64
|
|
65
|
|
66
|
public interface ITaxonService
|
67
|
extends IIdentifiableEntityService<TaxonBase>, IPublishableService<TaxonBase>{
|
68
|
|
69
|
/**
|
70
|
* {@inheritDoc}
|
71
|
* <BR><BR>
|
72
|
* NOTE: Also taxa with <code>publish=false</code> are returned.
|
73
|
*/
|
74
|
@Override
|
75
|
public TaxonBase load(UUID uuid, List<String> propertyPaths);
|
76
|
|
77
|
/**
|
78
|
* Returns a list of taxa that matches the name string and the sec reference
|
79
|
* @param name the name string to search for
|
80
|
* @param sec the taxons sec reference
|
81
|
* @return a list of taxa matching the name and the sec reference
|
82
|
*/
|
83
|
public List<TaxonBase> searchByName(String name, boolean includeUnpublished, Reference sec);
|
84
|
|
85
|
/**
|
86
|
* Swaps given synonym and accepted taxon.
|
87
|
* In particular:
|
88
|
* <ul>
|
89
|
* <li>A new accepted taxon with the synonyms name is created</li>
|
90
|
* <li>The synonym is deleted from the old accepted taxons synonym list</li>
|
91
|
* <li>A new synonym with the name of the old accepted taxon is created</li>
|
92
|
* <li>The newly created synonym get related to the newly created accepted taxon</li>
|
93
|
* </ul>
|
94
|
*
|
95
|
* @param synonym
|
96
|
* @param acceptedTaxon
|
97
|
* @param setNameInSource
|
98
|
* @return
|
99
|
*/
|
100
|
public UpdateResult swapSynonymAndAcceptedTaxon(Synonym synonym, Taxon acceptedTaxon, boolean setNameInSource);
|
101
|
|
102
|
/**
|
103
|
* Changes a synonym into an accepted taxon and removes
|
104
|
* the synonym relationship to the given accepted taxon.
|
105
|
* Other synonyms homotypic to the synonym to change are
|
106
|
* moved to the same new accepted taxon as homotypic
|
107
|
* synonyms. The new accepted taxon has the same name and
|
108
|
* the same sec reference as the old synonym.<BR>
|
109
|
* If the given accepted taxon and the synonym are homotypic
|
110
|
* to each other an exception may be thrown as taxonomically it doesn't
|
111
|
* make sense to have two accepted taxa in the same homotypic group
|
112
|
* but also it is than difficult to decide how to handle other names
|
113
|
* in the homotypic group. It is up to the implementing class to
|
114
|
* handle this situation via an exception or in another way.
|
115
|
*
|
116
|
*
|
117
|
* @param synonym
|
118
|
* the synonym to change into an accepted taxon
|
119
|
* @param acceptedTaxon
|
120
|
* an accepted taxon, the synonym had a relationship to
|
121
|
* @param deleteSynonym
|
122
|
* if true the method tries to delete the old synonym from the database
|
123
|
* @return
|
124
|
* the newly created accepted taxon
|
125
|
* @throws IllegalArgumentException
|
126
|
* if the given accepted taxon and the synonym are homotypic
|
127
|
* to each other an exception may be thrown as taxonomically it doesn't
|
128
|
* make sense to have two accepted taxa in the same homotypic group
|
129
|
* but also it is than difficult to decide how to handle other names
|
130
|
* in the homotypic group. It is up to the implementing class to
|
131
|
* handle this situation via an exception or in another way.
|
132
|
*/
|
133
|
public UpdateResult changeSynonymToAcceptedTaxon(Synonym synonym, Taxon acceptedTaxon, boolean deleteSynonym) throws HomotypicalGroupChangeException;
|
134
|
|
135
|
/**
|
136
|
* @param synonymUuid
|
137
|
* @param acceptedTaxonUuid
|
138
|
* @param newParentNodeUuid
|
139
|
* @param deleteSynonym
|
140
|
* @return
|
141
|
* @throws HomotypicalGroupChangeException
|
142
|
*/
|
143
|
public UpdateResult changeSynonymToAcceptedTaxon(UUID synonymUuid, UUID acceptedTaxonUuid, UUID newParentNodeUuid,
|
144
|
boolean deleteSynonym)
|
145
|
throws HomotypicalGroupChangeException;
|
146
|
|
147
|
/**
|
148
|
* Change a synonym into a related concept
|
149
|
*
|
150
|
* @param synonym
|
151
|
* the synonym to change into the concept taxon
|
152
|
* @param toTaxon
|
153
|
* the taxon the newly created concept should be related to
|
154
|
* @param taxonRelationshipType
|
155
|
* the type of relationship
|
156
|
* @param reference
|
157
|
* @param microReference
|
158
|
* @return
|
159
|
* update result with the newly created concept
|
160
|
*/
|
161
|
public UpdateResult changeSynonymToRelatedTaxon(Synonym synonym, Taxon toTaxon, TaxonRelationshipType taxonRelationshipType, Reference reference, String microReference);
|
162
|
|
163
|
/**
|
164
|
*
|
165
|
* Change a related concept into synonym
|
166
|
*
|
167
|
* @param synonym
|
168
|
* the concept taxon to change into a synonym
|
169
|
* @param toTaxon
|
170
|
* the taxon the newly created synonym should be related to
|
171
|
* @param oldRelationshipType
|
172
|
* the type of old concept relationship
|
173
|
* @param synonymRelationshipType
|
174
|
* the type of new synonym relationship
|
175
|
*
|
176
|
* @return
|
177
|
* update result with the newly created synonym
|
178
|
* @throws DataChangeNoRollbackException
|
179
|
*/
|
180
|
public UpdateResult changeRelatedTaxonToSynonym(Taxon fromTaxon, Taxon toTaxon,
|
181
|
TaxonRelationshipType oldRelationshipType,
|
182
|
SynonymType synonymType) throws DataChangeNoRollbackException;
|
183
|
|
184
|
/**
|
185
|
* Changes the homotypic group of a synonym into the new homotypic group.
|
186
|
* All relations to taxa are updated correctly depending on the homotypic
|
187
|
* group of the accepted taxon. <BR>
|
188
|
* All existing basionym relationships to and from this name are removed.<BR>
|
189
|
* If the parameter <code>targetTaxon</code> is defined, the synonym is
|
190
|
* added to this taxon irrespctive of if it has been related to this
|
191
|
* taxon before.<BR>
|
192
|
* If <code>setBasionymRelationIfApplicable</code> is true a basionym relationship
|
193
|
* between the existing basionym(s) of the new homotypic group and the synonyms name
|
194
|
* is added.<BR>
|
195
|
*
|
196
|
* @param synonym
|
197
|
* @param newHomotypicalGroup
|
198
|
* @param taxon
|
199
|
* @param setBasionymRelationIfApplicable
|
200
|
*/
|
201
|
public void changeHomotypicalGroupOfSynonym(Synonym synonym, HomotypicalGroup newHomotypicalGroup,
|
202
|
Taxon targetTaxon, boolean setBasionymRelationIfApplicable);
|
203
|
|
204
|
/**
|
205
|
* See {@link #moveSynonymToAnotherTaxon(Synonym, Taxon, boolean, SynonymType, Reference, String, boolean)}
|
206
|
* @param oldSynonym
|
207
|
* @param newTaxon
|
208
|
* @param moveHomotypicGroup
|
209
|
* @param newSynonymType
|
210
|
* @return
|
211
|
* @throws HomotypicalGroupChangeException
|
212
|
*/
|
213
|
public UpdateResult moveSynonymToAnotherTaxon(Synonym oldSynonym, Taxon newTaxon, boolean moveHomotypicGroup,
|
214
|
SynonymType newSynonymType) throws HomotypicalGroupChangeException;
|
215
|
|
216
|
|
217
|
/**
|
218
|
* Moves a synonym to another taxon and removes the old synonym relationship.
|
219
|
*
|
220
|
* @param oldSynonym the old synonym to move.
|
221
|
* @param newTaxon the taxon the synonym will be moved to
|
222
|
* @param moveHomotypicGroup if the synonym belongs to a homotypic group with other synonyms and
|
223
|
* <code>moveHomotypicGroup</code> is <code>true</code> all these synonyms are moved to the new taxon,
|
224
|
* if <code>false</code> a {@link HomotypicalGroupChangeException} is thrown.
|
225
|
* <code>moveHomotypicGroup</code> has no effect if the synonym is the only synonym in it's homotypic group.
|
226
|
* @param newSynonymType the synonym type of the new synonyms. Default is
|
227
|
* {@link SynonymType#HETEROTYPIC_SYNONYM_OF() heterotypic}.
|
228
|
* @param newSecundum The secundum for the new synonyms).
|
229
|
* @param newSecundumDetail The secundum micro reference for the new synonym(s).
|
230
|
* @param keepSecundumIfUndefined if no <code>newSecundum</code> and/or no <code>newSecundumDetail</code>
|
231
|
* is defined they are taken from the old synonym(s) if <code>keepSecundumIfUndefined</code> is
|
232
|
* <code>true</code>. If <code>false</code> the secundum and the secundum detail will be taken
|
233
|
* only from the <code>newSecundum</code> and <code>newSecundumDetail</code> even if they are
|
234
|
* undefined (<code>null</code>).
|
235
|
* @return The new synonym relationship. If <code>moveHomotypicGroup</code> is <code>true</code> additionally
|
236
|
* created new synonym relationships must be retrieved separately from the new taxon.
|
237
|
* @throws HomotypicalGroupChangeException Exception is thrown if (1) synonym is homotypic to the old accepted taxon or
|
238
|
* (2) synonym is in homotypic group with other synonyms and <code>moveHomotypicGroup</code> is false
|
239
|
*/
|
240
|
public UpdateResult moveSynonymToAnotherTaxon(Synonym oldSynonym, Taxon newTaxon, boolean moveHomotypicGroup,
|
241
|
SynonymType newSynonymType, Reference newSecundum,
|
242
|
String newSecundumDetail, boolean keepSecundumIfUndefined) throws HomotypicalGroupChangeException;
|
243
|
|
244
|
|
245
|
/**
|
246
|
* @param oldSynonym
|
247
|
* @param newTaxonUUID
|
248
|
* @param moveHomotypicGroup
|
249
|
* @param newSynonymType
|
250
|
* @param reference
|
251
|
* @param referenceDetail
|
252
|
* @param keepReference
|
253
|
* @return
|
254
|
* @throws HomotypicalGroupChangeException
|
255
|
*
|
256
|
* @see {@link #moveSynonymToAnotherTaxon(Synonym, Taxon, boolean, SynonymType, Reference, String, boolean)}
|
257
|
*/
|
258
|
public UpdateResult moveSynonymToAnotherTaxon(Synonym oldSynonym,
|
259
|
UUID newTaxonUUID, boolean moveHomotypicGroup,
|
260
|
SynonymType newSynonymType,
|
261
|
Reference newSecundum, String newSecundumDetail, boolean keepSecundumIfUndefined)
|
262
|
throws HomotypicalGroupChangeException;
|
263
|
|
264
|
/**
|
265
|
* Returns the TaxonRelationships (of where relationship.type == type, if this argument is supplied)
|
266
|
* where the supplied taxon is relatedTo.
|
267
|
*
|
268
|
* @param taxon The taxon that is relatedTo
|
269
|
* @param type The type of TaxonRelationship (can be null)
|
270
|
* @param includeUnpublished should unpublished related taxa also be returned?
|
271
|
* @param pageSize The maximum number of relationships returned (can be null for all relationships)
|
272
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
273
|
* @param orderHints Properties to order by
|
274
|
* @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
|
275
|
* @return a List of TaxonRelationship instances
|
276
|
*/
|
277
|
public List<TaxonRelationship> listToTaxonRelationships(Taxon taxon, TaxonRelationshipType type,
|
278
|
boolean includeUnpublished, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
279
|
|
280
|
|
281
|
/**
|
282
|
* Returns the TaxonRelationships (of where relationship.type == type, if this arguement is supplied)
|
283
|
* where the supplied taxon is relatedTo.
|
284
|
*
|
285
|
* @param taxon The taxon that is relatedTo
|
286
|
* @param type The type of TaxonRelationship (can be null)
|
287
|
* @param includeUnpublished should unpublished related taxa also be returned?
|
288
|
* @param pageSize The maximum number of relationships returned (can be null for all relationships)
|
289
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
290
|
* @param orderHints Properties to order by
|
291
|
* @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
|
292
|
* @return a Pager of TaxonRelationship instances
|
293
|
*/
|
294
|
public Pager<TaxonRelationship> pageToTaxonRelationships(Taxon taxon, TaxonRelationshipType type,
|
295
|
boolean includeUnpublished, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
296
|
|
297
|
/**
|
298
|
* Returns the TaxonRelationships (of where relationship.type == type, if this argument is supplied)
|
299
|
* where the supplied taxon is relatedFrom.
|
300
|
*
|
301
|
* @param taxon The taxon that is relatedFrom
|
302
|
* @param type The type of TaxonRelationship (can be null)
|
303
|
* @param includeUnpublished should unpublished related taxa also be returned?
|
304
|
* @param pageSize The maximum number of relationships returned (can be null for all relationships)
|
305
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
306
|
* @param orderHints Properties to order by
|
307
|
* @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
|
308
|
* @return a List of TaxonRelationship instances
|
309
|
*/
|
310
|
public List<TaxonRelationship> listFromTaxonRelationships(Taxon taxon, TaxonRelationshipType type,
|
311
|
boolean includeUnpublished, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
312
|
|
313
|
|
314
|
/**
|
315
|
* Returns the TaxonRelationships (of where relationship.type == type, if this argument is supplied)
|
316
|
* where the supplied taxon is relatedFrom.
|
317
|
*
|
318
|
* @param taxon The taxon that is relatedFrom
|
319
|
* @param type The type of TaxonRelationship (can be null)
|
320
|
* @param includeUnpublished should unpublished related taxa also be returned?
|
321
|
* @param pageSize The maximum number of relationships returned (can be null for all relationships)
|
322
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
323
|
* @param orderHints Properties to order by
|
324
|
* @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
|
325
|
* @return a Pager of TaxonRelationship instances
|
326
|
*/
|
327
|
public Pager<TaxonRelationship> pageFromTaxonRelationships(Taxon taxon, TaxonRelationshipType type,
|
328
|
boolean includeUnpublished, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
329
|
|
330
|
/**
|
331
|
* lists all taxa which are related to the <code>taxon</code> given as
|
332
|
* parameter.
|
333
|
*
|
334
|
* @param taxon
|
335
|
* @param includeRelationships
|
336
|
* @param maxDepth
|
337
|
* <code>1</code> for one level, <code>null</code> for infinite
|
338
|
* depth, <code>0</code> will completely omit collecting related taxa.
|
339
|
* @param limit
|
340
|
* @param start
|
341
|
* @param propertyPaths
|
342
|
* @return
|
343
|
*/
|
344
|
public Set<Taxon> listRelatedTaxa(Taxon taxon, Set<TaxonRelationshipEdge> includeRelationships, Integer maxDepth,
|
345
|
boolean includeUnpublished, Integer limit, Integer start, List<String> propertyPaths);
|
346
|
|
347
|
|
348
|
/**
|
349
|
* Returns all or a page of all taxon concept relationships in the database.
|
350
|
* The result can be filtered by relationship types.
|
351
|
*
|
352
|
* @param types The taxon relationship type filter, if <code>null</code> no filter is set, if empty the result will also be empty
|
353
|
* @param pageSize the page size
|
354
|
* @param pageStart the number of the page
|
355
|
* @param orderHints the order hints
|
356
|
* @param propertyPaths the property path to initialize the resulting objects
|
357
|
* @return list of taxon relationships matching the filter criteria
|
358
|
*/
|
359
|
public List<TaxonRelationship> listTaxonRelationships(Set<TaxonRelationshipType> types,
|
360
|
Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
361
|
|
362
|
/**
|
363
|
* Lists all classifications the given taxon/synonym is used in{@link Synonym}
|
364
|
*
|
365
|
* @param taxonBase
|
366
|
* @param limit
|
367
|
* @param start
|
368
|
* @param propertyPaths
|
369
|
* @return
|
370
|
*/
|
371
|
public List<Classification> listClassifications(TaxonBase taxonBase, Integer limit, Integer start, List<String> propertyPaths);
|
372
|
|
373
|
/**
|
374
|
* Returns the Synonyms (with the given synonym relationship type, if this argument is supplied)
|
375
|
* that do have the supplied taxon as accepted taxon.
|
376
|
*
|
377
|
* @param taxon The accepted taxon
|
378
|
* @param type The type of Synonym (can be null)
|
379
|
* @param pageSize The maximum number of synonyms returned (can be null for returning synonyms)
|
380
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
381
|
* * @param orderHints Properties to order by
|
382
|
* @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
|
383
|
* @return a Pager of {@link Synonym} instances
|
384
|
*/
|
385
|
public Pager<Synonym> getSynonyms(Taxon taxon, SynonymType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
386
|
|
387
|
/**
|
388
|
* This method returns in the first entry the list of synonyms of the
|
389
|
* homotypic group of the accepted taxon. All other entries represent the lists of heterotypic
|
390
|
* synonym groups. For detailed information about these 2 groups see
|
391
|
* {@link #getHomotypicSynonymsByHomotypicGroup(Taxon, List)} and
|
392
|
* {@link #getHeterotypicSynonymyGroups(Taxon, List)}
|
393
|
*
|
394
|
* @see #getSynonyms()
|
395
|
* @see SynonymType#HETEROTYPIC_SYNONYM_OF()
|
396
|
* @see eu.etaxonomy.cdm.model.name.HomotypicalGroup
|
397
|
|
398
|
* @param taxon the accepted taxon
|
399
|
* @param propertyPaths the property path
|
400
|
* @return the list of groups of synonyms
|
401
|
*/
|
402
|
public List<List<Synonym>> getSynonymsByHomotypicGroup(Taxon taxon, List<String> propertyPaths);
|
403
|
|
404
|
|
405
|
/**
|
406
|
* Returns the list of all synonyms that share the same homotypical group with the given taxon.
|
407
|
* Only those homotypic synonyms are returned that do have a synonym relationship with the accepted taxon.
|
408
|
* @param taxon
|
409
|
* @param propertyPaths
|
410
|
* @return
|
411
|
*/
|
412
|
public List<Synonym> getHomotypicSynonymsByHomotypicGroup(Taxon taxon, List<String> propertyPaths);
|
413
|
|
414
|
/**
|
415
|
* Returns the ordered list of all {@link eu.etaxonomy.cdm.model.name.HomotypicalGroup homotypical groups}
|
416
|
* that contain {@link Synonym synonyms} that are heterotypic to the given taxon.
|
417
|
* {@link eu.etaxonomy.cdm.model.name.TaxonName Taxon names} of heterotypic synonyms
|
418
|
* belong to a homotypical group which cannot be the homotypical group to which the
|
419
|
* taxon name of the given taxon belongs. This method does not return the homotypic group the given
|
420
|
* taxon belongs to.<BR>
|
421
|
* This method does neglect the type of synonym relationship that is defined between the given taxon
|
422
|
* and the synonym. So the synonym relationship may be homotypic however a synonym is returned
|
423
|
* in one of the result lists as long as the synonym does not belong to the same homotypic group as
|
424
|
* the given taxon.<BR>
|
425
|
* The list returned is ordered according to the date of publication of the
|
426
|
* first published name within each homotypical group.
|
427
|
*
|
428
|
* @see #getHeterotypicSynonymyGroups()
|
429
|
* @see #getSynonyms()
|
430
|
* @see SynonymType#HETEROTYPIC_SYNONYM_OF()
|
431
|
* @see eu.etaxonomy.cdm.model.name.HomotypicalGroup
|
432
|
|
433
|
* @param taxon
|
434
|
* @param propertyPaths
|
435
|
* @return
|
436
|
*/
|
437
|
public List<List<Synonym>> getHeterotypicSynonymyGroups(Taxon taxon, List<String> propertyPaths);
|
438
|
|
439
|
/**
|
440
|
* Returns a Paged List of TaxonBase instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
|
441
|
*
|
442
|
* @param clazz filter the results by class (or pass null to return all TaxonBase instances)
|
443
|
* @param queryString
|
444
|
* @param pageSize The maximum number of taxa returned (can be null for all matching taxa)
|
445
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
446
|
* @param orderHints
|
447
|
* Supports path like <code>orderHints.propertyNames</code> which
|
448
|
* include *-to-one properties like createdBy.username or
|
449
|
* authorTeam.persistentTitleCache
|
450
|
* @param propertyPaths properties to be initialized
|
451
|
* @return a Pager Taxon instances
|
452
|
* @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>
|
453
|
*/
|
454
|
@Override
|
455
|
public Pager<TaxonBase> search(Class<? extends TaxonBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
456
|
|
457
|
/**
|
458
|
* Returns a list of TaxonBase instances where the
|
459
|
* taxon.name properties match the parameters passed. In order to search for any string value, pass '*', passing the string value of
|
460
|
* <i>null</i> will search for those taxa with a value of null in that field
|
461
|
*
|
462
|
* @param clazz optionally filter by class (can be null to return all taxa)
|
463
|
* @param uninomial
|
464
|
* @param infragenericEpithet
|
465
|
* @param specificEpithet
|
466
|
* @param infraspecificEpithet
|
467
|
* @param rank
|
468
|
* @param pageSize The maximum number of taxa returned (can be null for all matching taxa)
|
469
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
470
|
* @return a list of TaxonBase instances
|
471
|
*/
|
472
|
public <T extends TaxonBase> Pager<T> findTaxaByName(Class<T> clazz, String uninomial, String infragenericEpithet, String specificEpithet,
|
473
|
String infraspecificEpithet, String authorshipCache, Rank rank, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
474
|
|
475
|
/**
|
476
|
* Returns a list of TaxonBase instances where the
|
477
|
* taxon.name properties match the parameters passed. In order to search for any string value, pass '*', passing the string value of
|
478
|
* <i>null</i> will search for those taxa with a value of null in that field
|
479
|
*
|
480
|
* @param clazz optionally filter by class
|
481
|
* @param uninomial
|
482
|
* @param infragenericEpithet
|
483
|
* @param specificEpithet
|
484
|
* @param infraspecificEpithet
|
485
|
* @param rank
|
486
|
* @param authorshipCache
|
487
|
* @param pageSize The maximum number of taxa returned (can be null for all matching taxa)
|
488
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
489
|
* @return a List of TaxonBase instances
|
490
|
*/
|
491
|
public <T extends TaxonBase> List<T> listTaxaByName(Class<T> clazz, String uninomial, String infragenericEpithet, String specificEpithet,
|
492
|
String infraspecificEpithet, String authorshipCache, Rank rank, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
493
|
|
494
|
/**
|
495
|
* Returns a list of IdentifiableEntity instances (in particular, TaxonName and TaxonBase instances)
|
496
|
* that match the properties specified in the configurator.
|
497
|
* @param configurator
|
498
|
* @return
|
499
|
*/
|
500
|
public Pager<IdentifiableEntity> findTaxaAndNames(IFindTaxaAndNamesConfigurator configurator);
|
501
|
|
502
|
/**
|
503
|
* performes a union searches for TaxonBase instances on all available
|
504
|
* free text indexes. At the time of writing this documentation it combines
|
505
|
* {@link #findByDescriptionElementFullText(Class, String, Classification, List, List, boolean, Integer, Integer, List, List)}
|
506
|
* and {@link #findByFullText(Class, String, Classification, List, boolean, Integer, Integer, List, List)
|
507
|
*
|
508
|
* @param queryString
|
509
|
* the query string
|
510
|
* @param classification
|
511
|
* Additional filter criterion: If a taxonomic classification
|
512
|
* three is specified here the result set will only contain taxa
|
513
|
* of the given classification
|
514
|
* @param languages
|
515
|
* Additional filter criterion: Search only in these languages.
|
516
|
* Not all text fields in the cdm model are multilingual, thus
|
517
|
* this setting will only apply to the multilingiual fields.
|
518
|
* Other fields are searched nevertheless if this parameter is
|
519
|
* set or not.
|
520
|
* @param highlightFragments
|
521
|
* TODO
|
522
|
* @param pageSize
|
523
|
* The maximum number of objects returned (can be null for all
|
524
|
* objects)
|
525
|
* @param pageNumber
|
526
|
* The offset (in pageSize chunks) from the start of the result
|
527
|
* set (0 - based)
|
528
|
* @param orderHints
|
529
|
* Supports path like <code>orderHints.propertyNames</code> which
|
530
|
* include *-to-one properties like createdBy.username or
|
531
|
* authorTeam.persistentTitleCache
|
532
|
* @param propertyPaths
|
533
|
* properties to initialize - see
|
534
|
* {@link IBeanInitializer#initialize(Object, List)}
|
535
|
* @return a paged list of instances of type T matching the queryString and
|
536
|
* the additional filter criteria
|
537
|
* @return
|
538
|
* @throws LuceneCorruptIndexException
|
539
|
* @throws IOException
|
540
|
* @throws LuceneParseException
|
541
|
* @throws LuceneMultiSearchException
|
542
|
* @deprecated this search should fully be covered by the new method
|
543
|
* {@link #findTaxaAndNamesByFullText(EnumSet, String, Classification, Set, List, boolean, Integer, Integer, List, List)}
|
544
|
* , maybe we should rename this latter method to give it a more meaningful name
|
545
|
*/
|
546
|
@Deprecated
|
547
|
public Pager<SearchResult<TaxonBase>> findByEverythingFullText(String queryString,
|
548
|
Classification classification, TaxonNode subtree, boolean includeUnpublished, List<Language> languages, boolean highlightFragments,
|
549
|
Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws IOException, LuceneParseException, LuceneMultiSearchException;
|
550
|
|
551
|
/**
|
552
|
* Searches for TaxonBase instances using the TaxonBase free text index.
|
553
|
*
|
554
|
* <h4>This is an experimental feature, it may be moved, modified, or even
|
555
|
* removed in future releases!!!</h4>
|
556
|
*
|
557
|
* @param clazz
|
558
|
* Additional filter criterion: The specific TaxonBase subclass
|
559
|
* to search for
|
560
|
* @param queryString
|
561
|
* the query string
|
562
|
* @param classification
|
563
|
* Additional filter criterion: If a taxonomic classification
|
564
|
* three is specified here the result set will only contain taxa
|
565
|
* of the given classification
|
566
|
* @param languages
|
567
|
* Additional filter criterion: Search only in these languages.
|
568
|
* Not all text fields in the cdm model are multilingual, thus
|
569
|
* this setting will only apply to the multilingiual fields.
|
570
|
* Other fields are searched nevertheless if this parameter is
|
571
|
* set or not.
|
572
|
* @param highlightFragments
|
573
|
* TODO
|
574
|
* @param pageSize
|
575
|
* The maximum number of objects returned (can be null for all
|
576
|
* objects)
|
577
|
* @param pageNumber
|
578
|
* The offset (in pageSize chunks) from the start of the result
|
579
|
* set (0 - based)
|
580
|
* @param orderHints
|
581
|
* Supports path like <code>orderHints.propertyNames</code> which
|
582
|
* include *-to-one properties like createdBy.username or
|
583
|
* authorTeam.persistentTitleCache
|
584
|
* @param propertyPaths
|
585
|
* properties to initialize - see
|
586
|
* {@link IBeanInitializer#initialize(Object, List)}
|
587
|
* @return a paged list of instances of type T matching the queryString and
|
588
|
* the additional filter criteria
|
589
|
* @throws LuceneCorruptIndexException
|
590
|
* @throws IOException
|
591
|
* @throws LuceneParseException
|
592
|
*/
|
593
|
public Pager<SearchResult<TaxonBase>> findByFullText(Class<? extends TaxonBase> clazz, String queryString,
|
594
|
Classification classification, TaxonNode subtree,
|
595
|
boolean includeUnpublished, List<Language> languages,
|
596
|
boolean highlightFragments, Integer pageSize, Integer pageNumber,
|
597
|
List<OrderHint> orderHints, List<String> propertyPaths)
|
598
|
throws IOException, LuceneParseException;
|
599
|
|
600
|
|
601
|
/**
|
602
|
* @param areaFilter
|
603
|
* @param statusFilter
|
604
|
* @param classification
|
605
|
* Additional filter criterion: If a taxonomic classification
|
606
|
* three is specified here the result set will only contain taxa
|
607
|
* of the given classification
|
608
|
* @param highlightFragments
|
609
|
* @param pageSize
|
610
|
* The maximum number of objects returned (can be null for all
|
611
|
* objects)
|
612
|
* @param pageNumber
|
613
|
* The offset (in pageSize chunks) from the start of the result
|
614
|
* set (0 - based)
|
615
|
* @param orderHints
|
616
|
* Supports path like <code>orderHints.propertyNames</code> which
|
617
|
* include *-to-one properties like createdBy.username or
|
618
|
* authorTeam.persistentTitleCache
|
619
|
* @param propertyPath
|
620
|
* Common properties to initialize the instances of the
|
621
|
* CDM types ({@link Taxon} and {@link Synonym}
|
622
|
* this method can return - see {@link IBeanInitializer#initialize(Object, List)}
|
623
|
* @return a paged list of instances of {@link Taxon} instances
|
624
|
* @throws IOException
|
625
|
* @throws LuceneParseException
|
626
|
*/
|
627
|
//TODO needed? currently only used in test
|
628
|
public Pager<SearchResult<TaxonBase>> findByDistribution(List<NamedArea> areaFilter, List<PresenceAbsenceTerm> statusFilter,
|
629
|
Classification classification, TaxonNode subtree,
|
630
|
Integer pageSize, Integer pageNumber,
|
631
|
List<OrderHint> orderHints, List<String> propertyPaths) throws IOException, LuceneParseException;
|
632
|
|
633
|
/**
|
634
|
* Searches for TaxonBase instances using the TaxonBase free text index.
|
635
|
*
|
636
|
*
|
637
|
*
|
638
|
* <h4>This is an experimental feature, it may be moved, modified, or even
|
639
|
* removed in future releases!!!</h4>
|
640
|
* @param searchModes
|
641
|
* Additional filter criterion: defaults to [doTaxa] if set null
|
642
|
* @param queryString
|
643
|
* the query string
|
644
|
* @param classification
|
645
|
* Additional filter criterion: If a taxonomic classification
|
646
|
* three is specified here the result set will only contain taxa
|
647
|
* of the given classification
|
648
|
* @param subtree
|
649
|
* @param namedAreas
|
650
|
* @param distributionStatus
|
651
|
* @param languages
|
652
|
* Additional filter criterion: Search only in these languages.
|
653
|
* Not all text fields in the cdm model are multilingual, thus
|
654
|
* this setting will only apply to the multilingiual fields.
|
655
|
* Other fields are searched nevertheless if this parameter is
|
656
|
* set or not.
|
657
|
* @param highlightFragments
|
658
|
* TODO
|
659
|
* @param pageSize
|
660
|
* The maximum number of objects returned (can be null for all
|
661
|
* objects)
|
662
|
* @param pageNumber
|
663
|
* The offset (in pageSize chunks) from the start of the result
|
664
|
* set (0 - based)
|
665
|
* @param orderHints
|
666
|
* Supports path like <code>orderHints.propertyNames</code> which
|
667
|
* include *-to-one properties like createdBy.username or
|
668
|
* authorTeam.persistentTitleCache
|
669
|
* @param propertyPath
|
670
|
* Common properties to initialize the instances of the
|
671
|
* CDM types ({@link Taxon} and {@link Synonym}
|
672
|
* this method can return - see {@link IBeanInitializer#initialize(Object, List)}
|
673
|
* @return a paged list of instances of {@link Taxon}, {@link Synonym}, matching the queryString and
|
674
|
* the additional filter criteria
|
675
|
* @throws LuceneCorruptIndexException
|
676
|
* @throws IOException
|
677
|
* @throws LuceneParseException
|
678
|
* @throws LuceneMultiSearchException
|
679
|
*/
|
680
|
public Pager<SearchResult<TaxonBase>> findTaxaAndNamesByFullText(
|
681
|
EnumSet<TaxaAndNamesSearchMode> searchModes,
|
682
|
String queryString, Classification classification, TaxonNode subtree,
|
683
|
Set<NamedArea> namedAreas, Set<PresenceAbsenceTerm> distributionStatus,
|
684
|
List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints,
|
685
|
List<String> propertyPaths) throws IOException, LuceneParseException, LuceneMultiSearchException;
|
686
|
|
687
|
/**
|
688
|
* Searches for TaxonBase instances by using the DescriptionElement free text index.
|
689
|
*
|
690
|
* <h4>This is an experimental feature, it may be moved, modified, or even
|
691
|
* removed in future releases!!!</h4>
|
692
|
*
|
693
|
* @param clazz
|
694
|
* Additional filter criterion:
|
695
|
* @param queryString
|
696
|
* the query string to filter by
|
697
|
* @param classification
|
698
|
* Additional filter criterion: If a taxonomic classification
|
699
|
* tree is specified here the result set will only contain taxa
|
700
|
* of the given classification
|
701
|
* @param subtree
|
702
|
* Additional filter criterion: If a taxonomic classification
|
703
|
* subtree is specified here the result set will only contain taxa
|
704
|
* of the given subtree
|
705
|
* @param features
|
706
|
* TODO
|
707
|
* @param languages
|
708
|
* Additional filter criterion: Search only in these languages.
|
709
|
* Not all text fields in the CDM model are multi-lingual, thus
|
710
|
* this setting will only apply to the multi-lingual fields.
|
711
|
* Other fields are searched nevertheless if this parameter is
|
712
|
* set or not.
|
713
|
* @param highlightFragments
|
714
|
* TODO
|
715
|
* @param pageSize
|
716
|
* The maximum number of objects returned (can be null for all
|
717
|
* objects)
|
718
|
* @param pageNumber
|
719
|
* The offset (in pageSize chunks) from the start of the result
|
720
|
* set (0 - based)
|
721
|
* @param orderHints
|
722
|
* Supports path like <code>orderHints.propertyNames</code> which
|
723
|
* include *-to-one properties like createdBy.username or
|
724
|
* authorTeam.persistentTitleCache
|
725
|
* @param propertyPaths
|
726
|
* properties to initialize - see
|
727
|
* {@link IBeanInitializer#initialize(Object, List)}
|
728
|
* @return a paged list of instances of type T matching the queryString and
|
729
|
* the additional filter criteria
|
730
|
* @throws IOException
|
731
|
* @throws LuceneCorruptIndexException
|
732
|
* @throws LuceneParseException
|
733
|
*/
|
734
|
public Pager<SearchResult<TaxonBase>> findByDescriptionElementFullText(Class<? extends DescriptionElementBase> clazz,
|
735
|
String queryString, Classification classification, TaxonNode subtree, List<Feature> features, List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws IOException, LuceneParseException;
|
736
|
|
737
|
/**
|
738
|
* Lists all Media found in an any TaxonDescription associated with this
|
739
|
* taxon.
|
740
|
*
|
741
|
* @param taxon
|
742
|
* @param includeRelationships
|
743
|
* the given list of TaxonRelationshipEdges will be taken into
|
744
|
* account when retrieving media associated with the given taxon.
|
745
|
* Can be NULL.
|
746
|
* @param limitToGalleries
|
747
|
* whether to take only TaxonDescription into account which are
|
748
|
* marked as gallery
|
749
|
* @return
|
750
|
* @deprecated use {@link #listMedia(Taxon, Set, boolean, boolean, List)} instead
|
751
|
*/
|
752
|
@Deprecated
|
753
|
public List<Media> listTaxonDescriptionMedia(Taxon taxon, Set<TaxonRelationshipEdge> includeRelationships, boolean limitToGalleries, List<String> propertyPath);
|
754
|
|
755
|
/**
|
756
|
* Lists all Media found in an any TaxonDescription, NameDescription,
|
757
|
* SpecimenOrObservationBase, DnaSample Chromatograms, etc. associated with this taxon.
|
758
|
*
|
759
|
* @param taxon
|
760
|
* @param includeRelationships
|
761
|
* the given list of TaxonRelationshipEdges will be taken into
|
762
|
* account when retrieving media associated with the given taxon.
|
763
|
* Can be NULL.
|
764
|
* @param limitToGalleries
|
765
|
* whether to take only descriptions into account which are
|
766
|
* marked as gallery, can be NULL
|
767
|
* @param includeTaxonDescriptions
|
768
|
* whether to take TaxonDescriptions into account, can be NULL
|
769
|
* @param includeOccurrences
|
770
|
* whether to take TaxonDescriptions into account, can be NULL
|
771
|
* @param includeTaxonNameDescriptions
|
772
|
* whether to take TaxonNameDescriptions into account, can be NULL
|
773
|
* @param propertyPath
|
774
|
* @return
|
775
|
*/
|
776
|
public List<Media> listMedia(Taxon taxon, Set<TaxonRelationshipEdge> includeRelationships,
|
777
|
Boolean limitToGalleries, Boolean includeTaxonDescriptions, Boolean includeOccurrences,
|
778
|
Boolean includeTaxonNameDescriptions, List<String> propertyPath);
|
779
|
|
780
|
public List<TaxonBase> findTaxaByID(Set<Integer> listOfIDs);
|
781
|
|
782
|
/**
|
783
|
* Returns the TaxonBase with the given UUID
|
784
|
* using the given match mode and initialization strategy
|
785
|
*
|
786
|
* @param uuid
|
787
|
* @param propertyPaths
|
788
|
* @return
|
789
|
*/
|
790
|
public TaxonBase findTaxonByUuid(UUID uuid, List<String> propertyPaths);
|
791
|
|
792
|
/**
|
793
|
* Counts the number of synonyms
|
794
|
* @param onlyAttachedToTaxon if <code>true</code> only those synonyms being attached to
|
795
|
* an accepted taxon are counted
|
796
|
* @return the number of synonyms
|
797
|
*/
|
798
|
public long countSynonyms(boolean onlyAttachedToTaxon);
|
799
|
|
800
|
/**
|
801
|
* Returns a map of taxon names that have identical name caches but derive from different sources.
|
802
|
* The sources are defined via the sources reference uuid.
|
803
|
*
|
804
|
* @return map of nameCaches and taxon name maps where the key is the UUID of the according sourceRefUuid
|
805
|
*/
|
806
|
public Map<String, Map<UUID,Set<TaxonName>>> findIdenticalTaxonNames(List<UUID> sourceRefUuids, List<String> propertyPaths);
|
807
|
|
808
|
/**
|
809
|
* Returns all {@link Taxon taxa} which are {@link TaxonRelationshipType#CONGRUENT_TO() congruent} or
|
810
|
* {@link TaxonRelationshipType#INCLUDES() included} in the taxon represented by the given taxon uuid.
|
811
|
* The result also returns the path to these taxa represented by the uuids of
|
812
|
* the {@link TaxonRelationshipType taxon relationships types} and doubtful information.
|
813
|
* If classificationUuids is set only taxa of classifications are returned which are included
|
814
|
* in the given {@link Classification classifications}. ALso the path to these taxa may not include
|
815
|
* taxa from other classifications.
|
816
|
* @param taxonUuid uuid of the original taxon
|
817
|
* @param classificationUuids List of uuids of classifications used as a filter
|
818
|
* @param includeDoubtful set to <code>true</code> if also doubtfully included taxa should be included in the result
|
819
|
* @return a DTO which includes a list of taxa with the pathes from the original taxon to the given taxon as well
|
820
|
* as doubtful and date information. The original taxon is included in the result.
|
821
|
*/
|
822
|
public IncludedTaxaDTO listIncludedTaxa(UUID taxonUuid, IncludedTaxonConfiguration configuration);
|
823
|
|
824
|
|
825
|
/**
|
826
|
* Removes a synonym.<BR><BR>
|
827
|
*
|
828
|
* In detail it removes
|
829
|
* <li>the synonym concept</li>
|
830
|
* <BR><BR>
|
831
|
* If <code>removeNameIfPossible</code> is true
|
832
|
* it also removes the synonym name if it is not used in any other context
|
833
|
* (part of a concept, in DescriptionElementSource, part of a name relationship, used inline, ...)<BR><BR>
|
834
|
* If <code>newHomotypicGroupIfNeeded</code> is <code>true</code> and the synonym name
|
835
|
* is not deleted and the name is homotypic to the taxon
|
836
|
* the name is moved to a new homotypic group.<BR><BR>
|
837
|
*
|
838
|
* If synonym is <code>null</code> the method has no effect.
|
839
|
*
|
840
|
* @param taxon
|
841
|
* @param synonym
|
842
|
* @param removeNameIfPossible
|
843
|
* @return deleteResult
|
844
|
*
|
845
|
*/
|
846
|
public DeleteResult deleteSynonym(Synonym synonym, SynonymDeletionConfigurator config);
|
847
|
|
848
|
/**
|
849
|
* Removes a synonym.
|
850
|
*
|
851
|
* The method essentially loads the synonym and calls the
|
852
|
* {@link #deleteSynonym(Synonym, SynonymDeletionConfigurator) deleteSynonym} method
|
853
|
*
|
854
|
* @param synonymUuid
|
855
|
* @param config
|
856
|
* @return
|
857
|
*/
|
858
|
public DeleteResult deleteSynonym(UUID synonymUuid, SynonymDeletionConfigurator config);
|
859
|
|
860
|
/**
|
861
|
* @param tnb
|
862
|
* @return
|
863
|
*/
|
864
|
public Taxon findBestMatchingTaxon(String taxonName);
|
865
|
|
866
|
public Taxon findBestMatchingTaxon(MatchingTaxonConfigurator config);
|
867
|
|
868
|
public Synonym findBestMatchingSynonym(String taxonName, boolean includeUnpublished);
|
869
|
|
870
|
public List<UuidAndTitleCache<? extends IdentifiableEntity>> findTaxaAndNamesForEditor(IFindTaxaAndNamesConfigurator configurator);
|
871
|
|
872
|
/**
|
873
|
* Creates the specified inferred synonyms for the taxon in the classification, but do not insert it to the database
|
874
|
* @param taxon
|
875
|
* @param tree
|
876
|
* @return list of inferred synonyms
|
877
|
*/
|
878
|
public List<Synonym> createInferredSynonyms(Taxon taxon, Classification tree, SynonymType type, boolean doWithMisappliedNames);
|
879
|
|
880
|
/**
|
881
|
* Creates all inferred synonyms for the taxon in the classification, but do not insert it to the database
|
882
|
* @param taxon
|
883
|
* @param tree
|
884
|
* @param iDatabase
|
885
|
* @return list of inferred synonyms
|
886
|
*/
|
887
|
public List<Synonym> createAllInferredSynonyms(Taxon taxon, Classification tree, boolean doWithMisappliedNames);
|
888
|
|
889
|
public Taxon findAcceptedTaxonFor(UUID synonymUuid, UUID classificationUuid, boolean includeUnpublished,
|
890
|
List<String> propertyPaths) throws UnpublishedException;
|
891
|
|
892
|
public List<TaxonBase> findTaxaByName(MatchingTaxonConfigurator config);
|
893
|
|
894
|
|
895
|
/**
|
896
|
* @param clazz the optional {@link TaxonBase} subclass
|
897
|
* @param identifier the identifier string
|
898
|
* @param identifierType the identifier type
|
899
|
* @param subtreeFilter filter on a classification subtree (TaxonNode)
|
900
|
* @param matchmode the match mode for the identifier string
|
901
|
* @param includeEntity should the taxon as an object be included in the result
|
902
|
* @param pageSize page size
|
903
|
* @param pageNumber page number
|
904
|
* @param propertyPaths property path for initializing the returned taxon object (requires includeEntity=true)
|
905
|
* @return the resulting {@link IdentifiedEntityDTO} pager
|
906
|
* @see IIdentifiableEntityService#findByIdentifier(Class, String, DefinedTerm, MatchMode, boolean, Integer, Integer, List)
|
907
|
*/
|
908
|
public <S extends TaxonBase> Pager<IdentifiedEntityDTO<S>> findByIdentifier(
|
909
|
Class<S> clazz, String identifier, DefinedTerm identifierType, TaxonNode subtreeFilter,
|
910
|
MatchMode matchmode, boolean includeEntity, Integer pageSize,
|
911
|
Integer pageNumber, List<String> propertyPaths);
|
912
|
|
913
|
/**
|
914
|
* Returns a pager for {@link MarkedEntityDTO DTOs} that hold the marker including type, title and uuid
|
915
|
* and the according {@link TaxonBase} information (uuid, title and the taxon object itself (optional)).
|
916
|
*
|
917
|
* @param clazz The optional {@link TaxonBase} subclass
|
918
|
* @param markerType the obligatory marker type, if not given, the results will always be empty
|
919
|
* @param markerValue the optional
|
920
|
* @param subtreeFilter filter on a classification subtree (TaxonNode)
|
921
|
* @param includeEntity should the taxon as an object be included in the result
|
922
|
* @param titleType which label to give the returned entity, taxon.titleCache, name.titleCache or name.nameCache
|
923
|
* @param pageSize page size
|
924
|
* @param pageNumber page number
|
925
|
* @param propertyPaths property path for initializing the returned taxon object (requires includeEntity=true)
|
926
|
* @return the resulting {@link MarkedEntityDTO} pager
|
927
|
* @see IIdentifiableEntityService#findByMarker(Class, MarkerType, Boolean, boolean, Integer, Integer, List)
|
928
|
*/
|
929
|
public <S extends TaxonBase> Pager<MarkedEntityDTO<S>> findByMarker(
|
930
|
Class<S> clazz, MarkerType markerType, Boolean markerValue,
|
931
|
TaxonNode subtreeFilter, boolean includeEntity, TaxonTitleType titleType,
|
932
|
Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
933
|
|
934
|
/**
|
935
|
* @param synonymUUid
|
936
|
* @param acceptedTaxonUuid
|
937
|
* @param setNameInSource
|
938
|
* @return
|
939
|
*/
|
940
|
public UpdateResult swapSynonymAndAcceptedTaxon(UUID synonymUUid, UUID acceptedTaxonUuid, boolean setNameInSource);
|
941
|
|
942
|
/**
|
943
|
* @param taxonUuid
|
944
|
* @param config
|
945
|
* @param classificationUuid
|
946
|
* @return
|
947
|
*/
|
948
|
public DeleteResult deleteTaxon(UUID taxonUuid, TaxonDeletionConfigurator config, UUID classificationUuid);
|
949
|
|
950
|
|
951
|
public UpdateResult moveFactualDateToAnotherTaxon(UUID fromTaxonUuid,
|
952
|
UUID toTaxonUuid);
|
953
|
|
954
|
|
955
|
/**
|
956
|
* @param synonymUuid
|
957
|
* @param toTaxonUuid
|
958
|
* @param taxonRelationshipType
|
959
|
* @param citation
|
960
|
* @param microcitation
|
961
|
* @return
|
962
|
*/
|
963
|
public UpdateResult changeSynonymToRelatedTaxon(UUID synonymUuid, UUID toTaxonUuid, TaxonRelationshipType taxonRelationshipType,
|
964
|
Reference citation, String microcitation);
|
965
|
|
966
|
/**
|
967
|
* @param fromTaxonUuid
|
968
|
* @param toTaxonUuid
|
969
|
* @param oldRelationshipType
|
970
|
* @param synonymType
|
971
|
* @return
|
972
|
* @throws DataChangeNoRollbackException
|
973
|
*/
|
974
|
public UpdateResult changeRelatedTaxonToSynonym(UUID fromTaxonUuid, UUID toTaxonUuid,
|
975
|
TaxonRelationshipType oldRelationshipType, SynonymType synonymType) throws DataChangeNoRollbackException;
|
976
|
|
977
|
/**
|
978
|
* Returns a list of taxon relationships for a given taxon as DTO.
|
979
|
* @param taxonUuid
|
980
|
* @param directTypes
|
981
|
* @param inversTypes
|
982
|
* @param direction
|
983
|
* @param groupMisapplications
|
984
|
* @param includeUnpublished
|
985
|
* @param pageSize
|
986
|
* @param pageNumber
|
987
|
* @return
|
988
|
*/
|
989
|
public TaxonRelationshipsDTO listTaxonRelationships(UUID taxonUuid,
|
990
|
Set<TaxonRelationshipType> directTypes,
|
991
|
Set<TaxonRelationshipType> inversTypes, Direction direction, boolean groupMisapplications,
|
992
|
boolean includeUnpublished, Integer pageSize, Integer pageNumber);
|
993
|
|
994
|
/**
|
995
|
* @param clazz
|
996
|
* @param restrictions
|
997
|
* @param pageSize
|
998
|
* @param pageIndex
|
999
|
* @param orderHints
|
1000
|
* @param propertyPaths
|
1001
|
* @param includeUnpublished
|
1002
|
* @return
|
1003
|
*/
|
1004
|
public <S extends TaxonBase> Pager<S> page(Class<S> clazz, List<Restriction<?>> restrictions, Integer pageSize, Integer pageIndex,
|
1005
|
List<OrderHint> orderHints, List<String> propertyPaths, boolean includeUnpublished);
|
1006
|
|
1007
|
|
1008
|
|
1009
|
|
1010
|
}
|