Project

General

Profile

Revision eb9880a0

IDeb9880a0d86ba7a26779e7f929d31e6873a8f6cb
Parent 11bdf5c4
Child 2f72f4da

Added by Andreas Müller 12 months ago

ref #6794 rename some parameters, methods and classes

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/jaxb/JaxbImport.java
118 118
		List<TypeDesignationBase<?>> typeDesignations;
119 119
		List<SpecimenOrObservationBase> occurrences;
120 120
		List<TermTree> featureTrees;
121
		List<TermNode> featureNodes;
121
		List<TermNode> termNodes;
122 122
		List<Media> media;
123 123
		List<LanguageStringBase> languageData;
124 124
		List<TermVocabulary<DefinedTermBase>> termVocabularies;
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/markup/MarkupImportState.java
51 51
	private UnmatchedLeads unmatchedLeads;
52 52
	private boolean onlyNumberedTaxaExist; //attribute in <key>
53 53

  
54
	private Set<TermNode> featureNodesToSave = new HashSet<TermNode>();
54
	private Set<TermNode> termNodesToSave = new HashSet<>();
55 55

  
56 56
	private Set<PolytomousKeyNode> polytomousKeyNodesToSave = new HashSet<>();
57 57

  
......
115 115
	 * @see MarkupImportConfigurator#getNewState()
116 116
	 */
117 117
	protected void reset(){
118
		featureNodesToSave = new HashSet<TermNode>();
118
		termNodesToSave = new HashSet<TermNode>();
119 119
		polytomousKeyNodesToSave = new HashSet<PolytomousKeyNode>();
120 120
		currentKey = null;
121 121
		defaultLanguage = null;
......
154 154
		this.unmatchedLeads = unmatchedKeys;
155 155
	}
156 156

  
157
	public void setFeatureNodesToSave(Set<TermNode> featureNodesToSave) {
158
		this.featureNodesToSave = featureNodesToSave;
157
	public void setTermNodesToSave(Set<TermNode> termNodesToSave) {
158
		this.termNodesToSave = termNodesToSave;
159 159
	}
160 160

  
161
	public Set<TermNode> getFeatureNodesToSave() {
162
		return featureNodesToSave;
161
	public Set<TermNode> getTermNodesToSave() {
162
		return termNodesToSave;
163 163
	}
164 164

  
165 165
	public Set<PolytomousKeyNode> getPolytomousKeyNodesToSave() {
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/sdd/in/SDDImport.java
106 106
    private Map<String,String> citations = new HashMap<>();
107 107
    private Map<String,String> defaultUnitPrefixes = new HashMap<>();
108 108
    private Map<String,Person> editors = new HashMap<>();
109
    private Map<String,TermNode<Feature>> featureNodes = new HashMap<>();
109
    private Map<String,TermNode<Feature>> termNodes = new HashMap<>();
110 110
    private Map<String,Feature> features = new HashMap<>();
111 111
    private Map<String,String> locations = new HashMap<>();
112 112
    private Map<String,List<CdmBase>> mediaObject_ListCdmBase = new HashMap<>();
......
161 161
	    citations = new HashMap<>();
162 162
	    defaultUnitPrefixes = new HashMap<>();
163 163
	    editors = new HashMap<>();
164
	    featureNodes = new HashMap<>();
164
	    termNodes = new HashMap<>();
165 165
	    features = new HashMap<>();
166 166
	    locations = new HashMap<>();
167 167
	    mediaObject_ListCdmBase = new HashMap<>();
......
1803 1803
					if (elParent!=null){
1804 1804
						String refP = elParent.getAttributeValue("ref");
1805 1805
						if (refP!=null) {
1806
							TermNode<Feature> parent = featureNodes.get(refP);
1806
							TermNode<Feature> parent = termNodes.get(refP);
1807 1807
							if (parent==null){
1808 1808
							    // if no parent found or the reference is broken, add the node to the root of the tree
1809 1809
							    fn = (dc==null)?root.addChild():root.addChild(dc);
......
1818 1818
                        fn = (dc==null)?root.addChild():root.addChild(dc);
1819 1819
					}
1820 1820
				}
1821
				featureNodes.put(idN, fn);
1821
				termNodes.put(idN, fn);
1822 1822
			}
1823 1823
		}
1824 1824

  
......
1835 1835
                if (elParent!=null){
1836 1836
                    String refP = elParent.getAttributeValue("ref");
1837 1837
                    if ((refP!=null)&&(!refP.equals(""))) {
1838
                        TermNode<Feature> parent = featureNodes.get(refP);
1838
                        TermNode<Feature> parent = termNodes.get(refP);
1839 1839
                        if (parent==null){
1840 1840
                            parent = root; // if no parent found or the reference is broken, add the node to the root of the tree
1841 1841
                        }
......
1875 1875
				if ((refC!=null)&&(!refC.equals(""))){
1876 1876
					Feature character = features.get(refC);
1877 1877
					fn.setTerm(character);
1878
					featureNodes.put(refC, fn);
1878
					termNodes.put(refC, fn);
1879 1879
				}
1880 1880
			}
1881 1881
		}
cdmlib-io/src/main/resources/schema/cdm/description.xsd
35 35

  
36 36
  <xs:element name="Feature" type="description:Feature"/>
37 37

  
38
  <xs:element name="TermNode" type="description:FeatureNode"/>
38
  <xs:element name="TermNode" type="description:TermNode"/>
39 39

  
40 40
  <xs:element name="FeatureTree" type="description:FeatureTree"/>
41 41
  
......
99 99
    <xs:complexContent>
100 100
      <xs:extension base="common:TermBase">
101 101
        <xs:sequence>
102
          <xs:element name="Root" type="description:FeatureNode" minOccurs="0"/>
102
          <xs:element name="Root" type="description:TermNode" minOccurs="0"/>
103 103
        </xs:sequence>
104 104
      </xs:extension>
105 105
    </xs:complexContent>
106 106
  </xs:complexType>
107 107

  
108
  <xs:complexType name="FeatureNode">
108
  <xs:complexType name="TermNode">
109 109
    <xs:complexContent>
110 110
      <xs:extension base="common:VersionableEntity">
111 111
        <xs:sequence>
......
114 114
          <xs:element name="Children" minOccurs="0">
115 115
            <xs:complexType>
116 116
              <xs:sequence>
117
                <xs:element name="Child" type="description:FeatureNode" minOccurs="0" maxOccurs="unbounded"/>
117
                <xs:element name="Child" type="description:TermNode" minOccurs="0" maxOccurs="unbounded"/>
118 118
              </xs:sequence>
119 119
            </xs:complexType>
120 120
          </xs:element>
cdmlib-io/src/test/java/eu/etaxonomy/cdm/io/jaxb/FeatureTest.java
18 18
import org.junit.Test;
19 19

  
20 20
import eu.etaxonomy.cdm.model.description.Feature;
21
import eu.etaxonomy.cdm.model.term.TermNode;
21 22
import eu.etaxonomy.cdm.model.term.TermTree;
22
import eu.etaxonomy.cdm.model.term.TermTreeNode;
23 23

  
24 24
//@Ignore  //does not work anymore since FeatureNode + Tree was moved to term package
25 25
public class FeatureTest {
......
39 39
			assertNotNull("Feature must not be null", feature);
40 40

  
41 41
			assertNotNull("FeatureTree.root must not be null", featureTree.getRoot());
42
			TermTreeNode<Feature> root = featureTree.getRoot();
43
			assertNotNull("FeatureNode.feature must not be null", root.getTerm());
44
			assertEquals("FeatureNode.feature must equal Feature", feature, root.getTerm());
42
			TermNode<Feature> root = featureTree.getRoot();
43
			assertNotNull("TermNode.term must not be null", root.getTerm());
44
			assertEquals("TermNode.feature must equal Feature", feature, root.getTerm());
45 45

  
46
			assertNotNull("FeatureNode.children must not be null", root.getChildNodes());
47
			assertFalse("FeatureNode.children must not be empty", root.getChildNodes().isEmpty());
48
			assertEquals("FeatureNode.children must have 4 child nodes", 4, root.getChildNodes().size());
46
			assertNotNull("TermNode.children must not be null", root.getChildNodes());
47
			assertFalse("TermNode.children must not be empty", root.getChildNodes().isEmpty());
48
			assertEquals("TermNode.children must have 4 child nodes", 4, root.getChildNodes().size());
49 49

  
50 50
	    }
51 51
}
cdmlib-io/src/test/java/eu/etaxonomy/cdm/io/owl/in/StructureTreeOwlImportTest.java
121 121
        DefinedTerm inflorescence = records.iterator().next();
122 122
        assertEquals(inflorescenceLabel, inflorescence.getLabel(Language.ENGLISH()));
123 123

  
124
        for (TermNode<DefinedTerm> featureNode : childNodes) {
125
            assertTrue("Child node not found. Found node with term: "+featureNode.getTerm().getLabel(),
126
                    featureNode.getTerm().getUuid().equals(inflorescence.getUuid())
127
                    || featureNode.getTerm().getLabel(Language.ENGLISH()).equals("Flower"));
128
            if(featureNode.getTerm().getUuid().equals(inflorescence.getUuid())){
129
                assertEquals("Term mismatch", inflorescence, featureNode.getTerm());
130
                inflorescence = featureNode.getTerm();
124
        for (TermNode<DefinedTerm> termNode : childNodes) {
125
            assertTrue("Child node not found. Found node with term: "+termNode.getTerm().getLabel(),
126
                    termNode.getTerm().getUuid().equals(inflorescence.getUuid())
127
                    || termNode.getTerm().getLabel(Language.ENGLISH()).equals("Flower"));
128
            if(termNode.getTerm().getUuid().equals(inflorescence.getUuid())){
129
                assertEquals("Term mismatch", inflorescence, termNode.getTerm());
130
                inflorescence = termNode.getTerm();
131 131

  
132 132
                assertEquals("wrong id in vocabulary", "inflorescence", inflorescence.getIdInVocabulary());
133 133
                assertEquals("wrong symbol", "infloSymbol", inflorescence.getSymbol());
cdmlib-io/src/test/resources/eu/etaxonomy/cdm/io/jaxb/CdmImporterTest.testImport-result.xml
9761 9761
  <DETERMINATIONEVENT_MARKER/>
9762 9762
  <DETERMINATIONEVENT_REFERENCE/>
9763 9763
  <EXTENSION/>
9764
  <FEATURENODE/>
9765
  <FEATURETREE/>
9766
  <FEATURETREE_REPRESENTATION/>
9764
  <TERMNODE/>
9765
  <TERMTREE/>
9766
  <TERMTREE_REPRESENTATION/>
9767 9767
  <GRANTEDAUTHORITYIMPL/>
9768 9768
  <HOMOTYPICALGROUP/>
9769 9769
  <HOMOTYPICALGROUP_ANNOTATION/>
cdmlib-io/src/test/resources/eu/etaxonomy/cdm/io/jaxb/CdmImporterTest.xml
8772 8772
  <DETERMINATIONEVENT_MARKER/>
8773 8773
  <DETERMINATIONEVENT_REFERENCE/>
8774 8774
  <EXTENSION/>
8775
  <FEATURENODE/>
8776
  <FEATURETREE/>
8777
  <FEATURETREE_REPRESENTATION/>
8775
  <TERMNODE/>
8776
  <TERMTREE/>
8777
  <TERMTREE_REPRESENTATION/>
8778 8778
  <GRANTEDAUTHORITYIMPL/>
8779 8779
  <HOMOTYPICALGROUP/>
8780 8780
  <HOMOTYPICALGROUP_ANNOTATION/>
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/DescriptionServiceImpl.java
93 93
    protected IDescriptionElementDao descriptionElementDao;
94 94
    protected IFeatureTreeDao featureTreeDao;
95 95
    protected IDescriptiveDataSetDao descriptiveDataSetDao;
96
    protected ITermNodeDao featureNodeDao;
96
    protected ITermNodeDao termNodeDao;
97 97
    protected IFeatureDao featureDao;
98 98
    protected ITermVocabularyDao vocabularyDao;
99 99
    protected IDefinedTermDao definedTermDao;
......
122 122

  
123 123
    @Autowired
124 124
    protected void setFeatureNodeDao(ITermNodeDao featureNodeDao) {
125
        this.featureNodeDao = featureNodeDao;
125
        this.termNodeDao = featureNodeDao;
126 126
    }
127 127

  
128 128
    @Autowired
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/FeatureNodeServiceImpl.java
19 19
import org.springframework.stereotype.Service;
20 20
import org.springframework.transaction.annotation.Transactional;
21 21

  
22
import eu.etaxonomy.cdm.api.service.config.FeatureNodeDeletionConfigurator;
23 22
import eu.etaxonomy.cdm.api.service.config.NodeDeletionConfigurator.ChildHandling;
23
import eu.etaxonomy.cdm.api.service.config.TermNodeDeletionConfigurator;
24 24
import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;
25 25
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
26 26
import eu.etaxonomy.cdm.model.common.CdmBase;
27 27
import eu.etaxonomy.cdm.model.description.Feature;
28 28
import eu.etaxonomy.cdm.model.term.DefinedTermBase;
29
import eu.etaxonomy.cdm.model.term.TermTree;
30 29
import eu.etaxonomy.cdm.model.term.TermNode;
30
import eu.etaxonomy.cdm.model.term.TermTree;
31 31
import eu.etaxonomy.cdm.model.term.TermVocabulary;
32 32
import eu.etaxonomy.cdm.persistence.dao.description.ITermNodeDao;
33 33

  
......
38 38
@Service
39 39
@Transactional(readOnly = false)
40 40
public class FeatureNodeServiceImpl extends VersionableServiceBase<TermNode, ITermNodeDao> implements IFeatureNodeService {
41
	private static final Logger logger = Logger.getLogger(FeatureNodeServiceImpl.class);
41

  
42
    @SuppressWarnings("unused")
43
    private static final Logger logger = Logger.getLogger(FeatureNodeServiceImpl.class);
42 44

  
43 45
	@Override
44 46
    @Autowired
......
54 56

  
55 57
	 @Override
56 58
	 @Transactional(readOnly = false)
57
	 public DeleteResult deleteFeatureNode(UUID nodeUuid, FeatureNodeDeletionConfigurator config) {
59
	 public DeleteResult deleteFeatureNode(UUID nodeUuid, TermNodeDeletionConfigurator config) {
58 60
	     DeleteResult result = new DeleteResult();
59
         TermNode<Feature> node = HibernateProxyHelper.deproxy(dao.load(nodeUuid), TermNode.class);
61
         TermNode<Feature> node = CdmBase.deproxy(dao.load(nodeUuid));
60 62
	     result = isDeletable(nodeUuid, config);
61 63
	     if (result.isOk()){
62 64
	         TermNode<Feature> parent = node.getParent();
63
             parent = HibernateProxyHelper.deproxy(parent, TermNode.class);
64
	         List<TermNode> children = new ArrayList(node.getChildNodes());
65
             parent = CdmBase.deproxy(parent);
66
	         List<TermNode<Feature>> children = new ArrayList<>(node.getChildNodes());
65 67

  
66 68
	         if (config.getChildHandling().equals(ChildHandling.DELETE)){
67 69

  
68
	             for (TermNode child: children){
70
	             for (TermNode<Feature> child: children){
69 71
	                 deleteFeatureNode(child.getUuid(), config);
70 72
	                // node.removeChild(child);
71 73
	             }
......
77 79

  
78 80
	             if (parent != null){
79 81
	                 parent.removeChild(node);
80
	                 for (TermNode child: children){
82
	                 for (TermNode<Feature> child: children){
81 83
	                     node.removeChild(child);
82 84
	                     parent.addChild(child);
83 85
	                 }
......
94 96
	             result.addUpdatedObject(parent);
95 97
	         }
96 98
	         if (config.isDeleteElement()){
97
	             DefinedTermBase term = node.getTerm();
99
	             DefinedTermBase<?> term = node.getTerm();
98 100
                 termService.delete(term.getUuid());
99 101
                 result.addDeletedObject(term);
100 102
             }
......
136 138
     }
137 139

  
138 140
	 @Override
139
	 public DeleteResult isDeletable(UUID nodeUuid, FeatureNodeDeletionConfigurator config){
141
	 public DeleteResult isDeletable(UUID nodeUuid, TermNodeDeletionConfigurator config){
140 142
	     TermNode<Feature> node = load(nodeUuid);
141 143
	     DeleteResult result = new DeleteResult();
142 144
	     Set<CdmBase> references = commonService.getReferencingObjectsForDeletion(node);
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/FeatureTreeServiceImpl.java
21 21
import org.springframework.stereotype.Service;
22 22
import org.springframework.transaction.annotation.Transactional;
23 23

  
24
import eu.etaxonomy.cdm.api.service.config.FeatureNodeDeletionConfigurator;
25 24
import eu.etaxonomy.cdm.api.service.config.NodeDeletionConfigurator.ChildHandling;
25
import eu.etaxonomy.cdm.api.service.config.TermNodeDeletionConfigurator;
26 26
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
27 27
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
28
import eu.etaxonomy.cdm.model.term.TermTree;
29 28
import eu.etaxonomy.cdm.model.term.TermNode;
29
import eu.etaxonomy.cdm.model.term.TermTree;
30 30
import eu.etaxonomy.cdm.model.term.TermType;
31 31
import eu.etaxonomy.cdm.persistence.dao.description.IFeatureTreeDao;
32 32
import eu.etaxonomy.cdm.persistence.dao.description.ITermNodeDao;
......
37 37
@Transactional(readOnly = false)
38 38
public class FeatureTreeServiceImpl extends IdentifiableServiceBase<TermTree, IFeatureTreeDao> implements IFeatureTreeService {
39 39

  
40
    private ITermNodeDao featureNodeDao;
40
    private ITermNodeDao termNodeDao;
41 41

  
42 42
    @Autowired
43 43
    private IFeatureNodeService featureNodeService;
......
49 49
    }
50 50

  
51 51
    @Autowired
52
    protected void setFeatureNodeDao(ITermNodeDao featureNodeDao) {
53
        this.featureNodeDao = featureNodeDao;
52
    protected void setTermNodeDao(ITermNodeDao termNodeDao) {
53
        this.termNodeDao = termNodeDao;
54 54
    }
55 55

  
56 56
    @Override
......
64 64

  
65 65
    @Override
66 66
    public List<TermNode> getFeatureNodesAll() {
67
        return featureNodeDao.list();
67
        return termNodeDao.list();
68 68
    }
69 69

  
70 70
    @Override
71 71
    public Map<UUID, TermNode> saveFeatureNodesAll(Collection<TermNode> featureNodeCollection) {
72
        return featureNodeDao.saveAll(featureNodeCollection);
72
        return termNodeDao.saveAll(featureNodeCollection);
73 73
    }
74 74

  
75 75
    @Override
76 76
    public Map<UUID, TermNode> saveOrUpdateFeatureNodesAll(Collection<TermNode> featureNodeCollection) {
77
        return featureNodeDao.saveOrUpdateAll(featureNodeCollection);
77
        return termNodeDao.saveOrUpdateAll(featureNodeCollection);
78 78
    }
79 79

  
80 80
    @Override
......
131 131
        TermTree tree = dao.load(featureTreeUuid);
132 132

  
133 133
        TermNode rootNode = HibernateProxyHelper.deproxy(tree.getRoot());
134
        FeatureNodeDeletionConfigurator config = new FeatureNodeDeletionConfigurator();
134
        TermNodeDeletionConfigurator config = new TermNodeDeletionConfigurator();
135 135
        config.setChildHandling(ChildHandling.DELETE);
136 136
        result =featureNodeService.deleteFeatureNode(rootNode.getUuid(), config);
137 137
        //FIXME test if this is necessary
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/config/FeatureNodeDeletionConfigurator.java
1
/**
2
* Copyright (C) 2015 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
package eu.etaxonomy.cdm.api.service.config;
10

  
11
/**
12
 * @author k.luther
13
 * @since 05.11.2015
14
 *
15
 */
16
public class FeatureNodeDeletionConfigurator extends NodeDeletionConfigurator {
17

  
18
    public FeatureNodeDeletionConfigurator(){
19
        deleteElement = false;
20
    }
21
}
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/config/SortIndexUpdaterConfigurator.java
21 21

  
22 22

  
23 23
    private boolean doTaxonNode = true;
24
    private boolean doFeatureNode = true;
24
    private boolean doTermNode = true;
25 25
    private boolean doPolytomousKeyNode = true;
26 26
    private IProgressMonitor monitor;
27 27

  
......
42 42
     * @param destination
43 43
     * @return
44 44
     */
45
    public static SortIndexUpdaterConfigurator NewInstance(boolean doTaxonNode, boolean doFeatureNode, boolean doPolytomousKeyNode) {
45
    public static SortIndexUpdaterConfigurator NewInstance(boolean doTaxonNode, boolean doTermNode, boolean doPolytomousKeyNode) {
46 46
        SortIndexUpdaterConfigurator result = new SortIndexUpdaterConfigurator();
47
        result.doFeatureNode = doFeatureNode;
47
        result.doTermNode = doTermNode;
48 48
        result.doTaxonNode = doTaxonNode;
49 49
        result.doPolytomousKeyNode = doPolytomousKeyNode;
50 50
        return result;
......
53 53

  
54 54
 // **************** GETTER / SETTER ************************************
55 55

  
56

  
57
    /**
58
     * @return the doTaxonNode
59
     */
60 56
    public boolean isDoTaxonNode() {
61 57
        return doTaxonNode;
62 58
    }
63
    /**
64
     * @param doTaxonNode the doTaxonNode to set
65
     */
66 59
    public void setDoTaxonNode(boolean doTaxonNode) {
67 60
        this.doTaxonNode = doTaxonNode;
68 61
    }
69
    /**
70
     * @return the doPolytomousKeyNode
71
     */
62

  
72 63
    public boolean isDoPolytomousKeyNode() {
73 64
        return doPolytomousKeyNode;
74 65
    }
75
    /**
76
     * @param doPolytomousKeyNode the doPolytomousKeyNode to set
77
     */
78 66
    public void setDoPolytomousKeyNode(boolean doPolytomousKeyNode) {
79 67
        this.doPolytomousKeyNode = doPolytomousKeyNode;
80 68
    }
81
    /**
82
     * @return the doFeatureNode
83
     */
84
    public boolean isDoFeatureNode() {
85
        return doFeatureNode;
69

  
70
    public boolean isDoTermNode() {
71
        return doTermNode;
86 72
    }
87
    /**
88
     * @param doFeatureNode the doFeatureNode to set
89
     */
90
    public void setDoFeatureNode(boolean doFeatureNode) {
91
        this.doFeatureNode = doFeatureNode;
73
    public void setDoTermNode(boolean doTermNode) {
74
        this.doTermNode = doTermNode;
92 75
    }
93 76

  
94 77
    public IProgressMonitor getMonitor() {
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/config/TermNodeDeletionConfigurator.java
1
/**
2
* Copyright (C) 2015 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
package eu.etaxonomy.cdm.api.service.config;
10

  
11
/**
12
 * @author k.luther
13
 * @since 05.11.2015
14
 */
15
public class TermNodeDeletionConfigurator extends NodeDeletionConfigurator {
16

  
17
    private static final long serialVersionUID = 3079674487787604884L;
18

  
19
    public TermNodeDeletionConfigurator(){
20
        deleteElement = false;
21
    }
22
}
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/util/SortIndexUpdaterWrapper.java
72 72
            updater = SortIndexUpdater.NewInstance("Update taxonnode sortindex", "TaxonNode", "parent_id", "sortIndex", true);
73 73

  
74 74
            result.includeResult(update(updater, monitor));
75

  
76

  
77 75
        }
78
        if (config.isDoFeatureNode()){
79
            updater = SortIndexUpdater.NewInstance("Update Feature node sortindex", "FeatureNode", "parent_id", "sortIndex", true);
76
        if (config.isDoTermNode()){
77
            updater = SortIndexUpdater.NewInstance("Update Feature node sortindex", "TermNode", "parent_id", "sortIndex", true);
80 78
            result.includeResult(update(updater, monitor));
81 79
        }
82 80
        if (config.isDoPolytomousKeyNode()){
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/FeatureNodeServiceImplTest.java
22 22
import org.unitils.dbunit.datasetloadstrategy.impl.RefreshLoadStrategy;
23 23
import org.unitils.spring.annotation.SpringBeanByType;
24 24

  
25
import eu.etaxonomy.cdm.api.service.config.FeatureNodeDeletionConfigurator;
25
import eu.etaxonomy.cdm.api.service.config.TermNodeDeletionConfigurator;
26 26
import eu.etaxonomy.cdm.api.service.config.NodeDeletionConfigurator.ChildHandling;
27 27
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
28 28
import eu.etaxonomy.cdm.model.common.ITreeNode;
......
146 146
	public final void testIndexDeleteNode() {
147 147
		node2 = featureNodeService.load(node2Uuid);
148 148
		TermNode<Feature> root = node2.getParent();
149
		FeatureNodeDeletionConfigurator config = new FeatureNodeDeletionConfigurator();
149
		TermNodeDeletionConfigurator config = new TermNodeDeletionConfigurator();
150 150
		config.setDeleteElement(false);
151 151
        config.setChildHandling(ChildHandling.MOVE_TO_PARENT);
152 152
        DeleteResult result = featureNodeService.deleteFeatureNode(node2Uuid, config);
cdmlib-services/src/test/java/eu/etaxonomy/cdm/test/function/Datasource.java
232 232
//		appCtr.getTaxonNodeService().saveOrUpdate(node3);
233 233
//		appCtr.getClassificationService().saveOrUpdate(cl);
234 234
//
235
//		FeatureTree ft1 = FeatureTree.NewInstance();
236
//		FeatureNode fn1 = FeatureNode.NewInstance((Feature)null);
235
//		TermTree<Feature> ft1 = TermTree.NewInstance();
236
//		FeatureNode fn1 = TermNode.NewInstance((Feature)null);
237 237
//		ft1.getRoot().addChild(fn1);
238 238
//		appCtr.getFeatureNodeService().save(fn1);
239 239
//
240
//		FeatureNode fn2 = FeatureNode.NewInstance((Feature)null);
240
//		TermNode fn2 = TermNode.NewInstance((Feature)null);
241 241
//		fn1.addChild(fn2);
242 242
//
243
//		FeatureNode fn3 = FeatureNode.NewInstance((Feature)null);
243
//		TermNode fn3 = TermNode.NewInstance((Feature)null);
244 244
//		fn1.addChild(fn2, 0);
245 245
//
246 246
//		appCtr.getFeatureNodeService().saveOrUpdate(fn1);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)