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
.pager
.Pager
;
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
.dto
.UuidAndTitleCache
;
27 import eu
.etaxonomy
.cdm
.persistence
.query
.OrderHint
;
32 * @created Sep 21, 2009
34 public interface IClassificationService
extends IIdentifiableEntityService
<Classification
> {
41 public TaxonNode
getTaxonNodeByUuid(UUID uuid
);
48 public ITaxonTreeNode
getTreeNodeByUuid(UUID uuid
);
55 * @param propertyPaths
58 public List
<Classification
> listClassifications(Integer limit
, Integer start
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
63 * @param classificationUuid
64 * @param propertyPaths
66 * @deprecated use loadTaxonNode(TaxonNode taxonNode, ...) instead
67 * if you have a classification and a taxon that is in it, you should also have the according taxonNode
70 public TaxonNode
loadTaxonNodeByTaxon(Taxon taxon
, UUID classificationUuid
, List
<String
> propertyPaths
);
75 * @param propertyPaths
77 * @deprecated use TaxonNodeService instead
80 public TaxonNode
loadTaxonNode(TaxonNode taxonNode
, List
<String
> propertyPaths
);
83 * Loads all TaxonNodes of the specified classification for a given Rank or lower.
84 * If a branch of the classification tree is not containing a TaxonNode with a Taxon at the given
85 * Rank the according node associated with the next lower Rank is taken as root node in this case.
86 * So the nodes returned may reference Taxa with different Ranks.
88 * If the <code>rank</code> is null the absolute root nodes will be returned.
90 * @param classification may be null for all classifications
91 * @param rank the set to null for to get the root nodes of classifications
92 * @param pageSize The maximum number of relationships returned (can be null for all relationships)
93 * @param pageIndex The offset (in pageSize chunks) from the start of the result set (0 - based)
94 * @param propertyPaths
98 public List
<TaxonNode
> listRankSpecificRootNodes(Classification classification
, Rank rank
, Integer pageSize
, Integer pageIndex
, List
<String
> propertyPaths
);
102 * Loads all TaxonNodes of the specified classification for a given Rank or lower.
103 * If a branch of the classification tree is not containing a TaxonNode with a Taxon at the given
104 * Rank the according node associated with the next lower Rank is taken as root node in this case.
105 * So the nodes returned may reference Taxa with different Ranks.
107 * If the <code>rank</code> is null the absolute root nodes will be returned.
109 * @param classification may be null for all classifications
110 * @param rank the set to null for to get the root nodes of classifications
111 * @param pageSize The maximum number of relationships returned (can be null for all relationships)
112 * @param pageIndex The offset (in pageSize chunks) from the start of the result set (0 - based)
113 * @param propertyPaths
117 public Pager
<TaxonNode
> pageRankSpecificRootNodes(Classification classification
, Rank rank
, Integer pageSize
, Integer pageIndex
, List
<String
> propertyPaths
);
122 * specifies the root level of the classification, may be null.
123 * Nodes of this rank or in case this rank does not exist in the
124 * current branch the next lower rank is taken as root node for
125 * this rank henceforth called the <b>base node</b>.
126 * @param propertyPaths
127 * the initialization strategy for the returned TaxonNode
129 * @return the path of nodes from the <b>base node</b> to the node of the
132 public List
<TaxonNode
> loadTreeBranch(TaxonNode taxonNode
, Rank baseRank
, List
<String
> propertyPaths
);
135 * Although this method seems to be a redundant alternative to {@link #loadChildNodesOfTaxonNode(TaxonNode, List)} it is an important
136 * alternative from which web services benefit. Without this method the web service controller method, which operates outside of the
137 * transaction, would have to initialize the full taxon tree with all nodes of the taxon.
138 * This would be rather slow compared to using this method.
140 * @param classification
141 * the classification to be used
143 * specifies the root level of the classification, may be null.
144 * Nodes of this rank or in case this rank does not exist in the
145 * current branch the next lower rank is taken as as root node for
146 * this rank henceforth called the <b>base node</b>.
147 * @param propertyPaths
148 * the initialization strategy for the returned TaxonNode
150 * @return the path of nodes from the <b>base node</b> to the node of the specified
153 public List
<TaxonNode
> loadTreeBranchToTaxon(Taxon taxon
, Classification classification
, Rank baseRank
, List
<String
> propertyPaths
);
159 * @param classificationUuid
160 * @param propertyPaths
163 public List
<TaxonNode
> listChildNodesOfTaxon(UUID taxonUuid
, UUID classificationUuid
, Integer pageSize
, Integer pageIndex
, List
<String
> propertyPaths
);
167 * @param propertyPaths
168 * @deprecated move to TaxonNodeService
172 public List
<TaxonNode
> loadChildNodesOfTaxonNode(TaxonNode taxonNode
, List
<String
> propertyPaths
);
176 * @param classification
179 public List
<UuidAndTitleCache
<TaxonNode
>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification
, List
<UUID
> excludeTaxa
);
184 * @param propertyPaths
187 * @param widthOrDuration
191 * @deprecated use getAllMediaForChildNodes(TaxonNode taxonNode, ...) instead
192 * if you have a classification and a taxon that is in it, you should also have the according taxonNode
195 public Map
<UUID
, List
<MediaRepresentation
>> getAllMediaForChildNodes(Taxon taxon
, Classification taxTree
, List
<String
> propertyPaths
, int size
, int height
, int widthOrDuration
, String
[] mimeTypes
);
200 * @param propertyPaths
203 * @param widthOrDuration
207 public Map
<UUID
, List
<MediaRepresentation
>> getAllMediaForChildNodes(TaxonNode taxonNode
, List
<String
> propertyPaths
, int size
, int height
, int widthOrDuration
, String
[] mimeTypes
);
213 * @deprecated use TaxonNodeService instead
216 public UUID
removeTaxonNode(TaxonNode taxonNode
);
222 * @deprecated use TaxonNodeService instead
225 public UUID
saveTaxonNode(TaxonNode taxonNode
);
229 * @param taxonNodeCollection
231 * @deprecated use TaxonNodeService instead
234 public Map
<UUID
, TaxonNode
> saveTaxonNodeAll(Collection
<TaxonNode
> taxonNodeCollection
);
242 public UUID
removeTreeNode(ITaxonTreeNode treeNode
);
249 public UUID
saveTreeNode(ITaxonTreeNode treeNode
);
252 public List
<TaxonNode
> getAllNodes();
254 public UpdateResult
createHierarchyInClassification(Classification classification
, CreateHierarchyForClassificationConfigurator configurator
);
257 * @param classificationUuid
261 public List
<UuidAndTitleCache
<TaxonNode
>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(UUID classificationUuid
, List
<UUID
> excludeTaxa
);
264 * @param classificationUuid
270 List
<UuidAndTitleCache
<TaxonNode
>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(
271 UUID classificationUuid
, List
<UUID
> excludeTaxa
, Integer limit
, String pattern
);
274 * @param classification
280 List
<UuidAndTitleCache
<TaxonNode
>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(
281 Classification classification
, List
<UUID
> excludeTaxa
, Integer limit
, String pattern
);