misappliedName can be created directly from the accepted Taxon in TaxonNameEditor
authorKatja Luther <k.luther@bgbm.org>
Tue, 3 Jun 2014 10:01:45 +0000 (10:01 +0000)
committerKatja Luther <k.luther@bgbm.org>
Tue, 3 Jun 2014 10:01:45 +0000 (10:01 +0000)
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/ContainerFactory.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/operation/CreateConceptRelationOperation.java

index 7c9f0548fabb2670c3b4713152d9905ff0e4279f..da4e2dd1bec4d97e89f5093317b4655741c0c8dc 100644 (file)
                   name="separator1"
                   visible="true">
             </separator>
-           <!-- <command
+           <command
                   commandId="eu.etaxonomy.taxeditor.editor.name.createMisapplication"
                   label="Misapplication"
                   style="push">
                      </reference>
                   </or>
                </visibleWhen>
-            </command>-->
+            </command>
          </menu>
         <!--<command
                commandId="eu.etaxonomy.taxeditor.editor.name.changeAcceptedToSynonym"
             id="eu.etaxonomy.taxeditor.editor.name.createSynonymInHomotypicalGroup"
             name="Create Synonym In Homotypical Group">
       </command>
-     <!-- <command
+     <command
             categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.CreateMisapplicationHandler"
             id="eu.etaxonomy.taxeditor.editor.name.createMisapplication"
             name="Create Misapplication">
-      </command>-->
+      </command>
       <!--command
             defaultHandler="eu.etaxonomy.taxeditor.editor.handler.MoveTaxonHandler"
             id="eu.etaxonomy.taxeditor.editor.name.moveTaxon"
index 1634b7dcc860ac92238988c8800e382237447ca6..66c0f51479f97726ac7f9ef0dd306d7840557fca 100644 (file)
@@ -8,7 +8,9 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
@@ -88,7 +90,8 @@ public class ContainerFactory {
        public static void createOrUpdateMisapplicationsGroup(
                        TaxonNameEditor taxonNameEditor) {
                MisappliedGroup group = taxonNameEditor.getMisappliedGroup();
-               if(taxonNameEditor.getTaxon().getMisappliedNames().isEmpty()){
+               Taxon taxon = HibernateProxyHelper.deproxy(taxonNameEditor.getTaxon(), Taxon.class);
+               if(taxon.getMisappliedNames().isEmpty()){
                        taxonNameEditor.removeGroup(group);             
                        taxonNameEditor.setMisapplicationsGroup(null);
                }else{
index 40c92af92938f59b2ab03bc89f00eb4ace2bfdcd..4b48b8c6f1eed545782a0184544de67bc9dfef39 100644 (file)
@@ -69,9 +69,9 @@ public class CreateConceptRelationOperation extends AbstractPostTaxonOperation {
                monitor.worked(20);
                // add concept to taxon
                if(taxonRelationshipTypeInverseContainer.isInverse()){
-                       concept.addTaxonRelation(element, taxonRelationshipTypeInverseContainer.getType(), null, null);
+                       element.addTaxonRelation(concept, taxonRelationshipTypeInverseContainer.getType(), null, null);
                } else {
-                   element.addTaxonRelation(concept, taxonRelationshipTypeInverseContainer.getType(), null, null);
+                   concept.addTaxonRelation(element, taxonRelationshipTypeInverseContainer.getType(), null, null);
                }
                monitor.worked(40);