Project

General

Profile

Download (10.7 KB) Statistics
| Branch: | Tag: | Revision:
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.util.Collection;
14
import java.util.List;
15
import java.util.Map;
16
import java.util.UUID;
17

    
18
import eu.etaxonomy.cdm.api.service.config.CreateHierarchyForClassificationConfigurator;
19
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
20
import eu.etaxonomy.cdm.api.service.pager.Pager;
21
import eu.etaxonomy.cdm.model.media.MediaRepresentation;
22
import eu.etaxonomy.cdm.model.name.Rank;
23
import eu.etaxonomy.cdm.model.taxon.Classification;
24
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
25
import eu.etaxonomy.cdm.model.taxon.Taxon;
26
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
27
import eu.etaxonomy.cdm.persistence.dto.ClassificationLookupDTO;
28
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
29
import eu.etaxonomy.cdm.persistence.query.OrderHint;
30

    
31

    
32
/**
33
 * @author n.hoffmann
34
 * @created Sep 21, 2009
35
 */
36
public interface IClassificationService extends IIdentifiableEntityService<Classification> {
37

    
38
    /**
39
     *
40
     * @param uuid
41
     * @return
42
     */
43
    public TaxonNode getTaxonNodeByUuid(UUID uuid);
44

    
45
    /**
46
     *
47
     * @param uuid
48
     * @return
49
     */
50
    public ITaxonTreeNode getTreeNodeByUuid(UUID uuid);
51

    
52
    /**
53
     *
54
     * @param limit
55
     * @param start
56
     * @param orderHints
57
     * @param propertyPaths
58
     * @return
59
     */
60
    public List<Classification> listClassifications(Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);
61

    
62
    /**
63
     *
64
     * @param taxon
65
     * @param classificationUuid
66
     * @param propertyPaths
67
     * @return
68
     * @deprecated use loadTaxonNode(TaxonNode taxonNode, ...) instead
69
     * if you have a classification and a taxon that is in it, you should also have the according taxonNode
70
     */
71
    @Deprecated
72
    public TaxonNode loadTaxonNodeByTaxon(Taxon taxon, UUID classificationUuid, List<String> propertyPaths);
73

    
74
    /**
75
     *
76
     * @param taxonNode
77
     * @param propertyPaths
78
     * @return
79
     * @deprecated use TaxonNodeService instead
80
     */
81
    @Deprecated
82
    public TaxonNode loadTaxonNode(TaxonNode taxonNode, List<String> propertyPaths);
83

    
84
    /**
85
     * Loads all TaxonNodes of the specified classification for a given Rank or lower.
86
     * If a branch of the classification tree is not containing a TaxonNode with a Taxon at the given
87
     * Rank the according node associated with the next lower Rank is taken as root node in this case.
88
     * So the nodes returned may reference Taxa with different Ranks.
89
     *
90
     * If the <code>rank</code> is null the absolute root nodes will be returned.
91
     *
92
     * @param classification may be null for all classifications
93
     * @param rank the set to null for to get the root nodes of classifications
94
     * @param pageSize The maximum number of relationships returned (can be null for all relationships)
95
     * @param pageIndex The offset (in pageSize chunks) from the start of the result set (0 - based)
96
     * @param propertyPaths
97
     * @return
98
     *
99
     */
100
    public List<TaxonNode> listRankSpecificRootNodes(Classification classification, Rank rank, Integer pageSize, Integer pageIndex, List<String> propertyPaths);
101

    
102

    
103
    /**
104
     * Loads all TaxonNodes of the specified classification for a given Rank or lower.
105
     * If a branch of the classification tree is not containing a TaxonNode with a Taxon at the given
106
     * Rank the according node associated with the next lower Rank is taken as root node in this case.
107
     * So the nodes returned may reference Taxa with different Ranks.
108
     *
109
     * If the <code>rank</code> is null the absolute root nodes will be returned.
110
     *
111
     * @param classification may be null for all classifications
112
     * @param rank the set to null for to get the root nodes of classifications
113
     * @param pageSize The maximum number of relationships returned (can be null for all relationships)
114
     * @param pageIndex The offset (in pageSize chunks) from the start of the result set (0 - based)
115
     * @param propertyPaths
116
     * @return
117
     *
118
     */
119
    public Pager<TaxonNode> pageRankSpecificRootNodes(Classification classification, Rank rank, Integer pageSize, Integer pageIndex, List<String> propertyPaths);
120

    
121
    /**
122
     * @param taxonNode
123
     * @param baseRank
124
     *            specifies the root level of the classification, may be null.
125
     *            Nodes of this rank or in case this rank does not exist in the
126
     *            current branch the next lower rank is taken as root node for
127
     *            this rank henceforth called the <b>base node</b>.
128
     * @param propertyPaths
129
     *            the initialization strategy for the returned TaxonNode
130
     *            instances.
131
     * @return the path of nodes from the <b>base node</b> to the node of the
132
     *         specified taxon.
133
     */
134
    public List<TaxonNode> loadTreeBranch(TaxonNode taxonNode, Rank baseRank, List<String> propertyPaths);
135

    
136
    /**
137
     * Although this method seems to be a redundant alternative to {@link #loadChildNodesOfTaxonNode(TaxonNode, List)} it is an important
138
     * alternative from which web services benefit. Without this method the web service controller method, which operates outside of the
139
     * transaction, would have to initialize the full taxon tree with all nodes of the taxon.
140
     * This would be rather slow compared to using this method.
141
     * @param taxon
142
     * @param classification
143
     *            the classification to be used
144
     * @param baseRank
145
     *            specifies the root level of the classification, may be null.
146
     *            Nodes of this rank or in case this rank does not exist in the
147
     *            current branch the next lower rank is taken as as root node for
148
     *            this rank henceforth called the <b>base node</b>.
149
     * @param propertyPaths
150
     *            the initialization strategy for the returned TaxonNode
151
     *            instances.
152
     * @return the path of nodes from the <b>base node</b> to the node of the specified
153
     *         taxon.
154
     */
155
    public List<TaxonNode> loadTreeBranchToTaxon(Taxon taxon, Classification classification, Rank baseRank, List<String> propertyPaths);
156

    
157

    
158

    
159
    /**
160
     * @param taxonUuid
161
     * @param classificationUuid
162
     * @param propertyPaths
163
     * @return
164
     */
165
    public List<TaxonNode> listChildNodesOfTaxon(UUID taxonUuid, UUID classificationUuid, Integer pageSize, Integer pageIndex, List<String> propertyPaths);
166

    
167
    /**
168
     * @param taxonNode
169
     * @param propertyPaths
170
     * @deprecated move to TaxonNodeService
171
     * @return
172
     */
173
    @Deprecated
174
    public List<TaxonNode> loadChildNodesOfTaxonNode(TaxonNode taxonNode, List<String> propertyPaths);
175

    
176
    /**
177
     *
178
     * @param classification
179
     * @return
180
     */
181
    public List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification, List<UUID> excludeTaxa);
182

    
183
    /**
184
     * @param taxon
185
     * @param taxTree
186
     * @param propertyPaths
187
     * @param size
188
     * @param height
189
     * @param widthOrDuration
190
     * @param mimeTypes
191
     * @return
192
     *
193
     * @deprecated use getAllMediaForChildNodes(TaxonNode taxonNode, ...) instead
194
     * if you have a classification and a taxon that is in it, you should also have the according taxonNode
195
     */
196
    @Deprecated
197
    public Map<UUID, List<MediaRepresentation>> getAllMediaForChildNodes(Taxon taxon, Classification taxTree, List<String> propertyPaths, int size, int height, int widthOrDuration, String[] mimeTypes);
198

    
199
    /**
200
     *
201
     * @param taxonNode
202
     * @param propertyPaths
203
     * @param size
204
     * @param height
205
     * @param widthOrDuration
206
     * @param mimeTypes
207
     * @return
208
     */
209
    public Map<UUID, List<MediaRepresentation>> getAllMediaForChildNodes(TaxonNode taxonNode, List<String> propertyPaths, int size, int height, int widthOrDuration, String[] mimeTypes);
210

    
211
    /**
212
     *
213
     * @param taxonNode
214
     * @return
215
     * @deprecated use TaxonNodeService instead
216
     */
217
    @Deprecated
218
    public UUID removeTaxonNode(TaxonNode taxonNode);
219

    
220
    /**
221
     *
222
     * @param taxonNode
223
     * @return
224
     * @deprecated use TaxonNodeService instead
225
     */
226
    @Deprecated
227
    public UUID saveTaxonNode(TaxonNode taxonNode);
228

    
229
    /**
230
     *
231
     * @param taxonNodeCollection
232
     * @return
233
     * @deprecated use TaxonNodeService instead
234
     */
235
    @Deprecated
236
    public Map<UUID, TaxonNode> saveTaxonNodeAll(Collection<TaxonNode> taxonNodeCollection);
237

    
238
    /**
239
     *
240
     * @param treeNode
241
     * @return
242
     */
243

    
244
    public UUID removeTreeNode(ITaxonTreeNode treeNode);
245

    
246
    /**
247
     *
248
     * @param treeNode
249
     * @return
250
     */
251
    public UUID saveTreeNode(ITaxonTreeNode treeNode);
252

    
253

    
254
    public List<TaxonNode> getAllNodes();
255

    
256
	public UpdateResult createHierarchyInClassification(Classification classification, CreateHierarchyForClassificationConfigurator configurator);
257

    
258
    /**
259
     * @param classificationUuid
260
     * @param excludeTaxa
261
     * @return
262
     */
263
    public List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(UUID classificationUuid, List<UUID> excludeTaxa);
264

    
265
    /**
266
     * @param classificationUuid
267
     * @param excludeTaxa
268
     * @param limit
269
     * @param pattern
270
     * @return
271
     */
272
    List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(
273
            UUID classificationUuid, List<UUID> excludeTaxa, Integer limit, String pattern);
274

    
275
    /**
276
     * @param classification
277
     * @param excludeTaxa
278
     * @param limit
279
     * @param pattern
280
     * @return
281
     */
282
    List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(
283
            Classification classification, List<UUID> excludeTaxa, Integer limit, String pattern);
284

    
285
    /**
286
     * @param taxonUuid
287
     * @param classificationUuid
288
     * @param pageSize
289
     * @param pageIndex
290
     * @param propertyPaths
291
     * @return
292
     */
293
    List<TaxonNode> listSiblingsOfTaxon(UUID taxonUuid, UUID classificationUuid, Integer pageSize, Integer pageIndex,
294
            List<String> propertyPaths);
295

    
296
    /**
297
     * @param taxonUuid
298
     * @param classificationUuid
299
     * @param pageSize
300
     * @param pageIndex
301
     * @param propertyPaths
302
     * @return
303
     */
304
    Pager<TaxonNode> pageSiblingsOfTaxon(UUID taxonUuid, UUID classificationUuid, Integer pageSize, Integer pageIndex,
305
            List<String> propertyPaths);
306

    
307
    /**
308
     * @param classification
309
     * @return
310
     */
311
    ClassificationLookupDTO classificationLookup(Classification classification);
312

    
313
    DeleteResult delete(UUID classificationUuid, TaxonDeletionConfigurator config);
314

    
315

    
316
}
(30-30/97)