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
.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
;
30 * @created Sep 21, 2009
33 public interface IClassificationService
extends IIdentifiableEntityService
<Classification
> {
40 public TaxonNode
getTaxonNodeByUuid(UUID uuid
);
47 public ITreeNode
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
68 public TaxonNode
loadTaxonNodeByTaxon(Taxon taxon
, UUID classificationUuid
, List
<String
> propertyPaths
);
73 * @param propertyPaths
75 * @deprecated use TaxonNodeService instead
77 public TaxonNode
loadTaxonNode(TaxonNode taxonNode
, List
<String
> propertyPaths
);
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.
85 * If the <code>rank</code> is null the absolute root nodes will be returned.
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 limit The maximum number of objects returned (can be null for all matching objects)
90 * @param start The offset from the start of the result set (0 - based, can be null -
91 * equivalent of starting at the beginning of the recordset)
92 * @param propertyPaths
95 public List
<TaxonNode
> loadRankSpecificRootNodes(Classification classification
, Rank rank
, Integer limit
, Integer start
, List
<String
> propertyPaths
);
100 * specifies the root level of the classification, may be null.
101 * Nodes of this rank or in case this rank does not exist in the
102 * current branch the next lower rank is taken as root node for
103 * this rank henceforth called the <b>base node</b>.
104 * @param propertyPaths
105 * the initialization strategy for the returned TaxonNode
107 * @return the path of nodes from the <b>base node</b> to the node of the
110 public List
<TaxonNode
> loadTreeBranch(TaxonNode taxonNode
, Rank baseRank
, List
<String
> propertyPaths
);
113 * Although this method seems to be a redundant alternative to {@link #loadChildNodesOfTaxonNode(TaxonNode, List)} it is an important
114 * alternative from which web services benefit. Without this method the web service controller method, which operates outside of the
115 * transaction, would have to initialize the full taxon tree with all nodes of the taxon.
116 * This would be rather slow compared to using this method.
118 * @param classification
119 * the classification to be used
121 * specifies the root level of the classification, may be null.
122 * Nodes of this rank or in case this rank does not exist in the
123 * current branch the next lower rank is taken as as root node for
124 * this rank henceforth called the <b>base node</b>.
125 * @param propertyPaths
126 * the initialization strategy for the returned TaxonNode
128 * @return the path of nodes from the <b>base node</b> to the node of the specified
131 public List
<TaxonNode
> loadTreeBranchToTaxon(Taxon taxon
, Classification classification
, 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 * @param propertyPaths
145 public List
<TaxonNode
> loadChildNodesOfTaxon(Taxon taxon
, Classification classification
, List
<String
> propertyPaths
);
149 * @param propertyPaths
150 * @deprecated move to TaxonNodeService
153 public List
<TaxonNode
> loadChildNodesOfTaxonNode(TaxonNode taxonNode
, List
<String
> propertyPaths
);
157 * @param classification
160 public List
<UuidAndTitleCache
<TaxonNode
>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification
);
165 * @param propertyPaths
168 * @param widthOrDuration
171 * @deprecated use getAllMediaForChildNodes(TaxonNode taxonNode, ...) instead
172 * if you have a classification and a taxon that is in it, you should also have the according taxonNode
174 public Map
<UUID
, List
<MediaRepresentation
>> getAllMediaForChildNodes(Taxon taxon
, Classification taxTree
, List
<String
> propertyPaths
, int size
, int height
, int widthOrDuration
, String
[] mimeTypes
);
179 * @param propertyPaths
182 * @param widthOrDuration
186 public Map
<UUID
, List
<MediaRepresentation
>> getAllMediaForChildNodes(TaxonNode taxonNode
, List
<String
> propertyPaths
, int size
, int height
, int widthOrDuration
, String
[] mimeTypes
);
192 * @deprecated use TaxonNodeService instead
194 public UUID
removeTaxonNode(TaxonNode taxonNode
);
200 * @deprecated use TaxonNodeService instead
202 public UUID
saveTaxonNode(TaxonNode taxonNode
);
206 * @param taxonNodeCollection
208 * @deprecated use TaxonNodeService instead
210 public Map
<UUID
, TaxonNode
> saveTaxonNodeAll(Collection
<TaxonNode
> taxonNodeCollection
);
217 public UUID
removeTreeNode(ITreeNode treeNode
);
224 public UUID
saveTreeNode(ITreeNode treeNode
);
227 public List
<TaxonNode
> getAllNodes();