Project

General

Profile

Revision 22d2dd81

ID22d2dd817d87517d727c067011f63532b62c34eb
Parent 5069da98
Child 8a3f391d

Added by Katja Luther over 3 years ago

use remotingProgressMonitor for setSecundumReferenceForSubtree

View differences:

cdmlib-commons/src/main/java/eu/etaxonomy/cdm/common/monitor/RemotingProgressMonitorThread.java
11 11
import java.io.Serializable;
12 12
import java.util.concurrent.ConcurrentHashMap;
13 13

  
14
import org.apache.log4j.Logger;
15

  
14 16
/**
15 17
 * Thread class to be used to run monitored jobs
16 18
 *
......
24 26
            new ConcurrentHashMap<IRemotingProgressMonitor, RemotingProgressMonitorThread>();
25 27

  
26 28
    private IRemotingProgressMonitor monitor;
29
    @SuppressWarnings("unused")
30
    private static final Logger logger = Logger.getLogger(RemotingProgressMonitorThread.class);
27 31

  
28 32
    public void setMonitor(IRemotingProgressMonitor monitor) {
29 33
        if(monitor == null) {
......
41 45
            monitorsInProgress.put(monitor, this);
42 46
            monitor.setResult(doRun(monitor));
43 47
        } catch(Exception ex) {
48
            logger.info("Exception in RemotingProgressMonitorThread ", ex);
44 49
            monitor.setResult(ex);
45 50
            monitor.setIsFailed(true);
46 51
        }
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/SecundumUpdater.java
1
/**
2
* Copyright (C) 2017 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.io.common;
10

  
11
import org.apache.log4j.Logger;
12
import org.springframework.beans.BeansException;
13
import org.springframework.context.ApplicationContext;
14
import org.springframework.stereotype.Component;
15

  
16
import eu.etaxonomy.cdm.api.service.UpdateResult;
17

  
18
/**
19
 * @author k.luther
20
 * @date 14.03.2017
21
 *
22
 */
23
@Component
24
public class SecundumUpdater extends CdmImportBase<SetSecundumForSubtreeConfigurator, DefaultImportState<SetSecundumForSubtreeConfigurator>>  {
25
    /**
26
     *
27
     */
28
    private static final long serialVersionUID = 6788425152444747546L;
29

  
30
    private static final Logger logger = Logger.getLogger(SecundumUpdater.class);
31

  
32

  
33
    /**
34
     * {@inheritDoc}
35
     */
36
    @Override
37
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
38
        this.applicationContext = applicationContext;
39

  
40
    }
41
    /**
42
     * {@inheritDoc}
43
     */
44
    @Override
45
    protected void doInvoke(DefaultImportState<SetSecundumForSubtreeConfigurator> state) {
46
        SetSecundumForSubtreeConfigurator config = state.getConfig();
47
        state.getConfig().getProgressMonitor().beginTask("Update Secundum References ", 100);
48

  
49
        UpdateResult result = getTaxonNodeService().setSecundumForSubtree(config.getSubtreeUuid(),  config.getNewSecundum(), config.isIncludeAcceptedTaxa(), config.isIncludeSynonyms(), config.isOverwriteExistingAccepted(), config.isOverwriteExistingSynonyms(), config.isIncludeSharedTaxa(), config.isEmptySecundumDetail(), config.getProgressMonitor());
50

  
51
        return;
52

  
53
    }
54
    /**
55
     * {@inheritDoc}
56
     */
57
    @Override
58
    protected boolean doCheck(DefaultImportState<SetSecundumForSubtreeConfigurator> state) {
59
        // TODO Auto-generated method stub
60
        return false;
61
    }
62
    /**
63
     * {@inheritDoc}
64
     */
65
    @Override
66
    protected boolean isIgnore(DefaultImportState<SetSecundumForSubtreeConfigurator> state) {
67
        // TODO Auto-generated method stub
68
        return false;
69
    }
70

  
71

  
72

  
73
}
74

  
75

  
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/SetSecundumForSubtreeConfigurator.java
1
/**
2
* Copyright (C) 2017 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.io.common;
10

  
11
import java.util.UUID;
12

  
13
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
14
import eu.etaxonomy.cdm.model.reference.Reference;
15

  
16
/**
17
 * Configurator for the setSecundumForSubtree operation.
18
 *
19
 * @author a.mueller
20
 * @date 06.01.2017
21
 *
22
 */
23
public class SetSecundumForSubtreeConfigurator extends ImportConfiguratorBase<DefaultImportState<SetSecundumForSubtreeConfigurator>, Object> implements IImportConfigurator{
24
    private UUID subtreeUuid;
25
    private Reference newSecundum;
26
    private boolean includeAcceptedTaxa = true;
27
    private boolean includeSynonyms = true;
28
    private boolean overwriteExistingAccepted = true;
29
    private boolean overwriteExistingSynonyms = true;
30
    private boolean emptySecundumDetail = true;
31
    private boolean includeSharedTaxa = true;
32
    private IProgressMonitor monitor;
33

  
34
    /**
35
     * @param monitor the monitor to set
36
     */
37
    public void setMonitor(IProgressMonitor monitor) {
38
        this.monitor = monitor;
39
    }
40

  
41
    /**
42
     * @param subtreeUuid
43
     * @param newSecundum
44
     */
45
    public SetSecundumForSubtreeConfigurator(UUID subtreeUuid, Reference newSecundum, IProgressMonitor monitor) {
46
        super(null);
47
        this.subtreeUuid = subtreeUuid;
48
        this.newSecundum = newSecundum;
49
        this.monitor = monitor;
50
    }
51

  
52
    /**
53
     * @param subtreeUuid
54
     * @param newSecundum
55
     */
56
    public SetSecundumForSubtreeConfigurator(UUID subtreeUuid) {
57
        super(null);
58
        this.subtreeUuid = subtreeUuid;
59
        // this.newSecundum = newSecundum;
60
    }
61

  
62
    /**
63
     * @return the subtreeUuid
64
     */
65
    public UUID getSubtreeUuid() {
66
        return subtreeUuid;
67
    }
68

  
69
    /**
70
     * @param subtreeUuid
71
     *            the subtreeUuid to set
72
     */
73
    public void setSubtreeUuid(UUID subtreeUuid) {
74
        this.subtreeUuid = subtreeUuid;
75
    }
76

  
77
    /**
78
     * @return the newSecundum
79
     */
80
    public Reference getNewSecundum() {
81
        return newSecundum;
82
    }
83

  
84
    /**
85
     * @param newSecundum
86
     *            the newSecundum to set
87
     */
88
    public void setNewSecundum(Reference newSecundum) {
89
        this.newSecundum = newSecundum;
90
    }
91

  
92
    /**
93
     * @return the overrideExisting
94
     */
95
    public boolean isOverwriteExistingAccepted() {
96
        return overwriteExistingAccepted;
97
    }
98

  
99
    /**
100
     * @param overrideExisting
101
     *            the overrideExisting to set
102
     */
103
    public void setOverwriteExistingAccepted(boolean overwriteExistingAccepted) {
104
        this.overwriteExistingAccepted = overwriteExistingAccepted;
105
    }
106

  
107
    /**
108
     * @return the overrideExisting
109
     */
110
    public boolean isOverwriteExistingSynonyms() {
111
        return overwriteExistingSynonyms;
112
    }
113

  
114
    /**
115
     * @param overrideExisting
116
     *            the overrideExisting to set
117
     */
118
    public void setOverwriteExistingSynonyms(boolean overwriteExistingSynonyms) {
119
        this.overwriteExistingSynonyms = overwriteExistingSynonyms;
120
    }
121

  
122
    /**
123
     * @return the emptySecundumDetail
124
     */
125
    public boolean isEmptySecundumDetail() {
126
        return emptySecundumDetail;
127
    }
128

  
129
    /**
130
     * @param emptySecundumDetail
131
     *            the emptySecundumDetail to set
132
     */
133
    public void setEmptySecundumDetail(boolean emptySecundumDetail) {
134
        this.emptySecundumDetail = emptySecundumDetail;
135
    }
136

  
137
    /**
138
     * @return the includeSynonyms
139
     */
140
    public boolean isIncludeSynonyms() {
141
        return includeSynonyms;
142
    }
143

  
144
    /**
145
     * @param includeSynonyms
146
     *            the includeSynonyms to set
147
     */
148
    public void setIncludeSynonyms(boolean includeSynonyms) {
149
        this.includeSynonyms = includeSynonyms;
150
    }
151

  
152
    /**
153
     * @return the includeAcceptedTaxa
154
     */
155
    public boolean isIncludeAcceptedTaxa() {
156
        return includeAcceptedTaxa;
157
    }
158

  
159
    /**
160
     * @param includeAcceptedTaxa
161
     *            the includeAcceptedTaxa to set
162
     */
163
    public void setIncludeAcceptedTaxa(boolean includeAcceptedTaxa) {
164
        this.includeAcceptedTaxa = includeAcceptedTaxa;
165
    }
166

  
167
    /**
168
     * @return the includeSharedTaxa
169
     */
170
    public boolean isIncludeSharedTaxa() {
171
        return includeSharedTaxa;
172
    }
173

  
174
    /**
175
     * @param includeSharedTaxa
176
     *            the includeSharedTaxa to set
177
     */
178
    public void setIncludeSharedTaxa(boolean includeSharedTaxa) {
179
        this.includeSharedTaxa = includeSharedTaxa;
180
    }
181

  
182
    /**
183
     * @return
184
     */
185
    public IProgressMonitor getMonitor() {
186

  
187
        return monitor;
188
    }
189

  
190
    /**
191
     * {@inheritDoc}
192
     */
193
    @SuppressWarnings("rawtypes")
194
    @Override
195
    public DefaultImportState getNewState() {
196
      return new DefaultImportState(this);
197
    }
198

  
199
    /**
200
     * {@inheritDoc}
201
     */
202
    @Override
203
    protected void makeIoClassList() {
204
        ioClassList = new Class[]{
205
                SecundumUpdater.class
206
                };
207

  
208
    }
209

  
210
    /**
211
     * {@inheritDoc}
212
     */
213
    @Override
214
    public Reference getSourceReference() {
215
        // TODO Auto-generated method stub
216
        return null;
217
    }
218

  
219
    @Override
220
    public boolean isValid(){
221
        return true;
222
    }
223

  
224
}
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/service/IIOService.java
17 17
import eu.etaxonomy.cdm.io.common.IImportConfigurator;
18 18
import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
19 19
import eu.etaxonomy.cdm.io.common.ImportResult;
20
import eu.etaxonomy.cdm.io.common.SetSecundumForSubtreeConfigurator;
20 21
import eu.etaxonomy.cdm.io.common.SortIndexUpdaterConfigurator;
21 22
import eu.etaxonomy.cdm.io.specimen.SpecimenImportConfiguratorBase;
22 23
import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
......
88 89
     */
89 90
    ImportResult updateCaches(CacheUpdaterConfigurator config);
90 91

  
92

  
93
    /**
94
     * @param configurator
95
     * @param importData
96
     * @param type
97
     * @return
98
     */
99
    UUID monitUpdateData(IImportConfigurator configurator);
100

  
101

  
102
    /**
103
     * @param configurator
104
     * @return
105
     */
106
    ImportResult updateData(SetSecundumForSubtreeConfigurator configurator);
107

  
91 108
}
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/service/IOServiceImpl.java
36 36
import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
37 37
import eu.etaxonomy.cdm.io.common.ImportConfiguratorBase;
38 38
import eu.etaxonomy.cdm.io.common.ImportResult;
39
import eu.etaxonomy.cdm.io.common.SetSecundumForSubtreeConfigurator;
39 40
import eu.etaxonomy.cdm.io.common.SortIndexUpdaterConfigurator;
40 41
import eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitImportConfigurator;
41 42
import eu.etaxonomy.cdm.io.specimen.SpecimenImportConfiguratorBase;
......
59 60

  
60 61
    @Autowired
61 62
    IProgressMonitorService progressMonitorService;
63
//
64
//    @Autowired
65
//    @Qualifier("defaultUpdate")
66
//    CdmApplicationAwareDefaultUpdate cdmUpdate;
62 67

  
63 68

  
64 69

  
......
93 98
    }
94 99

  
95 100
    @Override
101
    public UUID monitUpdateData(final IImportConfigurator configurator) {
102
        RemotingProgressMonitorThread monitorThread = new RemotingProgressMonitorThread() {
103
            @Override
104
            public Serializable doRun(IRemotingProgressMonitor monitor) {
105

  
106
                configurator.setProgressMonitor(monitor);
107
                ImportResult result =updateData((SetSecundumForSubtreeConfigurator)configurator);
108

  
109
                return result;
110
            }
111
        };
112
        UUID uuid = progressMonitorService.registerNewRemotingMonitor(monitorThread);
113
        monitorThread.setPriority(3);
114
        monitorThread.start();
115
        return uuid;
116
    }
117

  
118
    @Override
96 119
    public ImportResult importData(IImportConfigurator configurator, byte[] importData, SOURCE_TYPE type) {
97 120
        ImportResult result;
98 121
        switch(type) {
......
110 133
    }
111 134

  
112 135
    @Override
136
    public ImportResult updateData(SetSecundumForSubtreeConfigurator configurator) {
137
        ImportResult result;
138

  
139
        result = cdmImport.invoke(configurator);
140
        return result;
141
    }
142

  
143
    @Override
113 144
    public ImportResult importDataFromUri(IImportConfigurator configurator, byte[] importData) {
114 145
        ImportResult result;
115 146

  
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonNodeServiceImpl.java
25 25

  
26 26
import eu.etaxonomy.cdm.api.service.UpdateResult.Status;
27 27
import eu.etaxonomy.cdm.api.service.config.NodeDeletionConfigurator.ChildHandling;
28
import eu.etaxonomy.cdm.api.service.config.SetSecundumForSubtreeConfigurator;
29 28
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
30 29
import eu.etaxonomy.cdm.api.service.config.TaxonNodeDeletionConfigurator;
31 30
import eu.etaxonomy.cdm.api.service.dto.CdmEntityIdentifier;
......
741 740

  
742 741
    @Override
743 742
    @Transactional
744
    public UpdateResult setSecundumForSubtree(SetSecundumForSubtreeConfigurator config, IProgressMonitor monitor) {
743
    public UpdateResult setSecundumForSubtree(UUID subtreeUuid,  Reference newSec, boolean includeAcceptedTaxa, boolean includeSynonyms, boolean overwriteExistingAccepted, boolean overwriteExistingSynonyms, boolean includeSharedTaxa, boolean emptyDetail, IProgressMonitor monitor) {
745 744
        UpdateResult result = new UpdateResult();
745
       // IProgressMonitor monitor = config.getMonitor();
746 746
        if (monitor == null){
747 747
            monitor = DefaultProgressMonitor.NewInstance();
748 748
        }
749
        UUID subtreeUuid = config.getSubtreeUuid();
749
        monitor.beginTask("Update Secundum Reference", 100);
750 750
        if (subtreeUuid == null){
751 751
            result.setError();
752 752
            result.addException(new NullPointerException("No subtree given"));
......
762 762
        }
763 763
        TreeIndex subTreeIndex = TreeIndex.NewInstance(subTree.treeIndex());
764 764

  
765
        Reference ref = config.getNewSecundum();
766
        if (config.isIncludeAcceptedTaxa()){
767
            Set<Taxon> updatedTaxa = dao.setSecundumForSubtreeAcceptedTaxa(subTreeIndex, ref, config.isOverwriteExistingAccepted(), config.isIncludeSharedTaxa() ,config.isEmptySecundumDetail());
765
        //Reference ref = config.getNewSecundum();
766
        if (includeAcceptedTaxa){
767
            monitor.subTask("Update Accepted Taxa");
768
            Set<Taxon> updatedTaxa = dao.setSecundumForSubtreeAcceptedTaxa(subTreeIndex, newSec, overwriteExistingAccepted, includeSharedTaxa, emptyDetail);
768 769
            result.addUpdatedObjects(updatedTaxa);
769 770
        }
770
        if (config.isIncludeSynonyms()){
771
            Set<Synonym> updatedSynonyms = dao.setSecundumForSubtreeSynonyms(subTreeIndex, ref, config.isOverwriteExistingSynonyms(), config.isIncludeSharedTaxa() , config.isEmptySecundumDetail());
771
        if (includeSynonyms){
772
            monitor.subTask("Update Synonyms");
773
            Set<Synonym> updatedSynonyms = dao.setSecundumForSubtreeSynonyms(subTreeIndex, newSec, overwriteExistingSynonyms, includeSharedTaxa , emptyDetail);
772 774
            result.addUpdatedObjects(updatedSynonyms);
773 775
        }
774

  
776
        monitor.done();
775 777
        return result;
776 778
    }
777 779

  
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/config/SetSecundumForSubtreeConfigurator.java
1
/**
2
* Copyright (C) 2017 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
import java.io.Serializable;
12
import java.util.UUID;
13

  
14
import eu.etaxonomy.cdm.model.reference.Reference;
15

  
16
/**
17
 * Configurator for the setSecundumForSubtree operation.
18
 * @author a.mueller
19
 * @date 06.01.2017
20
 *
21
 */
22
public class SetSecundumForSubtreeConfigurator implements Serializable{
23
    private UUID subtreeUuid;
24
    private Reference newSecundum;
25
    private boolean includeAcceptedTaxa = true;
26
    private boolean includeSynonyms = true;
27
    private boolean overwriteExistingAccepted = true;
28
    private boolean overwriteExistingSynonyms = true;
29
    private boolean emptySecundumDetail = true;
30
    private boolean includeSharedTaxa = true;
31

  
32
    /**
33
     * @param subtreeUuid
34
     * @param newSecundum
35
     */
36
    public SetSecundumForSubtreeConfigurator(UUID subtreeUuid, Reference newSecundum) {
37
        super();
38
        this.subtreeUuid = subtreeUuid;
39
        this.newSecundum = newSecundum;
40
    }
41

  
42
    /**
43
     * @param subtreeUuid
44
     * @param newSecundum
45
     */
46
    public SetSecundumForSubtreeConfigurator(UUID subtreeUuid) {
47
        super();
48
        this.subtreeUuid = subtreeUuid;
49
       // this.newSecundum = newSecundum;
50
    }
51
    /**
52
     * @return the subtreeUuid
53
     */
54
    public UUID getSubtreeUuid() {
55
        return subtreeUuid;
56
    }
57
    /**
58
     * @param subtreeUuid the subtreeUuid to set
59
     */
60
    public void setSubtreeUuid(UUID subtreeUuid) {
61
        this.subtreeUuid = subtreeUuid;
62
    }
63
    /**
64
     * @return the newSecundum
65
     */
66
    public Reference getNewSecundum() {
67
        return newSecundum;
68
    }
69
    /**
70
     * @param newSecundum the newSecundum to set
71
     */
72
    public void setNewSecundum(Reference newSecundum) {
73
        this.newSecundum = newSecundum;
74
    }
75
    /**
76
     * @return the overrideExisting
77
     */
78
    public boolean isOverwriteExistingAccepted() {
79
        return overwriteExistingAccepted;
80
    }
81
    /**
82
     * @param overrideExisting the overrideExisting to set
83
     */
84
    public void setOverwriteExistingAccepted(boolean overwriteExistingAccepted) {
85
        this.overwriteExistingAccepted = overwriteExistingAccepted;
86
    }
87
    /**
88
     * @return the overrideExisting
89
     */
90
    public boolean isOverwriteExistingSynonyms() {
91
        return overwriteExistingSynonyms;
92
    }
93
    /**
94
     * @param overrideExisting the overrideExisting to set
95
     */
96
    public void setOverwriteExistingSynonyms(boolean overwriteExistingSynonyms) {
97
        this.overwriteExistingSynonyms = overwriteExistingSynonyms;
98
    }
99
    /**
100
     * @return the emptySecundumDetail
101
     */
102
    public boolean isEmptySecundumDetail() {
103
        return emptySecundumDetail;
104
    }
105
    /**
106
     * @param emptySecundumDetail the emptySecundumDetail to set
107
     */
108
    public void setEmptySecundumDetail(boolean emptySecundumDetail) {
109
        this.emptySecundumDetail = emptySecundumDetail;
110
    }
111
    /**
112
     * @return the includeSynonyms
113
     */
114
    public boolean isIncludeSynonyms() {
115
        return includeSynonyms;
116
    }
117
    /**
118
     * @param includeSynonyms the includeSynonyms to set
119
     */
120
    public void setIncludeSynonyms(boolean includeSynonyms) {
121
        this.includeSynonyms = includeSynonyms;
122
    }
123
    /**
124
     * @return the includeAcceptedTaxa
125
     */
126
    public boolean isIncludeAcceptedTaxa() {
127
        return includeAcceptedTaxa;
128
    }
129
    /**
130
     * @param includeAcceptedTaxa the includeAcceptedTaxa to set
131
     */
132
    public void setIncludeAcceptedTaxa(boolean includeAcceptedTaxa) {
133
        this.includeAcceptedTaxa = includeAcceptedTaxa;
134
    }
135
    /**
136
     * @return the includeSharedTaxa
137
     */
138
    public boolean isIncludeSharedTaxa() {
139
        return includeSharedTaxa;
140
    }
141
    /**
142
     * @param includeSharedTaxa the includeSharedTaxa to set
143
     */
144
    public void setIncludeSharedTaxa(boolean includeSharedTaxa) {
145
        this.includeSharedTaxa = includeSharedTaxa;
146
    }
147

  
148
}
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TaxonNodeServiceImplTest.java
29 29
import org.unitils.dbunit.annotation.DataSet;
30 30
import org.unitils.spring.annotation.SpringBeanByType;
31 31

  
32
import eu.etaxonomy.cdm.api.service.config.SetSecundumForSubtreeConfigurator;
33 32
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
34 33
import eu.etaxonomy.cdm.model.common.CdmBase;
35 34
import eu.etaxonomy.cdm.model.description.PolytomousKey;
......
725 724
        Assert.assertNotNull(taxon5.getSecMicroReference());
726 725

  
727 726
        //set secundum
728
        SetSecundumForSubtreeConfigurator config = new SetSecundumForSubtreeConfigurator(subTreeUuid, newSec);
729
        taxonNodeService.setSecundumForSubtree(config, null);
727
//        SetSecundumForSubtreeConfigurator config = new SetSecundumForSubtreeConfigurator(subTreeUuid);
728
//        config.setNewSecundum(newSec);
729
        taxonNodeService.setSecundumForSubtree(subTreeUuid,  newSec, true, true, true, true, true, true, null);
730 730

  
731 731
        commitAndStartNewTransaction(new String[]{"TaxonBase","TaxonBase_AUD"});
732 732
        Assert.assertEquals(newSec, taxonService.find(1).getSec());
......
758 758
        Assert.assertNotNull(taxon5.getSecMicroReference());
759 759

  
760 760
        //set secundum
761
        SetSecundumForSubtreeConfigurator config = new SetSecundumForSubtreeConfigurator(subTreeUuid, newSec);
762
        config.setOverwriteExistingAccepted(false);
763
        config.setOverwriteExistingSynonyms(false);
764
        taxonNodeService.setSecundumForSubtree(config, null);
761
//        SetSecundumForSubtreeConfigurator config = new SetSecundumForSubtreeConfigurator(subTreeUuid, newSec, null);
762
//        config.setOverwriteExistingAccepted(false);
763
//        config.setOverwriteExistingSynonyms(false);
764
        taxonNodeService.setSecundumForSubtree(subTreeUuid,  newSec, true, true, false, false, true, true, null);
765 765

  
766 766
        commitAndStartNewTransaction(new String[]{"TaxonBase","TaxonBase_AUD"});
767 767
        Assert.assertEquals(newSec, taxonService.find(1).getSec());
......
793 793
        Assert.assertNotNull(taxon5.getSecMicroReference());
794 794

  
795 795
        //set secundum
796
        SetSecundumForSubtreeConfigurator config = new SetSecundumForSubtreeConfigurator(subTreeUuid, newSec);
797
        config.setIncludeSynonyms(false);
798
        taxonNodeService.setSecundumForSubtree(config, null);
796
//        SetSecundumForSubtreeConfigurator config = new SetSecundumForSubtreeConfigurator(subTreeUuid, newSec, null);
797
//        config.setIncludeSynonyms(false);
798
        taxonNodeService.setSecundumForSubtree(subTreeUuid,  newSec, true, false, true, true, true, true, null);
799 799

  
800 800
        commitAndStartNewTransaction(new String[]{"TaxonBase","TaxonBase_AUD"});
801 801
        Assert.assertEquals(newSec, taxonService.find(1).getSec());
......
825 825
        Assert.assertNotNull(taxon5.getSecMicroReference());
826 826

  
827 827
        //set secundum
828
        SetSecundumForSubtreeConfigurator config = new SetSecundumForSubtreeConfigurator(subTreeUuid, newSec);
829
        config.setIncludeAcceptedTaxa(false);
830
        taxonNodeService.setSecundumForSubtree(config, null);
828
//        SetSecundumForSubtreeConfigurator config = new SetSecundumForSubtreeConfigurator(subTreeUuid, newSec, null);
829
//        config.setIncludeAcceptedTaxa(false);
830
        taxonNodeService.setSecundumForSubtree(subTreeUuid,  newSec, false, true, true, true, true, true, null);
831 831

  
832 832
        commitAndStartNewTransaction(new String[]{"TaxonBase","TaxonBase_AUD"});
833 833
        Assert.assertNull(taxonService.find(1).getSec());
......
859 859
        Assert.assertNotNull(taxon5.getSecMicroReference());
860 860

  
861 861
        //set secundum
862
        SetSecundumForSubtreeConfigurator config = new SetSecundumForSubtreeConfigurator(subTreeUuid, newSec);
863
        config.setIncludeSharedTaxa(false);
864
        taxonNodeService.setSecundumForSubtree(config, null);
862
     //   SetSecundumForSubtreeConfigurator config = new SetSecundumForSubtreeConfigurator(subTreeUuid, newSec, null);
863
   //     config.setIncludeSharedTaxa(false);
864
        taxonNodeService.setSecundumForSubtree(subTreeUuid, newSec, true, true, true, true, false, true, null);
865 865

  
866 866
        commitAndStartNewTransaction(new String[]{"TaxonBase","TaxonBase_AUD"});
867 867
        Assert.assertNull("Shared taxon must not be set", taxonService.find(1).getSec());

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)