move ChangeConceptToSynonym business logic from editor operation to service layer
authorKatja Luther <k.luther@bgbm.org>
Wed, 12 Feb 2014 12:27:53 +0000 (12:27 +0000)
committerKatja Luther <k.luther@bgbm.org>
Wed, 12 Feb 2014 12:27:53 +0000 (12:27 +0000)
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientTaxonService.java
eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar
eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeConceptToSynonymOperation.java
eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF

index 587b20bbbbabc06d99bf1d7100d2b9329808a18e..b78da64c1e966470030f23d818515b27241719c9 100644 (file)
@@ -1394,6 +1394,18 @@ public class TransientTaxonService implements ITaxonService {
         return defaultTaxonService.getSynonymsByHomotypicGroup(taxon, propertyPaths);
     }
 
+       @Override
+       public Synonym changeRelatedTaxonToSynonym(Taxon fromTaxon, Taxon toTaxon,
+                       TaxonRelationshipType oldRelationshipType,
+                       SynonymRelationshipType synonymRelationshipType)
+                       throws DataChangeNoRollbackException {
+               
+               return defaultTaxonService.changeRelatedTaxonToSynonym(fromTaxon, toTaxon, oldRelationshipType, synonymRelationshipType);
+       }
+
+    
+
+       
 
 
 }
index 9fb167cc8644ced846238dee40784f7341832719..4cf488ee33f1a17bac6e7badc2adfac6cf54f75d 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar and b/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar differ
index 25f118068392d39fda76feea6c855dfb3633db17..f131a431cbf20a8f2194c84912950bd3e0a6485b 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar and b/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar differ
index 6a295e64e9a9763f8d9f779ea4d814aab2523b6c..b0428d5bc511cf107fe2896d9aa8a14e82725e6e 100644 (file)
@@ -115,7 +115,7 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
        else if(taxonBase.isInstanceOf(Taxon.class)){
                Taxon taxon = CdmBase.deproxy(taxonBase, Taxon.class);
 
-               if (taxon.isMisapplication()){
+               if (taxon.getTaxonNodes().size() == 0 && taxon.isMisapplication()){
                        // TODO get accepted taxon
                        EditorUtil.info("trying to open Mispplied Name ");
 
index 62e56bcd4bf62e262f88642a72080bef78febb07..3219c650c5b21b56653f5b8f632f0ce1930bd7e3 100644 (file)
@@ -17,14 +17,18 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.api.service.exception.DataChangeNoRollbackException;
 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
@@ -87,19 +91,16 @@ public class ChangeConceptToSynonymOperation extends
 
                // Create new synonym using concept name
                TaxonNameBase<?, ?> synonymName = concept.getName();
-
-               // Remove concept relation from taxon
-               element.removeTaxon(concept, oldRelationshipType);
-               monitor.worked(20);
-
-               // Add name to new homotypic group
-               homotypicalGroup.addTypifiedName(synonymName);
-               monitor.worked(40);
-
-        // Create a new synonym for the taxon
-               newSynonymRelationship = element.addHeterotypicSynonymName(synonymName);
-
-               return postExecute(newSynonymRelationship.getSynonym());
+               Synonym synonym = null;
+               try {
+                       synonym = CdmStore.getService(ITaxonService.class).changeRelatedTaxonToSynonym(concept, element, taxonRelationship.getType(), null);
+               } catch (DataChangeNoRollbackException e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
+               }
+               
+       
+               return postExecute(synonym);
        }
 
        /* (non-Javadoc)
index 26bd4ff9581a6585d8d2ab3f14ddb177b5165d06..c3b5a4e33d389a3f1c9269e4f71599e9f582b4a0 100644 (file)
@@ -80,137 +80,159 @@ Import-Package: org.eclipse.core.commands,
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ClassPath: .,
- activation-1.1.jar,
- antlr-2.7.6.jar,
+ activation-1.1.1.jar,
+ antlr-2.7.7.jar,
  aopalliance-1.0.jar,
- asm-attrs.jar,
- asm.jar,
- aspectjrt-1.6.3.jar,
- aspectjweaver-1.6.3.jar,
- avalon-framework-4.2.0.jar,
- batik-all-1.7.jar,
- c3p0-0.9.1.jar,
- cdmlib-commons-3.0.7-SNAPSHOT.jar,
- cdmlib-ext-3.0.7-SNAPSHOT.jar,
- cdmlib-io-3.0.7-SNAPSHOT.jar,
- cdmlib-model-3.0.7-SNAPSHOT.jar,
- cdmlib-persistence-3.0.7-SNAPSHOT.jar,
- cdmlib-print-3.0.7-SNAPSHOT.jar,
- cdmlib-remote-3.0.7-SNAPSHOT.jar,
- cglib-2.1.3.jar,
- commons-beanutils-1.7.0.jar,
- commons-collections-3.2.jar,
- commons-dbcp-1.2.2.jar,
- commons-io-1.3.1.jar,
- commons-logging-1.0.4.jar,
- commons-pool-1.3.jar,
+ aspectjrt-1.7.1.jar,
+ aspectjweaver-1.7.1.jar,
+ avro-1.6.3.jar,
+ batik-anim-1.7.jar,
+ batik-awt-util-1.7.jar,
+ batik-bridge-1.7.jar,
+ batik-css-1.7.jar,
+ batik-dom-1.7.jar,
+ batik-ext-1.7.jar,
+ batik-extension-1.7.jar,
+ batik-gvt-1.7.jar,
+ batik-js-1.7.jar,
+ batik-parser-1.7.jar,
+ batik-script-1.7.jar,
+ batik-svg-dom-1.7.jar,
+ batik-svggen-1.7.jar,
+ batik-transcoder-1.7.jar,
+ batik-util-1.7.jar,
+ batik-xml-1.7.jar,
+ c3p0-0.9.2.jar,
+ cdmlib-commons-3.3.1-SNAPSHOT-sources.jar,
+ cdmlib-commons-3.3.1-SNAPSHOT.jar,
+ cdmlib-ext-3.3.1-SNAPSHOT-sources.jar,
+ cdmlib-ext-3.3.1-SNAPSHOT.jar,
+ cdmlib-io-3.3.1-SNAPSHOT-sources.jar,
+ cdmlib-io-3.3.1-SNAPSHOT.jar,
+ cdmlib-model-3.3.1-SNAPSHOT-sources.jar,
+ cdmlib-model-3.3.1-SNAPSHOT.jar,
+ cdmlib-persistence-3.3.1-SNAPSHOT-sources.jar,
+ cdmlib-persistence-3.3.1-SNAPSHOT.jar,
+ cdmlib-print-3.3.1-SNAPSHOT-sources.jar,
+ cdmlib-print-3.3.1-SNAPSHOT.jar,
+ cdmlib-remote-3.3.1-SNAPSHOT-sources.jar,
+ cdmlib-remote-3.3.1-SNAPSHOT.jar,
+ cdmlib-services-3.3.1-SNAPSHOT-sources.jar,
+ cglib-nodep-2.2.2.jar,
+ commons-codec-20041127.091804.jar,
+ concurrent-1.3.4.jar,
+ dbunit-2.4.9.jar,
  dom4j-1.6.1.jar,
- dozer-5.3.0-sources.jar,
+ doxia-core-1.3.jar,
+ doxia-logging-api-1.3.jar,
+ doxia-module-apt-1.3.jar,
+ doxia-module-xhtml-1.3.jar,
+ doxia-sink-api-1.3.jar,
  dozer-5.3.0.jar,
- ehcache-1.2.3.jar,
- ejb3-persistence.jar,
- ezmorph-1.0.4.jar,
- fop.jar,
+ easymockclassextension-2.3.jar,
+ ehcache-core-2.4.3.jar,
+ ezmorph-1.0.6.jar,
+ fop-1.1.jar,
  google-api-translate-java-0.92.jar,
- hibernate-annotations-3.4.0-SNAPSHOT.jar,
- hibernate-commons-annotations-3.4.0-SNAPSHOT.jar,
- hibernate-core-3.4.0-SNAPSHOT.jar,
- hibernate-envers-3.4.0-SNAPSHOT.jar,
- hibernate-search-3.1.0.GA.jar,
- hibernate-tools-3.2.0.ga.jar,
- hibernate-validator-4.0.0.CR1.jar,
- hsqldb.jar,
- httpclient-4.0.1.jar,
- httpcore-4.0.1.jar,
- javassist.jar,
- jaxb-api-2.1.6.jar,
- jaxb-impl-2.1.6.jar,
- jaxen-1.1.2.jar,
- jdbc-1.2.jar,
- jdbc2_0-stdext.jar,
- jdom.jar,
- joda-time-1.5.jar,
- joda-time-hibernate-1.0.jar,
- json-lib-2.2.3-jdk15.jar,
+ guava-r05.jar,
+ hamcrest-core-1.3.jar,
+ hibernate-c3p0-4.1.10.Final.jar,
+ hibernate-cglib-repack-2.1_3.jar,
+ hibernate-commons-annotations-4.0.1.Final.jar,
+ hibernate-core-4.1.10.Final.jar,
+ hibernate-ehcache-4.1.10.Final.jar,
+ hibernate-entitymanager-4.1.10.Final.jar,
+ hibernate-envers-4.1.10.Final.jar,
+ hibernate-jpa-2.0-api-1.0.1.Final.jar,
+ hibernate-search-4.2.0.Final.jar,
+ hibernate-search-analyzers-4.2.0.Final.jar,
+ hibernate-search-engine-4.2.0.Final.jar,
+ hibernate-search-orm-4.2.0.Final.jar,
+ hsqldb-1.8.0.10.jar,
+ httpclient-4.2.3.jar,
+ httpcore-4.2.4.jar,
+ icu4j-2.6.1.jar,
+ identificationKeyAPI-1.0-SNAPSHOT-sources.jar,
+ identificationKeyAPI-1.0-SNAPSHOT.jar,
+ jakarta-regexp-1.4.jar,
+ jaxb-api-2.2.7.jar,
+ jaxb-impl-2.2-EA.jar,
+ jaxb-xjc-2.2-EA.jar,
+ jaxb1-impl-2.2-EA.jar,
+ jaxen-1.1.4.jar,
+ jboss-transaction-api_1.1_spec-1.0.0.Final.jar,
+ jdbc4-2.0.jar,
+ jdom-1.1.3.jar,
+ json-lib-2.4-jdk15.jar,
  jsr250-api-1.0.jar,
- jta.jar,
- jtds-1.2.2.jar,
- junit-4.4.jar,
- junit-4.8.1-sources.jar,
- junit-4.8.1.jar,
- log4j-1.2.14.jar,
+ jtds-1.3.0.jar,
+ junit-4.11.jar,
+ junit-benchmarks-0.5.0.jar,
  lsid-client-1.1.2.jar,
  lsid-server-1.1.2.jar,
- lucene-core-2.4.0.jar,
- lucene-spellchecker-2.4.0.jar,
- mail-1.4.jar,
- msbase-2000.3.jar,
- mssqlserver-2000.3.jar,
- msutil-2000.3.jar,
- mysql-connector-java-5.0.5.jar,
+ lucene-analyzers-3.6.2.jar,
+ lucene-core-3.6.2.jar,
+ lucene-facet-3.6.2.jar,
+ lucene-grouping-3.6.2.jar,
+ lucene-highlighter-3.6.2.jar,
+ lucene-kuromoji-3.6.2.jar,
+ lucene-memory-3.6.2.jar,
+ lucene-misc-3.6.2.jar,
+ lucene-phonetic-3.6.2.jar,
+ lucene-queries-3.6.2.jar,
+ lucene-smartcn-3.6.2.jar,
+ lucene-spatial-3.6.2.jar,
+ lucene-spellchecker-3.6.2.jar,
+ lucene-stempel-3.6.2.jar,
+ mchange-commons-java-0.2.3.3.jar,
  odfdom-0.8.jar,
- opencsv-1.8.jar,
- org.springframework.aop-3.0.4.RELEASE-sources.jar,
- org.springframework.asm-3.0.4.RELEASE-sources.jar,
- org.springframework.aspects-3.0.4.RELEASE-sources.jar,
- org.springframework.beans-3.0.4.RELEASE-sources.jar,
- org.springframework.context-3.0.4.RELEASE-sources.jar,
- org.springframework.context.support-3.0.4.RELEASE-sources.jar,
- org.springframework.core-3.0.4.RELEASE-sources.jar,
- org.springframework.expression-3.0.4.RELEASE-sources.jar,
- org.springframework.jdbc-3.0.4.RELEASE-sources.jar,
- org.springframework.orm-3.0.4.RELEASE-sources.jar,
- org.springframework.oxm-3.0.4.RELEASE-sources.jar,
- org.springframework.transaction-3.0.4.RELEASE-sources.jar,
- org.springframework.web-3.0.4.RELEASE-sources.jar,
- org.springframework.web.servlet-3.0.4.RELEASE-sources.jar,
- poi-3.1-FINAL.jar,
- postgresql-8.2-504.jdbc4.jar,
- saxon9he.jar,
- serializer-2.7.0.jar,
+ odfdom-java-0.8.7.jar,
+ ognl-2.6.9.jar,
+ opencsv-2.3.jar,
+ p6spy-1.3.jar,
+ paranamer-2.3.jar,
+ plexus-classworlds-1.2-alpha-9.jar,
+ plexus-container-default-1.0-alpha-30.jar,
+ plexus-utils-2.0.5.jar,
+ poi-3.9.jar,
+ postgresql-9.1-901.jdbc4.jar,
  servlet-api-2.5.jar,
+ solr-analysis-extras-3.6.2.jar,
+ solr-core-3.6.2.jar,
+ solr-solrj-3.6.2.jar,
+ spring-aop-3.2.2.RELEASE.jar,
+ spring-beans-3.2.2.RELEASE.jar,
+ spring-context-3.2.2.RELEASE.jar,
+ spring-context-support-3.2.2.RELEASE.jar,
+ spring-core-3.2.2.RELEASE.jar,
+ spring-expression-3.2.2.RELEASE.jar,
  spring-modules-cache-0.7.jar,
- spring-modules-lucene-0.8a.jar,
- wsdl4j-1.6.1.jar,
- xalan-2.7.0.jar,
- xercesImpl-2.7.1.jar,
- xercesImpl.jar,
- xml-apis-1.3.04.jar,
+ stax-1.2.0.jar,
+ stax-api-1.0.1.jar,
+ unitils-core-3.3.jar,
+ unitils-database-3.3.jar,
+ unitils-dbmaintainer-3.3.jar,
+ unitils-dbunit-3.3.jar,
+ unitils-easymock-3.3.jar,
+ unitils-inject-3.3.jar,
+ unitils-mock-3.3.jar,
+ unitils-orm-3.3.jar,
+ unitils-spring-3.3.jar,
+ usertype.jodatime-2.0.1.jar,
+ usertype.spi-2.0.1.jar,
+ validation-api-1.0.0.GA.jar,
+ wsdl4j-1.6.2.jar,
+ xalan-2.6.0.jar,
+ xercesImpl-2.11.0.jar,
+ xml-apis-1.0.b2.jar,
  xml-apis-ext-1.3.04.jar,
- xml-apis.jar,
  xml-resolver-1.2.jar,
- xmlgraphics-commons-1.3.1.jar,
+ xmlParserAPIs-2.6.2.jar,
+ xmlgraphics-commons-1.5.jar,
+ xmlpull-1.1.3.1.jar,
+ xmlunit-1.4.jar,
  xom-1.0.jar,
- xsltc.jar,
- xstream-1.3.1.jar,
- yjp-controller-api-redist-8.0.1.jar,
- ant-antlr.jar,
- ant-apache-bcel.jar,
- ant-apache-bsf.jar,
- ant-apache-log4j.jar,
- ant-apache-oro.jar,
- ant-apache-regexp.jar,
- ant-apache-resolver.jar,
- ant-commons-logging.jar,
- ant-commons-net.jar,
- ant-jai.jar,
- ant-javamail.jar,
- ant-jdepend.jar,
- ant-jmf.jar,
- ant-jsch.jar,
- ant-junit.jar,
- ant-launcher.jar,
- ant-netrexx.jar,
- ant-nodeps.jar,
- ant-starteam.jar,
- ant-stylebook.jar,
- ant-swing.jar,
- ant-trax.jar,
- ant-weblogic.jar,
- ant.jar,
- runtime_registry_compatibility.jar,
- jdi.jar,
- jdimodel.jar,
- pdebuild.jar,
- compatibility.jar,
- junit.jar
+ xpp3-1.1.4c.jar,
+ xpp3_min-1.1.4c.jar,
+ xstream-1.4.4.jar,
+ yjp-controller-api-redist-9.0.8.jar