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