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 tree for a given Rank.
81 * If a branch does not contain a TaxonNode with a TaxonName at the given
82 * Rank the node associated with the next lower Rank is taken as root node.
83 * If the <code>rank</code> is null the absolute root nodes will be returned.
85 * @param classification
86 * @param rank may be null
87 * @param propertyPaths
90 public List
<TaxonNode
> loadRankSpecificRootNodes(Classification classification
, Rank rank
, List
<String
> propertyPaths
);
95 * specifies the root level of the classification, may be null.
96 * Nodes of this rank or in case this rank does not exist in the
97 * current branch the next lower rank is taken as root node for
98 * this rank henceforth called the <b>base node</b>.
99 * @param propertyPaths
100 * the initialization strategy for the returned TaxonNode
102 * @return the path of nodes from the <b>base node</b> to the node of the
105 public List
<TaxonNode
> loadTreeBranch(TaxonNode taxonNode
, Rank baseRank
, List
<String
> propertyPaths
);
108 * Although this method seems to be a redundant alternative to {@link #loadChildNodesOfTaxonNode(TaxonNode, List)} it is an important
109 * alternative from which web services benefit. Without this method the web service controller method, which operates outside of the
110 * transaction, would have to initialize the full taxon tree with all nodes of the taxon.
111 * This would be rather slow compared to using this method.
113 * @param classification
114 * the classification to be used
116 * specifies the root level of the classification, may be null.
117 * Nodes of this rank or in case this rank does not exist in the
118 * current branch the next lower rank is taken as as root node for
119 * this rank henceforth called the <b>base node</b>.
120 * @param propertyPaths
121 * the initialization strategy for the returned TaxonNode
123 * @return the path of nodes from the <b>base node</b> to the node of the specified
126 public List
<TaxonNode
> loadTreeBranchToTaxon(Taxon taxon
, Classification classification
, Rank baseRank
, List
<String
> propertyPaths
);
131 * Although this method seems to be a redundant alternative to {@link #loadChildNodesOfTaxonNode(TaxonNode, List)} it is an important
132 * alternative from which web services benefit. Without this method the web service controller method, which operates outside of the
133 * transaction, would have to initialize the full taxon tree with all nodes of the taxon.
134 * This would be rather slow compared to using this method.
136 * @param classification
137 * @param propertyPaths
140 public List
<TaxonNode
> loadChildNodesOfTaxon(Taxon taxon
, Classification classification
, List
<String
> propertyPaths
);
144 * @param propertyPaths
145 * @deprecated move to TaxonNodeService
148 public List
<TaxonNode
> loadChildNodesOfTaxonNode(TaxonNode taxonNode
, List
<String
> propertyPaths
);
152 * @param classification
155 public List
<UuidAndTitleCache
<TaxonNode
>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification
);
160 * @param propertyPaths
163 * @param widthOrDuration
166 * @deprecated use getAllMediaForChildNodes(TaxonNode taxonNode, ...) instead
167 * if you have a classification and a taxon that is in it, you should also have the according taxonNode
169 public Map
<UUID
, List
<MediaRepresentation
>> getAllMediaForChildNodes(Taxon taxon
, Classification taxTree
, List
<String
> propertyPaths
, int size
, int height
, int widthOrDuration
, String
[] mimeTypes
);
174 * @param propertyPaths
177 * @param widthOrDuration
181 public Map
<UUID
, List
<MediaRepresentation
>> getAllMediaForChildNodes(TaxonNode taxonNode
, List
<String
> propertyPaths
, int size
, int height
, int widthOrDuration
, String
[] mimeTypes
);
187 * @deprecated use TaxonNodeService instead
189 public UUID
removeTaxonNode(TaxonNode taxonNode
);
195 * @deprecated use TaxonNodeService instead
197 public UUID
saveTaxonNode(TaxonNode taxonNode
);
201 * @param taxonNodeCollection
203 * @deprecated use TaxonNodeService instead
205 public Map
<UUID
, TaxonNode
> saveTaxonNodeAll(Collection
<TaxonNode
> taxonNodeCollection
);
212 public UUID
removeTreeNode(ITreeNode treeNode
);
219 public UUID
saveTreeNode(ITreeNode treeNode
);
222 public List
<TaxonNode
> getAllNodes();