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
);
64 public Classification
getClassificationByUuid(UUID uuid
);
69 * @param classificationUuid
70 * @param propertyPaths
72 * @deprecated use loadTaxonNode(TaxonNode taxonNode, ...) instead
73 * if you have a classification and a taxon that is in it, you should also have the according taxonNode
75 public TaxonNode
loadTaxonNodeByTaxon(Taxon taxon
, UUID classificationUuid
, List
<String
> propertyPaths
);
80 * @param propertyPaths
82 * @deprecated use TaxonNodeService instead
84 public TaxonNode
loadTaxonNode(TaxonNode taxonNode
, List
<String
> propertyPaths
);
87 * Loads all TaxonNodes of the specified tree for a given Rank.
88 * If a branch does not contain a TaxonNode with a TaxonName at the given
89 * Rank the node associated with the next lower Rank is taken as root node.
90 * If the <code>rank</code> is null the absolute root nodes will be returned.
92 * @param classification
93 * @param rank may be null
94 * @param propertyPaths
97 public List
<TaxonNode
> loadRankSpecificRootNodes(Classification classification
, Rank rank
, List
<String
> propertyPaths
);
102 * specifies the root level of the classification, may be null.
103 * Nodes of this rank or in case this rank does not exist in the
104 * current branch the next lower rank is taken as root node for
105 * this rank henceforth called the <b>base node</b>.
106 * @param propertyPaths
107 * the initialization strategy for the returned TaxonNode
109 * @return the path of nodes from the <b>base node</b> to the node of the
112 public List
<TaxonNode
> loadTreeBranch(TaxonNode taxonNode
, Rank baseRank
, List
<String
> propertyPaths
);
115 * Although this method seems to be a redundant alternative to {@link #loadChildNodesOfTaxonNode(TaxonNode, List)} it is an important
116 * alternative from which web services benefit. Without this method the web service controller method, which operates outside of the
117 * transaction, would have to initialize the full taxon tree with all nodes of the taxon.
118 * This would be rather slow compared to using this method.
120 * @param classification
121 * the classification to be used
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 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 specified
133 public List
<TaxonNode
> loadTreeBranchToTaxon(Taxon taxon
, Classification classification
, Rank baseRank
, List
<String
> propertyPaths
);
138 * Although this method seems to be a redundant alternative to {@link #loadChildNodesOfTaxonNode(TaxonNode, List)} it is an important
139 * alternative from which web services benefit. Without this method the web service controller method, which operates outside of the
140 * transaction, would have to initialize the full taxon tree with all nodes of the taxon.
141 * This would be rather slow compared to using this method.
143 * @param classification
144 * @param propertyPaths
147 public List
<TaxonNode
> loadChildNodesOfTaxon(Taxon taxon
, Classification classification
, List
<String
> propertyPaths
);
151 * @param propertyPaths
152 * @deprecated move to TaxonNodeService
155 public List
<TaxonNode
> loadChildNodesOfTaxonNode(TaxonNode taxonNode
, List
<String
> propertyPaths
);
159 * @param classification
162 public List
<UuidAndTitleCache
<TaxonNode
>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification
);
167 * @param propertyPaths
170 * @param widthOrDuration
173 * @deprecated use getAllMediaForChildNodes(TaxonNode taxonNode, ...) instead
174 * if you have a classification and a taxon that is in it, you should also have the according taxonNode
176 public Map
<UUID
, List
<MediaRepresentation
>> getAllMediaForChildNodes(Taxon taxon
, Classification taxTree
, List
<String
> propertyPaths
, int size
, int height
, int widthOrDuration
, String
[] mimeTypes
);
181 * @param propertyPaths
184 * @param widthOrDuration
188 public Map
<UUID
, List
<MediaRepresentation
>> getAllMediaForChildNodes(TaxonNode taxonNode
, List
<String
> propertyPaths
, int size
, int height
, int widthOrDuration
, String
[] mimeTypes
);
194 * @deprecated use TaxonNodeService instead
196 public UUID
removeTaxonNode(TaxonNode taxonNode
);
202 * @deprecated use TaxonNodeService instead
204 public UUID
saveTaxonNode(TaxonNode taxonNode
);
208 * @param taxonNodeCollection
210 * @deprecated use TaxonNodeService instead
212 public Map
<UUID
, TaxonNode
> saveTaxonNodeAll(Collection
<TaxonNode
> taxonNodeCollection
);
219 public UUID
removeTreeNode(ITreeNode treeNode
);
226 public UUID
saveTreeNode(ITreeNode treeNode
);
229 public List
<TaxonNode
> getAllNodes();