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
.ClassificationLookupDTO
;
27 import eu
.etaxonomy
.cdm
.persistence
.dto
.UuidAndTitleCache
;
28 import eu
.etaxonomy
.cdm
.persistence
.query
.OrderHint
;
33 * @created Sep 21, 2009
35 public interface IClassificationService
extends IIdentifiableEntityService
<Classification
> {
42 public TaxonNode
getTaxonNodeByUuid(UUID uuid
);
49 public ITaxonTreeNode
getTreeNodeByUuid(UUID uuid
);
56 * @param propertyPaths
59 public List
<Classification
> listClassifications(Integer limit
, Integer start
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
64 * @param classificationUuid
65 * @param propertyPaths
67 * @deprecated use loadTaxonNode(TaxonNode taxonNode, ...) instead
68 * if you have a classification and a taxon that is in it, you should also have the according taxonNode
71 public TaxonNode
loadTaxonNodeByTaxon(Taxon taxon
, UUID classificationUuid
, List
<String
> propertyPaths
);
76 * @param propertyPaths
78 * @deprecated use TaxonNodeService instead
81 public TaxonNode
loadTaxonNode(TaxonNode taxonNode
, List
<String
> propertyPaths
);
84 * Loads all TaxonNodes of the specified classification for a given Rank or lower.
85 * If a branch of the classification tree is not containing a TaxonNode with a Taxon at the given
86 * Rank the according node associated with the next lower Rank is taken as root node in this case.
87 * So the nodes returned may reference Taxa with different Ranks.
89 * If the <code>rank</code> is null the absolute root nodes will be returned.
91 * @param classification may be null for all classifications
92 * @param rank the set to null for to get the root nodes of classifications
93 * @param pageSize The maximum number of relationships returned (can be null for all relationships)
94 * @param pageIndex The offset (in pageSize chunks) from the start of the result set (0 - based)
95 * @param propertyPaths
99 public List
<TaxonNode
> listRankSpecificRootNodes(Classification classification
, Rank rank
, Integer pageSize
, Integer pageIndex
, 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 Pager
<TaxonNode
> pageRankSpecificRootNodes(Classification classification
, Rank rank
, Integer pageSize
, Integer pageIndex
, List
<String
> propertyPaths
);
123 * specifies the root level of the classification, may be null.
124 * Nodes of this rank or in case this rank does not exist in the
125 * current branch the next lower rank is taken as root node for
126 * this rank henceforth called the <b>base node</b>.
127 * @param propertyPaths
128 * the initialization strategy for the returned TaxonNode
130 * @return the path of nodes from the <b>base node</b> to the node of the
133 public List
<TaxonNode
> loadTreeBranch(TaxonNode taxonNode
, Rank baseRank
, List
<String
> propertyPaths
);
136 * Although this method seems to be a redundant alternative to {@link #loadChildNodesOfTaxonNode(TaxonNode, List)} it is an important
137 * alternative from which web services benefit. Without this method the web service controller method, which operates outside of the
138 * transaction, would have to initialize the full taxon tree with all nodes of the taxon.
139 * This would be rather slow compared to using this method.
141 * @param classification
142 * the classification to be used
144 * specifies the root level of the classification, may be null.
145 * Nodes of this rank or in case this rank does not exist in the
146 * current branch the next lower rank is taken as as root node for
147 * this rank henceforth called the <b>base node</b>.
148 * @param propertyPaths
149 * the initialization strategy for the returned TaxonNode
151 * @return the path of nodes from the <b>base node</b> to the node of the specified
154 public List
<TaxonNode
> loadTreeBranchToTaxon(Taxon taxon
, Classification classification
, Rank baseRank
, List
<String
> propertyPaths
);
160 * @param classificationUuid
161 * @param propertyPaths
164 public List
<TaxonNode
> listChildNodesOfTaxon(UUID taxonUuid
, UUID classificationUuid
, Integer pageSize
, Integer pageIndex
, List
<String
> propertyPaths
);
168 * @param propertyPaths
169 * @deprecated move to TaxonNodeService
173 public List
<TaxonNode
> loadChildNodesOfTaxonNode(TaxonNode taxonNode
, List
<String
> propertyPaths
);
177 * @param classification
180 public List
<UuidAndTitleCache
<TaxonNode
>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification
, List
<UUID
> excludeTaxa
);
185 * @param propertyPaths
188 * @param widthOrDuration
192 * @deprecated use getAllMediaForChildNodes(TaxonNode taxonNode, ...) instead
193 * if you have a classification and a taxon that is in it, you should also have the according taxonNode
196 public Map
<UUID
, List
<MediaRepresentation
>> getAllMediaForChildNodes(Taxon taxon
, Classification taxTree
, List
<String
> propertyPaths
, int size
, int height
, int widthOrDuration
, String
[] mimeTypes
);
201 * @param propertyPaths
204 * @param widthOrDuration
208 public Map
<UUID
, List
<MediaRepresentation
>> getAllMediaForChildNodes(TaxonNode taxonNode
, List
<String
> propertyPaths
, int size
, int height
, int widthOrDuration
, String
[] mimeTypes
);
214 * @deprecated use TaxonNodeService instead
217 public UUID
removeTaxonNode(TaxonNode taxonNode
);
223 * @deprecated use TaxonNodeService instead
226 public UUID
saveTaxonNode(TaxonNode taxonNode
);
230 * @param taxonNodeCollection
232 * @deprecated use TaxonNodeService instead
235 public Map
<UUID
, TaxonNode
> saveTaxonNodeAll(Collection
<TaxonNode
> taxonNodeCollection
);
243 public UUID
removeTreeNode(ITaxonTreeNode treeNode
);
250 public UUID
saveTreeNode(ITaxonTreeNode treeNode
);
253 public List
<TaxonNode
> getAllNodes();
255 public UpdateResult
createHierarchyInClassification(Classification classification
, CreateHierarchyForClassificationConfigurator configurator
);
258 * @param classificationUuid
262 public List
<UuidAndTitleCache
<TaxonNode
>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(UUID classificationUuid
, List
<UUID
> excludeTaxa
);
265 * @param classificationUuid
271 List
<UuidAndTitleCache
<TaxonNode
>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(
272 UUID classificationUuid
, List
<UUID
> excludeTaxa
, Integer limit
, String pattern
);
275 * @param classification
281 List
<UuidAndTitleCache
<TaxonNode
>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(
282 Classification classification
, List
<UUID
> excludeTaxa
, Integer limit
, String pattern
);
286 * @param classificationUuid
289 * @param propertyPaths
292 List
<TaxonNode
> listSiblingsOfTaxon(UUID taxonUuid
, UUID classificationUuid
, Integer pageSize
, Integer pageIndex
,
293 List
<String
> propertyPaths
);
297 * @param classificationUuid
300 * @param propertyPaths
303 Pager
<TaxonNode
> pageSiblingsOfTaxon(UUID taxonUuid
, UUID classificationUuid
, Integer pageSize
, Integer pageIndex
,
304 List
<String
> propertyPaths
);