loadRankSpecificRootNodes() documentation
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / IClassificationService.java
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.model.common.UuidAndTitleCache;
19 import eu.etaxonomy.cdm.model.media.MediaRepresentation;
20 import eu.etaxonomy.cdm.model.name.Rank;
21 import eu.etaxonomy.cdm.model.taxon.ITreeNode;
22 import eu.etaxonomy.cdm.model.taxon.Taxon;
23 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
24 import eu.etaxonomy.cdm.model.taxon.Classification;
25 import eu.etaxonomy.cdm.persistence.query.OrderHint;
26
27
28 /**
29 * @author n.hoffmann
30 * @created Sep 21, 2009
31 * @version 1.0
32 */
33 public interface IClassificationService extends IIdentifiableEntityService<Classification> {
34
35 /**
36 *
37 * @param uuid
38 * @return
39 */
40 public TaxonNode getTaxonNodeByUuid(UUID uuid);
41
42 /**
43 *
44 * @param uuid
45 * @return
46 */
47 public ITreeNode getTreeNodeByUuid(UUID uuid);
48
49 /**
50 *
51 * @param limit
52 * @param start
53 * @param orderHints
54 * @param propertyPaths
55 * @return
56 */
57 public List<Classification> listClassifications(Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);
58
59 /**
60 *
61 * @param taxon
62 * @param classificationUuid
63 * @param propertyPaths
64 * @return
65 * @deprecated use loadTaxonNode(TaxonNode taxonNode, ...) instead
66 * if you have a classification and a taxon that is in it, you should also have the according taxonNode
67 */
68 public TaxonNode loadTaxonNodeByTaxon(Taxon taxon, UUID classificationUuid, List<String> propertyPaths);
69
70 /**
71 *
72 * @param taxonNode
73 * @param propertyPaths
74 * @return
75 * @deprecated use TaxonNodeService instead
76 */
77 public TaxonNode loadTaxonNode(TaxonNode taxonNode, List<String> propertyPaths);
78
79 /**
80 * Loads all TaxonNodes of the specified classification for a given Rank or lower.
81 * If a branch of the classification tree is not containing a TaxonNode with a Taxon at the given
82 * Rank the according node associated with the next lower Rank is taken as root node in this case.
83 * So the nodes returned may reference Taxa with different Ranks.
84 *
85 * If the <code>rank</code> is null the absolute root nodes will be returned.
86 *
87 * @param classification may be null for all classifications
88 * @param rank the set to null for to get the root nodes of classifications
89 * @param propertyPaths
90 * @return
91 */
92 public List<TaxonNode> loadRankSpecificRootNodes(Classification classification, Rank rank, List<String> propertyPaths);
93
94 /**
95 * @param taxonNode
96 * @param baseRank
97 * specifies the root level of the classification, may be null.
98 * Nodes of this rank or in case this rank does not exist in the
99 * current branch the next lower rank is taken as root node for
100 * this rank henceforth called the <b>base node</b>.
101 * @param propertyPaths
102 * the initialization strategy for the returned TaxonNode
103 * instances.
104 * @return the path of nodes from the <b>base node</b> to the node of the
105 * specified taxon.
106 */
107 public List<TaxonNode> loadTreeBranch(TaxonNode taxonNode, Rank baseRank, List<String> propertyPaths);
108
109 /**
110 * Although this method seems to be a redundant alternative to {@link #loadChildNodesOfTaxonNode(TaxonNode, List)} it is an important
111 * alternative from which web services benefit. Without this method the web service controller method, which operates outside of the
112 * transaction, would have to initialize the full taxon tree with all nodes of the taxon.
113 * This would be rather slow compared to using this method.
114 * @param taxon
115 * @param classification
116 * the classification to be used
117 * @param baseRank
118 * specifies the root level of the classification, may be null.
119 * Nodes of this rank or in case this rank does not exist in the
120 * current branch the next lower rank is taken as as root node for
121 * this rank henceforth called the <b>base node</b>.
122 * @param propertyPaths
123 * the initialization strategy for the returned TaxonNode
124 * instances.
125 * @return the path of nodes from the <b>base node</b> to the node of the specified
126 * taxon.
127 */
128 public List<TaxonNode> loadTreeBranchToTaxon(Taxon taxon, Classification classification, Rank baseRank, List<String> propertyPaths);
129
130
131
132 /**
133 * Although this method seems to be a redundant alternative to {@link #loadChildNodesOfTaxonNode(TaxonNode, List)} it is an important
134 * alternative from which web services benefit. Without this method the web service controller method, which operates outside of the
135 * transaction, would have to initialize the full taxon tree with all nodes of the taxon.
136 * This would be rather slow compared to using this method.
137 * @param taxon
138 * @param classification
139 * @param propertyPaths
140 * @return
141 */
142 public List<TaxonNode> loadChildNodesOfTaxon(Taxon taxon, Classification classification, List<String> propertyPaths);
143
144 /**
145 * @param taxonNode
146 * @param propertyPaths
147 * @deprecated move to TaxonNodeService
148 * @return
149 */
150 public List<TaxonNode> loadChildNodesOfTaxonNode(TaxonNode taxonNode, List<String> propertyPaths);
151
152 /**
153 *
154 * @param classification
155 * @return
156 */
157 public List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification);
158
159 /**
160 * @param taxon
161 * @param taxTree
162 * @param propertyPaths
163 * @param size
164 * @param height
165 * @param widthOrDuration
166 * @param mimeTypes
167 * @return
168 * @deprecated use getAllMediaForChildNodes(TaxonNode taxonNode, ...) instead
169 * if you have a classification and a taxon that is in it, you should also have the according taxonNode
170 */
171 public Map<UUID, List<MediaRepresentation>> getAllMediaForChildNodes(Taxon taxon, Classification taxTree, List<String> propertyPaths, int size, int height, int widthOrDuration, String[] mimeTypes);
172
173 /**
174 *
175 * @param taxonNode
176 * @param propertyPaths
177 * @param size
178 * @param height
179 * @param widthOrDuration
180 * @param mimeTypes
181 * @return
182 */
183 public Map<UUID, List<MediaRepresentation>> getAllMediaForChildNodes(TaxonNode taxonNode, List<String> propertyPaths, int size, int height, int widthOrDuration, String[] mimeTypes);
184
185 /**
186 *
187 * @param taxonNode
188 * @return
189 * @deprecated use TaxonNodeService instead
190 */
191 public UUID removeTaxonNode(TaxonNode taxonNode);
192
193 /**
194 *
195 * @param taxonNode
196 * @return
197 * @deprecated use TaxonNodeService instead
198 */
199 public UUID saveTaxonNode(TaxonNode taxonNode);
200
201 /**
202 *
203 * @param taxonNodeCollection
204 * @return
205 * @deprecated use TaxonNodeService instead
206 */
207 public Map<UUID, TaxonNode> saveTaxonNodeAll(Collection<TaxonNode> taxonNodeCollection);
208
209 /**
210 *
211 * @param treeNode
212 * @return
213 */
214 public UUID removeTreeNode(ITreeNode treeNode);
215
216 /**
217 *
218 * @param treeNode
219 * @return
220 */
221 public UUID saveTreeNode(ITreeNode treeNode);
222
223
224 public List<TaxonNode> getAllNodes();
225
226
227 }