3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.cdm
.api
.service
;
13 import java
.util
.Collection
;
14 import java
.util
.List
;
16 import java
.util
.UUID
;
18 import eu
.etaxonomy
.cdm
.api
.service
.pager
.Pager
;
19 import eu
.etaxonomy
.cdm
.model
.common
.UuidAndTitleCache
;
20 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentation
;
21 import eu
.etaxonomy
.cdm
.model
.name
.Rank
;
22 import eu
.etaxonomy
.cdm
.model
.taxon
.Classification
;
23 import eu
.etaxonomy
.cdm
.model
.taxon
.ITaxonTreeNode
;
24 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
25 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
26 import eu
.etaxonomy
.cdm
.persistence
.query
.OrderHint
;
31 * @created Sep 21, 2009
33 public interface IClassificationService
extends IIdentifiableEntityService
<Classification
> {
40 public TaxonNode
getTaxonNodeByUuid(UUID uuid
);
47 public ITaxonTreeNode
getTreeNodeByUuid(UUID uuid
);
54 * @param propertyPaths
57 public List
<Classification
> listClassifications(Integer limit
, Integer start
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
62 * @param classificationUuid
63 * @param propertyPaths
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
69 public TaxonNode
loadTaxonNodeByTaxon(Taxon taxon
, UUID classificationUuid
, List
<String
> propertyPaths
);
74 * @param propertyPaths
76 * @deprecated use TaxonNodeService instead
79 public TaxonNode
loadTaxonNode(TaxonNode taxonNode
, List
<String
> propertyPaths
);
82 * Loads all TaxonNodes of the specified classification for a given Rank or lower.
83 * If a branch of the classification tree is not containing a TaxonNode with a Taxon at the given
84 * Rank the according node associated with the next lower Rank is taken as root node in this case.
85 * So the nodes returned may reference Taxa with different Ranks.
87 * If the <code>rank</code> is null the absolute root nodes will be returned.
89 * @param classification may be null for all classifications
90 * @param rank the set to null for to get the root nodes of classifications
91 * @param limit The maximum number of objects returned (can be null for all matching objects)
92 * @param start The offset from the start of the result set (0 - based, can be null -
93 * equivalent of starting at the beginning of the recordset)
94 * @param propertyPaths
96 * @deprecated use {@link #listRankSpecificRootNodes(Classification, Rank, Integer, Integer, List)} instead
99 public List
<TaxonNode
> loadRankSpecificRootNodes(Classification classification
, Rank rank
, Integer limit
, Integer start
, List
<String
> propertyPaths
);
103 * Loads all TaxonNodes of the specified classification for a given Rank or lower.
104 * If a branch of the classification tree is not containing a TaxonNode with a Taxon at the given
105 * Rank the according node associated with the next lower Rank is taken as root node in this case.
106 * So the nodes returned may reference Taxa with different Ranks.
108 * If the <code>rank</code> is null the absolute root nodes will be returned.
110 * @param classification may be null for all classifications
111 * @param rank the set to null for to get the root nodes of classifications
112 * @param pageSize The maximum number of relationships returned (can be null for all relationships)
113 * @param pageIndex The offset (in pageSize chunks) from the start of the result set (0 - based)
114 * @param propertyPaths
118 public List
<TaxonNode
> listRankSpecificRootNodes(Classification classification
, Rank rank
, Integer pageSize
, Integer pageIndex
, List
<String
> propertyPaths
);
122 * Loads all TaxonNodes of the specified classification for a given Rank or lower.
123 * If a branch of the classification tree is not containing a TaxonNode with a Taxon at the given
124 * Rank the according node associated with the next lower Rank is taken as root node in this case.
125 * So the nodes returned may reference Taxa with different Ranks.
127 * If the <code>rank</code> is null the absolute root nodes will be returned.
129 * @param classification may be null for all classifications
130 * @param rank the set to null for to get the root nodes of classifications
131 * @param pageSize The maximum number of relationships returned (can be null for all relationships)
132 * @param pageIndex The offset (in pageSize chunks) from the start of the result set (0 - based)
133 * @param propertyPaths
137 public Pager
<TaxonNode
> pageRankSpecificRootNodes(Classification classification
, Rank rank
, Integer pageSize
, Integer pageIndex
, List
<String
> propertyPaths
);
142 * specifies the root level of the classification, may be null.
143 * Nodes of this rank or in case this rank does not exist in the
144 * current branch the next lower rank is taken as root node for
145 * this rank henceforth called the <b>base node</b>.
146 * @param propertyPaths
147 * the initialization strategy for the returned TaxonNode
149 * @return the path of nodes from the <b>base node</b> to the node of the
152 public List
<TaxonNode
> loadTreeBranch(TaxonNode taxonNode
, Rank baseRank
, List
<String
> propertyPaths
);
155 * Although this method seems to be a redundant alternative to {@link #loadChildNodesOfTaxonNode(TaxonNode, List)} it is an important
156 * alternative from which web services benefit. Without this method the web service controller method, which operates outside of the
157 * transaction, would have to initialize the full taxon tree with all nodes of the taxon.
158 * This would be rather slow compared to using this method.
160 * @param classification
161 * the classification to be used
163 * specifies the root level of the classification, may be null.
164 * Nodes of this rank or in case this rank does not exist in the
165 * current branch the next lower rank is taken as as root node for
166 * this rank henceforth called the <b>base node</b>.
167 * @param propertyPaths
168 * the initialization strategy for the returned TaxonNode
170 * @return the path of nodes from the <b>base node</b> to the node of the specified
173 public List
<TaxonNode
> loadTreeBranchToTaxon(Taxon taxon
, Classification classification
, Rank baseRank
, List
<String
> propertyPaths
);
179 * @param classificationUuid
180 * @param propertyPaths
183 public List
<TaxonNode
> listChildNodesOfTaxon(UUID taxonUuid
, UUID classificationUuid
, Integer pageSize
, Integer pageIndex
, List
<String
> propertyPaths
);
187 * @param propertyPaths
188 * @deprecated move to TaxonNodeService
192 public List
<TaxonNode
> loadChildNodesOfTaxonNode(TaxonNode taxonNode
, List
<String
> propertyPaths
);
196 * @param classification
199 public List
<UuidAndTitleCache
<TaxonNode
>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification
);
204 * @param propertyPaths
207 * @param widthOrDuration
211 * @deprecated use getAllMediaForChildNodes(TaxonNode taxonNode, ...) instead
212 * if you have a classification and a taxon that is in it, you should also have the according taxonNode
215 public Map
<UUID
, List
<MediaRepresentation
>> getAllMediaForChildNodes(Taxon taxon
, Classification taxTree
, List
<String
> propertyPaths
, int size
, int height
, int widthOrDuration
, String
[] mimeTypes
);
220 * @param propertyPaths
223 * @param widthOrDuration
227 public Map
<UUID
, List
<MediaRepresentation
>> getAllMediaForChildNodes(TaxonNode taxonNode
, List
<String
> propertyPaths
, int size
, int height
, int widthOrDuration
, String
[] mimeTypes
);
233 * @deprecated use TaxonNodeService instead
236 public UUID
removeTaxonNode(TaxonNode taxonNode
);
242 * @deprecated use TaxonNodeService instead
245 public UUID
saveTaxonNode(TaxonNode taxonNode
);
249 * @param taxonNodeCollection
251 * @deprecated use TaxonNodeService instead
254 public Map
<UUID
, TaxonNode
> saveTaxonNodeAll(Collection
<TaxonNode
> taxonNodeCollection
);
261 public UUID
removeTreeNode(ITaxonTreeNode treeNode
);
268 public UUID
saveTreeNode(ITaxonTreeNode treeNode
);
271 public List
<TaxonNode
> getAllNodes();