ref #6794 add TermNodeService and TermTreeService and make FeatureXXX services deprecated
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / ITermNodeService.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9
10 package eu.etaxonomy.cdm.api.service;
11
12 import java.util.List;
13 import java.util.UUID;
14
15 import eu.etaxonomy.cdm.api.service.config.TermNodeDeletionConfigurator;
16 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
17 import eu.etaxonomy.cdm.model.term.TermNode;
18 import eu.etaxonomy.cdm.model.term.TermType;
19 import eu.etaxonomy.cdm.persistence.query.OrderHint;
20
21 /**
22 * @author n.hoffmann
23 * @since Aug 5, 2010
24 */
25 public interface ITermNodeService extends IVersionableService<TermNode>{
26
27 public List<TermNode> list(TermType termType, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);
28
29 public DeleteResult isDeletable(UUID nodeUuid, TermNodeDeletionConfigurator config);
30
31 public DeleteResult deleteNode(UUID nodeUuid, TermNodeDeletionConfigurator config);
32
33
34 /**
35 * <b>Saves</b> and adds the specified term as a child node to the given term node.
36 * @see ITermNodeService#addChildNode(TermNode, DefinedTermBase)
37 * @param parentNodeUuid the term node to which the new term should be added
38 * @param term the term which should be <b>saved</b> and added to the given term node
39 * @param vocabularyUuid the UUID of the vocabulary where the term should be saved
40 * @return the result of the operation
41 */
42 public UpdateResult createChildNode(UUID parentNodeUuid, DefinedTermBase term, UUID vocabularyUuid);
43
44 /**
45 * Adds the specified term as a child node to the given term node
46 * @param parentNodeUUID the UUID of the term node to which the new term should be added
47 * @param termChildUuid the UUID of the term which should be added to the given term node
48 * @return the result of the operation
49 */
50 public UpdateResult addChildNode(UUID parentNodeUUID, UUID termChildUuid);
51
52 /**
53 * Adds the specified term as a child node to the given term node at the given position
54 * @param parentNodeUUID the UUID of the term node to which the new term should be added
55 * @param termChildUuid the UUID of the term which should be added to the given term node
56 * @param position the position where the child node should be added
57 * @return the result of the operation
58 */
59 public UpdateResult addChildNode(UUID parentNodeUUID, UUID termChildUuid, int position);
60
61 /**
62 * Moves a given {@link TermNode} to the target node at the given position;
63 * @param movedNodeUuid the node to move
64 * @param targetNodeUuid the target node
65 * @param position the position in the list of children of the target node
66 * @return the result of the operation
67 */
68 public UpdateResult moveNode(UUID movedNodeUuid, UUID targetNodeUuid, int position);
69
70 /**
71 * Moves a given {@link TermNode} to the target node;
72 * @param movedNodeUuid the node to move
73 * @param targetNodeUuid the target node
74 * @return the result of the operation
75 */
76 public UpdateResult moveNode(UUID movedNodeUuid, UUID targetNodeUuid);
77
78 }