Project

General

Profile

« Previous | Next » 

Revision bfc8d3b4

Added by Katja Luther over 6 years ago

fix #6056: when creating checklisteditorInput don't init session at the beginning, but at the end of constructor

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditor.java
477 477
    /** {@inheritDoc} */
478 478
    @Override
479 479
    public void dispose() {
480
        this.checklistEditorInput.dispose();
481

  
480
    	this.checklistEditorInput.dispose();
481
    	super.dispose();
482
        
482 483
        conversation.unregisterForDataStoreChanges(this);
483
        conversation.close();
484
        super.dispose();
484
        conversation.unbind();
485
       
486
        //conversation.close();
487
		conversation = null;
485 488
    }
486 489

  
487 490
    /** {@inheritDoc} */
......
838 841

  
839 842
        return conversation;
840 843
    }
844
    
845
    
841 846
}
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorInput.java
21 21
import org.eclipse.ui.IPersistableElement;
22 22

  
23 23
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
24
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
24 25
import eu.etaxonomy.cdm.api.service.ITaxonService;
25 26
import eu.etaxonomy.cdm.model.taxon.Classification;
26 27
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
......
54 55
     * @param taxonNode
55 56
     */
56 57
    public ChecklistEditorInput(TaxonNode taxonNode){
57
        super(true);
58
        super(false);
59
        System.out.println(this.toString());
58 60
        this.conversation = CdmStore.createConversation();
59
        this.taxonNode = CdmStore.getCurrentApplicationConfiguration().getTaxonNodeService().load(taxonNode.getUuid());
61
        this.taxonNode =CdmStore.getService(ITaxonNodeService.class).load(taxonNode.getUuid(), getTaxonNodePropertyPaths());
60 62
       // getChildTaxa(taxonNode);
61 63
        classification = taxonNode.getClassification();
64
        initSession();
65
        System.out.println(this.toString());
62 66
    }
67
    
63 68

  
64 69
    /**
65 70
     * @param taxonNode2
......
241 246
    public ConversationHolder getConversation() {
242 247
        return conversation;
243 248
    }
249
    
250
    private List<String> getTaxonNodePropertyPaths() {
251
        List<String> taxonNodePropertyPaths = new ArrayList<String>();
252
        for(String propertyPath : getTaxonBasePropertyPaths()) {
253
            taxonNodePropertyPaths.add("taxon." + propertyPath);
254
        }
255
        return taxonNodePropertyPaths;
256
    }
257

  
258
    private List<String> getTaxonBasePropertyPaths() {
259
        List<String> taxonBasePropertyPaths = Arrays.asList(new String[] {
260
                "sec",
261
                "createdBy",
262
                "updatedBy",
263
                "annotations",
264
                "markers",
265
                "credits",
266
                "extensions",
267
                "rights",
268
                "sources",
269
                "descriptions",
270
                "relationsToThisTaxon",
271
                "relationsFromThisTaxon",
272
                "taxonNodes",
273
                "descriptions.descriptionElements.feature",
274
                "descriptions.descriptionElements.area",
275
                "descriptions.descriptionElements.status",
276
                "descriptions.markers",
277
                "name.descriptions",
278
                "name.typeDesignations",
279
                "name.status",
280
                "name.nomenclaturalReference.inReference",
281
                "name.taxonBases.taxonNodes",
282
                "name.relationsFromThisName",
283
                "name.relationsToThisName",
284
                "name.homotypicalGroup.typifiedNames.taxonBases.synonymRelations.synonym.name.status",
285
                "name.homotypicalGroup.typifiedNames.relationsToThisName.fromName",
286
                "synonymRelations.synonym.name.status.type",
287
                "synonymRelations.synonym.name.relationsToThisName.fromName",
288
                "synonymRelations.synonym.name.nomenclaturalReference.inReference.authorship",
289
                "synonymRelations.synonym.name.nomenclaturalReference.authorship",
290
                "synonymRelations.synonym.name.homotypicalGroup.typifiedNames.taxonBases.synonymRelations"
291
        });
292

  
293
        return taxonBasePropertyPaths;
294
    }
295
    
296
//    @Override
297
//    public void dispose(){
298
//    	conversation.unbind();
299
//    	conversation.close();
300
//    	getCdmEntitySession().dispose();
301
//    	super.dispose();
302
//    }
244 303

  
245 304
}

Also available in: Unified diff