Map preparation materials to derivation event description
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 1 Jul 2015 07:23:39 +0000 (09:23 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 1 Jul 2015 07:23:39 +0000 (09:23 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaSamplePreparationPreservationDetailElement.java

index 7db3cfaaf8e42107f4c80b3b7e3b76ec623b9deb..f31ad03dc8e3c5367505bf08d8487afe91c80014 100644 (file)
@@ -66,7 +66,9 @@ public class DnaSamplePreparationPreservationDetailElement extends AbstractCdmDe
         String materialOrMethodText = null;
         if(entity.getPreservation()!=null){
             temperature = entity.getPreservation().getTemperature();
         String materialOrMethodText = null;
         if(entity.getPreservation()!=null){
             temperature = entity.getPreservation().getTemperature();
-            materialOrMethodText = entity.getPreservation().getMaterialMethodText();
+        }
+        if(entity.getDerivedFrom()!=null){
+            materialOrMethodText = entity.getDerivedFrom().getDescription();
         }
         selectionInstitution = formFactory.createSelectionElement(Institution.class, getConversationHolder(), formElement, "Institution", institution, EntitySelectionElement.ALL, style);
         selectionStaff = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), formElement, "Staff", staff, EntitySelectionElement.ALL, style);
         }
         selectionInstitution = formFactory.createSelectionElement(Institution.class, getConversationHolder(), formElement, "Institution", institution, EntitySelectionElement.ALL, style);
         selectionStaff = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), formElement, "Staff", staff, EntitySelectionElement.ALL, style);
@@ -103,8 +105,8 @@ public class DnaSamplePreparationPreservationDetailElement extends AbstractCdmDe
         else if(eventSource==numberPreservationTemperature && numberPreservationTemperature.getText()!=null){
             addPreservationMethod().setTemperature(numberPreservationTemperature.getDouble());
         }
         else if(eventSource==numberPreservationTemperature && numberPreservationTemperature.getText()!=null){
             addPreservationMethod().setTemperature(numberPreservationTemperature.getDouble());
         }
-        else if(eventSource==txtMaterialOrMethods){
-            addPreservationMethod().setMaterialMethodText(txtMaterialOrMethods.getText());
+        else if(eventSource==txtMaterialOrMethods && getEntity().getDerivedFrom()!=null){
+            getEntity().getDerivedFrom().setDescription(txtMaterialOrMethods.getText());
         }
     }
 
         }
     }