Project

General

Profile

Revision 0d3d2e38

ID0d3d2e38f001e5dddaf2824d82afbfcd094702dd
Parent 070e6317
Child 3b0ec7a1

Added by Katja Luther over 1 year ago

ref #8088: fix TOE in edit taxon node wizard when changing taxon

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/EditTaxonNodeWizard.java
8 8
*/
9 9
package eu.etaxonomy.taxeditor.ui.section.classification;
10 10

  
11
import java.util.Collection;
12
import java.util.Collections;
13
import java.util.List;
14
import java.util.Map;
15

  
11 16
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
12 17
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
13 18
import eu.etaxonomy.cdm.persistence.dto.MergeResult;
14 19
import eu.etaxonomy.taxeditor.newWizard.IWizardPageListener;
20
import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
21
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
15 22
import eu.etaxonomy.taxeditor.store.CdmStore;
16 23

  
17 24
/**
......
19 26
 * @date 23.03.2016
20 27
 *
21 28
 */
22
public class EditTaxonNodeWizard extends AbstractEditWizard<TaxonNode> {
29
public class EditTaxonNodeWizard extends AbstractEditWizard<TaxonNode> implements ICdmEntitySessionEnabled{
23 30

  
24 31
    private TaxonNodeWizardPage taxonNodePage;
25 32
    private IWizardPageListener wizardPageListener;
33
    private ICdmEntitySession cdmEntitySession;
34

  
26 35

  
27 36
    /* (non-Javadoc)
28 37
     * @see eu.etaxonomy.taxeditor.ui.section.classification.AbstractEditWizard#getEntityName()
......
60 69
    @Override
61 70
    public void setEntity(TaxonNode entity) {
62 71
        setWindowTitle(String.format("Edit %s", getEntityName()));
72
        if (CdmStore.isActive() && cdmEntitySession == null) {
73

  
74
            cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
75
            cdmEntitySession.bind();
76
        }
63 77
        entity = CdmStore.getService(ITaxonNodeService.class).load(entity.getUuid());
64 78
        super.setEntity(entity);
65 79
    }
66 80

  
81
    /**
82
     * {@inheritDoc}
83
     */
84
    @Override
85
    public ICdmEntitySession getCdmEntitySession() {
86

  
87
        return cdmEntitySession;
88
    }
89

  
90
    /**
91
     * {@inheritDoc}
92
     */
93
    @Override
94
    public Collection<TaxonNode> getRootEntities() {
95
        return Collections.singleton(this.getEntity());
96
    }
97

  
98
    /**
99
     * {@inheritDoc}
100
     */
101
    @Override
102
    public Map<Object, List<String>> getPropertyPathsMap() {
103
        // TODO Auto-generated method stub
104
        return null;
105
    }
106

  
67 107

  
68 108

  
69 109
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java
265 265
		} else if (eventSource == selection_reuseExistingTaxon) {
266 266
		    if (selection_reuseExistingTaxon.getEntity() != null){
267 267
		        setTaxon(selection_reuseExistingTaxon.getEntity());
268
		        if (getTaxon().getSec()!= null){
269
		            textTaxonSec.setText((getTaxon().getSec().getTitleCache()));
270
		        }else{
271
		            textTaxonSec.setText("");
272
		        }
273
		        checkbox_publish.setSelected(getTaxon().isPublish());
268 274
            }
269 275
			complete = true;
270 276
		} else if (eventSource == selection_reuseExistingName) {

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)