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.util.List;
|
13
|
import java.util.Set;
|
14
|
import java.util.UUID;
|
15
|
|
16
|
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
|
17
|
import eu.etaxonomy.cdm.api.service.dto.IdentifiedEntityDTO;
|
18
|
import eu.etaxonomy.cdm.api.service.pager.Pager;
|
19
|
import eu.etaxonomy.cdm.model.name.TaxonName;
|
20
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
21
|
import eu.etaxonomy.cdm.model.reference.ReferenceType;
|
22
|
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
|
23
|
import eu.etaxonomy.cdm.model.term.DefinedTerm;
|
24
|
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
|
25
|
import eu.etaxonomy.cdm.persistence.query.MatchMode;
|
26
|
import eu.etaxonomy.cdm.persistence.query.OrderHint;
|
27
|
|
28
|
|
29
|
public interface IReferenceService extends IIdentifiableEntityService<Reference> {
|
30
|
|
31
|
/**
|
32
|
* Returns a Paged List of Reference instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
|
33
|
*
|
34
|
* @param clazz filter the results by class (or pass null to return all Reference instances)
|
35
|
* @param queryString
|
36
|
* @param pageSize The maximum number of references returned (can be null for all matching references)
|
37
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
38
|
* @param orderHints
|
39
|
* Supports path like <code>orderHints.propertyNames</code> which
|
40
|
* include *-to-one properties like createdBy.username or
|
41
|
* authorTeam.persistentTitleCache
|
42
|
* @param propertyPaths properties to be initialized
|
43
|
* @return a Pager Reference instances
|
44
|
* @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>
|
45
|
*/
|
46
|
@Override
|
47
|
public Pager<Reference> search(Class<? extends Reference> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
48
|
|
49
|
/**
|
50
|
* Returns a map that holds uuid, titleCache pairs of all references in the current database
|
51
|
*
|
52
|
* @return
|
53
|
* a <code>Map</code> containing uuid and titleCache of references
|
54
|
*/
|
55
|
public List<UuidAndTitleCache<Reference>> getUuidAndTitle();
|
56
|
|
57
|
/**
|
58
|
* lists all references marked as "publish" and not used as nomenclatural references
|
59
|
*/
|
60
|
public List<Reference> listReferencesForPublishing();
|
61
|
|
62
|
/**
|
63
|
* Lists all references used as nomenclatural references in at least 1 {@link TaxonName}
|
64
|
*/
|
65
|
public List<Reference> listNomenclaturalReferences();
|
66
|
|
67
|
/**
|
68
|
* returns
|
69
|
*
|
70
|
* <ol>
|
71
|
* <li>all taxa directly covered by this reference</li>
|
72
|
* <li>all taxa covered by the according in references of this reference</li>
|
73
|
* </ol>
|
74
|
*
|
75
|
* searches for taxa using the following relations:
|
76
|
* <ul>
|
77
|
* <li>taxon.name.nomenclaturalSource.citation</li>
|
78
|
* <li>taxon.descriptions.descriptionElement.sources.citation</li>
|
79
|
* <li>taxon.descriptions.descriptionSources</li>
|
80
|
* <li>taxon.name.descriptions.descriptionElement.sources</li>
|
81
|
* <li>taxon.name.descriptions.descriptionSources</li>
|
82
|
* </ul>
|
83
|
*
|
84
|
* @param reference
|
85
|
* @param includeSubordinateReferences TODO
|
86
|
* @param propertyPaths
|
87
|
* @return
|
88
|
*/
|
89
|
public List<TaxonBase> listCoveredTaxa(Reference reference, boolean includeSubordinateReferences, List<String> propertyPaths);
|
90
|
|
91
|
|
92
|
public List<UuidAndTitleCache<Reference>> getUuidAndAbbrevTitleCache(Integer limit, String pattern);
|
93
|
|
94
|
/**
|
95
|
* @param limit
|
96
|
* @param pattern
|
97
|
* @param type
|
98
|
* @return
|
99
|
*/
|
100
|
public List<UuidAndTitleCache<Reference>> getUuidAndAbbrevTitleCache(Integer limit, String pattern, ReferenceType type);
|
101
|
/**
|
102
|
* @param limit
|
103
|
* @param pattern
|
104
|
* @param type
|
105
|
* @return
|
106
|
*/
|
107
|
public List<UuidAndTitleCache<Reference>> getUuidAndTitleCache(Integer limit, String pattern, ReferenceType type);
|
108
|
|
109
|
/**
|
110
|
* @param identifier
|
111
|
* @param identifierType
|
112
|
* @param matchmode
|
113
|
* @param limit
|
114
|
* @return
|
115
|
*/
|
116
|
public List<IdentifiedEntityDTO<Reference>> listByIdentifierAbbrev(String identifier, DefinedTerm identifierType,
|
117
|
MatchMode matchmode, Integer limit);
|
118
|
|
119
|
/**
|
120
|
* @param limit
|
121
|
* @param pattern
|
122
|
* @param type
|
123
|
* @return
|
124
|
*/
|
125
|
List<UuidAndTitleCache<Reference>> getUuidAndAbbrevTitleCacheForAuthor(Integer limit, String pattern,
|
126
|
ReferenceType type);
|
127
|
|
128
|
/**
|
129
|
* @param limit
|
130
|
* @param authorID
|
131
|
* @param type
|
132
|
* @return
|
133
|
*/
|
134
|
List<UuidAndTitleCache<Reference>> getUuidAndAbbrevTitleCacheForAuthorID(Integer limit, Integer authorID,
|
135
|
ReferenceType refType);
|
136
|
|
137
|
/**
|
138
|
* @param uuids
|
139
|
*
|
140
|
* @return
|
141
|
*/
|
142
|
List<UuidAndTitleCache<Reference>> getUuidAndTitleCacheForUUIDS(Set<UUID> uuids);
|
143
|
|
144
|
/**
|
145
|
* @param identifier
|
146
|
* @param identifierType
|
147
|
* @param matchmode
|
148
|
* @param limit
|
149
|
* @return
|
150
|
*/
|
151
|
List<IdentifiedEntityDTO<Reference>> listByIdentifierAndTitleCacheAbbrev(String identifier,
|
152
|
DefinedTerm identifierType, MatchMode matchmode, Integer limit);
|
153
|
|
154
|
/**
|
155
|
* @param uuids
|
156
|
* @param refType
|
157
|
* @return
|
158
|
*/
|
159
|
List<UuidAndTitleCache<Reference>> getUuidAndTitleCacheForUUIDS(Set<UUID> uuids, ReferenceType refType);
|
160
|
|
161
|
/**
|
162
|
* @param config
|
163
|
* @return
|
164
|
*/
|
165
|
List<Reference> findByTitleAndAbbrevTitle(IIdentifiableEntityServiceConfigurator<Reference> config);
|
166
|
|
167
|
}
|