ref #1445: improve search for identical names
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / INameService.java
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.Collection;
14 import java.util.HashMap;
15 import java.util.List;
16 import java.util.Map;
17 import java.util.Optional;
18 import java.util.Set;
19 import java.util.UUID;
20
21 import org.hibernate.criterion.Criterion;
22
23 import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator;
24 import eu.etaxonomy.cdm.api.service.dto.TypeDesignationStatusFilter;
25 import eu.etaxonomy.cdm.api.service.pager.Pager;
26 import eu.etaxonomy.cdm.api.service.search.DocumentSearchResult;
27 import eu.etaxonomy.cdm.api.service.search.LuceneParseException;
28 import eu.etaxonomy.cdm.api.service.search.SearchResult;
29 import eu.etaxonomy.cdm.api.utility.TaxonNamePartsFilter;
30 import eu.etaxonomy.cdm.model.common.Language;
31 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
32 import eu.etaxonomy.cdm.model.name.HybridRelationship;
33 import eu.etaxonomy.cdm.model.name.HybridRelationshipType;
34 import eu.etaxonomy.cdm.model.name.INonViralName;
35 import eu.etaxonomy.cdm.model.name.NameRelationship;
36 import eu.etaxonomy.cdm.model.name.NameRelationshipType;
37 import eu.etaxonomy.cdm.model.name.NomenclaturalStatus;
38 import eu.etaxonomy.cdm.model.name.Rank;
39 import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
40 import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;
41 import eu.etaxonomy.cdm.model.name.TaxonName;
42 import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
43 import eu.etaxonomy.cdm.model.name.TypeDesignationStatusBase;
44 import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
45 import eu.etaxonomy.cdm.persistence.dao.common.Restriction;
46 import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
47 import eu.etaxonomy.cdm.persistence.dto.TaxonNameParts;
48 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
49 import eu.etaxonomy.cdm.persistence.query.MatchMode;
50 import eu.etaxonomy.cdm.persistence.query.OrderHint;
51 import eu.etaxonomy.cdm.strategy.cache.TaggedText;
52 import eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl;
53
54 public interface INameService
55 extends IIdentifiableEntityService<TaxonName> {
56
57 /**
58 * Deletes a name. Depending on the configurator state links to the name will either be
59 * deleted or throw exceptions.<BR>
60 * If name is <code>null</code> this method has no effect.
61 * @param name
62 * @param config
63 *
64 */
65 public DeleteResult delete(UUID nameUUID, NameDeletionConfigurator config);
66
67 /**
68 * Creates specimen duplicate based on the given type specimen which will be assigned as a type
69 * of the given name.<br>
70 * The specimen will only differ in accession number, collection and type status and will be attached
71 * to the same {@link FieldUnit}
72 * @param name the name where this type designation will be added to
73 * @param baseDesignation the type specimen of this designation is cloned to create the new specimen
74 * @param accessionNumber the accession number of the cloned specimen
75 * @param barcode the barcode of the cloned specimen
76 * @param catalogNumber the catalog number of the cloned specimen
77 * @param collectionUuid the collection the cloned specimen belongs to
78 * @param typeStatus the type status of the cloned specimen
79 * @return an {@link UpdateResult}
80 */
81 public UpdateResult cloneTypeDesignation(UUID nameUuid, SpecimenTypeDesignation baseDesignation,
82 String accessionNumber, String barcode, String catalogNumber,
83 UUID collectionUuid, SpecimenTypeDesignationStatus typeStatus);
84
85 /**
86 * Removes the given type designation from the given taxon name and deletes it from
87 * the database if it is not connected to any other name.
88 * If <code>typeDesignation</code> is <code>null</code> all type designations are deleted
89 * from the given taxon name. If <code>name</code> is <code>null</code> all names are removed from
90 * the given type designation. If both are <code>null</code> nothing happens.
91 * @param typeDesignation
92 * @param name
93 * @return
94 */
95 public DeleteResult deleteTypeDesignation(TaxonName name, TypeDesignationBase<?> typeDesignation);
96
97 /**
98 * Removes the given type designation from the given taxon name and deletes it from
99 * the database if it is not connected to any other name.
100 * If <code>typeDesignation</code> is <code>null</code> all type designations are deleted
101 * from the given taxon name. If <code>name</code> is <code>null</code> all names are removed from
102 * the given type designation. If both are <code>null</code> nothing happens.
103 * @param typeDesignation
104 * @param name
105 * @return
106 */
107 public DeleteResult deleteTypeDesignation(UUID nameUuid, UUID typeDesignationUuid);
108
109
110 /**
111 * Saves the given type designations.
112 * @param typeDesignationCollection
113 * @return
114 */
115 public Map<UUID, TypeDesignationBase<?>> saveTypeDesignationAll(Collection<TypeDesignationBase<?>> typeDesignationCollection);
116
117 /**
118 * Saves the given homotypical groups.
119 * @param homotypicalGroups
120 * @return
121 */
122 public Map<UUID, HomotypicalGroup> saveAllHomotypicalGroups(Collection<HomotypicalGroup> homotypicalGroups);
123
124 /**
125 * Returns all nomenclatural status.
126 * @param limit
127 * @param start
128 * @return
129 */
130 public List<NomenclaturalStatus> getAllNomenclaturalStatus(int limit, int start);
131
132 /**
133 * Returns all type designations.
134 * @param limit
135 * @param start
136 * @return
137 */
138 public List<TypeDesignationBase<?>> getAllTypeDesignations(int limit, int start);
139
140 public TypeDesignationBase<?> loadTypeDesignation(int id, List<String> propertyPaths);
141
142 public TypeDesignationBase<?> loadTypeDesignation(UUID uuid, List<String> propertyPaths);
143
144 /**
145 * Returns all NonViralNames with a name cache that matches the given string
146 * @param name
147 * @return
148 */
149 public List<TaxonName> getNamesByNameCache(String nameCache);
150
151 /**
152 * Returns all NonViralNames with a title cache that matches the given string
153 * using the given match mode and initialization strategy
154 *
155 * @param name
156 * @param matchMode must not be <code>NULL</code>
157 * @param propertyPaths
158 * @return
159 */
160 public List<TaxonName> findNamesByTitleCache(String titleCache, MatchMode matchMode, List<String> propertyPaths);
161
162 /**
163 * Supports using wildcards in the query parameters.
164 * If a name part passed to the method contains the asterisk character ('*') it will be translated into '%' the related field is search with a LIKE clause.
165 * <p>
166 * A query parameter which is passed as <code>NULL</code> value will be ignored. A parameter passed as {@link Optional} object containing a <code>NULL</code> value will be used
167 * to filter select taxon names where the according field is <code>null</code>.
168 *
169 * @param filter
170 * @param infraGenericEpithet
171 * @param specificEpithet
172 * @param infraSpecificEpithet
173 * @param rank
174 * Only names having the specified rank are taken into account.
175 * @param excludedNamesUuids
176 * Names to be excluded from the result set
177 * @return
178 */
179 public Pager<TaxonNameParts> findTaxonNameParts(Optional<String> genusOrUninomial,
180 Optional<String> infraGenericEpithet, Optional<String> specificEpithet,
181 Optional<String> infraSpecificEpithet, Rank rank, Set<UUID> excludedNamesUuids,
182 Integer pageSize, Integer pageIndex, List<OrderHint> orderHints);
183
184 /**
185 * <b>This method behaves differently compared to {@link #findTaxonNameParts(Optional, Optional, Optional, Optional, Rank, Integer, Integer, List)}!</b>
186 * <p>
187 * The {@link TaxonNamePartsFilter} defines the rank and fixed name parts for the search process.
188 * For example: In case the <code>rank</code> is "genus", the <code>genusOrUninomial</code> will be used as search parameter which needs to match exactly.
189 * The <code>namePartQueryString</code> will be used to do a wildcard search on the specificEpithet.
190 * <p>
191 * For name part lookup purposes the <code>TaxonNameParts</code> in the result list can be asked to return the relavant name part by
192 * calling {@link TaxonNameParts#nameRankSpecificNamePart(TaxonName)}
193 *
194 *
195 * @param filter
196 * @return
197 */
198 public Pager<TaxonNameParts> findTaxonNameParts(TaxonNamePartsFilter filter, String namePartQueryString, Integer pageSize, Integer pageIndex, List<OrderHint> orderHints);
199
200 /**
201 * Returns all NonViralNames with a name cache that matches the given string
202 * using the given match mode and initialization strategy
203 *
204 * @param name
205 * @param matchMode
206 * @param propertyPaths
207 * @return
208 */
209 public List<TaxonName> findNamesByNameCache(String nameCache, MatchMode matchMode, List<String> propertyPaths);
210
211 /**
212 * Fuzzy matching for the taxon name elements. The input name is first atomised using the {@link NonViralNameParserImpl}
213 * into its separate parts (genusOrUninomial,infraGenericEpithet,specificEpithet,infraGenericEpithet,authorshipCache).
214 * Each field is then matched separately with the same accuracy parameter.
215 *
216 * @param name taxon name to fuzzy match
217 * @param accuracy value > 0.0 and < 1.0 which determines the accuracy of the result.
218 * @param languages list of languages to consider when matching (currently not used)
219 * @param highlightFragments
220 * @param propertyPaths
221 * @param maxNoOfResults
222 * @return
223 * @throws IOException
224 * @throws LuceneParseException
225 */
226 public List<SearchResult<TaxonName>> findByNameFuzzySearch(
227 String name,
228 float accuracy,
229 List<Language> languages,
230 boolean highlightFragments,
231 List<String> propertyPaths,
232 int maxNoOfResults) throws IOException, LuceneParseException;
233
234 /**
235 * Fuzzy matching for the taxon name elements using only the lucene index.
236 *
237 * The input name is first atomised using the {@link NonViralNameParserImpl}
238 * into its separate parts (genusOrUninomial,infraGenericEpithet,specificEpithet,infraGenericEpithet,authorshipCache).
239 * Each field is then matched separately with the same accuracy parameter.
240 *
241 * @param name taxon name to fuzzy match
242 * @param accuracy value > 0.0 and < 1.0 which determines the accuracy of the result.
243 * @param languages list of languages to consider when matching (currently not used)
244 * @param highlightFragments
245 * @param maxNoOfResults
246 * @return
247 * @throws IOException
248 * @throws LuceneParseException
249 */
250 public List<DocumentSearchResult> findByNameFuzzySearch(
251 String name,
252 float accuracy,
253 List<Language> languages,
254 boolean highlightFragments,
255 int maxNoOfResults) throws IOException, LuceneParseException;
256
257 /**
258 * Fuzzy matching against the name cache using only the lucene index.
259 *
260 *
261 * @param name taxon name to fuzzy match
262 * @param accuracy value > 0.0 and < 1.0 which determines the accuracy of the result.
263 * @param languages list of languages to consider when matching (currently not used)
264 * @param highlightFragments
265 * @param maxNoOfResults
266 * @return
267 * @throws IOException
268 * @throws LuceneParseException
269 */
270 public List<DocumentSearchResult> findByFuzzyNameCacheSearch(
271 String name,
272 float accuracy,
273 List<Language> languages,
274 boolean highlightFragments,
275 int maxNoOfResults) throws IOException, LuceneParseException;
276
277 /**
278 * Exact matching for the taxon name elements using only the lucene index.
279 *
280 * The input name is first atomised using the {@link NonViralNameParserImpl}
281 * into its separate parts (genusOrUninomial,infraGenericEpithet,specificEpithet,infraGenericEpithet,authorshipCache).
282 * Each field is then matched separately with the same accuracy parameter.
283 *
284 * @param name taxon name to fuzzy match
285 * @param wildcard boolean flag to indicate whether a wildcard '*' should be added at the end of the query
286 * @param languages list of languages to consider when matching (currently not used)
287 * @param highlightFragments
288 * @param maxNoOfResults
289 * @return
290 * @throws IOException
291 * @throws LuceneParseException
292 */
293
294 public List<DocumentSearchResult> findByNameExactSearch(
295 String name,
296 boolean wildcard,
297 List<Language> languages,
298 boolean highlightFragments,
299 int maxNoOfResults) throws IOException, LuceneParseException;
300
301 // TODO: Remove getNamesByName() methods. Use findNamesByTitle() instead.
302
303 public List<HomotypicalGroup> getAllHomotypicalGroups(int limit, int start);
304
305 /**
306 * Returns all or a page of all taxon name relationships in the database.
307 * The result can be filtered by relationship types.
308 * It does NOT contain hybrid relationships
309 * (see {@link #listHybridRelationships(Set, Integer, Integer, List, List)})
310 *
311 * @param types The name relationship type filter, if <code>null</code> no filter is set, if empty the result will also be empty
312 * @param pageSize the page size
313 * @param pageStart the number of the page
314 * @param orderHints the order hints
315 * @param propertyPaths the property path to initialize the resulting objects
316 * @return list of name relationships matching the filter criteria
317 */
318 public List<NameRelationship> listNameRelationships(Set<NameRelationshipType> types,
319 Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
320
321 /**
322 * Returns all or a page of all hybrid relationships in the database.
323 * The result can be filtered by relationship types.
324 * It does NOT contain ordinary name relationships
325 * (see {@link #listNameRelationships(Set, Integer, Integer, List, List)})
326 *
327 * @param types The hybrid relationship type filter, if <code>null</code> no filter is set, if empty the result will also be empty
328 * @param pageSize the page size
329 * @param pageStart the number of the page
330 * @param orderHints the order hints
331 * @param propertyPaths the property path to initialize the resulting objects
332 * @return list of hybrid relationships matching the filter criteria
333 */
334 public List<HybridRelationship> listHybridRelationships(Set<HybridRelationshipType> types,
335 Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
336
337 /**
338 * Return a List of name relationships in which this name is related to
339 * another name, optionally filtered by relationship type
340 *
341 * @param name
342 * the name on either the <i>"from side"</i> or on the
343 * <i>"to side"</i> of the relationship, depending on the
344 * <code>direction</code> of the relationship.
345 * @param direction
346 * the direction of the NameRelationship, may be null to return all relationships
347 * @param type
348 * the relationship type (or null to return all relationships)
349 * @param pageSize
350 * The maximum number of relationships returned (can be null for
351 * all relationships)
352 * @param pageNumber
353 * The offset (in pageSize chunks) from the start of the result
354 * set (0 - based)
355 * @param orderHints
356 * may be null
357 * @param propertyPaths
358 * properties to initialize - see
359 * {@link IBeanInitializer#initialize(Object, List)}
360 * @return a Pager of NameRelationship instances
361 */
362 public List<NameRelationship> listNameRelationships(TaxonName name, NameRelationship.Direction direction, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
363
364 /**
365 * Return a List of name relationships in which this name is related to another name, optionally filtered
366 * by relationship type
367 *
368 * @param name the name on the <i>"from side"</i> of the relationship
369 * @param direction the direction of the NameRelationship
370 * @param type the relationship type (or null to return all relationships)
371 * @param pageSize The maximum number of relationships returned (can be null for all relationships)
372 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
373 * @param orderHints may be null
374 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
375 * @return a Pager of NameRelationship instances
376 */
377 public Pager<NameRelationship> pageNameRelationships(TaxonName name, NameRelationship.Direction direction, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
378
379 /**
380 * Return a List of relationships in which this name is related to another name, optionally filtered
381 * by relationship type
382 *
383 * @param name the name on the <i>"from side"</i> of the relationship
384 * @param type the relationship type (or null to return all relationships)
385 * @param pageSize The maximum number of relationships returned (can be null for all relationships)
386 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
387 * @param orderHints may be null
388 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
389 * @return a Pager of NameRelationship instances
390 * @deprecated use {@link #listNameRelationships(TaxonName, eu.etaxonomy.cdm.model.common.RelationshipBase.Direction, NameRelationshipType, Integer, Integer, List, List)} instead
391 */
392 @Deprecated
393 public List<NameRelationship> listFromNameRelationships(TaxonName name, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
394
395 /**
396 * Return a List of relationships in which this name is related to another name, optionally filtered
397 * by relationship type
398 *
399 * @param name the name on the <i>"from side"</i> of the relationship
400 * @param type the relationship type (or null to return all relationships)
401 * @param pageSize The maximum number of relationships returned (can be null for all relationships)
402 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
403 * @param orderHints may be null
404 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
405 * @return a Pager of NameRelationship instances
406 * @deprecated use {@link #pageNameRelationships(TaxonName, eu.etaxonomy.cdm.model.common.RelationshipBase.Direction, NameRelationshipType, Integer, Integer, List, List)} instead
407 */
408 @Deprecated
409 public Pager<NameRelationship> pageFromNameRelationships(TaxonName name, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
410
411 /**
412 * Return a List of relationships in which another name is related to this name, optionally filtered
413 * by relationship type
414 *
415 * @param name the name on the <i>"to side"</i> of the relationship
416 * @param type the relationship type (or null to return all relationships)
417 * @param pageSize The maximum number of relationships returned (can be null for all relationships)
418 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
419 * @param orderHints may be null
420 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
421 * @return a Pager of NameRelationship instances
422 * @deprecated use {@link #listNameRelationships(TaxonName, eu.etaxonomy.cdm.model.common.RelationshipBase.Direction, NameRelationshipType, Integer, Integer, List, List)} instead
423 */
424 @Deprecated
425 public List<NameRelationship> listToNameRelationships(TaxonName name, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
426
427 /**
428 * Return a List of relationships in which another name is related to this name, optionally filtered
429 * by relationship type
430 *
431 * @param name the name on the <i>"to side"</i> of the relationship
432 * @param type the relationship type (or null to return all relationships)
433 * @param pageSize The maximum number of relationships returned (can be null for all relationships)
434 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
435 * @param orderHints may be null
436 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
437 * @return a Pager of NameRelationship instances
438 * @deprecated use {@link #pageNameRelationships(TaxonName, eu.etaxonomy.cdm.model.common.RelationshipBase.Direction, NameRelationshipType, Integer, Integer, List, List)} instead
439 */
440 @Deprecated
441 public Pager<NameRelationship> pageToNameRelationships(TaxonName name, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
442
443
444 /**
445 * Return a List of hybrids related to this name, optionally filtered
446 * by hybrid relationship type
447 *
448 * @param name the name
449 * @param type the hybrid relationship type (or null to return all hybrids)
450 * @param pageSize The maximum number of hybrid relationships returned (can be null for all relationships)
451 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
452 * @param orderHints may be null
453 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
454 * @return a Pager of HybridRelationship instances
455 */
456 public Pager<HybridRelationship> getHybridNames(INonViralName name, HybridRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
457
458 /**
459 * Return a List of types related to this name, optionally filtered
460 * by type designation status
461 *
462 * @param name the name
463 * @param status the type designation status (or null to return all types)
464 * @param pageSize The maximum number of types returned (can be null for all types)
465 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
466 * @return a Pager of TypeDesignationBase instances
467 */
468 public Pager<TypeDesignationBase> getTypeDesignations(TaxonName name,
469 SpecimenTypeDesignationStatus status, Integer pageSize, Integer pageNumber);
470
471 public Pager<TypeDesignationBase> getTypeDesignations(TaxonName name,
472 SpecimenTypeDesignationStatus status, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
473
474 public List<TypeDesignationBase> getTypeDesignationsInHomotypicalGroup(UUID nameUuid, Integer pageSize,
475 Integer pageNumber, List<String> propertyPaths);
476
477
478 /**
479 * Returns a List of TaxonName instances that match the properties passed
480 *
481 * @param uninomial
482 * @param infraGenericEpithet
483 * @param specificEpithet
484 * @param infraspecificEpithet
485 * @param rank
486 * @param pageSize The maximum number of names returned (can be null for all names)
487 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
488 * @param orderHints may be null
489 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
490 * @return a Pager of TaxonName instances
491 */
492 public Pager<TaxonName> searchNames(String uninomial, String infraGenericEpithet, String specificEpithet, String infraspecificEpithet, Rank rank, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
493
494 /**
495 * Returns a Paged List of TaxonName instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
496 *
497 * @param clazz filter the results by class (or pass null to return all TaxonName instances)
498 * @param queryString
499 * @param pageSize The maximum number of names returned (can be null for all matching names)
500 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
501 * @param orderHints
502 * Supports path like <code>orderHints.propertyNames</code> which
503 * include *-to-one properties like createdBy.username or
504 * authorTeam.persistentTitleCache
505 * @param propertyPaths properties to be initialized
506 * @return a Pager TaxonName instances
507 * @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>
508 */
509 @Override
510 public Pager<TaxonName> search(Class<? extends TaxonName> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
511
512 /**
513 * Returns a map that holds uuid, titleCache pairs of all names in the current database
514 *
515 * @return
516 * a <code>Map</code> containing uuid and titleCache of names
517 */
518 public List<UuidAndTitleCache> getUuidAndTitleCacheOfNames(Integer limit, String pattern);
519
520 /**
521 * Return a Pager of names matching the given query string, optionally filtered by class, optionally with a particular MatchMode
522 *
523 * @param clazz filter by class - can be null to include all instances of type T
524 * @param queryString the query string to filter by
525 * @param matchmode use a particular type of matching (can be null - defaults to exact matching)
526 * @param criteria additional criteria to filter by
527 * @param pageSize The maximum number of objects returned (can be null for all objects)
528 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
529 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
530 * @param orderHints
531 * Supports path like <code>orderHints.propertyNames</code> which
532 * include *-to-one properties like createdBy.username or
533 * authorTeam.persistentTitleCache
534 * @return a paged list of instances of type T matching the queryString
535 */
536 public Pager<TaxonName> findByName(Class<TaxonName> clazz, String queryString, MatchMode matchmode,
537 List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
538
539 /**
540 * Returns a homotypical group with the given UUID or null if not homotypical group exists with that UUID
541 *
542 * @param uuid the uuid of the homotypical group
543 * @return a homotypical group
544 */
545 public HomotypicalGroup findHomotypicalGroup(UUID uuid);
546
547 /**
548 * @param uuid
549 * @return
550 */
551 public List<TaggedText> getTaggedName(UUID uuid);
552
553 /**
554 * @param nameUuid
555 * @return
556 */
557 public UpdateResult setAsGroupsBasionym(UUID nameUuid);
558
559 public List<HashMap<String, String>> getNameRecords();
560
561 /**
562 * @param name
563 * @param config
564 * @return
565 */
566 DeleteResult delete(TaxonName name, NameDeletionConfigurator config);
567
568 List<TypeDesignationStatusBase> getTypeDesignationStatusInUse();
569
570 /**
571 * Provides a collection of the TypeDesignationStatusBase terms which are in use.
572 * Terms having the same label are merged into one filter item.
573 *
574 * @param preferredLanguage
575 * @return
576 */
577 Collection<TypeDesignationStatusFilter> getTypeDesignationStatusFilterTerms(List<Language> preferredLanguages);
578
579 /**
580 * @param uuid
581 * @param propertyPaths
582 * @return
583 */
584 NomenclaturalStatus loadNomenclaturalStatus(UUID uuid, List<String> propertyPaths);
585
586 /**
587 * @param clazz
588 * @param restrictions
589 * @param pageSize
590 * @param pageIndex
591 * @param orderHints
592 * @param propertyPaths
593 * @param includeUnpublished
594 * @return
595 */
596 public <S extends TaxonName> Pager<S> page(Class<S> clazz, List<Restriction<?>> restrictions, Integer pageSize, Integer pageIndex,
597 List<OrderHint> orderHints, List<String> propertyPaths, boolean includeUnpublished);
598
599
600 }