1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2009 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.util.List;
|
14
|
|
15
|
import eu.etaxonomy.cdm.api.service.pager.Pager;
|
16
|
import eu.etaxonomy.cdm.model.location.WaterbodyOrCountry;
|
17
|
import eu.etaxonomy.cdm.model.media.Media;
|
18
|
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
|
19
|
import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
|
20
|
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
|
21
|
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
|
22
|
import eu.etaxonomy.cdm.persistence.dao.BeanInitializer;
|
23
|
import eu.etaxonomy.cdm.persistence.query.OrderHint;
|
24
|
|
25
|
/**
|
26
|
* @author a.babadshanjan
|
27
|
* @created 01.09.2008
|
28
|
*/
|
29
|
public interface IOccurrenceService extends IIdentifiableEntityService<SpecimenOrObservationBase> {
|
30
|
|
31
|
public WaterbodyOrCountry getCountryByIso(String iso639);
|
32
|
|
33
|
public List<WaterbodyOrCountry> getWaterbodyOrCountryByName(String name);
|
34
|
|
35
|
/**
|
36
|
* Returns a paged list of occurrences that have been determined to belong to the taxon concept
|
37
|
* determinedAs, optionally restricted to objects belonging to a class that that extends
|
38
|
* SpecimenOrObservationBase
|
39
|
*
|
40
|
* @param type The type of entities to return (can be null to count all entities of type <T>)
|
41
|
* @param determinedAs the taxon concept that the occurrences have been determined to belong to
|
42
|
* @param pageSize The maximum number of objects returned (can be null for all matching objects)
|
43
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based,
|
44
|
* can be null, equivalent of starting at the beginning of the recordset)
|
45
|
* @param orderHints
|
46
|
* Supports path like <code>orderHints.propertyNames</code> which
|
47
|
* include *-to-one properties like createdBy.username or
|
48
|
* authorTeam.persistentTitleCache
|
49
|
* @param propertyPaths properties to be initialized
|
50
|
* @return
|
51
|
*/
|
52
|
public Pager<SpecimenOrObservationBase> list(Class<? extends SpecimenOrObservationBase> type, TaxonBase determinedAs, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);
|
53
|
|
54
|
/**
|
55
|
* Returns a List of Media that are associated with a given occurence
|
56
|
*
|
57
|
* @param occurence the occurence associated with these media
|
58
|
* @param pageSize The maximum number of media returned (can be null for all related media)
|
59
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
60
|
* @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}
|
61
|
* @return a Pager of media instances
|
62
|
*/
|
63
|
public Pager<Media> getMedia(SpecimenOrObservationBase occurence, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
64
|
|
65
|
/**
|
66
|
* Returns a List of determinations that have been made for a given occurence
|
67
|
*
|
68
|
* @param occurence the occurence associated with these determinations (can be null for all occurrences)
|
69
|
* @param taxonbase the taxon concept associated with these determinations (can be null for all taxon concepts)
|
70
|
* @param pageSize The maximum number of determinations returned (can be null for all related determinations)
|
71
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
72
|
* @return a Pager of determination instances
|
73
|
*/
|
74
|
public Pager<DeterminationEvent> getDeterminations(SpecimenOrObservationBase occurence, TaxonBase taxonBase, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
75
|
|
76
|
/**
|
77
|
* Returns a list of derivation events that have involved creating new DerivedUnits from this occurence
|
78
|
*
|
79
|
* @param occurence the occurence that was a source of these derivation events
|
80
|
* @param pageSize The maximum number of derivation events returned (can be null for all related derivation events)
|
81
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
82
|
* @return a Pager of derivation events
|
83
|
*/
|
84
|
public Pager<DerivationEvent> getDerivationEvents(SpecimenOrObservationBase occurence, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
85
|
|
86
|
/**
|
87
|
* Returns a Paged List of SpecimenOrObservationBase instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
|
88
|
*
|
89
|
* @param clazz filter the results by class (or pass null to return all SpecimenOrObservationBase instances)
|
90
|
* @param queryString
|
91
|
* @param pageSize The maximum number of occurrences returned (can be null for all matching occurrences)
|
92
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
93
|
* @param orderHints
|
94
|
* Supports path like <code>orderHints.propertyNames</code> which
|
95
|
* include *-to-one properties like createdBy.username or
|
96
|
* authorTeam.persistentTitleCache
|
97
|
* @param propertyPaths properties to be initialized
|
98
|
* @return a Pager SpecimenOrObservationBase instances
|
99
|
* @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>
|
100
|
*/
|
101
|
public Pager<SpecimenOrObservationBase> search(Class<? extends SpecimenOrObservationBase> clazz, String query, Integer pageSize,Integer pageNumber, List<OrderHint> orderHints,List<String> propertyPaths);
|
102
|
}
|