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
.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
;
34 * @created Sep 21, 2009
36 public interface IClassificationService
extends IIdentifiableEntityService
<Classification
> {
43 public TaxonNode
getTaxonNodeByUuid(UUID uuid
);
50 public ITaxonTreeNode
getTreeNodeByUuid(UUID uuid
);
57 * @param propertyPaths
60 public List
<Classification
> listClassifications(Integer limit
, Integer start
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
65 * @param classificationUuid
66 * @param propertyPaths
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
72 public TaxonNode
loadTaxonNodeByTaxon(Taxon taxon
, UUID classificationUuid
, List
<String
> propertyPaths
);
77 * @param propertyPaths
79 * @deprecated use TaxonNodeService instead
82 public TaxonNode
loadTaxonNode(TaxonNode taxonNode
, List
<String
> propertyPaths
);
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.
90 * If the <code>rank</code> is null the absolute root nodes will be returned.
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
100 public List
<TaxonNode
> listRankSpecificRootNodes(Classification classification
, Rank rank
, Integer pageSize
, Integer pageIndex
, List
<String
> propertyPaths
);
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.
109 * If the <code>rank</code> is null the absolute root nodes will be returned.
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
119 public Pager
<TaxonNode
> pageRankSpecificRootNodes(Classification classification
, Rank rank
, Integer pageSize
, Integer pageIndex
, List
<String
> propertyPaths
);
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
131 * @return the path of nodes from the <b>base node</b> to the node of the
134 public List
<TaxonNode
> loadTreeBranch(TaxonNode taxonNode
, Rank baseRank
, List
<String
> propertyPaths
);
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.
142 * @param classification
143 * the classification to be used
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
152 * @return the path of nodes from the <b>base node</b> to the node of the specified
155 public List
<TaxonNode
> loadTreeBranchToTaxon(Taxon taxon
, Classification classification
, Rank baseRank
, List
<String
> propertyPaths
);
161 * @param classificationUuid
162 * @param propertyPaths
165 public List
<TaxonNode
> listChildNodesOfTaxon(UUID taxonUuid
, UUID classificationUuid
, Integer pageSize
, Integer pageIndex
, List
<String
> propertyPaths
);
169 * @param propertyPaths
170 * @deprecated move to TaxonNodeService
174 public List
<TaxonNode
> loadChildNodesOfTaxonNode(TaxonNode taxonNode
, List
<String
> propertyPaths
);
178 * @param classification
181 public List
<UuidAndTitleCache
<TaxonNode
>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification
, List
<UUID
> excludeTaxa
);
186 * @param propertyPaths
189 * @param widthOrDuration
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
197 public Map
<UUID
, List
<MediaRepresentation
>> getAllMediaForChildNodes(Taxon taxon
, Classification taxTree
, List
<String
> propertyPaths
, int size
, int height
, int widthOrDuration
, String
[] mimeTypes
);
202 * @param propertyPaths
205 * @param widthOrDuration
209 public Map
<UUID
, List
<MediaRepresentation
>> getAllMediaForChildNodes(TaxonNode taxonNode
, List
<String
> propertyPaths
, int size
, int height
, int widthOrDuration
, String
[] mimeTypes
);
215 * @deprecated use TaxonNodeService instead
218 public UUID
removeTaxonNode(TaxonNode taxonNode
);
224 * @deprecated use TaxonNodeService instead
227 public UUID
saveTaxonNode(TaxonNode taxonNode
);
231 * @param taxonNodeCollection
233 * @deprecated use TaxonNodeService instead
236 public Map
<UUID
, TaxonNode
> saveTaxonNodeAll(Collection
<TaxonNode
> taxonNodeCollection
);
244 public UUID
removeTreeNode(ITaxonTreeNode treeNode
);
251 public UUID
saveTreeNode(ITaxonTreeNode treeNode
);
254 public List
<TaxonNode
> getAllNodes();
256 public UpdateResult
createHierarchyInClassification(Classification classification
, CreateHierarchyForClassificationConfigurator configurator
);
259 * @param classificationUuid
263 public List
<UuidAndTitleCache
<TaxonNode
>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(UUID classificationUuid
, List
<UUID
> excludeTaxa
);
266 * @param classificationUuid
272 List
<UuidAndTitleCache
<TaxonNode
>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(
273 UUID classificationUuid
, List
<UUID
> excludeTaxa
, Integer limit
, String pattern
);
276 * @param classification
282 List
<UuidAndTitleCache
<TaxonNode
>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(
283 Classification classification
, List
<UUID
> excludeTaxa
, Integer limit
, String pattern
);
287 * @param classificationUuid
290 * @param propertyPaths
293 List
<TaxonNode
> listSiblingsOfTaxon(UUID taxonUuid
, UUID classificationUuid
, Integer pageSize
, Integer pageIndex
,
294 List
<String
> propertyPaths
);
298 * @param classificationUuid
301 * @param propertyPaths
304 Pager
<TaxonNode
> pageSiblingsOfTaxon(UUID taxonUuid
, UUID classificationUuid
, Integer pageSize
, Integer pageIndex
,
305 List
<String
> propertyPaths
);
308 * @param classification
311 ClassificationLookupDTO
classificationLookup(Classification classification
);
313 DeleteResult
delete(UUID classificationUuid
, TaxonDeletionConfigurator config
);