1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2007 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
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.
|
9
|
*/
|
10
|
|
11
|
package eu.etaxonomy.cdm.api.service;
|
12
|
|
13
|
import java.util.Collection;
|
14
|
import java.util.List;
|
15
|
import java.util.Set;
|
16
|
import java.util.UUID;
|
17
|
|
18
|
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
|
19
|
import eu.etaxonomy.cdm.api.service.pager.Pager;
|
20
|
import eu.etaxonomy.cdm.model.common.DefinedTerm;
|
21
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
22
|
import eu.etaxonomy.cdm.model.taxon.Classification;
|
23
|
import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
|
24
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
25
|
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
|
26
|
import eu.etaxonomy.cdm.model.taxon.TaxonNodeAgentRelation;
|
27
|
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
|
28
|
|
29
|
|
30
|
/**
|
31
|
* @author n.hoffmann
|
32
|
* @created Apr 9, 2010
|
33
|
* @version 1.0
|
34
|
*/
|
35
|
public interface ITaxonNodeService extends IAnnotatableService<TaxonNode>{
|
36
|
|
37
|
/**
|
38
|
*returns the childnodes of the taxonNode, if recursive is true it returns all descendants, if sort is true the nodes are sorted
|
39
|
*
|
40
|
* @param taxonNode
|
41
|
* @param propertyPaths
|
42
|
* @param recursive
|
43
|
* @return List<TaxonNode>
|
44
|
*/
|
45
|
public List<TaxonNode> loadChildNodesOfTaxonNode(TaxonNode taxonNode, List<String> propertyPaths, boolean recursive, NodeSortMode sortMode);
|
46
|
|
47
|
/**
|
48
|
*returns the childnodes of the taxonNode, if recursive is true it returns all descendants, if sort is true the nodes are sorted
|
49
|
*
|
50
|
* @param taxonNode
|
51
|
* @param recursive
|
52
|
* @param sortMode
|
53
|
* @param pageSize
|
54
|
* @param pageIndex
|
55
|
*
|
56
|
* @return List<TaxonNodeDto>
|
57
|
*/
|
58
|
public Pager<TaxonNodeDto> pageChildNodesDTOs(UUID taxonNodeUuid, boolean recursive, NodeSortMode sortMode, Integer pageSize, Integer pageIndex);
|
59
|
|
60
|
public TaxonNodeDto parentDto(UUID taxonNodeUuid);
|
61
|
|
62
|
/**
|
63
|
* Changes the taxon associated with the given taxon node into a synonym of the new accepted taxon node.
|
64
|
* All data associated with the former taxon are moved to the newly accepted taxon.
|
65
|
*
|
66
|
* @param oldTaxonNode
|
67
|
* @param newAcceptedTaxonNode
|
68
|
* @param synonymRelationshipType
|
69
|
* @param citation
|
70
|
* @param citationMicroReference
|
71
|
* @return
|
72
|
*
|
73
|
*/
|
74
|
public DeleteResult makeTaxonNodeASynonymOfAnotherTaxonNode(TaxonNode oldTaxonNode, TaxonNode newAcceptedTaxonNode, SynonymRelationshipType synonymRelationshipType, Reference citation, String citationMicroReference) ;
|
75
|
|
76
|
public UpdateResult makeTaxonNodeASynonymOfAnotherTaxonNode(UUID oldTaxonNodeUuid,
|
77
|
UUID newAcceptedTaxonNodeUUID,
|
78
|
SynonymRelationshipType synonymRelationshipType,
|
79
|
Reference citation,
|
80
|
String citationMicroReference) ;
|
81
|
|
82
|
|
83
|
/**
|
84
|
* @param nodeUuids
|
85
|
* @param config
|
86
|
* @return
|
87
|
*/
|
88
|
public DeleteResult deleteTaxonNodes(Collection<UUID> nodeUuids, TaxonDeletionConfigurator config);
|
89
|
|
90
|
/**
|
91
|
* deletes the given taxon node the configurator defines whether the children will be deleted too or not
|
92
|
*
|
93
|
* @param node
|
94
|
* @param conf
|
95
|
* @return
|
96
|
*
|
97
|
*/
|
98
|
public DeleteResult deleteTaxonNode(TaxonNode node, TaxonDeletionConfigurator config);
|
99
|
/**
|
100
|
* Returns a List of all TaxonNodes of a given Classification.
|
101
|
*
|
102
|
* @param classification - according to the given classification the TaxonNodes are filtered.
|
103
|
* @param start - beginning of wanted row set, i.e. 0 if one want to start from the beginning.
|
104
|
* @param end - limit of how many rows are to be pulled from the database, i.e. 1000 rows.
|
105
|
* @return filtered List of TaxonNode according to the classification provided
|
106
|
*/
|
107
|
|
108
|
/**
|
109
|
* @param nodeUuid
|
110
|
* @param config
|
111
|
* @return
|
112
|
*/
|
113
|
public DeleteResult deleteTaxonNode(UUID nodeUuid, TaxonDeletionConfigurator config);
|
114
|
|
115
|
public List<TaxonNode> listAllNodesForClassification(Classification classification, Integer start, Integer end);
|
116
|
|
117
|
/**
|
118
|
* Counts all TaxonNodes for a given Classification
|
119
|
*
|
120
|
* @param classification - according to the given classification the TaxonNodes are filtered.
|
121
|
* @return
|
122
|
*/
|
123
|
public int countAllNodesForClassification(Classification classification);
|
124
|
|
125
|
|
126
|
/**
|
127
|
* @param taxonNodeUuid
|
128
|
* @param newParentTaxonNodeUuid
|
129
|
* @return
|
130
|
*/
|
131
|
public UpdateResult moveTaxonNode(UUID taxonNodeUuid, UUID newParentTaxonNodeUuid, int movingType);
|
132
|
|
133
|
|
134
|
|
135
|
/**
|
136
|
* @param taxonNodeUuids
|
137
|
* @param newParentNodeUuid
|
138
|
* @return
|
139
|
*/
|
140
|
UpdateResult moveTaxonNodes(Set<UUID> taxonNodeUuids, UUID newParentNodeUuid, int movingType);
|
141
|
|
142
|
/**
|
143
|
* @param taxonNode
|
144
|
* @param newParent
|
145
|
* @param parent
|
146
|
* @return
|
147
|
*/
|
148
|
UpdateResult moveTaxonNode(TaxonNode taxonNode, TaxonNode newParent, int movingType);
|
149
|
|
150
|
/**
|
151
|
* deletes the given taxon nodes
|
152
|
*
|
153
|
* @param nodes
|
154
|
* @param config
|
155
|
* @return
|
156
|
*
|
157
|
*/
|
158
|
public DeleteResult deleteTaxonNodes(List<TaxonNode> list, TaxonDeletionConfigurator config);
|
159
|
|
160
|
/**
|
161
|
* Returns the of TaxonNodeAgentRelation entities which are associated with the TaxonNode for the
|
162
|
* given TaxonUuid in the specified Classification.
|
163
|
*
|
164
|
* @param taxonUuid
|
165
|
* @param agentUuid TODO
|
166
|
* @param rankUuid TODO
|
167
|
* @param relTypeUuid TODO
|
168
|
* @param classification
|
169
|
* @return
|
170
|
*/
|
171
|
public Pager<TaxonNodeAgentRelation> pageTaxonNodeAgentRelations(UUID taxonUuid, UUID classificationUuid,
|
172
|
UUID agentUuid, UUID rankUuid, UUID relTypeUuid, Integer pageSize, Integer pageIndex, List<String> propertyPaths);
|
173
|
|
174
|
/**
|
175
|
* @param parentNodeUuid
|
176
|
* @param newTaxon
|
177
|
* @param ref
|
178
|
* @param microref
|
179
|
* @return
|
180
|
*/
|
181
|
public UpdateResult createNewTaxonNode(UUID parentNodeUuid, Taxon newTaxon, Reference ref, String microref);
|
182
|
|
183
|
/**
|
184
|
* @param taxonNodeUUID
|
185
|
* @param agentUUID
|
186
|
* @param relationshipType
|
187
|
* @return
|
188
|
*/
|
189
|
UpdateResult addTaxonNodeAgentRelation(UUID taxonNodeUUID, UUID agentUUID, DefinedTerm relationshipType);
|
190
|
|
191
|
|
192
|
}
|