Merge branch 'develop' into LibrAlign
authorPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 12 Apr 2016 08:03:42 +0000 (10:03 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 12 Apr 2016 08:03:42 +0000 (10:03 +0200)
916 files changed:
.gitattributes
.gitignore
eu.etaxonomy.taxeditor.application/.classpath
eu.etaxonomy.taxeditor.application/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.application/build.properties
eu.etaxonomy.taxeditor.application/plugin.xml
eu.etaxonomy.taxeditor.application/pom.xml
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationWorkbenchAdvisor.java
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationWorkbenchWindowAdvisor.java
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/DerivatePerspective.java
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/update/P2Util.java
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/update/UpdateHandler.java
eu.etaxonomy.taxeditor.application/src/main/resources/log4j.properties [deleted file]
eu.etaxonomy.taxeditor.bulkeditor/.classpath
eu.etaxonomy.taxeditor.bulkeditor/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/bundle.properties
eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/bundle_de.properties
eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/messages.properties
eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/messages_de.properties
eu.etaxonomy.taxeditor.bulkeditor/plugin.xml
eu.etaxonomy.taxeditor.bulkeditor/pom.xml
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/AnnotatedLineDocumentProvider.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/AnnotatedLineEditor.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/IEntityContainer.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/IEntityPersistenceService.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/LineAnnotation.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditorLables.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditorLineDisplay.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/BulkEditorPropertyTester.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/OpenBulkEditorContributionItem.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/ConvertPerson2TeamHandler.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/ConvertTeam2PersonHandler.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AgentEditorInput.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/BulkEditorInputType.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/GroupEditorInput.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/MediaEditorInput.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/Messages.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/NameEditorInput.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/NameRelationshipEditorInput.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/OccurrenceEditorInput.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/ReferenceEditorInput.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/TaxonEditorInput.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/UserEditorInput.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/MediaCreator.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/UserCreator.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/preference/BulkEditorMarkerPreferencePage.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/ReferencingObjectsView.java
eu.etaxonomy.taxeditor.cdmlib/.classpath
eu.etaxonomy.taxeditor.cdmlib/.gitignore
eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.cdmlib/build.properties
eu.etaxonomy.taxeditor.cdmlib/lib/FastInfoset-1.2.13.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/Saxon-HE-9.7.0-2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/apache-log4j-extras-1.2.17.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/aspectjrt-1.7.1-sources.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/aspectjrt-1.8.8.jar [moved from eu.etaxonomy.taxeditor.cdmlib/lib/aspectjrt-1.7.1.jar with 52% similarity]
eu.etaxonomy.taxeditor.cdmlib/lib/aspectjweaver-1.7.1-sources.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/aspectjweaver-1.7.1.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/aspectjweaver-1.8.8.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/batik-ext-1.7.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/batik-ext-1.8.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/c3p0-0.9.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/c3p0-0.9.5.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/cglib-3.2.0.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/cglib-nodep-2.2.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/cglib-nodep-3.2.0.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/classmate-1.3.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/codemodel-2.2.11.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/commons-beanutils-1.8.3.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/commons-beanutils-1.9.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/commons-codec-1.10.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/commons-codec-20041127.091804.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/commons-collections-3.2.1.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/commons-collections-3.2.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/commons-csv-1.0.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/commons-lang3-3.3.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/commons-logging-1.1.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/commons-logging-1.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/doxia-core-1.3.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/doxia-core-1.6.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/doxia-logging-api-1.3.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/doxia-logging-api-1.6.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/doxia-module-apt-1.3.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/doxia-module-apt-1.6.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/doxia-module-xhtml-1.3.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/doxia-module-xhtml-1.6.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/doxia-sink-api-1.6.jar [moved from eu.etaxonomy.taxeditor.cdmlib/lib/doxia-sink-api-1.3.jar with 61% similarity]
eu.etaxonomy.taxeditor.cdmlib/lib/dtd-parser-1.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/easymock-2.3.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/easymock-3.1.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/ehcache-core-2.6.11.jar [moved from eu.etaxonomy.taxeditor.cdmlib/lib/ehcache-core-2.6.9.jar with 79% similarity]
eu.etaxonomy.taxeditor.cdmlib/lib/guava-19.0.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/guava-r05.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/h2-1.3.170.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/h2-1.4.190.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-c3p0-4.1.10.Final.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-c3p0-5.0.7.Final.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-commons-annotations-4.0.1.Final.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-commons-annotations-5.0.1.Final.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-core-4.1.10.Final.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-core-5.0.7.Final.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-ehcache-4.1.10.Final.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-ehcache-5.0.7.Final.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-entitymanager-4.1.10.Final.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-entitymanager-5.0.7.Final.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-envers-4.1.10.Final.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-envers-5.0.7.Final.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-jpa-2.0-api-1.0.1.Final.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-jpa-2.1-api-1.0.0.Final.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-search-engine-4.2.0.Final.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-search-engine-5.5.2.Final.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-search-orm-4.2.0.Final.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-search-orm-5.5.2.Final.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-validator-4.3.1.Final.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-validator-5.2.2.Final.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-validator-cdi-5.2.2.Final.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/hsqldb-1.8.0.10.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/hsqldb-2.3.3.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/httpclient-4.2.3.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/httpclient-4.5.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/httpclient-cache-4.2.6.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/httpcore-4.2.4.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/httpcore-4.4.4.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/httpmime-4.5.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/identificationKeyAPI-1.0-SNAPSHOT-sources.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/identificationKeyAPI-1.0-SNAPSHOT.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/identificationKeyAPI-1.0.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/istack-commons-runtime-2.21.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/istack-commons-tools-2.21.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/itextpdf-5.4.0.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/itextpdf-5.5.8.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jackson-annotations-2.6.5.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jackson-core-2.6.5.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jackson-databind-2.6.5.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jandex-2.0.0.Final.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/javassist-3.17.1-GA.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/javassist-3.20.0-GA.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/javax.el-2.2.6.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/javax.el-api-2.2.5.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/javax.servlet-api-3.1.0.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-api-2.2.12.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-api-2.2.7.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-core-2.2.11.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-impl-2.2-EA.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-jxc-2.2.11.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-runtime-2.2.11.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-xjc-2.2-EA.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-xjc-2.2.11.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jaxen-1.1.6.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jboss-logging-3.1.3.GA.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/jboss-logging-3.3.0.Final.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jcl-over-slf4j-1.7.6.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jdom2-2.0.6.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jena-arq-2.13.0.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jena-core-2.11.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/jena-core-2.13.0.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jena-iri-1.0.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/jena-iri-1.1.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jena-tdb-1.1.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/joda-time-2.1.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/joda-time-2.9.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/json-20090211.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jsonld-java-0.5.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jta-1.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/jtds-1.3.1.jar [moved from eu.etaxonomy.taxeditor.cdmlib/lib/jtds-1.3.0.jar with 50% similarity]
eu.etaxonomy.taxeditor.cdmlib/lib/junit-4.11.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/junit-4.12.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/junit-benchmarks-0.5.0.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/junit-benchmarks-0.7.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/libthrift-0.9.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-analyzers-3.6.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-analyzers-common-5.4.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-backward-codecs-5.4.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-core-3.6.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-core-5.4.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-facet-3.6.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-facet-5.4.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-grouping-3.6.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-grouping-5.4.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-highlighter-3.6.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-highlighter-5.4.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-join-5.4.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-kuromoji-3.6.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-memory-3.6.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-memory-5.4.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-misc-3.6.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-misc-5.4.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-phonetic-3.6.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-queries-3.6.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-queries-5.4.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-queryparser-5.4.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-sandbox-5.4.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-smartcn-3.6.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-spatial-3.6.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-spellchecker-3.6.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-stempel-3.6.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/lucene-suggest-5.4.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/mapstruct-1.0.0.Final.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/mchange-commons-java-0.2.11.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/mchange-commons-java-0.2.3.3.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/mysql-connector-java-5.1.38.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.aop-3.2.2.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.aspects-3.2.2.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.beans-3.2.2.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.core-3.2.2.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.expression-3.2.2.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.jdbc-3.2.2.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.orm-3.2.2.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.oxm-3.2.2.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.test-3.2.2.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.transaction-3.2.2.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.web-3.2.2.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.web.servlet-3.2.2.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/p6spy-1.3.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/p6spy-2.1.4.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/plexus-component-annotations-1.5.5.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/plexus-utils-2.0.5.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/plexus-utils-3.0.15.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/poi-3.10-FINAL.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/poi-3.13.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/poi-ooxml-3.10-FINAL.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/poi-ooxml-3.13.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/poi-ooxml-schemas-3.13.jar [moved from eu.etaxonomy.taxeditor.cdmlib/lib/poi-ooxml-schemas-3.10-FINAL.jar with 70% similarity]
eu.etaxonomy.taxeditor.cdmlib/lib/postgresql-9.1-901.jdbc4.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/postgresql-9.4-1206-jdbc4.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/relaxngDatatype-20020414.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/rngom-2.2.11.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-api-1.7.13.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-api-1.7.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-log4j12-1.7.13.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-log4j12-1.7.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-nop-1.7.13.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-aop-3.2.2.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-aop-4.2.4.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-aspects-4.2.4.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-beans-3.2.2.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-beans-4.2.4.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-context-3.2.2.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-context-4.2.4.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-context-support-3.2.2.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-context-support-4.2.4.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-core-3.2.2.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-core-4.2.4.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-expression-3.2.2.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-expression-4.2.4.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-jdbc-4.2.4.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-orm-4.2.4.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-oxm-4.2.4.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-plugin-core-1.2.0.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-plugin-metadata-1.2.0.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-config-3.1.3.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-config-4.0.3.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-core-3.1.3.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-core-4.0.3.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-remoting-3.1.3.RELEASE.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-web-4.0.3.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-test-4.2.4.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-tx-4.2.4.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-web-4.2.4.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/spring-webmvc-4.2.4.RELEASE.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/springfox-core-2.3.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/springfox-schema-2.3.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/springfox-spi-2.3.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/springfox-spring-web-2.3.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/springfox-swagger-common-2.3.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/springfox-swagger2-2.3.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/standard-1.1.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/stax-ex-1.7.7.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/swagger-annotations-1.3.5.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/swagger-annotations-1.5.6.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/swagger-models-1.5.5.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/tools.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/txw2-2.2.11.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/unitils-core-3.3.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/unitils-core-3.4.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/unitils-database-3.3.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/unitils-database-3.4.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbmaintainer-3.3.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbmaintainer-3.4.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbunit-3.3.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbunit-3.4.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/unitils-easymock-3.3.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/unitils-easymock-3.4.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/unitils-inject-3.3.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/unitils-inject-3.4.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/unitils-mock-3.3.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/unitils-mock-3.4.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/unitils-orm-3.3.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/unitils-orm-3.4.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/unitils-spring-3.3.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/unitils-spring-3.4.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/validation-api-1.0.0.GA.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/validation-api-1.1.0.Final.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/wsdl4j-1.6.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/wsdl4j-1.6.3.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/x-1.1.2.tld [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/xalan-2.6.0.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/xalan-2.7.0.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/xmlParserAPIs-2.6.2.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/xmlbeans-2.6.0.jar [moved from eu.etaxonomy.taxeditor.cdmlib/lib/xmlbeans-2.3.0.jar with 55% similarity]
eu.etaxonomy.taxeditor.cdmlib/lib/xmlunit-1.4.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/xmlunit-1.6.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/xom-1.0.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/xom-1.2.5.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/xsom-20140925.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/xstream-1.4.4.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/xstream-1.4.8.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/pom.xml
eu.etaxonomy.taxeditor.cdmlib/resources/cdm.map.ser [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationException.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationRemoteConfiguration.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationRemoteController.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationState.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmChangeEvent.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmDataChangeService.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/ICdmChangeListener.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/ICdmDataChangeService.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/cache/CdmServiceCacher.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/CdmEagerLoadingException.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/CdmRemotingException.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CacheLoader.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmClientCacheException.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmEntityCacheKey.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmModelCacher.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmModelFieldPropertyFromClass.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmRemoteCacheManager.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmTransientEntityCacher.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/EntityCacherDebugResult.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/ProxyUtils.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/server/CDMServerException.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/server/CDMServerUtils.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmPersistentRemoteSource.java [moved from eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/remote/CdmPersistentRemoteSource.java with 88% similarity]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmRemoteSource.java [moved from eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/remote/CdmRemoteSource.java with 96% similarity]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmRemoteSourceBase.java [moved from eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/remote/CdmRemoteSourceBase.java with 65% similarity]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmRemoteSourceException.java [moved from eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/remote/CdmRemoteSourceException.java with 82% similarity]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmServerInfo.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmServerInfoConfig.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/ICdmRemoteSource.java [moved from eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/remote/ICdmRemoteSource.java with 94% similarity]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CachedCommonServiceImpl.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CdmAuthenticatedHttpInvokerRequestExecutor.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CdmServiceInterceptorException.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CdmServiceRequestExecutor.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/ICachedCommonService.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/TermServiceRequestExecutor.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/CdmClientSessionException.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/CdmEntitySession.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionManager.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/DefaultNewEntityListener.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySession.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySessionEnabled.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySessionManager.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySessionManagerObserver.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/NullSession.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/mock/MockCdmEntitySession.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/mock/MockCdmEntitySessionManager.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/collection/internal/AbstractPersistentCollection.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/proxy/AbstractLazyInitializer.java
eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/httpInvokerServiceClients.xml
eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/localApplicationContext.xml
eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/mappings/hibernate.cfg.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/remotingApplicationContext.xml
eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/remoting_persistence_security.xml [deleted file]
eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/remoting_services_security.xml [deleted file]
eu.etaxonomy.taxeditor.cdmlib/src/main/resources/log4j.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/src/test/resources/eu/etaxonomy/cdm/datasources/cdm.datasources.xml [deleted file]
eu.etaxonomy.taxeditor.editor/.classpath
eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages_de.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin.properties
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_de.properties
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_en.properties [deleted file]
eu.etaxonomy.taxeditor.editor/build.properties
eu.etaxonomy.taxeditor.editor/icons/synced.gif [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/pom.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorCdmViewer.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/Messages.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/MultiPageTaxonEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenDerivateViewHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenTaxonEditorHandler.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/SpecimenPropertyTester.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/TaxonParameterConverter.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/create/NewSpecimenHandler.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/defaultHandler/DefaultOpenTaxonEditorForTaxonHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/defaultHandler/DefaultOpenTaxonEditorForTaxonNodeHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/AbstractIdentificationEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/KeyEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyEditorLabels.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyListContentProvider.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyListEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/RemotingCreateChildPolytomousKeyNodeHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/RemotingCreateSiblingPolytomousKeyNodeHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/CreateNodeOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/DeleteNodeOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/RemotingCreatePolytomousKeyNodeOperation.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/TaxonNameEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/MisapplicationContainer.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/ChangeSynonymToAcceptedTaxonHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/ChangeToMisapplicationHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/CreateHomotypicSynonymHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/CreateSynonymInHomotypicalGroupHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/DeleteTaxonBaseHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/MoveSynonymToAnotherAcceptedTaxonHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/NameEditorMenuPropertyTester.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/SwapSynonymAndAcceptedHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeConceptToSynonymOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeHomotypicalGroupBasionymOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeSynonymToAcceptedTaxonOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeSynonymToMisapplicationOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/CreateSynonymInExistingHomotypicalGroupOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteMisapplicationOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteSynonymOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteTaxonBaseOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteTaxonOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/MoveSynonymToAnotherAcceptedTaxonOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/SwapSynonymAndAcceptedOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/graph/ConceptGraphView.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientAgentService.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientCdmRepository.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientClassificationService.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientCollectionService.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientDescriptionService.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientNameService.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientOccurenceService.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientReferenceService.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientTaxonService.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientTermService.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateDragListener.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateDropListener.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateViewEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivativeEditorPropertyTester.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/CreateDerivateContextMenu.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/CreateFieldUnitContextMenu.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/DerivateViewContextMenu.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/ListenToSelectionChangeContextMenu.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/SingleReadSequenceContextMenu.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/CreateFieldUnitHandler.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/DeleteDerivateHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/ListenToSelectionChangeHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivateEditorForTaxonHandler.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivativeEditorForDescriptionElement.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivativeEditorForTaxonNode.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/ToggleLinkWithTaxonSelectionHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/operation/DeleteDerivateOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/operation/MoveDerivateOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/searchFilter/DerivateSearchComposite.java [moved from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateSearchComposite.java with 59% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/searchFilter/DerivateSearchCompositeController.java [moved from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateSearchCompositeController.java with 52% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptionElementDragListener.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptionElementDropAdapter.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveContentProvider.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DeleteHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/MoveDescriptionElementsHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/MoveDescriptionToOtherTaxonHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/DeleteDescriptionElementOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/DeleteSpecimenDescriptionOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/DeleteTaxonDescriptionOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/MoveDescriptionElementsOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/MoveDescriptionToOtherTaxonOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaViewPart.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AddImageGalleryHandler.java
eu.etaxonomy.taxeditor.editor/src/main/resources/log4j.properties [deleted file]
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/CreateSynonymInExisitingHomotypicalGroupOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteDescriptionElementOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/SwapSynonymAndAcceptedOperationTest.java
eu.etaxonomy.taxeditor.feature.jre.linux64/.gitignore [new file with mode: 0644]
eu.etaxonomy.taxeditor.feature.jre.linux64/.project [new file with mode: 0644]
eu.etaxonomy.taxeditor.feature.jre.linux64/LICENSE.TXT [new file with mode: 0644]
eu.etaxonomy.taxeditor.feature.jre.linux64/build.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.feature.jre.linux64/feature.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.feature.jre.linux64/jre/test [new file with mode: 0644]
eu.etaxonomy.taxeditor.feature.jre.linux64/p2.inf [new file with mode: 0644]
eu.etaxonomy.taxeditor.feature.jre.linux64/pom.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.feature.platform/feature.xml
eu.etaxonomy.taxeditor.feature.platform/pom.xml
eu.etaxonomy.taxeditor.feature/README.txt [deleted file]
eu.etaxonomy.taxeditor.feature/build.properties.with.jre
eu.etaxonomy.taxeditor.feature/feature.xml
eu.etaxonomy.taxeditor.feature/pom.xml
eu.etaxonomy.taxeditor.help/.classpath
eu.etaxonomy.taxeditor.help/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.help/pom.xml
eu.etaxonomy.taxeditor.molecular.lib/.classpath
eu.etaxonomy.taxeditor.molecular.lib/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.molecular.lib/pom.xml
eu.etaxonomy.taxeditor.molecular/.classpath
eu.etaxonomy.taxeditor.molecular/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/bundle.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/bundle_de.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin.properties [deleted file]
eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin_de.properties [deleted file]
eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin_en.properties [deleted file]
eu.etaxonomy.taxeditor.molecular/plugin.xml
eu.etaxonomy.taxeditor.molecular/pom.xml
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/editor/AlignmentEditor.java
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/editor/AlignmentEditorInput.java
eu.etaxonomy.taxeditor.navigation/.classpath
eu.etaxonomy.taxeditor.navigation/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages.properties
eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages_de.properties
eu.etaxonomy.taxeditor.navigation/plugin.xml
eu.etaxonomy.taxeditor.navigation/pom.xml
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/NavigationCdmViewer.java [deleted file]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/NavigationUtil.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/NavigatorStateManager.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/PolytomousKeyViewLabels.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/PolytomousKeyViewPart.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/DeleteHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/RemotingDeletePolytomousKeyHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/RemotingEditPolytomousKeyNodesHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/RemotingUpdatePolytomousKeyAllNodesHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/operation/DeleteOperation.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/operation/RemotingDeletePolytomousKeyOperation.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/operation/RemotingUpdatePolytomousKeyAllNodesOperation.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/Root.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonLinkHelper.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigator.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigatorDataChangeBehavior.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigatorLabels.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodeContentProvider.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TreeNodeDropAdapter.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TreeNodeDropAdapterAssistant.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/ChangeAcceptedTaxonToSynonymHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/DeleteHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/EditHandler.java [deleted file]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/MoveFactualDataHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/MoveTaxonHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/NavigatorHandlerUtils.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/RemotingChangeAcceptedTaxonToSynonymHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/RemotingDeleteTaxonNodeHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/RemotingMoveFactualDataHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/RemotingMoveTaxonNodeHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/ChangeAcceptedTaxonToSynonymOperation.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/DeleteOperation.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/EditClassificationOperation.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/MoveTaxonOperation.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/RemotingChangeAcceptedTaxonToSynonymOperation.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/RemotingDeleteTaxonNodeOperation.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/RemotingMoveFactualDataOperation.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/RemotingMoveTaxonOperation.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/operation/CreateClassification.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/operation/CreatePolytomousKey.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/operation/CreateTaxonNode.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchBar.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchResultView.java
eu.etaxonomy.taxeditor.navigation/src/test/resources/log4j.properties [deleted file]
eu.etaxonomy.taxeditor.printpublisher/.classpath
eu.etaxonomy.taxeditor.printpublisher/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.printpublisher/pom.xml
eu.etaxonomy.taxeditor.store/.classpath
eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle.properties
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_de.properties
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties
eu.etaxonomy.taxeditor.store/icons/specimen_derivate_type-16x16-32.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/plugin.xml
eu.etaxonomy.taxeditor.store/pom.xml
eu.etaxonomy.taxeditor.store/schema/eu.etaxonomy.taxeditor.store.cdmViewer.exsd
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/datasource/CdmDataSourceRepository.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/CdmEntitySessionInput.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermDropAdapter.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermEditor.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenu.java [moved from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenuFactory.java with 57% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/DeleteTermBaseHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/AbstractDefinedTermEditorInput.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/TermEditorInput.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/CreateDefinedTermOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/CreateTermVocabularyOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/DeleteTermBaseOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/MoveDefinedTermOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/EditFeatureTreeWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/FeatureTreeEditorWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/SelectFeatureTreeWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenInspectSessionsHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/ReconnectHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/ShowRemotingLoginWindowHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/SwitchUserHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/UuidsParameterTypeConverter.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/DefaultOpenClassificationWizardHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/DefaultOpenHandlerBase.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/DefaultOpenTaxonNodeWizardHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/OpenReferencingObjectsView.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/AbstractIOManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ExportManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ImportManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdSourceSelectionPage.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbstractImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ClassificationChooserWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/CsvExportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/CsvNameExportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/CsvPrintExportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExcelNormalExplicitTaxaImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExportToFileDestinationWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ImportFromFileDataSourceWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/JaxbExportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/SddExportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/SddImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/TcsImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AuthorHelper.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmDeleteErrorDialog.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmErrorDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmObjectTransfer.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmProgressMonitorAdapter.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/DeleteResultMessagingUtils.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/DescriptionHelper.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ImageResources.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MessagingUtils.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewAmplificationWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewClassificationWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewCollectionWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewDerivedUnitBaseWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewFieldUnitWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewGrantedAuthorityWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewGroupWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewInstitutionWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewNonViralNameWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewPersonWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewPolytomousKeyWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewPrimerWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewReferenceWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonNodeWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonWizard.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTeamWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewUserWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/AbstractPersistentPostOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/AbstractPostOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/AbstractPostTaxonOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/FeedbackGenerator.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/IFeedbackGenerator.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/IPostMoniteredOperationEnabled.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/RemotingCdmDefaultOperation.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/RemotingCdmHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/RemotingCdmOperation.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/RemotingCdmUpdateOperation.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/parser/ParseHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/CdmStorePropertyTester.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/DebugPreferences.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/DefaultFeatureTreePreferenecs.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/FeatureTreePreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/LanguageRepresentationPreferencePage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/MobotOpenUrlPreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/OrderPreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenOrObservationPreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonomicEditorGeneralPreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/AbstractMatchingPreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/NonViralNameMatchingPreference.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/ReferenceMatchingPreference.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/TeamOrPersonMatchingPreference.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/AbstractMenuPreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/CdmPreferencePage.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmAuthenticationException.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStoreConnector.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmUIDataChangeService.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/ContextManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/LoginManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/SearchManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/TermManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/TermStore.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/AbstractEntityCollectionElementWizardPage.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/bar/AuthenticatedUserBar.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/TermComboElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/FeedbackMessageBox.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/LoginDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/RemotingLoginDialog.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/ReportTextDialog.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/deleteConfigurator/DeleteConfiguratorDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/deleteConfigurator/DeleteNameConfiguratorComposite.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/deleteConfigurator/DeleteSpecimenConfiguratorComposite.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/deleteConfigurator/DeleteTaxonConfiguratorComposite.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmResourceSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NameSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NamedAreaSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SelectionDialogFactory.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SpecimenOrObservationBaseSelectionDialog.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonBaseSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonNodeSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/AbstractCdmEntityWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/AbstractFormSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/AbstractUriWithExceptionLabelElement.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/DateDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/ISelectableElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/ImageElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/KeyStatementElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/LanguageStringWithLabelElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/LsidWithExceptionLabelElement.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/MultilanguageTextElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/PartialElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/password/PasswordWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractEntityCollectionElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/PersonDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/AbstractEditWizard.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/EditTaxonNodeWizard.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeAgentRelationCollectionElement.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeAgentRelationCollectionSection.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementSourceElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementSourceSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/IndividualsAssociationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/operation/ChangeDescriptionElementType.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/FeatureDistributionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/identifier/IdentifierDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyNodeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/ImageFileElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaMetaElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaRepresentationPartElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameRelationshipWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameTypeDesignationElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NomenclaturalStatusElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/ProtologueElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/SpecimenTypeDesignationElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/SynonymRelationshipWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/TypeDesignationSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitGeneralWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationEventDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeoScopePolyKeyDetailSection.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/DerivedUnitTypeDesignationElement.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/DerivedUnitTypeDesignationSection.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/TaxonAssociationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenDeterminationDetailElement.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenDeterminationDetailSection.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenDeterminationHistoryDetailSection.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SequenceGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AbstractOriginalSourceElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AbstractReferencedEntityElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/IdentifiableSourceElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonWizardPage.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/NamedAreaDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/TermVocabularyDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/ClassificationSelectionElement.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EditFromSelectionWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EntitySelectionElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EntitySelectionElementWithAbbreviatedTitle.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/util/ApplicationUtil.java [moved from eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationUtil.java with 84% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/util/OperationsUtil.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/util/ProgressMonitorClientManager.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractCdmDataViewer.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractCdmEditorViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractCdmViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractSplitableViewPart.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/CdmViewerChooser.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/CdmViewerContextMenu.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/CdmViewerUtil.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/ICdmViewer.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/BioCaseEditorInput.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/BioCaseEditorInput.java with 94% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/DataImportEditor.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/DataImportEditor.java with 99% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/DataImportEditorContextMenu.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/DataImportEditorContextMenu.java with 94% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/DataImportEditorInput.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/DataImportEditorInput.java with 97% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/DataImportView.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/DataImportView.java with 99% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/GbifImportEditor.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/GbifImportEditor.java with 77% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/GbifImportEditorInput.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/GbifImportEditorInput.java with 97% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/GbifResponseImportView.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/GbifResponseImportView.java with 81% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/QueryType.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/QueryType.java with 88% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SaveImportedSpecimenAction.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/SaveImportedSpecimenAction.java with 98% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SpecimenImportEditor.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/SpecimenImportEditor.java with 74% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SpecimenImportView.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/SpecimenImportView.java with 63% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SpecimenProviderSelectionWizardPage.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/SpecimenProviderSelectionWizardPage.java with 96% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SpecimenSearchWizard.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/SpecimenSearchWizard.java with 61% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SpecimenSearchWizardPage.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/SpecimenSearchWizardPage.java with 97% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/ChangeConnectionHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/DeleteDataSourceHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateContentProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateLabelProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateSearchView.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/sessions/InspectSessionsDialog.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/sessions/SessionsViewPart.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/supplementaldata/SupplementalDataViewPart.java
eu.etaxonomy.taxeditor.store/src/main/resources/log4j.properties [deleted file]
eu.etaxonomy.taxeditor.store/src/test/java/eu/etaxonomy/taxeditor/store/operations/AbstractTaxeditorOperationTestBase.java
eu.etaxonomy.taxeditor.store/src/test/java/eu/etaxonomy/taxeditor/store/operations/RemotingTestUpdateOperation.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/test/resources/log4j.properties [deleted file]
eu.etaxonomy.taxeditor.test/.classpath
eu.etaxonomy.taxeditor.test/.project
eu.etaxonomy.taxeditor.test/.settings/org.eclipse.jdt.core.prefs
eu.etaxonomy.taxeditor.test/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.test/build.properties
eu.etaxonomy.taxeditor.test/lib/byte-buddy-0.5.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/lib/dbunit-2.4.9.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/lib/org.springframework.context-3.2.2.RELEASE.jar [moved from eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.context-3.2.2.RELEASE.jar with 100% similarity]
eu.etaxonomy.taxeditor.test/lib/unitils-core-3.4.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/lib/unitils-database-3.4.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/lib/unitils-dbmaintainer-3.4.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/lib/unitils-dbunit-3.4.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/lib/unitils-spring-3.4.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/pom.xml
eu.etaxonomy.taxeditor.test/src/main/resources/log4j.xml [deleted file]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/api/cache/CdmClientCachingTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/application/menu/general/NewMenuTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/BaseRemotingTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CdmRemoteSourceTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CdmServerTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/HttpInvokerServicesTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/RemotingSessionAwareTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/TestConfig.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/TestThread.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/ThreadedTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/AbstractLazyInitializerTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/CdmServiceCacherTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/PropertyPathsTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/RemoteLazyLoadingTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/RemotePersistentCollectionTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/navigation/navigator/contextmenu/ClassificationTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonWizardTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/BaseOperationTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/PolytomousKeyViewPartTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/RemotingCdmUpdateOperationTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/TaxonNameEditorTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/TaxonNavigatorTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/IOServiceExportTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/IOServiceImportTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/ProgressMonitorServiceTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/ServiceInterceptorTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmApplicationStateTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionAwareTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionManagerTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/MockSessionOwner.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/MockConversationEnabled.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/dialogs/CdmServerInfoTest.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/dialogs/LoginDialogTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/selection/ClassificationSelectionElementTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/selection/NameSelectionElementTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/selection/TaxonNodeSelectionElementTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/selection/TaxonSelectionElementTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/util/H2DbSupport.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/.cdmLibrary/writableResources/cdm.datasources.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/.cdmLibrary/writableResources/mgd.datasources.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/.cdmLibrary/writableResources/test.mgd.datasources.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/datasources.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/cdm/api/cache/CdmClientCachingTest.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/cdm/testRemotingApplicationContext.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/lazyloading/AbstractLazyInitializerTest.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/lazyloading/CdmEntityCacherTest.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/PolytomousKeyViewPartTest.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/RemotingCdmUpdateOperationTest.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/TaxonNameEditorTest.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/TaxonNavigatorTest.testDeleteClassificationWithDeleteChildren.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/TaxonNavigatorTest.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/service/IOServiceExportTest.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/service/IOServiceImportTest.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/session/CdmEntitySessionAwareTest.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/session/CdmEntitySessionManagerTest.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/h2/cdmTest.h2.db [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/imports/ABCDImport.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/imports/NormalExplicitImport.xls [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/imports/SDD.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/imports/SpecimenExcelImport.xls [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/imports/TcsImport.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/log4j.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/server.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.test/src/test/resources/unitils.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.webapp/.classpath [new file with mode: 0644]
eu.etaxonomy.taxeditor.webapp/.gitignore [new file with mode: 0644]
eu.etaxonomy.taxeditor.webapp/.project [new file with mode: 0644]
eu.etaxonomy.taxeditor.webapp/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
eu.etaxonomy.taxeditor.webapp/META-INF/MANIFEST.MF [new file with mode: 0644]
eu.etaxonomy.taxeditor.webapp/build.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.webapp/lib/c3p0-0.9.5.2.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.webapp/lib/javax.servlet-api-3.1.0.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.webapp/lib/jetty-all-9.2.9.v20150224.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.webapp/lib/log4j-1.2.17.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.webapp/lib/mysql-connector-java-5.1.24.jar [moved from eu.etaxonomy.taxeditor.cdmlib/lib/mysql-connector-java-5.1.24.jar with 100% similarity]
eu.etaxonomy.taxeditor.webapp/pom.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.webapp/src/main/java/eu/etaxonomy/taxeditor/webapp/CDMEmbeddedServerException.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.webapp/src/main/java/eu/etaxonomy/taxeditor/webapp/CDMServer.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.webapp/src/main/java/eu/etaxonomy/taxeditor/webapp/ICDMServerError.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.webapp/src/main/java/eu/etaxonomy/taxeditor/webapp/TaxeditorWebappPlugin.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.webapp/src/main/resources/etc/jetty/.svnignore [new file with mode: 0644]
eu.etaxonomy.taxeditor.webapp/src/main/resources/etc/jetty/jetty-runner-9.2.3.v20140905.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.webapp/src/main/resources/etc/jetty/start-9.2.3.v20140905.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor/.classpath
eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product
eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product.with.jre
eu.etaxonomy.taxeditor/pom.xml
pom.xml

index a9c346ed72e6baa6bcf6a91c670ee5023306f2bd..877a615a022cb9b9e3ca73dbe3410a5cfe62fb2c 100644 (file)
@@ -142,9 +142,7 @@ eu.etaxonomy.taxeditor.cdmlib/build.properties -text
 eu.etaxonomy.taxeditor.cdmlib/lib/activation-1.1.1.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/antlr-2.7.7.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/aopalliance-1.0.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/aspectjrt-1.7.1-sources.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/aspectjrt-1.7.1.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/aspectjweaver-1.7.1-sources.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/aspectjweaver-1.7.1.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/avro-1.6.3.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/batik-anim-1.7.jar -text
@@ -306,15 +304,11 @@ eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-remoting-3.1.3.RELEASE.jar -te
 eu.etaxonomy.taxeditor.cdmlib/lib/stax-1.2.0.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/stax-api-1.0.1.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/swagger-annotations-1.3.5.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/unitils-core-3.3.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/unitils-database-3.3.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbmaintainer-3.3.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbunit-3.3.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/unitils-easymock-3.3.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/unitils-inject-3.3.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/unitils-mock-3.3.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/unitils-orm-3.3.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/unitils-spring-3.3.jar -text
+eu.etaxonomy.taxeditor.cdmlib/lib/unitils-core-3.4.2.jar -text
+eu.etaxonomy.taxeditor.cdmlib/lib/unitils-database-3.4.2.jar -text
+eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbmaintainer-3.4.2.jar -text
+eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbunit-3.4.2.jar -text
+eu.etaxonomy.taxeditor.cdmlib/lib/unitils-spring-3.4.2.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/usertype.jodatime-2.0.1.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/usertype.spi-2.0.1.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/validation-api-1.0.0.GA.jar -text
@@ -337,22 +331,57 @@ eu.etaxonomy.taxeditor.cdmlib/lib/yjp-controller-api-redist-9.0.8.jar -text
 eu.etaxonomy.taxeditor.cdmlib/pom.xml -text
 eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationRemoteConfiguration.java -text
 eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationRemoteController.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/RemotingMonitoredGenericApplicationContext.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/RemotingMonitoredListableBeanFactory.java -text
 eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/cache/CdmServiceCacher.java -text
-eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/lazyloading/CdmLazyLoader.java -text
-eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/remote/CdmPersistentRemoteSource.java -text
-eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/remote/CdmRemoteSource.java -text
-eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/remote/CdmRemoteSourceBase.java -text
-eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/remote/CdmRemoteSourceException.java -text
-eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/remote/ICdmRemoteSource.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/CdmEagerLoadingException.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/CdmRemotingException.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CacheLoader.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmClientCacheException.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmEntityCacheKey.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmModelCacher.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmModelFieldPropertyFromClass.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmRemoteCacheManager.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmTransientEntityCacher.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/EntityCacherDebugResult.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/ProxyUtils.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/server/CDMServerException.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmPersistentRemoteSource.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmRemoteSource.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmRemoteSourceBase.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmRemoteSourceException.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmServerInfo.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/ICdmRemoteSource.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CachedCommonServiceImpl.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CdmAuthenticatedHttpInvokerRequestExecutor.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CdmServiceInterceptorException.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CdmServiceRequestExecutor.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/ICachedCommonService.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/TermServiceRequestExecutor.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/CdmClientSessionException.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/CdmEntitySession.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionManager.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySession.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySessionEnabled.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySessionManager.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySessionManagerObserver.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/mock/MockCdmEntitySession.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/mock/MockCdmEntitySessionManager.java -text
 eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/collection/internal/AbstractPersistentCollection.java -text
 eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/proxy/AbstractLazyInitializer.java -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/resources/cdmlib-ehcache.xml -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/resources/etc/jetty/.svnignore -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/resources/etc/jetty/cdmlib-remote-webapp.war -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/resources/etc/jetty/jetty-runner-9.2.3.v20140905.jar -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/resources/etc/jetty/start-9.2.3.v20140905.jar -text
 eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/config.properties -text
 eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/httpInvokerServiceClients.xml -text
 eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/localApplicationContext.xml -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/mappings/hibernate.cfg.xml -text
 eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/remotingApplicationContext.xml -text
 eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/remoting_persistence_security.xml -text
 eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/remoting_services_security.xml -text
-eu.etaxonomy.taxeditor.cdmlib/src/test/resources/eu/etaxonomy/cdm/datasources/cdm.datasources.xml -text
+eu.etaxonomy.taxeditor.cdmlib/src/main/resources/log4j.properties -text
 eu.etaxonomy.taxeditor.editor/.classpath -text
 eu.etaxonomy.taxeditor.editor/.project -text
 eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF -text
@@ -374,6 +403,7 @@ eu.etaxonomy.taxeditor.editor/p2.inf -text
 eu.etaxonomy.taxeditor.editor/plugin.xml -text
 eu.etaxonomy.taxeditor.editor/pom.xml -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/CdmDataTransfer.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/CdmEntitySessionInput.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/ChooseFromMultipleTaxonNodesDialog.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorCdmViewer.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorStateManager.java -text
@@ -1266,9 +1296,14 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/Op
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/SelectFeatureTreeWizard.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/SelectFeatureTreeWizardPage.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenDistributionEditorWizardHandler.java -text
+<<<<<<< HEAD
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenInspectSessionsHandler.java -text
+=======
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenHandler.java -text
+>>>>>>> 02176688eaa23a31ff5b71c317cb5ee685483aa4
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenPasswordWizzardHandler.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/ShowLoginWindowHandler.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/ShowRemotingLoginWindowHandler.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/identificationkey/AbstractIdentificaitonKeyWizard.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/AbstractIOManager.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ExportManager.java -text
@@ -1365,7 +1400,6 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/Abst
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/AbstractPostOperation.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/AbstractPostTaxonOperation.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/IPostOperationEnabled.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/parser/MatchStrategyConfigurator.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/parser/ParseHandler.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/CdmPreferences.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/CdmStorePropertyTester.java -text
@@ -1437,6 +1471,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/TermC
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/VocabularyComboElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/DefaultLanguageDialog.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/LoginDialog.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/RemotingLoginDialog.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/UriDialog.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/deleteConfigurator/DeleteConfiguratorComposite.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/deleteConfigurator/DeleteConfiguratorDialog.java -text
@@ -1826,6 +1861,8 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/Cd
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewPart.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/reporting/ReportingViewPart.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/sessions/InspectSessionsDialog.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/sessions/SessionsViewPart.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/specimenSearch/SpecimenProviderSelectionComposite.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/specimenSearch/SpecimenProviderSelectionController.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/specimenSearch/SpecimenSearchComposite.java -text
@@ -1859,14 +1896,56 @@ eu.etaxonomy.taxeditor.test/.settings/org.eclipse.jdt.core.prefs -text
 eu.etaxonomy.taxeditor.test/META-INF/MANIFEST.MF -text
 eu.etaxonomy.taxeditor.test/build.properties -text
 eu.etaxonomy.taxeditor.test/ide/eclipse/EDITor[!!-~]Tests.launch -text
+eu.etaxonomy.taxeditor.test/lib/byte-buddy-0.5.1.jar -text
 eu.etaxonomy.taxeditor.test/pom.xml -text
+eu.etaxonomy.taxeditor.test/src/main/resources/cdmlib-ehcache.xml -text
+eu.etaxonomy.taxeditor.test/src/main/resources/datasources.xml -text
+eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/api/cache/CdmClientCachingTest.xml -text
+eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/cdm.datasources.xml -text
+eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/model/PolytomousKeyTest.xml -text
+eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/model/TaxonNameEditorTest.xml -text
+eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/model/TaxonNavigatorTest.xml -text
+eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/testRemotingApplicationContext.xml -text
+eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/taxeditor/lazyloading/AbstractLazyInitializerTest.xml -text
+eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/taxeditor/lazyloading/CdmEntityCacherTest.xml -text
+eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/taxeditor/remoting/session/CdmEntitySessionManagerTest.xml -text
+eu.etaxonomy.taxeditor.test/src/main/resources/h2/cdmTest.h2.db -text
+eu.etaxonomy.taxeditor.test/src/main/resources/h2/cdmTest.trace.db -text
+eu.etaxonomy.taxeditor.test/src/main/resources/log4j.properties -text
 eu.etaxonomy.taxeditor.test/src/main/resources/log4j.xml -text
+eu.etaxonomy.taxeditor.test/src/main/resources/unitils.properties -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/api/cache/CdmClientCachingTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/api/cache/CdmModelGetMethodCacherTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/model/PolytomousKeyTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/model/TaxonNameEditorTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/model/TaxonNavigatorTest.java -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/application/menu/general/NewMenuTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/BaseRemotingTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CDMServer.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CdmPersistentRemoteSourceTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CdmRemoteSourceTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CdmServerTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CdmServerTestManager.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/HttpInvokerServicesTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/AbstractLazyInitializerTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/CdmEntityCacherTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/CdmServiceCacherTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/RemoteLazyLoadingTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/RemotePersistentCollectionTest.java -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/navigation/navigator/contextmenu/ClassificationTest.java -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonWizardTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operations/OperationTestBase.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/ITestService.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/ServiceInterceptorTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/ServiceRebasingTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/TargetTestService.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/TestService.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionManagerTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/MockSessionOwner.java -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/AbstractEditorTest.java -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/ContextMenuHelper.java -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/SwtBotUtils.java -text
+eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/dialogs/CdmServerInfoTest.java -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/dialogs/LoginDialogTest.java -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/selection/AbstractSelectionElementTest.java -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/selection/ClassificationSelectionElementTest.java -text
@@ -1894,3 +1973,19 @@ src/site/fml/troubleshooting.fml -text
 src/site/resources/css/site.css -text
 src/site/resources/images/taxeditor_transformed.png -text
 src/site/site.xml -text
+
+# The following files will be ignored when merging another
+# branch into this branch in case of merge conflict and 
+# if the 'ours' merge driver is configured.
+# WARNING : This merge driver should NOT be set in development
+#           environments. It is supposed to be used only in CI
+#           environments.
+# The driver can be configured by executing,
+# git config --local merge.ours.driver true
+**/pom.xml merge=ours
+**/MANIFEST.MF merge=ours
+**/feature.xml merge=ours
+eu.etaxonomy.taxeditor.cdmlib/.classpath merge=ours
+eu.etaxonomy.taxeditor.cdmlib/build.properties merge=ours
+eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product merge=ours
+eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product.with.jre merge=ours
index 5c8b928b8e9810e6ba3615b0efdeead665c5c54d..353a280dbb922b07d0c778f9947a7ec5b6a1590e 100644 (file)
@@ -1,43 +1,32 @@
-/.project
-eu.etaxonomy.taxeditor.application/.settings
-eu.etaxonomy.taxeditor.application/target
-eu.etaxonomy.taxeditor.bulkeditor/.settings
-eu.etaxonomy.taxeditor.bulkeditor/target
-eu.etaxonomy.taxeditor.cdmlib/.directory
-eu.etaxonomy.taxeditor.cdmlib/.settings
+.project
+integration-test.log
+eu.etaxonomy.taxeditor.cdmlib/src/main/resources/etc/jetty/*
+.settings
+target
+.directory
 eu.etaxonomy.taxeditor.cdmlib/cdmlib-*.jar
 eu.etaxonomy.taxeditor.cdmlib/cdmlib-*.zip
 eu.etaxonomy.taxeditor.cdmlib/dist
+eu.etaxonomy.taxeditor.cdmlib/lib/cdm-server*
 eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib*
 eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.servletbridge.extensionbundle-1.2.0.v20100503.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.transforms.hook-1.0.300.v20100719.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.weaving.hook-1.0.100.v20110502.jar
 eu.etaxonomy.taxeditor.cdmlib/log4j-1.2.14src.zip
-eu.etaxonomy.taxeditor.cdmlib/target
-eu.etaxonomy.taxeditor.editor/.settings
-eu.etaxonomy.taxeditor.editor/target
-eu.etaxonomy.taxeditor.feature.platform/.settings
 eu.etaxonomy.taxeditor.feature.platform/bin
-eu.etaxonomy.taxeditor.feature.platform/target
-eu.etaxonomy.taxeditor.feature/.settings
 eu.etaxonomy.taxeditor.feature/compile.eu.etaxonomy.taxeditor.product.feature.xml
 eu.etaxonomy.taxeditor.feature/plugin_customization.ini
-eu.etaxonomy.taxeditor.feature/target
-eu.etaxonomy.taxeditor.feature/workspace
-eu.etaxonomy.taxeditor.help/.settings
 eu.etaxonomy.taxeditor.help/original_document/~$xonomic_Editor_User_Manual_Version_4.doc
-eu.etaxonomy.taxeditor.help/target
-eu.etaxonomy.taxeditor.navigation/.settings
-eu.etaxonomy.taxeditor.navigation/target
-eu.etaxonomy.taxeditor.printpublisher/.settings
-eu.etaxonomy.taxeditor.printpublisher/target
-eu.etaxonomy.taxeditor.store/.settings
-eu.etaxonomy.taxeditor.store/hibernate.log
-eu.etaxonomy.taxeditor.store/target
+hibernate.log
 eu.etaxonomy.taxeditor.test/screenshots/*.jpeg
-eu.etaxonomy.taxeditor.test/target
-eu.etaxonomy.taxeditor/.settings
-eu.etaxonomy.taxeditor/target
+eu.etaxonomy.taxeditor.test/src/test/resources/.cdm-server-ehcache
+eu.etaxonomy.taxeditor.test/src/test/resources/.cdmLibrary/cdm_remote_servers.json
+eu.etaxonomy.taxeditor.test/src/test/resources/.cdmLibrary/remote-webapp
+eu.etaxonomy.taxeditor.test/src/test/resources/.cdmLibrary/writableResources/test.mgd.datasources.xml
+eu.etaxonomy.taxeditor.webapp/lib/cdmlib-remote-webapp.war
 /runtime-taxeditor.product
-/target
 /workspace
+/*.patch
+/eu.etaxonomy.taxeditor.webapp/.settings/org.eclipse.core.resources.prefs
+/eu.etaxonomy.taxeditor.webapp/.settings/org.eclipse.m2e.core.prefs
+
index 4c7e96f59500b4f98198fb4a11bdf511d1107b48..6bca977bed3b6d2bc7f202c8a811de4878f0c42b 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry including="**/*.java" kind="src" path="src/main/java"/>
-       <classpathentry kind="src" path="src/main/resources"/>
+       <classpathentry kind="src" path="src/test/java"/>
        <classpathentry kind="output" path="target/classes"/>
 </classpath>
index 6a5c286864b932de03a3eebef50559186709fc25..441b55d6c6924cce043c220d8dbb937a6a92c480 100644 (file)
@@ -2,18 +2,20 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Application
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.application;singleton:=true
-Bundle-Version: 3.8.0.qualifier
+Bundle-Version: 4.0.0.qualifier
 Bundle-Activator: eu.etaxonomy.taxeditor.TaxonomicEditorPlugin
 Bundle-Vendor: EDIT
 Bundle-Localization: OSGI-INF/l10n/plugin
 Export-Package: eu.etaxonomy.taxeditor
 Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Import-Package: org.apache.log4j,
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Import-Package: eu.etaxonomy.cdm.database,
+ org.apache.log4j,
  org.eclipse.equinox.app,
  org.eclipse.equinox.p2.repository.metadata,
  org.osgi.framework,
- org.osgi.service.packageadmin
+ org.osgi.service.packageadmin,
+ org.springframework.remoting
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
  eu.etaxonomy.taxeditor.store,
@@ -21,7 +23,7 @@ Require-Bundle: org.eclipse.ui,
  eu.etaxonomy.taxeditor.bulkeditor,
  eu.etaxonomy.taxeditor.editor,
  eu.etaxonomy.taxeditor.printpublisher,
- eu.etaxonomy.taxeditor.molecular,
+ eu.etaxonomy.taxeditor.molecular;resolution:=optional,
  eu.etaxonomy.taxeditor.help,
  org.eclipse.equinox.ds,
  org.eclipse.equinox.util,
index a83b19295c3f3bd459acf80232a8fc32bfe07720..46fe7efb559c628f2be65c0e15f72c6fa97e2949 100644 (file)
@@ -1,6 +1,5 @@
 source.. = src/main/java/,\
-           src/test/java/,\
-           src/main/resources/
+           src/test/java/
 bin.includes = META-INF/,\
                .,\
                plugin.xml,\
index 40453cf2d1848c766922824ffe398ca9329c89e9..ae74af849e0ff876087aa64776ee4fe35b24249c 100644 (file)
             id="eu.etaxonomy.taxeditor.application.perspective.taxonomic"
             name="%perspective.name">
       </perspective>
-      <!--perspective
-            class="eu.etaxonomy.taxeditor.perspective.BulkEditing"
-            id="eu.etaxonomy.taxeditor.application.perspective.bulkeditor"
-            name="Bulk Editing">
-      </perspective-->
       <perspective
             class="eu.etaxonomy.taxeditor.perspective.PolytomousKey"
             id="eu.etaxonomy.taxeditor.application.perspective.polytomous"
             restorable="true">
       </view>
    </extension-->
- <extension
-       point="org.eclipse.ui.perspectiveExtensions">
-    <perspectiveExtension
-          targetID="eu.etaxonomy.taxeditor.application.perspective.bulkeditor">
-       <showInPart
-             id="eu.etaxonomy.taxeditor.editor.forms.detailsView">
-       </showInPart>
-       <showInPart
-             id="eu.etaxonomy.taxeditor.bulkeditor.referencingobjectsview">
-       </showInPart>
-    </perspectiveExtension>
-    <perspectiveExtension
-          targetID="eu.etaxonomy.taxeditor.application.perspective.polytomous">
-       <showInPart
-             id="eu.etaxonomy.taxeditor.editor.forms.detailsView">
-       </showInPart>
-    </perspectiveExtension>
-    <perspectiveExtension
-          targetID="eu.etaxonomy.taxeditor.application.perspective.uses">
-       <showInPart
-             id="eu.etaxonomy.taxeditor.editor.forms.detailsView">
-       </showInPart>
-    </perspectiveExtension>
- </extension>
    <extension
          point="org.eclipse.ui.menus">
       <menuContribution
                commandId="org.eclipse.ui.file.import"
                label="%command.label.3"
                style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
          <command
                commandId="org.eclipse.ui.file.export"
                label="%command.label.4"
                style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
          <separator
                name="eu.etaxonomy.taxeditor.application.filemenu.io"
index 2f4db0a333cf6b161c68a17a536f75a8b78d590c..8a71dda15044ea8e036123dcccb8a62a78446cc9 100644 (file)
@@ -3,7 +3,7 @@
   <parent>
     <groupId>eu.etaxonomy</groupId>
     <artifactId>taxeditor-parent</artifactId>
-    <version>3.8.0-SNAPSHOT</version>
+    <version>4.0.0-SNAPSHOT</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
index f02297f4b69c6eddb79350405e44ec297ed3dcf0..02d13bd9f53d8fa14b656bf06fcfbe75e91727d9 100644 (file)
@@ -8,8 +8,11 @@ import org.eclipse.ui.application.WorkbenchAdvisor;
 import org.eclipse.ui.application.WorkbenchWindowAdvisor;
 import org.eclipse.ui.statushandlers.AbstractStatusHandler;
 import org.eclipse.ui.statushandlers.StatusAdapter;
+import org.springframework.remoting.RemoteAccessException;
+import org.springframework.remoting.RemoteConnectFailureException;
 
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
 
 
@@ -22,6 +25,7 @@ import eu.etaxonomy.taxeditor.model.MessagingUtils;
 public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
 
        private CdmStatusHandler cdmStatusHandler;
+
        /*
         * (non-Javadoc)
         * @see org.eclipse.ui.application.WorkbenchAdvisor#createWorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)
@@ -88,31 +92,87 @@ public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
         */
        class CdmStatusHandler extends AbstractStatusHandler {
 
+           private Throwable previousT;
                /* (non-Javadoc)
                 * @see org.eclipse.ui.statushandlers.AbstractStatusHandler#handle(org.eclipse.ui.statushandlers.StatusAdapter, int)
                 */
                @Override
                public void handle(StatusAdapter statusAdapter, int style)
                {
+
                    if(statusAdapter.getStatus().matches(IStatus.ERROR)) {
 
                        IStatus status = statusAdapter.getStatus();
                        Throwable t = statusAdapter.getStatus().getException();
+                       // NOTE : the global status handling mechanism in the case of
+                       //        runtime exceptions is called twice, once by the application
+                       //        throwing the exception and then by the rcp logging mechanism
+                       //        The check below is to make sure that the same exception is
+                       //        not shown twice in succession.
+                       if(t != null && previousT == t) {
+                       return;
+                   }
+                       previousT = t;
+
+
+
                        // NOTE : Currently we only allow RuntimeExceptions since
                        //        allowing all kinds of exceptions would also include
                        //        those in generated status objects coming from from logging triggers
                        //        leading to a recursive infinite loop of :
                        //        initial exception thrown -> status handling -> dialog opening + logging of status ->
                        //        status handling -> dialog opening + logging of status ... and so on
-                       if(t != null && t instanceof RuntimeException && ! "Widget is disposed".equals(t.getMessage())){
-                               MessagingUtils.errorDialog("Unexpected error",
-                                               null,
-                                               MessagingUtils.UNEXPECTED_ERROR_MESSAGE,
-                                               statusAdapter.getStatus().getPlugin(),
-                                               t,
-                                               true);
-                       }
+                       if(t != null &&
+                               t instanceof RuntimeException &&
+                               ! "Widget is disposed".equals(t.getMessage()) &&
+                               ! handleKnownRuntimeException(t,statusAdapter.getStatus().getPlugin())) {
+
+                           MessagingUtils.errorDialog("Unexpected error",
+                                   null,
+                                   MessagingUtils.UNEXPECTED_ERROR_MESSAGE,
+                                   statusAdapter.getStatus().getPlugin(),
+                                   t,
+                                   true);
+
+                       } else if (t != null && ("Widget is disposed".equals(t.getMessage()))){
+                    MessagingUtils.warn(this.getClass(), t);
+                    if (PreferencesUtil.isShowUpWidgetIsDisposedMessages()){
+                        MessagingUtils.errorDialog("Widget is disposed",
+                                null,
+                                MessagingUtils.WIDGET_IS_DISPOSED_MESSAGE,
+                                statusAdapter.getStatus().getPlugin(),
+                                t,
+                                true);
+
+                    }
+                }
+                   }
+               }
+
+               private boolean handleKnownRuntimeException(Throwable t, String pluginId) {
+                   if(t instanceof RemoteConnectFailureException ||
+                           t.getCause() instanceof RemoteConnectFailureException) {
+                       MessagingUtils.errorDialog("Connection Failure",
+                               null,
+                               MessagingUtils.CONNECTION_FAILURE_MESSAGE + System.getProperty("line.separator"),
+                               pluginId,
+                               t,
+                               true,
+                               false);
+                       return true;
+                   }
+                   if(t instanceof RemoteAccessException ||
+                           t.getCause() instanceof RemoteAccessException) {
+                       MessagingUtils.errorDialog("Remote Access Error",
+                               null,
+                               MessagingUtils.REMOTE_ACCESS_FAILURE_MESSAGE + System.getProperty("line.separator"),
+                               pluginId,
+                               t,
+                               true,
+                               false);
+                       return true;
                    }
+                   return false;
                }
        }
 
index a4d2e6816dc5452ab1f36ae1b54eeadeb5d4852f..bb5b360a311cca20625d70ad041ed5e78a56ccd2 100644 (file)
@@ -12,6 +12,7 @@ import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.dialog.LoginDialog;
 import eu.etaxonomy.taxeditor.update.P2Util;
+import eu.etaxonomy.taxeditor.util.ApplicationUtil;
 
 /**
  * <p>ApplicationWorkbenchWindowAdvisor class.</p>
@@ -47,7 +48,7 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
                configurer.setShowCoolBar(true);
                configurer.setShowStatusLine(true);
                configurer.setShowPerspectiveBar(true);
-               configurer.setTitle("EDIT Taxonomic Editor " + ApplicationUtil.getVersion());
+               configurer.setTitle(ApplicationUtil.getTitle());
                configurer.setShowProgressIndicator(true);
 
                CdmDataSourceRepository.createDefaultH2DataSource();
index b7e8509325d8fc11a5d1aac3eac2a9ea2a7063de..1033f0c7ca10070bf6fd67d578840c3a90be257b 100644 (file)
@@ -13,9 +13,9 @@ import org.eclipse.ui.IPageLayout;
 import org.eclipse.ui.IPlaceholderFolderLayout;
 import org.eclipse.ui.progress.IProgressConstants;
 
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
 import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
-import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateSearchView;
 import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart;
 import eu.etaxonomy.taxeditor.view.detail.DetailsViewPart;
 
@@ -30,16 +30,13 @@ public class DerivatePerspective extends Default {
 
     public static final String ADDITIONAL = "additional";
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
-     */
     @Override
     public void createInitialLayout(IPageLayout layout) {
         layout.addView(TaxonNavigator.ID, IPageLayout.LEFT, 0.25f, layout.getEditorArea());
 
         layout.addView(DetailsViewPart.ID, IPageLayout.RIGHT, 0.6f, layout.getEditorArea());
 
-        layout.addView(DerivateSearchView.ID, IPageLayout.TOP, 0.5f, layout.getEditorArea());
+        layout.addView(DerivateView.ID, IPageLayout.BOTTOM, 0.5f, layout.getEditorArea());
 
         layout.addView(DescriptiveViewPart.ID, IPageLayout.BOTTOM, 0.6f, TaxonNavigator.ID);
 
index 9e1731c4cf7cdcc7c73745e5bcf39b1d8ef705b1..e39cdb618a58acb3368adebc820d6b6a5ada5277 100644 (file)
@@ -5,38 +5,18 @@ import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.jobs.JobChangeAdapter;
 import org.eclipse.equinox.internal.p2.ui.ProvUI;
 import org.eclipse.equinox.internal.p2.ui.model.ElementUtils;
 import org.eclipse.equinox.internal.p2.ui.model.MetadataRepositoryElement;
 import org.eclipse.equinox.p2.repository.IRepository;
 import org.eclipse.equinox.p2.repository.IRepositoryManager;
-import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
 import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
-import org.eclipse.equinox.p2.core.IProvisioningAgent;
-import org.eclipse.equinox.p2.core.ProvisionException;
-import org.eclipse.equinox.p2.operations.ProvisioningJob;
-import org.eclipse.equinox.p2.operations.ProvisioningSession;
-import org.eclipse.equinox.p2.operations.RepositoryTracker;
-import org.eclipse.equinox.p2.operations.Update;
-import org.eclipse.equinox.p2.operations.UpdateOperation;
 import org.eclipse.equinox.p2.ui.ProvisioningUI;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
 
-import eu.etaxonomy.taxeditor.ApplicationUtil;
 import eu.etaxonomy.taxeditor.TaxonomicEditorPlugin;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.util.ApplicationUtil;
 
 /**
  * This class is a utility class for updating the editor from a p2 update site,
@@ -140,141 +120,4 @@ public class P2Util {
         }
         PreferencesUtil.setP2Repositories(repoElements);
     }
-
-    /**
-     *
-     *
-     */
-    public static void checkForUpdates() {
-        // the main job which performs the update
-        Job updateJob = new Job("Update Job") {
-            @Override
-            public IStatus run(IProgressMonitor monitor) {
-                return doCheckForUpdates(monitor);
-            }
-        };
-        updateJob.schedule();
-    }
-
-    /**
-     * @param monitor
-     * @return
-     */
-    private static IStatus doCheckForUpdates(IProgressMonitor monitor) {
-
-        BundleContext bundleContext = TaxonomicEditorPlugin.getContext();
-        ServiceReference reference = bundleContext.getServiceReference(IProvisioningAgent.SERVICE_NAME);
-        if (reference == null) {
-            IStatus errorStatus = new Status(IStatus.ERROR, TaxonomicEditorPlugin.PLUGIN_ID,
-                    "No provisioning agent found.  This application is not set up for updates.");
-            return errorStatus;
-        }
-
-        final IProvisioningAgent agent = (IProvisioningAgent) bundleContext.getService(reference);
-        IStatus updateStatus;
-        try {
-            updateStatus = P2Util.checkForUpdates(agent, monitor);
-            MessagingUtils.info(updateStatus);
-        } finally {
-            bundleContext.ungetService(reference);
-        }
-        return updateStatus;
-    }
-
-    /**
-     * @param agent
-     * @param monitor
-     * @return
-     * @throws OperationCanceledException
-     */
-    static IStatus checkForUpdates(IProvisioningAgent agent, final IProgressMonitor monitor) {
-        ProvisioningSession session = new ProvisioningSession(agent);
-        // the default update operation looks for updates to the currently
-        // running profile, using the default profile root marker. To change
-        // which installable units are being updated, use the more detailed
-        // constructors.
-        final UpdateOperation operation = new UpdateOperation(session);
-//        try {
-//            setUpdateRepositories(operation);
-//        } catch (URISyntaxException e) {
-//            MessagingUtils.errorDialog("Invalid update site URI",
-//                    operation,
-//                    "The update site URI has an invalid syntax",
-//                    TaxonomicEditorPlugin.PLUGIN_ID,
-//                    e,
-//                    false);
-//            return null;
-//        }
-
-        final IStatus status = operation.resolveModal(monitor);
-
-        if (status.getCode() == UpdateOperation.STATUS_NOTHING_TO_UPDATE) {
-            return status;
-        }
-
-        if (status.isOK() && status.getSeverity() != IStatus.ERROR) {
-            // We need this block of code to be in async execution
-            // since the confirm dialogs work only on the UI thread
-            Display.getDefault().asyncExec(new Runnable() {
-                @Override
-                public void run() {
-                    String updates = "";
-                    Update[] possibleUpdates = operation
-                            .getPossibleUpdates();
-                    for (Update update : possibleUpdates) {
-                        updates += update + "\n";
-                    }
-
-                    boolean doInstall = MessagingUtils.confirmDialog("Updates available", "Do you want to install the available updates ?");
-                    // We may need to think whether we still run in async mode once
-                    // the user agrees to update. Maybe be reasonable to change to blocking
-                    // from this point until the update is complete.
-
-                    // More complex status handling might include showing the user what
-                    // updates are available if there are multiples, differentiating
-                    // patches vs. updates, etc. In this example, we simply update as
-                    // suggested by the operation.
-                    if(doInstall) {
-                        ProvisioningJob provisioningJob = operation.getProvisioningJob(monitor);
-                        if (provisioningJob == null) {
-                            MessagingUtils.messageDialog("Error in performing update",
-                                    operation,
-                                    "ProvisioningJob could not be created." + System.getProperty("line.separator") +
-                                    "Either this application does not support p2 software installation or this application has been launched from within the Eclipse IDE",
-                                    null,
-                                    false);
-
-                        } else {
-                            // register a job change listener to track
-                            // installation progress and notify user upon success
-                            provisioningJob
-                            .addJobChangeListener(new JobChangeAdapter() {
-                                @Override
-                                public void done(IJobChangeEvent event) {
-                                    if (event.getResult().isOK()) {
-                                        // We need this block of code to be in async execution
-                                        // since the confirm dialogs work only on the UI thread
-                                        Display.getDefault().asyncExec(new Runnable() {
-                                            @Override
-                                            public void run() {
-                                                boolean restart = MessagingUtils.confirmDialog(
-                                                        "Updates installed, restart?",
-                                                        "Updates have been installed successfully, do you want to restart?");
-                                                if (restart) {
-                                                    PlatformUI.getWorkbench().restart();
-                                                }
-                                            }
-                                        });
-                                    }
-                                    super.done(event);
-                                }
-                            });
-                            provisioningJob.schedule();
-                        }
-                    }
-                }
-            });
-        }
-        return status;
-    }
 }
index bca8c9923b8b59811899f2d03ae56b73559a7953..a835cdc5c2b0eb65e778fcc88b6bfabd9cbe2aaa 100644 (file)
@@ -23,40 +23,40 @@ import org.eclipse.jface.wizard.WizardDialog;
  */
 public class UpdateHandler extends PreloadingRepositoryHandler {
 
-       boolean hasNoRepos = false;
+    boolean hasNoRepos = false;
 
-       @Override
+    @Override
     protected void doExecute(LoadMetadataRepositoryJob job) {
-               if (hasNoRepos) {
-                       return;
-               }
-               UpdateOperation operation = getProvisioningUI().getUpdateOperation(null, null);
+        if (hasNoRepos) {
+            return;
+        }
+        UpdateOperation operation = getProvisioningUI().getUpdateOperation(null, null);
 
 
-               // check for updates
-               operation.resolveModal(null);
-               if (getProvisioningUI().getPolicy().continueWorkingWithOperation(operation, getShell())) {
-                       if (UpdateSingleIUWizard.validFor(operation)) {
-                               // Special case for only updating a single root
-                               UpdateSingleIUWizard wizard = new UpdateSingleIUWizard(getProvisioningUI(), operation);
-                               WizardDialog dialog = new WizardDialog(getShell(), wizard);
-                               dialog.create();
-                               dialog.open();
-                       } else {
-                               // Open the normal version of the update wizard
-                               getProvisioningUI().openUpdateWizard(false, operation, job);
-                       }
-               }
-       }
+        // check for updates
+        operation.resolveModal(null);
+        if (getProvisioningUI().getPolicy().continueWorkingWithOperation(operation, getShell())) {
+            if (UpdateSingleIUWizard.validFor(operation)) {
+                // Special case for only updating a single root
+                UpdateSingleIUWizard wizard = new UpdateSingleIUWizard(getProvisioningUI(), operation);
+                WizardDialog dialog = new WizardDialog(getShell(), wizard);
+                dialog.create();
+                dialog.open();
+            } else {
+                // Open the normal version of the update wizard
+                getProvisioningUI().openUpdateWizard(false, operation, job);
+            }
+        }
+    }
 
-       @Override
+    @Override
     protected boolean preloadRepositories() {
-               hasNoRepos = false;
-               RepositoryTracker repoMan = getProvisioningUI().getRepositoryTracker();
-               if (repoMan.getKnownRepositories(getProvisioningUI().getSession()).length == 0) {
-                       hasNoRepos = true;
-                       return false;
-               }
-               return super.preloadRepositories();
-       }
+        hasNoRepos = false;
+        RepositoryTracker repoMan = getProvisioningUI().getRepositoryTracker();
+        if (repoMan.getKnownRepositories(getProvisioningUI().getSession()).length == 0) {
+            hasNoRepos = true;
+            return false;
+        }
+        return super.preloadRepositories();
+    }
 }
diff --git a/eu.etaxonomy.taxeditor.application/src/main/resources/log4j.properties b/eu.etaxonomy.taxeditor.application/src/main/resources/log4j.properties
deleted file mode 100644 (file)
index c7c943e..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-### ************ APPENDER ***********************************###\r
-\r
-### direct log messages to stdout ###\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.Target=System.out\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n\r
-\r
-### direct messages to file hibernate.log ###\r
-log4j.appender.file=org.apache.log4j.FileAppender\r
-log4j.appender.file.File=taxeditor.log\r
-log4j.appender.file.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n\r
-\r
-### ************* LOG LEVELS *********************************###\r
-\r
-### set log levels - for more verbose logging change 'info' to 'debug' ###\r
-### levels: error, warn, debug, info\r
-log4j.rootLogger=INFO, stdout\r
-\r
-### set directory-specific levels below\r
-\r
-### basic level for editor directory\r
-log4j.logger.eu.etaxonomy.taxeditor.editor = WARN, stdout \r
-\r
-log4j.logger.eu.etaxonomy.taxeditor.editor.handler = DEBUG, stdout\r
-\r
-### log level for conversation handler\r
-#log4j.logger.eu.etaxonomy.cdm.api.application = DEBUG, stdout\r
index 5ff90b230e62a2d2a915585ed2f290bdcb34c824..264aebb561ee41e11130a5ba4ef3780ff1c43348 100644 (file)
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
-       <classpathentry including="**/*.java" kind="src" path="src/main/java"/>\r
-       <classpathentry including="**/*.java" kind="src" path="src/test/java"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry including="**/*.java" kind="src" path="src/main/java"/>
+       <classpathentry including="**/*.java" kind="src" path="src/test/java"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 60ba65373bc6ef60f733df4ef9d8e4a57d4517ad..7a89eaee2b98a20af72047f3d0d8b610d63d2bbf 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Bulkeditor Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.bulkeditor;singleton:=true
-Bundle-Version: 3.8.0.qualifier
+Bundle-Version: 4.0.0.qualifier
 Bundle-Activator: eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin
 Bundle-Vendor: EDIT
 Export-Package: eu.etaxonomy.taxeditor.annotatedlineeditor,
@@ -19,9 +19,10 @@ Require-Bundle: org.eclipse.ui,
  org.eclipse.core.expressions,
  eu.etaxonomy.taxeditor.store,
  eu.etaxonomy.taxeditor.cdmlib
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
 Bundle-ActivationPolicy: lazy
-Import-Package: org.eclipse.core.runtime,
+Import-Package: eu.etaxonomy.taxeditor.editor,
+ org.eclipse.core.runtime,
  org.eclipse.equinox.app,
  org.eclipse.jface.text,
  org.eclipse.jface.text.presentation,
@@ -30,138 +31,3 @@ Import-Package: org.eclipse.core.runtime,
  org.eclipse.jface.text.source,
  org.eclipse.ui.views.properties,
  org.osgi.framework
-Bundle-ClassPath: .,
- activation-1.1.jar,
- antlr-2.7.6.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,
- dom4j-1.6.1.jar,
- dozer-5.3.0-sources.jar,
- dozer-5.3.0.jar,
- ehcache-1.2.3.jar,
- ejb3-persistence.jar,
- ezmorph-1.0.4.jar,
- fop.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,
- 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,
- 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,
- 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,
- servlet-api-2.5.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,
- xml-apis-ext-1.3.04.jar,
- xml-apis.jar,
- xml-resolver-1.2.jar,
- xmlgraphics-commons-1.3.1.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
index f77e70cbb39ffefe75a6f1b5ac860d7d5e888509..9ede48e0da771eaedd05c82887c8d1425934a3ca 100644 (file)
@@ -16,10 +16,10 @@ command.label.2 = Remove as Candidate(s) for Duplicate Removal
 command.label.3 = De-Duplicate Group
 command.label.4 = Delete
 command.label.5 = Convert to Person
+command.label.6 = Convert to Team
 command.name = Merge Group
 command.name.0 = Set as Target for Group Merge
 command.name.1 = Dynamic Open Bulk Editor
-commandParameter.name = Bulk Editor Class
 command.name.2 = Dynamic New Object
 command.name.3 = Dynamic Delete Object
 command.name.4 = Set as Candidate for Group Merge
@@ -30,5 +30,6 @@ command.name.8 = convert to Person
 command.name.9 = convert to Team
 specification.label = Merge Candidate Annotation
 specification.label.0 = Merge Target Annotation
-command.label.6 = Convert to Team
-command.name.10 = convert Person to Team
\ No newline at end of file
+command.name.10 = convert Person to Team
+command.label.OPEN_REFERENCING_OBJECTS_VIEW = Referencing Objects View
+command.name.OPEN_REFERENCING_OBJECTS_VIEW = Open Referencing Objects View
\ No newline at end of file
index 1365dd13911261d9b8a7479a48d32a0e1b51fd47..f454140aa0116587bac81967730077f08ab2b2b4 100644 (file)
@@ -16,4 +16,20 @@ command.label.2 = Entferne Kandidat f\u00fcr Duplikatenentfernung
 command.label.3 = Dedupliziere Gruppe
 command.label.4 = L\u00f6schen
 command.label.5 = Umwandeln in Person
-command.label.6 = Umwandeln in Team
\ No newline at end of file
+command.label.6 = Umwandeln in Team
+command.name = Gruppen zusammenfügen
+command.name.0 = Setze als Ziel für Gruppenzusammenfügung
+command.name.1 = Dynamisches Ã–ffnen Bulk Editor
+command.name.2 = Dynamisches Neues Objekt
+command.name.3 = Dynamisches Objekt Löschen
+command.name.4 = Setze als Kandidat für Gruppenzusammenfügung
+command.name.5 = Entferne Kandidat für Gruppenzusammenfügung
+command.name.6 = Setze Marker Flag
+command.name.7 = Löschen
+command.name.8 = In Person umwandeln
+command.name.9 = In Team umwandeln
+specification.label = Kandidat-Annotation zusammenfügen
+specification.label.0 = Ziel-Annotation zusammenfügen
+command.name.10 = Person in Team umwandeln
+command.label.OPEN_REFERENCING_OBJECTS_VIEW = Referenzierende Objekte
+command.name.OPEN_REFERENCING_OBJECTS_VIEW = Ã–ffne Referenzierende Objekte
\ No newline at end of file
index 816633c1755ba03a9e51dcf117952e161ddb20e5..2250072f6e6ce7ae774be79a11d1b57234f1f32e 100644 (file)
@@ -6,3 +6,4 @@ BulkEditorInputType_4=Specimen and Observations
 BulkEditorInputType_5=Users\r
 BulkEditorInputType_6=Groups\r
 BulkEditorInputType_7=Taxa\r
+BulkEditorInputType_8=Media\r
index 56a3c86fcbdf9e5c9b2e8d8249b68fee61ccd16b..4bf7416ffc36876518d48d4d323cd148c2922b75 100644 (file)
@@ -6,3 +6,4 @@ BulkEditorInputType_4=Belege und Beobachtungen
 BulkEditorInputType_5=Nutzer\r
 BulkEditorInputType_6=Nutzergruppen\r
 BulkEditorInputType_7=Taxa\r
+BulkEditorInputType_8=Medien
\ No newline at end of file
index f408f10ff1d902402c707fb61e42842a08b575df..4869f718f708c836da07c80dcedda77ff609f01a 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<?eclipse version="3.4"?>\r
-<plugin>\r
-\r
-   <extension\r
-         id="application"\r
-         point="org.eclipse.core.runtime.applications">\r
-      <application>\r
-         <run\r
-               class="eu.etaxonomy.taxeditor.bulkeditor.Application">\r
-         </run>\r
-      </application>\r
-   </extension>\r
-   <extension\r
-         point="org.eclipse.ui.editors">\r
-      <editor\r
-            class="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor"\r
-            default="false"\r
-            id="bulkeditor.editor"\r
-            name="%editor.name">\r
-      </editor>\r
-      <editor\r
-            class="eu.etaxonomy.taxeditor.nameditor.TaxonNameEditor"\r
-            default="false"\r
-            id="nameeditor.editor"\r
-            name="%editor.name.0">\r
-      </editor>\r
-      <editor\r
-            class="eu.etaxonomy.taxeditor.dataimport.DataImportEditor"\r
-            default="false"\r
-            id="eu.etaxonomy.taxeditor.dataimport.DataImportEditor"\r
-            name="%editor.name.1">\r
-      </editor>\r
-   </extension>\r
-   <extension\r
-         point="org.eclipse.ui.menus">\r
-      <menuContribution\r
-            locationURI="menu:org.eclipse.ui.main.menu.window?before=eu.etaxonomy.taxeditor.application.windowMenu.last">\r
-         <menu\r
-               id="bulkeditor.menus.openmenu"\r
-               label="%menu.label">\r
-            <visibleWhen\r
-                  checkEnabled="true">\r
-               <reference\r
-                     definitionId="isCdmStoreConnected">\r
-               </reference>\r
-            </visibleWhen>\r
-         </menu>\r
-         <menu\r
-               label="%menu.label.0">\r
-            <visibleWhen\r
-                  checkEnabled="true">\r
-               <reference\r
-                     definitionId="isCdmStoreConnected">\r
-               </reference>\r
-            </visibleWhen>\r
-         </menu>\r
-      </menuContribution>\r
-      <menuContribution\r
-            locationURI="menu:bulkeditor.menus.openmenu">\r
-         <dynamic\r
-               class="eu.etaxonomy.taxeditor.bulkeditor.command.OpenBulkEditorContributionItem"\r
-               id="taxeditor-bulkeditor.dynamicopenmenu">\r
-            <visibleWhen\r
-                  checkEnabled="true">\r
-               <reference\r
-                     definitionId="isCdmStoreConnected">\r
-               </reference>\r
-            </visibleWhen>\r
-         </dynamic>\r
-         <!--command\r
-               commandId="taxeditor-nameeditor.commands.open"\r
-               label="Open Name Editor"\r
-               style="push">\r
-            <visibleWhen\r
-                  checkEnabled="false">\r
-               <reference\r
-                     definitionId="pigsFly">\r
-               </reference>\r
-            </visibleWhen>\r
-         </command-->\r
-      </menuContribution>\r
-      <menuContribution\r
-            locationURI="popup:#BulkEditorContext">\r
-         <command\r
-               commandId="eu.etaxonomy.taxeditor.navigation.command.update.editSelection"\r
-               label="%command.label"\r
-               style="push">\r
-            <visibleWhen>\r
-               <reference\r
-                     definitionId="isTaxonBulkEditorInput">\r
-               </reference>\r
-            </visibleWhen>\r
-         </command>\r
-         <separator\r
-               name="taxeditor-bulkeditor.separator1"\r
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+   <extension
+         id="application"
+         point="org.eclipse.core.runtime.applications">
+      <application>
+         <run
+               class="eu.etaxonomy.taxeditor.bulkeditor.Application">
+         </run>
+      </application>
+   </extension>
+   <extension
+         point="org.eclipse.ui.editors">
+      <editor
+            class="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor"
+            default="false"
+            id="bulkeditor.editor"
+            name="%editor.name">
+      </editor>
+      <editor
+            class="eu.etaxonomy.taxeditor.nameditor.TaxonNameEditor"
+            default="false"
+            id="nameeditor.editor"
+            name="%editor.name.0">
+      </editor>
+      <editor
+            class="eu.etaxonomy.taxeditor.dataimport.DataImportEditor"
+            default="false"
+            id="eu.etaxonomy.taxeditor.dataimport.DataImportEditor"
+            name="%editor.name.1">
+      </editor>
+   </extension>
+   <extension
+         point="org.eclipse.ui.menus">
+      <menuContribution
+            locationURI="menu:org.eclipse.ui.main.menu.window?before=eu.etaxonomy.taxeditor.application.windowMenu.last">
+         <menu
+               id="bulkeditor.menus.openmenu"
+               label="%menu.label">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
+         </menu>
+         <menu
+               label="%menu.label.0">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
+         </menu>
+      </menuContribution>
+      <menuContribution
+            locationURI="menu:bulkeditor.menus.openmenu">
+         <dynamic
+               class="eu.etaxonomy.taxeditor.bulkeditor.command.OpenBulkEditorContributionItem"
+               id="taxeditor-bulkeditor.dynamicopenmenu">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
+         </dynamic>
+      </menuContribution>
+      <menuContribution
+            locationURI="popup:#BulkEditorContext">
+         <dynamic
+               class="eu.etaxonomy.taxeditor.view.CdmViewerContextMenu"
+               id="eu.etaxonomy.taxeditor.bulkeditor.cdmViewerContextMenu">
+         </dynamic>
+         <separator
+               name="taxeditor-bulkeditor.separator1"
+               visible="true">
+         </separator>
+         <menu
+               label="%menu.label.1">
+            <dynamic
+                  class="eu.etaxonomy.taxeditor.bulkeditor.command.DynamicNewObjectMenu"
+                  id="eu.etaxonomy.taxeditor.bulkeditor.dynamicNewMenu">
+               <visibleWhen
+                     checkEnabled="false">
+                  <reference
+                        definitionId="isCdmStoreConnected">
+                  </reference>
+               </visibleWhen>
+            </dynamic>
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
+         </menu>
+         <separator
+               name="taxeditor-bulkeditor.separator4"\r
                visible="true">\r
-         </separator>\r
-         <menu\r
-               label="%menu.label.1">\r
-            <dynamic\r
-                  class="eu.etaxonomy.taxeditor.bulkeditor.command.DynamicNewObjectMenu"\r
-                  id="eu.etaxonomy.taxeditor.bulkeditor.dynamicNewMenu">\r
-               <visibleWhen\r
-                     checkEnabled="false">\r
-                  <reference\r
-                        definitionId="isCdmStoreConnected">\r
-                  </reference>\r
-               </visibleWhen>\r
-            </dynamic>\r
-            <visibleWhen\r
-                  checkEnabled="true">\r
-               <reference\r
-                     definitionId="isCdmStoreConnected">\r
-               </reference>\r
-            </visibleWhen>\r
-         </menu>\r
-         <separator\r
-               name="eu.etaxonomy.taxeditor.bulkeditor.separator1">\r
-         </separator>\r
-         <command\r
-               commandId="bulkeditor.commands.setmergetarget"\r
-               label="%command.label.0"\r
-               style="push">\r
-            <visibleWhen>\r
-               <reference\r
-                     definitionId="isMergeEnabled">\r
-               </reference>\r
-            </visibleWhen>\r
-         </command>\r
-         \r
-         <command\r
-               commandId="bulkeditor.commands.setmergecandidate"\r
-               label="%command.label.1"\r
-               style="push">\r
-            <visibleWhen>\r
-               <reference\r
-                     definitionId="isMergeEnabled">\r
-               </reference>\r
-            </visibleWhen>\r
-         </command>\r
-         <command\r
-               commandId="bulkeditor.commands.removemergecandidate"\r
-               label="%command.label.2"\r
-               style="push">\r
-            <visibleWhen>\r
-               <reference\r
-                     definitionId="isMergeEnabled">\r
-               </reference>\r
-            </visibleWhen>\r
-         </command>\r
-      <!--menuContribution\r
-            locationURI="popup:org.eclipse.ui.popup.any"-->            \r
-         <command\r
-               commandId="bulkeditor.commands.mergegroup"\r
-               label="%command.label.3"\r
-               style="push">\r
-            <visibleWhen>\r
-               <reference\r
-                     definitionId="isMergeEnabled">\r
-               </reference>\r
-            </visibleWhen>\r
-         </command>\r
-         <command\r
-               commandId="eu.etaxonomy.taxeditor.bulkeditor.convertTeam2Person"\r
-               label="%command.label.5"\r
-               style="push">\r
-                  <visibleWhen\r
-                               checkEnabled="true">\r
-                               <and>\r
-                               <reference\r
-                       definitionId="isConvertEnabled">\r
-                               </reference>\r
-                               <reference \r
-                                               definitionId="isTeam">\r
-                               </reference>\r
-                       </and>\r
-                       </visibleWhen>\r
-         </command>\r
-         <command\r
-               commandId="eu.etaxonomy.taxeditor.bulkeditor.convertPerson2Team"\r
-               label="%command.label.6"\r
-               style="push">\r
-               <visibleWhen \r
-                       checkEnabled="true">>\r
-                               <and>\r
-                               <reference\r
-                       definitionId="isConvertEnabled">\r
-                               </reference>\r
-                               <reference \r
-                                       definitionId="isPerson">\r
-                               </reference>\r
-                       </and>\r
-                       </visibleWhen>\r
-         </command>\r
-         <separator\r
-               name="taxeditor-bulkeditor.separator2"\r
-               visible="true">\r
-         </separator>\r
-         <menu\r
-               label="%menu.label.2">\r
-            <dynamic\r
-                  class="eu.etaxonomy.taxeditor.bulkeditor.command.DynamicMarkerTypeEditingMenu"\r
-                  id="eu.etaxonomy.taxeditor.bulkeditor.dynamicMarkerTypeEditingMenu">\r
-            </dynamic>\r
-            <visibleWhen\r
-                  checkEnabled="true">\r
-               <reference\r
-                     definitionId="isCdmStoreConnected">\r
-               </reference>\r
-            </visibleWhen>\r
-         </menu>\r
+         </separator>
+         <command
+               commandId="bulkeditor.commands.setmergetarget"
+               label="%command.label.0"
+               style="push">
+            <visibleWhen>
+               <reference
+                     definitionId="isMergeEnabled">
+               </reference>
+            </visibleWhen>
+         </command>
+         
+         <command
+               commandId="bulkeditor.commands.setmergecandidate"
+               label="%command.label.1"
+               style="push">
+            <visibleWhen>
+               <reference
+                     definitionId="isMergeEnabled">
+               </reference>
+            </visibleWhen>
+         </command>
+         <command
+               commandId="bulkeditor.commands.removemergecandidate"
+               label="%command.label.2"
+               style="push">
+            <visibleWhen>
+               <reference
+                     definitionId="isMergeEnabled">
+               </reference>
+            </visibleWhen>
+         </command>
+      <!--menuContribution
+            locationURI="popup:org.eclipse.ui.popup.any"-->            
+         <command
+               commandId="bulkeditor.commands.mergegroup"
+               label="%command.label.3"
+               style="push">
+            <visibleWhen>
+               <reference
+                     definitionId="isMergeEnabled">
+               </reference>
+            </visibleWhen>
+         </command>
          <separator\r
-               name="taxeditor-bulkeditor.separator3"\r
+               name="eu.etaxonomy.taxeditor.bulkeditor.separator1"\r
                visible="true">\r
          </separator>\r
-         <command\r
-               commandId="eu.etaxonomy.taxeditor.bulkeditor.delete"\r
-               label="%command.label.4"\r
-               style="push">\r
-            <visibleWhen\r
-                  checkEnabled="true">\r
-               <reference\r
-                     definitionId="isCdmStoreConnected">\r
-               </reference>\r
-            </visibleWhen>\r
-         </command>\r
-      </menuContribution>\r
-   </extension>\r
-   <extension\r
-         point="org.eclipse.ui.commands">\r
-      <command\r
-            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.MergeGroupHandler"\r
-            id="bulkeditor.commands.mergegroup"\r
-            name="%command.name">\r
-      </command>\r
-      <command\r
-            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.SetMergeTargetHandler"\r
-            id="bulkeditor.commands.setmergetarget"\r
-            name="%command.name.0">\r
-      </command>\r
-      <command\r
-            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.OpenBulkEditorHandler"\r
-            id="taxeditor-bulkeditor.dynamicopenmenu"\r
-            name="%command.name.1">\r
-         <commandParameter\r
-               id="taxeditor-bulkeditor.commandParameter.inputType"\r
-               name="%commandParameter.name"\r
-               values="eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues">\r
-         </commandParameter>\r
-      </command>\r
-      <command\r
-            defaultHandler="eu.etaxonomy.taxeditor.annotatedlineeditor.handler.NewObjectHandler"\r
-            id="taxeditor-bulkeditor.dynamicnewobjectcommand"\r
-            name="%command.name.2">\r
-      </command>\r
-      <command\r
-            defaultHandler="eu.etaxonomy.taxeditor.annotatedlineeditor.handler.DeleteObjectHandler"\r
-            id="taxeditor-bulkeditor.dynamicdeleteobjectcommand"\r
-            name="%command.name.3">\r
-      </command>\r
-      <command\r
-            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.SetMergeCandidateHandler"\r
-            id="bulkeditor.commands.setmergecandidate"\r
-            name="%command.name.4">\r
-      </command>\r
-      <command\r
-            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.RemoveMergeCandidateHandler"\r
-            id="bulkeditor.commands.removemergecandidate"\r
-            name="%command.name.5">\r
-      </command>\r
-      <command\r
-            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.SetMarkerFlagHandler"\r
-            id="taxeditor-bulkeditor.command.setMarkerFlag"\r
-            name="%command.name.6">\r
-      </command>\r
-      <command\r
-            id="eu.etaxonomy.taxeditor.bulkeditor.delete"\r
-            name="%command.name.7">\r
-      </command>\r
-      <command\r
-            id="eu.etaxonomy.taxeditor.bulkeditor.convertTeam2Person"\r
-            name="%command.name.8">\r
-      </command>\r
-      <command\r
-            id="eu.etaxonomy.taxeditor.bulkeditor.convertPerson2Team"\r
-            name="%command.name.10">\r
-      </command>\r
-      <!--command\r
-            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.NewEntityHandler"\r
-            id="eu.etaxonomy.taxeditor.bulkeditor.command.new"\r
-            name="New Entity">\r
-      </command-->\r
-   </extension>\r
-   <extension\r
-         point="org.eclipse.ui.editors.markerAnnotationSpecification">\r
-      <specification\r
-            annotationType="merge_candidate_annotation"\r
-            colorPreferenceKey="merge_candidate_annotation_color"\r
-            colorPreferenceValue="220,220,255"\r
-            highlightPreferenceValue="true"\r
-            icon="icons/merge_candidate.gif"\r
-            includeOnPreferencePage="true"\r
-            label="%specification.label"\r
-            overviewRulerPreferenceKey="merge_candidate_annotation_overview"\r
-            overviewRulerPreferenceValue="true"\r
-            presentationLayer="0"\r
-            symbolicIcon="task"\r
-            textPreferenceKey="merge_candidate_annotation_text"\r
-            textPreferenceValue="false"\r
-            textStylePreferenceValue="BOX"\r
-            verticalRulerPreferenceKey="merge_candidate_annotation_vertical"\r
-            verticalRulerPreferenceValue="true">\r
-      </specification>\r
-      <specification\r
-            annotationType="merge_target_annotation"\r
-            colorPreferenceKey="merge_target_annotation_color"\r
-            colorPreferenceValue="220,220,255"\r
-            highlightPreferenceValue="true"\r
-            icon="icons/merge_target.gif"\r
-            includeOnPreferencePage="true"\r
-            label="%specification.label.0"\r
-            overviewRulerPreferenceKey="merge_target_annotation_overview"\r
-            overviewRulerPreferenceValue="true"\r
-            presentationLayer="1"\r
-            symbolicIcon="task"\r
-            textPreferenceKey="merge_target_annotation_text"\r
-            textPreferenceValue="false"\r
-            textStylePreferenceValue="BOX"\r
-            verticalRulerPreferenceKey="merge_target_annotation_vertical"\r
-            verticalRulerPreferenceValue="true">\r
-      </specification>      \r
-   </extension>\r
-   <extension\r
-         point="org.eclipse.ui.editors.annotationTypes">\r
-      <type\r
-            name="merge_candidate_annotation">\r
-      </type>\r
-      <type\r
-            name="merge_target_annotation">\r
-      </type>\r
-   </extension>\r
-   <extension\r
-         point="org.eclipse.ui.views">\r
-      <view\r
-            class="eu.etaxonomy.taxeditor.bulkeditor.referencingobjects.ReferencingObjectsView"\r
-            id="eu.etaxonomy.taxeditor.bulkeditor.view.referencingobjects"\r
-            name="%view.name"\r
-            restorable="false">\r
-      </view>\r
-   </extension>   \r
-   <extension\r
-         point="org.eclipse.core.expressions.definitions">\r
-      <definition\r
-            id="isMergeEnabled">\r
-         <with\r
-               variable="activeEditor">\r
-            <test\r
-                  property="taxeditor-bulkeditor.propertyTester.isMergingEnabled">\r
-            </test>\r
-         </with>\r
-      </definition>\r
-      <definition\r
-            id="isConvertEnabled">\r
-         <with\r
-               variable="activeEditor">\r
-            <test\r
-                  property="taxeditor-bulkeditor.propertyTester.isConvertingEnabled">\r
-            </test>\r
-         </with>\r
-      </definition>\r
-      <definition\r
-            id="isTaxonBulkEditorInput">\r
-         <with\r
-               variable="activeEditor">\r
-            <test\r
-                  property="taxeditor-bulkeditor.propertyTester.isTaxonEditor">\r
-            </test>\r
-         </with>\r
-      </definition>\r
-       <definition\r
-            id="isTeam">\r
-         <with\r
-               variable="selection">\r
-            <test\r
-                  property="eu.etaxonomy.taxeditor.bulkeditor.command.isTeam">\r
-            </test>\r
-         </with>\r
-      </definition>\r
-      <definition\r
-            id="isPerson">\r
-         <with\r
-               variable="selection">\r
-            <test\r
-                  property="eu.etaxonomy.taxeditor.bulkeditor.command.isPerson">\r
-            </test>\r
-         </with>\r
-      </definition>\r
-   </extension>\r
-   <extension\r
-         point="org.eclipse.core.expressions.propertyTesters">\r
-      <propertyTester\r
-            class="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorPropertyTester"\r
-            id="taxeditor-bulkeditor.PropertyTester"\r
-            namespace="taxeditor-bulkeditor.propertyTester"\r
-            properties="isMergingEnabled, isDerivedUnitEditor, isTaxonEditor, isGroupEditor, isConvertingEnabled"\r
-            type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">\r
-      </propertyTester>\r
-      <propertyTester\r
-            class="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorMenuPropertyTester"\r
-            id="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorMenuPropertyTester"\r
-            namespace="eu.etaxonomy.taxeditor.bulkeditor.command"\r
-            properties="isTeam, isPerson"\r
-            type="java.lang.Object">\r
-      </propertyTester>\r
-   </extension>\r
-   <extension\r
-         point="org.eclipse.ui.handlers">\r
-      <handler\r
-            class="org.eclipse.ui.internal.handlers.WidgetMethodHandler:cut"\r
-            commandId="org.eclipse.ui.edit.cut">\r
-         <activeWhen>\r
-            <with\r
-                  variable="activeFocusControlId">\r
-               <equals\r
-                     value="bulkeditor.textControlId">\r
-               </equals>\r
-            </with>\r
-         </activeWhen>\r
-      </handler>\r
-      <handler\r
-            class="org.eclipse.ui.internal.handlers.WidgetMethodHandler:copy"\r
-            commandId="org.eclipse.ui.edit.copy">\r
-         <activeWhen>\r
-            <with\r
-                  variable="activeFocusControlId">\r
-               <equals\r
-                     value="bulkeditor.textControlId">\r
-               </equals>\r
-            </with>\r
-         </activeWhen>\r
-      </handler>\r
-      <handler\r
-            class="org.eclipse.ui.internal.handlers.WidgetMethodHandler:paste"\r
-            commandId="org.eclipse.ui.edit.paste">\r
-         <activeWhen>\r
-            <with\r
-                  variable="activeFocusControlId">\r
-               <equals\r
-                     value="bulkeditor.textControlId">\r
-               </equals>\r
-            </with>\r
-         </activeWhen>\r
-      </handler>\r
-      <handler\r
-            class="eu.etaxonomy.taxeditor.bulkeditor.handler.DeleteHandler"\r
-            commandId="eu.etaxonomy.taxeditor.bulkeditor.delete">\r
-         <activeWhen>\r
-            <with\r
-                  variable="selection">\r
-               <instanceof\r
-                     value="eu.etaxonomy.taxeditor.model.LineSelection">\r
-               </instanceof>\r
-            </with>\r
-         </activeWhen>\r
-      </handler>\r
-      <handler\r
-            class="eu.etaxonomy.taxeditor.bulkeditor.handler.ConvertTeam2PersonHandler"\r
-            commandId="eu.etaxonomy.taxeditor.bulkeditor.convertTeam2Person">\r
-      </handler>\r
-      <handler\r
-            class="eu.etaxonomy.taxeditor.bulkeditor.handler.ConvertPerson2TeamHandler"\r
-            commandId="eu.etaxonomy.taxeditor.bulkeditor.convertPerson2Team">\r
-      </handler>\r
-      \r
-   </extension>\r
-   <extension\r
-         point="org.eclipse.ui.preferencePages">\r
-      <page\r
-            category="eu.etaxonomy.taxeditor.preferences.bulkeditor.general"\r
-            class="eu.etaxonomy.taxeditor.bulkeditor.preference.BulkEditorMarkerPreferencePage"\r
-            id="eu.etaxonomy.taxeditor.preferences.bulkeditor.markerTypes"\r
-            name="%page.name">\r
-      </page>\r
-      <page\r
-            category="eu.etaxonomy.taxeditor.preferences.general"\r
-            class="eu.etaxonomy.taxeditor.bulkeditor.preference.BulkEditorGeneralPreferencePage"\r
-            id="eu.etaxonomy.taxeditor.preferences.bulkeditor.general"\r
-            name="%page.name.0">\r
-      </page>\r
-   </extension>\r
-   <extension\r
-         point="org.eclipse.ui.perspectiveExtensions">\r
-      <perspectiveExtension\r
-            targetID="*">\r
-         <showInPart\r
-               id="eu.etaxonomy.taxeditor.bulkeditor.view.referencingobjects"></showInPart>\r
-         <showInPart\r
-               id="eu.etaxonomy.taxeditor.view.detail">\r
-         </showInPart>\r
-      </perspectiveExtension>\r
-   </extension>\r
-<!-- start set marker -->\r
-\r
-</plugin>\r
+         <command
+               commandId="eu.etaxonomy.taxeditor.bulkeditor.convertTeam2Person"
+               label="%command.label.5"
+               style="push">
+                  <visibleWhen
+                               checkEnabled="true">
+                               <and>
+                               <reference
+                       definitionId="isConvertEnabled">
+                               </reference>
+                               <reference 
+                                               definitionId="isTeam">
+                               </reference>
+                       </and>
+                       </visibleWhen>
+         </command>
+         <command
+               commandId="eu.etaxonomy.taxeditor.bulkeditor.convertPerson2Team"
+               label="%command.label.6"
+               style="push">
+               <visibleWhen 
+                       checkEnabled="true">>
+                               <and>
+                               <reference
+                       definitionId="isConvertEnabled">
+                               </reference>
+                               <reference 
+                                       definitionId="isPerson">
+                               </reference>
+                       </and>
+                       </visibleWhen>
+         </command>
+         <separator
+               name="taxeditor-bulkeditor.separator2"
+               visible="true">
+         </separator>
+         <menu
+               label="%menu.label.2">
+            <dynamic
+                  class="eu.etaxonomy.taxeditor.bulkeditor.command.DynamicMarkerTypeEditingMenu"
+                  id="eu.etaxonomy.taxeditor.bulkeditor.dynamicMarkerTypeEditingMenu">
+            </dynamic>
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
+         </menu>
+         <separator
+               name="taxeditor-bulkeditor.separator3"
+               visible="true">
+         </separator>
+         <command
+               commandId="eu.etaxonomy.taxeditor.bulkeditor.delete"
+               label="%command.label.4"
+               style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+      <menuContribution
+            allPopups="false"
+            locationURI="popup:eu.etaxonomy.taxeditor.bulkeditor.view.referencingobjects">
+         <dynamic
+               class="eu.etaxonomy.taxeditor.view.CdmViewerContextMenu"
+               id="eu.etaxonomy.taxeditor.referencingObjectsView.cdmViewerContextMenu">
+         </dynamic>
+         <separator
+               name="eu.etaxonomy.taxeditor.bulkeditor.separator1">
+         </separator>
+      </menuContribution>
+      <menuContribution
+            allPopups="false"
+            locationURI="menu:eu.etaxonomy.taxeditor.menu.showView?after=org.eclipse.ui.views.showView.supplemental">
+         <command
+               commandId="eu.etaxonomy.taxeditor.openReferencingObjectsView"
+               label="%command.label.OPEN_REFERENCING_OBJECTS_VIEW"
+               style="push">
+         </command>
+      </menuContribution>
+   </extension>
+   <extension
+         point="org.eclipse.ui.commands">
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.MergeGroupHandler"
+            id="bulkeditor.commands.mergegroup"
+            name="%command.name">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.SetMergeTargetHandler"
+            id="bulkeditor.commands.setmergetarget"
+            name="%command.name.0">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.OpenBulkEditorHandler"
+            id="taxeditor-bulkeditor.dynamicopenmenu"
+            name="%command.name.1">
+         <commandParameter
+               id="taxeditor-bulkeditor.commandParameter.inputType"
+               name="Bulk Editor Class"
+               values="eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues">
+         </commandParameter>
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.annotatedlineeditor.handler.NewObjectHandler"
+            id="taxeditor-bulkeditor.dynamicnewobjectcommand"
+            name="%command.name.2">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.annotatedlineeditor.handler.DeleteObjectHandler"
+            id="taxeditor-bulkeditor.dynamicdeleteobjectcommand"
+            name="%command.name.3">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.SetMergeCandidateHandler"
+            id="bulkeditor.commands.setmergecandidate"
+            name="%command.name.4">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.RemoveMergeCandidateHandler"
+            id="bulkeditor.commands.removemergecandidate"
+            name="%command.name.5">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.SetMarkerFlagHandler"
+            id="taxeditor-bulkeditor.command.setMarkerFlag"
+            name="%command.name.6">
+      </command>
+      <command
+            id="eu.etaxonomy.taxeditor.bulkeditor.delete"
+            name="%command.name.7">
+      </command>
+      <command
+            id="eu.etaxonomy.taxeditor.bulkeditor.convertTeam2Person"
+            name="%command.name.8">
+      </command>
+      <command
+            id="eu.etaxonomy.taxeditor.bulkeditor.convertPerson2Team"
+            name="%command.name.10">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.handler.defaultHandler.OpenReferencingObjectsView"
+            id="eu.etaxonomy.taxeditor.openReferencingObjectsView"
+            name="%command.name.OPEN_REFERENCING_OBJECTS_VIEW">
+      </command>
+      <!--command
+            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.NewEntityHandler"
+            id="eu.etaxonomy.taxeditor.bulkeditor.command.new"
+            name="New Entity">
+      </command-->
+   </extension>
+   <extension
+         point="org.eclipse.ui.editors.markerAnnotationSpecification">
+      <specification
+            annotationType="merge_candidate_annotation"
+            colorPreferenceKey="merge_candidate_annotation_color"
+            colorPreferenceValue="220,220,255"
+            highlightPreferenceValue="true"
+            icon="icons/merge_candidate.gif"
+            includeOnPreferencePage="true"
+            label="%specification.label"
+            overviewRulerPreferenceKey="merge_candidate_annotation_overview"
+            overviewRulerPreferenceValue="true"
+            presentationLayer="0"
+            symbolicIcon="task"
+            textPreferenceKey="merge_candidate_annotation_text"
+            textPreferenceValue="false"
+            textStylePreferenceValue="BOX"
+            verticalRulerPreferenceKey="merge_candidate_annotation_vertical"
+            verticalRulerPreferenceValue="true">
+      </specification>
+      <specification
+            annotationType="merge_target_annotation"
+            colorPreferenceKey="merge_target_annotation_color"
+            colorPreferenceValue="220,220,255"
+            highlightPreferenceValue="true"
+            icon="icons/merge_target.gif"
+            includeOnPreferencePage="true"
+            label="%specification.label.0"
+            overviewRulerPreferenceKey="merge_target_annotation_overview"
+            overviewRulerPreferenceValue="true"
+            presentationLayer="1"
+            symbolicIcon="task"
+            textPreferenceKey="merge_target_annotation_text"
+            textPreferenceValue="false"
+            textStylePreferenceValue="BOX"
+            verticalRulerPreferenceKey="merge_target_annotation_vertical"
+            verticalRulerPreferenceValue="true">
+      </specification>      
+   </extension>
+   <extension
+         point="org.eclipse.ui.editors.annotationTypes">
+      <type
+            name="merge_candidate_annotation">
+      </type>
+      <type
+            name="merge_target_annotation">
+      </type>
+   </extension>
+   <extension
+         point="org.eclipse.ui.views">
+      <view
+            class="eu.etaxonomy.taxeditor.bulkeditor.referencingobjects.ReferencingObjectsView"
+            id="eu.etaxonomy.taxeditor.bulkeditor.view.referencingobjects"
+            name="%view.name"
+            restorable="false">
+      </view>
+   </extension>   
+   <extension
+         point="org.eclipse.core.expressions.definitions">
+      <definition
+            id="isMergeEnabled">
+         <with
+               variable="activeEditor">
+            <test
+                  property="taxeditor-bulkeditor.propertyTester.isMergingEnabled">
+            </test>
+         </with>
+      </definition>
+      <definition
+            id="isConvertEnabled">
+         <with
+               variable="activeEditor">
+            <test
+                  property="taxeditor-bulkeditor.propertyTester.isConvertingEnabled">
+            </test>
+         </with>
+      </definition>
+      <definition
+            id="isTaxonBulkEditorInput">
+         <with
+               variable="activeEditor">
+            <test
+                  property="taxeditor-bulkeditor.propertyTester.isTaxonEditor">
+            </test>
+         </with>
+      </definition>
+       <definition
+            id="isTeam">
+         <with
+               variable="selection">
+            <test
+                  property="eu.etaxonomy.taxeditor.bulkeditor.command.isTeam">
+            </test>
+         </with>
+      </definition>
+      <definition
+            id="isPerson">
+         <with
+               variable="selection">
+            <test
+                  property="eu.etaxonomy.taxeditor.bulkeditor.command.isPerson">
+            </test>
+         </with>
+      </definition>
+   </extension>
+   <extension
+         point="org.eclipse.core.expressions.propertyTesters">
+      <propertyTester
+            class="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorPropertyTester"
+            id="taxeditor-bulkeditor.PropertyTester"
+            namespace="taxeditor-bulkeditor.propertyTester"
+            properties="isMergingEnabled, isDerivedUnitEditor, isTaxonEditor, isGroupEditor, isConvertingEnabled"
+            type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">
+      </propertyTester>
+      <propertyTester
+            class="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorMenuPropertyTester"
+            id="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorMenuPropertyTester"
+            namespace="eu.etaxonomy.taxeditor.bulkeditor.command"
+            properties="isTeam, isPerson"
+            type="java.lang.Object">
+      </propertyTester>
+   </extension>
+   <extension
+         point="org.eclipse.ui.handlers">
+      <handler
+            class="org.eclipse.ui.internal.handlers.WidgetMethodHandler:cut"
+            commandId="org.eclipse.ui.edit.cut">
+         <activeWhen>
+            <with
+                  variable="activeFocusControlId">
+               <equals
+                     value="bulkeditor.textControlId">
+               </equals>
+            </with>
+         </activeWhen>
+      </handler>
+      <handler
+            class="org.eclipse.ui.internal.handlers.WidgetMethodHandler:copy"
+            commandId="org.eclipse.ui.edit.copy">
+         <activeWhen>
+            <with
+                  variable="activeFocusControlId">
+               <equals
+                     value="bulkeditor.textControlId">
+               </equals>
+            </with>
+         </activeWhen>
+      </handler>
+      <handler
+            class="org.eclipse.ui.internal.handlers.WidgetMethodHandler:paste"
+            commandId="org.eclipse.ui.edit.paste">
+         <activeWhen>
+            <with
+                  variable="activeFocusControlId">
+               <equals
+                     value="bulkeditor.textControlId">
+               </equals>
+            </with>
+         </activeWhen>
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.bulkeditor.handler.DeleteHandler"
+            commandId="eu.etaxonomy.taxeditor.bulkeditor.delete">
+         <activeWhen>
+            <with
+                  variable="selection">
+               <instanceof
+                     value="eu.etaxonomy.taxeditor.model.LineSelection">
+               </instanceof>
+            </with>
+         </activeWhen>
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.bulkeditor.handler.ConvertTeam2PersonHandler"
+            commandId="eu.etaxonomy.taxeditor.bulkeditor.convertTeam2Person">
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.bulkeditor.handler.ConvertPerson2TeamHandler"
+            commandId="eu.etaxonomy.taxeditor.bulkeditor.convertPerson2Team">
+      </handler>
+      
+   </extension>
+   <extension
+         point="org.eclipse.ui.preferencePages">
+      <page
+            category="eu.etaxonomy.taxeditor.preferences.bulkeditor.general"
+            class="eu.etaxonomy.taxeditor.bulkeditor.preference.BulkEditorMarkerPreferencePage"
+            id="eu.etaxonomy.taxeditor.preferences.bulkeditor.markerTypes"
+            name="%page.name">
+      </page>
+      <page
+            category="eu.etaxonomy.taxeditor.preferences.general"
+            class="eu.etaxonomy.taxeditor.bulkeditor.preference.BulkEditorGeneralPreferencePage"
+            id="eu.etaxonomy.taxeditor.preferences.bulkeditor.general"
+            name="%page.name.0">
+      </page>
+   </extension>
+   <extension
+         point="eu.etaxonomy.taxeditor.store.cdmViewer">
+      <viewCommandMapping
+            commandId="eu.etaxonomy.taxeditor.openReferencingObjectsView"
+            selection="java.lang.Object"
+            viewerName="Referencing Objects View">
+      </viewCommandMapping>
+   </extension>
+<!-- start set marker -->
+
+</plugin>
index 7730f3fadd05822f612735572142cc88171b6bac..35cae124aceef990ccb14d61c5cf92ad9691e610 100644 (file)
@@ -3,7 +3,7 @@
        <parent>
                <groupId>eu.etaxonomy</groupId>
                <artifactId>taxeditor-parent</artifactId>
-               <version>3.8.0-SNAPSHOT</version>
+               <version>4.0.0-SNAPSHOT</version>
        </parent>
 
        <modelVersion>4.0.0</modelVersion>
index 5469cb0693d406f40536e6a60776f43933ad8c14..3243ffbe49299cddaee36b43327ac5139893df83 100644 (file)
@@ -237,7 +237,8 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
                                if (annotation instanceof IEntityContainer<?>) {
                                        IEntityContainer<?> container = (IEntityContainer<?>) annotation;
                                        if (container.isMarkedAsNew() || container.isDirty()) {
-                                               persistenceService.save(container.getEntity()); // save
+                                               Object entity = persistenceService.save(container.getEntity()); // save
+                                               container.setEntity(entity);
                                                container.setDirty(false);
                                                container.markAsNew(false);
                                        }
index 08876fef01d643cd5a2869b83dd2472903ec86aa..e7640f011c211fac76387e65b040e4cc0c0d4575 100644 (file)
@@ -1,12 +1,12 @@
 // $Id$
 /**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
 package eu.etaxonomy.taxeditor.annotatedlineeditor;
 
 import java.util.Iterator;
@@ -29,6 +29,7 @@ import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -47,290 +48,296 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class AnnotatedLineEditor extends TextEditor implements IConversationEnabled, IPostOperationEnabled {
 
-       protected ConversationHolder conversation;
-
-       private IEntityPersistenceService persistenceService;
-       protected ILineDisplayStrategy lineDisplayStrategy;
-
-
-       /**
-        * <p>Constructor for AnnotatedLineEditor.</p>
-        *
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        */
-       public AnnotatedLineEditor(ConversationHolder conversation) {
-               this.conversation = conversation;
-       }
-
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.editors.text.TextEditor#doSetInput(org.eclipse.ui.IEditorInput)
-        */
-       /** {@inheritDoc} */
-       @Override
-       protected void doSetInput(IEditorInput input) throws CoreException {
-
-               AnnotatedLineDocumentProvider provider = new AnnotatedLineDocumentProvider(input);
-
-               provider.setLineDisplayStrategy(lineDisplayStrategy, input);
-               setDocumentProvider(provider);
-
-               super.doSetInput(input);
-       }
-
-       /**
-        * <p>Setter for the field <code>persistenceService</code>.</p>
-        *
-        * @param persistenceService a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService} object.
-        */
-       protected void setPersistenceService(
-                       IEntityPersistenceService persistenceService) {
-               this.persistenceService = persistenceService;
-       }
-
-       /**
-        * <p>Getter for the field <code>persistenceService</code>.</p>
-        *
-        * @return a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService} object.
-        */
-       protected IEntityPersistenceService getPersistenceService() {
-               return persistenceService;
-       }
-
-       /**
-        * <p>Setter for the field <code>lineDisplayStrategy</code>.</p>
-        *
-        * @param lineDisplayStrategy a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy} object.
-        */
-       protected void setLineDisplayStrategy(
-                       ILineDisplayStrategy lineDisplayStrategy) {
-               this.lineDisplayStrategy = lineDisplayStrategy;
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       protected ISourceViewer createSourceViewer(Composite parent,
-                       IVerticalRuler ruler, int styles) {
-
-               fAnnotationAccess= getAnnotationAccess();
-               fOverviewRuler= createOverviewRuler(getSharedColors());
-               LineSelectionViewer viewer = new LineSelectionViewer(parent, ruler, getOverviewRuler(),
-                                               isOverviewRulerVisible(), styles);
-//                                             isOverviewRulerVisible(), styles | SWT.WRAP);
-               getSourceViewerDecorationSupport(viewer);
-
-               return viewer;
-       }
-
-       /**
-        * Create an annotated line with an "empty" entity, i.e. using the editor
-        * input's default entity type and a zero-length title cache.
-        *
-        * @return a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation} object.
-        */
-       public LineAnnotation createAnnotatedLineNewObject() {
-
-               // Create new object
-
-               AnnotatedLineDocumentProvider documentProvider = (AnnotatedLineDocumentProvider) getDocumentProvider();
-               IEntityCreator entityCreator = documentProvider.getEntityCreator(getEditorInput());
-               Object entity = entityCreator.createEntity(null);
-
-               LineAnnotation annotation = createAnnotatedLine(entity);
-               if (annotation != null) {
-                       annotation.markAsNew(true);
-               }
-               return annotation;
-       }
-
-       /**
-        * Create an annotated line, first creating an entity of type "key" - this key
-        * must be recognized by the editor's entity creator.
-        *
-        * @param key a {@link java.lang.Object} object.
-        * @param titleCache a {@link java.lang.String} object.
-        * @return a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation} object.
-        */
-       public LineAnnotation createAnnotatedLineNewObject(Object key, String titleCache) {
-
-
-
-               // Create new object
-               Object entity = ((AnnotatedLineDocumentProvider) getDocumentProvider()).
-                                                       getEntityCreator(getEditorInput()).createEntity(key, titleCache);
-               // checks if the creator also saves the entity (in a different conversation), in which case
-               // we need to bind back this editors conversation
-               // we also need to reload the entity because the conversation used to
-               // to create / save the entity may have been closed
-               if(entity != null && ((AnnotatedLineDocumentProvider) getDocumentProvider()).getEntityCreator(getEditorInput()).savesEntity()) {
-                       getConversationHolder().bind();
-                       Object object = CdmStore.getService(IOccurrenceService.class).load(((CdmBase)entity).getUuid());
-                       entity = HibernateProxyHelper.deproxy(object);
-               }
-
-               if(entity == null) {
-                       return null;
-               }
-               LineAnnotation annotation = createAnnotatedLine(entity);
-               if (annotation != null) {
-                       annotation.markAsNew(true);
-               }
-
-               return annotation;
-
-       }
-
-         @Override
-         public boolean isDirty() {
-               return super.isDirty();
-         }
-
-       /**
-        * Creates an annotated line at the end of the document. The annotation contains the entity.
-        *
-        * @param entity a {@link java.lang.Object} object.
-        * @return a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation} object.
-        */
-       public LineAnnotation createAnnotatedLine(Object entity) {
-
-               IEditorInput input = getEditorInput();
-               AnnotatedLineDocumentProvider provider = (AnnotatedLineDocumentProvider) getDocumentProvider();
-
-               LineAnnotation annotation = null;
-               try {
-                       annotation = provider.createAnnotatedLine(input, entity);
-
-                       // Jump to new line
-                       IAnnotationModel model = provider.getAnnotationModel(input);
-                       if(model != null){
-                               int start= model.getPosition(annotation).getOffset();
-                               selectAndReveal(start, 0);
-                       }
-
-               } catch (BadLocationException e) {
-                       // TODO Auto-generated catch block
-                       e.printStackTrace();
-               }
-               return annotation;
-       }
-
-       /**
-        * <p>removeAnnotatedLine</p>
-        *
-        * @param lineno a int.
-        */
-       public void removeAnnotatedLine(int lineno) {
-               ((AnnotatedLineDocumentProvider) getDocumentProvider()).removeAnnotatedLine(lineno);
-       }
-
-       /**
-        * <p>removeAnnotatedLine</p>
-        *
-        * @param annotation a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation} object.
-        */
-       public void removeAnnotatedLine(LineAnnotation annotation) {
-               ((AnnotatedLineDocumentProvider) getDocumentProvider()).removeAnnotatedLine(annotation);
-       }
-
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.texteditor.AbstractTextEditor#doSave(org.eclipse.core.runtime.IProgressMonitor)
-        */
-       /** {@inheritDoc} */
-       @Override
-       public void doSave(IProgressMonitor progressMonitor) {
-               if (getConversationHolder() != null) {
-                       if( ! getConversationHolder().isBound()){
-                               getConversationHolder().bind();
-                       }
-                       super.doSave(progressMonitor);
-                       getConversationHolder().commit(true);
-               } else {
-                       super.doSave(progressMonitor);
-               }
-               firePropertyChange(PROP_DIRTY);
-       }
-
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.texteditor.AbstractTextEditor#setFocus()
-        */
-       /** {@inheritDoc} */
-       @Override
-       public void setFocus() {
-               super.setFocus();
-               if (getConversationHolder() != null) {
-                       getConversationHolder().bind();
-               }
-               PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setFocus();
-               // TODO pass focus to underlying widgets
-       }
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
-        */
-       /**
-        * <p>getConversationHolder</p>
-        *
-        * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        */
-       @Override
+    protected ConversationHolder conversation;
+
+    private IEntityPersistenceService persistenceService;
+    protected ILineDisplayStrategy lineDisplayStrategy;
+
+
+    /**
+     * <p>Constructor for AnnotatedLineEditor.</p>
+     *
+     * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
+     */
+    public AnnotatedLineEditor(ConversationHolder conversation) {
+        this.conversation = conversation;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.editors.text.TextEditor#doSetInput(org.eclipse.ui.IEditorInput)
+     */
+    /** {@inheritDoc} */
+    @Override
+    protected void doSetInput(IEditorInput input) throws CoreException {
+
+        AnnotatedLineDocumentProvider provider = new AnnotatedLineDocumentProvider(input);
+
+        provider.setLineDisplayStrategy(lineDisplayStrategy, input);
+        setDocumentProvider(provider);
+
+        super.doSetInput(input);
+    }
+
+    /**
+     * <p>Setter for the field <code>persistenceService</code>.</p>
+     *
+     * @param persistenceService a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService} object.
+     */
+    protected void setPersistenceService(
+            IEntityPersistenceService persistenceService) {
+        this.persistenceService = persistenceService;
+    }
+
+    /**
+     * <p>Getter for the field <code>persistenceService</code>.</p>
+     *
+     * @return a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService} object.
+     */
+    protected IEntityPersistenceService getPersistenceService() {
+        return persistenceService;
+    }
+
+    /**
+     * <p>Setter for the field <code>lineDisplayStrategy</code>.</p>
+     *
+     * @param lineDisplayStrategy a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy} object.
+     */
+    protected void setLineDisplayStrategy(
+            ILineDisplayStrategy lineDisplayStrategy) {
+        this.lineDisplayStrategy = lineDisplayStrategy;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    protected ISourceViewer createSourceViewer(Composite parent,
+            IVerticalRuler ruler, int styles) {
+
+        fAnnotationAccess= getAnnotationAccess();
+        fOverviewRuler= createOverviewRuler(getSharedColors());
+        LineSelectionViewer viewer = new LineSelectionViewer(parent, ruler, getOverviewRuler(),
+                isOverviewRulerVisible(), styles);
+        //                                             isOverviewRulerVisible(), styles | SWT.WRAP);
+        getSourceViewerDecorationSupport(viewer);
+
+        return viewer;
+    }
+
+    /**
+     * Create an annotated line with an "empty" entity, i.e. using the editor
+     * input's default entity type and a zero-length title cache.
+     *
+     * @return a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation} object.
+     */
+    public LineAnnotation createAnnotatedLineNewObject() {
+
+        // Create new object
+
+        AnnotatedLineDocumentProvider documentProvider = (AnnotatedLineDocumentProvider) getDocumentProvider();
+        IEntityCreator entityCreator = documentProvider.getEntityCreator(getEditorInput());
+        Object entity = entityCreator.createEntity(null);
+
+        LineAnnotation annotation = createAnnotatedLine(entity);
+        if (annotation != null) {
+            annotation.markAsNew(true);
+        }
+        return annotation;
+    }
+
+    /**
+     * Create an annotated line, first creating an entity of type "key" - this key
+     * must be recognized by the editor's entity creator.
+     *
+     * @param key a {@link java.lang.Object} object.
+     * @param titleCache a {@link java.lang.String} object.
+     * @return a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation} object.
+     */
+    public LineAnnotation createAnnotatedLineNewObject(Object key, String titleCache) {
+
+
+
+        // Create new object
+        Object entity = ((AnnotatedLineDocumentProvider) getDocumentProvider()).
+                getEntityCreator(getEditorInput()).createEntity(key, titleCache);
+        // checks if the creator also saves the entity (in a different conversation), in which case
+        // we need to bind back this editors conversation
+        // we also need to reload the entity because the conversation used to
+        // to create / save the entity may have been closed
+        if(entity != null && ((AnnotatedLineDocumentProvider) getDocumentProvider()).getEntityCreator(getEditorInput()).savesEntity()) {
+            getConversationHolder().bind();
+            //FIXME: why do we use IOccurrenceService here? is this generic?
+            //because this method is only invoked by the handler which is used in the
+            //specimen bulk editor. This is unsafe and should be refactored!
+            Object object = CdmStore.getService(IOccurrenceService.class).load(((CdmBase)entity).getUuid());
+            entity = HibernateProxyHelper.deproxy(object);
+        }
+
+        if(entity == null) {
+            return null;
+        }
+        LineAnnotation annotation = createAnnotatedLine(entity);
+        if (annotation != null) {
+            annotation.markAsNew(true);
+        }
+
+        return annotation;
+
+    }
+
+    @Override
+    public boolean isDirty() {
+        return super.isDirty();
+    }
+
+    /**
+     * Creates an annotated line at the end of the document. The annotation contains the entity.
+     *
+     * @param entity a {@link java.lang.Object} object.
+     * @return a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation} object.
+     */
+    public LineAnnotation createAnnotatedLine(Object entity) {
+
+        IEditorInput input = getEditorInput();
+        AnnotatedLineDocumentProvider provider = (AnnotatedLineDocumentProvider) getDocumentProvider();
+
+        LineAnnotation annotation = null;
+        try {
+            annotation = provider.createAnnotatedLine(input, entity);
+
+            // Jump to new line
+            IAnnotationModel model = provider.getAnnotationModel(input);
+            if(model != null){
+                int start= model.getPosition(annotation).getOffset();
+                selectAndReveal(start, 0);
+            }
+
+        } catch (BadLocationException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        return annotation;
+    }
+
+    /**
+     * <p>removeAnnotatedLine</p>
+     *
+     * @param lineno a int.
+     */
+    public void removeAnnotatedLine(int lineno) {
+        ((AnnotatedLineDocumentProvider) getDocumentProvider()).removeAnnotatedLine(lineno);
+    }
+
+    /**
+     * <p>removeAnnotatedLine</p>
+     *
+     * @param annotation a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation} object.
+     */
+    public void removeAnnotatedLine(LineAnnotation annotation) {
+        ((AnnotatedLineDocumentProvider) getDocumentProvider()).removeAnnotatedLine(annotation);
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.texteditor.AbstractTextEditor#doSave(org.eclipse.core.runtime.IProgressMonitor)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public void doSave(IProgressMonitor progressMonitor) {
+        if (getConversationHolder() != null) {
+            if( ! getConversationHolder().isBound()){
+                getConversationHolder().bind();
+            }
+            super.doSave(progressMonitor);
+            getConversationHolder().commit(true);
+        } else {
+            super.doSave(progressMonitor);
+        }
+        firePropertyChange(PROP_DIRTY);
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.texteditor.AbstractTextEditor#setFocus()
+     */
+    /** {@inheritDoc} */
+    @Override
+    public void setFocus() {
+        super.setFocus();
+        if (getConversationHolder() != null) {
+            getConversationHolder().bind();
+        }
+        ((AbstractBulkEditorInput)getEditorInput()).bind();
+        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setFocus();
+        // TODO pass focus to underlying widgets
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
+     */
+    /**
+     * <p>getConversationHolder</p>
+     *
+     * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
+     */
+    @Override
     public ConversationHolder getConversationHolder() {
-               return conversation;
-       }
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
-        */
-       /** {@inheritDoc} */
-       @Override
+        return conversation;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
+     */
+    /** {@inheritDoc} */
+    @Override
     public void update(CdmDataChangeMap changeEvents) {}
 
-       /**
-        * Refreshes text in all lines.
-        */
-       protected void refreshLineDisplay() {
-               IDocumentProvider provider = getDocumentProvider();
-               IEditorInput input = getEditorInput();
-               IAnnotationModel model = provider.getAnnotationModel(input);
-               Iterator iter = getDocumentProvider().getAnnotationModel(getEditorInput()).getAnnotationIterator();
-               while (iter.hasNext()) {
-                       Object next = iter.next();
-                       if (next instanceof LineAnnotation) {
-                               LineAnnotation annotation = (LineAnnotation) next;
-                               ((AnnotatedLineDocumentProvider) getDocumentProvider()).
-                                               updateLineFromAnnotation(annotation);
-                       }
-               }
-       }
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.operations.IPostOperationEnabled#postOperation(eu.etaxonomy.cdm.model.common.CdmBase)
-        */
-       /** {@inheritDoc} */
-       @Override
+    /**
+     * Refreshes text in all lines.
+     */
+    protected void refreshLineDisplay() {
+        IDocumentProvider provider = getDocumentProvider();
+        IEditorInput input = getEditorInput();
+        IAnnotationModel model = provider.getAnnotationModel(input);
+        Iterator iter = getDocumentProvider().getAnnotationModel(getEditorInput()).getAnnotationIterator();
+        while (iter.hasNext()) {
+            Object next = iter.next();
+            if (next instanceof LineAnnotation) {
+                LineAnnotation annotation = (LineAnnotation) next;
+                ((AnnotatedLineDocumentProvider) getDocumentProvider()).
+                updateLineFromAnnotation(annotation);
+            }
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operations.IPostOperationEnabled#postOperation(eu.etaxonomy.cdm.model.common.CdmBase)
+     */
+    /** {@inheritDoc} */
+    @Override
     public boolean postOperation(CdmBase objectAffectedByOperation) {
-               refreshLineDisplay();
-
-               return true;
-       }
-
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.editors.text.TextEditor#dispose()
-        */
-       /** {@inheritDoc} */
-       @Override
-       public void dispose() {
-               super.dispose();
-               conversation.close();
-       }
-
-       /**
-        * <p>onComplete</p>
-        *
-        * @return a boolean.
-        */
-       @Override
+        refreshLineDisplay();
+
+        return true;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.editors.text.TextEditor#dispose()
+     */
+    /** {@inheritDoc} */
+    @Override
+    public void dispose() {
+        super.dispose();
+        conversation.close();
+        ((AbstractBulkEditorInput)getEditorInput()).dispose();
+    }
+
+    /**
+     * <p>onComplete</p>
+     *
+     * @return a boolean.
+     */
+    @Override
     public boolean onComplete() {
-               // TODO Auto-generated method stub
-               return false;
-       }
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 
 }
index 9761f55f4acc88096bd846bdcd707ba8d41f2cbb..230d5240eaab76c4503299463099d4e39896920d 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -28,54 +28,56 @@ public interface IEntityContainer<T> {
         * @return a T object.
         */
        T getEntity();
-       
+
+       void setEntity(Object entity);
+
        /**
         * <p>getEditableText</p>
         *
         * @return a {@link java.lang.String} object.
         */
        String getEditableText();
-       
+
        /**
         * <p>getAttachedEntities</p>
         *
         * @return a {@link java.util.Set} object.
         */
        Set<T> getAttachedEntities();
-       
+
        /**
         * <p>markAsMerged</p>
         *
         * @param mergeTarget a T object.
         */
        void markAsMerged(T mergeTarget);
-       
+
        /**
         * <p>markAsDeleted</p>
         */
        void markAsDeleted();
-       
+
        /**
         * <p>markAsNew</p>
         *
         * @param isNew a boolean.
         */
        void markAsNew(boolean isNew);
-       
+
        /**
         * <p>isMarkedAsMerged</p>
         *
         * @return a boolean.
         */
        boolean isMarkedAsMerged();
-       
+
        /**
         * <p>isMarkedAsDeleted</p>
         *
         * @return a boolean.
         */
        boolean isMarkedAsDeleted();
-       
+
        /**
         * <p>isMarkedAsNew</p>
         *
index 39acd4ff0fd996a8c7b58dc9b17dcfdf267b56a4..b57e8b7bc1840b9f5aca90b30eacb9efcc0425ed 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -24,23 +24,23 @@ import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableExcepti
  * @version 1.0
  */
 public interface IEntityPersistenceService<T> {
-       
+
        /**
         * <p>create</p>
         *
         * @param entity a {@link java.lang.Object} object.
         * @return a boolean.
         */
-       boolean create(T entity);
-       
+       T create(T entity);
+
        /**
         * <p>save</p>
         *
         * @param entity a {@link java.lang.Object} object.
         * @return a boolean.
         */
-       boolean save(T entity);
-       
+       T save(T entity);
+
        /**
         * <p>merge</p>
         *
@@ -49,13 +49,13 @@ public interface IEntityPersistenceService<T> {
         * @return a boolean.
         */
        boolean merge(T entity, T mergeTarget);
-       
+
        /**
         * <p>delete</p>
         *
         * @param entity a {@link java.lang.Object} object.
         * @return a boolean.
-        * @throws ReferencedObjectUndeletableException 
+        * @throws ReferencedObjectUndeletableException
         */
        boolean delete(T entity) throws ReferencedObjectUndeletableException;
 }
index 6d30942d829760bdb2dda538c040ac9d01d33cfc..ef4f124b70dada677d4330bf1f5fc6c3980443f8 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -29,7 +29,7 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
 
        /** Constant <code>TYPE_GENERIC="Annotation.TYPE_UNKNOWN"</code> */
        public static final String TYPE_GENERIC = Annotation.TYPE_UNKNOWN;
-       
+
        private T entity;
        private ILineDisplayStrategy lineDisplayStrategy;
 
@@ -38,7 +38,7 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
        private boolean markedAsNew;
        private T mergeTarget;
 
-       
+
        /**
         * <p>Constructor for LineAnnotation.</p>
         *
@@ -51,7 +51,7 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
                this.lineDisplayStrategy = lineDisplayStrategy;
                setType(TYPE_GENERIC);
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.jface.text.source.Annotation#getText()
         */
@@ -60,7 +60,7 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
        public String getText() {
                return getEditableText();
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.jface.text.source.Annotation#setText(java.lang.String)
         */
@@ -68,17 +68,17 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
        @Override
        public void setText(String text) {
                lineDisplayStrategy.setText(text, entity);
-               dirty  = true;          
+               dirty  = true;
                super.setText(text);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public String toString() {
                // For debugging
                return getText();
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.bulkeditor.IEntityContainer#getAttachedEntities()
         */
@@ -87,7 +87,8 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
         *
         * @return a {@link java.util.Set} object.
         */
-       public Set getAttachedEntities() {
+       @Override
+    public Set getAttachedEntities() {
                // TODO Auto-generated method stub
                return null;
        }
@@ -100,7 +101,8 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
         *
         * @return a T object.
         */
-       public T getEntity() {
+       @Override
+    public T getEntity() {
                return entity;
        }
 
@@ -112,7 +114,8 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
         *
         * @return a {@link java.lang.String} object.
         */
-       public String getEditableText() {
+       @Override
+    public String getEditableText() {
                return lineDisplayStrategy.getText(entity);
        }
 
@@ -124,7 +127,8 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
         *
         * @return a T object.
         */
-       public T getMergeTarget() {
+       @Override
+    public T getMergeTarget() {
                return mergeTarget;
        }
 
@@ -136,7 +140,8 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
         *
         * @return a boolean.
         */
-       public boolean isMarkedAsDeleted() {
+       @Override
+    public boolean isMarkedAsDeleted() {
                return super.isMarkedDeleted();
        }
 
@@ -148,7 +153,8 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
         *
         * @return a boolean.
         */
-       public boolean isMarkedAsMerged() {
+       @Override
+    public boolean isMarkedAsMerged() {
                return markedAsMerged;
        }
 
@@ -160,7 +166,8 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
         *
         * @return a boolean.
         */
-       public boolean isMarkedAsNew() {
+       @Override
+    public boolean isMarkedAsNew() {
                return markedAsNew;
        }
 
@@ -170,7 +177,8 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
        /**
         * <p>markAsDeleted</p>
         */
-       public void markAsDeleted() {
+       @Override
+    public void markAsDeleted() {
                super.markDeleted(true);
                if (!isMarkedAsMerged()) {
                        lineDisplayStrategy.setStatusMessage(entity + " deleted.", entity);
@@ -185,7 +193,8 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
         *
         * @param mergeTarget a T object.
         */
-       public void markAsMerged(T mergeTarget) {
+       @Override
+    public void markAsMerged(T mergeTarget) {
                this.mergeTarget = mergeTarget;
                markedAsMerged = true;
                lineDisplayStrategy.setStatusMessage("'" + entity + "' merged into '" + mergeTarget + "'.", entity);
@@ -195,7 +204,8 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
         * @see eu.etaxonomy.taxeditor.bulkeditor.IEntityContainer#markAsNew()
         */
        /** {@inheritDoc} */
-       public void markAsNew(boolean isNew) {
+       @Override
+    public void markAsNew(boolean isNew) {
                markedAsNew = isNew;
                lineDisplayStrategy.setStatusMessage("New entity created.", entity);
        }
@@ -204,7 +214,8 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
         * @see eu.etaxonomy.taxeditor.bulkeditor.IEntityContainer#setDirty(boolean)
         */
        /** {@inheritDoc} */
-       public void setDirty(boolean dirty) {
+       @Override
+    public void setDirty(boolean dirty) {
                this.dirty = dirty;
        }
 
@@ -216,7 +227,8 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
         *
         * @return a boolean.
         */
-       public boolean isDirty() {
+       @Override
+    public boolean isDirty() {
                return dirty;
        }
 
@@ -228,4 +240,12 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
        public String getHoverText() {
                return lineDisplayStrategy.getHoverText(entity);
        }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityContainer#setEntity(java.lang.Object)
+     */
+    @Override
+    public void setEntity(Object entity) {
+        this.entity = (T) entity;
+    }
 }
index 4c97dbfb51582f3a52d614059d26acf2f4b05d12..5b7b601e78eae0be27acafd4fa4c1947d50811a9 100644 (file)
@@ -171,6 +171,7 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
                        displayWarningDialog();
                        isInitialFocus = false;
                }
+               super.setFocus();
        }
 
        private void displayWarningDialog() {
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditorLables.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditorLables.java
new file mode 100644 (file)
index 0000000..7a230c5
--- /dev/null
@@ -0,0 +1,46 @@
+/**
+       * Copyright (C) 2016 EDIT
+       * European Distributed Institute of Taxonomy
+       * http://www.e-taxonomy.eu
+       *
+       * The contents of this file are subject to the Mozilla Public License Version 1.1
+       * See LICENSE.TXT at the top of this package for the full license terms.
+       */
+
+package eu.etaxonomy.taxeditor.bulkeditor;
+/**
+ * @author kluther
+ * @date 29 Feb 2016
+ *
+ */
+public interface BulkEditorLables {
+       
+
+
+           public static final String CONVERT_TEAM_2_PERSON_LABEL = "Convert Team to Person";
+           public static final String CONVERT_PERSON_2_TEAM_LABEL = "Convert Person to Team";
+           public static final String DELETE_LABEL = "Delete";
+           public static final String MERGE_GROUP_LABEL = "Merge Group";
+           public static final String REMOVE_MERGE_CANDIDATE_LABEL = "Remove from Merge Group";
+           public static final String SET_MERGE_CANDIDATE_LABEL = "Set as Merge Candidate";
+           public static final String SET_MERGE_TARGET_LABEL = "Set as Merge Target";
+
+           public static final String NO_CONVERT_PERSON_TO_TEAM_MESSAGE = "Can not convert Person into a Team.";
+           public static final String TRANSFORMATION_NOT_POSSIBLE_PERSON_PART_OF_TEAM_MESSAGE = "Person can not be transformed into team as it is already part of a team.";
+           public static final String NO_CONVERT_TEAM_TO_PERSON_MESSAGE = "Can not convert Team to Person";
+          
+          
+           public static final String UNSAVED_CHANGES_MESSAGE = "There are unsaved changes in the source taxon. Please save first.";
+               public static final String SINGLE_PERSON_SELECTION_MESSAGE = "The chosen operation is available only for a single person";
+               public static final String SINGLE_TEAM_SELECTION_MESSAGE = "The chosen operation is available only for a single team";
+               public static final String NO_PERSON_SELECTION_MESSAGE = "No person selected for conversion";
+               public static final String ONLY_PERSON_SELECTION_MESSAGE = "Only a person can be converted into a team.";
+               public static final String NO_TEAM_SELECTION_MESSAGE = "No team selected for conversion";
+               public static final String ONLY_TEAM_SELECTION_MESSAGE = "Only a team can be converted into a person.";
+               public static final String ONLY_FOR_BULKEDITOR_MESSAGE = "You have to choose a line in the bulkeditor to perform this operation.";
+
+
+
+       
+
+}
index a6ae0fd7787d87e75da2a5d5056b29e14984e8d6..613ee50fb72e90d917b811439686212deb5f7181 100644 (file)
@@ -12,7 +12,6 @@ package eu.etaxonomy.taxeditor.bulkeditor;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
 
 import org.apache.commons.lang.StringUtils;
 import org.eclipse.jface.action.IStatusLineManager;
@@ -26,13 +25,11 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.IAnnotatableEntity;
 import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.common.Marker;
-import eu.etaxonomy.cdm.model.common.MarkerType;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.EntityListener;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy;
 import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
-import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
 /**
  * <p>BulkEditorLineDisplay class.</p>
@@ -99,8 +96,6 @@ public class BulkEditorLineDisplay implements ILineDisplayStrategy {
                if (entity instanceof IAnnotatableEntity) {
                        IAnnotatableEntity annotatableEntity = (IAnnotatableEntity) HibernateProxyHelper.deproxy(entity);
 
-                       Map<MarkerType, Boolean> editMarkerTypePreferences = PreferencesUtil.getEditMarkerTypePreferences();
-
                        String markerText = "";
                        List<String> markers = new ArrayList<String>();
                        for (Marker marker : annotatableEntity.getMarkers()) {
index bd8494c00e191d78ae57d11ed21123cd58d5c243..bbfe04df5fd667756cad809a46a1dec119c85e39 100644 (file)
@@ -17,6 +17,7 @@ import org.eclipse.ui.IEditorInput;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
 import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
 import eu.etaxonomy.taxeditor.bulkeditor.input.GroupEditorInput;
+import eu.etaxonomy.taxeditor.bulkeditor.input.MediaEditorInput;
 import eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput;
 import eu.etaxonomy.taxeditor.bulkeditor.input.TaxonEditorInput;
 
@@ -41,6 +42,7 @@ public class BulkEditorPropertyTester extends PropertyTester {
     public static final String IS_CONVERT_ENABLED = "isConvertingEnabled";
     public static final String IS_PERSON = "isPerson";
     public static final String IS_TEAM = "isTeam";
+    public static final String IS_MEDIA_EDITOR = "isMediaEditor";
        /* (non-Javadoc)
         * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
         */
@@ -72,6 +74,8 @@ public class BulkEditorPropertyTester extends PropertyTester {
                }
         else if(IS_TAXON_EDITOR.equals(property)){
             return bulkEditor.getEditorInput() instanceof TaxonEditorInput;
+        } else if(IS_MEDIA_EDITOR.equals(property)){
+            return bulkEditor.getEditorInput() instanceof MediaEditorInput;
         }
 
 //             if (("isPublishFlagEditingEnabled").equals(property)) {
index 4cb892e67eb9c4f0e08f57343c0149aaf5231d6f..f1525dde93f62bafa1891199a10f4f86d1a53e05 100644 (file)
@@ -79,9 +79,11 @@ public class OpenBulkEditorContributionItem extends CompoundContributionItem {
         contributionItems.add(new Separator(groupName));
         contributionItems.add(BulkEditorInputType.OCCURRENCE.createContributionItem());
         contributionItems.add(new Separator(groupName));
+        contributionItems.add(BulkEditorInputType.MEDIA.createContributionItem());
+        contributionItems.add(new Separator(groupName));
         contributionItems.add(BulkEditorInputType.USER.createContributionItem());
         contributionItems.add(BulkEditorInputType.GROUP.createContributionItem());
-        
+        contributionItems.add(BulkEditorInputType.MEDIA.createContributionItem());
         return contributionItems.toArray(new IContributionItem[contributionItems.size()]);
     }
 
index a016571e2862abf02bffe9917525ea9a842af317..ed211575e3dc59efd5b18337805ad3ec83e7fb73 100644 (file)
@@ -21,6 +21,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.texteditor.IDocumentProvider;\r
 \r
 import eu.etaxonomy.cdm.api.service.IAgentService;\r
+import eu.etaxonomy.cdm.api.service.UpdateResult;\r
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;\r
 import eu.etaxonomy.cdm.model.agent.Person;\r
 import eu.etaxonomy.cdm.model.agent.Team;\r
@@ -74,20 +75,23 @@ public class ConvertPerson2TeamHandler extends AbstractHandler {
                        Team team ;\r
                        for(Object object : structuredSelection.toList()){\r
                                LineAnnotation annotation = (LineAnnotation) model.getAnnotation(object);\r
-                               team = null;\r
+                               UpdateResult result = null;\r
+                               team  = null;\r
                                if (object instanceof Person){\r
                                        Person person = HibernateProxyHelper.deproxy(object, Person.class);\r
                                        try {\r
-                                               team = CdmStore.getService(IAgentService.class).convertPerson2Team(person);\r
+                                           result = CdmStore.getService(IAgentService.class).convertPerson2Team(person.getUuid());\r
                                        } catch (IllegalArgumentException e) {\r
                                                MessagingUtils.errorDialog("Can not convert Person into a Team", null, e.getLocalizedMessage(), TaxeditorBulkeditorPlugin.PLUGIN_ID,e, true);\r
                                        } catch (MergeException e) {\r
-                                               MessagingUtils.informationDialog("Convert not possible", "Person can not be transformed into team as it is referenced in a way that does not allow converting");\r
+                                               MessagingUtils.informationDialog("Convert not possible", "Person can not be transformed into team as it is already part of a team.");\r
                                        }\r
                                }else{\r
                                        MessagingUtils.informationDialog("Can not convert Person into a Team", "convert Person to Team can only be called on a person.");\r
                                }\r
-\r
+                               if (result != null &&result.isOk()){\r
+                                   team = (Team)result.getCdmEntity();\r
+                               }\r
                                if (team != null){\r
                                        ((BulkEditor) editor).removeAnnotatedLine(annotation);\r
                                        ((BulkEditor) editor).createAnnotatedLine(team);\r
index 846ada15f14a8bfe3386dd6cb90561ae10a576b5..d26b3ed5fc0c238081bdf805cbc63c55a74de65a 100644 (file)
@@ -20,10 +20,9 @@ import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.handlers.HandlerUtil;\r
 import org.eclipse.ui.texteditor.IDocumentProvider;\r
 \r
-import eu.etaxonomy.cdm.api.service.AgentServiceImpl;\r
 import eu.etaxonomy.cdm.api.service.IAgentService;\r
+import eu.etaxonomy.cdm.api.service.UpdateResult;\r
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;\r
-import eu.etaxonomy.cdm.model.agent.AgentBase;\r
 import eu.etaxonomy.cdm.model.agent.Person;\r
 import eu.etaxonomy.cdm.model.agent.Team;\r
 import eu.etaxonomy.cdm.strategy.merge.MergeException;\r
@@ -47,9 +46,9 @@ public class ConvertTeam2PersonHandler extends AbstractHandler {
        @Override\r
        public Person execute(ExecutionEvent event) throws ExecutionException {\r
                ISelection selection = HandlerUtil.getCurrentSelection(event);\r
-               \r
+\r
                IEditorPart editor = HandlerUtil.getActiveEditor(event);\r
-               \r
+\r
                IEditorInput input = editor.getEditorInput();\r
                if (editor.isDirty()){\r
                        boolean proceed = MessageDialog.openQuestion(null,\r
@@ -61,25 +60,26 @@ public class ConvertTeam2PersonHandler extends AbstractHandler {
                        }\r
                }\r
                if((input instanceof IEntityPersistenceService) && (selection instanceof IStructuredSelection)){\r
-                       \r
-                       \r
+\r
+\r
                        IDocumentProvider provider = ((BulkEditor) editor).getDocumentProvider();\r
-                       LineAnnotationModel model = \r
+                       LineAnnotationModel model =\r
                                        (LineAnnotationModel) provider.getAnnotationModel(input);\r
-                       \r
-                       \r
+\r
+\r
                        IStructuredSelection structuredSelection = (IStructuredSelection) selection;\r
-                       \r
+\r
                        IEntityPersistenceService persistenceService = (IEntityPersistenceService) input;\r
-               \r
+\r
                        Person person ;\r
                        for(Object object : structuredSelection.toList()){\r
                                LineAnnotation annotation = (LineAnnotation) model.getAnnotation(object);\r
                                person = null;\r
+                               UpdateResult result = null;\r
                                if (object instanceof Team){\r
                                        Team team = HibernateProxyHelper.deproxy(object, Team.class);\r
                                        try {\r
-                                               person = CdmStore.getService(IAgentService.class).convertTeam2Person(team);\r
+                                               result = CdmStore.getService(IAgentService.class).convertTeam2Person(team.getUuid());\r
                                        } catch (IllegalArgumentException e) {\r
                                                MessagingUtils.informationDialog("Can not convert Team to Person", e.getMessage());\r
                                        } catch (MergeException e) {\r
@@ -88,7 +88,9 @@ public class ConvertTeam2PersonHandler extends AbstractHandler {
                                }else{\r
                                        MessagingUtils.informationDialog("Can not convert Team to Person", "convertTeam2Person can only be called on a team.");\r
                                }\r
-                               \r
+                               if (result != null && result.isOk()){\r
+                                   person = (Person)result.getCdmEntity();\r
+                               }\r
                                if (person != null){\r
                                        ((BulkEditor) editor).removeAnnotatedLine(annotation);\r
                                        ((BulkEditor) editor).createAnnotatedLine(person);\r
index 041359836ef7622d6406aa264a7cd826bf50e314..ff196c718880975052924e8d41a54078eef34f6d 100644 (file)
@@ -1,18 +1,17 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.bulkeditor.handler;
 
-import java.util.Iterator;
-import java.util.Set;
-import java.util.UUID;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
@@ -22,46 +21,41 @@ import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IViewReference;
-import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.IWorkbenchPage;
 
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.api.service.IAgentService;
 import eu.etaxonomy.cdm.api.service.IGroupService;
+import eu.etaxonomy.cdm.api.service.IMediaService;
 import eu.etaxonomy.cdm.api.service.INameService;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.IReferenceService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.api.service.IUserService;
 import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator;
-import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
-import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.Group;
-import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-import eu.etaxonomy.cdm.persistence.dao.hibernate.HibernateBeanInitializer;
-import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotationModel;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
 import eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin;
-import eu.etaxonomy.taxeditor.bulkeditor.referencingobjects.ReferencingObjectsView;
+import eu.etaxonomy.taxeditor.model.DeleteResultMessagingUtils;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
-import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.dialog.deleteConfigurator.DeleteConfiguratorDialog;
 
 
 /**
@@ -76,119 +70,149 @@ public class DeleteHandler extends AbstractHandler {
         */
        @Override
        public Object execute(ExecutionEvent event) throws ExecutionException {
-               
+
                ISelection selection = HandlerUtil.getCurrentSelection(event);
-               
+
                IEditorPart editor = HandlerUtil.getActiveEditor(event);
-               
+
                IEditorInput input = editor.getEditorInput();
-               
+
                if((input instanceof IEntityPersistenceService) && (selection instanceof IStructuredSelection)){
-                       
-                       
+
+
                        IDocumentProvider provider = ((BulkEditor) editor).getDocumentProvider();
-                       LineAnnotationModel model = 
+                       LineAnnotationModel model =
                                        (LineAnnotationModel) provider.getAnnotationModel(input);
-                       
-                       
+
+
                        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-                       
+
                        IEntityPersistenceService persistenceService = (IEntityPersistenceService) input;
-                       
-                       
+
+
                        for(Object object : structuredSelection.toList()){
-                               
+
                                LineAnnotation annotation = (LineAnnotation) model.getAnnotation(object);
-                               DeleteResult result = new DeleteResult();       
+                               DeleteResult result = new DeleteResult();
+                               String errorMessage= "The object ";
                                //result.setError();
                                try {
                                        ICdmApplicationConfiguration controller;
-                                       controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration();
-                                       //persistenceService.delete(object);
+                                       controller = CdmStore.getCurrentApplicationConfiguration();
+
                                        if (object instanceof SpecimenOrObservationBase){
-                                               
                                                IOccurrenceService service = controller.getOccurrenceService();
-                                               SpecimenOrObservationBase persistedObject = service.load(((SpecimenOrObservationBase) object).getUuid());
-                                               if (persistedObject != null){
-                                                       result = service.delete(persistedObject);
-                                               } 
+                                               if (object != null){
+                                                       result = service.delete(((SpecimenOrObservationBase) object).getUuid());
+                                                       errorMessage = "The specimen or observation ";
+                                               }
                                        } else if (object instanceof Reference){
                                                IReferenceService service = controller.getReferenceService();
-                                               
-                                               Reference persistedObject = service.load(((Reference) object).getUuid());
-                                               if (persistedObject != null){
-                                                       result = service.delete(persistedObject);
+                                               if (object != null){
+                                                       result = service.delete(((Reference) object).getUuid());
+                                                       errorMessage = "The reference ";
                                                }
-                                               
+
                                        } else if (object instanceof Group){
                                                IGroupService service = controller.getGroupService();
-                                               Group persistedObject = service.load(((Group) object).getUuid());
-                                               if (persistedObject != null){
-                                                       result = service.delete(persistedObject);
+                                               if (object != null){
+                                                       result = service.delete(((Group) object).getUuid());
+                                                       errorMessage = "The group ";
                                                }
                                        }else if (object instanceof User){
                                                IUserService service = controller.getUserService();
-                                               User persistedObject = service.load(((User) object).getUuid());
-                                               if (persistedObject != null){
-                                                       result = service.delete(persistedObject);
+                                               if (object != null){
+                                                       result = service.delete(((User) object).getUuid());
+                                                       errorMessage = "The user ";
                                                }
                                        } else if (object instanceof TaxonNameBase){
                                                INameService service = controller.getNameService();
-                                               TaxonNameBase name = service.load(((TaxonNameBase) object).getUuid());
-                                               if (name != null){
+                                               if (object != null){
                                                        NameDeletionConfigurator config = new NameDeletionConfigurator();
-                                                       
-                                                       result = service.delete(name.getUuid(), config);
-                                               } 
+
+                                                       DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(config, HandlerUtil.getActiveShell(event), "Confirm Deletion",  null,  "Do you really want to delete the name?", MessageDialog.WARNING, new String[] { "Delete", "Skip" }, 0);
+                                                       int result_dialog= dialog.open();
+                                                       if (result_dialog == 1){
+                                                               return null;
+                                                       }
+                                                       result = service.delete(((TaxonNameBase) object).getUuid(), config);
+                                                       errorMessage = "The name ";
+                                               }
                                        } else if (object instanceof TaxonBase){
                                                ITaxonService service = controller.getTaxonService();
-                                               TaxonBase taxonBase = service.load(((TaxonBase) object).getUuid());
-                                               if (taxonBase != null){
+                                               if (object != null){
                                                        if (object instanceof Taxon){
-                                                               result = service.deleteTaxon(((TaxonBase) object).getUuid(), null, null);
+                                                           TaxonDeletionConfigurator config = new TaxonDeletionConfigurator();
+                                                               config.setDeleteInAllClassifications(true);
+                                                               DeleteConfiguratorDialog dialog;
+                                                               if (((Taxon)object).getTaxonNodes().isEmpty()){
+                                                                   dialog = new DeleteConfiguratorDialog(config, HandlerUtil.getActiveShell(event), "Confirm Deletion",  null,  "Do you really want to delete the taxon?", MessageDialog.WARNING, new String[] { "Delete", "Skip" }, 0);
+                                                                   int result_dialog= dialog.open();
+                                       if (result_dialog == 1){
+                                           return null;
+                                       }
+                                       result = service.deleteTaxon(((TaxonBase) object).getUuid(), config, null);
+                                       errorMessage = "The taxon ";
+                                                               } else{
+                                                                   MessagingUtils.messageDialog("Delete not possible", getClass(), "The taxon can not be deleted in bulk editor. It is used in a classification.", null);
+                                                                   return null;
+                                                               }
+
                                                        }else{
-                                                               result = service.deleteSynonym((Synonym)object, null);
+                                                               SynonymDeletionConfigurator config = new SynonymDeletionConfigurator();
+
+                                                               result = service.deleteSynonym(((Synonym)object).getUuid(), config);
+                                                               errorMessage = "The synonym ";
                                                        }
                                                }
                                        } else if (object instanceof TeamOrPersonBase){
                                                IAgentService service = controller.getAgentService();
-                                               TeamOrPersonBase teamOrPerson = (TeamOrPersonBase)service.load(((TeamOrPersonBase) object).getUuid());
-                                               result = service.delete((TeamOrPersonBase)object);
-                                       }
+                                               //TeamOrPersonBase teamOrPerson = (TeamOrPersonBase)service.load(((TeamOrPersonBase) object).getUuid());
+                                               result = service.delete(((TeamOrPersonBase)object).getUuid());
+                                               errorMessage = "The team or person ";
+                                       } else if (object instanceof Media){
+                        IMediaService service = controller.getMediaService();
+                        //TeamOrPersonBase teamOrPerson = (TeamOrPersonBase)service.load(((TeamOrPersonBase) object).getUuid());
+                        result = service.delete(((Media)object).getUuid(), null);
+                        errorMessage = "The media ";
+                    }
+
                                } catch (Exception e){
                                        MessagingUtils.errorDialog("Exception occured. Delete not possible", getClass(), e.getMessage(), TaxeditorBulkeditorPlugin.PLUGIN_ID, null, true);
                                }
                                if (result.isError() || result.isAbort()){
                                        if (!result.getExceptions().isEmpty()) {
-                                               String message = null;
+                                               List<String> messages = new ArrayList<String>();
                                                int i = result.getExceptions().size();
                                                for (Exception e:result.getExceptions()){
-                                                       i--;
-                                                       message+= e.getMessage();
-                                                       if (i>0){
-                                                               message+= ", ";
-                                                       }
+                                                       messages.add(e.getMessage());
                                                }
-                                               
-                                               
-                                               MessagingUtils.messageDialog("Delete not possible", getClass(), result.getExceptions().toString(), null);
+                                               errorMessage += "could not be deleted.";
+                                               //MessagingUtils.errorDialog("test", getClass(), "message", TaxeditorBulkeditorPlugin.PLUGIN_ID, result.getExceptions().iterator().next(),true);
+                                               DeleteResultMessagingUtils.messageDialogWithDetails(result,errorMessage, TaxeditorBulkeditorPlugin.PLUGIN_ID);
                                        }else{
                                                MessagingUtils.messageDialog("Delete not possible", getClass(), "The object could not be deleted. An exception occured.", null);
-                                               
                                        }
                                }
                                if (result.isOk() ){
                                        ((BulkEditor) editor).removeAnnotatedLine(annotation);
                                        if(result.getUpdatedObjects().size() != 0 || !result.getExceptions().isEmpty()){
-                                               MessagingUtils.informationDialog("Delete successfull", "The object is deleted but there are updated objects: " + result.toString());
+                                           List<String> messages = new ArrayList<String>();
+                        int i = result.getExceptions().size();
+                        for (Exception e:result.getExceptions()){
+                            messages.add(e.getMessage());
+                        }
+                                           errorMessage += "was deleted but related object(s) could not be deleted. ";
+                                           //MessagingUtils.errorDialog("test", getClass(), "message", TaxeditorBulkeditorPlugin.PLUGIN_ID, result.getExceptions().iterator().next(),true);
+                                           DeleteResultMessagingUtils.messageDialogWithDetails(result, errorMessage, TaxeditorBulkeditorPlugin.PLUGIN_ID);
                                        }
 
                                }
-                               
-                       }                               
+
+                       }
                }
-       
-               
+
+
                return null;
        }
 
index 8cf5d3357e22a6ace1df8b40854e94f5ff703179..00f746d977cb26c97514f565407ab3a4928d0453 100644 (file)
@@ -14,6 +14,7 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
+import java.util.Map;
 import java.util.UUID;
 
 import org.eclipse.jface.resource.ImageDescriptor;
@@ -35,6 +36,7 @@ import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;
 import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.CdmBaseSortProvider;
 import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.TitleCacheComparator;
 import eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin;
+import eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -46,7 +48,8 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @version 1.0
  * @param <T>
  */
-public abstract class AbstractBulkEditorInput<T extends ICdmBase> implements IEditorInput, IEntityPersistenceService<T> {
+public abstract class AbstractBulkEditorInput<T extends ICdmBase> extends CdmEntitySessionInput implements IEditorInput ,
+    IEntityPersistenceService<T> {
 
        private UUID entityUuid;
 
@@ -56,6 +59,10 @@ public abstract class AbstractBulkEditorInput<T extends ICdmBase> implements IEd
 
        private static Class serviceClass;
 
+       public AbstractBulkEditorInput() {
+           super(true);
+       }
+
        /**
         * <p>NewInstance</p>
         *
@@ -232,7 +239,7 @@ public abstract class AbstractBulkEditorInput<T extends ICdmBase> implements IEd
     public boolean merge(T entity, T mergeTarget) {
                if (entity instanceof IMergable) {
                        try {
-                               CdmStore.getCommonService().merge(mergeTarget.getId(), entity.getId(), (Class<? extends CdmBase>)entity.getClass());
+                               CdmStore.getCommonService().merge(mergeTarget.getUuid(), entity.getUuid(), (Class<? extends CdmBase>)entity.getClass());
                        } catch (MergeException e) {
                                MessagingUtils.errorDialog("Bulk Editor Merge Error",
                                                this,
@@ -248,7 +255,7 @@ public abstract class AbstractBulkEditorInput<T extends ICdmBase> implements IEd
 
        /** {@inheritDoc} */
        @Override
-    public boolean create(T entity) {
+    public T create(T entity) {
                return save(entity);
        }
 
@@ -305,9 +312,35 @@ public abstract class AbstractBulkEditorInput<T extends ICdmBase> implements IEd
        /**
         * @return
         */
-       public List<?> getModel() {
+       public List<T> getModel() {
                return model;
        }
 
+       protected boolean replaceInModel(T entity) {
+           int index = model.indexOf(entity);
+           if(index >= 0) {
+               model.set(index, entity);
+               return true;
+           } else {
+               return false;
+           }
+       }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getRootEntities()
+     */
+    @Override
+    public   List<T> getRootEntities() {
+        return getModel();
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+     */
+    @Override
+    public Map<Object, List<String>> getPropertyPathsMap() {
+        // TODO Auto-generated method stub
+        return null;
+    }
 }
index 4c2dccc55e38157da4cff496d941179ebc5c4152..f7f65de9f095b112fbc3e781544aba790d752daf 100644 (file)
@@ -48,11 +48,13 @@ public class AgentEditorInput extends AbstractBulkEditorInput<TeamOrPersonBase>
                return ID;
        }
 
+
        @Override
     public String getName() {
                return BulkEditorInputType.AGENT.label;
        }
 
+
        @Override
     public String getToolTipText() {
                return getName();
@@ -71,6 +73,7 @@ public class AgentEditorInput extends AbstractBulkEditorInput<TeamOrPersonBase>
                return true;
        }
 
+
        /** {@inheritDoc} */
        @Override
        public boolean isConvertingEnabled() {
@@ -85,10 +88,10 @@ public class AgentEditorInput extends AbstractBulkEditorInput<TeamOrPersonBase>
                                if(entity instanceof Person && mergeTarget instanceof Person) {
                                    IMergeStrategy strategy = DefaultMergeStrategy.NewInstance(Person.class);
                                    strategy.setMergeMode("institutionalMemberships", MergeMode.FIRST);
-                                   CdmStore.getCommonService().merge(mergeTarget.getId(), entity.getId(), Person.class);
+                                   CdmStore.getCommonService().merge(mergeTarget.getUuid(), entity.getUuid(), Person.class);
                                } else {
                                    IMergeStrategy strategy = DefaultMergeStrategy.NewInstance(TeamOrPersonBase.class);
-                                   CdmStore.getCommonService().merge(mergeTarget.getId(), entity.getId(), TeamOrPersonBase.class);
+                                   CdmStore.getCommonService().merge(mergeTarget.getUuid(), entity.getUuid(), TeamOrPersonBase.class);
                                }
                        } catch (MergeException e) {
                                MessagingUtils.errorDialog("Bulk Editor Merge Error",
@@ -117,7 +120,6 @@ public class AgentEditorInput extends AbstractBulkEditorInput<TeamOrPersonBase>
 
 
        public boolean delete(AgentBase entity) throws ReferencedObjectUndeletableException  {
-
                        return CdmStore.getService(IAgentService.class).delete(entity) != null;
 
        }
@@ -137,14 +139,20 @@ public class AgentEditorInput extends AbstractBulkEditorInput<TeamOrPersonBase>
                return sortProviders;
        }
 
+
        @Override
        protected IEntityCreator<TeamOrPersonBase> createEntityCreator() {
                return new AgentCreator();
        }
 
        @Override
-       public boolean save(TeamOrPersonBase entity) {
-               return CdmStore.getService(IAgentService.class).saveOrUpdate(entity) != null;
+       public TeamOrPersonBase save(TeamOrPersonBase entity) {
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               return (TeamOrPersonBase) CdmStore.getService(IAgentService.class).merge(entity, true).getMergedEntity();
+           } else {
+               CdmStore.getService(IAgentService.class).saveOrUpdate(entity) ;
+               return entity;
+           }
        }
 
        @Override
@@ -154,4 +162,13 @@ public class AgentEditorInput extends AbstractBulkEditorInput<TeamOrPersonBase>
                return false;
        }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput#merge()
+     */
+    @Override
+    public void merge() {
+
+    }
+
+
 }
index cb7020b31117300c060f6101c4e07fecb1344f01..a509aecbddfa4e436d9563d672c08961f26275f0 100644 (file)
@@ -1,7 +1,6 @@
 package eu.etaxonomy.taxeditor.bulkeditor.input;
 
 import java.util.HashMap;
-import java.util.Locale;
 import java.util.Map;
 import java.util.ResourceBundle;
 
@@ -14,6 +13,7 @@ import org.eclipse.ui.menus.CommandContributionItemParameter;
 
 import eu.etaxonomy.cdm.api.service.IAgentService;
 import eu.etaxonomy.cdm.api.service.IGroupService;
+import eu.etaxonomy.cdm.api.service.IMediaService;
 import eu.etaxonomy.cdm.api.service.INameService;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.IReferenceService;
@@ -22,38 +22,38 @@ import eu.etaxonomy.cdm.api.service.IUserService;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.common.Group;
 import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.name.NameRelationship;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants;
-import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
-import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
 public enum BulkEditorInputType {
-       AGENT(Messages.BulkEditorInputType_0, AgentEditorInput.ID), 
-       REFERENCE(Messages.BulkEditorInputType_1, ReferenceEditorInput.ID), 
-       NAME(Messages.BulkEditorInputType_2, NameEditorInput.ID), 
-       NAME_RELATIONSHIP(Messages.BulkEditorInputType_3, NameRelationshipEditorInput.ID), 
-       OCCURRENCE(Messages.BulkEditorInputType_4, OccurrenceEditorInput.ID), 
-       USER(Messages.BulkEditorInputType_5, UserEditorInput.ID), 
+       AGENT(Messages.BulkEditorInputType_0, AgentEditorInput.ID),
+       REFERENCE(Messages.BulkEditorInputType_1, ReferenceEditorInput.ID),
+       NAME(Messages.BulkEditorInputType_2, NameEditorInput.ID),
+       NAME_RELATIONSHIP(Messages.BulkEditorInputType_3, NameRelationshipEditorInput.ID),
+       OCCURRENCE(Messages.BulkEditorInputType_4, OccurrenceEditorInput.ID),
+       USER(Messages.BulkEditorInputType_5, UserEditorInput.ID),
        GROUP(Messages.BulkEditorInputType_6, GroupEditorInput.ID),
-       TAXON(Messages.BulkEditorInputType_7, TaxonEditorInput.ID);
+       TAXON(Messages.BulkEditorInputType_7, TaxonEditorInput.ID),
+       MEDIA(Messages.BulkEditorInputType_8, MediaEditorInput.ID);
 
        public String id;
        public String label;
-       public ResourceBundle resourceBundle; 
+       public ResourceBundle resourceBundle;
 
        BulkEditorInputType(String label, String id) {
                this.id = id;
                this.label = label;
        }
 
-       public IContributionItem createContributionItem(){ 
+       public IContributionItem createContributionItem(){
                return createContributionItem(label, id);
        }
-       
+
        /**
         * @param key
         * @param object
@@ -73,7 +73,7 @@ public enum BulkEditorInputType {
 
                return new CommandContributionItem(parameter);
        }
-       
+
        public static BulkEditorInputType getById(String id) {
 
                for (BulkEditorInputType type : values()) {
@@ -102,7 +102,9 @@ public enum BulkEditorInputType {
                        return USER;
                } else if (Taxon.class.isAssignableFrom(clazz)){
                        return TAXON;
-               }
+               } else if (Media.class.isAssignableFrom(clazz)){
+            return MEDIA;
+        }
                return null;
        }
 
@@ -123,7 +125,9 @@ public enum BulkEditorInputType {
                        return GROUP;
                } else if (input instanceof TaxonEditorInput){
                        return TAXON;
-               }
+               }else if (input instanceof MediaEditorInput){
+            return MEDIA;
+        }
                return null;
        }
 
@@ -146,12 +150,14 @@ public enum BulkEditorInputType {
                        return new GroupEditorInput();
                case TAXON:
                        return new TaxonEditorInput();
+               case MEDIA:
+            return new MediaEditorInput();
                default:
                        throw new IllegalStateException(
                                        "No input class for the given input type defined."); //$NON-NLS-1$
                }
        }
-       
+
        public static Class getServiceClass(
                        BulkEditorInputType inputType) {
                switch (inputType) {
@@ -171,6 +177,8 @@ public enum BulkEditorInputType {
                        return IGroupService.class;
                case TAXON:
                        return ITaxonService.class;
+               case MEDIA:
+            return IMediaService.class;
                default:
                        throw new IllegalStateException(
                                        "No input class for the given input type defined."); //$NON-NLS-1$
index 98724faa802a6a0942d057e5507524cf43dc5873..0082939986a984d95527749de20bf64d7bfb53ca 100644 (file)
@@ -1,18 +1,16 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.bulkeditor.input;
 
-import java.util.Arrays;
 import java.util.List;
-import java.util.UUID;
 
 import eu.etaxonomy.cdm.api.service.IGroupService;
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
@@ -30,9 +28,9 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class GroupEditorInput extends AbstractBulkEditorInput<Group> {
 
        public static final String ID = "bulkeditor.input.group";
-       
+
        private static GroupEditorInput instance;
-       
+
        /**
         * @return the instance
         */
@@ -42,7 +40,7 @@ public class GroupEditorInput extends AbstractBulkEditorInput<Group> {
                }
                return instance;
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.IEditorInput#getName()
         */
@@ -63,8 +61,13 @@ public class GroupEditorInput extends AbstractBulkEditorInput<Group> {
         * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#save(java.lang.Object)
         */
        @Override
-       public boolean save(Group entity) {
-               return CdmStore.getService(IGroupService.class).saveOrUpdate(entity) != null;
+       public Group save(Group entity) {
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               return CdmStore.getService(IGroupService.class).merge(entity, true).getMergedEntity();
+           } else {
+               CdmStore.getService(IGroupService.class).saveOrUpdate(entity);
+               return entity;
+           }
        }
 
        /* (non-Javadoc)
@@ -86,10 +89,10 @@ public class GroupEditorInput extends AbstractBulkEditorInput<Group> {
 
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#loadEntity(java.util.UUID)
-        
+
        @Override
        protected Group loadEntity(UUID entityUuid) {
-               List<String> propertyPaths = Arrays.asList(new String[]{}); 
+               List<String> propertyPaths = Arrays.asList(new String[]{});
                return CdmStore.getService(IGroupService.class).load(entityUuid, propertyPaths);
        }
 */
@@ -100,7 +103,7 @@ public class GroupEditorInput extends AbstractBulkEditorInput<Group> {
        protected IEntityCreator<Group> createEntityCreator() {
                return new GroupCreator();
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getText(eu.etaxonomy.cdm.model.common.ICdmBase)
         */
@@ -109,6 +112,14 @@ public class GroupEditorInput extends AbstractBulkEditorInput<Group> {
                return entity.getName();
        }
 
-       
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput#merge()
+     */
+    @Override
+    public void merge() {
+
+    }
+
+
 
 }
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/MediaEditorInput.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/MediaEditorInput.java
new file mode 100644 (file)
index 0000000..6f3ccb2
--- /dev/null
@@ -0,0 +1,94 @@
+// $Id$
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.bulkeditor.input;
+
+import java.util.List;
+
+import eu.etaxonomy.cdm.api.service.IMediaService;
+import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
+import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;
+import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
+import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;
+import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.MediaCreator;
+import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.IdentifiableEntitySortProvider;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author k.luther
+ * @date 10.03.2016
+ *
+ */
+public class MediaEditorInput extends AbstractBulkEditorInput<Media> {
+    public static final String ID = "bulkeditor.input.media";
+
+    private static MediaEditorInput instance;
+
+    public static String getID() {
+        return ID;
+    }
+
+    public static AbstractBulkEditorInput getInstance() {
+        if (instance == null) {
+            instance = new MediaEditorInput();
+        }
+        return instance;
+    }
+
+    @Override
+    public String getName() {
+        return BulkEditorInputType.MEDIA.label;
+    }
+
+    @Override
+    public String getToolTipText() {
+        return getName();
+    }
+
+    @Override
+    public Media save(Media entity) {
+        if(CdmStore.getCurrentSessionManager().isRemoting()) {
+            return CdmStore.getService(IMediaService.class).merge(entity, true).getMergedEntity();
+        } else {
+            CdmStore.getService(IMediaService.class).saveOrUpdate(entity) ;
+            return entity;
+        }
+    }
+
+    @Override
+    public boolean delete(Media entity) throws ReferencedObjectUndeletableException {
+        return CdmStore.getService(IMediaService.class).delete(entity) != null;
+    }
+
+    @Override
+    protected List<Media> listEntities(IIdentifiableEntityServiceConfigurator configurator) {
+        return CdmStore.getSearchManager().findMedia(configurator);
+    }
+
+    @Override
+    protected IEntityCreator<Media> createEntityCreator() {
+        return new MediaCreator();
+    }
+
+    @Override
+    public void merge() {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public List<IBulkEditorSortProvider<Media>> getSortProviders() {
+        List<IBulkEditorSortProvider<Media>> sortProviders = super.getSortProviders();
+
+        sortProviders.add(0, new IdentifiableEntitySortProvider<Media>());
+
+        return sortProviders;
+    }
+}
index 5d046af0ac45737d184e5868700d6f840a7d06f6..1f9f2727381220bd03575f35836311f85a59a200 100644 (file)
@@ -12,6 +12,7 @@ public class Messages extends NLS {
        public static String BulkEditorInputType_5;\r
        public static String BulkEditorInputType_6;\r
        public static String BulkEditorInputType_7;\r
+       public static String BulkEditorInputType_8;\r
        static {\r
                // initialize resource bundle\r
                NLS.initializeMessages(BUNDLE_NAME, Messages.class);\r
index c9298f93bd147e80e77643c98f5c56409395dedc..6116162d2857d9b597787d6de27db0edb2ffdbb7 100644 (file)
@@ -1,22 +1,19 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.bulkeditor.input;
 
-import java.util.Arrays;
 import java.util.List;
-import java.util.UUID;
 
 import eu.etaxonomy.cdm.api.service.INameService;
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
-import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
 import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;
@@ -34,14 +31,14 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class NameEditorInput extends AbstractBulkEditorInput<TaxonNameBase> {
 
        /**
-        * 
+        *
         */
        private static final long serialVersionUID = -3085029575759626823L;
        private static NameEditorInput instance;
 
        /** Constant <code>ID="bulkeditor.input.name"</code> */
        public static final String ID = "bulkeditor.input.name";
-       
+
        /**
         * <p>Getter for the field <code>instance</code>.</p>
         *
@@ -53,7 +50,7 @@ public class NameEditorInput extends AbstractBulkEditorInput<TaxonNameBase> {
                }
                return instance;
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.IEditorInput#getName()
         */
@@ -62,7 +59,8 @@ public class NameEditorInput extends AbstractBulkEditorInput<TaxonNameBase> {
         *
         * @return a {@link java.lang.String} object.
         */
-       public String getName() {
+       @Override
+    public String getName() {
                return BulkEditorInputType.NAME.label;
        }
 
@@ -74,7 +72,8 @@ public class NameEditorInput extends AbstractBulkEditorInput<TaxonNameBase> {
         *
         * @return a {@link java.lang.String} object.
         */
-       public String getToolTipText() {
+       @Override
+    public String getToolTipText() {
                return getName();
        }
 
@@ -102,22 +101,29 @@ public class NameEditorInput extends AbstractBulkEditorInput<TaxonNameBase> {
                return CdmStore.getSearchManager().findNames(configurator);
        }
 
-       /** {@inheritDoc} 
+       /** {@inheritDoc}
        @Override
        public TaxonNameBase loadEntity(UUID uuid) {
-               List<String> propertyPaths = Arrays.asList(new String[]{}); 
+               List<String> propertyPaths = Arrays.asList(new String[]{});
                return CdmStore.getService(INameService.class).load(uuid, propertyPaths);
        }
 */
-       /** {@inheritDoc} 
+       /** {@inheritDoc}
         **/
-       public boolean delete(TaxonNameBase entity)  {
+       @Override
+    public boolean delete(TaxonNameBase entity)  {
                return CdmStore.getService(INameService.class).delete(entity) != null;
        }
 
        /** {@inheritDoc} */
-       public boolean save(TaxonNameBase entity) {
-               return CdmStore.getService(INameService.class).saveOrUpdate(entity) != null;
+       @Override
+    public TaxonNameBase save(TaxonNameBase entity) {
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               return CdmStore.getService(INameService.class).merge(entity, true).getMergedEntity();
+           } else {
+               CdmStore.getService(INameService.class).saveOrUpdate(entity);
+               return entity;
+           }
        }
 
        /* (non-Javadoc)
@@ -134,12 +140,12 @@ public class NameEditorInput extends AbstractBulkEditorInput<TaxonNameBase> {
        @Override
        public List<IBulkEditorSortProvider<TaxonNameBase>> getSortProviders() {
                List<IBulkEditorSortProvider<TaxonNameBase>> sortProviders = super.getSortProviders();
-               
+
                sortProviders.add(0, new IdentifiableEntitySortProvider<TaxonNameBase>());
-               
+
                return sortProviders;
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getTypeText(java.lang.Object)
         */
@@ -150,7 +156,7 @@ public class NameEditorInput extends AbstractBulkEditorInput<TaxonNameBase> {
                }
                return super.getTypeText(entity);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getText(eu.etaxonomy.cdm.model.common.ICdmBase)
         */
@@ -159,5 +165,13 @@ public class NameEditorInput extends AbstractBulkEditorInput<TaxonNameBase> {
                return (entity).getFullTitleCache();
        }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput#merge()
+     */
+    @Override
+    public void merge() {
+
+    }
+
 
 }
index a317feca144f1e561b25e3eaadc674c90650745d..893232a917d8eae331cee17b86db4ce23c00599f 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -30,7 +30,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class NameRelationshipEditorInput extends AbstractBulkEditorInput<NameRelationship> {
 
        /**
-        * 
+        *
         */
        private static final long serialVersionUID = -7453923697752787687L;
 
@@ -50,7 +50,7 @@ public class NameRelationshipEditorInput extends AbstractBulkEditorInput<NameRel
                }
                return instance;
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.IEditorInput#getName()
         */
@@ -74,9 +74,9 @@ public class NameRelationshipEditorInput extends AbstractBulkEditorInput<NameRel
         */
        /** {@inheritDoc} */
        @Override
-       public boolean save(NameRelationship entity) {
+       public NameRelationship save(NameRelationship entity) {
                // TODO Auto-generated method stub
-               return false;
+               return null;
        }
 
        /* (non-Javadoc)
@@ -105,7 +105,7 @@ public class NameRelationshipEditorInput extends AbstractBulkEditorInput<NameRel
        /** {@inheritDoc} */
        @Override
        protected NameRelationship loadEntity(UUID entityUuid) {
-               List<String> propertyPaths = Arrays.asList(new String[]{}); 
+               List<String> propertyPaths = Arrays.asList(new String[]{});
                return null; // CdmStore.getNameService().load(entityUuid, propertyPaths);
        }
 
@@ -117,7 +117,7 @@ public class NameRelationshipEditorInput extends AbstractBulkEditorInput<NameRel
                MessagingUtils.notImplementedMessage(getClass());
                return null;
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getTypeText(java.lang.Object)
         */
@@ -126,8 +126,16 @@ public class NameRelationshipEditorInput extends AbstractBulkEditorInput<NameRel
                if(entity instanceof NameRelationship){
                        return ((NameRelationship) entity).getType().getTitleCache();
                }
-               
+
                return super.getTypeText(entity);
        }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput#merge()
+     */
+    @Override
+    public void merge() {
+
+    }
+
 }
index 8e954f8bd163e28d137a6295c6aee14b8cbc802c..929379d2731220a67cd558a7815b56545c18e923 100644 (file)
 
 package eu.etaxonomy.taxeditor.bulkeditor.input;
 
-import java.util.Arrays;
 import java.util.List;
-import java.util.UUID;
 
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
 import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
 import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;
 import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.OccurrenceCreator;
@@ -69,7 +68,7 @@ public class OccurrenceEditorInput extends AbstractBulkEditorInput<SpecimenOrObs
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#loadEntity(java.util.UUID)
         */
-       /** {@inheritDoc} 
+       /** {@inheritDoc}
        @Override
        protected SpecimenOrObservationBase loadEntity(UUID entityUuid) {
                List<String> propertyPaths = Arrays.asList(new String[]{});
@@ -125,7 +124,7 @@ public class OccurrenceEditorInput extends AbstractBulkEditorInput<SpecimenOrObs
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#delete(java.lang.Object)
         */
-       /** {@inheritDoc} 
+       /** {@inheritDoc}
         * @throws ReferencedObjectUndeletableException */
        @Override
     public boolean delete(SpecimenOrObservationBase entity) throws ReferencedObjectUndeletableException {
@@ -137,8 +136,13 @@ public class OccurrenceEditorInput extends AbstractBulkEditorInput<SpecimenOrObs
         */
        /** {@inheritDoc} */
        @Override
-    public boolean save(SpecimenOrObservationBase entity) {
-               return CdmStore.getService(IOccurrenceService.class).save(entity) != null;
+    public SpecimenOrObservationBase<IIdentifiableEntityCacheStrategy> save(SpecimenOrObservationBase entity) {
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               return CdmStore.getService(IOccurrenceService.class).merge(entity, true).getMergedEntity();
+           } else {
+               CdmStore.getService(IOccurrenceService.class).save(entity);
+               return entity;
+           }
        }
 
 
@@ -161,4 +165,12 @@ public class OccurrenceEditorInput extends AbstractBulkEditorInput<SpecimenOrObs
 
                return sortProviders;
        }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput#merge()
+     */
+    @Override
+    public void merge() {
+
+    }
 }
index d32a648cd0bf522d3a32dcc2e22ec9fe34612537..8b8c11360c4442e1c160b9ed43ea630209e3b738 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -36,13 +36,13 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class ReferenceEditorInput extends AbstractBulkEditorInput<Reference> {
 
        /**
-        * 
+        *
         */
        private static final long serialVersionUID = 3806243517765126749L;
 
        /** Constant <code>ID="bulkeditor.input.reference"</code> */
        public static final String ID = "bulkeditor.input.reference";
-       
+
        private static ReferenceEditorInput instance;
 
        /**
@@ -53,7 +53,7 @@ public class ReferenceEditorInput extends AbstractBulkEditorInput<Reference> {
        public static String getID() {
                return ID;
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.IEditorInput#getName()
         */
@@ -62,7 +62,8 @@ public class ReferenceEditorInput extends AbstractBulkEditorInput<Reference> {
         *
         * @return a {@link java.lang.String} object.
         */
-       public String getName() {
+       @Override
+    public String getName() {
                return BulkEditorInputType.REFERENCE.label;
        }
 
@@ -74,7 +75,8 @@ public class ReferenceEditorInput extends AbstractBulkEditorInput<Reference> {
         *
         * @return a {@link java.lang.String} object.
         */
-       public String getToolTipText() {
+       @Override
+    public String getToolTipText() {
                return getName();
        }
 
@@ -98,7 +100,7 @@ public class ReferenceEditorInput extends AbstractBulkEditorInput<Reference> {
        public boolean isMergingEnabled() {
                return true;
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInput#isMarkerTypeEditingEnabled(eu.etaxonomy.cdm.model.common.MarkerType)
         */
@@ -111,31 +113,38 @@ public class ReferenceEditorInput extends AbstractBulkEditorInput<Reference> {
                return super.isMarkerTypeEditingEnabled(markerType);
        }
 
-       
+
        /** {@inheritDoc} */
        @Override
        public List listEntities(IIdentifiableEntityServiceConfigurator configurator) {
                return CdmStore.getSearchManager().findReferences(configurator);
        }
-       
+
        // Entity persistence
-       
+
        /** {@inheritDoc} */
        @Override
        public Reference loadEntity(UUID entityUuid) {
-               List<String> propertyPaths = Arrays.asList(new String[]{"*", "inReference.*", "authorTeam.*"}); 
+               List<String> propertyPaths = Arrays.asList(new String[]{"*", "inReference.*", "authorTeam.*"});
                return CdmStore.getService(IReferenceService.class).load(entityUuid, propertyPaths);
        }
 
-       /** {@inheritDoc} 
+       /** {@inheritDoc}
         * @throws ReferencedObjectUndeletableException */
-       public boolean delete(Reference entity) throws ReferencedObjectUndeletableException {
+       @Override
+    public boolean delete(Reference entity) throws ReferencedObjectUndeletableException {
                return CdmStore.getService(IReferenceService.class).delete(entity) != null;
        }
 
        /** {@inheritDoc} */
-       public boolean save(Reference entity) {
-               return CdmStore.getService(IReferenceService.class).saveOrUpdate(entity) != null;
+       @Override
+    public Reference save(Reference entity) {
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               return CdmStore.getService(IReferenceService.class).merge(entity, true).getMergedEntity();
+           } else {
+               CdmStore.getService(IReferenceService.class).saveOrUpdate(entity);
+               return entity;
+           }
        }
 
        /* (non-Javadoc)
@@ -145,20 +154,20 @@ public class ReferenceEditorInput extends AbstractBulkEditorInput<Reference> {
        protected IEntityCreator<Reference> createEntityCreator() {
                return new ReferenceCreator();
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getSortProviders()
         */
        @Override
        public List<IBulkEditorSortProvider<Reference>> getSortProviders() {
                List<IBulkEditorSortProvider<Reference>> sortProviders = super.getSortProviders();
-               
+
                sortProviders.add(0, new IdentifiableEntitySortProvider<Reference>());
                sortProviders.add(1, new ReferenceSortProvider());
-               
+
                return sortProviders;
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getTypeText(java.lang.Object)
         */
@@ -170,4 +179,12 @@ public class ReferenceEditorInput extends AbstractBulkEditorInput<Reference> {
                return super.getTypeText(entity);
        }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput#merge()
+     */
+    @Override
+    public void merge() {
+
+    }
+
 }
index 3367a5e09279f936f52c687d8c049e656a818f65..aa6dd1537bbae92c19b7a49adc5b35dbb09964eb 100644 (file)
@@ -5,20 +5,17 @@ import java.util.Arrays;
 import java.util.List;\r
 import java.util.UUID;\r
 \r
-import eu.etaxonomy.cdm.api.service.INameService;\r
 import eu.etaxonomy.cdm.api.service.ITaxonService;\r
 import eu.etaxonomy.cdm.api.service.config.FindTaxaAndNamesConfiguratorImpl;\r
 import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;\r
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;\r
 import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;\r
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;\r
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
 import eu.etaxonomy.cdm.model.taxon.Synonym;\r
 import eu.etaxonomy.cdm.model.taxon.Taxon;\r
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;\r
 import eu.etaxonomy.cdm.persistence.query.MatchMode;\r
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;\r
-import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.NameCreator;\r
 import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.TaxonCreator;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 \r
@@ -27,9 +24,9 @@ public class TaxonEditorInput extends AbstractBulkEditorInput<TaxonBase>{
        private static TaxonEditorInput instance;\r
        /** Constant <code>ID="bulkeditor.input.taxon"</code> */\r
        public static final String ID = "bulkeditor.input.taxon";\r
-       \r
-       \r
-       \r
+\r
+\r
+\r
        /**\r
         * <p>Getter for the field <code>instance</code>.</p>\r
         *\r
@@ -39,11 +36,11 @@ public class TaxonEditorInput extends AbstractBulkEditorInput<TaxonBase>{
                if (instance == null) {\r
                        instance = new TaxonEditorInput();\r
                }\r
-       \r
+\r
                return instance;\r
        }\r
-       \r
-       \r
+\r
+\r
        @Override\r
        public String getName() {\r
                return BulkEditorInputType.TAXON.label;\r
@@ -54,7 +51,7 @@ public class TaxonEditorInput extends AbstractBulkEditorInput<TaxonBase>{
                return getName();\r
        }\r
 \r
-       \r
+\r
        /**\r
         * <p>getID</p>\r
         *\r
@@ -63,7 +60,7 @@ public class TaxonEditorInput extends AbstractBulkEditorInput<TaxonBase>{
        public static Object getID() {\r
                return ID;\r
        }\r
-       \r
+\r
        /* (non-Javadoc)\r
         * @see eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInput#isMergingEnabled()\r
         */\r
@@ -73,11 +70,16 @@ public class TaxonEditorInput extends AbstractBulkEditorInput<TaxonBase>{
                return false;\r
        }\r
        @Override\r
-       public boolean save(TaxonBase entity) {\r
-               return CdmStore.getService(ITaxonService.class).saveOrUpdate(entity) != null;\r
+       public TaxonBase save(TaxonBase entity) {\r
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {\r
+               return CdmStore.getService(ITaxonService.class).merge(entity, true).getMergedEntity();\r
+           } else {\r
+               CdmStore.getService(ITaxonService.class).saveOrUpdate(entity);\r
+               return entity;\r
+           }\r
        }\r
 \r
-       \r
+\r
 \r
        /** {@inheritDoc} */\r
        @Override\r
@@ -88,7 +90,7 @@ public class TaxonEditorInput extends AbstractBulkEditorInput<TaxonBase>{
                List<TaxonBase> taxa =  CdmStore.getSearchManager().findTaxa(configurator);\r
                List<TaxonBase> taxaCopy = new ArrayList<TaxonBase>();\r
                for (TaxonBase taxon:taxa){\r
-                       \r
+\r
                        if (taxon instanceof Taxon){\r
                                taxaCopy.add(HibernateProxyHelper.deproxy(taxon, Taxon.class));\r
                        }else{\r
@@ -101,15 +103,16 @@ public class TaxonEditorInput extends AbstractBulkEditorInput<TaxonBase>{
 \r
        @Override\r
        protected TaxonBase loadEntity(UUID entityUuid) {\r
-               List<String> propertyPaths = Arrays.asList(new String[]{}); \r
+               List<String> propertyPaths = Arrays.asList(new String[]{});\r
                return CdmStore.getService(ITaxonService.class).load(entityUuid, propertyPaths);\r
        }\r
 \r
-       \r
 \r
-       /** {@inheritDoc} \r
+\r
+       /** {@inheritDoc}\r
         * @throws ReferencedObjectUndeletableException */\r
-       public boolean delete(TaxonBase entity) {\r
+       @Override\r
+    public boolean delete(TaxonBase entity) {\r
                return CdmStore.getService(ITaxonService.class).delete(entity) != null;\r
        }\r
        @Override\r
@@ -117,4 +120,13 @@ public class TaxonEditorInput extends AbstractBulkEditorInput<TaxonBase>{
                return new TaxonCreator();\r
        }\r
 \r
+\r
+    /* (non-Javadoc)\r
+     * @see eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput#merge()\r
+     */\r
+    @Override\r
+    public void merge() {\r
+\r
+    }\r
+\r
 }\r
index c80733b1e807b558638e0ae860322e959e22f87b..72dd138a4fc45db2581d631c2517b9b69ec6a1ae 100644 (file)
@@ -1,18 +1,16 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.bulkeditor.input;
 
-import java.util.Arrays;
 import java.util.List;
-import java.util.UUID;
 
 import eu.etaxonomy.cdm.api.service.IUserService;
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
@@ -30,9 +28,9 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class UserEditorInput extends AbstractBulkEditorInput<User> {
 
        public static final String ID = "bulkeditor.input.user";
-       
+
        private static UserEditorInput instance;
-       
+
        /**
         * @return the instance
         */
@@ -42,7 +40,7 @@ public class UserEditorInput extends AbstractBulkEditorInput<User> {
                }
                return instance;
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.IEditorInput#getName()
         */
@@ -63,8 +61,14 @@ public class UserEditorInput extends AbstractBulkEditorInput<User> {
         * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#save(java.lang.Object)
         */
        @Override
-       public boolean save(User entity) {
-               return CdmStore.getService(IUserService.class).saveOrUpdate(entity) != null;
+       public User save(User entity) {
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               return CdmStore.getService(IUserService.class).merge(entity, true).getMergedEntity();
+           } else {
+               CdmStore.getService(IUserService.class).saveOrUpdate(entity);
+               return entity;
+           }
+
        }
 
        /* (non-Javadoc)
@@ -84,13 +88,13 @@ public class UserEditorInput extends AbstractBulkEditorInput<User> {
                return CdmStore.getSearchManager().findUsers(configurator);
        }
 
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#loadEntity(java.util.UUID)
-       
+
        @Override
        protected User loadEntity(UUID entityUuid) {
-               List<String> propertyPaths = Arrays.asList(new String[]{}); 
+               List<String> propertyPaths = Arrays.asList(new String[]{});
                return CdmStore.getService(IUserService.class).load(entityUuid, propertyPaths);
        }
  */
@@ -101,7 +105,7 @@ public class UserEditorInput extends AbstractBulkEditorInput<User> {
        protected IEntityCreator<User> createEntityCreator() {
                return new UserCreator();
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getText(eu.etaxonomy.cdm.model.common.ICdmBase)
         */
@@ -110,5 +114,13 @@ public class UserEditorInput extends AbstractBulkEditorInput<User> {
                return String.format("%s, %s", entity.getUsername(), entity.getPerson());
        }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput#merge()
+     */
+    @Override
+    public void merge() {
+
+    }
+
 
 }
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/MediaCreator.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/MediaCreator.java
new file mode 100644 (file)
index 0000000..8b28278
--- /dev/null
@@ -0,0 +1,67 @@
+// $Id$
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
+
+/**
+ * @author k.luther
+ * @date 10.03.2016
+ *
+ */
+public class MediaCreator implements IEntityCreator<Media> {
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Media createEntity(String text) {
+        Media result = Media.NewInstance();
+        result.setTitleCache(text);
+        return result;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Media createEntity(Object key, String text) {
+        if (key.equals(Media.class)){
+            Media result = Media.NewInstance();
+            result.setTitleCache(text);
+            return result;
+        }
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Map<Object, String> getKeyLabelPairs() {
+        Map<Object, String> result = new HashMap<Object, String>();
+       result.put(Media.class, "Media");
+        return result;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean savesEntity() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+}
index aba437843535c3a7afac76042df26592e35a13e9..81ebab53c8c63236ee855d06810806a8a13b884d 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -43,7 +43,12 @@ public class UserCreator  implements IEntityCreator<User>{
        public User createEntity(Object key, String text) {
                try{
                        User user = User.NewInstance(text, text);
-                       CdmStore.getService(IUserService.class).createUser(user);
+                        if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                            CdmStore.getService(IUserService.class).createUser(user);
+                            user = CdmStore.getService(IUserService.class).loadWithUpdate(user.getUuid());
+                        } else {
+                            CdmStore.getService(IUserService.class).createUser(user);
+                        }
                        return user;
                } catch (AccessDeniedException e){
                        MessagingUtils.messageDialog("Access denied", getClass(), e.getMessage(), e);
index 2830dd82d6e82a8325140e7e0450403c191bec7c..b183539a5587d3b6cc34aba365a9836eadf5961c 100644 (file)
 
 package eu.etaxonomy.taxeditor.bulkeditor.preference;
 
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 
 import eu.etaxonomy.cdm.model.common.MarkerType;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.TermStore;
 
 /**
- * <p>BulkEditorMarkerPreferenceComposite class.</p>
- *
  * @author p.ciardelli
  * @created 17.08.2009
  * @version 1.0
  */
-public class BulkEditorMarkerPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+public class BulkEditorMarkerPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
 
-       private Map<MarkerType, Boolean> markerTypeEditingMap = new HashMap<MarkerType, Boolean>();
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
-        */
        @Override
        public void init(IWorkbench workbench) {
                setPreferenceStore(PreferencesUtil.getPreferenceStore());
                if(!CdmStore.isActive()) {
             MessagingUtils.noDataSourceWarningDialog(null);
-               }else{
-                   markerTypeEditingMap = PreferencesUtil.getEditMarkerTypePreferences();
                }
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
-        */
-       @Override
-       protected Control createContents(Composite parent) {
-               Composite container = new Composite(parent, SWT.NULL);
-               container.setLayout(new GridLayout());
+    @Override
+    protected void createFieldEditors() {
         if(CdmStore.isActive()){
             for (final MarkerType markerType : TermStore.getTerms(MarkerType.class)) {
-                final Button button = new Button(container, SWT.CHECK);
-                button.setText(String.format("Edit '%s' markers", markerType.getLabel()));
-
-                button.addSelectionListener(new SelectionAdapter() {
-                    @Override
-                    public void widgetSelected(SelectionEvent e) {
-                        markerTypeEditingMap.put(markerType, button.getSelection());
-                    }
-                });
-
-                boolean edit = markerTypeEditingMap.get(markerType) == null ? true : markerTypeEditingMap.get(markerType);
-
-                button.setSelection(edit);
+                addField(new BooleanFieldEditor(IPreferenceKeys.EDIT_MARKER_TYPE_PREFIX
+                        + markerType.getClass().getName() + markerType.getLabel(), String.format("Edit '%s' markers",
+                        markerType.getLabel()), getFieldEditorParent()));
             }
         }
-               return container;
-       }
-
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.preference.PreferencePage#performOk()
-        */
-       @Override
-       public boolean performOk() {
-               PreferencesUtil.setEditMarkerTypePreferences(markerTypeEditingMap);
 
-               return super.performOk();
-       }
+    }
 }
index 604f3874a6d788c0f879e2e7f6f6cf5d77648c06..682f60debad484c7b39c292b51513d5770e77020 100644 (file)
@@ -22,6 +22,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.viewers.CellEditor;
 import org.eclipse.jface.viewers.ICellModifier;
 import org.eclipse.jface.viewers.ISelection;
@@ -30,58 +31,69 @@ import org.eclipse.jface.viewers.ITableLabelProvider;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.viewers.TableViewerColumn;
 import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.jface.viewers.TreeNode;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.ui.IWorkbenchPart;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.IAgentService;
+import eu.etaxonomy.cdm.api.service.IDescriptionService;
+import eu.etaxonomy.cdm.api.service.IEventBaseService;
 import eu.etaxonomy.cdm.api.service.IGroupService;
+import eu.etaxonomy.cdm.api.service.IMediaService;
 import eu.etaxonomy.cdm.api.service.INameService;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.IReferenceService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.api.service.IUserService;
+import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.EventBase;
 import eu.etaxonomy.cdm.model.common.Group;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.cdm.model.description.DescriptionBase;
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.cdm.model.molecular.Sequence;
 import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
 import eu.etaxonomy.taxeditor.model.DescriptionHelper;
-import eu.etaxonomy.taxeditor.model.LineSelection;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.view.AbstractCdmViewPart;
 
 /**
- * <p>ReferencingObjectsView class.</p>
- *
  * @author p.ciardelli
  * @created 08.07.2009
  * @version 1.0
  */
-public class ReferencingObjectsView extends AbstractCdmViewPart{
+public class ReferencingObjectsView extends AbstractCdmViewPart {
        private static final Logger logger = Logger
                        .getLogger(ReferencingObjectsView.class);
 
-       /** Constant <code>ID="eu.etaxonomy.taxeditor.bulkeditor.refer"{trunked}</code> */
        public static final String ID = "eu.etaxonomy.taxeditor.bulkeditor.view.referencingobjects";
 
        private TableViewer viewer;
 
        private String referencedObjectTitleCache;
        private ConversationHolder conversation;
+       private final ICdmEntitySession cdmEntitySession;
+
+       public ReferencingObjectsView() {
+           cdmEntitySession = CdmStore.getCurrentSessionManager().bindNullSession();
+       }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createViewer(org.eclipse.swt.widgets.Composite)
-        */
        /** {@inheritDoc} */
        @Override
        public void createViewer(Composite parent) {
@@ -93,11 +105,8 @@ public class ReferencingObjectsView extends AbstractCdmViewPart{
                viewer.setContentProvider(new ReferencingObjectsContentProvider());
                viewer.setLabelProvider(new ReferencingObjectsLabelProvider());
                viewer.setCellModifier(new ICellModifier() {
-
             @Override
             public void modify(Object element, String property, Object value) {
-                // TODO Auto-generated method stub
-
             }
 
             @Override
@@ -120,7 +129,16 @@ public class ReferencingObjectsView extends AbstractCdmViewPart{
                 return true;
             }
         });
-//             viewer.setInput(new ArrayList<CdmBase>());
+
+        //create context menu
+        MenuManager menuManager = new MenuManager();
+        getSite().registerContextMenu(menuManager, viewer);
+        Control control = viewer.getControl();
+        Menu menu = menuManager.createContextMenu(control);
+        control.setMenu(menu);
+
+        // Propagate selection from viewer
+        getSite().setSelectionProvider(viewer);
        }
 
        /**
@@ -149,11 +167,11 @@ public class ReferencingObjectsView extends AbstractCdmViewPart{
                viewer.setColumnProperties(titles);
        }
 
-       /**
-        * <p>updateReferencingObjects</p>
-        *
-        * @param entity a {@link eu.etaxonomy.cdm.model.common.IdentifiableEntity} object.
-        */
+       @Override
+       public void setFocus() {
+           cdmEntitySession.bind();
+       }
+
        public void updateReferencingObjects(final UUID entityUUID, final Class objectClass) {
 
                final Display display = Display.getCurrent();
@@ -171,9 +189,12 @@ public class ReferencingObjectsView extends AbstractCdmViewPart{
                                        @Override
                                        public void run() {
                                                if (entityUUID != null){
-
+                                                   ICdmEntitySession previousCdmEntitySession = CdmStore.getCurrentSessionManager().getActiveSession();
+                                                   cdmEntitySession.bind();
                                                        List<CdmBase> referencingObjects = getReferencingObjects(entityUUID, objectClass);
-
+                                                       if(previousCdmEntitySession != null) {
+                                                           previousCdmEntitySession.bind();
+                                                       }
                                                        updateView(referencingObjects);
 
                                                }
@@ -208,12 +229,30 @@ public class ReferencingObjectsView extends AbstractCdmViewPart{
                        referencedObject = CdmStore.getService(IUserService.class).load(entity);
                } else if (objectClass.isAssignableFrom(Group.class)){
                        referencedObject = CdmStore.getService(IGroupService.class).load(entity);
-               }
+               } else if (objectClass.isAssignableFrom(Media.class)){
+                   referencedObject = CdmStore.getService(IMediaService.class).load(entity);
+               } else if (DescriptionBase.class.isAssignableFrom(objectClass)){
+                   referencedObject = CdmStore.getService(IDescriptionService.class).load(entity);
+               } else if (DescriptionElementBase.class.isAssignableFrom(objectClass)){
+                referencedObject = CdmStore.getService(IDescriptionService.class).loadDescriptionElement(entity, null);
+            } else if (objectClass.equals(Sequence.class)){
+                referencedObject = CdmStore.getService(ISequenceService.class).load(entity, null);
+            } else if (EventBase.class.isAssignableFrom(objectClass)){
+                referencedObject = CdmStore.getService(IEventBaseService.class).load(entity, null);
+            }
                        //referencedObject =(CdmBase) CdmStore.getService(IIdentifiableEntityService.class).load(referencedObject.getUuid());
                Set<CdmBase> setOfReferencingObjects = null;
 
                if (referencedObject != null){
-                       referencedObjectTitleCache = ((IdentifiableEntity)referencedObject).getTitleCache();
+                   if(referencedObject.isInstanceOf(IdentifiableEntity.class)){
+                       referencedObjectTitleCache = (HibernateProxyHelper.deproxy(referencedObject, IdentifiableEntity.class)).getTitleCache();
+                   }
+                   else if(referencedObject.isInstanceOf(DescriptionElementBase.class)){
+                       referencedObjectTitleCache = DescriptionHelper.getLabel(referencedObject);
+                   }
+                   else{
+                       referencedObjectTitleCache = null;
+                   }
                        setOfReferencingObjects = CdmStore.getCommonService().getReferencingObjects(referencedObject);
                }
                if (setOfReferencingObjects != null){
@@ -226,15 +265,13 @@ public class ReferencingObjectsView extends AbstractCdmViewPart{
                }
         } catch (Exception e) {
             logger.error("Error retrieving referencing objects", e);
+            setContentDescription("The referencing objects view could not be loaded completely. Some Problems occured.");
         }
                return null;
        }
 
        class ReferencingClassComparator implements Comparator<CdmBase> {
 
-               /* (non-Javadoc)
-                * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
-                */
                @Override
         public int compare(CdmBase o1, CdmBase o2) {
                        String string1 = o1.getClass().getSimpleName();
@@ -250,9 +287,6 @@ public class ReferencingObjectsView extends AbstractCdmViewPart{
                }
        }
 
-       /**
-        *
-        */
        private void updateView(List<CdmBase> referencingObjects) {
                if (viewer != null && !viewer.getControl().isDisposed()){
                        try{
@@ -273,37 +307,30 @@ public class ReferencingObjectsView extends AbstractCdmViewPart{
        /** {@inheritDoc} */
        @Override
     public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-               if(! (part instanceof BulkEditor)){
-                       setContentDescription("");
-                       showEmptyPage();
-                       return;
-               }
-
-               if(! (selection instanceof LineSelection)){
-                       return;
-               }
-               LineSelection lineSelection = (LineSelection) selection;
-
-               if(lineSelection.size() != 1){
-                       return;
-               }
-
-               if(! (lineSelection.getFirstElement() instanceof IdentifiableEntity)){
-                       return;
-               }
-
-               showViewer(part, lineSelection);
+        if(part == this){
+            return;
+        }
+        if(selection instanceof IStructuredSelection){
+            showViewer(part, (IStructuredSelection) selection);
+        }
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#showViewer(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-        */
        /** {@inheritDoc} */
        @Override
        public void showViewer(IWorkbenchPart part, IStructuredSelection selection) {
        //      this.part = part;
 
-               updateReferencingObjects(((IdentifiableEntity) selection.getFirstElement()).getUuid(),selection.getFirstElement().getClass() );
+               Object firstElement = selection.getFirstElement();
+               if(firstElement instanceof TreeNode){
+                   firstElement = ((TreeNode) firstElement).getValue();
+               }
+               if(firstElement instanceof CdmBase){
+                   updateReferencingObjects(((CdmBase) firstElement).getUuid(),firstElement.getClass() );
+               }
+               else{
+                   updateView(null);
+            setContentDescription("");
+               }
        }
 
        /** {@inheritDoc} */
@@ -312,31 +339,23 @@ public class ReferencingObjectsView extends AbstractCdmViewPart{
                conversation.close();
                selectionService.removePostSelectionListener(this);
                selectionService.removeSelectionListener(this);
+               cdmEntitySession.dispose();
                super.dispose();
 
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#getViewer()
-        */
        /** {@inheritDoc} */
        @Override
        public Viewer getViewer() {
                return viewer;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#dirtyStateChanged()
-        */
        /** {@inheritDoc} */
        @Override
        public void changed(Object object) {
                // no editing in this view
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.operations.IPostOperationEnabled#onComplete()
-        */
        /** {@inheritDoc} */
        @Override
        public boolean onComplete() {
@@ -344,7 +363,6 @@ public class ReferencingObjectsView extends AbstractCdmViewPart{
        }
 
        public void refresh(){
-
                selectionService.removePostSelectionListener(this);
                selectionService.removeSelectionListener(this);
                selectionService.addPostSelectionListener(this);
@@ -352,5 +370,4 @@ public class ReferencingObjectsView extends AbstractCdmViewPart{
 
        }
 
-
 }
index 5f958ce4af119eaecd27cb317134ea5e5d20692f..f368ad9b7f11ec6f30a0b0e402f2cc7baa128c0c 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.8.0-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.8.0-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.8.0-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.8.0-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.8.0-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.8.0-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.8.0-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.8.0-SNAPSHOT.jar" sourcepath="lib/cdmlib-services-3.8.0-SNAPSHOT-sources.jar"/>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
-       <classpathentry kind="src" path="src/main/java"/>\r
-       <classpathentry kind="src" path="src/main/resources"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/activation-1.1.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/antlr-2.7.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/aopalliance-1.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/aspectjrt-1.7.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/aspectjweaver-1.7.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/avro-1.6.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/batik-anim-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/batik-awt-util-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/batik-bridge-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/batik-css-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/batik-dom-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/batik-ext-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/batik-extension-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/batik-gvt-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/batik-js-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/batik-parser-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/batik-script-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/batik-svg-dom-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/batik-svggen-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/batik-transcoder-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/batik-util-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/batik-xml-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/c3p0-0.9.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cglib-nodep-2.2.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/com.springsource.org.aopalliance-1.0.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/com.springsource.org.apache.commons.logging-1.1.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-beanutils-1.8.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-codec-20041127.091804.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-collections-3.2.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-dbcp-1.4.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-io-2.4.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-lang-2.6.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.1.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-pool-1.5.4.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/concurrent-1.3.4.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/dbunit-2.4.9.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/doxia-core-1.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/doxia-logging-api-1.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/doxia-module-apt-1.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/doxia-module-xhtml-1.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/doxia-sink-api-1.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/dozer-5.3.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/easymock-3.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/easymockclassextension-2.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/ehcache-core-2.6.9.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/ezmorph-1.0.6.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/fop-1.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/guava-r05.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/h2-1.3.170.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hamcrest-core-1.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-c3p0-4.1.10.Final.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-cglib-repack-2.1_3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-commons-annotations-4.0.1.Final.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-core-4.1.10.Final.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-ehcache-4.1.10.Final.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-entitymanager-4.1.10.Final.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-envers-4.1.10.Final.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-jpa-2.0-api-1.0.1.Final.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-4.2.0.Final.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-analyzers-4.2.0.Final.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-engine-4.2.0.Final.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-orm-4.2.0.Final.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-validator-4.3.1.Final.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hsqldb-1.8.0.10.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/httpclient-4.2.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/httpcore-4.2.4.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/icu4j-2.6.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/identificationKeyAPI-1.0-SNAPSHOT-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/identificationKeyAPI-1.0-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/itextpdf-5.4.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jackson-core-asl-1.8.8.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jackson-mapper-asl-1.8.8.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jakarta-regexp-1.4.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/javassist-3.17.1-GA.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jaxb-api-2.2.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jaxb-impl-2.2-EA.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jaxb-xjc-2.2-EA.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jaxb1-impl-2.2-EA.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jaxen-1.1.4.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jboss-logging-3.1.3.GA.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jdbc4-2.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jdom-1.1.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/joda-time-2.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/json-lib-2.4-jdk15.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jsr250-api-1.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jtds-1.3.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/junit-4.11.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/junit-benchmarks-0.5.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/log4j-1.2.17.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lsid-client-1.1.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lsid-server-1.1.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lucene-analyzers-3.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lucene-core-3.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lucene-facet-3.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lucene-grouping-3.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lucene-highlighter-3.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lucene-kuromoji-3.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lucene-memory-3.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lucene-misc-3.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lucene-phonetic-3.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lucene-queries-3.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lucene-smartcn-3.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lucene-spatial-3.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lucene-spellchecker-3.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lucene-stempel-3.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/mchange-commons-java-0.2.3.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/mysql-connector-java-5.1.24.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/objenesis-1.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/odfdom-java-0.8.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/ognl-2.6.9.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/opencsv-2.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.eclipse.equinox.common-3.6.0.v20110523.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.osgi.core-1.0.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.aop-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.aspects-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.beans-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.context-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.core-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.expression-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.jdbc-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.orm-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.oxm-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.test-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.transaction-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.web-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.web.servlet-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/osgi-3.6.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/p6spy-1.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/paranamer-2.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/plexus-classworlds-1.2-alpha-9.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/plexus-container-default-1.0-alpha-30.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/plexus-utils-2.0.5.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/postgresql-9.1-901.jdbc4.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/sanselan-0.97-incubator.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/servlet-api-2.5.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.7.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/slf4j-log4j12-1.7.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/snappy-java-1.0.4.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/solr-analysis-extras-3.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/solr-core-3.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/solr-solrj-3.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-aop-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-beans-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-context-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-context-support-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-core-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-expression-3.2.2.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-modules-cache-0.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-security-config-3.1.3.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-security-core-3.1.3.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/stax-1.2.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/stax-api-1.0.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/unitils-core-3.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/unitils-database-3.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/unitils-dbmaintainer-3.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/unitils-dbunit-3.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/unitils-easymock-3.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/unitils-inject-3.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/unitils-mock-3.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/unitils-orm-3.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/unitils-spring-3.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/usertype.jodatime-2.0.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/usertype.spi-2.0.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/validation-api-1.0.0.GA.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xalan-2.6.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xercesImpl-2.11.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xml-apis-1.0.b2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xml-apis-ext-1.3.04.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xml-resolver-1.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xmlgraphics-commons-1.5.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xmlParserAPIs-2.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xmlpull-1.1.3.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xmlunit-1.4.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xom-1.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xpp3_min-1.1.4c.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xpp3-1.1.4c.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xstream-1.4.4.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/yjp-controller-api-redist-9.0.8.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/google-api-translate-java-0.92.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/odfdom-0.8.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/h2mig_pagestore_addon.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-security-remoting-3.1.3.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jena-core-2.11.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jena-iri-1.0.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/poi-3.10-FINAL.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/poi-ooxml-3.10-FINAL.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xmlbeans-2.3.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/poi-ooxml-schemas-3.10-FINAL.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/swagger-annotations-1.3.5.jar"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry kind="src" path="src/main/java"/>
+       <classpathentry kind="src" path="src/main/resources"/>
+       <classpathentry exported="true" kind="lib" path="lib/activation-1.1.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/antlr-2.7.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/aopalliance-1.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/apache-log4j-extras-1.2.17.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/aspectjrt-1.8.8.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/aspectjweaver-1.8.8.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/avro-1.6.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/batik-anim-1.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/batik-awt-util-1.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/batik-bridge-1.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/batik-css-1.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/batik-dom-1.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/batik-ext-1.8.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/batik-extension-1.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/batik-gvt-1.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/batik-js-1.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/batik-parser-1.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/batik-script-1.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/batik-svg-dom-1.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/batik-svggen-1.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/batik-transcoder-1.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/batik-util-1.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/batik-xml-1.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/c3p0-0.9.5.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-4.0.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-4.0.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-4.0.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-4.0.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-4.0.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-4.0.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-4.0.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-4.0.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-test-4.0.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cglib-3.2.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cglib-nodep-3.2.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/classmate-1.3.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/codemodel-2.2.11.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/com.springsource.org.aopalliance-1.0.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/com.springsource.org.apache.commons.logging-1.1.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-beanutils-1.9.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-codec-1.10.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-collections-3.2.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-csv-1.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-dbcp-1.4.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-io-2.4.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-lang-2.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-lang3-3.3.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-pool-1.5.4.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/concurrent-1.3.4.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/dbunit-2.4.9.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/doxia-core-1.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/doxia-logging-api-1.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/doxia-module-apt-1.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/doxia-module-xhtml-1.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/doxia-sink-api-1.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/dozer-5.3.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/dtd-parser-1.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/easymock-2.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/easymockclassextension-2.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/ehcache-core-2.6.11.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/ezmorph-1.0.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/FastInfoset-1.2.13.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/fop-1.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/google-api-translate-java-0.92.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/guava-19.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/h2-1.4.190.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/h2mig_pagestore_addon.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hamcrest-core-1.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-c3p0-5.0.7.Final.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-cglib-repack-2.1_3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-commons-annotations-5.0.1.Final.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-core-5.0.7.Final.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-ehcache-5.0.7.Final.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-entitymanager-5.0.7.Final.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-envers-5.0.7.Final.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-jpa-2.1-api-1.0.0.Final.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-4.2.0.Final.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-analyzers-4.2.0.Final.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-engine-5.5.2.Final.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-orm-5.5.2.Final.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-validator-5.2.2.Final.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-validator-cdi-5.2.2.Final.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hsqldb-2.3.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/httpclient-4.5.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/httpclient-cache-4.2.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/httpcore-4.4.4.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/httpmime-4.5.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/icu4j-2.6.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/identificationKeyAPI-1.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/istack-commons-runtime-2.21.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/istack-commons-tools-2.21.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/itextpdf-5.5.8.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jackson-annotations-2.6.5.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jackson-core-2.6.5.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jackson-core-asl-1.8.8.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jackson-databind-2.6.5.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jackson-mapper-asl-1.8.8.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jakarta-regexp-1.4.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jandex-2.0.0.Final.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/javassist-3.20.0-GA.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/javax.el-2.2.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/javax.el-api-2.2.5.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/javax.servlet-api-3.1.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jaxb-api-2.2.12.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jaxb-core-2.2.11.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jaxb-jxc-2.2.11.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jaxb-runtime-2.2.11.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jaxb-xjc-2.2.11.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jaxb1-impl-2.2-EA.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jaxen-1.1.4.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jaxen-1.1.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jboss-logging-3.3.0.Final.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jcl-over-slf4j-1.7.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jdbc4-2.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jdom-1.1.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jdom2-2.0.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jena-arq-2.13.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jena-core-2.13.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jena-iri-1.1.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jena-tdb-1.1.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/joda-time-2.9.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/json-20090211.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/json-lib-2.4-jdk15.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jsonld-java-0.5.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jsr250-api-1.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jta-1.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jtds-1.3.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/junit-4.12.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/junit-benchmarks-0.7.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/libthrift-0.9.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/log4j-1.2.17.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lsid-client-1.1.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lsid-server-1.1.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lucene-analyzers-common-5.4.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lucene-backward-codecs-5.4.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lucene-core-5.4.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lucene-facet-5.4.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lucene-grouping-5.4.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lucene-highlighter-5.4.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lucene-join-5.4.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lucene-memory-5.4.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lucene-misc-5.4.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lucene-queries-5.4.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lucene-queryparser-5.4.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lucene-sandbox-5.4.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lucene-suggest-5.4.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/mapstruct-1.0.0.Final.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/mchange-commons-java-0.2.11.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/mysql-connector-java-5.1.38.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/objenesis-1.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/odfdom-0.8.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/odfdom-java-0.8.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/ognl-2.6.9.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/opencsv-2.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.osgi.core-1.0.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/osgi-3.6.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/p6spy-2.1.4.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/paranamer-2.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/plexus-classworlds-1.2-alpha-9.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/plexus-component-annotations-1.5.5.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/plexus-container-default-1.0-alpha-30.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/plexus-utils-3.0.15.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/poi-3.13.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/poi-ooxml-3.13.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/poi-ooxml-schemas-3.13.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/postgresql-9.4-1206-jdbc4.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/relaxngDatatype-20020414.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/rngom-2.2.11.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/sanselan-0.97-incubator.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/Saxon-HE-9.7.0-2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/servlet-api-2.5.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.7.13.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/slf4j-log4j12-1.7.13.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/slf4j-nop-1.7.13.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/snappy-java-1.0.4.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/solr-analysis-extras-3.6.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/solr-core-3.6.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/solr-solrj-3.6.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-aop-4.2.4.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-aspects-4.2.4.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-beans-4.2.4.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-context-4.2.4.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-context-support-4.2.4.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-core-4.2.4.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-expression-4.2.4.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-jdbc-4.2.4.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-modules-cache-0.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-orm-4.2.4.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-oxm-4.2.4.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-plugin-core-1.2.0.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-plugin-metadata-1.2.0.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-security-config-4.0.3.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-security-core-4.0.3.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-security-web-4.0.3.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-test-4.2.4.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-tx-4.2.4.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-web-4.2.4.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-webmvc-4.2.4.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/springfox-core-2.3.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/springfox-schema-2.3.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/springfox-spi-2.3.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/springfox-spring-web-2.3.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/springfox-swagger-common-2.3.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/springfox-swagger2-2.3.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/standard-1.1.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/stax-1.2.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/stax-api-1.0.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/stax-ex-1.7.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/swagger-annotations-1.5.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/swagger-models-1.5.5.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/tools.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/txw2-2.2.11.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/unitils-core-3.4.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/unitils-database-3.4.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/unitils-dbmaintainer-3.4.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/unitils-dbunit-3.4.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/unitils-easymock-3.4.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/unitils-inject-3.4.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/unitils-mock-3.4.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/unitils-orm-3.4.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/unitils-spring-3.4.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/usertype.jodatime-2.0.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/usertype.spi-2.0.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/validation-api-1.1.0.Final.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xalan-2.7.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xercesImpl-2.11.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xml-apis-1.0.b2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xml-apis-ext-1.3.04.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xml-resolver-1.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xmlbeans-2.6.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xmlgraphics-commons-1.5.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xmlpull-1.1.3.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xmlunit-1.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xom-1.2.5.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xpp3_min-1.1.4c.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xpp3-1.1.4c.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xsom-20140925.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xstream-1.4.8.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/yjp-controller-api-redist-9.0.8.jar"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index c5e82d74585d15d6ea821b5f23cd65624190f244..41b529a2179c63c4a7fdeb5afd85cd68ed2e5720 100644 (file)
@@ -1 +1,5 @@
-bin
\ No newline at end of file
+bin
+/target/
+/target/
+/target/
+/target/
index 158f930cf0e6a1da7eaeb1825e176772a6c48af1..d936af7d854cb1d7d51999a31a96a1e2ea8dbdc5 100644 (file)
@@ -2,15 +2,16 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: CDM Library Dependencies Plugin
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.cdmlib;singleton:=true
-Bundle-Version: 3.8.0.qualifier
+Bundle-Version: 4.0.0.qualifier
 Eclipse-BundleShape: dir
 Export-Package: com.google.api,
  com.google.api.detect,
  com.google.api.translate,
+ eu.etaxonomy.cdm,
  eu.etaxonomy.cdm.api.application,
+ eu.etaxonomy.cdm.api.cache,
  eu.etaxonomy.cdm.api.conversation,
  eu.etaxonomy.cdm.api.facade,
- eu.etaxonomy.cdm.api.lazyloading,
  eu.etaxonomy.cdm.api.service,
  eu.etaxonomy.cdm.api.service.config,
  eu.etaxonomy.cdm.api.service.description,
@@ -49,6 +50,7 @@ Export-Package: com.google.api,
  eu.etaxonomy.cdm.ext.occurrence.gbif,
  eu.etaxonomy.cdm.ext.openurl,
  eu.etaxonomy.cdm.ext.sru,
+ eu.etaxonomy.cdm.format,
  eu.etaxonomy.cdm.hibernate,
  eu.etaxonomy.cdm.hibernate.search,
  eu.etaxonomy.cdm.io.api.application,
@@ -76,6 +78,7 @@ Export-Package: com.google.api,
  eu.etaxonomy.cdm.io.sdd.ikeyplus,
  eu.etaxonomy.cdm.io.sdd.in,
  eu.etaxonomy.cdm.io.sdd.out,
+ eu.etaxonomy.cdm.io.service,
  eu.etaxonomy.cdm.io.specimen,
  eu.etaxonomy.cdm.io.specimen.abcd206.in,
  eu.etaxonomy.cdm.io.specimen.excel.in,
@@ -113,7 +116,6 @@ Export-Package: com.google.api,
  eu.etaxonomy.cdm.persistence.dao.hibernate.occurrence,
  eu.etaxonomy.cdm.persistence.dao.hibernate.reference,
  eu.etaxonomy.cdm.persistence.dao.hibernate.taxon,
- eu.etaxonomy.cdm.persistence.dao.hibernate.validation,
  eu.etaxonomy.cdm.persistence.dao.hibernate.view,
  eu.etaxonomy.cdm.persistence.dao.media,
  eu.etaxonomy.cdm.persistence.dao.name,
@@ -136,7 +138,6 @@ Export-Package: com.google.api,
  eu.etaxonomy.cdm.print.out.pdf,
  eu.etaxonomy.cdm.print.out.taxpub,
  eu.etaxonomy.cdm.print.out.xml,
- eu.etaxonomy.cdm.remote,
  eu.etaxonomy.cdm.remote.config,
  eu.etaxonomy.cdm.remote.controller,
  eu.etaxonomy.cdm.remote.controller.dto,
@@ -185,20 +186,39 @@ Export-Package: com.google.api,
  eu.etaxonomy.cdm.strategy.merge,
  eu.etaxonomy.cdm.strategy.parser,
  eu.etaxonomy.cdm.strategy.parser.location,
+ eu.etaxonomy.cdm.test.integration,
  eu.etaxonomy.cdm.validation,
  eu.etaxonomy.cdm.validation.annotation,
  eu.etaxonomy.cdm.validation.constraint,
  eu.etaxonomy.remote.dto.rdf,
+ eu.etaxonomy.taxeditor.remoting,
+ eu.etaxonomy.taxeditor.remoting.cache,
+ eu.etaxonomy.taxeditor.remoting.server,
+ eu.etaxonomy.taxeditor.remoting.source,
+ eu.etaxonomy.taxeditor.service,
+ eu.etaxonomy.taxeditor.session,
+ eu.etaxonomy.taxeditor.session.mock,
+ javassist.util.proxy,
  javax.persistence,
  junit.framework;uses:="org.junit.runner.manipulation,org.junit.runner,org.junit.runner.notification",
+ net.sf.ehcache,
+ net.sf.ehcache.config,
+ net.sf.ehcache.statistics,
+ net.sf.ehcache.store,
  net.sf.json;uses:="net.sf.json.processors,net.sf.json.util,org.apache.commons.lang.exception",
+ org.aopalliance.aop,
  org.apache.commons.collections;uses:="org.apache.commons.collections.keyvalue,new org.apache.commons.collections",
+ org.apache.commons.collections.buffer,
+ org.apache.commons.dbcp,
  org.apache.commons.io;uses:="org.apache.commons.io.filefilter",
  org.apache.commons.lang;uses:="org.apache.commons.lang.exception",
  org.apache.commons.lang.exception,
+ org.apache.commons.lang.text,
+ org.apache.commons.logging,
  org.apache.fop.apps,
  org.apache.http,
  org.apache.http.client,
+ org.apache.http.util,
  org.apache.log4j;uses:="org.apache.log4j.helpers,org.apache.log4j.or,org.apache.log4j.spi",
  org.apache.log4j.chainsaw;
   uses:="org.apache.log4j,
@@ -254,7 +274,7 @@ Export-Package: com.google.api,
    org.w3c.dom,
    org.xml.sax",
  org.apache.lucene.index,
- org.apache.lucene.queryParser,
+ org.apache.lucene.queryparser.classic,
  org.apache.lucene.util,
  org.apache.sanselan;uses:="org.apache.sanselan.common,org.apache.sanselan.common.byteSources",
  org.apache.xerces.dom,
@@ -265,13 +285,27 @@ Export-Package: com.google.api,
  org.hibernate,
  org.hibernate.annotations.common.reflection,
  org.hibernate.cache.internal,
+ org.hibernate.cfg,
  org.hibernate.classic,
  org.hibernate.collection.internal,
+ org.hibernate.collection.spi,
  org.hibernate.criterion,
+ org.hibernate.engine.internal,
+ org.hibernate.engine.spi,
+ org.hibernate.engine.transaction.spi,
  org.hibernate.envers.query.criteria,
+ org.hibernate.internal,
+ org.hibernate.internal.util,
+ org.hibernate.internal.util.collections,
+ org.hibernate.mapping,
+ org.hibernate.persister.collection,
+ org.hibernate.persister.entity,
+ org.hibernate.pretty,
  org.hibernate.proxy,
+ org.hibernate.proxy.pojo.javassist,
  org.hibernate.search,
  org.hibernate.search.spatial.impl,
+ org.hibernate.type,
  org.jadira.usertype.dateandtime.joda,
  org.jadira.usertype.dateandtime.shared.spi,
  org.jboss.logging,
@@ -311,6 +345,10 @@ Export-Package: com.google.api,
  org.odftoolkit.odfdom.dom.element,
  org.odftoolkit.odfdom.dom.element.style,
  org.odftoolkit.odfdom.dom.style,
+ org.slf4j,
+ org.springframework.aop,
+ org.springframework.aop.framework,
+ org.springframework.beans,
  org.springframework.beans.factory,
  org.springframework.beans.factory.annotation;
   uses:="org.apache.commons.logging,
@@ -321,6 +359,9 @@ Export-Package: com.google.api,
    org.springframework.beans.factory.wiring,
    org.springframework.core.type,
    org.springframework.beans.factory",
+ org.springframework.beans.factory.config,
+ org.springframework.beans.factory.support,
+ org.springframework.beans.factory.xml,
  org.springframework.cache.ehcache,
  org.springframework.context;
   uses:="org.springframework.core.io,
@@ -328,14 +369,19 @@ Export-Package: com.google.api,
    org.springframework.core.io.support,
    org.springframework.beans.factory.config,
    org.springframework.beans.factory",
+ org.springframework.context.config,
  org.springframework.context.event;
   uses:="org.springframework.core,
    org.aopalliance.intercept,
    org.springframework.context,
    org.springframework.beans.factory",
+ org.springframework.context.support,
  org.springframework.core;uses:="org.springframework.util",
+ org.springframework.core.env,
  org.springframework.core.io;uses:="org.jboss.virtual",
+ org.springframework.core.io.support,
  org.springframework.core.type.classreading,
+ org.springframework.jdbc.datasource,
  org.springframework.orm.hibernate3;
   uses:="org.apache.commons.logging,
    org.aopalliance.intercept,
@@ -362,14 +408,19 @@ Export-Package: com.google.api,
    org.springframework.dao,
    org.springframework.transaction.support",
  org.springframework.orm.hibernate4,
+ org.springframework.remoting,
+ org.springframework.remoting.httpinvoker,
+ org.springframework.remoting.support,
  org.springframework.security.access,
  org.springframework.security.authentication,
+ org.springframework.security.authentication.dao,
+ org.springframework.security.authentication.encoding,
  org.springframework.security.authentication.event,
+ org.springframework.security.config,
  org.springframework.security.core,
  org.springframework.security.core.context,
  org.springframework.security.core.userdetails,
  org.springframework.security.provisioning,
- org.springframework.security.remoting.httpinvoker,
  org.springframework.stereotype,
  org.springframework.transaction;uses:="org.springframework.core",
  org.springframework.transaction.annotation;uses:="javax.ejb,org.springframework.transaction.interceptor",
@@ -401,6 +452,7 @@ Export-Package: com.google.api,
    org.springframework.transaction,
    org.apache.commons.logging,
    org.springframework.beans.factory",
+ org.springframework.util,
  org.springframework.web.servlet;
   uses:="org.springframework.web.multipart,
    org.apache.commons.logging,
@@ -415,22 +467,25 @@ Export-Package: com.google.api,
    org.springframework.ui,
    javax.servlet.http"
 Bundle-Vendor: EDIT
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
 Require-Bundle: org.eclipse.osgi,
- org.eclipse.equinox.common
+ org.eclipse.equinox.common,
+ org.apache.commons.httpclient;bundle-version="3.1.0",
+ org.eclipse.core.runtime
 Bundle-ClassPath: .,
  lib/activation-1.1.1.jar,
  lib/antlr-2.7.7.jar,
  lib/aopalliance-1.0.jar,
- lib/aspectjrt-1.7.1.jar,
- lib/aspectjweaver-1.7.1.jar,
+ lib/apache-log4j-extras-1.2.17.jar,
+ lib/aspectjrt-1.8.8.jar,
+ lib/aspectjweaver-1.8.8.jar,
  lib/avro-1.6.3.jar,
  lib/batik-anim-1.7.jar,
  lib/batik-awt-util-1.7.jar,
  lib/batik-bridge-1.7.jar,
  lib/batik-css-1.7.jar,
  lib/batik-dom-1.7.jar,
- lib/batik-ext-1.7.jar,
+ lib/batik-ext-1.8.jar,
  lib/batik-extension-1.7.jar,
  lib/batik-gvt-1.7.jar,
  lib/batik-js-1.7.jar,
@@ -441,183 +496,224 @@ Bundle-ClassPath: .,
  lib/batik-transcoder-1.7.jar,
  lib/batik-util-1.7.jar,
  lib/batik-xml-1.7.jar,
- lib/c3p0-0.9.2.jar,
- lib/cglib-nodep-2.2.2.jar,
+ lib/c3p0-0.9.5.2.jar,
+ lib/cdmlib-commons-4.0.0-SNAPSHOT.jar,
+ lib/cdmlib-ext-4.0.0-SNAPSHOT.jar,
+ lib/cdmlib-io-4.0.0-SNAPSHOT.jar,
+ lib/cdmlib-model-4.0.0-SNAPSHOT.jar,
+ lib/cdmlib-persistence-4.0.0-SNAPSHOT.jar,
+ lib/cdmlib-print-4.0.0-SNAPSHOT.jar,
+ lib/cdmlib-remote-4.0.0-SNAPSHOT.jar,
+ lib/cdmlib-services-4.0.0-SNAPSHOT.jar,
+ lib/cdmlib-test-4.0.0-SNAPSHOT.jar,
+ lib/cglib-3.2.0.jar,
+ lib/cglib-nodep-3.2.0.jar,
+ lib/classmate-1.3.1.jar,
+ lib/codemodel-2.2.11.jar,
  lib/com.springsource.org.aopalliance-1.0.0.jar,
  lib/com.springsource.org.apache.commons.logging-1.1.1.jar,
- lib/commons-beanutils-1.8.3.jar,
- lib/commons-codec-20041127.091804.jar,
- lib/commons-collections-3.2.1.jar,
+ lib/commons-beanutils-1.9.2.jar,
+ lib/commons-codec-1.10.jar,
+ lib/commons-collections-3.2.2.jar,
+ lib/commons-csv-1.0.jar,
  lib/commons-dbcp-1.4.jar,
  lib/commons-io-2.4.jar,
  lib/commons-lang-2.6.jar,
- lib/commons-logging-1.1.2.jar,
+ lib/commons-lang3-3.3.2.jar,
+ lib/commons-logging-1.2.jar,
  lib/commons-pool-1.5.4.jar,
  lib/concurrent-1.3.4.jar,
  lib/dbunit-2.4.9.jar,
  lib/dom4j-1.6.1.jar,
- lib/doxia-core-1.3.jar,
- lib/doxia-logging-api-1.3.jar,
- lib/doxia-module-apt-1.3.jar,
- lib/doxia-module-xhtml-1.3.jar,
- lib/doxia-sink-api-1.3.jar,
+ lib/doxia-core-1.6.jar,
+ lib/doxia-logging-api-1.6.jar,
+ lib/doxia-module-apt-1.6.jar,
+ lib/doxia-module-xhtml-1.6.jar,
+ lib/doxia-sink-api-1.6.jar,
  lib/dozer-5.3.0.jar,
- lib/easymock-3.1.jar,
+ lib/dtd-parser-1.1.jar,
+ lib/easymock-2.3.jar,
  lib/easymockclassextension-2.3.jar,
- lib/ehcache-core-2.6.9.jar,
+ lib/ehcache-core-2.6.11.jar,
  lib/ezmorph-1.0.6.jar,
+ lib/FastInfoset-1.2.13.jar,
  lib/fop-1.1.jar,
- lib/guava-r05.jar,
- lib/h2-1.3.170.jar,
+ lib/google-api-translate-java-0.92.jar,
+ lib/guava-19.0.jar,
+ lib/h2-1.4.190.jar,
+ lib/h2mig_pagestore_addon.jar,
  lib/hamcrest-core-1.3.jar,
- lib/hibernate-c3p0-4.1.10.Final.jar,
+ lib/hibernate-c3p0-5.0.7.Final.jar,
  lib/hibernate-cglib-repack-2.1_3.jar,
- lib/hibernate-commons-annotations-4.0.1.Final.jar,
- lib/hibernate-core-4.1.10.Final.jar,
- lib/hibernate-ehcache-4.1.10.Final.jar,
- lib/hibernate-entitymanager-4.1.10.Final.jar,
- lib/hibernate-envers-4.1.10.Final.jar,
- lib/hibernate-jpa-2.0-api-1.0.1.Final.jar,
+ lib/hibernate-commons-annotations-5.0.1.Final.jar,
+ lib/hibernate-core-5.0.7.Final.jar,
+ lib/hibernate-ehcache-5.0.7.Final.jar,
+ lib/hibernate-entitymanager-5.0.7.Final.jar,
+ lib/hibernate-envers-5.0.7.Final.jar,
+ lib/hibernate-jpa-2.1-api-1.0.0.Final.jar,
  lib/hibernate-search-4.2.0.Final.jar,
  lib/hibernate-search-analyzers-4.2.0.Final.jar,
- lib/hibernate-search-engine-4.2.0.Final.jar,
- lib/hibernate-search-orm-4.2.0.Final.jar,
- lib/hibernate-validator-4.3.1.Final.jar,
- lib/hsqldb-1.8.0.10.jar,
- lib/httpclient-4.2.3.jar,
- lib/httpcore-4.2.4.jar,
+ lib/hibernate-search-engine-5.5.2.Final.jar,
+ lib/hibernate-search-orm-5.5.2.Final.jar,
+ lib/hibernate-validator-5.2.2.Final.jar,
+ lib/hibernate-validator-cdi-5.2.2.Final.jar,
+ lib/hsqldb-2.3.3.jar,
+ lib/httpclient-4.5.1.jar,
+ lib/httpclient-cache-4.2.6.jar,
+ lib/httpcore-4.4.4.jar,
+ lib/httpmime-4.5.1.jar,
  lib/icu4j-2.6.1.jar,
- lib/identificationKeyAPI-1.0-SNAPSHOT-sources.jar,
- lib/identificationKeyAPI-1.0-SNAPSHOT.jar,
- lib/itextpdf-5.4.0.jar,
+ lib/identificationKeyAPI-1.0.jar,
+ lib/istack-commons-runtime-2.21.jar,
+ lib/istack-commons-tools-2.21.jar,
+ lib/itextpdf-5.5.8.jar,
+ lib/jackson-annotations-2.6.5.jar,
+ lib/jackson-core-2.6.5.jar,
  lib/jackson-core-asl-1.8.8.jar,
+ lib/jackson-databind-2.6.5.jar,
  lib/jackson-mapper-asl-1.8.8.jar,
  lib/jakarta-regexp-1.4.jar,
- lib/javassist-3.17.1-GA.jar,
- lib/jaxb-api-2.2.7.jar,
- lib/jaxb-impl-2.2-EA.jar,
- lib/jaxb-xjc-2.2-EA.jar,
+ lib/jandex-2.0.0.Final.jar,
+ lib/javassist-3.20.0-GA.jar,
+ lib/javax.el-2.2.6.jar,
+ lib/javax.el-api-2.2.5.jar,
+ lib/javax.servlet-api-3.1.0.jar,
+ lib/jaxb-api-2.2.12.jar,
+ lib/jaxb-core-2.2.11.jar,
+ lib/jaxb-jxc-2.2.11.jar,
+ lib/jaxb-runtime-2.2.11.jar,
+ lib/jaxb-xjc-2.2.11.jar,
  lib/jaxb1-impl-2.2-EA.jar,
  lib/jaxen-1.1.4.jar,
- lib/jboss-logging-3.1.3.GA.jar,
+ lib/jaxen-1.1.6.jar,
+ lib/jboss-logging-3.3.0.Final.jar,
  lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar,
+ lib/jcl-over-slf4j-1.7.6.jar,
  lib/jdbc4-2.0.jar,
  lib/jdom-1.1.3.jar,
- lib/joda-time-2.1.jar,
+ lib/jdom2-2.0.6.jar,
+ lib/jena-arq-2.13.0.jar,
+ lib/jena-core-2.13.0.jar,
+ lib/jena-iri-1.1.2.jar,
+ lib/jena-tdb-1.1.2.jar,
+ lib/joda-time-2.9.1.jar,
+ lib/json-20090211.jar,
  lib/json-lib-2.4-jdk15.jar,
+ lib/jsonld-java-0.5.1.jar,
  lib/jsr250-api-1.0.jar,
- lib/jtds-1.3.0.jar,
- lib/junit-4.11.jar,
- lib/junit-benchmarks-0.5.0.jar,
+ lib/jta-1.1.jar,
+ lib/jtds-1.3.1.jar,
+ lib/junit-4.12.jar,
+ lib/junit-benchmarks-0.7.2.jar,
+ lib/libthrift-0.9.2.jar,
  lib/log4j-1.2.17.jar,
  lib/lsid-client-1.1.2.jar,
  lib/lsid-server-1.1.2.jar,
- lib/lucene-analyzers-3.6.2.jar,
- lib/lucene-core-3.6.2.jar,
- lib/lucene-facet-3.6.2.jar,
- lib/lucene-grouping-3.6.2.jar,
- lib/lucene-highlighter-3.6.2.jar,
- lib/lucene-kuromoji-3.6.2.jar,
- lib/lucene-memory-3.6.2.jar,
- lib/lucene-misc-3.6.2.jar,
- lib/lucene-phonetic-3.6.2.jar,
- lib/lucene-queries-3.6.2.jar,
- lib/lucene-smartcn-3.6.2.jar,
- lib/lucene-spatial-3.6.2.jar,
- lib/lucene-spellchecker-3.6.2.jar,
- lib/lucene-stempel-3.6.2.jar,
- lib/mchange-commons-java-0.2.3.3.jar,
- lib/mysql-connector-java-5.1.24.jar,
+ lib/lucene-analyzers-common-5.4.1.jar,
+ lib/lucene-backward-codecs-5.4.1.jar,
+ lib/lucene-core-5.4.1.jar,
+ lib/lucene-facet-5.4.1.jar,
+ lib/lucene-grouping-5.4.1.jar,
+ lib/lucene-highlighter-5.4.1.jar,
+ lib/lucene-join-5.4.1.jar,
+ lib/lucene-memory-5.4.1.jar,
+ lib/lucene-misc-5.4.1.jar,
+ lib/lucene-queries-5.4.1.jar,
+ lib/lucene-queryparser-5.4.1.jar,
+ lib/lucene-sandbox-5.4.1.jar,
+ lib/lucene-suggest-5.4.1.jar,
+ lib/mapstruct-1.0.0.Final.jar,
+ lib/mchange-commons-java-0.2.11.jar,
+ lib/mysql-connector-java-5.1.38.jar,
  lib/objenesis-1.2.jar,
+ lib/odfdom-0.8.jar,
  lib/odfdom-java-0.8.7.jar,
  lib/ognl-2.6.9.jar,
  lib/opencsv-2.3.jar,
- lib/org.eclipse.equinox.common-3.6.0.v20110523.jar,
- lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar,
  lib/org.osgi.core-1.0.0.jar,
- lib/org.springframework.aop-3.2.2.RELEASE.jar,
- lib/org.springframework.aspects-3.2.2.RELEASE.jar,
- lib/org.springframework.beans-3.2.2.RELEASE.jar,
- lib/org.springframework.context-3.2.2.RELEASE.jar,
- lib/org.springframework.core-3.2.2.RELEASE.jar,
- lib/org.springframework.expression-3.2.2.RELEASE.jar,
- lib/org.springframework.jdbc-3.2.2.RELEASE.jar,
- lib/org.springframework.orm-3.2.2.RELEASE.jar,
- lib/org.springframework.oxm-3.2.2.RELEASE.jar,
- lib/org.springframework.test-3.2.2.RELEASE.jar,
- lib/org.springframework.transaction-3.2.2.RELEASE.jar,
- lib/org.springframework.web-3.2.2.RELEASE.jar,
- lib/org.springframework.web.servlet-3.2.2.RELEASE.jar,
  lib/osgi-3.6.0.jar,
- lib/p6spy-1.3.jar,
+ lib/p6spy-2.1.4.jar,
  lib/paranamer-2.3.jar,
  lib/plexus-classworlds-1.2-alpha-9.jar,
+ lib/plexus-component-annotations-1.5.5.jar,
  lib/plexus-container-default-1.0-alpha-30.jar,
- lib/plexus-utils-2.0.5.jar,
- lib/postgresql-9.1-901.jdbc4.jar,
+ lib/plexus-utils-3.0.15.jar,
+ lib/poi-3.13.jar,
+ lib/poi-ooxml-3.13.jar,
+ lib/poi-ooxml-schemas-3.13.jar,
+ lib/postgresql-9.4-1206-jdbc4.jar,
+ lib/relaxngDatatype-20020414.jar,
+ lib/rngom-2.2.11.jar,
  lib/sanselan-0.97-incubator.jar,
+ lib/Saxon-HE-9.7.0-2.jar,
  lib/servlet-api-2.5.jar,
- lib/slf4j-api-1.7.2.jar,
- lib/slf4j-log4j12-1.7.2.jar,
+ lib/slf4j-api-1.7.13.jar,
+ lib/slf4j-log4j12-1.7.13.jar,
+ lib/slf4j-nop-1.7.13.jar,
  lib/snappy-java-1.0.4.1.jar,
  lib/solr-analysis-extras-3.6.2.jar,
  lib/solr-core-3.6.2.jar,
  lib/solr-solrj-3.6.2.jar,
- lib/spring-aop-3.2.2.RELEASE.jar,
- lib/spring-beans-3.2.2.RELEASE.jar,
- lib/spring-context-3.2.2.RELEASE.jar,
- lib/spring-context-support-3.2.2.RELEASE.jar,
- lib/spring-core-3.2.2.RELEASE.jar,
- lib/spring-expression-3.2.2.RELEASE.jar,
+ lib/spring-aop-4.2.4.RELEASE.jar,
+ lib/spring-aspects-4.2.4.RELEASE.jar,
+ lib/spring-beans-4.2.4.RELEASE.jar,
+ lib/spring-context-4.2.4.RELEASE.jar,
+ lib/spring-context-support-4.2.4.RELEASE.jar,
+ lib/spring-core-4.2.4.RELEASE.jar,
+ lib/spring-expression-4.2.4.RELEASE.jar,
+ lib/spring-jdbc-4.2.4.RELEASE.jar,
  lib/spring-modules-cache-0.7.jar,
- lib/spring-security-config-3.1.3.RELEASE.jar,
- lib/spring-security-core-3.1.3.RELEASE.jar,
+ lib/spring-orm-4.2.4.RELEASE.jar,
+ lib/spring-oxm-4.2.4.RELEASE.jar,
+ lib/spring-plugin-core-1.2.0.RELEASE.jar,
+ lib/spring-plugin-metadata-1.2.0.RELEASE.jar,
+ lib/spring-security-config-4.0.3.RELEASE.jar,
+ lib/spring-security-core-4.0.3.RELEASE.jar,
+ lib/spring-security-web-4.0.3.RELEASE.jar,
+ lib/spring-test-4.2.4.RELEASE.jar,
+ lib/spring-tx-4.2.4.RELEASE.jar,
+ lib/spring-web-4.2.4.RELEASE.jar,
+ lib/spring-webmvc-4.2.4.RELEASE.jar,
+ lib/springfox-core-2.3.1.jar,
+ lib/springfox-schema-2.3.1.jar,
+ lib/springfox-spi-2.3.1.jar,
+ lib/springfox-spring-web-2.3.1.jar,
+ lib/springfox-swagger-common-2.3.1.jar,
+ lib/springfox-swagger2-2.3.1.jar,
+ lib/standard-1.1.2.jar,
  lib/stax-1.2.0.jar,
  lib/stax-api-1.0.1.jar,
- lib/unitils-core-3.3.jar,
- lib/unitils-database-3.3.jar,
- lib/unitils-dbmaintainer-3.3.jar,
- lib/unitils-dbunit-3.3.jar,
- lib/unitils-easymock-3.3.jar,
- lib/unitils-inject-3.3.jar,
- lib/unitils-mock-3.3.jar,
- lib/unitils-orm-3.3.jar,
- lib/unitils-spring-3.3.jar,
+ lib/stax-ex-1.7.7.jar,
+ lib/swagger-annotations-1.5.6.jar,
+ lib/swagger-models-1.5.5.jar,
+ lib/tools.jar,
+ lib/txw2-2.2.11.jar,
+ lib/unitils-core-3.4.2.jar,
+ lib/unitils-database-3.4.2.jar,
+ lib/unitils-dbmaintainer-3.4.2.jar,
+ lib/unitils-dbunit-3.4.2.jar,
+ lib/unitils-easymock-3.4.2.jar,
+ lib/unitils-inject-3.4.2.jar,
+ lib/unitils-mock-3.4.2.jar,
+ lib/unitils-orm-3.4.2.jar,
+ lib/unitils-spring-3.4.2.jar,
  lib/usertype.jodatime-2.0.1.jar,
  lib/usertype.spi-2.0.1.jar,
- lib/validation-api-1.0.0.GA.jar,
- lib/wsdl4j-1.6.2.jar,
- lib/xalan-2.6.0.jar,
+ lib/validation-api-1.1.0.Final.jar,
+ lib/wsdl4j-1.6.3.jar,
+ lib/xalan-2.7.0.jar,
  lib/xercesImpl-2.11.0.jar,
  lib/xml-apis-1.0.b2.jar,
  lib/xml-apis-ext-1.3.04.jar,
  lib/xml-resolver-1.2.jar,
+ lib/xmlbeans-2.6.0.jar,
  lib/xmlgraphics-commons-1.5.jar,
- lib/xmlParserAPIs-2.6.2.jar,
  lib/xmlpull-1.1.3.1.jar,
- lib/xmlunit-1.4.jar,
- lib/xom-1.0.jar,
+ lib/xmlunit-1.6.jar,
+ lib/xom-1.2.5.jar,
  lib/xpp3_min-1.1.4c.jar,
  lib/xpp3-1.1.4c.jar,
- lib/xstream-1.4.4.jar,
- lib/yjp-controller-api-redist-9.0.8.jar,
- lib/google-api-translate-java-0.92.jar,
- lib/odfdom-0.8.jar,
- lib/h2mig_pagestore_addon.jar,
- lib/spring-security-remoting-3.1.3.RELEASE.jar,
- lib/jena-core-2.11.2.jar,
- lib/jena-iri-1.0.2.jar,
- lib/poi-3.10-FINAL.jar,
- lib/poi-ooxml-3.10-FINAL.jar,
- lib/xmlbeans-2.3.0.jar,
- lib/poi-ooxml-schemas-3.10-FINAL.jar,
- lib/swagger-annotations-1.3.5.jar,
- lib/cdmlib-commons-3.8.0-SNAPSHOT.jar,
- lib/cdmlib-ext-3.8.0-SNAPSHOT.jar,
- lib/cdmlib-io-3.8.0-SNAPSHOT.jar,
- lib/cdmlib-model-3.8.0-SNAPSHOT.jar,
- lib/cdmlib-persistence-3.8.0-SNAPSHOT.jar,
- lib/cdmlib-print-3.8.0-SNAPSHOT.jar,
- lib/cdmlib-remote-3.8.0-SNAPSHOT.jar,
- lib/cdmlib-services-3.8.0-SNAPSHOT.jar
+ lib/xsom-20140925.jar,
+ lib/xstream-1.4.8.jar,
+ lib/yjp-controller-api-redist-9.0.8.jar
 Import-Package: eu.etaxonomy.cdm.api.application
index 3ce2b145dd7c8b8dc21f692f8634b554f9f4e799..62c612144bc0df70e78e3e52f82ac625b5c7623f 100644 (file)
-bin.includes = META-INF/,\\r
-               .,\\r
-               lib/activation-1.1.1.jar,\\r
-               lib/antlr-2.7.7.jar,\\r
-               lib/aopalliance-1.0.jar,\\r
-               lib/aspectjrt-1.7.1.jar,\\r
-               lib/aspectjweaver-1.7.1.jar,\\r
-               lib/avro-1.6.3.jar,\\r
-               lib/batik-anim-1.7.jar,\\r
-               lib/batik-awt-util-1.7.jar,\\r
-               lib/batik-bridge-1.7.jar,\\r
-               lib/batik-css-1.7.jar,\\r
-               lib/batik-dom-1.7.jar,\\r
-               lib/batik-ext-1.7.jar,\\r
-               lib/batik-extension-1.7.jar,\\r
-               lib/batik-gvt-1.7.jar,\\r
-               lib/batik-js-1.7.jar,\\r
-               lib/batik-parser-1.7.jar,\\r
-               lib/batik-script-1.7.jar,\\r
-               lib/batik-svg-dom-1.7.jar,\\r
-               lib/batik-svggen-1.7.jar,\\r
-               lib/batik-transcoder-1.7.jar,\\r
-               lib/batik-util-1.7.jar,\\r
-               lib/batik-xml-1.7.jar,\\r
-               lib/c3p0-0.9.2.jar,\\r
-               lib/cglib-nodep-2.2.2.jar,\\r
-               lib/com.springsource.org.aopalliance-1.0.0.jar,\\r
-               lib/com.springsource.org.apache.commons.logging-1.1.1.jar,\\r
-               lib/commons-beanutils-1.8.3.jar,\\r
-               lib/commons-codec-20041127.091804.jar,\\r
-               lib/commons-collections-3.2.1.jar,\\r
-               lib/commons-dbcp-1.4.jar,\\r
-               lib/commons-io-2.4.jar,\\r
-               lib/commons-lang-2.6.jar,\\r
-               lib/commons-logging-1.1.2.jar,\\r
-               lib/commons-pool-1.5.4.jar,\\r
-               lib/concurrent-1.3.4.jar,\\r
-               lib/dbunit-2.4.9.jar,\\r
-               lib/dom4j-1.6.1.jar,\\r
-               lib/doxia-core-1.3.jar,\\r
-               lib/doxia-logging-api-1.3.jar,\\r
-               lib/doxia-module-apt-1.3.jar,\\r
-               lib/doxia-module-xhtml-1.3.jar,\\r
-               lib/doxia-sink-api-1.3.jar,\\r
-               lib/dozer-5.3.0.jar,\\r
-               lib/easymock-3.1.jar,\\r
-               lib/easymockclassextension-2.3.jar,\\r
-               lib/ehcache-core-2.6.9.jar,\\r
-               lib/ezmorph-1.0.6.jar,\\r
-               lib/fop-1.1.jar,\\r
-               lib/guava-r05.jar,\\r
-               lib/h2-1.3.170.jar,\\r
-               lib/hamcrest-core-1.3.jar,\\r
-               lib/hibernate-c3p0-4.1.10.Final.jar,\\r
-               lib/hibernate-cglib-repack-2.1_3.jar,\\r
-               lib/hibernate-commons-annotations-4.0.1.Final.jar,\\r
-               lib/hibernate-core-4.1.10.Final.jar,\\r
-               lib/hibernate-ehcache-4.1.10.Final.jar,\\r
-               lib/hibernate-entitymanager-4.1.10.Final.jar,\\r
-               lib/hibernate-envers-4.1.10.Final.jar,\\r
-               lib/hibernate-jpa-2.0-api-1.0.1.Final.jar,\\r
-               lib/hibernate-search-4.2.0.Final.jar,\\r
-               lib/hibernate-search-analyzers-4.2.0.Final.jar,\\r
-               lib/hibernate-search-engine-4.2.0.Final.jar,\\r
-               lib/hibernate-search-orm-4.2.0.Final.jar,\\r
-               lib/hibernate-validator-4.3.1.Final.jar,\\r
-               lib/hsqldb-1.8.0.10.jar,\\r
-               lib/httpclient-4.2.3.jar,\\r
-               lib/httpcore-4.2.4.jar,\\r
-               lib/icu4j-2.6.1.jar,\\r
-               lib/identificationKeyAPI-1.0-SNAPSHOT-sources.jar,\\r
-               lib/identificationKeyAPI-1.0-SNAPSHOT.jar,\\r
-               lib/itextpdf-5.4.0.jar,\\r
-               lib/jackson-core-asl-1.8.8.jar,\\r
-               lib/jackson-mapper-asl-1.8.8.jar,\\r
-               lib/jakarta-regexp-1.4.jar,\\r
-               lib/javassist-3.17.1-GA.jar,\\r
-               lib/jaxb-api-2.2.7.jar,\\r
-               lib/jaxb-impl-2.2-EA.jar,\\r
-               lib/jaxb-xjc-2.2-EA.jar,\\r
-               lib/jaxb1-impl-2.2-EA.jar,\\r
-               lib/jaxen-1.1.4.jar,\\r
-               lib/jboss-logging-3.1.3.GA.jar,\\r
-               lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar,\\r
-               lib/jdbc4-2.0.jar,\\r
-               lib/jdom-1.1.3.jar,\\r
-               lib/joda-time-2.1.jar,\\r
-               lib/json-lib-2.4-jdk15.jar,\\r
-               lib/jsr250-api-1.0.jar,\\r
-               lib/jtds-1.3.0.jar,\\r
-               lib/junit-4.11.jar,\\r
-               lib/junit-benchmarks-0.5.0.jar,\\r
-               lib/log4j-1.2.17.jar,\\r
-               lib/lsid-client-1.1.2.jar,\\r
-               lib/lsid-server-1.1.2.jar,\\r
-               lib/lucene-analyzers-3.6.2.jar,\\r
-               lib/lucene-core-3.6.2.jar,\\r
-               lib/lucene-facet-3.6.2.jar,\\r
-               lib/lucene-grouping-3.6.2.jar,\\r
-               lib/lucene-highlighter-3.6.2.jar,\\r
-               lib/lucene-kuromoji-3.6.2.jar,\\r
-               lib/lucene-memory-3.6.2.jar,\\r
-               lib/lucene-misc-3.6.2.jar,\\r
-               lib/lucene-phonetic-3.6.2.jar,\\r
-               lib/lucene-queries-3.6.2.jar,\\r
-               lib/lucene-smartcn-3.6.2.jar,\\r
-               lib/lucene-spatial-3.6.2.jar,\\r
-               lib/lucene-spellchecker-3.6.2.jar,\\r
-               lib/lucene-stempel-3.6.2.jar,\\r
-               lib/mchange-commons-java-0.2.3.3.jar,\\r
-               lib/mysql-connector-java-5.1.24.jar,\\r
-               lib/objenesis-1.2.jar,\\r
-               lib/odfdom-java-0.8.7.jar,\\r
-               lib/ognl-2.6.9.jar,\\r
-               lib/opencsv-2.3.jar,\\r
-               lib/org.eclipse.equinox.common-3.6.0.v20110523.jar,\\r
-               lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar,\\r
-               lib/org.osgi.core-1.0.0.jar,\\r
-               lib/org.springframework.aop-3.2.2.RELEASE.jar,\\r
-               lib/org.springframework.aspects-3.2.2.RELEASE.jar,\\r
-               lib/org.springframework.beans-3.2.2.RELEASE.jar,\\r
-               lib/org.springframework.context-3.2.2.RELEASE.jar,\\r
-               lib/org.springframework.core-3.2.2.RELEASE.jar,\\r
-               lib/org.springframework.expression-3.2.2.RELEASE.jar,\\r
-               lib/org.springframework.jdbc-3.2.2.RELEASE.jar,\\r
-               lib/org.springframework.orm-3.2.2.RELEASE.jar,\\r
-               lib/org.springframework.oxm-3.2.2.RELEASE.jar,\\r
-               lib/org.springframework.test-3.2.2.RELEASE.jar,\\r
-               lib/org.springframework.transaction-3.2.2.RELEASE.jar,\\r
-               lib/org.springframework.web-3.2.2.RELEASE.jar,\\r
-               lib/org.springframework.web.servlet-3.2.2.RELEASE.jar,\\r
-               lib/osgi-3.6.0.jar,\\r
-               lib/p6spy-1.3.jar,\\r
-               lib/paranamer-2.3.jar,\\r
-               lib/plexus-classworlds-1.2-alpha-9.jar,\\r
-               lib/plexus-container-default-1.0-alpha-30.jar,\\r
-               lib/plexus-utils-2.0.5.jar,\\r
-               lib/postgresql-9.1-901.jdbc4.jar,\\r
-               lib/sanselan-0.97-incubator.jar,\\r
-               lib/servlet-api-2.5.jar,\\r
-               lib/slf4j-api-1.7.2.jar,\\r
-               lib/slf4j-log4j12-1.7.2.jar,\\r
-               lib/snappy-java-1.0.4.1.jar,\\r
-               lib/solr-analysis-extras-3.6.2.jar,\\r
-               lib/solr-core-3.6.2.jar,\\r
-               lib/solr-solrj-3.6.2.jar,\\r
-               lib/spring-aop-3.2.2.RELEASE.jar,\\r
-               lib/spring-beans-3.2.2.RELEASE.jar,\\r
-               lib/spring-context-3.2.2.RELEASE.jar,\\r
-               lib/spring-context-support-3.2.2.RELEASE.jar,\\r
-               lib/spring-core-3.2.2.RELEASE.jar,\\r
-               lib/spring-expression-3.2.2.RELEASE.jar,\\r
-               lib/spring-modules-cache-0.7.jar,\\r
-               lib/spring-security-config-3.1.3.RELEASE.jar,\\r
-               lib/spring-security-core-3.1.3.RELEASE.jar,\\r
-               lib/stax-1.2.0.jar,\\r
-               lib/stax-api-1.0.1.jar,\\r
-               lib/unitils-core-3.3.jar,\\r
-               lib/unitils-database-3.3.jar,\\r
-               lib/unitils-dbmaintainer-3.3.jar,\\r
-               lib/unitils-dbunit-3.3.jar,\\r
-               lib/unitils-easymock-3.3.jar,\\r
-               lib/unitils-inject-3.3.jar,\\r
-               lib/unitils-mock-3.3.jar,\\r
-               lib/unitils-orm-3.3.jar,\\r
-               lib/unitils-spring-3.3.jar,\\r
-               lib/usertype.jodatime-2.0.1.jar,\\r
-               lib/usertype.spi-2.0.1.jar,\\r
-               lib/validation-api-1.0.0.GA.jar,\\r
-               lib/wsdl4j-1.6.2.jar,\\r
-               lib/xalan-2.6.0.jar,\\r
-               lib/xercesImpl-2.11.0.jar,\\r
-               lib/xml-apis-1.0.b2.jar,\\r
-               lib/xml-apis-ext-1.3.04.jar,\\r
-               lib/xml-resolver-1.2.jar,\\r
-               lib/xmlgraphics-commons-1.5.jar,\\r
-               lib/xmlParserAPIs-2.6.2.jar,\\r
-               lib/xmlpull-1.1.3.1.jar,\\r
-               lib/xmlunit-1.4.jar,\\r
-               lib/xom-1.0.jar,\\r
-               lib/xpp3_min-1.1.4c.jar,\\r
-               lib/xpp3-1.1.4c.jar,\\r
-               lib/xstream-1.4.4.jar,\\r
-               lib/yjp-controller-api-redist-9.0.8.jar,\\r
-               lib/google-api-translate-java-0.92.jar,\\r
-               lib/odfdom-0.8.jar,\\r
-               lib/h2mig_pagestore_addon.jar,\\r
-               lib/spring-security-remoting-3.1.3.RELEASE.jar,\\r
-               lib/spring-security-remoting-3.1.3.RELEASE.jar,\\r
-               lib/jena-core-2.11.2.jar,\\r
-               lib/jena-iri-1.0.2.jar,\\r
-               lib/poi-3.10-FINAL.jar,\\r
-               lib/poi-ooxml-3.10-FINAL.jar,\\r
-               lib/poi-ooxml-schemas-3.10-FINAL.jar,\\r
-               lib/xmlbeans-2.3.0.jar,\\r
-               lib/swagger-annotations-1.3.5.jar,\\r
-               lib/cdmlib-commons-3.8.0-SNAPSHOT.jar,\\r
-               lib/cdmlib-ext-3.8.0-SNAPSHOT.jar,\\r
-               lib/cdmlib-io-3.8.0-SNAPSHOT.jar,\\r
-               lib/cdmlib-model-3.8.0-SNAPSHOT.jar,\\r
-               lib/cdmlib-persistence-3.8.0-SNAPSHOT.jar,\\r
-               lib/cdmlib-print-3.8.0-SNAPSHOT.jar,\\r
-               lib/cdmlib-remote-3.8.0-SNAPSHOT.jar,\\r
-               lib/cdmlib-services-3.8.0-SNAPSHOT.jar\r
-\r
-jars.compile.order = .\r
-output.. = bin/\r
-source.. = src/main/java/,\\r
-           src/main/resources/,\\r
-           src/test/java/\r
-src.includes = src/\r
-\r
+bin.includes = META-INF/,\
+               .,\
+               resources/cdm.map.ser,\
+               lib/activation-1.1.1.jar,\
+               lib/antlr-2.7.7.jar,\
+               lib/aopalliance-1.0.jar,\
+               lib/apache-log4j-extras-1.2.17.jar,\
+               lib/aspectjrt-1.8.8.jar,\
+               lib/aspectjweaver-1.8.8.jar,\
+               lib/avro-1.6.3.jar,\
+               lib/batik-anim-1.7.jar,\
+               lib/batik-awt-util-1.7.jar,\
+               lib/batik-bridge-1.7.jar,\
+               lib/batik-css-1.7.jar,\
+               lib/batik-dom-1.7.jar,\
+               lib/batik-ext-1.8.jar,\
+               lib/batik-extension-1.7.jar,\
+               lib/batik-gvt-1.7.jar,\
+               lib/batik-js-1.7.jar,\
+               lib/batik-parser-1.7.jar,\
+               lib/batik-script-1.7.jar,\
+               lib/batik-svg-dom-1.7.jar,\
+               lib/batik-svggen-1.7.jar,\
+               lib/batik-transcoder-1.7.jar,\
+               lib/batik-util-1.7.jar,\
+               lib/batik-xml-1.7.jar,\
+               lib/c3p0-0.9.5.2.jar,\
+               lib/cdmlib-commons-4.0.0-SNAPSHOT.jar,\
+               lib/cdmlib-ext-4.0.0-SNAPSHOT.jar,\
+               lib/cdmlib-io-4.0.0-SNAPSHOT.jar,\
+               lib/cdmlib-model-4.0.0-SNAPSHOT.jar,\
+               lib/cdmlib-persistence-4.0.0-SNAPSHOT.jar,\
+               lib/cdmlib-print-4.0.0-SNAPSHOT.jar,\
+               lib/cdmlib-remote-4.0.0-SNAPSHOT.jar,\
+               lib/cdmlib-services-4.0.0-SNAPSHOT.jar,\
+               lib/cdmlib-test-4.0.0-SNAPSHOT.jar,\
+               lib/cglib-3.2.0.jar,\
+               lib/cglib-nodep-3.2.0.jar,\
+               lib/classmate-1.3.1.jar,\
+               lib/codemodel-2.2.11.jar,\
+               lib/com.springsource.org.aopalliance-1.0.0.jar,\
+               lib/com.springsource.org.apache.commons.logging-1.1.1.jar,\
+               lib/commons-beanutils-1.9.2.jar,\
+               lib/commons-codec-1.10.jar,\
+               lib/commons-collections-3.2.2.jar,\
+               lib/commons-csv-1.0.jar,\
+               lib/commons-dbcp-1.4.jar,\
+               lib/commons-io-2.4.jar,\
+               lib/commons-lang-2.6.jar,\
+               lib/commons-lang3-3.3.2.jar,\
+               lib/commons-logging-1.2.jar,\
+               lib/commons-pool-1.5.4.jar,\
+               lib/concurrent-1.3.4.jar,\
+               lib/dbunit-2.4.9.jar,\
+               lib/dom4j-1.6.1.jar,\
+               lib/doxia-core-1.6.jar,\
+               lib/doxia-logging-api-1.6.jar,\
+               lib/doxia-module-apt-1.6.jar,\
+               lib/doxia-module-xhtml-1.6.jar,\
+               lib/doxia-sink-api-1.6.jar,\
+               lib/dozer-5.3.0.jar,\
+               lib/dtd-parser-1.1.jar,\
+               lib/easymock-2.3.jar,\
+               lib/easymockclassextension-2.3.jar,\
+               lib/ehcache-core-2.6.11.jar,\
+               lib/ezmorph-1.0.6.jar,\
+               lib/FastInfoset-1.2.13.jar,\
+               lib/fop-1.1.jar,\
+               lib/google-api-translate-java-0.92.jar,\
+               lib/guava-19.0.jar,\
+               lib/h2-1.4.190.jar,\
+               lib/h2mig_pagestore_addon.jar,\
+               lib/hamcrest-core-1.3.jar,\
+               lib/hibernate-c3p0-5.0.7.Final.jar,\
+               lib/hibernate-cglib-repack-2.1_3.jar,\
+               lib/hibernate-commons-annotations-5.0.1.Final.jar,\
+               lib/hibernate-core-5.0.7.Final.jar,\
+               lib/hibernate-ehcache-5.0.7.Final.jar,\
+               lib/hibernate-entitymanager-5.0.7.Final.jar,\
+               lib/hibernate-envers-5.0.7.Final.jar,\
+               lib/hibernate-jpa-2.1-api-1.0.0.Final.jar,\
+               lib/hibernate-search-4.2.0.Final.jar,\
+               lib/hibernate-search-analyzers-4.2.0.Final.jar,\
+               lib/hibernate-search-engine-5.5.2.Final.jar,\
+               lib/hibernate-search-orm-5.5.2.Final.jar,\
+               lib/hibernate-validator-5.2.2.Final.jar,\
+               lib/hibernate-validator-cdi-5.2.2.Final.jar,\
+               lib/hsqldb-2.3.3.jar,\
+               lib/httpclient-4.5.1.jar,\
+               lib/httpclient-cache-4.2.6.jar,\
+               lib/httpcore-4.4.4.jar,\
+               lib/httpmime-4.5.1.jar,\
+               lib/icu4j-2.6.1.jar,\
+               lib/identificationKeyAPI-1.0.jar,\
+               lib/istack-commons-runtime-2.21.jar,\
+               lib/istack-commons-tools-2.21.jar,\
+               lib/itextpdf-5.5.8.jar,\
+               lib/jackson-annotations-2.6.5.jar,\
+               lib/jackson-core-2.6.5.jar,\
+               lib/jackson-core-asl-1.8.8.jar,\
+               lib/jackson-databind-2.6.5.jar,\
+               lib/jackson-mapper-asl-1.8.8.jar,\
+               lib/jakarta-regexp-1.4.jar,\
+               lib/jandex-2.0.0.Final.jar,\
+               lib/javassist-3.20.0-GA.jar,\
+               lib/javax.el-2.2.6.jar,\
+               lib/javax.el-api-2.2.5.jar,\
+               lib/javax.servlet-api-3.1.0.jar,\
+               lib/jaxb-api-2.2.12.jar,\
+               lib/jaxb-core-2.2.11.jar,\
+               lib/jaxb-jxc-2.2.11.jar,\
+               lib/jaxb-runtime-2.2.11.jar,\
+               lib/jaxb-xjc-2.2.11.jar,\
+               lib/jaxb1-impl-2.2-EA.jar,\
+               lib/jaxen-1.1.4.jar,\
+               lib/jaxen-1.1.6.jar,\
+               lib/jboss-logging-3.3.0.Final.jar,\
+               lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar,\
+               lib/jcl-over-slf4j-1.7.6.jar,\
+               lib/jdbc4-2.0.jar,\
+               lib/jdom-1.1.3.jar,\
+               lib/jdom2-2.0.6.jar,\
+               lib/jena-arq-2.13.0.jar,\
+               lib/jena-core-2.13.0.jar,\
+               lib/jena-iri-1.1.2.jar,\
+               lib/jena-tdb-1.1.2.jar,\
+               lib/joda-time-2.9.1.jar,\
+               lib/json-20090211.jar,\
+               lib/json-lib-2.4-jdk15.jar,\
+               lib/jsonld-java-0.5.1.jar,\
+               lib/jsr250-api-1.0.jar,\
+               lib/jta-1.1.jar,\
+               lib/jtds-1.3.1.jar,\
+               lib/junit-4.12.jar,\
+               lib/junit-benchmarks-0.7.2.jar,\
+               lib/libthrift-0.9.2.jar,\
+               lib/log4j-1.2.17.jar,\
+               lib/lsid-client-1.1.2.jar,\
+               lib/lsid-server-1.1.2.jar,\
+               lib/lucene-analyzers-common-5.4.1.jar,\
+               lib/lucene-backward-codecs-5.4.1.jar,\
+               lib/lucene-core-5.4.1.jar,\
+               lib/lucene-facet-5.4.1.jar,\
+               lib/lucene-grouping-5.4.1.jar,\
+               lib/lucene-highlighter-5.4.1.jar,\
+               lib/lucene-join-5.4.1.jar,\
+               lib/lucene-memory-5.4.1.jar,\
+               lib/lucene-misc-5.4.1.jar,\
+               lib/lucene-queries-5.4.1.jar,\
+               lib/lucene-queryparser-5.4.1.jar,\
+               lib/lucene-sandbox-5.4.1.jar,\
+               lib/lucene-suggest-5.4.1.jar,\
+               lib/mapstruct-1.0.0.Final.jar,\
+               lib/mchange-commons-java-0.2.11.jar,\
+               lib/mysql-connector-java-5.1.38.jar,\
+               lib/objenesis-1.2.jar,\
+               lib/odfdom-0.8.jar,\
+               lib/odfdom-java-0.8.7.jar,\
+               lib/ognl-2.6.9.jar,\
+               lib/opencsv-2.3.jar,\
+               lib/org.osgi.core-1.0.0.jar,\
+               lib/osgi-3.6.0.jar,\
+               lib/p6spy-2.1.4.jar,\
+               lib/paranamer-2.3.jar,\
+               lib/plexus-classworlds-1.2-alpha-9.jar,\
+               lib/plexus-component-annotations-1.5.5.jar,\
+               lib/plexus-container-default-1.0-alpha-30.jar,\
+               lib/plexus-utils-3.0.15.jar,\
+               lib/poi-3.13.jar,\
+               lib/poi-ooxml-3.13.jar,\
+               lib/poi-ooxml-schemas-3.13.jar,\
+               lib/postgresql-9.4-1206-jdbc4.jar,\
+               lib/relaxngDatatype-20020414.jar,\
+               lib/rngom-2.2.11.jar,\
+               lib/sanselan-0.97-incubator.jar,\
+               lib/Saxon-HE-9.7.0-2.jar,\
+               lib/servlet-api-2.5.jar,\
+               lib/slf4j-api-1.7.13.jar,\
+               lib/slf4j-log4j12-1.7.13.jar,\
+               lib/slf4j-nop-1.7.13.jar,\
+               lib/snappy-java-1.0.4.1.jar,\
+               lib/solr-analysis-extras-3.6.2.jar,\
+               lib/solr-core-3.6.2.jar,\
+               lib/solr-solrj-3.6.2.jar,\
+               lib/spring-aop-4.2.4.RELEASE.jar,\
+               lib/spring-aspects-4.2.4.RELEASE.jar,\
+               lib/spring-beans-4.2.4.RELEASE.jar,\
+               lib/spring-context-4.2.4.RELEASE.jar,\
+               lib/spring-context-support-4.2.4.RELEASE.jar,\
+               lib/spring-core-4.2.4.RELEASE.jar,\
+               lib/spring-expression-4.2.4.RELEASE.jar,\
+               lib/spring-jdbc-4.2.4.RELEASE.jar,\
+               lib/spring-modules-cache-0.7.jar,\
+               lib/spring-orm-4.2.4.RELEASE.jar,\
+               lib/spring-oxm-4.2.4.RELEASE.jar,\
+               lib/spring-plugin-core-1.2.0.RELEASE.jar,\
+               lib/spring-plugin-metadata-1.2.0.RELEASE.jar,\
+               lib/spring-security-config-4.0.3.RELEASE.jar,\
+               lib/spring-security-core-4.0.3.RELEASE.jar,\
+               lib/spring-security-web-4.0.3.RELEASE.jar,\
+               lib/spring-test-4.2.4.RELEASE.jar,\
+               lib/spring-tx-4.2.4.RELEASE.jar,\
+               lib/spring-web-4.2.4.RELEASE.jar,\
+               lib/spring-webmvc-4.2.4.RELEASE.jar,\
+               lib/springfox-core-2.3.1.jar,\
+               lib/springfox-schema-2.3.1.jar,\
+               lib/springfox-spi-2.3.1.jar,\
+               lib/springfox-spring-web-2.3.1.jar,\
+               lib/springfox-swagger-common-2.3.1.jar,\
+               lib/springfox-swagger2-2.3.1.jar,\
+               lib/standard-1.1.2.jar,\
+               lib/stax-1.2.0.jar,\
+               lib/stax-api-1.0.1.jar,\
+               lib/stax-ex-1.7.7.jar,\
+               lib/swagger-annotations-1.5.6.jar,\
+               lib/swagger-models-1.5.5.jar,\
+               lib/tools.jar,\
+               lib/txw2-2.2.11.jar,\
+               lib/unitils-core-3.4.2.jar,\
+               lib/unitils-database-3.4.2.jar,\
+               lib/unitils-dbmaintainer-3.4.2.jar,\
+               lib/unitils-dbunit-3.4.2.jar,\
+               lib/unitils-easymock-3.4.2.jar,\
+               lib/unitils-inject-3.4.2.jar,\
+               lib/unitils-mock-3.4.2.jar,\
+               lib/unitils-orm-3.4.2.jar,\
+               lib/unitils-spring-3.4.2.jar,\
+               lib/usertype.jodatime-2.0.1.jar,\
+               lib/usertype.spi-2.0.1.jar,\
+               lib/validation-api-1.1.0.Final.jar,\
+               lib/wsdl4j-1.6.3.jar,\
+               lib/xalan-2.7.0.jar,\
+               lib/xercesImpl-2.11.0.jar,\
+               lib/xml-apis-1.0.b2.jar,\
+               lib/xml-apis-ext-1.3.04.jar,\
+               lib/xml-resolver-1.2.jar,\
+               lib/xmlbeans-2.6.0.jar,\
+               lib/xmlgraphics-commons-1.5.jar,\
+               lib/xmlpull-1.1.3.1.jar,\
+               lib/xmlunit-1.6.jar,\
+               lib/xom-1.2.5.jar,\
+               lib/xpp3_min-1.1.4c.jar,\
+               lib/xpp3-1.1.4c.jar,\
+               lib/xsom-20140925.jar,\
+               lib/xstream-1.4.8.jar,\
+               lib/yjp-controller-api-redist-9.0.8.jar
+
+jars.compile.order = .
+output.. = bin/
+source.. = src/main/java/,\
+           src/main/resources/
+src.includes = src/
+
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/FastInfoset-1.2.13.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/FastInfoset-1.2.13.jar
new file mode 100644 (file)
index 0000000..933e4ee
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/FastInfoset-1.2.13.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/Saxon-HE-9.7.0-2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/Saxon-HE-9.7.0-2.jar
new file mode 100644 (file)
index 0000000..83fc05a
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/Saxon-HE-9.7.0-2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/apache-log4j-extras-1.2.17.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/apache-log4j-extras-1.2.17.jar
new file mode 100644 (file)
index 0000000..b08d8d5
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/apache-log4j-extras-1.2.17.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/aspectjrt-1.7.1-sources.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/aspectjrt-1.7.1-sources.jar
deleted file mode 100644 (file)
index 21ffee7..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/aspectjrt-1.7.1-sources.jar and /dev/null differ
similarity index 52%
rename from eu.etaxonomy.taxeditor.cdmlib/lib/aspectjrt-1.7.1.jar
rename to eu.etaxonomy.taxeditor.cdmlib/lib/aspectjrt-1.8.8.jar
index 351409c83e516cb15c69244f8d90ea2364119471..4c6990220b87249ffe478c7b21516fc68fc03436 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/aspectjrt-1.7.1.jar and b/eu.etaxonomy.taxeditor.cdmlib/lib/aspectjrt-1.8.8.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/aspectjweaver-1.7.1-sources.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/aspectjweaver-1.7.1-sources.jar
deleted file mode 100644 (file)
index 9625da0..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/aspectjweaver-1.7.1-sources.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/aspectjweaver-1.7.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/aspectjweaver-1.7.1.jar
deleted file mode 100644 (file)
index 9949bc5..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/aspectjweaver-1.7.1.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/aspectjweaver-1.8.8.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/aspectjweaver-1.8.8.jar
new file mode 100644 (file)
index 0000000..5e5d3ce
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/aspectjweaver-1.8.8.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/batik-ext-1.7.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/batik-ext-1.7.jar
deleted file mode 100644 (file)
index 57fb273..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/batik-ext-1.7.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/batik-ext-1.8.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/batik-ext-1.8.jar
new file mode 100644 (file)
index 0000000..6a09ca3
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/batik-ext-1.8.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/c3p0-0.9.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/c3p0-0.9.2.jar
deleted file mode 100644 (file)
index 5dea94b..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/c3p0-0.9.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/c3p0-0.9.5.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/c3p0-0.9.5.2.jar
new file mode 100644 (file)
index 0000000..579cedd
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/c3p0-0.9.5.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cglib-3.2.0.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cglib-3.2.0.jar
new file mode 100644 (file)
index 0000000..51e2d85
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/cglib-3.2.0.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cglib-nodep-2.2.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cglib-nodep-2.2.2.jar
deleted file mode 100644 (file)
index 02d81e8..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/cglib-nodep-2.2.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cglib-nodep-3.2.0.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cglib-nodep-3.2.0.jar
new file mode 100644 (file)
index 0000000..e11f7cb
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/cglib-nodep-3.2.0.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/classmate-1.3.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/classmate-1.3.1.jar
new file mode 100644 (file)
index 0000000..01bf55b
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/classmate-1.3.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/codemodel-2.2.11.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/codemodel-2.2.11.jar
new file mode 100644 (file)
index 0000000..02f3da4
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/codemodel-2.2.11.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/commons-beanutils-1.8.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/commons-beanutils-1.8.3.jar
deleted file mode 100644 (file)
index 218510b..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/commons-beanutils-1.8.3.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/commons-beanutils-1.9.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/commons-beanutils-1.9.2.jar
new file mode 100644 (file)
index 0000000..7d075ed
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/commons-beanutils-1.9.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/commons-codec-1.10.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/commons-codec-1.10.jar
new file mode 100644 (file)
index 0000000..1d7417c
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/commons-codec-1.10.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/commons-codec-20041127.091804.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/commons-codec-20041127.091804.jar
deleted file mode 100644 (file)
index 0df1030..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/commons-codec-20041127.091804.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/commons-collections-3.2.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/commons-collections-3.2.1.jar
deleted file mode 100644 (file)
index c35fa1f..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/commons-collections-3.2.1.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/commons-collections-3.2.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/commons-collections-3.2.2.jar
new file mode 100644 (file)
index 0000000..fa5df82
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/commons-collections-3.2.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/commons-csv-1.0.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/commons-csv-1.0.jar
new file mode 100644 (file)
index 0000000..5f58e40
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/commons-csv-1.0.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/commons-lang3-3.3.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/commons-lang3-3.3.2.jar
new file mode 100644 (file)
index 0000000..2ce08ae
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/commons-lang3-3.3.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/commons-logging-1.1.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/commons-logging-1.1.2.jar
deleted file mode 100644 (file)
index d6a543c..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/commons-logging-1.1.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/commons-logging-1.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/commons-logging-1.2.jar
new file mode 100644 (file)
index 0000000..93a3b9f
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/commons-logging-1.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-core-1.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-core-1.3.jar
deleted file mode 100644 (file)
index 9f8fb36..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-core-1.3.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-core-1.6.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-core-1.6.jar
new file mode 100644 (file)
index 0000000..4f595c6
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-core-1.6.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-logging-api-1.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-logging-api-1.3.jar
deleted file mode 100644 (file)
index 59e009b..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-logging-api-1.3.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-logging-api-1.6.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-logging-api-1.6.jar
new file mode 100644 (file)
index 0000000..aa3d909
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-logging-api-1.6.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-module-apt-1.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-module-apt-1.3.jar
deleted file mode 100644 (file)
index ae4f3c6..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-module-apt-1.3.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-module-apt-1.6.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-module-apt-1.6.jar
new file mode 100644 (file)
index 0000000..9080348
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-module-apt-1.6.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-module-xhtml-1.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-module-xhtml-1.3.jar
deleted file mode 100644 (file)
index b888a40..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-module-xhtml-1.3.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-module-xhtml-1.6.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-module-xhtml-1.6.jar
new file mode 100644 (file)
index 0000000..ca6607e
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-module-xhtml-1.6.jar differ
similarity index 61%
rename from eu.etaxonomy.taxeditor.cdmlib/lib/doxia-sink-api-1.3.jar
rename to eu.etaxonomy.taxeditor.cdmlib/lib/doxia-sink-api-1.6.jar
index 10ca4b67f96f89baf013850c8f8f72b088444dae..7ddd397d3a868f06b42f581dab2b0b6f4912ab50 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-sink-api-1.3.jar and b/eu.etaxonomy.taxeditor.cdmlib/lib/doxia-sink-api-1.6.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/dtd-parser-1.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/dtd-parser-1.1.jar
new file mode 100644 (file)
index 0000000..e6e6c4e
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/dtd-parser-1.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/easymock-2.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/easymock-2.3.jar
new file mode 100644 (file)
index 0000000..190213e
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/easymock-2.3.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/easymock-3.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/easymock-3.1.jar
deleted file mode 100644 (file)
index 4b79dd1..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/easymock-3.1.jar and /dev/null differ
similarity index 79%
rename from eu.etaxonomy.taxeditor.cdmlib/lib/ehcache-core-2.6.9.jar
rename to eu.etaxonomy.taxeditor.cdmlib/lib/ehcache-core-2.6.11.jar
index 99dd2d26ec49a29b6186b38c8355ba878403d50a..0eb926ba4f23e0efbe6d6164ed4bc8ab27e07737 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/ehcache-core-2.6.9.jar and b/eu.etaxonomy.taxeditor.cdmlib/lib/ehcache-core-2.6.11.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/guava-19.0.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/guava-19.0.jar
new file mode 100644 (file)
index 0000000..b175ca8
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/guava-19.0.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/guava-r05.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/guava-r05.jar
deleted file mode 100644 (file)
index 0407b9c..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/guava-r05.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/h2-1.3.170.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/h2-1.3.170.jar
deleted file mode 100644 (file)
index 869798e..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/h2-1.3.170.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/h2-1.4.190.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/h2-1.4.190.jar
new file mode 100644 (file)
index 0000000..8b11e2e
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/h2-1.4.190.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-c3p0-4.1.10.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-c3p0-4.1.10.Final.jar
deleted file mode 100644 (file)
index 7eb1a03..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-c3p0-4.1.10.Final.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-c3p0-5.0.7.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-c3p0-5.0.7.Final.jar
new file mode 100644 (file)
index 0000000..bb6633e
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-c3p0-5.0.7.Final.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-commons-annotations-4.0.1.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-commons-annotations-4.0.1.Final.jar
deleted file mode 100644 (file)
index ac9d674..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-commons-annotations-4.0.1.Final.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-commons-annotations-5.0.1.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-commons-annotations-5.0.1.Final.jar
new file mode 100644 (file)
index 0000000..82e425d
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-commons-annotations-5.0.1.Final.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-core-4.1.10.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-core-4.1.10.Final.jar
deleted file mode 100644 (file)
index a8ac85d..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-core-4.1.10.Final.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-core-5.0.7.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-core-5.0.7.Final.jar
new file mode 100644 (file)
index 0000000..7265b21
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-core-5.0.7.Final.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-ehcache-4.1.10.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-ehcache-4.1.10.Final.jar
deleted file mode 100644 (file)
index f534c03..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-ehcache-4.1.10.Final.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-ehcache-5.0.7.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-ehcache-5.0.7.Final.jar
new file mode 100644 (file)
index 0000000..a248250
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-ehcache-5.0.7.Final.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-entitymanager-4.1.10.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-entitymanager-4.1.10.Final.jar
deleted file mode 100644 (file)
index 92d74fd..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-entitymanager-4.1.10.Final.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-entitymanager-5.0.7.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-entitymanager-5.0.7.Final.jar
new file mode 100644 (file)
index 0000000..31d1aa4
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-entitymanager-5.0.7.Final.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-envers-4.1.10.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-envers-4.1.10.Final.jar
deleted file mode 100644 (file)
index f54d748..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-envers-4.1.10.Final.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-envers-5.0.7.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-envers-5.0.7.Final.jar
new file mode 100644 (file)
index 0000000..dd5ed8a
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-envers-5.0.7.Final.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-jpa-2.0-api-1.0.1.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-jpa-2.0-api-1.0.1.Final.jar
deleted file mode 100644 (file)
index 1e9f71b..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-jpa-2.0-api-1.0.1.Final.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-jpa-2.1-api-1.0.0.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-jpa-2.1-api-1.0.0.Final.jar
new file mode 100644 (file)
index 0000000..e2f2c59
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-jpa-2.1-api-1.0.0.Final.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-search-engine-4.2.0.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-search-engine-4.2.0.Final.jar
deleted file mode 100644 (file)
index 3acd5ac..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-search-engine-4.2.0.Final.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-search-engine-5.5.2.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-search-engine-5.5.2.Final.jar
new file mode 100644 (file)
index 0000000..13da63d
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-search-engine-5.5.2.Final.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-search-orm-4.2.0.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-search-orm-4.2.0.Final.jar
deleted file mode 100644 (file)
index 9f384c8..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-search-orm-4.2.0.Final.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-search-orm-5.5.2.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-search-orm-5.5.2.Final.jar
new file mode 100644 (file)
index 0000000..8ebf70b
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-search-orm-5.5.2.Final.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-validator-4.3.1.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-validator-4.3.1.Final.jar
deleted file mode 100644 (file)
index 5656793..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-validator-4.3.1.Final.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-validator-5.2.2.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-validator-5.2.2.Final.jar
new file mode 100644 (file)
index 0000000..ba42764
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-validator-5.2.2.Final.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-validator-cdi-5.2.2.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-validator-cdi-5.2.2.Final.jar
new file mode 100644 (file)
index 0000000..37f8ab1
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-validator-cdi-5.2.2.Final.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hsqldb-1.8.0.10.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hsqldb-1.8.0.10.jar
deleted file mode 100644 (file)
index e010269..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/hsqldb-1.8.0.10.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/hsqldb-2.3.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/hsqldb-2.3.3.jar
new file mode 100644 (file)
index 0000000..2f05edf
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/hsqldb-2.3.3.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/httpclient-4.2.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/httpclient-4.2.3.jar
deleted file mode 100644 (file)
index 53c1c26..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/httpclient-4.2.3.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/httpclient-4.5.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/httpclient-4.5.1.jar
new file mode 100644 (file)
index 0000000..b9c0c1c
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/httpclient-4.5.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/httpclient-cache-4.2.6.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/httpclient-cache-4.2.6.jar
new file mode 100644 (file)
index 0000000..f6a7cd4
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/httpclient-cache-4.2.6.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/httpcore-4.2.4.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/httpcore-4.2.4.jar
deleted file mode 100644 (file)
index 9f45bd9..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/httpcore-4.2.4.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/httpcore-4.4.4.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/httpcore-4.4.4.jar
new file mode 100644 (file)
index 0000000..ac4a877
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/httpcore-4.4.4.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/httpmime-4.5.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/httpmime-4.5.1.jar
new file mode 100644 (file)
index 0000000..53a6420
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/httpmime-4.5.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/identificationKeyAPI-1.0-SNAPSHOT-sources.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/identificationKeyAPI-1.0-SNAPSHOT-sources.jar
deleted file mode 100755 (executable)
index 2ec64a8..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/identificationKeyAPI-1.0-SNAPSHOT-sources.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/identificationKeyAPI-1.0-SNAPSHOT.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/identificationKeyAPI-1.0-SNAPSHOT.jar
deleted file mode 100644 (file)
index 1955f94..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/identificationKeyAPI-1.0-SNAPSHOT.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/identificationKeyAPI-1.0.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/identificationKeyAPI-1.0.jar
new file mode 100644 (file)
index 0000000..ec25356
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/identificationKeyAPI-1.0.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/istack-commons-runtime-2.21.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/istack-commons-runtime-2.21.jar
new file mode 100644 (file)
index 0000000..aa950a8
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/istack-commons-runtime-2.21.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/istack-commons-tools-2.21.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/istack-commons-tools-2.21.jar
new file mode 100644 (file)
index 0000000..acfa7e3
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/istack-commons-tools-2.21.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/itextpdf-5.4.0.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/itextpdf-5.4.0.jar
deleted file mode 100644 (file)
index e1e2713..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/itextpdf-5.4.0.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/itextpdf-5.5.8.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/itextpdf-5.5.8.jar
new file mode 100644 (file)
index 0000000..3f6ea6c
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/itextpdf-5.5.8.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jackson-annotations-2.6.5.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jackson-annotations-2.6.5.jar
new file mode 100644 (file)
index 0000000..68b6162
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jackson-annotations-2.6.5.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jackson-core-2.6.5.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jackson-core-2.6.5.jar
new file mode 100644 (file)
index 0000000..5ee8d20
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jackson-core-2.6.5.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jackson-databind-2.6.5.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jackson-databind-2.6.5.jar
new file mode 100644 (file)
index 0000000..feb8bba
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jackson-databind-2.6.5.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jandex-2.0.0.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jandex-2.0.0.Final.jar
new file mode 100644 (file)
index 0000000..d24086a
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jandex-2.0.0.Final.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/javassist-3.17.1-GA.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/javassist-3.17.1-GA.jar
deleted file mode 100644 (file)
index a248980..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/javassist-3.17.1-GA.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/javassist-3.20.0-GA.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/javassist-3.20.0-GA.jar
new file mode 100644 (file)
index 0000000..0f1ff72
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/javassist-3.20.0-GA.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/javax.el-2.2.6.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/javax.el-2.2.6.jar
new file mode 100644 (file)
index 0000000..90a9ab5
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/javax.el-2.2.6.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/javax.el-api-2.2.5.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/javax.el-api-2.2.5.jar
new file mode 100644 (file)
index 0000000..4a3001e
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/javax.el-api-2.2.5.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/javax.servlet-api-3.1.0.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/javax.servlet-api-3.1.0.jar
new file mode 100644 (file)
index 0000000..6b14c3d
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/javax.servlet-api-3.1.0.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-api-2.2.12.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-api-2.2.12.jar
new file mode 100644 (file)
index 0000000..3f4638c
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-api-2.2.12.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-api-2.2.7.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-api-2.2.7.jar
deleted file mode 100644 (file)
index ae2adee..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-api-2.2.7.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-core-2.2.11.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-core-2.2.11.jar
new file mode 100644 (file)
index 0000000..cc0aad1
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-core-2.2.11.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-impl-2.2-EA.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-impl-2.2-EA.jar
deleted file mode 100644 (file)
index 4977608..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-impl-2.2-EA.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-jxc-2.2.11.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-jxc-2.2.11.jar
new file mode 100644 (file)
index 0000000..79db7c4
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-jxc-2.2.11.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-runtime-2.2.11.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-runtime-2.2.11.jar
new file mode 100644 (file)
index 0000000..a1f047f
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-runtime-2.2.11.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-xjc-2.2-EA.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-xjc-2.2-EA.jar
deleted file mode 100644 (file)
index f8e5ff8..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-xjc-2.2-EA.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-xjc-2.2.11.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-xjc-2.2.11.jar
new file mode 100644 (file)
index 0000000..0a753d0
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-xjc-2.2.11.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jaxen-1.1.6.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jaxen-1.1.6.jar
new file mode 100644 (file)
index 0000000..52f47a4
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jaxen-1.1.6.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jboss-logging-3.1.3.GA.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jboss-logging-3.1.3.GA.jar
deleted file mode 100644 (file)
index ff3a103..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/jboss-logging-3.1.3.GA.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jboss-logging-3.3.0.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jboss-logging-3.3.0.Final.jar
new file mode 100644 (file)
index 0000000..ea45d4d
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jboss-logging-3.3.0.Final.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jcl-over-slf4j-1.7.6.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jcl-over-slf4j-1.7.6.jar
new file mode 100644 (file)
index 0000000..1a1ceee
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jcl-over-slf4j-1.7.6.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jdom2-2.0.6.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jdom2-2.0.6.jar
new file mode 100644 (file)
index 0000000..2850ca1
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jdom2-2.0.6.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jena-arq-2.13.0.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jena-arq-2.13.0.jar
new file mode 100644 (file)
index 0000000..3b17e6e
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jena-arq-2.13.0.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jena-core-2.11.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jena-core-2.11.2.jar
deleted file mode 100644 (file)
index 7d7d210..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/jena-core-2.11.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jena-core-2.13.0.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jena-core-2.13.0.jar
new file mode 100644 (file)
index 0000000..ba93796
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jena-core-2.13.0.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jena-iri-1.0.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jena-iri-1.0.2.jar
deleted file mode 100644 (file)
index f54fb49..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/jena-iri-1.0.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jena-iri-1.1.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jena-iri-1.1.2.jar
new file mode 100644 (file)
index 0000000..d520498
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jena-iri-1.1.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jena-tdb-1.1.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jena-tdb-1.1.2.jar
new file mode 100644 (file)
index 0000000..580c9cd
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jena-tdb-1.1.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/joda-time-2.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/joda-time-2.1.jar
deleted file mode 100644 (file)
index b2aca95..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/joda-time-2.1.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/joda-time-2.9.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/joda-time-2.9.1.jar
new file mode 100644 (file)
index 0000000..583e06a
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/joda-time-2.9.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/json-20090211.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/json-20090211.jar
new file mode 100644 (file)
index 0000000..ef29094
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/json-20090211.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jsonld-java-0.5.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jsonld-java-0.5.1.jar
new file mode 100644 (file)
index 0000000..d61cc0f
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jsonld-java-0.5.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/jta-1.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/jta-1.1.jar
new file mode 100644 (file)
index 0000000..7736ec9
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/jta-1.1.jar differ
similarity index 50%
rename from eu.etaxonomy.taxeditor.cdmlib/lib/jtds-1.3.0.jar
rename to eu.etaxonomy.taxeditor.cdmlib/lib/jtds-1.3.1.jar
index 60f119cacfd143a2539cb7a26cd8da5043b96815..518b425d38ef9ea424b3f03ea001d26679495af6 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/jtds-1.3.0.jar and b/eu.etaxonomy.taxeditor.cdmlib/lib/jtds-1.3.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/junit-4.11.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/junit-4.11.jar
deleted file mode 100644 (file)
index aaf7444..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/junit-4.11.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/junit-4.12.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/junit-4.12.jar
new file mode 100644 (file)
index 0000000..3a7fc26
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/junit-4.12.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/junit-benchmarks-0.5.0.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/junit-benchmarks-0.5.0.jar
deleted file mode 100644 (file)
index b1e1c51..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/junit-benchmarks-0.5.0.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/junit-benchmarks-0.7.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/junit-benchmarks-0.7.2.jar
new file mode 100644 (file)
index 0000000..93aee13
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/junit-benchmarks-0.7.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/libthrift-0.9.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/libthrift-0.9.2.jar
new file mode 100644 (file)
index 0000000..39143a5
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/libthrift-0.9.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-analyzers-3.6.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-analyzers-3.6.2.jar
deleted file mode 100644 (file)
index 752c714..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-analyzers-3.6.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-analyzers-common-5.4.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-analyzers-common-5.4.1.jar
new file mode 100644 (file)
index 0000000..bcbeedb
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-analyzers-common-5.4.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-backward-codecs-5.4.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-backward-codecs-5.4.1.jar
new file mode 100644 (file)
index 0000000..67b83ee
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-backward-codecs-5.4.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-core-3.6.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-core-3.6.2.jar
deleted file mode 100644 (file)
index cc374b7..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-core-3.6.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-core-5.4.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-core-5.4.1.jar
new file mode 100644 (file)
index 0000000..769566b
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-core-5.4.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-facet-3.6.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-facet-3.6.2.jar
deleted file mode 100644 (file)
index 7b8d21c..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-facet-3.6.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-facet-5.4.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-facet-5.4.1.jar
new file mode 100644 (file)
index 0000000..941d1d1
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-facet-5.4.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-grouping-3.6.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-grouping-3.6.2.jar
deleted file mode 100644 (file)
index 37a4406..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-grouping-3.6.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-grouping-5.4.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-grouping-5.4.1.jar
new file mode 100644 (file)
index 0000000..06ed59d
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-grouping-5.4.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-highlighter-3.6.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-highlighter-3.6.2.jar
deleted file mode 100644 (file)
index 47923cc..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-highlighter-3.6.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-highlighter-5.4.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-highlighter-5.4.1.jar
new file mode 100644 (file)
index 0000000..381ea47
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-highlighter-5.4.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-join-5.4.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-join-5.4.1.jar
new file mode 100644 (file)
index 0000000..16a3e87
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-join-5.4.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-kuromoji-3.6.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-kuromoji-3.6.2.jar
deleted file mode 100644 (file)
index 093efbd..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-kuromoji-3.6.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-memory-3.6.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-memory-3.6.2.jar
deleted file mode 100644 (file)
index 5e1937f..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-memory-3.6.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-memory-5.4.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-memory-5.4.1.jar
new file mode 100644 (file)
index 0000000..6b65fe2
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-memory-5.4.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-misc-3.6.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-misc-3.6.2.jar
deleted file mode 100644 (file)
index 6276656..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-misc-3.6.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-misc-5.4.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-misc-5.4.1.jar
new file mode 100644 (file)
index 0000000..8d36fe7
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-misc-5.4.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-phonetic-3.6.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-phonetic-3.6.2.jar
deleted file mode 100644 (file)
index b67de4c..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-phonetic-3.6.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-queries-3.6.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-queries-3.6.2.jar
deleted file mode 100644 (file)
index 8e2c2b7..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-queries-3.6.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-queries-5.4.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-queries-5.4.1.jar
new file mode 100644 (file)
index 0000000..168771d
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-queries-5.4.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-queryparser-5.4.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-queryparser-5.4.1.jar
new file mode 100644 (file)
index 0000000..f7c2e47
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-queryparser-5.4.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-sandbox-5.4.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-sandbox-5.4.1.jar
new file mode 100644 (file)
index 0000000..530aa27
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-sandbox-5.4.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-smartcn-3.6.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-smartcn-3.6.2.jar
deleted file mode 100644 (file)
index ea5930b..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-smartcn-3.6.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-spatial-3.6.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-spatial-3.6.2.jar
deleted file mode 100644 (file)
index 2f2bf0b..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-spatial-3.6.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-spellchecker-3.6.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-spellchecker-3.6.2.jar
deleted file mode 100644 (file)
index 501701d..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-spellchecker-3.6.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-stempel-3.6.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-stempel-3.6.2.jar
deleted file mode 100644 (file)
index bf83933..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-stempel-3.6.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-suggest-5.4.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-suggest-5.4.1.jar
new file mode 100644 (file)
index 0000000..348a755
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/lucene-suggest-5.4.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/mapstruct-1.0.0.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/mapstruct-1.0.0.Final.jar
new file mode 100644 (file)
index 0000000..20a0d2c
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/mapstruct-1.0.0.Final.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/mchange-commons-java-0.2.11.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/mchange-commons-java-0.2.11.jar
new file mode 100644 (file)
index 0000000..88f1d47
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/mchange-commons-java-0.2.11.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/mchange-commons-java-0.2.3.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/mchange-commons-java-0.2.3.3.jar
deleted file mode 100644 (file)
index c44160e..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/mchange-commons-java-0.2.3.3.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/mysql-connector-java-5.1.38.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/mysql-connector-java-5.1.38.jar
new file mode 100644 (file)
index 0000000..be09493
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/mysql-connector-java-5.1.38.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar
deleted file mode 100644 (file)
index 4cf488e..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar
deleted file mode 100644 (file)
index f131a43..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.aop-3.2.2.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.aop-3.2.2.RELEASE.jar
deleted file mode 100644 (file)
index 3b9cbb1..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.aop-3.2.2.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.aspects-3.2.2.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.aspects-3.2.2.RELEASE.jar
deleted file mode 100644 (file)
index b8c0595..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.aspects-3.2.2.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.beans-3.2.2.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.beans-3.2.2.RELEASE.jar
deleted file mode 100644 (file)
index 172c395..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.beans-3.2.2.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.core-3.2.2.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.core-3.2.2.RELEASE.jar
deleted file mode 100644 (file)
index 0b73e4a..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.core-3.2.2.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.expression-3.2.2.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.expression-3.2.2.RELEASE.jar
deleted file mode 100644 (file)
index f992bff..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.expression-3.2.2.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.jdbc-3.2.2.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.jdbc-3.2.2.RELEASE.jar
deleted file mode 100644 (file)
index a46dc3a..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.jdbc-3.2.2.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.orm-3.2.2.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.orm-3.2.2.RELEASE.jar
deleted file mode 100644 (file)
index 412412b..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.orm-3.2.2.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.oxm-3.2.2.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.oxm-3.2.2.RELEASE.jar
deleted file mode 100644 (file)
index 84af61c..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.oxm-3.2.2.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.test-3.2.2.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.test-3.2.2.RELEASE.jar
deleted file mode 100644 (file)
index 30962d0..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.test-3.2.2.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.transaction-3.2.2.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.transaction-3.2.2.RELEASE.jar
deleted file mode 100644 (file)
index 4d4c662..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.transaction-3.2.2.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.web-3.2.2.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.web-3.2.2.RELEASE.jar
deleted file mode 100644 (file)
index bfe1d97..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.web-3.2.2.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.web.servlet-3.2.2.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.web.servlet-3.2.2.RELEASE.jar
deleted file mode 100644 (file)
index 015aacd..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.web.servlet-3.2.2.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/p6spy-1.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/p6spy-1.3.jar
deleted file mode 100644 (file)
index 44b8987..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/p6spy-1.3.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/p6spy-2.1.4.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/p6spy-2.1.4.jar
new file mode 100644 (file)
index 0000000..7bf6273
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/p6spy-2.1.4.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/plexus-component-annotations-1.5.5.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/plexus-component-annotations-1.5.5.jar
new file mode 100644 (file)
index 0000000..e4de16f
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/plexus-component-annotations-1.5.5.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/plexus-utils-2.0.5.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/plexus-utils-2.0.5.jar
deleted file mode 100644 (file)
index 1cf1a7a..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/plexus-utils-2.0.5.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/plexus-utils-3.0.15.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/plexus-utils-3.0.15.jar
new file mode 100644 (file)
index 0000000..feab196
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/plexus-utils-3.0.15.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/poi-3.10-FINAL.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/poi-3.10-FINAL.jar
deleted file mode 100644 (file)
index 8862e21..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/poi-3.10-FINAL.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/poi-3.13.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/poi-3.13.jar
new file mode 100644 (file)
index 0000000..a9e3800
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/poi-3.13.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/poi-ooxml-3.10-FINAL.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/poi-ooxml-3.10-FINAL.jar
deleted file mode 100644 (file)
index 0782b07..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/poi-ooxml-3.10-FINAL.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/poi-ooxml-3.13.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/poi-ooxml-3.13.jar
new file mode 100644 (file)
index 0000000..726768c
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/poi-ooxml-3.13.jar differ
similarity index 70%
rename from eu.etaxonomy.taxeditor.cdmlib/lib/poi-ooxml-schemas-3.10-FINAL.jar
rename to eu.etaxonomy.taxeditor.cdmlib/lib/poi-ooxml-schemas-3.13.jar
index 24d719e70ddc273d76035951d314ec44bd4e5d24..bd883978b3ed22e697314973650dd797f86eccf7 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/poi-ooxml-schemas-3.10-FINAL.jar and b/eu.etaxonomy.taxeditor.cdmlib/lib/poi-ooxml-schemas-3.13.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/postgresql-9.1-901.jdbc4.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/postgresql-9.1-901.jdbc4.jar
deleted file mode 100644 (file)
index 63e5416..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/postgresql-9.1-901.jdbc4.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/postgresql-9.4-1206-jdbc4.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/postgresql-9.4-1206-jdbc4.jar
new file mode 100644 (file)
index 0000000..5bae20e
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/postgresql-9.4-1206-jdbc4.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/relaxngDatatype-20020414.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/relaxngDatatype-20020414.jar
new file mode 100644 (file)
index 0000000..db9206f
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/relaxngDatatype-20020414.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/rngom-2.2.11.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/rngom-2.2.11.jar
new file mode 100644 (file)
index 0000000..00cf5b4
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/rngom-2.2.11.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-api-1.7.13.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-api-1.7.13.jar
new file mode 100644 (file)
index 0000000..f07884e
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-api-1.7.13.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-api-1.7.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-api-1.7.2.jar
deleted file mode 100644 (file)
index 1a88708..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-api-1.7.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-log4j12-1.7.13.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-log4j12-1.7.13.jar
new file mode 100644 (file)
index 0000000..a8dd5c5
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-log4j12-1.7.13.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-log4j12-1.7.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-log4j12-1.7.2.jar
deleted file mode 100644 (file)
index 5dfcf4b..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-log4j12-1.7.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-nop-1.7.13.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-nop-1.7.13.jar
new file mode 100644 (file)
index 0000000..5496e46
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/slf4j-nop-1.7.13.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-aop-3.2.2.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-aop-3.2.2.RELEASE.jar
deleted file mode 100644 (file)
index 386fe32..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-aop-3.2.2.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-aop-4.2.4.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-aop-4.2.4.RELEASE.jar
new file mode 100644 (file)
index 0000000..7fb0ba7
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-aop-4.2.4.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-aspects-4.2.4.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-aspects-4.2.4.RELEASE.jar
new file mode 100644 (file)
index 0000000..8be8424
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-aspects-4.2.4.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-beans-3.2.2.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-beans-3.2.2.RELEASE.jar
deleted file mode 100644 (file)
index 52d0ae6..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-beans-3.2.2.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-beans-4.2.4.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-beans-4.2.4.RELEASE.jar
new file mode 100644 (file)
index 0000000..89232b4
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-beans-4.2.4.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-context-3.2.2.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-context-3.2.2.RELEASE.jar
deleted file mode 100644 (file)
index b027ab8..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-context-3.2.2.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-context-4.2.4.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-context-4.2.4.RELEASE.jar
new file mode 100644 (file)
index 0000000..38cfab6
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-context-4.2.4.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-context-support-3.2.2.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-context-support-3.2.2.RELEASE.jar
deleted file mode 100644 (file)
index f1df10b..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-context-support-3.2.2.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-context-support-4.2.4.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-context-support-4.2.4.RELEASE.jar
new file mode 100644 (file)
index 0000000..d979371
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-context-support-4.2.4.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-core-3.2.2.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-core-3.2.2.RELEASE.jar
deleted file mode 100644 (file)
index 906326d..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-core-3.2.2.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-core-4.2.4.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-core-4.2.4.RELEASE.jar
new file mode 100644 (file)
index 0000000..f2cd8fb
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-core-4.2.4.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-expression-3.2.2.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-expression-3.2.2.RELEASE.jar
deleted file mode 100644 (file)
index b5c6f1a..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-expression-3.2.2.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-expression-4.2.4.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-expression-4.2.4.RELEASE.jar
new file mode 100644 (file)
index 0000000..483f3f1
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-expression-4.2.4.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-jdbc-4.2.4.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-jdbc-4.2.4.RELEASE.jar
new file mode 100644 (file)
index 0000000..4f0abf1
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-jdbc-4.2.4.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-orm-4.2.4.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-orm-4.2.4.RELEASE.jar
new file mode 100644 (file)
index 0000000..e4f6cca
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-orm-4.2.4.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-oxm-4.2.4.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-oxm-4.2.4.RELEASE.jar
new file mode 100644 (file)
index 0000000..f191a6b
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-oxm-4.2.4.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-plugin-core-1.2.0.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-plugin-core-1.2.0.RELEASE.jar
new file mode 100644 (file)
index 0000000..c290363
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-plugin-core-1.2.0.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-plugin-metadata-1.2.0.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-plugin-metadata-1.2.0.RELEASE.jar
new file mode 100644 (file)
index 0000000..6eaa98c
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-plugin-metadata-1.2.0.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-config-3.1.3.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-config-3.1.3.RELEASE.jar
deleted file mode 100644 (file)
index 37f66bc..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-config-3.1.3.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-config-4.0.3.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-config-4.0.3.RELEASE.jar
new file mode 100644 (file)
index 0000000..427c2b2
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-config-4.0.3.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-core-3.1.3.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-core-3.1.3.RELEASE.jar
deleted file mode 100644 (file)
index 81e3566..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-core-3.1.3.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-core-4.0.3.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-core-4.0.3.RELEASE.jar
new file mode 100644 (file)
index 0000000..18c51b3
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-core-4.0.3.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-remoting-3.1.3.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-remoting-3.1.3.RELEASE.jar
deleted file mode 100644 (file)
index 6268e58..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-remoting-3.1.3.RELEASE.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-web-4.0.3.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-web-4.0.3.RELEASE.jar
new file mode 100644 (file)
index 0000000..018f192
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-web-4.0.3.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-test-4.2.4.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-test-4.2.4.RELEASE.jar
new file mode 100644 (file)
index 0000000..f5a6691
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-test-4.2.4.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-tx-4.2.4.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-tx-4.2.4.RELEASE.jar
new file mode 100644 (file)
index 0000000..dda3bc0
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-tx-4.2.4.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-web-4.2.4.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-web-4.2.4.RELEASE.jar
new file mode 100644 (file)
index 0000000..d788595
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-web-4.2.4.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/spring-webmvc-4.2.4.RELEASE.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-webmvc-4.2.4.RELEASE.jar
new file mode 100644 (file)
index 0000000..ee87814
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/spring-webmvc-4.2.4.RELEASE.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/springfox-core-2.3.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/springfox-core-2.3.1.jar
new file mode 100644 (file)
index 0000000..0cedf11
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/springfox-core-2.3.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/springfox-schema-2.3.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/springfox-schema-2.3.1.jar
new file mode 100644 (file)
index 0000000..e1ccee6
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/springfox-schema-2.3.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/springfox-spi-2.3.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/springfox-spi-2.3.1.jar
new file mode 100644 (file)
index 0000000..2dd9873
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/springfox-spi-2.3.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/springfox-spring-web-2.3.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/springfox-spring-web-2.3.1.jar
new file mode 100644 (file)
index 0000000..c64b035
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/springfox-spring-web-2.3.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/springfox-swagger-common-2.3.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/springfox-swagger-common-2.3.1.jar
new file mode 100644 (file)
index 0000000..31302c9
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/springfox-swagger-common-2.3.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/springfox-swagger2-2.3.1.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/springfox-swagger2-2.3.1.jar
new file mode 100644 (file)
index 0000000..31744df
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/springfox-swagger2-2.3.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/standard-1.1.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/standard-1.1.2.jar
new file mode 100644 (file)
index 0000000..bc528ac
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/standard-1.1.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/stax-ex-1.7.7.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/stax-ex-1.7.7.jar
new file mode 100644 (file)
index 0000000..31a6aad
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/stax-ex-1.7.7.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/swagger-annotations-1.3.5.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/swagger-annotations-1.3.5.jar
deleted file mode 100644 (file)
index 6c6f5c2..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/swagger-annotations-1.3.5.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/swagger-annotations-1.5.6.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/swagger-annotations-1.5.6.jar
new file mode 100644 (file)
index 0000000..5bea844
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/swagger-annotations-1.5.6.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/swagger-models-1.5.5.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/swagger-models-1.5.5.jar
new file mode 100644 (file)
index 0000000..a14a5ff
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/swagger-models-1.5.5.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/tools.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/tools.jar
new file mode 100644 (file)
index 0000000..4f98c80
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/tools.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/txw2-2.2.11.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/txw2-2.2.11.jar
new file mode 100644 (file)
index 0000000..eca81b2
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/txw2-2.2.11.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-core-3.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-core-3.3.jar
deleted file mode 100644 (file)
index a3a7a7b..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-core-3.3.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-core-3.4.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-core-3.4.2.jar
new file mode 100644 (file)
index 0000000..ab4c22e
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-core-3.4.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-database-3.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-database-3.3.jar
deleted file mode 100644 (file)
index f9a1647..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-database-3.3.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-database-3.4.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-database-3.4.2.jar
new file mode 100644 (file)
index 0000000..dfcb6ae
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-database-3.4.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbmaintainer-3.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbmaintainer-3.3.jar
deleted file mode 100644 (file)
index bb20970..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbmaintainer-3.3.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbmaintainer-3.4.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbmaintainer-3.4.2.jar
new file mode 100644 (file)
index 0000000..01f8994
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbmaintainer-3.4.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbunit-3.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbunit-3.3.jar
deleted file mode 100644 (file)
index eefa626..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbunit-3.3.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbunit-3.4.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbunit-3.4.2.jar
new file mode 100644 (file)
index 0000000..778274e
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-dbunit-3.4.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-easymock-3.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-easymock-3.3.jar
deleted file mode 100644 (file)
index c603f0b..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-easymock-3.3.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-easymock-3.4.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-easymock-3.4.2.jar
new file mode 100644 (file)
index 0000000..01b1f95
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-easymock-3.4.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-inject-3.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-inject-3.3.jar
deleted file mode 100644 (file)
index 8bf141e..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-inject-3.3.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-inject-3.4.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-inject-3.4.2.jar
new file mode 100644 (file)
index 0000000..25351e1
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-inject-3.4.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-mock-3.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-mock-3.3.jar
deleted file mode 100644 (file)
index f201831..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-mock-3.3.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-mock-3.4.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-mock-3.4.2.jar
new file mode 100644 (file)
index 0000000..588258e
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-mock-3.4.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-orm-3.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-orm-3.3.jar
deleted file mode 100644 (file)
index d8d4e89..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-orm-3.3.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-orm-3.4.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-orm-3.4.2.jar
new file mode 100644 (file)
index 0000000..538064a
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-orm-3.4.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-spring-3.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-spring-3.3.jar
deleted file mode 100644 (file)
index 53074f0..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-spring-3.3.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-spring-3.4.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-spring-3.4.2.jar
new file mode 100644 (file)
index 0000000..f30810b
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/unitils-spring-3.4.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/validation-api-1.0.0.GA.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/validation-api-1.0.0.GA.jar
deleted file mode 100644 (file)
index 1ff2dd7..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/validation-api-1.0.0.GA.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/validation-api-1.1.0.Final.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/validation-api-1.1.0.Final.jar
new file mode 100644 (file)
index 0000000..de85403
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/validation-api-1.1.0.Final.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/wsdl4j-1.6.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/wsdl4j-1.6.2.jar
deleted file mode 100644 (file)
index b9ffc36..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/wsdl4j-1.6.2.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/wsdl4j-1.6.3.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/wsdl4j-1.6.3.jar
new file mode 100644 (file)
index 0000000..b9c10b9
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/wsdl4j-1.6.3.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/x-1.1.2.tld b/eu.etaxonomy.taxeditor.cdmlib/lib/x-1.1.2.tld
new file mode 100644 (file)
index 0000000..e52ffe8
--- /dev/null
@@ -0,0 +1,448 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
+    version="2.0">
+    
+  <description>JSTL 1.1 XML library</description>
+  <display-name>JSTL XML</display-name>
+  <tlib-version>1.1</tlib-version>
+  <short-name>x</short-name>
+  <uri>http://java.sun.com/jsp/jstl/xml</uri>
+
+  <validator>
+    <description>
+        Provides validation features for JSTL XML tags.
+    </description>
+    <validator-class>
+       org.apache.taglibs.standard.tlv.JstlXmlTLV
+    </validator-class>
+  </validator>
+
+  <tag>
+    <description>
+        Simple conditional tag that establishes a context for
+        mutually exclusive conditional operations, marked by
+        &lt;when&gt; and &lt;otherwise&gt;
+    </description>
+    <name>choose</name>
+    <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class>
+    <body-content>JSP</body-content>
+  </tag>
+
+  <tag>
+    <description>
+       Like &lt;%= ... &gt;, but for XPath expressions.
+    </description>
+    <name>out</name>
+    <tag-class>org.apache.taglibs.standard.tag.rt.xml.ExprTag</tag-class>
+    <body-content>empty</body-content>
+    <attribute>
+        <description>
+XPath expression to be evaluated.
+        </description>
+        <name>select</name>
+        <required>true</required>
+        <rtexprvalue>false</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+Determines whether characters &lt;,&gt;,&amp;,'," in the
+resulting string should be converted to their
+corresponding character entity codes. Default
+value is true.
+        </description>
+        <name>escapeXml</name>
+        <required>false</required>
+        <rtexprvalue>true</rtexprvalue>
+    </attribute>
+  </tag>
+
+  <tag>
+    <description>
+        XML conditional tag, which evalutes its body if the
+        supplied XPath expression evalutes to 'true' as a boolean
+    </description>
+    <name>if</name>
+    <tag-class>org.apache.taglibs.standard.tag.common.xml.IfTag</tag-class>
+    <body-content>JSP</body-content>
+    <attribute>
+        <description>
+The test condition that tells whether or not the
+body content should be processed.
+        </description>
+        <name>select</name>
+        <required>true</required>
+        <rtexprvalue>false</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+Name of the exported scoped variable for the
+resulting value of the test condition. The type
+of the scoped variable is Boolean.
+        </description>
+        <name>var</name>
+        <required>false</required>
+        <rtexprvalue>false</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+Scope for var.
+        </description>
+        <name>scope</name>
+        <required>false</required>
+        <rtexprvalue>false</rtexprvalue>
+    </attribute>
+  </tag>
+
+  <tag>
+    <description>
+       XML iteration tag.
+    </description>
+    <name>forEach</name>
+    <tag-class>org.apache.taglibs.standard.tag.common.xml.ForEachTag</tag-class>
+    <body-content>JSP</body-content>
+    <attribute>
+        <description>
+Name of the exported scoped variable for the
+current item of the iteration. This scoped variable
+has nested visibility. Its type depends on the
+result of the XPath expression in the select
+attribute.
+        </description>
+       <name>var</name>
+       <required>false</required>
+       <rtexprvalue>false</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+XPath expression to be evaluated.
+        </description>
+       <name>select</name>
+       <required>true</required>
+       <rtexprvalue>false</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+Iteration begins at the item located at the
+specified index. First item of the collection has
+index 0.
+        </description>
+       <name>begin</name>
+       <required>false</required>
+       <rtexprvalue>true</rtexprvalue>
+       <type>int</type>
+    </attribute>
+    <attribute>
+        <description>
+Iteration ends at the item located at the specified
+index (inclusive).
+        </description>
+       <name>end</name>
+       <required>false</required>
+       <rtexprvalue>true</rtexprvalue>
+       <type>int</type>
+    </attribute>
+    <attribute>
+        <description>
+Iteration will only process every step items of
+the collection, starting with the first one.
+        </description>
+       <name>step</name>
+       <required>false</required>
+       <rtexprvalue>true</rtexprvalue>
+       <type>int</type>
+    </attribute>
+    <attribute>
+        <description>
+Name of the exported scoped variable for the
+status of the iteration. Object exported is of type
+javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested visibility.
+        </description>
+       <name>varStatus</name>
+       <required>false</required>
+       <rtexprvalue>false</rtexprvalue>
+    </attribute>
+  </tag>
+
+  <tag>
+    <description>
+       Subtag of &lt;choose&gt; that follows &lt;when&gt; tags
+       and runs only if all of the prior conditions evaluated to
+       'false'
+    </description>
+    <name>otherwise</name>
+    <tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class>
+    <body-content>JSP</body-content>
+  </tag>
+
+  <tag>
+    <description>
+        Adds a parameter to a containing 'transform' tag's Transformer
+    </description>
+    <name>param</name>
+    <tag-class>org.apache.taglibs.standard.tag.rt.xml.ParamTag</tag-class>
+    <body-content>JSP</body-content>
+    <attribute>
+        <description>
+Name of the transformation parameter.
+        </description>
+        <name>name</name>
+        <required>true</required>
+        <rtexprvalue>true</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+Value of the parameter.
+        </description>
+        <name>value</name>
+        <required>false</required>
+        <rtexprvalue>true</rtexprvalue>
+    </attribute>
+  </tag>
+
+  <tag>
+    <description>
+       Parses XML content from 'source' attribute or 'body'
+    </description>
+    <name>parse</name>
+    <tag-class>org.apache.taglibs.standard.tag.rt.xml.ParseTag</tag-class>
+    <tei-class>org.apache.taglibs.standard.tei.XmlParseTEI</tei-class>
+    <body-content>JSP</body-content>
+    <attribute>
+        <description>
+Name of the exported scoped variable for
+the parsed XML document. The type of the
+scoped variable is implementation
+dependent.
+        </description>
+        <name>var</name>
+        <required>false</required>
+        <rtexprvalue>false</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+Name of the exported scoped variable for
+the parsed XML document. The type of the
+scoped variable is
+org.w3c.dom.Document.
+        </description>
+        <name>varDom</name>
+        <required>false</required>
+        <rtexprvalue>false</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+Scope for var.
+        </description>
+        <name>scope</name>
+        <required>false</required>
+        <rtexprvalue>false</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+Scope for varDom.
+        </description>
+        <name>scopeDom</name>
+        <required>false</required>
+        <rtexprvalue>false</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+Deprecated. Use attribute 'doc' instead.
+        </description>
+        <name>xml</name>
+        <required>false</required>
+        <rtexprvalue>true</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+Source XML document to be parsed.
+        </description>
+        <name>doc</name>
+        <required>false</required>
+        <rtexprvalue>true</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+The system identifier (URI) for parsing the
+XML document.
+        </description>
+        <name>systemId</name>
+        <required>false</required>
+        <rtexprvalue>true</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+Filter to be applied to the source
+document.
+        </description>
+        <name>filter</name>
+        <required>false</required>
+        <rtexprvalue>true</rtexprvalue>
+    </attribute>
+  </tag>
+
+  <tag>
+    <description>
+       Saves the result of an XPath expression evaluation in a 'scope'
+    </description>
+    <name>set</name>
+    <tag-class>org.apache.taglibs.standard.tag.common.xml.SetTag</tag-class>
+    <body-content>empty</body-content>
+    <attribute>
+        <description>
+Name of the exported scoped variable to hold
+the value specified in the action. The type of the
+scoped variable is whatever type the select
+expression evaluates to.
+        </description>
+        <name>var</name>
+        <required>true</required>
+        <rtexprvalue>false</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+XPath expression to be evaluated.
+        </description>
+       <name>select</name>
+        <required>false</required>
+        <rtexprvalue>false</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+Scope for var.
+        </description>
+        <name>scope</name>
+        <required>false</required>
+        <rtexprvalue>false</rtexprvalue>
+    </attribute>
+  </tag>
+
+  <tag>
+    <description>
+       Conducts a transformation given a source XML document
+       and an XSLT stylesheet
+    </description>
+    <name>transform</name>
+    <tag-class>org.apache.taglibs.standard.tag.rt.xml.TransformTag</tag-class>
+    <tei-class>org.apache.taglibs.standard.tei.XmlTransformTEI</tei-class>
+    <body-content>JSP</body-content>
+    <attribute>
+        <description>
+Name of the exported
+scoped variable for the
+transformed XML
+document. The type of the
+scoped variable is
+org.w3c.dom.Document.
+        </description>
+        <name>var</name>
+        <required>false</required>
+        <rtexprvalue>false</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+Scope for var.
+        </description>
+        <name>scope</name>
+        <required>false</required>
+        <rtexprvalue>false</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+Result
+Object that captures or
+processes the transformation
+result.
+        </description>
+        <name>result</name>
+        <required>false</required>
+        <rtexprvalue>true</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+Deprecated. Use attribute
+'doc' instead.
+        </description>
+        <name>xml</name>
+        <required>false</required>
+        <rtexprvalue>true</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+Source XML document to be
+transformed. (If exported by
+&lt;x:set&gt;, it must correspond
+to a well-formed XML
+document, not a partial
+document.)
+        </description>
+        <name>doc</name>
+        <required>false</required>
+        <rtexprvalue>true</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+Deprecated. Use attribute
+'docSystemId' instead.
+        </description>
+        <name>xmlSystemId</name>
+        <required>false</required>
+        <rtexprvalue>true</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+The system identifier (URI)
+for parsing the XML
+document.
+        </description>
+        <name>docSystemId</name>
+        <required>false</required>
+        <rtexprvalue>true</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+javax.xml.transform.Source
+Transformation stylesheet as
+a String, Reader, or
+Source object.
+        </description>
+       <name>xslt</name>
+        <required>false</required>
+        <rtexprvalue>true</rtexprvalue>
+    </attribute>
+    <attribute>
+        <description>
+The system identifier (URI)
+for parsing the XSLT
+stylesheet.
+        </description>
+       <name>xsltSystemId</name>
+        <required>false</required>
+        <rtexprvalue>true</rtexprvalue>
+    </attribute>
+  </tag>
+
+  <tag>
+    <description>
+        Subtag of &lt;choose&gt; that includes its body if its
+        expression evalutes to 'true'
+    </description>
+    <name>when</name>
+    <tag-class>org.apache.taglibs.standard.tag.common.xml.WhenTag</tag-class>
+    <body-content>JSP</body-content>
+    <attribute>
+        <description>
+The test condition that tells whether or
+not the body content should be
+processed
+        </description>
+        <name>select</name>
+        <required>true</required>
+        <rtexprvalue>false</rtexprvalue>
+    </attribute>
+  </tag>
+
+</taglib>
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/xalan-2.6.0.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/xalan-2.6.0.jar
deleted file mode 100644 (file)
index 73cf175..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/xalan-2.6.0.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/xalan-2.7.0.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/xalan-2.7.0.jar
new file mode 100644 (file)
index 0000000..007be39
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/xalan-2.7.0.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/xmlParserAPIs-2.6.2.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/xmlParserAPIs-2.6.2.jar
deleted file mode 100644 (file)
index 2dd8377..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/xmlParserAPIs-2.6.2.jar and /dev/null differ
similarity index 55%
rename from eu.etaxonomy.taxeditor.cdmlib/lib/xmlbeans-2.3.0.jar
rename to eu.etaxonomy.taxeditor.cdmlib/lib/xmlbeans-2.6.0.jar
index ccd8163421ba8d0361315fb947f2432f1e6d7a83..d1b66271f5e379403207383db4ff6e4b9c4e24dd 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/xmlbeans-2.3.0.jar and b/eu.etaxonomy.taxeditor.cdmlib/lib/xmlbeans-2.6.0.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/xmlunit-1.4.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/xmlunit-1.4.jar
deleted file mode 100644 (file)
index d7c072d..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/xmlunit-1.4.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/xmlunit-1.6.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/xmlunit-1.6.jar
new file mode 100644 (file)
index 0000000..b9328ef
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/xmlunit-1.6.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/xom-1.0.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/xom-1.0.jar
deleted file mode 100644 (file)
index 22cd958..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/xom-1.0.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/xom-1.2.5.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/xom-1.2.5.jar
new file mode 100644 (file)
index 0000000..1f71ab9
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/xom-1.2.5.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/xsom-20140925.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/xsom-20140925.jar
new file mode 100644 (file)
index 0000000..f391598
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/xsom-20140925.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/xstream-1.4.4.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/xstream-1.4.4.jar
deleted file mode 100644 (file)
index dcedd5a..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/xstream-1.4.4.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/xstream-1.4.8.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/xstream-1.4.8.jar
new file mode 100644 (file)
index 0000000..a493c3b
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/xstream-1.4.8.jar differ
index 3369711696df66cf3a600b5f6f14640429d4cf89..09b3a2e08d5bdae772fe6a0de5606f0b44f2b8e8 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>eu.etaxonomy</groupId>
-    <artifactId>taxeditor-parent</artifactId>
-    <version>3.8.0-SNAPSHOT</version>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <artifactId>eu.etaxonomy.taxeditor.cdmlib</artifactId>
-  <packaging>eclipse-plugin</packaging>
-  <name>CDM Library Dependencies Plugin</name>
-  <description>CDM Library and dependencies as a plugin</description>
-  <build>
-    <plugins>      
-      <plugin>
-       <groupId>org.apache.maven.plugins</groupId>
-       <artifactId>maven-dependency-plugin</artifactId>
-       <version>2.4</version>
-       <executions>
-         <execution>
-           <id>copy-dependencies</id>
-           <phase>validate</phase>
-           <goals>
-             <goal>copy-dependencies</goal>
-           </goals>
-           <configuration>
-             <includeArtifactIds>cdmlib-commons,cdmlib-model,cdmlib-persistence,cdmlib-remote,cdmlib-print,cdmlib-services,cdmlib-ext,cdmlib-io</includeArtifactIds>
-             <outputDirectory>lib</outputDirectory>
-             <overWriteReleases>true</overWriteReleases>
-             <overWriteSnapshots>true</overWriteSnapshots>
-             <excludeTransitive>true</excludeTransitive>             
-           </configuration>
-         </execution>
-         <execution>
-           <id>copy-dependencies-sources</id>
-           <phase>validate</phase>
-           <goals>
-             <goal>copy-dependencies</goal>
-           </goals>
-           <configuration>
-             <classifier>sources</classifier>
-             <includeArtifactIds>cdmlib-commons,cdmlib-model,cdmlib-persistence,cdmlib-remote,cdmlib-print,cdmlib-services,cdmlib-ext,cdmlib-io</includeArtifactIds>
-             <outputDirectory>lib</outputDirectory>
-             <overWriteReleases>true</overWriteReleases>
-             <overWriteSnapshots>true</overWriteSnapshots>
-             <excludeTransitive>true</excludeTransitive>
-             <failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>
-           </configuration>
-         </execution>
-       </executions>
-      </plugin>
-      <plugin>
-       <groupId>org.apache.maven.plugins</groupId>
-       <artifactId>maven-antrun-plugin</artifactId>
-       <version>1.7</version>
-       <executions>
-         <execution>
-           <id>remove-existing-jars</id>
-           <phase>clean</phase>
-           <goals>
-             <goal>run</goal>
-           </goals>
-           <configuration>
-             <target>
-               <echo>Remove all cdmlib jars</echo>
-               <delete>
-                 <fileset dir="./lib" includes="cdmlib-*" />
-               </delete>
-             </target> 
-           </configuration>
-         </execution>
-         <execution>
-           <id>update-snapshot-jar-names</id>
-           <phase>validate</phase>
-           <goals>
-             <goal>run</goal>
-           </goals>
-           <configuration>           
-             <target>
-               <echo>Update cdmlib jars to SNAPSHOT when build with timestamp</echo>
-               <move todir="./lib">
-                 <fileset dir="./lib" />
-                 <mapper type="regexp" from="(^cdmlib\-.*\-[0-9]\.[0-9]\.[0-9]\-)[0-9.-]+(\.jar)" to="\1SNAPSHOT\2" />
-               </move>                           
-               <move todir="./lib">
-                 <fileset dir="./lib" />
-                 <mapper type="regexp" from="(^cdmlib\-.*\-[0-9]\.[0-9]\.[0-9]\-)[0-9.-]+(\-sources\.jar)" to="\1SNAPSHOT\2" />
-               </move>                           
-             </target> 
-           </configuration>
-         </execution>
-       </executions>
-      </plugin>
-    </plugins>
-  </build>
-  <dependencies>
-    <dependency>
-      <groupId>identificationKeyAPI</groupId>
-      <artifactId>identificationKeyAPI</artifactId>
-      <version>1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>eu.etaxonomy</groupId>
-      <artifactId>cdmlib-commons</artifactId>
-      <version>${cdmlib.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>eu.etaxonomy</groupId>
-      <artifactId>cdmlib-model</artifactId>
-      <version>${cdmlib.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>eu.etaxonomy</groupId>
-      <artifactId>cdmlib-persistence</artifactId>
-      <version>${cdmlib.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>eu.etaxonomy</groupId>
-      <artifactId>cdmlib-remote</artifactId>
-      <version>${cdmlib.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>eu.etaxonomy</groupId>
-      <artifactId>cdmlib-print</artifactId>
-      <version>${cdmlib.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>eu.etaxonomy</groupId>
-      <artifactId>cdmlib-services</artifactId>
-      <version>${cdmlib.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>eu.etaxonomy</groupId>
-      <artifactId>cdmlib-io</artifactId>
-      <version>${cdmlib.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>eu.etaxonomy</groupId>
-      <artifactId>cdmlib-ext</artifactId>
-      <version>${cdmlib.version}</version>
-    </dependency>
-       <dependency>
-      <groupId>org.aspectj</groupId>
-      <artifactId>aspectjrt</artifactId>
-         <version>1.7.1</version>
-       </dependency>
-         <dependency>
-         <groupId>org.aspectj</groupId>
-         <artifactId>aspectjweaver</artifactId>
-         <version>1.7.1</version>
-        </dependency>
-        
-    <!--  for ikey-plus 
-        TODO this should not be needed but the utils class contained  in this jar 
-        seems to be loaded as bean by spring
-    -->
-  </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
+  <parent>\r
+    <groupId>eu.etaxonomy</groupId>\r
+    <artifactId>taxeditor-parent</artifactId>\r
+    <version>4.0.0-SNAPSHOT</version>\r
+  </parent>\r
+  <modelVersion>4.0.0</modelVersion>\r
+  <artifactId>eu.etaxonomy.taxeditor.cdmlib</artifactId>\r
+  <packaging>eclipse-plugin</packaging>\r
+  <name>CDM Library Dependencies Plugin</name>\r
+  <description>CDM Library and dependencies as a plugin</description>\r
+\r
+  <build>\r
+    <pluginManagement>\r
+      <plugins>\r
+        <plugin>\r
+          <groupId>org.apache.maven.plugins</groupId>\r
+          <artifactId>maven-surefire-plugin</artifactId>\r
+          <version>2.7</version>\r
+        </plugin>\r
+      </plugins>\r
+    </pluginManagement>\r
+    <plugins>\r
+      <plugin>\r
+        <groupId>org.apache.maven.plugins</groupId>\r
+        <artifactId>maven-dependency-plugin</artifactId>\r
+        <version>2.4</version>\r
+        <executions>\r
+          <execution>\r
+            <id>copy-dependencies</id>\r
+            <phase>validate</phase>\r
+            <goals>\r
+              <goal>copy-dependencies</goal>\r
+            </goals>\r
+            <configuration>\r
+              <excludeArtifactIds>\r
+                cdmlib-remote-webapp\r
+              </excludeArtifactIds>\r
+              <includeArtifactIds>\r
+                cdmlib-services,cdmlib-commons,cdmlib-persistence,cdmlib-ext,cdmlib-model,cdmlib-io,cdmlib-print,cdmlib-remote,cdmlib-test\r
+              </includeArtifactIds>\r
+              <outputDirectory>${basedir}/lib</outputDirectory>\r
+              <overWriteReleases>true</overWriteReleases>\r
+              <overWriteSnapshots>true</overWriteSnapshots>\r
+              <excludeTransitive>true</excludeTransitive>\r
+            </configuration>\r
+          </execution>\r
+          <execution>\r
+            <id>copy-dependency-war</id>\r
+            <phase>validate</phase>\r
+            <goals>\r
+              <goal>copy-dependencies</goal>\r
+            </goals>\r
+            <configuration>\r
+              <includeArtifactIds>\r
+                cdmlib-remote-webapp\r
+              </includeArtifactIds>\r
+              <outputDirectory>\r
+                ${basedir}/src/main/resources/etc/jetty\r
+              </outputDirectory>\r
+              <overWriteReleases>true</overWriteReleases>\r
+              <overWriteSnapshots>true</overWriteSnapshots>\r
+              <excludeTransitive>true</excludeTransitive>\r
+            </configuration>\r
+          </execution>\r
+        </executions>\r
+      </plugin>\r
+      <plugin>\r
+        <groupId>org.apache.maven.plugins</groupId>\r
+        <artifactId>maven-antrun-plugin</artifactId>\r
+        <version>1.7</version>\r
+        <executions>\r
+          <execution>\r
+            <id>update-snapshot-jar-names</id>\r
+            <phase>validate</phase>\r
+            <goals>\r
+              <goal>run</goal>\r
+            </goals>\r
+            <configuration>\r
+              <target>\r
+                <echo>Anonymizing war</echo>\r
+                <move todir="./src/main/resources/etc/jetty">\r
+                  <fileset dir="./src/main/resources/etc/jetty" />\r
+                  <mapper type="regexp"\r
+                    from="(^cdmlib\-remote\-webapp).*(\.war)" to="\1\2" />\r
+                </move>\r
+                <echo>Update cdmlib jars to SNAPSHOT when build with\r
+                  timestamp\r
+                </echo>\r
+                <move todir="./lib">\r
+                  <fileset dir="./lib" />\r
+                  <mapper type="regexp"\r
+                    from="(^cdmlib\-.*\-\d+\.\d+\.\d+\-)[\d.-]+(\.jar)"\r
+                    to="\1SNAPSHOT\2" />\r
+                </move>\r
+                <move todir="./lib">\r
+                  <fileset dir="./lib" />\r
+                  <mapper type="regexp"\r
+                    from="(^cdmlib\-.*\-\d+\.\d+\.\d+\-)[\d.-]+(\-sources\.jar)"\r
+                    to="\1SNAPSHOT\2" />\r
+                </move>\r
+              </target>\r
+            </configuration>\r
+          </execution>\r
+          <execution>\r
+            <id>remove-existing-jars</id>\r
+            <phase>clean</phase>\r
+            <goals>\r
+              <goal>run</goal>\r
+            </goals>\r
+            <configuration>\r
+              <target>\r
+                <echo>Remove all cdmlib jars</echo>\r
+                <delete>\r
+                  <fileset dir="./lib" includes="cdmlib-*" />\r
+                </delete>\r
+              </target>\r
+            </configuration>\r
+          </execution>\r
+        </executions>\r
+      </plugin>\r
+    </plugins>\r
+  </build>\r
+  <profiles>\r
+    <profile>\r
+      <id>copyAllJars</id>\r
+      <build>\r
+        <plugins>\r
+          <plugin>\r
+            <groupId>org.apache.maven.plugins</groupId>\r
+            <artifactId>maven-dependency-plugin</artifactId>\r
+            <version>2.4</version>\r
+            <executions>\r
+              <execution>\r
+                <id>copy-all-dependencies</id>\r
+                <phase>validate</phase>\r
+                <goals>\r
+                  <goal>copy-dependencies</goal>\r
+                </goals>\r
+                <configuration>\r
+                  <excludeArtifactIds>\r
+                    cdmlib-remote-webapp\r
+                  </excludeArtifactIds>\r
+                  <outputDirectory>${basedir}/lib</outputDirectory>\r
+                  <overWriteReleases>true</overWriteReleases>\r
+                  <overWriteSnapshots>true</overWriteSnapshots>\r
+                  <excludeTransitive>true</excludeTransitive>\r
+                </configuration>\r
+              </execution>\r
+            </executions>\r
+          </plugin>\r
+        </plugins>\r
+      </build>\r
+    </profile>\r
+  </profiles>\r
+  <repositories>\r
+    <repository>\r
+      <id>SpringSource Enterprise Bundle Repository - External Bundle\r
+        Milestones\r
+      </id>\r
+      <url>http://repository.springsource.com/maven/bundles/milestone\r
+      </url>\r
+    </repository>\r
+    <repository>\r
+      <id>SpringSource Enterprise Bundle Repository - SpringSource\r
+        Bundle\r
+        Releases\r
+      </id>\r
+      <url>http://repository.springsource.com/maven/bundles/release\r
+      </url>\r
+    </repository>\r
+    <repository>\r
+      <id>SpringSource Enterprise Bundle Repository - External Bundle\r
+        Releases\r
+      </id>\r
+      <url>http://repository.springsource.com/maven/bundles/external\r
+      </url>\r
+    </repository>\r
+        <repository>\r
+        <id>repository.springsource.release</id>\r
+        <name>SpringSource GA Repository</name>\r
+        <url>http://repo.springsource.org/release</url>\r
+    </repository>\r
+  </repositories>\r
+  <dependencies>\r
+    <dependency>\r
+      <groupId>eu.etaxonomy</groupId>\r
+      <artifactId>cdmlib-remote-webapp</artifactId>\r
+      <version>${cdmlib.version}</version>\r
+      <type>war</type>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>eu.etaxonomy</groupId>\r
+      <artifactId>cdmlib-commons</artifactId>\r
+      <version>${cdmlib.version}</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>eu.etaxonomy</groupId>\r
+      <artifactId>cdmlib-model</artifactId>\r
+      <version>${cdmlib.version}</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>eu.etaxonomy</groupId>\r
+      <artifactId>cdmlib-persistence</artifactId>\r
+      <version>${cdmlib.version}</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>eu.etaxonomy</groupId>\r
+      <artifactId>cdmlib-remote</artifactId>\r
+      <version>${cdmlib.version}</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>eu.etaxonomy</groupId>\r
+      <artifactId>cdmlib-print</artifactId>\r
+      <version>${cdmlib.version}</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>eu.etaxonomy</groupId>\r
+      <artifactId>cdmlib-services</artifactId>\r
+      <version>${cdmlib.version}</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>eu.etaxonomy</groupId>\r
+      <artifactId>cdmlib-io</artifactId>\r
+      <version>${cdmlib.version}</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>eu.etaxonomy</groupId>\r
+      <artifactId>cdmlib-ext</artifactId>\r
+      <version>${cdmlib.version}</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>eu.etaxonomy</groupId>\r
+      <artifactId>cdmlib-test</artifactId>\r
+      <version>${cdmlib.version}</version>\r
+    </dependency>\r
+\r
+    <!-- <dependency> -->\r
+    <!-- <groupId>org.eclipse.jetty</groupId> -->\r
+    <!-- <artifactId>jetty-server</artifactId> -->\r
+    <!-- <version>9.1.3.v20140225</version> -->\r
+    <!-- </dependency> -->\r
+    <!-- <dependency> -->\r
+    <!-- <groupId>org.eclipse.jetty</groupId> -->\r
+    <!-- <artifactId>jetty-util</artifactId> -->\r
+    <!-- <version>9.1.3.v20140225</version> -->\r
+    <!-- </dependency> -->\r
+    <!-- <dependency> -->\r
+    <!-- <groupId>org.eclipse.jetty</groupId> -->\r
+    <!-- <artifactId>jetty-xml</artifactId> -->\r
+    <!-- <version>9.1.3.v20140225</version> -->\r
+    <!-- </dependency> -->\r
+    <!-- <dependency> -->\r
+    <!-- <groupId>org.eclipse.jetty</groupId> -->\r
+    <!-- <artifactId>jetty-servlet</artifactId> -->\r
+    <!-- <version>9.1.3.v20140225</version> -->\r
+    <!-- </dependency> -->\r
+    <!-- <dependency> -->\r
+    <!-- <groupId>org.eclipse.jetty</groupId> -->\r
+    <!-- <artifactId>jetty-webapp</artifactId> -->\r
+    <!-- <version>9.1.3.v20140225</version> -->\r
+    <!-- </dependency> -->\r
+    <!-- <dependency> -->\r
+    <!-- <groupId>org.eclipse.jetty</groupId> -->\r
+    <!-- <artifactId>jetty-security</artifactId> -->\r
+    <!-- <version>9.1.3.v20140225</version> -->\r
+    <!-- </dependency> -->\r
+    <!-- <dependency> -->\r
+    <!-- <groupId>org.eclipse.jetty</groupId> -->\r
+    <!-- <artifactId>jetty-http</artifactId> -->\r
+    <!-- <version>${jetty.version}</version> -->\r
+    <!-- </dependency> -->\r
+    <!-- <dependency> -->\r
+    <!-- <groupId>org.eclipse.jetty</groupId> -->\r
+    <!-- <artifactId>jetty-io</artifactId> -->\r
+    <!-- <version>${jetty.version}</version> -->\r
+    <!-- </dependency> -->\r
+    <!-- <dependency> -->\r
+    <!-- <groupId>javax.servlet</groupId> -->\r
+    <!-- <artifactId>javax.servlet-api</artifactId> -->\r
+    <!-- <version>3.1.0</version> -->\r
+    <!-- </dependency> -->\r
+\r
+    <!-- <dependency> -->\r
+    <!-- <groupId>javax.servlet</groupId> -->\r
+    <!-- <artifactId>jsp-api</artifactId> -->\r
+    <!-- <version>2.0</version> -->\r
+    <!-- </dependency> -->\r
+\r
+    <dependency>\r
+      <groupId>net.sf.ehcache</groupId>\r
+      <artifactId>ehcache-core</artifactId>\r
+      <version>2.4.3</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.hibernate</groupId>\r
+      <artifactId>hibernate-core</artifactId>\r
+      <version>4.1.10.Final</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.hibernate.common</groupId>\r
+      <artifactId>hibernate-commons-annotations</artifactId>\r
+      <version>4.0.1.Final</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.hibernate</groupId>\r
+      <artifactId>hibernate-search-engine</artifactId>\r
+      <version>4.2.0.Final</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.hibernate.javax.persistence</groupId>\r
+      <artifactId>hibernate-jpa-2.0-api</artifactId>\r
+      <version>1.0.1.Final</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.hibernate</groupId>\r
+      <artifactId>hibernate-envers</artifactId>\r
+      <version>4.1.10.Final</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.hibernate</groupId>\r
+      <artifactId>hibernate-entitymanager</artifactId>\r
+      <version>4.1.10.Final</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>dom4j</groupId>\r
+      <artifactId>dom4j</artifactId>\r
+      <version>1.6</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.jadira.usertype</groupId>\r
+      <artifactId>usertype.jodatime</artifactId>\r
+      <version>2.0.1</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.jadira.usertype</groupId>\r
+      <artifactId>usertype.spi</artifactId>\r
+      <version>2.0.1</version>\r
+    </dependency>\r
+\r
+    <dependency>\r
+      <groupId>junit</groupId>\r
+      <artifactId>junit</artifactId>\r
+      <version>4.11</version>\r
+      <scope>test</scope>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>log4j</groupId>\r
+      <artifactId>log4j</artifactId>\r
+      <version>1.2.17</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.jdom</groupId>\r
+      <artifactId>jdom</artifactId>\r
+      <version>1.1.3</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.springframework</groupId>\r
+      <artifactId>spring-context</artifactId>\r
+      <version>4.2.4.RELEASE</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.springframework</groupId>\r
+      <artifactId>spring-context-support</artifactId>\r
+      <version>4.2.4.RELEASE</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.springframework</groupId>\r
+      <artifactId>spring-aspects</artifactId>\r
+      <version>4.2.4.RELEASE</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.springframework</groupId>\r
+      <artifactId>spring-test</artifactId>\r
+      <version>4.2.4.RELEASE</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.springframework</groupId>\r
+      <artifactId>spring-beans</artifactId>\r
+      <version>4.2.4.RELEASE</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.springframework</groupId>\r
+      <artifactId>spring-tx</artifactId>\r
+      <version>4.2.4.RELEASE</version>\r
+    </dependency>\r
+    <dependency>\r
+               <groupId>org.springframework</groupId>\r
+               <artifactId>spring-web</artifactId>\r
+               <version>4.2.4.RELEASE</version>\r
+       </dependency>\r
+    <dependency>\r
+      <groupId>org.springframework</groupId>\r
+      <artifactId>spring-core</artifactId>\r
+      <version>4.2.4.RELEASE</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.springframework</groupId>\r
+      <artifactId>spring-aop</artifactId>\r
+      <version>4.2.4.RELEASE</version>\r
+    </dependency>\r
+    <dependency>\r
+               <groupId>org.springframework</groupId>\r
+               <artifactId>spring-expression</artifactId>\r
+               <version>4.2.4.RELEASE</version>\r
+       </dependency>\r
+   <dependency>\r
+               <groupId>org.springframework</groupId>\r
+               <artifactId>spring-orm</artifactId>\r
+               <version>4.2.4.RELEASE</version>\r
+       </dependency>\r
+    <dependency>\r
+               <groupId>org.springframework</groupId>\r
+               <artifactId>spring-jdbc</artifactId>\r
+               <version>4.2.4.RELEASE</version>\r
+       </dependency>\r
+    <dependency>\r
+      <groupId>org.springframework.security</groupId>\r
+      <artifactId>spring-security-core</artifactId>\r
+      <version>4.0.3.RELEASE</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.springframework.security</groupId>\r
+      <artifactId>spring-security-config</artifactId>\r
+      <version>4.0.3.RELEASE</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.springframework.security</groupId>\r
+      <artifactId>spring-security-remoting</artifactId>\r
+      <version>4.0.3.RELEASE</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.jboss.logging</groupId>\r
+      <artifactId>jboss-logging</artifactId>\r
+      <version>3.1.3.GA</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.hamcrest</groupId>\r
+      <artifactId>hamcrest-core</artifactId>\r
+      <version>1.3</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>com.mchange</groupId>\r
+      <artifactId>c3p0</artifactId>\r
+      <version>0.9.2</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.jboss.spec.javax.transaction</groupId>\r
+      <artifactId>jboss-transaction-api_1.1_spec</artifactId>\r
+      <version>1.0.0.Final</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.aspectj</groupId>\r
+      <artifactId>aspectjrt</artifactId>\r
+      <version>1.7.1</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>commons-logging</groupId>\r
+      <artifactId>commons-logging</artifactId>\r
+      <version>1.1.1</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>commons-lang</groupId>\r
+      <artifactId>commons-lang</artifactId>\r
+      <version>2.6</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>aopalliance</groupId>\r
+      <artifactId>aopalliance</artifactId>\r
+      <version>1.0</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>joda-time</groupId>\r
+      <artifactId>joda-time</artifactId>\r
+      <version>2.1</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>com.ibm.lsid</groupId>\r
+      <artifactId>lsid-client</artifactId>\r
+      <version>1.1.2</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>com.ibm.lsid</groupId>\r
+      <artifactId>lsid-server</artifactId>\r
+      <version>1.1.2</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.apache.lucene</groupId>\r
+      <artifactId>lucene-core</artifactId>\r
+      <version>3.6.2</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.slf4j</groupId>\r
+      <artifactId>slf4j-api</artifactId>\r
+      <version>1.7.2</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.javassist</groupId>\r
+      <artifactId>javassist</artifactId>\r
+      <version>3.17.1-GA</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>au.com.bytecode</groupId>\r
+      <artifactId>opencsv</artifactId>\r
+      <version>2.4</version>\r
+    </dependency>\r
+\r
+    <!-- For Unit Tests Start -->\r
+\r
+    <dependency>\r
+      <groupId>org.unitils</groupId>\r
+      <artifactId>unitils-core</artifactId>\r
+      <version>3.4.2</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.unitils</groupId>\r
+      <artifactId>unitils-spring</artifactId>\r
+      <version>3.4.2</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.unitils</groupId>\r
+      <artifactId>unitils-database</artifactId>\r
+      <version>3.4.2</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>commons-dbcp</groupId>\r
+      <artifactId>commons-dbcp</artifactId>\r
+      <version>1.4</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>commons-pool</groupId>\r
+      <artifactId>commons-pool</artifactId>\r
+      <version>1.5.4</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.unitils</groupId>\r
+      <artifactId>unitils-dbmaintainer</artifactId>\r
+      <version>3.4.2</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>com.h2database</groupId>\r
+      <artifactId>h2</artifactId>\r
+      <version>1.4.181</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.unitils</groupId>\r
+      <artifactId>unitils-dbunit</artifactId>\r
+      <version>3.4.2</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.dbunit</groupId>\r
+      <artifactId>dbunit</artifactId>\r
+      <version>2.4.9</version>\r
+    </dependency>\r
+    <!-- For Unit Tests End -->\r
+\r
+    <!-- For Hibernate Mapping Start -->\r
+    <dependency>\r
+      <groupId>wsdl4j</groupId>\r
+      <artifactId>wsdl4j</artifactId>\r
+      <version>1.6.3</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>javax.validation</groupId>\r
+      <artifactId>validation-api</artifactId>\r
+      <version>1.1.0.Final</version>\r
+    </dependency>\r
+    <!-- For Hibernate Mapping End -->\r
+\r
+       <dependency>\r
+               <groupId>com.itextpdf</groupId>\r
+               <artifactId>itextpdf</artifactId>\r
+               <version>5.5.8</version>\r
+               <scope>compile</scope>\r
+       </dependency>\r
+    \r
+\r
+  </dependencies>\r
+</project>\r
+
diff --git a/eu.etaxonomy.taxeditor.cdmlib/resources/cdm.map.ser b/eu.etaxonomy.taxeditor.cdmlib/resources/cdm.map.ser
new file mode 100644 (file)
index 0000000..931f12e
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/resources/cdm.map.ser differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationException.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationException.java
new file mode 100644 (file)
index 0000000..c17e167
--- /dev/null
@@ -0,0 +1,23 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.api.application;
+
+/**
+ * @author cmathew
+ * @date 18 Jun 2015
+ *
+ */
+public class CdmApplicationException extends Exception {
+
+    public CdmApplicationException(Exception ex) {
+        super(ex);
+    }
+
+}
index 90cfc09909bd84ff974481bfed98d01ecaa83cfe..c9f360f44b6669cb364d064bcc174b7fefacb763 100644 (file)
@@ -1,28 +1,96 @@
 /**\r
-* Copyright (C) 2014 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
+ * Copyright (C) 2014 EDIT\r
+ * European Distributed Institute of Taxonomy\r
+ * http://www.e-taxonomy.eu\r
+ *\r
+ * The contents of this file are subject to the Mozilla Public License Version 1.1\r
+ * See LICENSE.TXT at the top of this package for the full license terms.\r
+ */\r
 \r
 package eu.etaxonomy.cdm.api.application;\r
 \r
-import javax.sql.DataSource;\r
-\r
-import org.hibernate.SessionFactory;\r
+import java.util.ArrayList;\r
+import java.util.Arrays;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+import java.util.Map;\r
 \r
 import org.apache.log4j.Logger;\r
-import org.springframework.beans.factory.annotation.Autowired;\r
+import org.springframework.beans.BeansException;\r
+import org.springframework.context.ApplicationContext;\r
+import org.springframework.context.ApplicationContextAware;\r
+import org.springframework.remoting.httpinvoker.HttpComponentsHttpInvokerRequestExecutor;\r
+import org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean;\r
+import org.springframework.security.access.AccessDecisionVoter;\r
+import org.springframework.security.authentication.AuthenticationProvider;\r
+import org.springframework.security.authentication.ProviderManager;\r
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;\r
+import org.springframework.security.authentication.dao.DaoAuthenticationProvider;\r
+import org.springframework.security.authentication.dao.ReflectionSaltSource;\r
+import org.springframework.security.authentication.encoding.Md5PasswordEncoder;\r
+import org.springframework.security.core.Authentication;\r
+import org.springframework.security.core.context.SecurityContext;\r
+import org.springframework.security.core.context.SecurityContextHolder;\r
 import org.springframework.stereotype.Component;\r
 import org.springframework.transaction.PlatformTransactionManager;\r
 import org.springframework.transaction.TransactionStatus;\r
 \r
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
 import eu.etaxonomy.cdm.api.conversation.ConversationHolderMock;\r
+import eu.etaxonomy.cdm.api.service.IAgentService;\r
+import eu.etaxonomy.cdm.api.service.IAnnotationService;\r
+import eu.etaxonomy.cdm.api.service.IClassificationService;\r
+import eu.etaxonomy.cdm.api.service.ICollectionService;\r
+import eu.etaxonomy.cdm.api.service.ICommonService;\r
 import eu.etaxonomy.cdm.api.service.IDatabaseService;\r
+import eu.etaxonomy.cdm.api.service.IDescriptionService;\r
+import eu.etaxonomy.cdm.api.service.IEntityConstraintViolationService;\r
+import eu.etaxonomy.cdm.api.service.IEntityValidationService;\r
+import eu.etaxonomy.cdm.api.service.IEventBaseService;\r
+import eu.etaxonomy.cdm.api.service.IFeatureNodeService;\r
+import eu.etaxonomy.cdm.api.service.IFeatureTreeService;\r
+import eu.etaxonomy.cdm.api.service.IGrantedAuthorityService;\r
+import eu.etaxonomy.cdm.api.service.IGroupService;\r
+import eu.etaxonomy.cdm.api.service.IIdentificationKeyService;\r
+import eu.etaxonomy.cdm.api.service.ILocationService;\r
+import eu.etaxonomy.cdm.api.service.IMediaService;\r
+import eu.etaxonomy.cdm.api.service.IMetadataService;\r
+import eu.etaxonomy.cdm.api.service.INameService;\r
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;\r
+import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService;\r
+import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;\r
+import eu.etaxonomy.cdm.api.service.IProgressMonitorService;\r
+import eu.etaxonomy.cdm.api.service.IReferenceService;\r
+import eu.etaxonomy.cdm.api.service.IService;\r
+import eu.etaxonomy.cdm.api.service.ITaxonNodeService;\r
+import eu.etaxonomy.cdm.api.service.ITaxonService;\r
+import eu.etaxonomy.cdm.api.service.ITermService;\r
+import eu.etaxonomy.cdm.api.service.ITestService;\r
+import eu.etaxonomy.cdm.api.service.IUserService;\r
+import eu.etaxonomy.cdm.api.service.IVocabularyService;\r
+import eu.etaxonomy.cdm.api.service.IWorkingSetService;\r
+import eu.etaxonomy.cdm.api.service.molecular.IAmplificationService;\r
+import eu.etaxonomy.cdm.api.service.molecular.IPrimerService;\r
+import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;\r
 import eu.etaxonomy.cdm.ext.geo.IEditGeoService;\r
+import eu.etaxonomy.cdm.io.service.IIOService;\r
+import eu.etaxonomy.cdm.model.common.CdmBase;\r
+import eu.etaxonomy.cdm.persistence.hibernate.permission.CdmPermissionEvaluator;\r
+import eu.etaxonomy.cdm.persistence.hibernate.permission.ICdmPermissionEvaluator;\r
+import eu.etaxonomy.cdm.persistence.hibernate.permission.UnanimousBasedUnrevokable;\r
+import eu.etaxonomy.cdm.persistence.hibernate.permission.voter.DescriptionBaseVoter;\r
+import eu.etaxonomy.cdm.persistence.hibernate.permission.voter.DescriptionElementVoter;\r
+import eu.etaxonomy.cdm.persistence.hibernate.permission.voter.GrantAlwaysVoter;\r
+import eu.etaxonomy.cdm.persistence.hibernate.permission.voter.TaxonBaseVoter;\r
+import eu.etaxonomy.cdm.persistence.hibernate.permission.voter.TaxonNodeVoter;\r
+import eu.etaxonomy.taxeditor.remoting.source.ICdmRemoteSource;\r
+import eu.etaxonomy.taxeditor.service.CachedCommonServiceImpl;\r
+import eu.etaxonomy.taxeditor.service.CdmAuthenticatedHttpInvokerRequestExecutor;\r
+import eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor;\r
+import eu.etaxonomy.taxeditor.service.ICachedCommonService;\r
+import eu.etaxonomy.taxeditor.service.TermServiceRequestExecutor;\r
+import eu.etaxonomy.taxeditor.session.CdmEntitySessionManager;\r
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;\r
 \r
 \r
 /**\r
@@ -31,85 +99,383 @@ import eu.etaxonomy.cdm.ext.geo.IEditGeoService;
  *\r
  */\r
 @Component\r
-public class CdmApplicationRemoteConfiguration extends CdmApplicationDefaultConfiguration {\r
-       \r
-       @SuppressWarnings("unused")\r
-       private static final Logger logger = Logger.getLogger(CdmApplicationRemoteConfiguration.class);\r
-\r
-       @Autowired\r
-       IEditGeoService editGeoService;\r
-       \r
-       public CdmApplicationRemoteConfiguration() {\r
-       }\r
-       \r
+public class CdmApplicationRemoteConfiguration implements ICdmApplicationConfiguration, ApplicationContextAware  {\r
+\r
+    @SuppressWarnings("unused")\r
+    private static final Logger logger = Logger.getLogger(CdmApplicationRemoteConfiguration.class);\r
+\r
+    protected ApplicationContext applicationContext;\r
+\r
+    private ICdmRemoteSource remoteSource;\r
+\r
+    private Map serviceMap = new HashMap<Class<IService>, IService>();\r
+\r
+    private ICdmEntitySessionManager cdmEntitySessionManager;\r
+\r
+    private CdmPermissionEvaluator cdmPermissionEvaluator;\r
+\r
+    private ProviderManager authenticationManager;\r
+\r
+    private ICachedCommonService cachedCommonService;\r
+\r
+    public CdmApplicationRemoteConfiguration() {}\r
+\r
+    public CdmApplicationRemoteConfiguration(ICdmRemoteSource remoteSource) {\r
+        this.remoteSource = remoteSource;\r
+\r
+    }\r
+\r
+    public void setRemoteSource(ICdmRemoteSource remoteSource) {\r
+        this.remoteSource = remoteSource;\r
+    }\r
+\r
+    private Object getService(Class<?> clazz, String serviceSuffix, HttpComponentsHttpInvokerRequestExecutor executor) {\r
+        if(serviceMap.containsKey(clazz)) {\r
+            return serviceMap.get(clazz);\r
+        }\r
+        Object service = getService(clazz, serviceSuffix, remoteSource, executor);\r
+        serviceMap.put(clazz,  service);\r
+        return service;\r
+    }\r
+\r
+    public static Object getService(Class<?> clazz,\r
+            String serviceSuffix,\r
+            ICdmRemoteSource remoteSource,\r
+            HttpComponentsHttpInvokerRequestExecutor executor) {\r
+\r
+        String baseUrl;\r
+        if(remoteSource.getContextPath() == null || remoteSource.getContextPath().equals("")) {\r
+            baseUrl = "http://" + remoteSource.getServer() + ":" + String.valueOf(remoteSource.getPort());\r
+        } else {\r
+            baseUrl = "http://" + remoteSource.getServer()  + ":" + String.valueOf(remoteSource.getPort()) + "/" + remoteSource.getContextPath();\r
+        }\r
+        HttpInvokerProxyFactoryBean proxy = new HttpInvokerProxyFactoryBean();\r
+        proxy.setServiceInterface(clazz);\r
+        proxy.setServiceUrl(baseUrl + serviceSuffix);\r
+        if(executor != null) {\r
+            executor.setReadTimeout(0);\r
+            proxy.setHttpInvokerRequestExecutor(executor);\r
+        }\r
+        proxy.afterPropertiesSet();\r
+        return proxy.getObject();\r
+    }\r
+\r
+    // ****************************** APPLICATION CONTEXT *************************************************/\r
+\r
+    @Override\r
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException{\r
+        this.applicationContext = applicationContext;\r
+    }\r
+\r
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration#getTransactionManager()\r
      */\r
     @Override\r
     public PlatformTransactionManager getTransactionManager() throws UnsupportedOperationException {\r
-               throw new UnsupportedOperationException("getTransactionManager is not implemented for CdmApplicationRemoteConfiguration");\r
-       }\r
+        throw new UnsupportedOperationException("getTransactionManager is not implemented for CdmApplicationRemoteConfiguration");\r
+    }\r
 \r
 \r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#startTransaction()\r
+\r
+    /**\r
+     * @return\r
      */\r
+    public IEditGeoService getEditGeoService() {\r
+        return (IEditGeoService) getService(IEditGeoService.class, "/remoting/editgeo.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    /**\r
+     * @return\r
+     */\r
+    public ICachedCommonService getCachedCommonService(){\r
+        if(cachedCommonService == null) {\r
+            cachedCommonService = new CachedCommonServiceImpl();\r
+        }\r
+        return cachedCommonService;\r
+    }\r
+\r
+\r
+    public ICdmEntitySessionManager getCdmEntitySessionManager() {\r
+        if(cdmEntitySessionManager == null) {\r
+            cdmEntitySessionManager = new CdmEntitySessionManager();\r
+        }\r
+        return cdmEntitySessionManager;\r
+    }\r
+\r
+\r
+\r
+\r
+\r
+\r
+ // ****************************** GETTER *************************************************/\r
+\r
     @Override\r
-    public TransactionStatus startTransaction() throws UnsupportedOperationException {\r
-               throw new UnsupportedOperationException("startTransaction is not implemented for CdmApplicationRemoteConfiguration");\r
-       }\r
+    public final Object getBean(String name){\r
+        throw new UnsupportedOperationException("getBean is not implemented for CdmApplicationRemoteConfiguration");\r
+    }\r
+\r
+    @Override\r
+    public IAgentService getAgentService(){\r
+        return (IAgentService) getService(IAgentService.class, "/remoting/agent.service", new CdmServiceRequestExecutor());\r
+    }\r
 \r
+    @Override\r
+    public IAnnotationService getAnnotationService(){\r
+        return (IAnnotationService) getService(IAnnotationService.class, "/remoting/annotation.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IDatabaseService getDatabaseService(){\r
+        return (IDatabaseService) getService(IDatabaseService.class, "/remoting/database.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public INameService getNameService(){\r
+        return (INameService) getService(INameService.class, "/remoting/name.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IReferenceService getReferenceService(){\r
+        return (IReferenceService) getService(IReferenceService.class, "/remoting/reference.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public ITaxonService getTaxonService(){\r
+        return (ITaxonService) getService(ITaxonService.class, "/remoting/taxon.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IClassificationService getClassificationService(){\r
+        return (IClassificationService) getService(IClassificationService.class, "/remoting/classification.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public ITaxonNodeService getTaxonNodeService(){\r
+        return (ITaxonNodeService) getService(ITaxonNodeService.class, "/remoting/taxonnode.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IDescriptionService getDescriptionService(){\r
+        return (IDescriptionService) getService(IDescriptionService.class, "/remoting/description.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IOccurrenceService getOccurrenceService(){\r
+        return (IOccurrenceService) getService(IOccurrenceService.class, "/remoting/occurrence.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IPrimerService getPrimerService(){\r
+        return (IPrimerService) getService(IPrimerService.class, "/remoting/primer.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IAmplificationService getAmplificationService(){\r
+        return (IAmplificationService) getService(IAmplificationService.class, "/remoting/amplification.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public ISequenceService getSequenceService(){\r
+        return (ISequenceService) getService(ISequenceService.class, "/remoting/sequence.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IEventBaseService getEventBaseService() {\r
+        return (IEventBaseService) getService(IEventBaseService.class, "/remoting/eventbase.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IMediaService getMediaService(){\r
+        return (IMediaService) getService(IMediaService.class, "/remoting/media.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public ITermService getTermService(){\r
+        return (ITermService) getService(ITermService.class, "/remoting/term.service", new TermServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public ICommonService getCommonService(){\r
+        return (ICommonService) getService(ICommonService.class, "/remoting/common.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public ILocationService getLocationService(){\r
+        return (ILocationService) getService(ILocationService.class, "/remoting/location.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IUserService getUserService(){\r
+        return (IUserService) getService(IUserService.class, "/remoting-public/user.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+\r
+    public static IUserService getUserService(ICdmRemoteSource remoteSource) {\r
+        return (IUserService) getService(IUserService.class, "/remoting-public/user.service", remoteSource, new HttpComponentsHttpInvokerRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IMetadataService getMetadataService() {\r
+        return (IMetadataService) getService(IMetadataService.class, "/remoting-public/metadata.service", new HttpComponentsHttpInvokerRequestExecutor());\r
+    }\r
+\r
+    public static IMetadataService getMetadataService(ICdmRemoteSource remoteSource) {\r
+        return (IMetadataService) getService(IMetadataService.class, "/remoting-public/metadata.service", remoteSource, new HttpComponentsHttpInvokerRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IGrantedAuthorityService getGrantedAuthorityService(){\r
+        return (IGrantedAuthorityService) getService(IGrantedAuthorityService.class, "/remoting/grantedauthority.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IService<CdmBase> getMainService(){\r
+        return null;\r
+    }\r
+\r
+\r
+    @Override\r
+    public ProviderManager getAuthenticationManager(){\r
+        if(authenticationManager != null) {\r
+            return authenticationManager;\r
+        }\r
+\r
+        authenticationManager = getAuthenticationManager(getUserService());\r
+        return authenticationManager;\r
+    }\r
+\r
+    public static ProviderManager getAuthenticationManager(IUserService userService) {\r
+        Md5PasswordEncoder passwordEncoder = new Md5PasswordEncoder();\r
+        ReflectionSaltSource saltSource = new ReflectionSaltSource();\r
+        saltSource.setUserPropertyToUse("getUsername");\r
+\r
+        DaoAuthenticationProvider daoAuthenticationProvider = new DaoAuthenticationProvider();\r
+        daoAuthenticationProvider.setUserDetailsService(userService);\r
+        daoAuthenticationProvider.setSaltSource(saltSource);\r
+        daoAuthenticationProvider.setPasswordEncoder(passwordEncoder);\r
+\r
+        return new ProviderManager(Arrays.asList((AuthenticationProvider)daoAuthenticationProvider));\r
+    }\r
+\r
+\r
+    @Override\r
+    public ConversationHolder NewConversation() {\r
+        return new ConversationHolderMock();\r
+    }\r
+\r
+    @Override\r
+    public ICollectionService getCollectionService(){\r
+        return (ICollectionService) getService(ICollectionService.class, "/remoting/collection.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IFeatureTreeService getFeatureTreeService(){\r
+        return (IFeatureTreeService) getService(IFeatureTreeService.class, "/remoting/featuretree.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IFeatureNodeService getFeatureNodeService(){\r
+        return (IFeatureNodeService) getService(IFeatureNodeService.class, "/remoting/featurenode.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IVocabularyService getVocabularyService(){\r
+        return (IVocabularyService) getService(IVocabularyService.class, "/remoting/vocabulary.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IIdentificationKeyService getIdentificationKeyService(){\r
+        return (IIdentificationKeyService) getService(IIdentificationKeyService.class, "/remoting/identificationkey.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IPolytomousKeyService getPolytomousKeyService(){\r
+        return (IPolytomousKeyService) getService(IPolytomousKeyService.class, "/remoting/polytomouskey.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+\r
+    @Override\r
+    public IPolytomousKeyNodeService getPolytomousKeyNodeService(){\r
+        return (IPolytomousKeyNodeService) getService(IPolytomousKeyNodeService.class, "/remoting/polytomouskeynode.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IProgressMonitorService getProgressMonitorService() {\r
+        return (IProgressMonitorService) getService(IProgressMonitorService.class, "/remoting/progressmonitor.service", new CdmAuthenticatedHttpInvokerRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IWorkingSetService getWorkingSetService(){\r
+        return (IWorkingSetService) getService(IWorkingSetService.class, "/remoting/workingset.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public IGroupService getGroupService(){\r
+        return (IGroupService) getService(IGroupService.class, "/remoting/group.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+\r
+    @Override\r
+    public IEntityValidationService getEntityValidationService(){\r
+        return (IEntityValidationService) getService(IEntityValidationService.class, "/remoting/entityvalidation.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+\r
+    @Override\r
+    public IEntityConstraintViolationService getEntityConstraintViolationService(){\r
+        return (IEntityConstraintViolationService) getService(IEntityConstraintViolationService.class, "/remoting/entityconstraintviolation.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    @Override\r
+    public ICdmPermissionEvaluator getPermissionEvaluator(){\r
+\r
+        if(cdmPermissionEvaluator != null) {\r
+            return cdmPermissionEvaluator;\r
+        }\r
+        List<AccessDecisionVoter<? extends Object>> decisionVoters = new ArrayList<AccessDecisionVoter<? extends Object>>();\r
+        decisionVoters.add(new GrantAlwaysVoter());\r
+        decisionVoters.add(new TaxonNodeVoter());\r
+        decisionVoters.add(new TaxonBaseVoter());\r
+        decisionVoters.add(new DescriptionBaseVoter());\r
+        decisionVoters.add(new DescriptionElementVoter());\r
+        UnanimousBasedUnrevokable accessDecisionManager = new UnanimousBasedUnrevokable(decisionVoters);\r
+\r
+        cdmPermissionEvaluator = new CdmPermissionEvaluator();\r
+        cdmPermissionEvaluator.setAccessDecisionManager(accessDecisionManager);\r
+\r
+        return cdmPermissionEvaluator;\r
+    }\r
+\r
+\r
+    @Override\r
+    public TransactionStatus startTransaction() throws UnsupportedOperationException {\r
+        throw new UnsupportedOperationException("startTransaction is not implemented for CdmApplicationRemoteConfiguration");\r
+    }\r
 \r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#startTransaction()\r
-     */\r
     @Override\r
     public TransactionStatus startTransaction(Boolean readOnly) throws UnsupportedOperationException {\r
-               throw new UnsupportedOperationException("startTransaction is not implemented for CdmApplicationRemoteConfiguration");\r
-       }\r
+        throw new UnsupportedOperationException("startTransaction is not implemented for CdmApplicationRemoteConfiguration");\r
+    }\r
 \r
 \r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration#commitTransaction(org.springframework.transaction.TransactionStatus)\r
-     */\r
     @Override\r
     public void commitTransaction(TransactionStatus txStatus) throws UnsupportedOperationException {\r
-               throw new UnsupportedOperationException("commitTransaction is not implemented for CdmApplicationRemoteConfiguration");\r
-       }\r
-                       \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration#NewConversation()\r
-        */\r
-       @Override\r
-       public ConversationHolder NewConversation() {           \r
-               return new ConversationHolderMock();\r
-       }\r
-       \r
-       /**\r
-        * @return\r
-        */\r
-       public IEditGeoService getEditGeoService() {\r
-               return this.editGeoService;\r
-       }\r
-       \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration#setDataSource(javax.sql.DataSource)\r
-        */\r
-       @Override\r
-       public void setDataSource(DataSource dataSource) {                      \r
-    }\r
-       \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration#setTransactionManager(org.springframework.transaction.PlatformTransactionManager)\r
-        */\r
-       @Override\r
-       public void setTransactionManager(PlatformTransactionManager transactionManager) {        \r
-    }\r
-       \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration#setSessionFactory(org.hibernate.SessionFactory)\r
-        */\r
-       @Override\r
-    public void setSessionFactory(SessionFactory sessionFactory) {     \r
+        throw new UnsupportedOperationException("commitTransaction is not implemented for CdmApplicationRemoteConfiguration");\r
+    }\r
+\r
+    @Override\r
+    public void authenticate(String username, String password){\r
+        UsernamePasswordAuthenticationToken tokenForUser = new UsernamePasswordAuthenticationToken(username, password);\r
+        Authentication authentication = this.getAuthenticationManager().authenticate(tokenForUser);\r
+        SecurityContext context = SecurityContextHolder.getContext();\r
+        context.setAuthentication(authentication);\r
+    }\r
+\r
+    public IIOService getIOService() {\r
+        return (IIOService) getService(IIOService.class, "/remoting/io.service", new CdmServiceRequestExecutor());\r
+    }\r
+\r
+    public ITestService getTestService() {\r
+        return (ITestService) getService(ITestService.class, "/remoting/test.service", new CdmServiceRequestExecutor());\r
     }\r
 }\r
index 5473ac141981dafc244e0b157a25e9ab7282a0b5..86228cbb59fe2dd1673509f7594fcffe9b93756b 100644 (file)
@@ -1,54 +1,57 @@
 /**
-* Copyright (C) 2014 EDIT
-* European Distributed Institute of Taxonomy 
-* http://www.e-taxonomy.eu
-* 
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
+ * Copyright (C) 2014 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
 
 
 package eu.etaxonomy.cdm.api.application;
 
 import java.util.List;
-import java.util.Properties;
 
 import org.apache.log4j.Logger;
 import org.hibernate.collection.internal.AbstractPersistentCollection;
 import org.hibernate.proxy.AbstractLazyInitializer;
-import org.springframework.beans.MutablePropertyValues;
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
 import org.springframework.context.ApplicationListener;
-import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.Resource;
 
+import eu.etaxonomy.cdm.api.service.ITestService;
 import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
 import eu.etaxonomy.cdm.common.monitor.NullProgressMonitor;
-import eu.etaxonomy.cdm.common.monitor.SubProgressMonitor;
-import eu.etaxonomy.cdm.remote.ICdmRemoteSource;
+import eu.etaxonomy.cdm.ext.geo.IEditGeoService;
+import eu.etaxonomy.cdm.io.service.IIOService;
+import eu.etaxonomy.taxeditor.remoting.cache.CdmRemoteCacheManager;
+import eu.etaxonomy.taxeditor.remoting.source.ICdmRemoteSource;
+import eu.etaxonomy.taxeditor.service.ICachedCommonService;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
 
 /**
  * CDM Application Controller class for remoting clients
- * 
+ *
  * FIXME:Remoting extending {@link CdmApplicationController} is a temporary workaround.
  * The {@link CdmApplicationController} should be split into a CdmApplicationControllerBase
  * class with {@link CdmApplicationController} and this class as subclasses
  *
  */
 public class CdmApplicationRemoteController  extends CdmApplicationController {
-       
+
     private static final Logger logger = Logger.getLogger(CdmApplicationRemoteController.class);
 
-    public static final Resource DEFAULT_REMOTE_APPLICATION_CONTEXT_RESOURCE = 
-               new ClassPathResource("/eu/etaxonomy/cdm/remotingApplicationContext.xml");
+
+    public static final Resource DEFAULT_REMOTE_APPLICATION_CONTEXT_RESOURCE =
+            new ClassPathResource("/eu/etaxonomy/cdm/remotingApplicationContext.xml");
     private final Resource applicationContextResource;
     private final IProgressMonitor progressMonitor;
-    
+    private ICdmRemoteSource remoteSource;
+
+
     /**
      * Creates new instance of CdmApplicationRemoteController
-     * 
+     *
      * @param applicationContextResource
      * @param remoteSource
      * @param omitTermLoading
@@ -56,21 +59,20 @@ public class CdmApplicationRemoteController  extends CdmApplicationController {
      * @param listeners
      * @return
      */
-    public static CdmApplicationRemoteController NewInstance(Resource applicationContextResource, 
-                       ICdmRemoteSource remoteSource,                          
-                       boolean omitTermLoading, 
-                       IProgressMonitor progressMonitor, 
-                       List<ApplicationListener> listeners) {
-       return new CdmApplicationRemoteController(applicationContextResource, 
-                       remoteSource, 
-                       omitTermLoading, 
-                       progressMonitor, 
-                               listeners);
-       
-    }
+//    public static CdmApplicationRemoteController NewInstance(Resource applicationContextResource,
+//            ICdmRemoteSource remoteSource,
+//            IProgressMonitor progressMonitor,
+//            List<ApplicationListener> listeners) {
+//        return new CdmApplicationRemoteController(applicationContextResource,
+//                remoteSource,
+//                false,
+//                progressMonitor,
+//                listeners);
+//
+//    }
     /**
      * Creates new instance of CdmApplicationRemoteController
-     * 
+     *
      * @param applicationContextResource
      * @param remoteSource
      * @param omitTermLoading
@@ -78,116 +80,115 @@ public class CdmApplicationRemoteController  extends CdmApplicationController {
      * @param listeners
      * @return
      */
-    public static CdmApplicationRemoteController NewInstance(ICdmRemoteSource remoteSource,                            
-                       boolean omitTermLoading, 
-                       IProgressMonitor progressMonitor, 
-                       List<ApplicationListener> listeners) {
-       
-       return new CdmApplicationRemoteController(DEFAULT_REMOTE_APPLICATION_CONTEXT_RESOURCE, 
-                       remoteSource, 
-                       omitTermLoading, 
-                       progressMonitor, 
-                               listeners);
-       
+    public static CdmApplicationRemoteController NewInstance(ICdmRemoteSource remoteSource,
+            IProgressMonitor progressMonitor,
+            List<ApplicationListener> listeners) {
+
+        return new CdmApplicationRemoteController(DEFAULT_REMOTE_APPLICATION_CONTEXT_RESOURCE,
+                remoteSource,
+                false,
+                progressMonitor,
+                listeners);
+
     }
-    
-       /**
-        * Constructs CdmApplicationRemoteController
-        * 
-        * @param applicationContextResource
-        * @param remoteSource
-        * @param omitTermLoading
-        * @param progressMonitor
-        * @param listeners
-        */
-       private CdmApplicationRemoteController(Resource applicationContextResource, 
-                               ICdmRemoteSource remoteSource,                          
-                               boolean omitTermLoading, 
-                               IProgressMonitor progressMonitor, 
-                               List<ApplicationListener> listeners){
-               logger.info("Start CdmApplicationRemoteController with remote source: " + remoteSource.getName());
-        this.applicationContextResource = 
-                       applicationContextResource != null ? applicationContextResource : DEFAULT_REMOTE_APPLICATION_CONTEXT_RESOURCE;
+
+    public static CdmApplicationRemoteController NewInstance(ICdmRemoteSource remoteSource,
+            boolean validateXml,
+            IProgressMonitor progressMonitor,
+            List<ApplicationListener> listeners) {
+
+        return new CdmApplicationRemoteController(DEFAULT_REMOTE_APPLICATION_CONTEXT_RESOURCE,
+                remoteSource,
+                validateXml,
+                progressMonitor,
+                listeners);
+
+    }
+
+    /**
+     * Constructs CdmApplicationRemoteController
+     *
+     * @param applicationContextResource
+     * @param remoteSource
+     * @param omitTermLoading
+     * @param progressMonitor
+     * @param listeners
+     */
+    private CdmApplicationRemoteController(Resource applicationContextResource,
+            ICdmRemoteSource remoteSource,
+            boolean validateXml,
+            IProgressMonitor progressMonitor,
+            List<ApplicationListener> listeners){
+        logger.info("Start CdmApplicationRemoteController with remote source: " + remoteSource.getName());
+        this.applicationContextResource =
+                applicationContextResource != null ? applicationContextResource : DEFAULT_REMOTE_APPLICATION_CONTEXT_RESOURCE;
         this.progressMonitor = progressMonitor != null ? progressMonitor : new NullProgressMonitor();
+        this.remoteSource = remoteSource;
+        setNewRemoteSource(remoteSource, validateXml, listeners);
+
+    }
+
+
 
-        setNewRemoteSource(remoteSource, omitTermLoading, listeners);
-               
-       }
-       
 
-    
-    
     /**
      * Creates and starts a new spring application context
-     * 
+     *
      * @param remoteSource object for connecting to an http-invoker server
      * @param omitTermLoading
      * @param listeners
      * @return
      */
-    protected boolean setNewRemoteSource(ICdmRemoteSource remoteSource, 
-               boolean omitTermLoading, 
-               List<ApplicationListener> listeners){
+    public boolean setNewRemoteSource(ICdmRemoteSource remoteSource,
+            boolean validateXml,
+            List<ApplicationListener> listeners){
 
         logger.info("Connecting to '" + remoteSource.getName() + "'");
 
-        MonitoredGenericApplicationContext applicationContext =  new MonitoredGenericApplicationContext();
-        int refreshTasks = 45;
-        int nTasks = 5 + refreshTasks;
+        int nTasks = 2;
 
         progressMonitor.beginTask("Connecting to '" + remoteSource.getName() + "'", nTasks);
 
-        progressMonitor.subTask("Registering remote source.");
-        PropertySourcesPlaceholderConfigurer pspc = new PropertySourcesPlaceholderConfigurer();
-        Properties properties = new Properties();
-        properties.setProperty("remoteServer", remoteSource.getServer());
-        properties.setProperty("remotePort", String.valueOf(remoteSource.getPort()));
-        properties.setProperty("remoteContext", remoteSource.getContextPath());
-        pspc.setProperties(properties);
-        applicationContext.addBeanFactoryPostProcessor(pspc);
+        progressMonitor.subTask("Initialising CDM Model Cache ...");
+        CdmRemoteCacheManager.getInstance();
         progressMonitor.worked(1);
-
-        XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(applicationContext);
-        //xmlReader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_NONE);
-        progressMonitor.subTask("Registering resources.");
-        xmlReader.loadBeanDefinitions(applicationContextResource);
+        progressMonitor.subTask("Starting application context ...");
+        init();
         progressMonitor.worked(1);
-
-        //omitTerms
-        if (omitTermLoading == true){
-            String initializerName = "persistentTermInitializer";
-            BeanDefinition beanDef = applicationContext.getBeanDefinition(initializerName);
-            MutablePropertyValues values = beanDef.getPropertyValues();
-            values.addPropertyValue("omit", omitTermLoading);
-        }
-
-        if (listeners != null){
-            for(ApplicationListener listener : listeners){
-                applicationContext.addApplicationListener(listener);
-            }
-        }
-
-
-        applicationContext.refresh(new SubProgressMonitor(progressMonitor, refreshTasks));
-        applicationContext.start();
-
-        progressMonitor.subTask("Cleaning up.");
-        setApplicationContext(applicationContext);
-        progressMonitor.worked(1);
-
         progressMonitor.done();
         return true;
     }
-    
+
+
+
     /* (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.application.CdmApplicationController#init()
      */
     @Override
-    protected void init(){    
-        configuration = (ICdmApplicationConfiguration)applicationContext.getBean("cdmApplicationRemoteConfiguration");
-               AbstractLazyInitializer.setConfiguration(this);
-               AbstractPersistentCollection.setConfiguration(this);
+    protected void init(){
+        configuration = new CdmApplicationRemoteConfiguration(remoteSource);
+        ((CdmApplicationRemoteConfiguration)configuration).setApplicationContext(applicationContext);
+        AbstractLazyInitializer.setConfiguration((CdmApplicationRemoteConfiguration)configuration);
+        AbstractPersistentCollection.setConfiguration((CdmApplicationRemoteConfiguration)configuration);
+    }
+
+    public ICdmEntitySessionManager getCdmEntitySessionManager() {
+        return ((CdmApplicationRemoteConfiguration)configuration).getCdmEntitySessionManager();
+    }
 
+    public IIOService getIOService(){
+        return ((CdmApplicationRemoteConfiguration)configuration).getIOService();
     }
 
+    public ITestService getTestService(){
+        return ((CdmApplicationRemoteConfiguration)configuration).getTestService();
+    }
+
+    public ICachedCommonService getCachedCommonService(){
+        return ((CdmApplicationRemoteConfiguration)configuration).getCachedCommonService();
+    }
+
+    public IEditGeoService getEditGeoService() {
+        return ((CdmApplicationRemoteConfiguration)configuration).getEditGeoService();
+    }
 }
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationState.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationState.java
new file mode 100644 (file)
index 0000000..05ac043
--- /dev/null
@@ -0,0 +1,290 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.api.application;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Dictionary;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.osgi.util.ManifestElement;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+import org.springframework.security.core.context.SecurityContext;
+
+import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
+import eu.etaxonomy.cdm.api.service.ICommonService;
+import eu.etaxonomy.cdm.api.service.IService;
+import eu.etaxonomy.cdm.api.service.ITestService;
+import eu.etaxonomy.cdm.io.service.IIOService;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.taxeditor.service.ICachedCommonService;
+import eu.etaxonomy.taxeditor.session.DefaultNewEntityListener;
+
+/**
+ * @author cmathew
+ * @date 17 Jun 2015
+ *
+ */
+public class CdmApplicationState {
+
+    private static CdmApplicationState cdmApplicationState;
+
+    private ICdmApplicationConfiguration appConfig;
+
+    private ICdmDataChangeService dataChangeService;
+
+    private SecurityContext securityContext;
+
+    private static CdmServiceCacher cdmServiceCacher;
+
+    private static String cdmlibVersion = null;
+    private static String cdmlibLastModified = null;
+
+    public static CdmApplicationState getInstance() {
+        if(cdmApplicationState == null) {
+            cdmApplicationState = new CdmApplicationState();
+        }
+
+        return cdmApplicationState;
+    }
+
+    public void setAppConfig(ICdmApplicationConfiguration appConfig) {
+        this.appConfig = appConfig;
+        if(appConfig instanceof CdmApplicationRemoteController) {
+            CdmBase.setNewEntityListener(new DefaultNewEntityListener());
+        } else {
+            CdmBase.setNewEntityListener(null);
+        }
+    }
+
+    public ICdmApplicationConfiguration getAppConfig() {
+        return appConfig;
+    }
+
+    public static void setCurrentAppConfig(ICdmApplicationConfiguration appConfig) {
+        getInstance().setAppConfig(appConfig);
+    }
+
+    public static ICdmApplicationConfiguration getCurrentAppConfig() {
+        return getInstance().getAppConfig();
+    }
+
+    /**
+     * @return the dataChangeService
+     */
+    public ICdmDataChangeService getDataChangeService() {
+        return dataChangeService;
+    }
+
+    /**
+     * @param dataChangeService the dataChangeService to set
+     */
+    public void setDataChangeService(ICdmDataChangeService dataChangeService) {
+        this.dataChangeService = dataChangeService;
+    }
+
+    public static ICdmDataChangeService getCurrentDataChangeService() {
+        return getInstance().getDataChangeService();
+    }
+
+    public static void setCurrentDataChangeService(ICdmDataChangeService dataChangeService) {
+        getInstance().setDataChangeService(dataChangeService);
+    }
+
+
+
+    /**
+     * @return the securityContext
+     */
+    public SecurityContext getSecurityContext() {
+        return securityContext;
+    }
+
+    /**
+     * @param securityContext the securityContext to set
+     */
+    public void setSecurityContext(SecurityContext securityContext) {
+        this.securityContext = securityContext;
+    }
+
+    /**
+     * @return the securityContext
+     */
+    public static SecurityContext getCurrentSecurityContext() {
+        return getInstance().getSecurityContext();
+    }
+
+    /**
+     * @param securityContext the securityContext to set
+     */
+    public static void setCurrentSecurityContext(SecurityContext securityContext) {
+        getInstance().setSecurityContext(securityContext);
+    }
+
+    public static void dispose() {
+        getInstance().setCurrentDataChangeService(null);
+        getInstance().setAppConfig(null);
+        getInstance().setSecurityContext(null);
+        cdmApplicationState = null;
+        cdmServiceCacher = null;
+        cdmlibVersion = null;
+        cdmlibLastModified = null;
+    }
+
+
+    /**
+     * Generic method that will scan the getters of {@link ICdmApplicationConfiguration} for the given service
+     * interface. If a matching getter is found the according service implementation is returned by
+     * invoking the getter otherwise the method returns <code>null</code>.
+     *
+     * @param <T>
+     * @param serviceClass
+     * @return the configured implementation of <code>serviceClass</code> or <code>null</code>
+     * @throws CdmApplicationException
+     */
+    public static <T extends IService> T getService(Class<T> serviceClass) throws CdmApplicationException {
+        ICdmApplicationConfiguration configuration = getCurrentAppConfig();
+
+        Method[] methods = ICdmApplicationConfiguration.class.getDeclaredMethods();
+
+        T service = null;
+
+        for (Method method : methods) {
+            Type type = method.getGenericReturnType();
+
+            if (type.equals(serviceClass)) {
+                try {
+                    service = (T) method.invoke(configuration, null);
+                    break;
+                } catch (IllegalArgumentException iae) {
+                    throw new CdmApplicationException(iae);
+                } catch (IllegalAccessException iae) {
+                    throw new CdmApplicationException(iae);
+                } catch (InvocationTargetException ite) {
+                    throw new CdmApplicationException(ite);
+                }
+            }
+        }
+
+        return service;
+    }
+
+
+    /**
+     * @see #getService(Class)
+     * As ICommonService is not extending IService we need a specific request here
+     */
+    public static ICommonService getCommonService() {
+        ICdmApplicationConfiguration configuration = getCurrentAppConfig();
+
+        return configuration.getCommonService();
+
+    }
+
+    public static IIOService getIOService() {
+        ICdmApplicationConfiguration configuration = getCurrentAppConfig();
+
+        return ((CdmApplicationRemoteController)configuration).getIOService();
+
+    }
+
+
+    public static ITestService getTestService() {
+        ICdmApplicationConfiguration configuration = getCurrentAppConfig();
+
+        return ((CdmApplicationRemoteController)configuration).getTestService();
+
+    }
+
+    public static ICachedCommonService getCachedCommonService() {
+        ICdmApplicationConfiguration configuration = getCurrentAppConfig();
+
+        return ((CdmApplicationRemoteController)configuration).getCachedCommonService();
+
+    }
+
+    public static CdmServiceCacher getCdmServiceCacher() {
+        return cdmServiceCacher;
+    }
+
+    public static void setCdmServiceCacher(CdmServiceCacher cacher) {
+        cdmServiceCacher = cacher;
+    }
+
+    public static void updateCdmlibManifestInfo() {
+        cdmlibVersion = null;
+        cdmlibLastModified = null;
+        String cdmlibPathPrefix = "lib/cdmlib-services-";
+        String jarSuffix = ".jar";
+        Bundle bundle = Platform.getBundle("eu.etaxonomy.taxeditor.cdmlib");
+        Dictionary<String, String> headers = bundle.getHeaders();
+        String bundleClasspath = headers.get(Constants.BUNDLE_CLASSPATH);
+        try {
+            ManifestElement[] elements = ManifestElement.parseHeader(Constants.BUNDLE_CLASSPATH, bundleClasspath);
+            for (ManifestElement manifestElement : elements) {
+                String jar =  manifestElement.getValue();
+                if(jar.startsWith(cdmlibPathPrefix) && jar.endsWith(jarSuffix)) {
+                    URL fileURL = bundle.getEntry(jar);
+                    File file = null;
+                    try {
+                        String urlString = FileLocator.resolve(fileURL).toExternalForm().replace(" ", "%20");
+                        file = new File(new URI(urlString));
+                        JarFile jarFile = new JarFile(file);
+                        Manifest manifest = jarFile.getManifest();
+                        Attributes attributes = manifest.getMainAttributes();
+                        // from the OSGI spec the LastModified value is " the number of milliseconds
+                        // since midnight Jan. 1, 1970 UTC with the condition that a change must
+                        // always result in a higher value than the previous last modified time
+                        // of any bundle"
+                        cdmlibVersion = attributes.getValue("Bundle-Version");
+                        cdmlibLastModified = attributes.getValue("Bnd-LastModified");
+
+                        jarFile.close();
+                        if(cdmlibVersion == null || cdmlibLastModified == null) {
+                            throw new IllegalStateException("Invalid cdmlib manifest info");
+                        }
+                    } catch (URISyntaxException urise) {
+                        throw new IllegalStateException(urise);
+                    } catch (IOException ioe) {
+                        throw new IllegalStateException(ioe);
+                    }
+                }
+            }
+        } catch (BundleException e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    public static String getCdmlibVersion() {
+        if(cdmlibVersion == null) {
+            updateCdmlibManifestInfo();
+        }
+        return cdmlibVersion;
+    }
+
+    public static String getCdmlibLastModified() {
+        if(cdmlibLastModified == null) {
+            updateCdmlibManifestInfo();
+        }
+        return cdmlibLastModified;
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmChangeEvent.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmChangeEvent.java
new file mode 100644 (file)
index 0000000..4dddf33
--- /dev/null
@@ -0,0 +1,96 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.api.application;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+
+/**
+ * @author cmathew
+ * @date 7 Apr 2015
+ *
+ */
+public class CdmChangeEvent {
+
+    public enum Action {
+        Create,
+        Update,
+        Delete
+    }
+
+    private final Action action;
+    private final Set<CdmBase> changedObjects;
+    private final Class sourceType;
+    private Class entityType;
+    private Object source;
+
+    public CdmChangeEvent(Action action, Set<CdmBase> changedObjects, Class sourceType) {
+        this.action = action;
+        this.changedObjects = changedObjects;
+        this.sourceType = sourceType;
+    }
+
+    public CdmChangeEvent(Action action, CdmBase changedObject, Class sourceType) {
+        this.action = action;
+        changedObjects = new HashSet<CdmBase>();
+        changedObjects.add(changedObject);
+        this.sourceType = sourceType;
+    }
+
+    public CdmChangeEvent(Action action, Set<CdmBase> changedObjects, Class sourceType, Class entityType) {
+        this(action, changedObjects, sourceType);
+        this.entityType = entityType;
+    }
+
+    public CdmChangeEvent(Action action, Set<CdmBase> changedObjects, Object source) {
+        this(action, changedObjects, source.getClass());
+        this.source = source;
+    }
+
+    /**
+     * @return the action
+     */
+    public Action getAction() {
+        return action;
+    }
+
+    /**
+     * @return the changedObjects
+     */
+    public Set<? extends CdmBase> getChangedObjects() {
+        return changedObjects;
+    }
+
+    /**
+     * @return the sourceType
+     */
+    public Class getSourceType() {
+        return sourceType;
+    }
+
+
+    /**
+     * @return the source
+     */
+    public Object getSource() {
+        return source;
+    }
+
+    public Class getEntityType() {
+        return entityType;
+    }
+
+    public boolean hasChanges() {
+        return changedObjects != null && !changedObjects.isEmpty();
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmDataChangeService.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmDataChangeService.java
new file mode 100644 (file)
index 0000000..f569102
--- /dev/null
@@ -0,0 +1,94 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.cdm.api.application;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author cmathew
+ * @date 18 Jun 2015
+ *
+ */
+public class CdmDataChangeService implements ICdmDataChangeService {
+
+    protected final Set<ICdmChangeListener> listeners;
+
+    private final List<CdmChangeEvent> currentEvents;
+
+    public CdmDataChangeService() {
+        listeners = new HashSet<ICdmChangeListener>();
+        currentEvents = new ArrayList<CdmChangeEvent>();
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.store.ICdmDataChangeService#register(eu.etaxonomy.cdm.api.application.ICdmChangeListener)
+     */
+    @Override
+    public void register(ICdmChangeListener listener) {
+        listeners.add(listener);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.application.ICdmDataChangeService#unregister(eu.etaxonomy.cdm.api.application.ICdmChangeListener)
+     */
+    @Override
+    public void unregister(ICdmChangeListener listener) {
+        listeners.remove(listener);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.store.ICdmDataChangeService#addEvent(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+     */
+    @Override
+    public void addEvent(CdmChangeEvent event) {
+        currentEvents.add(event);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.store.ICdmDataChangeService#fireCurrentChangeEvents(boolean)
+     */
+    @Override
+    public void fireCurrentChangeEvents(boolean async) {
+        try {
+            for(CdmChangeEvent event : currentEvents) {
+                fireChangeEvent(event,async);
+            }
+        } finally {
+            currentEvents.clear();
+        }
+    }
+
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.store.ICdmDataChangeService#fireChangeEvent(eu.etaxonomy.cdm.api.application.CdmChangeEvent, boolean)
+     */
+    @Override
+    public void fireChangeEvent(final CdmChangeEvent event, boolean async) {
+
+        for(final ICdmChangeListener listener : listeners) {
+            listener.onChange(event);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.store.ICdmDataChangeService#clear()
+     */
+    @Override
+    public void clear() {
+        listeners.clear();
+        currentEvents.clear();
+    }
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/ICdmChangeListener.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/ICdmChangeListener.java
new file mode 100644 (file)
index 0000000..4ae1834
--- /dev/null
@@ -0,0 +1,21 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.api.application;
+
+/**
+ * @author cmathew
+ * @date 7 Apr 2015
+ *
+ */
+public interface ICdmChangeListener {
+
+    public void onChange(CdmChangeEvent event);
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/ICdmDataChangeService.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/ICdmDataChangeService.java
new file mode 100644 (file)
index 0000000..84bb324
--- /dev/null
@@ -0,0 +1,32 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.cdm.api.application;
+
+
+/**
+ * @author cmathew
+ * @date 18 Jun 2015
+ *
+ */
+public interface ICdmDataChangeService {
+
+    public abstract void register(ICdmChangeListener listener);
+
+    public abstract void unregister(ICdmChangeListener listener);
+
+    public abstract void addEvent(CdmChangeEvent event);
+
+    public abstract void fireCurrentChangeEvents(boolean async);
+
+    public abstract void fireChangeEvent(CdmChangeEvent event, boolean async);
+
+    public abstract void clear();
+
+}
\ No newline at end of file
index 4de156c496dadc30b98aa873290f29f8d6b2613e..dcfff9f24c6ce8ad71b32bbab38ca1125394aa88 100644 (file)
@@ -2,16 +2,28 @@ package eu.etaxonomy.cdm.api.cache;
 
 import java.util.UUID;
 
-import org.springframework.beans.factory.annotation.Autowired;
+import net.sf.ehcache.config.CacheConfiguration;
+import net.sf.ehcache.config.SizeOfPolicyConfiguration;
+
 import org.springframework.stereotype.Component;
 
-import eu.etaxonomy.cdm.api.service.ITermService;
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.common.TermBase;
+import eu.etaxonomy.taxeditor.remoting.cache.CacheLoader;
+import eu.etaxonomy.taxeditor.remoting.cache.CdmEntityCacheKey;
+import eu.etaxonomy.taxeditor.remoting.cache.CdmTransientEntityCacher;
+import eu.etaxonomy.taxeditor.service.TermServiceRequestExecutor;
+import eu.etaxonomy.taxeditor.session.CdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManagerObserver;
 
 /**
  * Class which uses CDM services to cache cdm entities
  *
- * FIXME: Currently only handles terms entities. It would be
+ * FIXME: Currently only handles term entities. It would be
  *        interesting to have a generic method which finds the
  *        correct service to load / cache the entity.
  *
@@ -20,41 +32,118 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
  * @param <T>
  */
 @Component
-public class CdmServiceCacher<T extends CdmBase> extends CdmCacher {
+public class CdmServiceCacher extends CdmCacher  implements ICdmEntitySessionManagerObserver {
 
-       @Autowired
-       ITermService termService;
 
-       @Override
-       protected T findByUuid(UUID uuid) {
-               return (T)termService.findWithoutFlush(uuid);
-       }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.cache.CdmCacher#setup()
-     */
+    private ICdmEntitySessionManager cdmEntitySessionManager;
+
+    private CdmTransientEntityCacher cdmTransientEntityCacher;
+
+    private CacheLoader cacheLoader;
+
     @Override
     protected void setup() {
-        // TODO Auto-generated method stub
+        DefinedTermBase.setCacher(this);
+        CdmTransientEntityCacher.setDefaultCacher(this);
+        TermServiceRequestExecutor.setDefaultCacher(this);
 
+        cacheLoader = new CacheLoader(this);
+    }
+
+
+    @Override
+    protected CacheConfiguration getDefaultCacheConfiguration() {
+        // For a better understanding on how to size caches, refer to
+        // http://ehcache.org/documentation/configuration/cache-size
+
+        SizeOfPolicyConfiguration sizeOfConfig = new SizeOfPolicyConfiguration();
+        sizeOfConfig.setMaxDepth(100);
+        sizeOfConfig.setMaxDepthExceededBehavior("abort");
+
+        return new CacheConfiguration(DEFAULT_CACHE_NAME, 0)
+        .eternal(true)
+        .statistics(true)
+        .sizeOfPolicy(sizeOfConfig)
+        .overflowToOffHeap(false);
+
+    }
+
+    @Override
+    protected CdmBase findByUuid(UUID uuid) {
+        CdmBase term = CdmApplicationState.getCurrentAppConfig().getTermService().findWithoutFlush(uuid);
+        return load(term);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.model.ICdmCacher#isCachable(eu.etaxonomy.cdm.model.common.CdmBase)
-     */
     @Override
-    public boolean isCachable(CdmBase arg0) {
-        // TODO Auto-generated method stub
+    public boolean isCachable(CdmBase cdmEntity) {
+     //   if(cdmEntity != null && cdmEntity instanceof DefinedTermBase) {
+          if(cdmEntity != null && cdmEntity instanceof TermBase) {
+            return true;
+        }
         return false;
     }
 
+
+    public void setCdmEntitySessionManager(ICdmEntitySessionManager cdmEntitySessionManager) {
+        this.cdmEntitySessionManager = cdmEntitySessionManager;
+        if(cdmEntitySessionManager != null) {
+            cdmEntitySessionManager.addSessionObserver(this);
+        }
+    }
+
+
+    public CdmTransientEntityCacher getCurrentCacher() {
+        ICdmEntitySession cdmEntitySession = cdmEntitySessionManager.getActiveSession();
+        if(cdmEntitySession != null && cdmEntitySession instanceof CdmEntitySession) {
+            return ((CdmEntitySession) cdmEntitySession).getCacher();
+        }
+        return null;
+    }
+
+    @Override
+    public CdmBase getFromCache(CdmBase cdmBase) {
+        CdmBase cachedCdmEntity = null;
+        // first we check in the active session cache if the
+        // entity has been loaded there
+        // FIXME:Remoting do we really need the cdmTransientEntityCacher
+        // here. Is it not guarenteed that all every entity which 'isCachable'
+        // by this cacher is cached only in this cacher ?
+        if(!isCachable(cdmBase) && cdmTransientEntityCacher != null) {
+            CdmEntityCacheKey key = CdmTransientEntityCacher.generateKey(cdmBase);
+            cachedCdmEntity = cdmTransientEntityCacher.getFromCache(key);
+
+        }
+        if(cachedCdmEntity == null) {
+            cachedCdmEntity = super.getFromCache(cdmBase);
+        }
+        return cachedCdmEntity;
+    }
+
+
     /* (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.cache.CdmCacher#load(eu.etaxonomy.cdm.model.common.CdmBase)
      */
     @Override
-    public CdmBase load(CdmBase arg0) {
-        // TODO Auto-generated method stub
-        return null;
+    public CdmBase load(CdmBase cdmEntity) {
+        CdmBase cachedCdmEntity = getFromCache(cdmEntity.getUuid());
+
+        if(isCachable(cdmEntity) && cachedCdmEntity == null) {
+            cachedCdmEntity =  cacheLoader.load(cdmEntity, false, true);
+        }
+        return cachedCdmEntity;
     }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManagerObserver#changed()
+     */
+    @Override
+    public void changed() {
+        ICdmEntitySession cdmEntitySession = cdmEntitySessionManager.getActiveSession();
+        if(cdmEntitySession != null && cdmEntitySession instanceof CdmEntitySession) {
+            this.cdmTransientEntityCacher = ((CdmEntitySession) cdmEntitySession).getCacher();
+        } else {
+            this.cdmTransientEntityCacher = null;
+        }
+    }
 }
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/CdmEagerLoadingException.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/CdmEagerLoadingException.java
new file mode 100644 (file)
index 0000000..08cc011
--- /dev/null
@@ -0,0 +1,13 @@
+package eu.etaxonomy.taxeditor.remoting;
+
+public class CdmEagerLoadingException extends RuntimeException {
+       
+       public CdmEagerLoadingException(Throwable t) {
+               super(t);
+       }
+       
+       public CdmEagerLoadingException(String message) {
+               super(message);
+       }
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/CdmRemotingException.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/CdmRemotingException.java
new file mode 100644 (file)
index 0000000..13fcb4f
--- /dev/null
@@ -0,0 +1,18 @@
+package eu.etaxonomy.taxeditor.remoting;
+
+public class CdmRemotingException extends RuntimeException {
+
+       /**
+        *
+        */
+       private static final long serialVersionUID = -560332689478356360L;
+
+       public CdmRemotingException(String message) {
+               super(message);
+       }
+
+       public CdmRemotingException(Exception exception) {
+           super(exception);
+       }
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CacheLoader.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CacheLoader.java
new file mode 100644 (file)
index 0000000..c99ce01
--- /dev/null
@@ -0,0 +1,412 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.remoting.cache;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.Element;
+
+import org.apache.log4j.Logger;
+import org.springframework.util.ReflectionUtils;
+
+import eu.etaxonomy.cdm.api.service.pager.Pager;
+import eu.etaxonomy.cdm.model.ICdmCacher;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
+
+/**
+ * @author cmathew
+ * @date 19 Feb 2015
+ *
+ */
+public class CacheLoader {
+    private static final Logger logger = Logger.getLogger(CacheLoader.class);
+
+    private static boolean isRecursiveEnabled = true;
+
+    protected final ICdmCacher cdmCacher;
+
+    private final Cache cdmlibModelCache;
+
+
+
+    public CacheLoader(ICdmCacher cdmCacher) {
+        this.cdmCacher = cdmCacher;
+        this.cdmlibModelCache = CdmRemoteCacheManager.getInstance().getCdmModelGetMethodsCache();
+
+    }
+
+
+    public CdmModelFieldPropertyFromClass getFromCdmlibModelCache(String className) {
+        Element e = cdmlibModelCache.get(className);
+        if (e == null) {
+            return null;
+        } else {
+            return (CdmModelFieldPropertyFromClass) e.getObjectValue();
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public <T extends Object> T load(T obj, boolean recursive, boolean update) {
+        if(obj == null) {
+            return null;
+        }
+        if(obj instanceof CdmBase) {
+            return (T) load((CdmBase)obj, recursive, update);
+        } else if (obj instanceof Map) {
+            return (T) load((Map<T,T>)obj, recursive, update);
+        } else if (obj instanceof Collection) {
+            return (T) load((Collection<T>)obj, recursive, update);
+        } else if(obj instanceof Pager) {
+             load(((Pager)obj).getRecords(), recursive, update);
+             return obj;
+        } else if(obj instanceof MergeResult) {
+            return (T) load((MergeResult<CdmBase>)obj, recursive, update);
+        }
+
+        return obj;
+    }
+
+    @SuppressWarnings("unchecked")
+    private <T extends Object> T loadRecursive(T obj, List<Object> alreadyVisitedEntities, boolean update) {
+        if(obj == null) {
+            return null;
+        }
+        if(obj instanceof CdmBase) {
+            return (T) loadRecursive((CdmBase)obj, alreadyVisitedEntities, update);
+        } else if (obj instanceof Map) {
+            return (T) load((Map<T,T>)obj, alreadyVisitedEntities, update);
+        } else if (obj instanceof Collection) {
+            return (T) load((Collection<T>)obj, alreadyVisitedEntities, update);
+        } else if (obj instanceof MergeResult) {
+            return (T) loadRecursive((MergeResult)obj, alreadyVisitedEntities, update);
+        }
+
+
+        logger.info("No caching yet for type " + obj.getClass().getName());
+
+        return obj;
+    }
+
+    public <T extends Object> Map<T,T> load(Map<T,T> map, boolean recursive, boolean update){
+
+
+        if(isRecursiveEnabled && recursive) {
+            logger.info("---- starting recursive load for cdm entity map");
+            List<Object> alreadyVisitedEntities = new ArrayList<Object>();
+            Map<T,T> cachedMap = load(map, alreadyVisitedEntities, update);
+            alreadyVisitedEntities.clear();
+            logger.info("---- ending recursive load for cdm entity map \n");
+            return cachedMap;
+        } else {
+            return load(map, null, update);
+        }
+    }
+
+
+    private <T extends Object> Map<T,T> load(Map<T,T> map, List<Object> alreadyVisitedEntities, boolean update){
+        //map = (Map<T,T>)deproxy(map);
+
+        if(map == null || map.isEmpty()) {
+            return map;
+        }
+
+        int originalMapSize = map.size();
+        Object[] result = new Object[ map.size() * 2 ];
+        Iterator<Map.Entry<T,T>> iter = map.entrySet().iterator();
+        int i=0;
+        // to avoid ConcurrentModificationException
+        alreadyVisitedEntities.add(map);
+        while ( iter.hasNext() ) {
+            Map.Entry<T,T> e = iter.next();
+            result[i++] = e.getKey();
+            result[i++] = e.getValue();
+        }
+
+        for(i=0; i<result.length;i++) {
+            if(alreadyVisitedEntities == null) {
+                result[i] = load(result[i], false, update);
+            } else {
+                result[i] = loadRecursive(result[i], alreadyVisitedEntities, update);
+            }
+        }
+        map.clear();
+        for(i = 0; i < originalMapSize; i+=2 ) {
+            map.put(
+                    (T)result[i],
+                    (T)result[i+1]
+                    );
+        }
+        return map;
+    }
+
+    public <T extends Object> Collection<T> load(Collection<T> collection, boolean recursive, boolean update){
+
+        Collection<T> loadedCollection;
+        if(isRecursiveEnabled && recursive) {
+            logger.info("---- starting recursive load for cdm entity collection");
+            List<Object> alreadyVisitedEntities = new ArrayList<Object>();
+            Collection<T> cachedCollection = load(collection, alreadyVisitedEntities, update);
+            alreadyVisitedEntities.clear();
+            logger.info("---- ending recursive load for cdm entity collection \n");
+            loadedCollection = cachedCollection;
+        } else {
+            loadedCollection = load(collection, null, update);
+        }
+        return loadedCollection;
+    }
+
+    @SuppressWarnings("unchecked")
+    private <T extends Object> Collection<T> load(Collection<T> collection, List<Object> alreadyVisitedEntities, boolean update) {
+
+
+
+        if(collection == null || collection.isEmpty()) {
+            return collection;
+        }
+        int length = collection.size();
+        Object[] result = new Object[length];
+        Iterator<T> collectionItr = collection.iterator();
+        int count = 0;
+        // to avoid ConcurrentModificationException
+        alreadyVisitedEntities.add(collection);
+        while(collectionItr.hasNext()) {
+            Object obj = collectionItr.next();
+            if(alreadyVisitedEntities == null) {
+                result[count] = load(obj, false, update);
+            } else {
+                result[count] = loadRecursive(obj, alreadyVisitedEntities, update);
+            }
+
+            count++;
+        }
+
+        collection.clear();
+
+        for ( int i = 0; i < length; i++ ) {
+            collection.add((T)result[i]);
+        }
+
+        return collection;
+    }
+
+
+    public MergeResult<CdmBase> load(MergeResult<CdmBase> mergeResult, boolean recursive, boolean update) {
+        CdmBase cdmBase = load(mergeResult.getMergedEntity(), recursive, update);
+        load(mergeResult.getNewEntities(), recursive, update);
+        return new MergeResult(cdmBase, mergeResult.getNewEntities());
+    }
+
+    public MergeResult<CdmBase> loadRecursive(MergeResult<CdmBase> mergeResult,List<Object> alreadyVisitedEntities, boolean update) {
+        CdmBase cdmBase = loadRecursive(mergeResult.getMergedEntity(), alreadyVisitedEntities, update);
+        loadRecursive(mergeResult.getNewEntities(), alreadyVisitedEntities, update);
+        return new MergeResult(cdmBase, mergeResult.getNewEntities());
+    }
+
+    /**
+     * Puts the (Key,Value) pair of ({@link java.util.UUID}, {@link eu.etaxonomy.cdm.model.common.CdmBase}),
+     * in the cache corresponding to the given cache id
+     *
+     * @param cacheId
+     * @param uuid
+     * @param cdmEntity
+     */
+    public CdmBase load(CdmBase cdmEntity, boolean recursive, boolean update) {
+        if(cdmEntity == null) {
+            return null;
+        }
+
+        // start by looking up the cdm entity in the cache
+        CdmBase cachedCdmEntity = cdmCacher.getFromCache(cdmEntity);
+
+        if(cachedCdmEntity != null) {
+            // if cdm entity was found in cache then
+            logger.info(" - object of type " + cdmEntity.getClass().getName() + " with id " + cdmEntity.getId() + " already exists");
+            // .. return if the cached and input objects are identical, else (this is a newly loaded object so) continue
+            if(cachedCdmEntity == cdmEntity) {
+                return cachedCdmEntity;
+            }
+        }
+
+        CdmBase loadedCdmBase;
+        if(isRecursiveEnabled && recursive) {
+            logger.info("---- starting recursive load for cdm entity " + cdmEntity.getClass().getName() + " with id " + cdmEntity.getId());
+            List<Object> alreadyVisitedEntities = new ArrayList<Object>();
+            CdmBase cb =  loadRecursive(cdmEntity, alreadyVisitedEntities, update);
+            alreadyVisitedEntities.clear();
+            logger.info("---- ending recursive load for cdm entity " + cdmEntity.getClass().getName() + " with id " + cdmEntity.getId() + "\n");
+            loadedCdmBase =  cb;
+        } else {
+            loadedCdmBase = load(cdmEntity);
+        }
+        return loadedCdmBase;
+
+    }
+
+
+    protected CdmBase load(CdmBase cdmEntity) {
+        logger.info("loading object of type " + cdmEntity.getClass().getName() + " with id " + cdmEntity.getId());
+        cdmCacher.put((CdmBase)ProxyUtils.deproxy(cdmEntity));
+        return cdmCacher.getFromCache(cdmEntity);
+    }
+
+
+    private CdmBase loadRecursive(CdmBase cdmEntity,  List<Object> alreadyVisitedEntities, boolean update) {
+
+        CdmBase cachedCdmEntity = load(cdmEntity);
+
+
+        // we want to recursive through the cdmEntity (and not the cachedCdmEntity)
+        // since there could be new or deleted objects in the cdmEntity sub-graph
+
+        // start by getting the fields from the cdm entity
+        String className = cdmEntity.getClass().getName();
+        CdmModelFieldPropertyFromClass cmgmfc = getFromCdmlibModelCache(className);
+        if(cmgmfc != null) {
+            alreadyVisitedEntities.add(cdmEntity);
+            List<String> fields = cmgmfc.getFields();
+            for(String field : fields) {
+                // retrieve the actual object corresponding to the field.
+                // this object will be either a CdmBase or a Collection / Map
+                // with CdmBase as the generic type
+
+                CdmBase cdmEntityInSubGraph = getCdmBaseTypeFieldValue(cdmEntity, cachedCdmEntity, field, alreadyVisitedEntities, update);
+                if(cdmEntityInSubGraph != null) {
+                    //checkForIdenticalCdmEntity(alreadyVisitedEntities, cdmEntityInSubGraph);
+                    if(!checkForIdenticalCdmEntity(alreadyVisitedEntities, cdmEntityInSubGraph)) {
+                        logger.info("recursive loading object of type " + cdmEntityInSubGraph.getClass().getName() + " with id " + cdmEntityInSubGraph.getId());
+                        loadRecursive(cdmEntityInSubGraph, alreadyVisitedEntities, update);
+                    } else {
+                        logger.info("object of type " + cdmEntityInSubGraph.getClass().getName() + " with id " + cdmEntityInSubGraph.getId() + " already visited");
+                    }
+                }
+            }
+        } else {
+            throw new CdmClientCacheException("CdmEntity with class " + cdmEntity.getClass().getName() + " is not found in the cdmlib model cache. " +
+                    "The cache may be corrupted or not in sync with the latest model version" );
+        }
+
+        return cachedCdmEntity;
+    }
+
+
+    private CdmBase getCdmBaseTypeFieldValue(CdmBase cdmEntity,
+            CdmBase cachedCdmEntity,
+            String fieldName,
+            List<Object> alreadyVisitedEntities,
+            boolean update) {
+
+        // this method attempts to make sure that for any two objects found in
+        // the object graph, if they are equal then they should also be the same,
+        // which is crucial for the merge to work
+        if(cachedCdmEntity == null) {
+            throw new CdmClientCacheException("When trying to set field value, the cached cdm entity cannot be null");
+        }
+
+        Class<?> clazz = cdmEntity.getClass();
+        try {
+            // this call will search in the provided class as well as
+            // the super classes until it finds the field
+            Field field = ReflectionUtils.findField(clazz, fieldName);
+
+            if(field == null) {
+                throw new CdmClientCacheException("Field '" + fieldName
+                        + "' not found when searching in class '" + clazz.getName() + "' and its supercalsses");
+            }
+            field.setAccessible(true);
+            Object o = field.get(cdmEntity);
+            // resetting the value in cdm entity to the deproxied object
+            o = ProxyUtils.deproxy(o);
+            field.set(cdmEntity, o);
+            Object cachedo = field.get(cachedCdmEntity);
+            CdmBase cdmEntityInSubGraph = null;
+
+            if(update || ProxyUtils.isProxy(cachedo)) {
+                // if we are in update mode we have to make the field of the cached entity
+                // up-to-date by setting it to the value of the cdm entity being loaded
+                //
+                // if the cdm entity is a proxy then we always update to make sure that
+                // newly created entities are always up-to-date
+                //
+                // NOTE : the field is overridden in the case of the exception
+                // found below
+                field.set(cachedCdmEntity, o);
+
+            }
+
+            if(o != null && !ProxyUtils.isProxy(o)) {
+                if(CdmBase.class.isAssignableFrom(o.getClass())) {
+                    logger.info("found initialised cdm entity '" + fieldName + "' in object of type " + clazz.getName() + " with id " + cdmEntity.getId());
+
+                    cdmEntityInSubGraph  = (CdmBase)o;
+                    CdmBase cachedCdmEntityInSubGraph = cdmCacher.getFromCache(cdmEntityInSubGraph);
+
+                    if(cachedCdmEntityInSubGraph != null) {
+                        if(cachedCdmEntityInSubGraph != cdmEntityInSubGraph) {
+                            // exception : is the case where
+                            // the field has been already initialised, cached and
+                            // is not the same as the one in the cache, in which case we set the value
+                            // of the field to the one found in the cache
+                            logger.info("setting cached + real value to '" + fieldName + "' in object of type " + clazz.getName() + " with id " + cdmEntity.getId());
+                            field.set(cachedCdmEntity, cachedCdmEntityInSubGraph);
+                            field.set(cdmEntity, cachedCdmEntityInSubGraph);
+                        } else {
+                            // since the field value object in cdmEntity
+                            // is the same as the field value object in cachedCdmEntity
+                            // we are sure that the its subgraph is also correctly loaded,
+                            // so we can exit the recursion
+                            return null;
+                        }
+                    }
+                } else if(o instanceof Map && !checkForIdenticalCdmEntity(alreadyVisitedEntities, o)) {
+                    loadRecursive((Map)o, alreadyVisitedEntities, update);
+                } else if(o instanceof Collection && !checkForIdenticalCdmEntity(alreadyVisitedEntities, o)) {
+                    loadRecursive((Collection)o, alreadyVisitedEntities, update);
+                }
+            }
+            // we return the original cdm entity in the sub graph because we
+            // want to continue to recurse on the input cdm entity graph
+            // and not the one in the cache
+            return cdmEntityInSubGraph;
+        } catch (SecurityException e) {
+            throw new CdmClientCacheException(e);
+        } catch (IllegalArgumentException e) {
+            throw new CdmClientCacheException(e);
+        } catch (IllegalAccessException e) {
+            throw new CdmClientCacheException(e);
+        }
+    }
+
+    private boolean checkForIdenticalCdmEntity(List<Object> objList, Object objToCompare) {
+        if(objToCompare != null) {
+            for(Object obj : objList) {
+                if(obj == objToCompare) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+
+    public static boolean isRecursiveEnabled() {
+        return isRecursiveEnabled;
+    }
+
+    public static void  setRecursiveEnabled(boolean ire) {
+        isRecursiveEnabled = ire;
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmClientCacheException.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmClientCacheException.java
new file mode 100644 (file)
index 0000000..e00649f
--- /dev/null
@@ -0,0 +1,12 @@
+package eu.etaxonomy.taxeditor.remoting.cache;
+
+public class CdmClientCacheException extends RuntimeException {
+       
+       public CdmClientCacheException(String message) {
+               super(message);
+       }
+
+       public CdmClientCacheException(Exception e) {
+               super(e);
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmEntityCacheKey.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmEntityCacheKey.java
new file mode 100644 (file)
index 0000000..74e543c
--- /dev/null
@@ -0,0 +1,56 @@
+package eu.etaxonomy.taxeditor.remoting.cache;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+
+public class CdmEntityCacheKey {
+
+       private Class<? extends CdmBase> persistenceClass;
+       private int persistenceId;
+       
+       public CdmEntityCacheKey(CdmBase cdmBase) {
+               this.persistenceClass = cdmBase.getClass();
+               this.persistenceId = cdmBase.getId();
+       }
+       
+       public CdmEntityCacheKey(Class<? extends CdmBase> clazz, int id) {
+               this.persistenceClass = clazz;
+               this.persistenceId = id;
+       }
+       
+
+       
+       public Class<? extends CdmBase> getPersistenceClass() {
+               return persistenceClass;
+       }
+       
+       public int getPersistenceId() {
+               return persistenceId;
+       }
+       @Override
+       public boolean equals(Object obj) {
+               if(obj == null || !(obj instanceof CdmEntityCacheKey)) {
+                       return false;
+               }
+               
+               if(this == obj) {
+                       return true;
+               }
+               CdmEntityCacheKey that = (CdmEntityCacheKey) obj;
+               if(this.persistenceClass.equals(that.persistenceClass) && this.persistenceId == that.persistenceId) {
+                       return true;
+               }
+               
+               return false;
+       }
+       
+       @Override
+       public int hashCode() {
+               return (this.persistenceClass.getName() + String.valueOf(this.persistenceId)).hashCode();
+       }
+       
+       @Override
+       public String toString() {
+               return this.persistenceClass.getName() + String.valueOf(this.persistenceId);
+       }
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmModelCacher.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmModelCacher.java
new file mode 100644 (file)
index 0000000..9975269
--- /dev/null
@@ -0,0 +1,162 @@
+package eu.etaxonomy.taxeditor.remoting.cache;
+
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.lang.reflect.Field;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.Element;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+import org.hibernate.SessionFactory;
+import org.hibernate.boot.MetadataSources;
+import org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl;
+import org.hibernate.boot.registry.StandardServiceRegistry;
+import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.mapping.PersistentClass;
+import org.hibernate.mapping.Property;
+import org.hibernate.metadata.ClassMetadata;
+import org.hibernate.property.access.spi.Getter;
+import org.osgi.framework.Bundle;
+
+import org.hibernate.boot.Metadata;
+
+
+public class CdmModelCacher {
+
+
+
+
+    public static String HB_CONFIG_FILE_PATH= "/eu/etaxonomy/cdm/mappings/hibernate.cfg.xml";
+
+    public static final String CDM_MAP_SER_FILE_PATH = "resources/cdm.map.ser";
+
+
+
+
+    public void cacheGetterFields(Cache cache) throws IOException, ClassNotFoundException, URISyntaxException {
+        Map<String, CdmModelFieldPropertyFromClass> modelClassMap = loadModelClassMap();
+
+        cache.removeAll();
+
+        for(Map.Entry<String, CdmModelFieldPropertyFromClass> entry : modelClassMap.entrySet()) {
+            cache.put(new Element(entry.getKey(), entry.getValue()));
+        }
+    }
+
+    public Map<String, CdmModelFieldPropertyFromClass> loadModelClassMap() throws URISyntaxException, IOException, ClassNotFoundException  {
+
+        Bundle bundle = Platform.getBundle("eu.etaxonomy.taxeditor.cdmlib");
+
+        URL modelMapFileBundleURL = bundle.getEntry(CDM_MAP_SER_FILE_PATH);
+        URL modelMapFileURL = FileLocator.resolve(modelMapFileBundleURL);
+        String modelMapFilePath = modelMapFileURL.getFile();
+
+        FileInputStream fin = new FileInputStream(modelMapFilePath);
+        ObjectInputStream ois = new ObjectInputStream(fin);
+        Map<String, CdmModelFieldPropertyFromClass> modelClassMap = (Map<String, CdmModelFieldPropertyFromClass>) ois.readObject();
+        ois.close();
+        return modelClassMap;
+    }
+
+
+    public Map<String, CdmModelFieldPropertyFromClass> generateModelClassMap() {
+       
+       // A SessionFactory is set up once for an application!
+       final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()
+                       .configure(HB_CONFIG_FILE_PATH) // configures settings from hibernate.cfg.xml
+                       .build();
+       SessionFactory sessionFactory = null;
+       Map<String, CdmModelFieldPropertyFromClass> modelClassMap = new HashMap<String, CdmModelFieldPropertyFromClass>();
+       try {
+               sessionFactory = new MetadataSources( registry ).buildMetadata().buildSessionFactory();
+               Configuration configuration = buildConfiguration(HB_CONFIG_FILE_PATH);
+               Map<String, ClassMetadata> classMetaDataMap = sessionFactory.getAllClassMetadata();
+               Metadata metadata = new MetadataSources( registry ).getMetadataBuilder().applyImplicitNamingStrategy( ImplicitNamingStrategyJpaCompliantImpl.INSTANCE ).build();
+           
+
+            for(ClassMetadata classMetaData :classMetaDataMap.values()) {
+               Class mappedClass = classMetaData.getMappedClass();
+               
+                String mappedClassName = mappedClass.getName();
+               
+                PersistentClass persistentClass =metadata.getEntityBinding(mappedClassName);
+                CdmModelFieldPropertyFromClass cmgmfc = new CdmModelFieldPropertyFromClass(mappedClassName);
+                System.out.println("Adding class : " + mappedClassName + " to cache");
+                addGetters(persistentClass, cmgmfc);
+                modelClassMap.put(mappedClassName, cmgmfc);
+            }
+       }
+       catch (Exception e) {
+               // The registry would be destroyed by the SessionFactory, but we had trouble building the SessionFactory
+               // so destroy it manually.
+               StandardServiceRegistryBuilder.destroy( registry );
+       }
+       
+       
+        return modelClassMap;
+    }
+
+
+    public static Configuration buildConfiguration(String hibernateConfigFilePath) {
+        Configuration configuration = new Configuration().configure(hibernateConfigFilePath);
+        configuration.buildMappings();
+        return configuration;
+    }
+
+    private void addGetters(PersistentClass persistentClass, CdmModelFieldPropertyFromClass cmgmfc) {
+        if (persistentClass != null) {
+            Iterator propertyIt = persistentClass.getPropertyIterator();
+
+            while(propertyIt.hasNext())
+            {
+                Property property = (Property)propertyIt.next();
+                Getter getter = property.getGetter(persistentClass.getMappedClass());
+                if(getter != null && getter.getMember() != null) {
+                    Field field = (Field)getter.getMember();
+
+                    //logger.info(" - contains field '" + field.getName() + "' of type '" + field.getType().getName() + "'");
+                    cmgmfc.addGetMethods(field.getName());
+                }
+            }
+            addGetters(persistentClass.getSuperclass(), cmgmfc);
+        }
+    }
+
+
+
+    public static void main(String argv[]) {
+
+        // To re-create the serialised cdm map run,
+        // mvn exec:java -Dexec.mainClass="eu.etaxonomy.taxeditor.remoting.cache.CdmModelCacher"
+        // in the eu.etaxonomy.taxeditor.cdmlib project root dir
+        String CDM_MAP_SER_DIR = "resources/";
+
+        CdmModelCacher cdmModelCacher = new CdmModelCacher();
+        Map<String, CdmModelFieldPropertyFromClass> modelClassMap = cdmModelCacher.generateModelClassMap();
+        try{
+
+            FileOutputStream fout = new FileOutputStream(CDM_MAP_SER_DIR + "cdm.map.ser");
+            ObjectOutputStream oos = new ObjectOutputStream(fout);
+            oos.writeObject(modelClassMap);
+            oos.close();
+            System.out.println("CDM Map serialized");
+
+        }catch(Exception ex){
+            ex.printStackTrace();
+        }
+
+    }
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmModelFieldPropertyFromClass.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmModelFieldPropertyFromClass.java
new file mode 100644 (file)
index 0000000..e90ec6d
--- /dev/null
@@ -0,0 +1,51 @@
+package eu.etaxonomy.taxeditor.remoting.cache;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+public class CdmModelFieldPropertyFromClass implements Serializable {
+
+       private static final long serialVersionUID = 5726395976531887526L;
+       private String className;
+       private String parentClassName;
+       
+       private List<String> fields = new ArrayList<String>();
+       
+       
+       public CdmModelFieldPropertyFromClass(String className) {
+               this.setClassName(className);
+       }
+       
+       public String getParentClassName() {
+               return parentClassName;
+       }
+
+       public void setParentClassName(String parentClassName) {
+               this.parentClassName = parentClassName;
+       }
+
+       public List<String> getFields() {
+               return fields;
+       }
+
+       public void setFields(List<String> fields) {
+               this.fields = fields;
+       }
+       
+       public void addGetMethods(String getMethod) {
+               this.fields.add(getMethod);
+       }
+
+       public String getClassName() {
+               return className;
+       }
+
+       public void setClassName(String className) {
+               this.className = className;
+       }
+       
+
+       
+       
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmRemoteCacheManager.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmRemoteCacheManager.java
new file mode 100644 (file)
index 0000000..a2c4d1c
--- /dev/null
@@ -0,0 +1,94 @@
+package eu.etaxonomy.taxeditor.remoting.cache;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.CacheException;
+import net.sf.ehcache.CacheManager;
+import net.sf.ehcache.config.CacheConfiguration;
+import net.sf.ehcache.config.SizeOfPolicyConfiguration;
+
+import org.apache.log4j.Logger;
+
+
+public class CdmRemoteCacheManager {
+
+    private static final Logger logger = Logger.getLogger(CdmRemoteCacheManager.class);
+
+
+    private Cache cdmlibModelCache;
+
+    private static CdmRemoteCacheManager cdmRemoteCacheManager = null;
+
+    public static final String CDM_MODEL_CACHE_NAME = "cdmModelGetMethodsCache";
+
+    private static Thread initThread;
+
+    private static boolean cacheInitialised = false;
+
+    public enum CdmCacheManagerType {
+        CDMLIB_MODEL,
+        DEFAULT
+    }
+
+    public static CdmRemoteCacheManager getInstance(){
+
+        if(cdmRemoteCacheManager == null) {
+            cdmRemoteCacheManager = new CdmRemoteCacheManager();
+        }
+        return cdmRemoteCacheManager;
+    }
+    private CdmRemoteCacheManager() {
+
+
+        try {
+            // NOTE:Programmatically creating the cache manager may solve the problem of
+            //      recreating data written to disk on startup
+            //      see https://stackoverflow.com/questions/1729605/ehcache-persist-to-disk-issues
+            //String cacheFilePath = CDMLIB_CACHE_MANAGER_CONFIG_RESOURCE.getFile().getAbsolutePath();
+            //InputStream in = this.getClass().getClassLoader().getResourceAsStream("cdmlib-ehcache.xml");
+
+            SizeOfPolicyConfiguration sizeOfConfig = new SizeOfPolicyConfiguration();
+            sizeOfConfig.setMaxDepth(1000);
+            sizeOfConfig.setMaxDepthExceededBehavior("abort");
+
+            CacheConfiguration modelcc = new CacheConfiguration(CDM_MODEL_CACHE_NAME, 0)
+            .eternal(true)
+            .statistics(true)
+            .sizeOfPolicy(sizeOfConfig)
+            .overflowToOffHeap(false);
+
+            cdmlibModelCache = new Cache(modelcc);
+
+            CacheManager.create().addCache(cdmlibModelCache);
+            CdmModelCacher cmdmc = new CdmModelCacher();
+            cmdmc.cacheGetterFields(cdmlibModelCache);
+
+        } catch (CacheException e) {
+            throw new CdmClientCacheException(e);
+        } catch (ClassNotFoundException e) {
+            throw new CdmClientCacheException(e);
+        } catch (IOException e) {
+            throw new CdmClientCacheException(e);
+        } catch (URISyntaxException e) {
+            throw new CdmClientCacheException(e);
+        }
+
+    }
+
+
+    public Cache getCdmModelGetMethodsCache(){
+        return cdmlibModelCache;
+    }
+
+    public static void removeEntityCaches() {
+        CacheManager cm = CacheManager.create();
+        String[] cacheNames = CacheManager.create().getCacheNames();
+        for(String cacheName : cacheNames) {
+            if(!cacheName.equals(CDM_MODEL_CACHE_NAME)) {
+                cm.removeCache(cacheName);
+            }
+        }
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmTransientEntityCacher.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmTransientEntityCacher.java
new file mode 100644 (file)
index 0000000..f1909f0
--- /dev/null
@@ -0,0 +1,330 @@
+// $Id$
+/**
+ * Copyright (C) 2014 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.remoting.cache;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.CacheManager;
+import net.sf.ehcache.Element;
+import net.sf.ehcache.Status;
+import net.sf.ehcache.config.CacheConfiguration;
+import net.sf.ehcache.config.SizeOfPolicyConfiguration;
+import net.sf.ehcache.statistics.LiveCacheStatistics;
+
+import org.apache.log4j.Logger;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.api.service.dto.CdmEntityIdentifier;
+import eu.etaxonomy.cdm.model.ICdmCacher;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
+
+/**
+ *
+ * This cache guarantees that
+ *  - all objects put will be ancestors of CdmBase
+ *  - all CdmBase objects in the cache will be already de-proxied
+ *  - after any CdmBase object is put in the cache,
+ *  all non-null / non-proxy CdmBase objects in the sub-graph
+ *  will also be present in the cache.
+ *
+ * @author cmathew
+ * @date 14 Oct 2014
+ *
+ */
+
+public class CdmTransientEntityCacher implements ICdmCacher {
+
+    private static final Logger logger = Logger.getLogger(CdmTransientEntityCacher.class);
+
+
+    private final ICdmEntitySessionManager cdmEntitySessionManager;
+
+    private static CdmServiceCacher cdmServiceCacher;
+
+    private final String cacheId;
+
+    private final Cache cache;
+
+    private final CacheLoader cacheLoader;
+
+    private final Map<UUID, CdmBase> newEntitiesMap = new HashMap<UUID, CdmBase>();
+
+    public CdmTransientEntityCacher(String cacheId, ICdmEntitySessionManager cdmEntitySessionManager) {
+        this.cacheId = cacheId;
+
+        cache = new Cache(getEntityCacheConfiguration(cacheId));
+
+        CacheManager.create().removeCache(cache.getName());
+        CacheManager.create().addCache(cache);
+
+        this.cdmEntitySessionManager = cdmEntitySessionManager;
+
+        cacheLoader = new CacheLoader(this);
+
+    }
+
+    public CdmTransientEntityCacher(Object sessionOwner, ICdmEntitySessionManager cdmEntitySessionManager) {
+        this(generateCacheId(sessionOwner), cdmEntitySessionManager);
+    }
+
+    public static String generateCacheId(Object sessionOwner) {
+        return sessionOwner.getClass().getName() +  String.valueOf(sessionOwner.hashCode());
+    }
+
+    /**
+     * Returns the default cache configuration.
+     *
+     * @return
+     */
+    private CacheConfiguration getEntityCacheConfiguration(String cacheId) {
+        SizeOfPolicyConfiguration sizeOfConfig = new SizeOfPolicyConfiguration();
+        sizeOfConfig.setMaxDepth(100);
+        sizeOfConfig.setMaxDepthExceededBehavior("abort");
+
+        return new CacheConfiguration(cacheId, 0)
+        .eternal(true)
+        .statistics(true)
+        .sizeOfPolicy(sizeOfConfig)
+        .overflowToOffHeap(false);
+
+    }
+
+    public static void setDefaultCacher(CdmServiceCacher css) {
+        cdmServiceCacher = css;
+    }
+
+    public LiveCacheStatistics getCacheStatistics() {
+        if(cache.getStatus() == Status.STATUS_ALIVE) {
+            return cache.getLiveCacheStatistics();
+        }
+        return null;
+
+    }
+
+    /**
+     * Returns the cache corresponding to the cache id
+     *
+     * @param cacheId
+     * @return
+     */
+    private Cache getCache() {
+        return  CacheManager.create().getCache(cacheId);
+    }
+
+    public <T extends Object> T load(T obj, boolean update) {
+        return cacheLoader.load(obj, true, update);
+    }
+
+    public <T extends Object> Map<T,T> load(Map<T,T> map, boolean update){
+        return cacheLoader.load(map, true, update);
+    }
+
+    public <T extends Object> Collection<T> load(Collection<T> collection, boolean update){
+        return cacheLoader.load(collection, true, update);
+    }
+
+    public CdmBase load(CdmBase cdmEntity, boolean update) {
+        return cacheLoader.load(cdmEntity, true, update);
+    }
+
+
+    private CdmBase load(CdmEntityIdentifier cei, boolean update) {
+        return CdmApplicationState.getCommonService().findWithUpdate(cei.getCdmClass(), cei.getId());
+    }
+
+
+    public UpdateResult load(UpdateResult result, boolean update) {
+        // probably a good time to broadcast to other sessions
+
+        Set<CdmBase> updatedObjects = result.getUpdatedObjects();
+        Set<CdmBase> reloadedObjects = new HashSet<CdmBase>();
+        Set<CdmEntityIdentifier> updatedCdmIds = result.getUpdatedCdmIds();
+        boolean updatedCdmIdsIsEmpty = updatedCdmIds.isEmpty();
+
+        // if the cdm identifier set contains identifiers of objects already
+        // present in the updated objects set reomve them
+        for(CdmBase updatedObject : updatedObjects) {
+            if(updatedObject != null && exists(new CdmEntityCacheKey(updatedObject.getClass(), updatedObject.getId()))) {
+                CdmEntityIdentifier cdmEntityIdentifier = new CdmEntityIdentifier(updatedObject.getId(), updatedObject.getClass());
+                if(!updatedCdmIdsIsEmpty && updatedCdmIds.contains(cdmEntityIdentifier)) {
+                    updatedCdmIds.remove(cdmEntityIdentifier);
+                }
+                reloadedObjects.add(cacheLoader.load(updatedObject, true, update));
+            }
+        }
+
+        // remote load cdm identifiers of objects which already exist
+        // in the cache
+
+        for(CdmEntityIdentifier cei : updatedCdmIds) {
+            if(exists(new CdmEntityCacheKey(cei.getCdmClass(), cei.getId()))) {
+                reloadedObjects.add(load(cei, update));
+            }
+
+        }
+        updatedObjects.clear();
+        result.addUpdatedObjects(reloadedObjects);
+        return result;
+    }
+
+    public MergeResult<CdmBase> load(MergeResult<CdmBase> mergeResult, boolean update) {
+        return cacheLoader.load(mergeResult, true, update);
+    }
+
+    public CdmModelFieldPropertyFromClass getFromCdmlibModelCache(String className) {
+        return cacheLoader.getFromCdmlibModelCache(className);
+    }
+
+
+    public void addNewEntity(CdmBase newEntity) {
+        if(newEntity != null && newEntity.getId() == 0 && newEntity.getUuid() != null) {
+            newEntitiesMap.put(newEntity.getUuid(), newEntity);
+        }
+    }
+
+    @Override
+    public void put(CdmBase cdmEntity) {
+
+        CdmBase cachedCdmEntity = cdmServiceCacher.load(cdmEntity);
+        if(cachedCdmEntity != null) {
+            logger.info("Cdm Entity with id : " + cdmEntity.getId() + " already exists in permanent cache. Ignoring put.");
+            return;
+        }
+        CdmEntityCacheKey id = new CdmEntityCacheKey(cdmEntity);
+
+        cachedCdmEntity = getFromCache(id);
+        if(cachedCdmEntity == null) {
+            CdmBase cdmEntityToCache = cdmEntity;
+            CdmBase newEntity = newEntitiesMap.get(cdmEntity.getUuid());
+            if(newEntity != null) {
+                newEntity.setId(cdmEntity.getId());
+                cdmEntityToCache = newEntity;
+            }
+            getCache().put(new Element(id, cdmEntityToCache));
+            cdmEntityToCache.initListener();
+            newEntitiesMap.remove(cdmEntity.getUuid());
+            logger.info(" - object of type " + cdmEntityToCache.getClass().getName() + " with id " + cdmEntityToCache.getId() + " put in cache");
+            return;
+        }
+        logger.info(" - object of type " + cdmEntity.getClass().getName() + " with id " + cdmEntity.getId() + " already exists");
+    }
+
+
+    private Element getCacheElement(CdmEntityCacheKey key) {
+        return getCache().get(key);
+    }
+
+
+    public CdmBase getFromCache(CdmEntityCacheKey id) {
+        Element e = getCacheElement(id);
+
+        if (e == null) {
+            return null;
+        } else {
+            return (CdmBase) e.getObjectValue();
+        }
+    }
+
+    public CdmBase getFromCache(Class<? extends CdmBase> clazz, int id) {
+        CdmEntityCacheKey cacheId = generateKey(clazz,id);
+        return getFromCache(cacheId);
+    }
+
+    @Override
+    public CdmBase getFromCache(CdmBase cdmBase) {
+
+        CdmEntityCacheKey cacheId = generateKey((CdmBase)ProxyUtils.deproxy(cdmBase));
+        // first try this cache
+        CdmBase  cachedCdmEntity = getFromCache(cacheId);
+
+        if(cachedCdmEntity == null) {
+            // ... then try the permanent cache
+            cachedCdmEntity = cdmServiceCacher.getFromCache(cdmBase.getUuid());
+        }
+
+        return cachedCdmEntity;
+    }
+
+    public CdmBase getFromCache(CdmBase cdmBase, Class<? extends CdmBase> clazz) {
+
+        cdmBase = CdmBase.deproxy(cdmBase, clazz);
+        return getFromCache(cdmBase);
+    }
+
+    public List<CdmBase> getAllEntities() {
+        List<CdmBase> entities = new ArrayList<CdmBase>();
+        Map<String, CdmBase> elementsMap = getCache().getAllWithLoader(getCache().getKeys(), null);
+        for (Map.Entry<String, CdmBase> entry : elementsMap.entrySet()) {
+            entities.add(entry.getValue());
+        }
+        return entities;
+    }
+
+    public boolean exists(CdmEntityCacheKey key) {
+        return (getCacheElement(key) != null);
+    }
+
+    public boolean existsAndIsNotNull(CdmEntityCacheKey id) {
+        return getFromCache(id) != null;
+    }
+
+    public void clear() {
+        cache.removeAll();
+    }
+
+    public void dispose() {
+        CacheManager.create().removeCache(cache.getName());
+        cache.dispose();
+        newEntitiesMap.clear();
+
+    }
+
+
+    public static CdmEntityCacheKey generateKey(Class<? extends CdmBase> clazz, int id) {
+        return new CdmEntityCacheKey(clazz, id);
+    }
+
+
+    public static CdmEntityCacheKey generateKey(CdmBase cdmBase) {
+        Class<? extends CdmBase> entityClass = cdmBase.getClass();
+        int id = cdmBase.getId();
+        return new CdmEntityCacheKey(entityClass, id);
+    }
+
+    @Override
+    public CdmBase load(CdmBase cdmEntity) {
+        return load(cdmEntity, true);
+    }
+
+    @Override
+    public boolean isCachable(CdmBase cdmEntity) {
+        return true;
+    }
+
+    @Override
+    public boolean exists(CdmBase cdmBase) {
+        return exists(generateKey(cdmBase));
+    }
+
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/EntityCacherDebugResult.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/EntityCacherDebugResult.java
new file mode 100644 (file)
index 0000000..7319529
--- /dev/null
@@ -0,0 +1,539 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.remoting.cache;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.CacheManager;
+import net.sf.ehcache.Element;
+
+import org.apache.log4j.Logger;
+import org.hibernate.collection.spi.PersistentCollection;
+import org.hibernate.proxy.HibernateProxy;
+import org.hibernate.proxy.LazyInitializer;
+import org.springframework.util.ReflectionUtils;
+
+import eu.etaxonomy.cdm.api.cache.CdmCacher;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+
+/**
+ * @author cmathew
+ * @date 9 Feb 2015
+ *
+ */
+public class EntityCacherDebugResult {
+
+    private static final Logger logger = Logger.getLogger(EntityCacherDebugResult.class);
+
+    private Map<CdmEntityInfo, CdmEntityInfo> duplicateCdmEntityMap;
+
+    private List<CdmEntityInfo> notInCacheList;
+
+    private CdmTransientEntityCacher cacher;
+
+    private List<CdmEntityInfo> rootElements;
+
+    StringBuilder debugOutput = new StringBuilder();
+
+    public EntityCacherDebugResult() {
+    }
+
+
+    public <T extends CdmBase> EntityCacherDebugResult(CdmTransientEntityCacher cacher, Collection<T> rootEntities) {
+        this.cacher = cacher;
+        init();
+
+        if(rootEntities != null && !rootEntities.isEmpty()) {
+            for(CdmBase rootEntity : rootEntities) {
+                debug(rootEntity, true);
+                String out = toString(duplicateCdmEntityMap, notInCacheList, rootEntity);
+                System.out.println(out);
+                debugOutput.append(out);
+                clear();
+            }
+
+        }
+    }
+
+    private void init() {
+        duplicateCdmEntityMap = new HashMap<CdmEntityInfo, CdmEntityInfo>();
+        notInCacheList = new ArrayList<CdmEntityInfo>();
+        rootElements = new ArrayList<CdmEntityInfo>();
+    }
+
+    private void clear() {
+        duplicateCdmEntityMap.clear();
+        notInCacheList.clear();
+    }
+
+    public void addDuplicateEntity(CdmEntityInfo cei, CdmEntityInfo cachedCei) {
+        duplicateCdmEntityMap.put(cei, cachedCei);
+    }
+
+    public void addEntityNotInCache(CdmEntityInfo cei) {
+        notInCacheList.add(cei);
+    }
+
+    public List<CdmEntityInfo> getRootElements() {
+        return rootElements;
+    }
+
+    private void print(Map<CdmEntityInfo, CdmEntityInfo> duplicateCdmEntityMap,
+            List<CdmEntityInfo> notInCacheList,
+            CdmBase rootEntity) {
+        System.out.println(toString(duplicateCdmEntityMap, notInCacheList, rootEntity));
+    }
+
+
+    @Override
+    public String toString() {
+        return debugOutput.toString();
+    }
+
+    private String toString(Map<CdmEntityInfo, CdmEntityInfo> duplicateCdmEntityMap,
+            List<CdmEntityInfo> notInCacheList,
+            CdmBase rootEntity) {
+
+
+        StringBuilder sb = new StringBuilder();
+        sb.append(System.getProperty("line.separator"));
+        sb.append("<<< Root Entity " + rootEntity.getUserFriendlyTypeName() + " with id " + rootEntity.getId() + " >>>");
+        sb.append(System.getProperty("line.separator"));
+        if(duplicateCdmEntityMap.isEmpty()) {
+            sb.append("No Duplicate CDM Entities.");
+        } else {
+            sb.append("Duplicate CDM Entities,");
+
+            for (Map.Entry<CdmEntityInfo, CdmEntityInfo> entry : duplicateCdmEntityMap.entrySet())
+            {
+                sb.append(System.getProperty("line.separator"));
+                CdmEntityInfo cei = entry.getKey();
+                CdmBase cb = (CdmBase) cei.getObject();
+
+                sb.append(" - " + cei.getField().getName() + ":" + cb.getUserFriendlyTypeName() + "/" + cb.getId());
+                if(cei.getParent() != null) {
+                    Object cbParent = cei.getParent().getObject();
+                    sb.append("     in entity " + cbParent.getClass().getCanonicalName());
+                    if(cbParent instanceof CdmBase) {
+
+                        sb.append(" with id : " + ((CdmBase)cbParent).getId());
+                    }
+                }
+                sb.append(System.getProperty("line.separator"));
+                sb.append("  -- entity belongs to cache(s) : " + getCachesContainingEntity(cb));
+                sb.append(System.getProperty("line.separator"));
+
+
+                CdmEntityInfo dupCei = entry.getValue();
+                CdmBase dupCb = (CdmBase) dupCei.getObject();
+
+                String dupCeiFieldName = "";
+                if(dupCei.getField() != null) {
+                    dupCeiFieldName = dupCei.getField().getName();
+                }
+                sb.append(" - " + dupCeiFieldName + ":" + dupCb.getUserFriendlyTypeName() + "/" + dupCb.getId());
+                if(dupCei.getParent() != null) {
+                    Object dupCbParent = dupCei.getParent().getObject();
+                    sb.append("      in entity " + dupCbParent.getClass().getCanonicalName());
+                    if(dupCbParent instanceof CdmBase) {
+                        sb.append(" with id : " + ((CdmBase)dupCbParent).getId());
+                    }
+                }
+                sb.append(System.getProperty("line.separator"));
+                sb.append("  -- entity belongs to cache(s) : " + getCachesContainingEntity(dupCb));
+                sb.append(System.getProperty("line.separator"));
+                sb.append("-----------");
+            }
+        }
+
+        sb.append(System.getProperty("line.separator"));
+        sb.append(System.getProperty("line.separator"));
+
+        if(notInCacheList.isEmpty()) {
+            sb.append("No Entities found which are not in Cache.");
+        } else {
+            sb.append("Not In Cache Entities,");
+
+            for(CdmEntityInfo cei : notInCacheList) {
+                CdmBase cb = (CdmBase) cei.getObject();
+                Object cbParent = cei.getParent().getObject();
+
+                sb.append(System.getProperty("line.separator"));
+
+                String fieldName = "";
+                if(cei.getField() != null) {
+                    fieldName = cei.getField().getName();
+                }
+                sb.append(" - "  + fieldName + ":" + cb.getUserFriendlyTypeName() + "/" + cb.getId());
+
+                if(cbParent instanceof CdmBase) {
+                    sb.append(" of entity " + ((CdmBase)cbParent).getUserFriendlyTypeName());
+                } else {
+                    sb.append(" of entity " + cbParent.getClass().getName());
+                }
+            }
+        }
+        sb.append(System.getProperty("line.separator"));
+        return sb.toString();
+    }
+
+    private String getCachesContainingEntity(CdmBase cdmEntity) {
+        Cache defaultCache = CacheManager.create().getCache(CdmCacher.DEFAULT_CACHE_NAME);
+        String caches = "";
+        Element dce = defaultCache.get(cdmEntity.getUuid());
+        if(dce != null && dce.getObjectValue() == cdmEntity) {
+            caches = "{DC}";
+        }
+
+        Object cte = cacher.getFromCache(CdmTransientEntityCacher.generateKey(cdmEntity));
+        if(cte != null && cte == cdmEntity) {
+            caches += "{TC}";
+        }
+        return caches;
+    }
+
+
+    private void debug(CdmBase cdmEntity, boolean recursive) {
+        if(cdmEntity == null) {
+            return;
+        }
+        logger.info("---- starting recursive debug for cdm entity " + cdmEntity.getClass().getName() + " with id " + cdmEntity.getId());
+        List<CdmEntityInfo> alreadyVisitedEntities = new ArrayList<CdmEntityInfo>();
+        CdmEntityInfo cei = new CdmEntityInfo(ProxyUtils.deproxy(cdmEntity));
+        debugRecursive(cdmEntity, alreadyVisitedEntities, cei);
+        rootElements.add(cei);
+        alreadyVisitedEntities.clear();
+        logger.info("---- ending recursive debug for cdm entity " + cdmEntity.getClass().getName() + " with id " + cdmEntity.getId() + "\n");
+    }
+
+    private <T extends Object> void debugRecursive(T obj,
+            List<CdmEntityInfo> alreadyVisitedEntities,
+            CdmEntityInfo cei) {
+        if(obj == null) {
+            return;
+        }
+        if(obj instanceof CdmBase) {
+            debugRecursive((CdmBase)obj, alreadyVisitedEntities, cei);
+        } else if (obj instanceof Map) {
+            debug((Map<T,T>)obj, alreadyVisitedEntities, cei);
+        } else if (obj instanceof Collection) {
+            debug((Collection<T>)obj, alreadyVisitedEntities, cei);
+        }
+
+        logger.info("No caching yet for type " + obj.getClass().getName());
+
+
+    }
+
+    private <T extends Object> void debug(Map<T,T> map,
+            List<CdmEntityInfo> alreadyVisitedEntities,
+            CdmEntityInfo cei) {
+        if(map == null || map.isEmpty()) {
+            return;
+        }
+
+        int originalMapSize = map.size();
+
+        Iterator<Map.Entry<T,T>> iter = map.entrySet().iterator();
+        int i=0;
+        while ( iter.hasNext() ) {
+            Map.Entry<T,T> e = iter.next();
+            CdmEntityInfo childCei = new CdmEntityInfo(e);
+            cei.addChild(childCei);
+
+            CdmEntityInfo keyCei = new CdmEntityInfo(ProxyUtils.deproxy(e.getKey()));
+            childCei.addChild(keyCei);
+            CdmEntityInfo valueCei = new CdmEntityInfo(ProxyUtils.deproxy(e.getValue()));
+            childCei.addChild(valueCei);
+
+            debugRecursive(e.getKey(), alreadyVisitedEntities, keyCei);
+            debugRecursive(e.getValue(), alreadyVisitedEntities, valueCei);
+        }
+    }
+
+    private <T extends Object> void debug(Collection<T> collection,
+            List<CdmEntityInfo> alreadyVisitedEntities,
+            CdmEntityInfo cei) {
+        int length = collection.size();
+        Object[] result = new Object[length];
+        Iterator<T> collectionItr = collection.iterator();
+
+        while(collectionItr.hasNext()) {
+            Object obj = collectionItr.next();
+            CdmEntityInfo childCei = new CdmEntityInfo(ProxyUtils.deproxy(obj));
+            cei.addChild(childCei);
+            debugRecursive(obj, alreadyVisitedEntities, childCei);
+
+        }
+
+    }
+
+    private void debugRecursive(CdmBase cdmEntity,
+            List<CdmEntityInfo> alreadyVisitedEntities,
+            CdmEntityInfo cei) {
+
+        CdmBase cachedCdmEntityInSubGraph = null;
+
+        if(cei.getObject() instanceof CdmBase) {
+           CdmBase cb =  (CdmBase)cei.getObject();
+           cachedCdmEntityInSubGraph = cacher.getFromCache(cb);
+           if(cachedCdmEntityInSubGraph != cb) {
+               // found a cdm entity which is not in cache - need to record this
+               //logger.info("  - found entity not in cache " + fieldName + "' in object of type " + clazz.getName() + " with id " + cdmEntity.getId());
+               addEntityNotInCache(cei);
+           }
+        }
+
+
+        // we want to recursive through the cdmEntity (and not the cachedCdmEntity)
+        // since there could be new or deleted objects in the cdmEntity sub-graph
+
+        // start by getting the fields from the cdm entity
+        String className = cdmEntity.getClass().getName();
+        CdmModelFieldPropertyFromClass cmgmfc = cacher.getFromCdmlibModelCache(className);
+        if(cmgmfc != null) {
+            alreadyVisitedEntities.add(cei);
+            List<String> fields = cmgmfc.getFields();
+            for(String field : fields) {
+                // retrieve the actual object corresponding to the field.
+                // this object will be either a CdmBase or a Collection / Map
+                // with CdmBase as the generic type
+                String f = field;
+                CdmEntityInfo childCei = getDebugCdmBaseTypeFieldValue(cdmEntity, field, alreadyVisitedEntities, cei);
+                if(!childCei.isProxy()) {
+                    Object object = childCei.getObject();
+                    if(object != null && object instanceof CdmBase) {
+                        CdmBase cdmEntityInSubGraph = (CdmBase)object;
+                        if(!containsIdenticalCdmEntity(alreadyVisitedEntities, cdmEntityInSubGraph)) {
+                            logger.info("recursive debugging object of type " + cdmEntityInSubGraph.getClass().getName() + " with id " + cdmEntityInSubGraph.getId());
+                            debugRecursive(cdmEntityInSubGraph, alreadyVisitedEntities, childCei);
+                        } else {
+                            logger.info("object of type " + cdmEntityInSubGraph.getClass().getName() + " with id " + cdmEntityInSubGraph.getId() + " already visited");
+                        }
+                    }
+                }
+            }
+        } else {
+            throw new CdmClientCacheException("CdmEntity with class " + cdmEntity.getClass().getName() + " is not found in the cdmlib model cache. " +
+                    "The cache may be corrupted or not in sync with the latest model version" );
+        }
+
+    }
+
+
+    private CdmEntityInfo getDebugCdmBaseTypeFieldValue(CdmBase cdmEntity,
+            String fieldName,
+            List<CdmEntityInfo> alreadyVisitedEntities,
+            CdmEntityInfo cei) {
+
+        CdmEntityInfo childCei = null;
+        Class<?> clazz = cdmEntity.getClass();
+        try {
+            // this call will search in the provided class as well as
+            // the super classes until it finds the field
+            Field field = ReflectionUtils.findField(clazz, fieldName);
+
+            if(field == null) {
+                throw new CdmClientCacheException("Field '" + fieldName
+                        + "' not found when searching in class '" + clazz.getName() + "' and its supercalsses");
+            }
+            field.setAccessible(true);
+            Object o = field.get(cdmEntity);
+            o = ProxyUtils.deproxy(o);
+            CdmBase cdmEntityInSubGraph = null;
+
+            boolean isHibernateProxy = false;
+            boolean isPersistentCollection = false;
+
+            childCei = new CdmEntityInfo(o);
+            cei.addChild(childCei);
+            childCei.setField(field);
+
+            if(o != null) {
+                boolean isProxy = ProxyUtils.isProxy(o);
+
+                childCei.setProxy(isProxy);
+                if(!isProxy) {
+                    childCei.setObject(o);
+                    if(CdmBase.class.isAssignableFrom(o.getClass())) {
+                        logger.info("found initialised cdm entity '" + fieldName + "' in object of type " + clazz.getName() + " with id " + cdmEntity.getId());
+                        cdmEntityInSubGraph  = (CdmBase)o;
+
+                        //logger.info("  - found duplicate entity at " + fieldName + "' in object of type " + clazz.getName() + " with id " + cdmEntity.getId());
+                        CdmEntityInfo dupCei = getDuplicate(alreadyVisitedEntities, cdmEntityInSubGraph);
+                        if(dupCei != null) {
+                            addDuplicateEntity(childCei, dupCei);
+                        }
+
+                    } else if(o instanceof Map) {
+                        debugRecursive((Map)o, alreadyVisitedEntities, childCei);
+                    } else if(o instanceof Collection) {
+                        debugRecursive((Collection)o, alreadyVisitedEntities, childCei);
+                    }
+
+                }
+            }
+            // we return the original cdm entity in the sub graph because we
+            // want to continue to recurse on the input cdm entity graph
+            // and not the one in the cache
+
+            return childCei;
+        } catch (SecurityException e) {
+            throw new CdmClientCacheException(e);
+        } catch (IllegalArgumentException e) {
+            throw new CdmClientCacheException(e);
+        } catch (IllegalAccessException e) {
+            throw new CdmClientCacheException(e);
+        }
+    }
+
+
+    private CdmEntityInfo getDuplicate(List<CdmEntityInfo> alreadyVisitedEntities, Object objectToCompare) {
+        if(objectToCompare != null ) {
+            for(CdmEntityInfo cei: alreadyVisitedEntities) {
+                if(objectToCompare.equals(cei.getObject()) && objectToCompare != cei.getObject()) {
+                    return cei;
+                }
+            }
+        }
+        return null;
+    }
+
+    private boolean containsIdenticalCdmEntity(List<CdmEntityInfo> ceiSet, Object objectToCompare) {
+        boolean foundIdentical = false;
+        if(objectToCompare != null) {
+            for(CdmEntityInfo cei : ceiSet) {
+                if(cei.getObject() == objectToCompare) {
+                    foundIdentical = true;
+                } else if(objectToCompare.equals(cei.getObject())) {
+                    return false;
+                }
+            }
+        }
+        return foundIdentical;
+    }
+
+    public class CdmEntityInfo {
+
+        private Object object;
+        private CdmEntityInfo parent;
+        private List<CdmEntityInfo> children;
+        private Field field;
+        private String label;
+        private boolean isProxy;
+
+        public CdmEntityInfo(Object object) {
+            this.object = object;
+            isProxy = false;
+            children = new ArrayList<CdmEntityInfo>();
+        }
+
+        public CdmEntityInfo getParent() {
+            return parent;
+        }
+
+        public void setParent(CdmEntityInfo parent) {
+            this.parent = parent;
+        }
+
+        public List<CdmEntityInfo> getChildren() {
+            return children;
+        }
+
+        public void setChildren(List<CdmEntityInfo> children) {
+            this.children = children;
+        }
+
+        public void addChild(CdmEntityInfo cei) {
+            this.children.add(cei);
+            cei.setParent(this);
+        }
+
+        public Field getField() {
+            return field;
+        }
+
+        public void setField(Field field) {
+            this.field = field;
+        }
+
+
+        public String getLabel() {
+            String label;
+            String fieldName = "";
+            if(field != null) {
+                fieldName = field.getName();
+            }
+
+            if(object != null) {
+                String className = object.getClass().getName();
+                if(object instanceof HibernateProxy) {
+                    LazyInitializer hli = ((HibernateProxy)object).getHibernateLazyInitializer();
+                    if(hli.isUninitialized()) {
+                        className = "HibernateProxy";
+                    } else {
+                        className = "InitialisedHibernateProxy";
+                    }
+                    label = "[" + className + "] " + fieldName;
+                } else if(object instanceof PersistentCollection) {
+                    PersistentCollection pc = ((PersistentCollection)object);
+                    if(!pc.wasInitialized()) {
+                        className = "PersistentCollection";
+                    } else {
+                        className = "InitialisedPersistentCollection";
+                    }
+                    label = "[" + className + "] " + fieldName;
+                } else if(object instanceof Collection) {
+                    label = "[" + className + "] " + fieldName + " : " + String.valueOf(((Collection)object).size());
+                } else if(object instanceof Map) {
+                    label = "[" + className + "] " + fieldName + " : " + String.valueOf(((Map)object).size());
+                } else if(object instanceof CdmBase) {
+                    label = getCachesContainingEntity((CdmBase)object) +  "[" + className + ",id" + ((CdmBase)object).getId() + "] " + fieldName + " : " + object.toString();
+                } else {
+                    label = "[" + className + "] " + fieldName + " : " + object.toString();
+                }
+            } else {
+                label = "[NULL] " + fieldName;
+            }
+            return label;
+        }
+
+        public void setLabel(String label) {
+            this.label = label;
+        }
+
+        public Object getObject() {
+            return object;
+        }
+
+        public void setObject(Object object) {
+            this.object = object;
+        }
+
+        public boolean isProxy() {
+            return isProxy;
+        }
+
+        public void setProxy(boolean isProxy) {
+            this.isProxy = isProxy;
+        }
+
+
+
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/ProxyUtils.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/ProxyUtils.java
new file mode 100644 (file)
index 0000000..ceca3e9
--- /dev/null
@@ -0,0 +1,221 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.remoting.cache;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import java.util.UUID;
+
+import org.hibernate.collection.internal.PersistentBag;
+import org.hibernate.collection.internal.PersistentList;
+import org.hibernate.collection.internal.PersistentMap;
+import org.hibernate.collection.internal.PersistentSet;
+import org.hibernate.collection.internal.PersistentSortedMap;
+import org.hibernate.collection.internal.PersistentSortedSet;
+import org.hibernate.collection.spi.PersistentCollection;
+import org.hibernate.proxy.HibernateProxy;
+import org.hibernate.proxy.LazyInitializer;
+import org.springframework.util.ReflectionUtils;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.PersistentMultiLanguageText;
+import eu.etaxonomy.taxeditor.remoting.CdmRemotingException;
+
+/**
+ * @author cmathew
+ * @date 17 Feb 2015
+ *
+ */
+public class ProxyUtils {
+
+
+
+    public static enum CollectionType {
+        SET,
+        LIST,
+        MAP;
+
+        @Override
+        public String toString() {
+            return this.name().toLowerCase();
+        }
+    }
+
+    public static Object getCollectionType(Object obj) {
+        if(obj != null) {
+            if(obj instanceof List) {
+                return CollectionType.LIST;
+            }
+            if(obj instanceof Set) {
+                return CollectionType.SET;
+            }
+            if(obj instanceof Map) {
+                return CollectionType.MAP;
+            }
+            throw new CdmRemotingException("Cannot get Collection Type for " + obj.getClass().getName());
+        }
+        return null;
+    }
+
+    public static Object getObject(PersistentCollection pc) {
+        if(pc != null) {
+            if(pc instanceof PersistentSet) {
+                return new HashSet((Set)pc);
+            }
+            if(pc instanceof PersistentSortedSet) {
+                return new TreeSet((Set)pc);
+            }
+            if(pc instanceof PersistentList || pc instanceof PersistentBag) {
+                return new ArrayList((List)pc);
+            }
+            if(pc instanceof PersistentMap || pc instanceof PersistentMultiLanguageText) {
+                return new HashMap((Map)pc);
+            }
+            if(pc instanceof PersistentSortedMap) {
+                return new TreeMap((Map)pc);
+            }
+            throw new CdmRemotingException("Cannot get Collection field for type " + pc.getClass().getName());
+        }
+        return null;
+    }
+
+    public static CollectionField getCollectionField(PersistentCollection pc) {
+        if(pc != null) {
+            if(pc instanceof PersistentSet) {
+                return new CollectionField(new HashSet((Set)pc), CollectionType.SET);
+            }
+            if(pc instanceof PersistentSortedSet) {
+                return new CollectionField(new TreeSet((Set)pc), CollectionType.SET);
+            }
+            if(pc instanceof PersistentList) {
+                return new CollectionField(new ArrayList((List)pc), CollectionType.LIST);
+            }
+            if(pc instanceof PersistentMap || pc instanceof PersistentMultiLanguageText) {
+                return new CollectionField(new HashMap((Map)pc), CollectionType.MAP);
+            }
+            if(pc instanceof PersistentSortedMap) {
+                return new CollectionField(new TreeMap((Map)pc), CollectionType.MAP);
+            }
+            throw new CdmRemotingException("Cannot get Collection field for type " + pc.getClass().getName());
+        }
+        return null;
+    }
+
+    public static class CollectionField {
+        private final Object col;
+        private final CollectionType type;
+        public CollectionField(Object col, CollectionType type) {
+            this.col = col;
+            this.type = type;
+        }
+
+        public Object getCollection() {
+            return this.col;
+        }
+
+        public CollectionType getType() {
+            return this.type;
+        }
+    }
+
+
+    public static Object deproxy(Object o) {
+        if(o != null && o instanceof HibernateProxy) {
+            LazyInitializer hli = ((HibernateProxy)o).getHibernateLazyInitializer();
+            if(!hli.isUninitialized()) {
+                return hli.getImplementation();
+
+            }
+        }
+
+        if(o != null && o instanceof PersistentCollection) {
+            PersistentCollection pc = ((PersistentCollection)o);
+            if(pc.wasInitialized()) {
+                return  ProxyUtils.getObject(pc);
+
+            }
+        }
+        return o;
+    }
+
+    public static boolean isProxy(Object o) {
+        if(o != null && o instanceof HibernateProxy) {
+            LazyInitializer hli = ((HibernateProxy)o).getHibernateLazyInitializer();
+            if(hli.isUninitialized()) {
+                return true;
+            }
+        }
+
+        if(o != null && o instanceof PersistentCollection) {
+            PersistentCollection pc = ((PersistentCollection)o);
+            if(!pc.wasInitialized()) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    public static Object remoteLoadPersistentCollectionIfProxy(Object o, UUID ownerUuid, String fieldName) throws ClassNotFoundException {
+        if(o != null && o instanceof HibernateProxy) {
+            LazyInitializer hli = ((HibernateProxy)o).getHibernateLazyInitializer();
+            if(hli.isUninitialized()) {
+                return CdmApplicationState.getCachedCommonService().find((Class<CdmBase>)Class.forName(hli.getEntityName()),
+                        ((Integer)hli.getIdentifier()).intValue());
+            }
+        }
+
+        if(o != null && o instanceof PersistentCollection) {
+            PersistentCollection pc = ((PersistentCollection)o);
+            if(!pc.wasInitialized()) {
+                return CdmApplicationState.getCachedCommonService().initializeCollection(ownerUuid, fieldName);
+            }
+        }
+
+        return o;
+    }
+
+
+
+
+    public static void setRoleValueInOwner(Object owner, String role, Object value) {
+        if(role == null || role.isEmpty()) {
+            throw new CdmRemotingException("Role cannot be null or an empty string");
+        }
+
+        String fieldName = role.substring(role.lastIndexOf(".") + 1);
+
+        Field field = ReflectionUtils.findField(owner.getClass(), fieldName);
+
+        if(field == null) {
+            throw new CdmRemotingException("Field '" + fieldName
+                    + "' not found when searching in class '" + owner.getClass() + "' and its supercalsses");
+        }
+
+        field.setAccessible(true);
+
+        try {
+            field.set(owner, value);
+        } catch (IllegalArgumentException e) {
+            throw new CdmRemotingException(e);
+        } catch (IllegalAccessException e) {
+            throw new CdmRemotingException(e);
+        }
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/server/CDMServerException.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/server/CDMServerException.java
new file mode 100644 (file)
index 0000000..33cd998
--- /dev/null
@@ -0,0 +1,31 @@
+// $Id$
+/**
+* Copyright (C) 2014 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.remoting.server;
+
+/**
+ * @author cmathew
+ * @date 23 Sep 2014
+ *
+ */
+public class CDMServerException extends Exception {
+
+    public CDMServerException(String message) {
+        super(message);
+    }
+
+    public CDMServerException(Exception e) {
+        super(e);
+    }
+
+    public CDMServerException(String message,Exception e) {
+        super(message,e);
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/server/CDMServerUtils.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/server/CDMServerUtils.java
new file mode 100644 (file)
index 0000000..42bd28b
--- /dev/null
@@ -0,0 +1,91 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.remoting.server;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.StringEscapeUtils;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationUtils;
+import eu.etaxonomy.cdm.config.CdmPersistentXMLSource.CdmSourceProperties;
+import eu.etaxonomy.cdm.database.CdmPersistentDataSource;
+
+/**
+ * @author cmathew
+ * @date 11 Nov 2015
+ *
+ */
+public class CDMServerUtils {
+
+
+    public static String convertEditorToServerConfig() {
+        StringBuilder configStringBuilder = new StringBuilder();
+        configStringBuilder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?> " + System.lineSeparator());
+        configStringBuilder.append("<!-- DO NOT EDIT THIS FILE MANUALLY. -->");
+        configStringBuilder.append("<!-- It is created by the Taxonomic Editor for launching a managed CDM Server. -->");
+        configStringBuilder.append("<beans xmlns=\"http://www.springframework.org/schema/beans\"" + System.lineSeparator());
+        configStringBuilder.append("  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" + System.lineSeparator());
+        configStringBuilder.append("  xmlns:tx=\"http://www.springframework.org/schema/tx\"" + System.lineSeparator());
+        configStringBuilder.append("  xmlns:context=\"http://www.springframework.org/schema/context\"" + System.lineSeparator());
+        configStringBuilder.append("  xsi:schemaLocation=\"http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans-2.5.xsd" + System.lineSeparator());
+        configStringBuilder.append("  http://www.springframework.org/schema/context   http://www.springframework.org/schema/context/spring-context-2.5.xsd" + System.lineSeparator());
+        configStringBuilder.append("  http://www.springframework.org/schema/tx   http://www.springframework.org/schema/tx/spring-tx-2.5.xsd" + System.lineSeparator());
+        configStringBuilder.append("\">" + System.lineSeparator());
+        configStringBuilder.append(" <bean id=\"dataSourceProperties\" class=\"eu.etaxonomy.cdm.remote.config.DataSourceProperties\">" + System.lineSeparator());
+        configStringBuilder.append("   <property name=\"propsMap\">" + System.lineSeparator());
+        configStringBuilder.append("       <map/>" + System.lineSeparator());
+        configStringBuilder.append("   </property>" + System.lineSeparator());
+        configStringBuilder.append(" </bean>" + System.lineSeparator());
+
+        for(CdmPersistentDataSource dataSource : CdmPersistentDataSource.getAllDataSources()) {
+            String beanId = xmlNCNamefrom(dataSource.getName());
+            String user = dataSource.getUsername();
+            String password = dataSource.getPassword();
+            String driverClass = dataSource.getCdmSourceProperty(CdmSourceProperties.DRIVER_CLASS);
+            String jdbcUrl = StringEscapeUtils.escapeXml(dataSource.getCdmSourceProperty(CdmSourceProperties.URL));
+            configStringBuilder.append(" <bean id=\""  + beanId + "\" lazy-init=\"true\" class=\"com.mchange.v2.c3p0.ComboPooledDataSource\">" + System.lineSeparator());
+            configStringBuilder.append("   <property name=\"driverClass\" value=\"" + driverClass + "\"/>" + System.lineSeparator());
+            configStringBuilder.append("   <property name=\"user\" value=\"" + user + "\"/>" + System.lineSeparator());
+            configStringBuilder.append("   <property name=\"password\" value=\"" + password + "\"/>" + System.lineSeparator());
+            configStringBuilder.append("   <property name=\"jdbcUrl\" value=\"" + jdbcUrl + "\"/>" + System.lineSeparator());
+            configStringBuilder.append(" </bean>" + System.lineSeparator());
+
+        }
+        configStringBuilder.append("</beans>" + System.lineSeparator());
+
+        return configStringBuilder.toString();
+    }
+
+    /**
+     * Assures that the datasource name is converted into a valid XML type NCName.
+     *
+     * Prefixes the string and replaces all forbidden characters by '_'.
+     *
+     * @param dataSource
+     * @return
+     */
+    public static String xmlNCNamefrom(String beanName) {
+        return "MGD_" + beanName.replaceAll("[^a-zA-Z0-9]", "_");
+    }
+
+    public static File writeManagedServerConfig(String config, String fileName) throws IOException {
+        File managedConfigFile = new File(CdmApplicationUtils.getWritableResourceDir(), fileName);
+        if(managedConfigFile.exists()) {
+            managedConfigFile.delete();
+        }
+        if(managedConfigFile.createNewFile()) {
+            FileUtils.writeStringToFile(managedConfigFile, config);
+        }
+        return managedConfigFile;
+    }
+
+}
similarity index 88%
rename from eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/remote/CdmPersistentRemoteSource.java
rename to eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmPersistentRemoteSource.java
index a6cd14cd2e1d2d16e6787d30e5f3d2617752dd2b..e40e3625ff441fa1521a11d5d7f0806274a39984 100644 (file)
@@ -1,13 +1,13 @@
 /**
 * Copyright (C) 2014 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
-package eu.etaxonomy.cdm.remote;
+package eu.etaxonomy.taxeditor.remoting.source;
 
 import static eu.etaxonomy.cdm.common.XmlHelp.getBeansRoot;
 import static eu.etaxonomy.cdm.common.XmlHelp.insertXmlBean;
@@ -27,15 +27,8 @@ import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.common.XmlHelp;
 import eu.etaxonomy.cdm.config.CdmPersistentSourceUtils;
 import eu.etaxonomy.cdm.config.CdmPersistentXMLSource;
-import eu.etaxonomy.cdm.config.CdmSourceException;
-import eu.etaxonomy.cdm.config.ICdmPersistentSource;
 import eu.etaxonomy.cdm.config.CdmPersistentXMLSource.CdmSourceProperties;
-import eu.etaxonomy.cdm.database.CdmDataSource;
-import eu.etaxonomy.cdm.database.CdmPersistentDataSource;
-import eu.etaxonomy.cdm.database.DataSourceNotFoundException;
-import eu.etaxonomy.cdm.database.DatabaseTypeEnum;
-import eu.etaxonomy.cdm.database.ICdmDataSource;
-import eu.etaxonomy.cdm.database.types.IDatabaseType;
+import eu.etaxonomy.cdm.config.ICdmPersistentSource;
 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
 
 /**
@@ -44,22 +37,22 @@ import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
  */
 public class CdmPersistentRemoteSource extends CdmRemoteSourceBase implements ICdmPersistentSource{
        private static final Logger logger = Logger.getLogger(CdmPersistentRemoteSource.class);
-       
+
        public static final String REMOTESOURCE_BEAN_POSTFIX = "RemoteSource";
        private String beanName;
        private Properties cdmSourceProperties;
        private List<Attribute> cdmSourceAttributes;
-       
+
        /**
         * Creates a new instance of CdmPersistentRemoteSource
-        * 
+        *
         * @param name
         * @param server
         * @param port
         * @param contextPath
         * @param nomenclaturalCode
         * @return
-        * @throws CdmRemoteSourceException 
+        * @throws CdmRemoteSourceException
         */
        public static CdmPersistentRemoteSource NewInstance(String remoteSource) throws CdmRemoteSourceException {
                if(exists(remoteSource)) {
@@ -67,49 +60,48 @@ public class CdmPersistentRemoteSource extends CdmRemoteSourceBase implements IC
                } else {
                        throw new CdmRemoteSourceException("Remote source '" + remoteSource + "' does not exist in sources setting file");
                }
-               
+
        }
-       
+
        /**S
         * Creates a new CdmPersistentRemoteSource
-        * 
+        *
         * @param name
         * @param server
         * @param port
         * @param contextPath
         * @param nomenclaturalCode
-        * @throws CdmRemoteSourceException 
+        * @throws CdmRemoteSourceException
         */
-       private CdmPersistentRemoteSource(String remoteSource) throws CdmRemoteSourceException { 
-               
+       private CdmPersistentRemoteSource(String remoteSource) throws CdmRemoteSourceException {
+
                CdmPersistentXMLSource cdmPersistentXMLSource = CdmPersistentXMLSource.NewInstance(remoteSource, REMOTESOURCE_BEAN_POSTFIX);
                if(cdmPersistentXMLSource.getElement() != null) {
                        beanName = cdmPersistentXMLSource.getBeanName();
-                       // properties from the persistent xml file 
+                       // properties from the persistent xml file
                        cdmSourceProperties = cdmPersistentXMLSource.getCdmSourceProperties();
                        cdmSourceAttributes = cdmPersistentXMLSource.getCdmSourceAttributes();
                        checkProperties(cdmSourceProperties);
                } else {
                        throw new CdmRemoteSourceException("Remote source '" + remoteSource + "' does not exist in settings file");
-               }               
-               initDatabaseConnection();
+               }
        }
-       
+
        private static void checkProperties(Properties cdmSourceProperties) throws CdmRemoteSourceException {
                if(!cdmSourceProperties.containsKey(CdmSourceProperties.SERVER.toString())) {
-                       throw new CdmRemoteSourceException("Could not initialise remote source. Required property '" + CdmSourceProperties.SERVER.toString() + "' is missing");                 
+                       throw new CdmRemoteSourceException("Could not initialise remote source. Required property '" + CdmSourceProperties.SERVER.toString() + "' is missing");
                }
                String port = (String)cdmSourceProperties.get(CdmSourceProperties.PORT.toString());
                if(port == null || port.isEmpty()) {
-                       throw new CdmRemoteSourceException("Could not initialise remote source. Required property '" + CdmSourceProperties.SERVER.toString() + "' is missing");                 
-               }       
+                       throw new CdmRemoteSourceException("Could not initialise remote source. Required property '" + CdmSourceProperties.SERVER.toString() + "' is missing");
+               }
                if(!cdmSourceProperties.containsKey(CdmSourceProperties.CONTEXTPATH.toString())) {
-                       throw new CdmRemoteSourceException("Could not initialise remote source. Required property '" + CdmSourceProperties.SERVER.toString() + "' is missing");                 
-               }       
+                       throw new CdmRemoteSourceException("Could not initialise remote source. Required property '" + CdmSourceProperties.SERVER.toString() + "' is missing");
+               }
                // default NomenclaturalCode is always ICNAFP
-               if(!cdmSourceProperties.containsKey(CdmSourceProperties.NOMENCLATURAL_CODE.toString())) {                               
+               if(!cdmSourceProperties.containsKey(CdmSourceProperties.NOMENCLATURAL_CODE.toString())) {
                        cdmSourceProperties.put(CdmSourceProperties.NOMENCLATURAL_CODE.toString(), NomenclaturalCode.ICNAFP.name());
-               }                       
+               }
        }
 
        /* (non-Javadoc)
@@ -119,12 +111,12 @@ public class CdmPersistentRemoteSource extends CdmRemoteSourceBase implements IC
        public String getBeanName() {
                return beanName;
        }
-       
+
        @Override
        public String getServer() {
                return cdmSourceProperties.getProperty(CdmSourceProperties.SERVER.toString());
        }
-       
+
        @Override
        public int getPort() {
                String port = CdmUtils.Nz(cdmSourceProperties.getProperty(CdmSourceProperties.PORT.toString()));
@@ -135,17 +127,17 @@ public class CdmPersistentRemoteSource extends CdmRemoteSourceBase implements IC
                        return Integer.valueOf(port);
                }
        }
-       
+
        @Override
        public String getContextPath() {
                return cdmSourceProperties.getProperty(CdmSourceProperties.CONTEXTPATH.toString());
        }
-       
+
        @Override
        public NomenclaturalCode getNomenclaturalCode() {
                return NomenclaturalCode.fromString(cdmSourceProperties.getProperty(CdmSourceProperties.NOMENCLATURAL_CODE.toString()));
        }
-       
+
        public static CdmPersistentRemoteSource save(String strRemoteSourceName, ICdmRemoteSource remoteSource) throws CdmRemoteSourceException {
                Properties cdmSourceProperties = new Properties();
                cdmSourceProperties.put(CdmSourceProperties.SERVER.toString(), remoteSource.getServer());
@@ -155,7 +147,7 @@ public class CdmPersistentRemoteSource extends CdmRemoteSourceBase implements IC
                checkProperties(cdmSourceProperties);
                return save(strRemoteSourceName, cdmSourceProperties);
        }
-       
+
        private static CdmPersistentRemoteSource save(String strRemoteSourceName,Properties cdmSourceProperties) throws CdmRemoteSourceException {
 
                //root
@@ -180,19 +172,19 @@ public class CdmPersistentRemoteSource extends CdmRemoteSourceBase implements IC
                }
 
                //save
-               saveToXml(root.getDocument(), 
-                               CdmPersistentSourceUtils.getResourceDirectory(), 
-                               CdmPersistentXMLSource.CDMSOURCE_FILE_NAME, 
+               saveToXml(root.getDocument(),
+                               CdmPersistentSourceUtils.getResourceDirectory(),
+                               CdmPersistentXMLSource.CDMSOURCE_FILE_NAME,
                                XmlHelp.prettyFormat );
 
                return NewInstance(strRemoteSourceName) ;
 
        }
-       
+
        /**
         * @param strDataSourceName
         * @param dataSource
-        * @param code 
+        * @param code
         * @return
         *                      the updated dataSource, null if not succesful
         */
@@ -201,7 +193,7 @@ public class CdmPersistentRemoteSource extends CdmRemoteSourceBase implements IC
                CdmPersistentSourceUtils.delete(CdmPersistentSourceUtils.getBeanName(strRemoteSourceName,REMOTESOURCE_BEAN_POSTFIX));
                return save(strRemoteSourceName, remoteSource);
        }
-       
+
        /**
         * Tests existing of the datsource in the according config  file.
         * @return true if a datasource with the given name exists in the according datasource config file.
@@ -210,22 +202,22 @@ public class CdmPersistentRemoteSource extends CdmRemoteSourceBase implements IC
                Element bean = CdmPersistentSourceUtils.getCdmSourceBeanXml(strRemoteSourceName, REMOTESOURCE_BEAN_POSTFIX);
                return (bean != null);
        }
-       
+
        /**
         * Returns a list of all datasources stored in the datasource config file
         * @return all existing data sources
-        * @throws CdmRemoteSourceException 
+        * @throws CdmRemoteSourceException
         */
        @SuppressWarnings("unchecked")
        static public List<CdmPersistentRemoteSource> getAllRemoteSources() throws CdmRemoteSourceException{
                List<CdmPersistentRemoteSource> remoteSources = new ArrayList<CdmPersistentRemoteSource>();
-               
+
                Element root = getBeansRoot(CdmPersistentSourceUtils.getCdmSourceInputStream());
                if (root == null){
                        return null;
                }else{
                List<Element> lsChildren  = root.getChildren("bean", root.getNamespace());
-               
+
                for (Element elBean : lsChildren){
                        String strId = elBean.getAttributeValue("id");
                        if (strId != null && strId.endsWith(REMOTESOURCE_BEAN_POSTFIX)){
@@ -236,7 +228,7 @@ public class CdmPersistentRemoteSource extends CdmRemoteSourceBase implements IC
                }
                return remoteSources;
        }
-       
+
        @Override
        public String toString(){
                if (getName() != null){
similarity index 96%
rename from eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/remote/CdmRemoteSource.java
rename to eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmRemoteSource.java
index 9dbb34b3abf2d0cad71d8a22736c473603d8e9e2..473cdca0f4d50494ecaf501320df57c353492de8 100644 (file)
@@ -6,7 +6,7 @@
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-package eu.etaxonomy.cdm.remote;
+package eu.etaxonomy.taxeditor.remoting.source;
 
 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
 
similarity index 65%
rename from eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/remote/CdmRemoteSourceBase.java
rename to eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmRemoteSourceBase.java
index d24baa6ee8717126a7696dcb04f4c10a7f1ad271..59c24ea3b2f5497c692570e00582113aee6584b0 100644 (file)
@@ -1,26 +1,24 @@
 /**
 * Copyright (C) 2014 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-package eu.etaxonomy.cdm.remote;
+package eu.etaxonomy.taxeditor.remoting.source;
 
 import java.util.Map;
 
-import org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean;
-
-import eu.etaxonomy.cdm.api.service.IDatabaseService;
+import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteConfiguration;
+import eu.etaxonomy.cdm.api.service.IMetadataService;
 import eu.etaxonomy.cdm.config.CdmSource;
 import eu.etaxonomy.cdm.config.CdmSourceException;
-import eu.etaxonomy.cdm.database.DatabaseTypeEnum;
 import eu.etaxonomy.cdm.model.metadata.CdmMetaData.MetaDataPropertyName;
 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
 
 /**
- * Base class representing a CDM remote source. 
+ * Base class representing a CDM remote source.
  * This class handles all the configuration relating to the remoting aspect of
  * a CDM source.
  *
@@ -34,12 +32,12 @@ public class CdmRemoteSourceBase extends CdmSource implements ICdmRemoteSource {
        protected static final NomenclaturalCode DEFAULT_NOMENCLATURAL_CODE = NomenclaturalCode.ICNAFP;
        private String contextPath;
        private String baseUrl;
-       
-       private IDatabaseService databaseService;
-       
+
+       private IMetadataService metadataService;
+
        /**
         * Constructs a CdmRemoteSourceBase object with default values.
-        * 
+        *
         */
        protected CdmRemoteSourceBase() {
                setName(DEFAULT_NAME);
@@ -48,42 +46,26 @@ public class CdmRemoteSourceBase extends CdmSource implements ICdmRemoteSource {
                setContextPath(DEFAULT_CONTEXT_PATH);
                setNomenclaturalCode(DEFAULT_NOMENCLATURAL_CODE);
        }
-       
+
        /**
         * Constructs a CdmRemoteSourceBase
-        * 
+        *
         * @param name
         * @param server
         * @param port
         * @param contextPath
         * @param nomenclaturalCode
         */
-       protected CdmRemoteSourceBase(String name, String server, int port, String contextPath, NomenclaturalCode nomenclaturalCode) {
+       public CdmRemoteSourceBase(String name, String server, int port, String contextPath, NomenclaturalCode nomenclaturalCode) {
                setName(name);
                setServer(server);
                setPort(port);
                setContextPath(contextPath);
-               setNomenclaturalCode(nomenclaturalCode);                        
-               initDatabaseConnection();
+               setNomenclaturalCode(nomenclaturalCode);
+               metadataService = CdmApplicationRemoteConfiguration.getMetadataService(this);
        }
-       
-       protected void initDatabaseConnection() {
-               if(getContextPath() == null || getContextPath().equals("")) {
-                       setBaseUrl("http://" + getServer() + ":" + String.valueOf(getPort()));
-               } else {
-                       setBaseUrl("http://" + getServer()  + ":" + String.valueOf(getPort()) + "/" + getContextPath());
-               }       
-               // the database service needs to be initialised (before the spring
-               // application context initialsation) since it is required to 
-               // to make queries related to the source database
-           HttpInvokerProxyFactoryBean proxy = new HttpInvokerProxyFactoryBean();
-           proxy.setServiceInterface(IDatabaseService.class);
-           proxy.setServiceUrl(baseUrl + "/remoting/database.service");
-           proxy.afterPropertiesSet();
-           databaseService = (IDatabaseService) proxy.getObject();
 
-       }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.cdm.remote.ICdmRemoteSource#getBaseUrl()
         */
@@ -93,11 +75,11 @@ public class CdmRemoteSourceBase extends CdmSource implements ICdmRemoteSource {
        }
 
        /**
-        * Sets the base url for the http-invoker services as listed in 
+        * Sets the base url for the http-invoker services as listed in
         * httpInvokerServicesClients.xml.
-        * e.g. for 'http://127.0.0.1:8080/col/remoting/common.service', the 
+        * e.g. for 'http://127.0.0.1:8080/col/remoting/common.service', the
         * base url would be 'http://127.0.0.1:8080/col'
-        * 
+        *
         * @param baseUrl
         */
        public void setBaseUrl(String baseUrl) {
@@ -114,9 +96,9 @@ public class CdmRemoteSourceBase extends CdmSource implements ICdmRemoteSource {
 
        /**
         * Sets the context path.
-        * e.g. for 'http://127.0.0.1:8080/col/remoting/common.service', the 
+        * e.g. for 'http://127.0.0.1:8080/col/remoting/common.service', the
         * context path would be 'col'
-        * 
+        *
         * @param contextPath
         */
        public void setContextPath(String contextPath) {
@@ -128,7 +110,7 @@ public class CdmRemoteSourceBase extends CdmSource implements ICdmRemoteSource {
         */
        @Override
        public String getDbSchemaVersion() throws CdmSourceException {
-               return databaseService.getDbSchemaVersion();
+               return metadataService.getDbSchemaVersion();
 
        }
 
@@ -137,7 +119,7 @@ public class CdmRemoteSourceBase extends CdmSource implements ICdmRemoteSource {
         */
        @Override
        public boolean isDbEmpty() throws CdmSourceException {
-               return databaseService.isDbEmpty();
+               return metadataService.isDbEmpty();
 
        }
 
@@ -146,12 +128,12 @@ public class CdmRemoteSourceBase extends CdmSource implements ICdmRemoteSource {
         */
        @Override
        public boolean checkConnection() throws CdmSourceException {
-               // assuming that database service works implies 
+               // assuming that database service works implies
                // the connection is up
-               // if no exception is thrown then we assume that the 
+               // if no exception is thrown then we assume that the
                // connection is up
                // FIXME:Remoting is this really correct?
-               databaseService.getDbSchemaVersion();
+               metadataService.getDbSchemaVersion();
 
                return true;
        }
@@ -161,13 +143,13 @@ public class CdmRemoteSourceBase extends CdmSource implements ICdmRemoteSource {
         */
        @Override
        public String getConnectionMessage() {
-               return "Conncting to Remote CDM Server " + getName();
+               return "Connecting to Remote CDM Instance " + getName() + ":" + getPort() + "/" + getContextPath();
        }
 
-               
+
        @Override
        public Map<MetaDataPropertyName, String> getMetaDataMap() throws CdmSourceException {
-               return databaseService.getCdmMetadataMap();
+               return metadataService.getCdmMetadataMap();
        }
 
 
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmServerInfo.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmServerInfo.java
new file mode 100644 (file)
index 0000000..28e6446
--- /dev/null
@@ -0,0 +1,522 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.remoting.source;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.Socket;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.ResponseHandler;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.params.HttpConnectionParams;
+import org.apache.http.params.HttpParams;
+import org.apache.http.util.EntityUtils;
+import org.apache.log4j.Logger;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.common.CdmUtils;
+import eu.etaxonomy.cdm.config.CdmSourceException;
+import eu.etaxonomy.cdm.database.CdmPersistentDataSource;
+import eu.etaxonomy.cdm.database.ICdmDataSource;
+import eu.etaxonomy.cdm.model.metadata.CdmMetaData;
+import eu.etaxonomy.taxeditor.remoting.server.CDMServerException;
+import eu.etaxonomy.taxeditor.remoting.server.CDMServerUtils;
+
+/**
+ * @author cmathew
+ * @date 20 Jan 2015
+ *
+ */
+public class CdmServerInfo {
+    public static final Logger logger = Logger.getLogger(CdmServerInfo.class);
+
+    private final static String CDMSERVER_PREFIX = "cdmserver/";
+    private final static String NAME_PRODUCTION = "cybertaxonomy.org";
+    private final static String SERVER_PRODUCTION = "api.cybertaxonomy.org";
+
+    private final static String NAME_INTEGRATION = "edit-integration";
+    private final static String SERVER_INTEGRATION = "int.e-taxonomy.eu";
+
+    private final static String NAME_DEMO_1 = "edit-WS I";
+    private final static String SERVER_DEMO_1 = "160.45.63.230";
+
+    private final static String NAME_DEMO_2 = "edit-WS II";
+    private final static String SERVER_DEMO_2 = "160.45.63.231";
+
+    private final static String NAME_TEST = "edit-test";
+    private final static String SERVER_TEST = "test.e-taxonomy.eu";
+
+    public final static String SERVER_LOCALHOST = "localhost";
+    private final static String NAME_LOCALHOST = "localhost";
+    public final static String NAME_LOCALHOST_MGD = "localhost mgd.";
+
+    private final static String NAME_LOCALHOST_DEV = "localhost-dev";
+    private final static String NAME_INSTANCE_LOCALHOST_DEV = "local-dev";
+    private final static String SERVER_LOCALHOST_DEV = "localhost";
+    private final static int PORT_LOCALHOST_DEV = 8080;
+    private final static String BASEPATH_LOCALHOST_DEV = "";
+
+    public final static int NULL_PORT = -1;
+    public final static String NULL_PORT_STRING = "N/A";
+
+    private static final String CDM_REMOTE_SERVERS_CONFIG_FILE = "cdm_remote_servers.json";
+
+
+    private final String name;
+    private final String server;
+    private int port;
+    private final List<CdmInstanceInfo> instances;
+
+    private String cdmlibServicesVersion = "";
+    private String cdmlibServicesLastModified = "";
+
+    private String prefix = "";
+
+    private boolean ignoreCdmLibVersion = false;
+
+
+    public CdmServerInfo(CdmServerInfoConfig parameterObject) {
+        this.name = parameterObject.getName();
+        this.server = parameterObject.getServer();
+        this.port = parameterObject.getPort();
+        this.prefix = parameterObject.getPrefix();
+        this.ignoreCdmLibVersion = parameterObject.isIgnoreCdmLibVersion();
+        instances = new ArrayList<CdmInstanceInfo>();
+    }
+
+
+    public CdmInstanceInfo addInstance(String name, String basePath) {
+        String _basePath = basePath;
+        if(isLocalhostMgd()) {
+            _basePath = "";
+        }
+        CdmInstanceInfo cii = new CdmInstanceInfo(name, _basePath);
+        instances.add(cii);
+        return cii;
+
+    }
+
+    public boolean isLocalhost() {
+        return name.startsWith(SERVER_LOCALHOST);
+    }
+
+    public boolean isLocalhostMgd() {
+        return NAME_LOCALHOST_MGD.equals(name);
+    }
+
+    public String getCdmlibServicesVersion() {
+        return cdmlibServicesVersion;
+    }
+
+    public String getCdmlibLastModified() {
+        return cdmlibServicesLastModified;
+    }
+
+    public void refreshInstances() throws CDMServerException {
+        instances.clear();
+        if(isLocalhostMgd()) {
+            addInstancesFromDataSourcesConfig();
+        } else {
+            addInstancesViaHttp();
+        }
+        Collections.sort(instances, new Comparator<CdmInstanceInfo>() {
+            @Override
+            public int compare(CdmInstanceInfo cii1, CdmInstanceInfo cii2)
+            {
+                return cii1.getName().toString().compareTo(cii2.getName().toString());
+            }
+        });
+    }
+
+    public void updateInfo() throws CDMServerException {
+        String url = "http://" + server + ":" + String.valueOf(port) + "/" + prefix + "info.jsp";
+        String responseBody = getResponse(url);
+        if(responseBody != null) {
+            try {
+                JSONObject info = new JSONObject(responseBody);
+                cdmlibServicesVersion =  info.getString("cdmlibServicesVersion");
+                cdmlibServicesLastModified = info.getString("cdmlibServicesLastModified");
+            } catch (JSONException e) {
+                throw new CDMServerException(e);
+            }
+        }
+    }
+
+    public void addInstancesViaHttp() throws CDMServerException {
+        updateInfo();
+        String url = "http://" + server + ":" + String.valueOf(port) + "/" + prefix + "instances.jsp";
+        String responseBody = getResponse(url);
+        if(responseBody != null) {
+            try {
+                JSONArray array = new JSONArray(responseBody);
+                for(int i=0;i<array.length();i++) {
+                    JSONObject instance = (JSONObject)array.get(i);
+                    if(instance != null) {
+                        JSONObject conf = (JSONObject)instance.get("configuration");
+                        if(conf != null) {
+                            String instanceName = conf.getString("instanceName");
+                            // we need to remove the first (char) forward slash from
+                            // the base path
+                            String basePath = conf.getString("basePath").substring(1);
+                            addInstance(instanceName, basePath);
+                            logger.info("Added instance with name : " + instanceName + ", basePath : " + basePath);
+                        }
+                    }
+                }
+            } catch (JSONException e) {
+                throw new CDMServerException(e);
+            }
+        }
+    }
+
+    private String getResponse(String url) throws CDMServerException {
+        HttpClient client = new DefaultHttpClient();
+        HttpParams params = client.getParams();
+
+        HttpConnectionParams.setConnectionTimeout(params, 5000);
+        HttpConnectionParams.setSoTimeout(params, 5000);
+
+        HttpGet httpGet = new HttpGet(url);
+
+        logger.info("Executing request " + httpGet.getRequestLine());
+
+        // Create a custom response handler
+        ResponseHandler<String> responseHandler = new ResponseHandler<String>() {
+
+            @Override
+            public String handleResponse(
+                    final HttpResponse response) throws ClientProtocolException, IOException {
+                int status = response.getStatusLine().getStatusCode();
+                if (status >= 200 && status < 300) {
+                    HttpEntity entity = response.getEntity();
+                    return entity != null ? EntityUtils.toString(entity) : null;
+                } else {
+                    throw new ClientProtocolException("Unexpected response status: " + status);
+                }
+            }
+
+        };
+        String responseBody = null;
+        try {
+            responseBody = client.execute(httpGet, responseHandler);
+        } catch (ClientProtocolException e) {
+            throw new CDMServerException(e);
+        } catch (IOException e) {
+            throw new CDMServerException(e);
+        }
+        return responseBody;
+    }
+
+    public void addInstancesFromDataSourcesConfig() {
+        for(ICdmDataSource dataSource : CdmPersistentDataSource.getAllDataSources()){
+            String datasourceNCName = CDMServerUtils.xmlNCNamefrom(dataSource.getName());
+            logger.info("Adding local instance " + dataSource.getName() + " as " + datasourceNCName);
+            addInstance(datasourceNCName, datasourceNCName);
+        }
+    }
+
+    public String toString(String instanceName, int port) {
+        return server + ":" + String.valueOf(port) + "/" + instanceName;
+    }
+
+    public CdmInstanceInfo getInstanceFromName(String instanceName) {
+        if(instanceName == null) {
+            return null;
+        }
+
+        for(CdmInstanceInfo instance : instances) {
+            if(instance.getName() != null && instance.getName().equals(instanceName)) {
+                return instance;
+            }
+        }
+        return null;
+    }
+
+    public CdmRemoteSource getCdmRemoteSource(CdmInstanceInfo instance, int port) {
+        if(instance != null) {
+            return CdmRemoteSource.NewInstance(name,
+                    server,
+                    port,
+                    instance.getBasePath(),
+                    null);
+        }
+        return null;
+    }
+
+    public boolean pingServer() {
+        if(isLocalhostMgd()) {
+            return true;
+        }
+        try {
+            Socket s = new Socket(server, port);
+            logger.info("[CDM-Server] Available @ " + server + ":" + port );
+            updateInfo();
+            return true;
+        } catch (IOException ioe) {
+
+        } catch (CDMServerException e) {
+
+        }
+        return false;
+    }
+
+    public boolean pingInstance(CdmInstanceInfo instance, int port) throws CDMServerException  {
+
+        ICdmRemoteSource crs = getCdmRemoteSource(instance, port);
+        try {
+            if(crs != null && crs.checkConnection()) {
+                logger.info("[CDM-Server] Running @ " + server + ":" + port + " for instance " + instance);
+                return true;
+            }
+        } catch (CdmSourceException e) {
+            throw new CDMServerException(e);
+        }
+
+        return false;
+    }
+
+    public int compareDbSchemaVersion(CdmInstanceInfo instance, int port) throws CDMServerException {
+
+        ICdmRemoteSource crs = getCdmRemoteSource(instance, port);
+        String dbSchemaVersion;
+        try {
+            dbSchemaVersion = crs.getDbSchemaVersion();
+        } catch (CdmSourceException e) {
+            throw new CDMServerException(e);
+        }
+
+
+        if(dbSchemaVersion != null) {
+            return CdmMetaData.compareVersion(dbSchemaVersion, CdmMetaData.getDbSchemaVersion(), 3, null);
+        } else {
+            throw new CDMServerException("Cannot determine editor db. schema version");
+        }
+    }
+
+    public int compareCdmlibServicesVersion() throws CdmSourceException {
+
+        String serverVersion = cdmlibServicesVersion;
+        String serverCdmlibLastModified = cdmlibServicesLastModified;
+        if(ignoreCdmLibVersion) {
+            return 0;
+        } else {
+            return compareCdmlibServicesVersion(serverVersion, serverCdmlibLastModified);
+        }
+    }
+
+
+    /**
+     * @param serverVersion
+     * @param editorVersion
+     * @throws CdmSourceException
+     */
+    public static int compareCdmlibServicesVersion(String serverVersion, String serverCdmlibLastModified) throws CdmSourceException {
+
+        String editorVersion = CdmApplicationState.getCdmlibVersion();
+        String editorCdmlibLastModified = CdmApplicationState.getCdmlibLastModified();
+
+        int result = 0;
+        if(StringUtils.isBlank(serverVersion) || StringUtils.isBlank(editorVersion)) {
+            throw new CdmSourceException("cdmlib-services server or editor version is empty");
+        }
+
+        String[] serverVersionSplit = serverVersion.split("\\.");
+        String[] editorVersionSplit = editorVersion.split("\\.");
+
+        if(serverVersionSplit.length < 3 || editorVersionSplit.length < 3 || serverVersionSplit.length > 4 || editorVersionSplit.length > 4) {
+            throw new CdmSourceException("cdmlib-services server or editor version is invalid");
+        }
+
+        Integer serverVersionPart;
+        Integer editorVersionPart;
+
+        for(int i=0 ; i<3 ; i++) {
+            serverVersionPart = Integer.valueOf(serverVersionSplit[i]);
+            editorVersionPart = Integer.valueOf(editorVersionSplit[i]);
+
+            int partCompare = serverVersionPart.compareTo(editorVersionPart);
+            if (partCompare != 0){
+                return partCompare;
+            }
+        }
+        // at this point major, minor and patch versions are matching
+
+        if(StringUtils.isBlank(serverCdmlibLastModified) || StringUtils.isBlank(editorCdmlibLastModified)) {
+            throw new CdmSourceException("cdmlib-services server or editor version is empty");
+        }
+
+        String cdmServerIgnoreVersion = System.getProperty("cdm.server.version.lm.ignore");
+        if(StringUtils.isBlank(cdmServerIgnoreVersion) || !cdmServerIgnoreVersion.equals("true")) {
+            Long serverLastModified = Long.valueOf(serverCdmlibLastModified);
+            Long editorLastModified = Long.valueOf(editorCdmlibLastModified);
+            return serverLastModified.compareTo(editorLastModified);
+        }
+
+        return 0;
+    }
+
+
+
+    public static List<CdmServerInfo> getCdmServers() {
+        List<CdmServerInfoConfig> configList = loadFromConfigFile(new File(CdmUtils.perUserCdmFolder, CDM_REMOTE_SERVERS_CONFIG_FILE));
+        List<CdmServerInfo> serverInfoList = new ArrayList<CdmServerInfo>(configList.size());
+        for(CdmServerInfoConfig config : configList) {
+            serverInfoList.add(new CdmServerInfo(config));
+        }
+        // The local host managed server must not be in the config file
+        CdmServerInfoConfig localHostManagedConfig = new CdmServerInfoConfig(NAME_LOCALHOST_MGD, SERVER_LOCALHOST, NULL_PORT, CDMSERVER_PREFIX, false);
+        serverInfoList.add(new CdmServerInfo(localHostManagedConfig));
+        return serverInfoList;
+    }
+
+
+    /**
+     * @param file
+     * @throws IOException
+     * @throws FileNotFoundException
+     * @throws JsonMappingException
+     * @throws JsonParseException
+     */
+    private static List<CdmServerInfoConfig>  loadFromConfigFile(File file) {
+
+        List<CdmServerInfoConfig> serverList = null;
+
+        ObjectMapper mapper = new ObjectMapper();
+
+        if(!file.exists()) {
+            logger.info("The remote server config file '" + file.getAbsolutePath() +
+                    "' does not yet exist, it will be created based on the defaults.");
+             try {
+                serverList = createDefaultServerConfigList();
+                mapper.writerWithDefaultPrettyPrinter().writeValue(new FileOutputStream(file), serverList);
+
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        } else {
+            try {
+                serverList = mapper.readValue(new FileInputStream(file), new TypeReference<List<CdmServerInfoConfig>>(){});
+            } catch (IOException e) {
+               throw new RuntimeException(e);
+            }
+        }
+
+        return serverList;
+
+
+    }
+
+
+    /**
+     *
+     */
+    private static List<CdmServerInfoConfig> createDefaultServerConfigList() {
+
+        List<CdmServerInfoConfig> serverInfoList = new ArrayList<CdmServerInfoConfig>();
+       // serverInfoList.add(new CdmServerInfoConfig(NAME_PRODUCTION, SERVER_PRODUCTION, 80, ""));
+       //serverInfoList.add(new CdmServerInfoConfig(NAME_INTEGRATION, SERVER_INTEGRATION, 80, CDMSERVER_PREFIX));
+        serverInfoList.add(new CdmServerInfoConfig(NAME_DEMO_1, SERVER_DEMO_1, 80, CDMSERVER_PREFIX, false));
+       // serverInfoList.add(new CdmServerInfoConfig(NAME_DEMO_2, SERVER_DEMO_2, 80, CDMSERVER_PREFIX));
+        serverInfoList.add(new CdmServerInfoConfig(NAME_TEST, SERVER_TEST, 80, CDMSERVER_PREFIX, false));
+        serverInfoList.add(new CdmServerInfoConfig(NAME_LOCALHOST, SERVER_LOCALHOST, 8080, CDMSERVER_PREFIX, true));
+        return serverInfoList;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getServer() {
+        return server;
+    }
+
+
+    public int getPort() {
+        return port;
+    }
+
+    public void setPort(int port) {
+        this.port = port;
+    }
+
+    public List<CdmInstanceInfo> getInstances() throws CDMServerException {
+        if(instances.isEmpty()) {
+            refreshInstances();
+        }
+        return instances;
+    }
+
+    public static CdmRemoteSource getDevServerRemoteSource() {
+        String value = System.getProperty("cdm.server.dev.port");
+        boolean available = false;
+        CdmInstanceInfo devInstance = null;
+        if(value != null && !value.isEmpty()) {
+            int devPort = Integer.valueOf(value);
+            CdmServerInfo devCii = new CdmServerInfo(new CdmServerInfoConfig(NAME_LOCALHOST_DEV, SERVER_LOCALHOST_DEV, devPort, "", false));
+            try {
+                devInstance = devCii.addInstance(NAME_INSTANCE_LOCALHOST_DEV, BASEPATH_LOCALHOST_DEV);
+                available = devCii.pingInstance(devInstance, devPort);
+                if(available) {
+                    return devCii.getCdmRemoteSource(devInstance, devPort);
+                }
+            } catch (Exception e) {
+
+            }
+        }
+        return null;
+    }
+
+    public class CdmInstanceInfo {
+        private final String name;
+
+        /**
+         * The full path of the instance including the the prefix (if any).
+         * E.g. for an EDIT instance this would be something like "cdmserver/remoting"
+         * For a managed local server this would simply be ""
+         */
+        private final String basePath;
+
+
+        public CdmInstanceInfo(String name, String basePath) {
+            this.name = name;
+            this.basePath = basePath;
+        }
+
+
+        public String getName() {
+            return name;
+        }
+
+        public String getBasePath() {
+            return basePath;
+        }
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmServerInfoConfig.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmServerInfoConfig.java
new file mode 100644 (file)
index 0000000..be17270
--- /dev/null
@@ -0,0 +1,122 @@
+// $Id$
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.remoting.source;
+
+/**
+ * @author  a.kohlbecker
+ * @date  Feb 10, 2016
+ */
+public class CdmServerInfoConfig {
+    /**
+     *
+     */
+    private String name;
+    /**
+     *
+     */
+    private String server;
+    /**
+     *
+     */
+    private int port;
+    /**
+     *
+     */
+    private String prefix;
+    /**
+     *
+     */
+    private boolean ignoreCdmLibVersion;
+
+    /**
+     *
+     */
+    public CdmServerInfoConfig(String name, String server, int port, String prefix, boolean ignoreCdmLibVersion) {
+        this.name = name;
+        this.server = server;
+        this.port = port;
+        this.prefix = prefix;
+        this.ignoreCdmLibVersion = ignoreCdmLibVersion;
+    }
+
+    public CdmServerInfoConfig() {
+
+    }
+
+    /**
+     * @return the name
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * @param name the name to set
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * @return the server
+     */
+    public String getServer() {
+        return server;
+    }
+
+    /**
+     * @param server the server to set
+     */
+    public void setServer(String server) {
+        this.server = server;
+    }
+
+    /**
+     * @return the port
+     */
+    public int getPort() {
+        return port;
+    }
+
+    /**
+     * @param port the port to set
+     */
+    public void setPort(int port) {
+        this.port = port;
+    }
+
+    /**
+     * @return the prefix
+     */
+    public String getPrefix() {
+        return prefix;
+    }
+
+    /**
+     * @param prefix the prefix to set
+     */
+    public void setPrefix(String prefix) {
+        this.prefix = prefix;
+    }
+
+    /**
+     * @return the ignoreCdmLibVersion
+     */
+    public boolean isIgnoreCdmLibVersion() {
+        return ignoreCdmLibVersion;
+    }
+
+    /**
+     * @param ignoreCdmLibVersion the ignoreCdmLibVersion to set
+     */
+    public void setIgnoreCdmLibVersion(boolean ignoreCdmLibVersion) {
+        this.ignoreCdmLibVersion = ignoreCdmLibVersion;
+    }
+}
\ No newline at end of file
similarity index 94%
rename from eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/remote/ICdmRemoteSource.java
rename to eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/ICdmRemoteSource.java
index f278c74689aa3cbe8a0ee2de252e7940d62de8db..39e8886e43b31e6c881b8016a1baeba76d6f4519 100644 (file)
@@ -6,7 +6,7 @@
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-package eu.etaxonomy.cdm.remote;
+package eu.etaxonomy.taxeditor.remoting.source;
 
 import eu.etaxonomy.cdm.config.ICdmSource;
 
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CachedCommonServiceImpl.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CachedCommonServiceImpl.java
new file mode 100644 (file)
index 0000000..72f6294
--- /dev/null
@@ -0,0 +1,125 @@
+// $Id$
+/**
+* Copyright (C) 2014 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.service;
+
+import java.util.List;
+import java.util.UUID;
+
+import org.springframework.stereotype.Component;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+
+/**
+ * @author cmathew
+ * @date 14 Oct 2014
+ *
+ */
+@Component
+public class CachedCommonServiceImpl implements ICachedCommonService {
+
+
+    private static boolean cacheEnabled = true;
+
+    public static boolean isCacheEnabled() {
+        return cacheEnabled;
+    }
+
+    public static void setCacheEnabled(boolean cacheEnabled) {
+        CachedCommonServiceImpl.cacheEnabled = cacheEnabled;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.remoting.service.ICachedCommonService#find(java.lang.Class, int)
+     */
+    @Override
+    public CdmBase find(Class<? extends CdmBase> clazz, int id) {
+        CdmBase cdmEntity = CdmApplicationState.getCurrentAppConfig().getCommonService().find(clazz, id, getPropertyPaths(clazz));
+        if(cdmEntity == null) {
+            throw new NullPointerException("CDM Entity of type " + clazz.getName() + " with id " + id  + " is null.");
+        }
+        return cdmEntity;
+
+    }
+
+
+    private List<String> getPropertyPaths(Object obj) {
+        List<String> propertyPaths = null;
+        ICdmEntitySession cdmEntitySession =
+                ((CdmApplicationRemoteController)CdmApplicationState.getCurrentAppConfig()).getCdmEntitySessionManager().getActiveSession();
+        if(cdmEntitySession != null) {
+            propertyPaths = cdmEntitySession.getPropertyPaths(obj);
+        }
+        return propertyPaths;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.service.ICachedCommonService#initializeCollection(java.util.UUID, java.lang.String)
+     */
+    @Override
+    public Object initializeCollection(UUID ownerUuid, String fieldName) {
+        return  CdmApplicationState.getCurrentAppConfig().getCommonService().initializeCollection(ownerUuid, fieldName, getPropertyPaths(fieldName));
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.remoting.service.ICachedCommonService#isEmpty(org.hibernate.collection.spi.PersistentCollection)
+     */
+    @Override
+    public boolean isEmpty(UUID ownerUuid, String fieldName) {
+            return  CdmApplicationState.getCurrentAppConfig().getCommonService().isEmpty(ownerUuid, fieldName);
+
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.remoting.service.ICachedCommonService#size(org.hibernate.collection.spi.PersistentCollection)
+     */
+    @Override
+    public int size(UUID ownerUuid, String fieldName) {
+        return  CdmApplicationState.getCurrentAppConfig().getCommonService().size(ownerUuid, fieldName);
+    }
+
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.remoting.service.ICachedCommonService#contains(org.hibernate.collection.spi.PersistentCollection, java.lang.Object)
+     */
+    @Override
+    public boolean contains(UUID ownerUuid, String fieldName, Object element) {
+        return  CdmApplicationState.getCurrentAppConfig().getCommonService().contains(ownerUuid, fieldName, element);
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.remoting.service.ICachedCommonService#containsKey(org.hibernate.collection.spi.PersistentCollection, java.lang.Object)
+     */
+    @Override
+    public boolean containsKey(UUID ownerUuid, String fieldName, Object key) {
+        return  CdmApplicationState.getCurrentAppConfig().getCommonService().containsKey(ownerUuid, fieldName, key);
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.remoting.service.ICachedCommonService#containsValue(org.hibernate.collection.spi.PersistentCollection, java.lang.Object)
+     */
+    @Override
+    public boolean containsValue(UUID ownerUuid, String fieldName, Object element) {
+        return  CdmApplicationState.getCurrentAppConfig().getCommonService().containsValue(ownerUuid, fieldName, element);
+    }
+
+
+
+
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CdmAuthenticatedHttpInvokerRequestExecutor.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CdmAuthenticatedHttpInvokerRequestExecutor.java
new file mode 100644 (file)
index 0000000..f46b81a
--- /dev/null
@@ -0,0 +1,47 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.service;
+
+import java.io.IOException;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.http.client.methods.HttpPost;
+import org.springframework.remoting.httpinvoker.HttpComponentsHttpInvokerRequestExecutor;
+import org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.context.SecurityContext;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+
+/**
+ * @author cmathew
+ * @date 27 Jan 2015
+ *
+ */
+public class CdmAuthenticatedHttpInvokerRequestExecutor extends HttpComponentsHttpInvokerRequestExecutor {
+
+    @Override
+    protected HttpPost createHttpPost(HttpInvokerClientConfiguration config) throws IOException {
+       HttpPost postMethod = super.createHttpPost(config);
+
+        SecurityContext securityContext = CdmApplicationState.getCurrentSecurityContext();
+        if(securityContext != null) {
+            Authentication auth = securityContext.getAuthentication();
+            if ((auth != null) && (auth.getName() != null) &&
+                    (auth.getCredentials() != null)) {
+                String base64 = auth.getName() + ":" + auth.getCredentials().toString();
+                postMethod.setHeader("Authorization", "Basic " +
+                        new String(Base64.encodeBase64(base64.getBytes())));
+            }
+        }
+        return postMethod;
+    }
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CdmServiceInterceptorException.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CdmServiceInterceptorException.java
new file mode 100644 (file)
index 0000000..292eda2
--- /dev/null
@@ -0,0 +1,13 @@
+package eu.etaxonomy.taxeditor.service;
+
+public class CdmServiceInterceptorException extends RuntimeException {
+       
+       public CdmServiceInterceptorException(String message) {
+               super(message);
+       }
+       
+       public CdmServiceInterceptorException(Exception ex) {
+               super(ex);
+       }
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CdmServiceRequestExecutor.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CdmServiceRequestExecutor.java
new file mode 100644 (file)
index 0000000..d8a0732
--- /dev/null
@@ -0,0 +1,85 @@
+package eu.etaxonomy.taxeditor.service;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration;
+import org.springframework.remoting.support.RemoteInvocation;
+import org.springframework.remoting.support.RemoteInvocationResult;
+import org.springframework.stereotype.Component;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
+
+@Component
+public class CdmServiceRequestExecutor extends CdmAuthenticatedHttpInvokerRequestExecutor {
+
+    private static final Logger logger = Logger.getLogger(CdmServiceRequestExecutor.class);
+
+    private ICdmEntitySessionManager cdmEntitySessionManager ;
+
+       private RemoteInvocation currentRemoteInvocation;
+
+       protected final static Set<String> cachableMethods = new HashSet<String>();
+
+
+
+       public CdmServiceRequestExecutor() {
+           cachableMethods.add("merge");
+           cachableMethods.add("save");
+           cachableMethods.add("findWithUpdate");
+           cachableMethods.add("loadWithUpdate");
+       }
+
+       @Override
+       protected void writeRemoteInvocation(RemoteInvocation invocation, OutputStream os) throws IOException {
+           if(cdmEntitySessionManager == null) {
+               cdmEntitySessionManager =
+                       ((CdmApplicationRemoteController)CdmApplicationState.getCurrentAppConfig()).getCdmEntitySessionManager();
+           }
+               currentRemoteInvocation = invocation;
+               super.writeRemoteInvocation(invocation, os);
+       }
+
+       @Override
+       protected RemoteInvocationResult doExecuteRequest(HttpInvokerClientConfiguration config,
+                       java.io.ByteArrayOutputStream baos)
+                                       throws java.io.IOException,
+                                       java.lang.ClassNotFoundException {
+               RemoteInvocationResult rir = fromCache(currentRemoteInvocation);
+
+               if(rir == null) {
+                   logger.info("Remote invoking : " + currentRemoteInvocation.getMethodName() + "@" + config.getServiceUrl());
+                       rir = super.doExecuteRequest(config, baos);
+                       if(rir.getValue() != null && !rir.hasException()) {
+                if(cachableMethods.contains(currentRemoteInvocation.getMethodName())) {
+                    rir = new RemoteInvocationResult(cdmEntitySessionManager.load(rir.getValue(), true));
+                } else if(rir.getValue() instanceof UpdateResult){
+                    UpdateResult result = (UpdateResult)rir.getValue();
+                    if(result.isOk()){
+                        cdmEntitySessionManager.load(result, true);
+                    }
+                } else {
+                    rir = new RemoteInvocationResult(cdmEntitySessionManager.load(rir.getValue(), false));
+                }
+                       }
+                       cache(currentRemoteInvocation, rir);
+               }
+               currentRemoteInvocation = null;
+
+               return rir;
+       }
+
+       public void cache(RemoteInvocation ri, RemoteInvocationResult rir) {
+
+       }
+
+       public RemoteInvocationResult fromCache(RemoteInvocation ri) {
+           return null;
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/ICachedCommonService.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/ICachedCommonService.java
new file mode 100644 (file)
index 0000000..98c94d8
--- /dev/null
@@ -0,0 +1,88 @@
+// $Id$
+/**
+ * Copyright (C) 2014 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.service;
+
+import java.util.UUID;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+
+/**
+ * @author cmathew
+ * @date 14 Oct 2014
+ *
+ */
+public interface ICachedCommonService {
+
+    public CdmBase find(Class<? extends CdmBase> clazz, int id);
+
+
+    /**
+     * Initializes a collection or map.
+     *
+     * @param ownerUuid uuid of owner cdm entity
+     * @param fieldName field name of collection or map
+     * @return initialised collection or map
+     */
+    public Object initializeCollection(UUID ownerUuid, String fieldName);
+
+    /**
+     * Checks if a collection or map is empty.
+     *
+     * @param ownerUuid uuid of owner cdm entity
+     * @param fieldName field name of collection or map
+     * @return true if the collection of map is empty, else false
+     */
+    public boolean isEmpty(UUID ownerUuid, String fieldName);
+
+    /**
+     * Returns the size of requested collection or map.
+     *
+     * @param ownerUuid uuid of owner cdm entity
+     * @param fieldName field name of collection or map
+     * @return the size of the persistent collection
+     */
+    public int size(UUID ownerUuid, String fieldName);
+
+    /**
+     * Checks whether an object is contained within a persistent collection.
+     *
+     * @param ownerUuid uuid of owner cdm entity
+     * @param fieldName field name of collection or map
+     * @param element the element to check for
+     * @return true if the element exists in the collection, false o/w
+     */
+    public boolean contains(UUID ownerUuid, String fieldName, Object element);
+
+    /**
+     * Checks whether an index object exists within a persistent collection
+     * (usually a map)
+     *
+     * @param ownerUuid uuid of owner cdm entity
+     * @param fieldName field name of map
+     * @param key the index object to look for.
+     * @return true if the index object exists in the collection, false o/w
+     */
+    public boolean containsKey(UUID ownerUuid, String fieldName, Object key);
+
+    /**
+     * checks whether an value object exists within a persistent collection
+     * (usually a map)
+     *
+     * @param ownerUuid uuid of owner cdm entity
+     * @param fieldName field name of map
+     * @param key the value object to look for.
+     * @return true if the value object exists in the collection, false o/w
+     */
+    public boolean containsValue(UUID ownerUuid, String fieldName, Object element);
+
+
+
+
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/TermServiceRequestExecutor.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/TermServiceRequestExecutor.java
new file mode 100644 (file)
index 0000000..5991563
--- /dev/null
@@ -0,0 +1,60 @@
+package eu.etaxonomy.taxeditor.service;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.springframework.remoting.support.RemoteInvocation;
+import org.springframework.remoting.support.RemoteInvocationResult;
+
+import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.common.TermType;
+
+
+public class TermServiceRequestExecutor extends CdmServiceRequestExecutor {
+    private static final Logger logger = Logger.getLogger(TermServiceRequestExecutor.class);
+
+       private static Map<TermType, RemoteInvocationResult>  termTypeMap = new
+                       HashMap<TermType, RemoteInvocationResult>();
+
+       private static CdmServiceCacher cdmServiceCacher;
+
+       public static void setDefaultCacher(CdmServiceCacher css) {
+        cdmServiceCacher = css;
+    }
+
+       @Override
+       public void cache(RemoteInvocation ri, RemoteInvocationResult rir) {
+           if(cdmServiceCacher != null) {
+               if(ri.getMethodName().equals("listByTermType")) {
+                   if(ri.getArguments()[1] == null) {
+                       Set<DefinedTermBase> terms = new HashSet<DefinedTermBase>();
+                       if(rir.getValue() != null) {
+                           terms.addAll((List<DefinedTermBase>)rir.getValue());
+
+                           for(DefinedTermBase<?> term : terms) {
+                               cdmServiceCacher.load(term);
+                           }
+                           termTypeMap.put((TermType)ri.getArguments()[0], rir);
+                       }
+
+                   }
+               }
+           } else {
+               logger.info("Default CdmServiceCacher is null. Cannot cache terms");
+           }
+       }
+
+
+       @Override
+       public  RemoteInvocationResult fromCache(RemoteInvocation ri) {
+               return termTypeMap.get(ri.getArguments()[0]);
+       }
+
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/CdmClientSessionException.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/CdmClientSessionException.java
new file mode 100644 (file)
index 0000000..4af9273
--- /dev/null
@@ -0,0 +1,8 @@
+package eu.etaxonomy.taxeditor.session;
+
+public class CdmClientSessionException extends RuntimeException {
+
+       public CdmClientSessionException(String message) {
+               super(message);
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/CdmEntitySession.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/CdmEntitySession.java
new file mode 100644 (file)
index 0000000..150d7d2
--- /dev/null
@@ -0,0 +1,320 @@
+// $Id$
+/**
+ * Copyright (C) 2014 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.session;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import net.sf.ehcache.statistics.LiveCacheStatistics;
+
+import org.apache.log4j.Logger;
+
+import eu.etaxonomy.cdm.api.service.IService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
+import eu.etaxonomy.taxeditor.remoting.cache.CdmTransientEntityCacher;
+import eu.etaxonomy.taxeditor.remoting.cache.EntityCacherDebugResult;
+
+
+/**
+ *
+ * NOTE : It would be nice to have this class performing merge / delete operations
+ * using services, but this is only possible if we can 'intelligently'
+ * get from a model class to the correspoding service class
+ * @author cmathew
+ * @date 20 Oct 2014
+ *
+ */
+
+public class CdmEntitySession implements ICdmEntitySession  {
+
+    private static final Logger logger = Logger.getLogger(CdmEntitySession.class);
+
+    private final CdmEntitySessionManager cdmEntitySessionManager;
+
+    private final ICdmEntitySessionEnabled sessionOwner;
+
+    private CdmTransientEntityCacher cdmTransientEntityCacher;
+
+    private List<ICdmEntitySessionEnabled> changeObservers;
+
+
+    public CdmEntitySession(ICdmEntitySessionEnabled sessionOwner, CdmEntitySessionManager cdmEntitySessionManager) {
+        this.sessionOwner = sessionOwner;
+        this.cdmEntitySessionManager = cdmEntitySessionManager;
+        init(sessionOwner, cdmEntitySessionManager);
+    }
+
+    private void init(ICdmEntitySessionEnabled sessionOwner, CdmEntitySessionManager cdmEntitySessionManager) {
+        this.cdmTransientEntityCacher = new CdmTransientEntityCacher(sessionOwner, cdmEntitySessionManager);
+        this.changeObservers = new ArrayList<ICdmEntitySessionEnabled>();
+        cdmEntitySessionManager.addToOwnerSessionMap(sessionOwner, this);
+    }
+
+
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(java.lang.Object, boolean)
+     */
+    @Override
+    public  <O extends Object> O load(O obj, boolean update) {
+        return cdmTransientEntityCacher.load(obj, update);
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(eu.etaxonomy.cdm.model.common.CdmBase, boolean)
+     */
+    @Override
+    public  <T extends CdmBase> T load(T cdmBase, boolean update) {
+        return (T)cdmTransientEntityCacher.load(cdmBase, update);
+    }
+
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(eu.etaxonomy.cdm.api.service.UpdateResult, boolean)
+     */
+    @Override
+    public UpdateResult load(UpdateResult updateResult, boolean update) {
+        return cdmTransientEntityCacher.load(updateResult, update);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(eu.etaxonomy.cdm.persistence.dto.MergeResult, boolean)
+     */
+    @Override
+    public  <T extends CdmBase> MergeResult<T> load(MergeResult<T> mergeResult, boolean update) {
+        return  cdmTransientEntityCacher.load(mergeResult, update);
+    }
+
+    @Override
+    public <T extends CdmBase> void  update() {
+        Collection<T> rootEntities = getRootEntities();
+        if(rootEntities != null) {
+            for(T rootEntity : rootEntities) {
+                load(rootEntity, true);
+            }
+        }
+    }
+
+//    @Override
+//    public <T extends ICdmBase> void update(T cdmBase, Set<CdmBase> affectedObjects) {
+//        addEvent(cdmBase, affectedObjects, EventType.UPDATE);
+//    }
+//
+//    @Override
+//    public <T extends ICdmBase> void update(T cdmBase, CdmBase affectedObject) {
+//        Set<CdmBase> set = new HashSet<CdmBase>();
+//        set.add(affectedObject);
+//        addEvent(cdmBase, set, EventType.UPDATE);
+//    }
+//
+//
+//    @Override
+//    public <T extends ICdmBase> void delete(T cdmBase, Set<CdmBase> affectedObjects) {
+//        addEvent(cdmBase, affectedObjects, EventType.DELETE);
+//    }
+//
+//    @Override
+//    public <T extends ICdmBase> void delete(Set<T> cdmBases, Set<CdmBase> affectedObjects) {
+//        addEvent(cdmBases, affectedObjects, EventType.DELETE);
+//    }
+
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#debug(eu.etaxonomy.cdm.model.common.CdmBase)
+     */
+    @Override
+    public <T extends CdmBase> EntityCacherDebugResult debug(T cdmBase) {
+        return debug(Arrays.asList(cdmBase));
+    }
+
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#debug(java.util.List)
+     */
+    @Override
+    public <T extends CdmBase> EntityCacherDebugResult debug(Collection<T> cdmBases) {
+        EntityCacherDebugResult entityCacherDebugResult =
+                new EntityCacherDebugResult(cdmTransientEntityCacher, cdmBases);
+        return entityCacherDebugResult;
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#debug()
+     */
+    @Override
+    public <T extends CdmBase> EntityCacherDebugResult debug() {
+        return debug(getRootEntities());
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(java.util.Collection)
+     */
+    @Override
+    public  <T extends CdmBase> Collection<T> load(Collection<T> cdmBaseList, boolean update) {
+        return cdmTransientEntityCacher.load(cdmBaseList, update);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#setEntitiesAsLatest()
+     */
+    @Override
+    public void setEntitiesAsLatest() {
+        //FIXME:Remoting need to think more about whether we really need this
+        //             List<CdmBase> entities = cdmTransientEntityCacher.getAllEntities();
+        //             for(CdmBase entity : entities) {
+        //                     cdmEntitySessionManager.setEntityAsLatest(entity);
+        //             }
+    }
+
+
+    @Override
+    public void bind() {
+        logger.info("Binding session with owner " + sessionOwner.toString());
+        if(!cdmEntitySessionManager.contains(sessionOwner)) {
+            init(sessionOwner, cdmEntitySessionManager);
+        }
+        cdmEntitySessionManager.bind(sessionOwner);
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#dispose()
+     */
+    @Override
+    public void dispose() {
+
+        cdmTransientEntityCacher.dispose();
+        changeObservers.clear();
+        cdmEntitySessionManager.remove(sessionOwner);
+
+    }
+
+
+//    /* (non-Javadoc)
+//     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#commit()
+//     */
+//    @Override
+//    public void addEvent(ICdmBase cdmBase, Set<CdmBase> affectedObjects, EventType eventType) {
+//        affectedObjects = (Set<CdmBase>) load(affectedObjects, true);
+//        CdmDataChangeEvent cdce = CdmDataChangeEvent.NewInstance((CdmBase)cdmBase, affectedObjects, eventType);
+//        CdmPostDataChangeObservableListener.getDefault().notifyObservers(cdce);
+//    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(java.util.UUID, java.lang.Class)
+     */
+    @Override
+    public  <T extends CdmBase>  T remoteLoad(IService<T> service, UUID uuid) {
+        T cdmBase = service.load(uuid);
+        return load(cdmBase, false);
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(eu.etaxonomy.cdm.api.service.IService, java.util.UUID, java.util.List)
+     */
+    @Override
+    public <T extends CdmBase>  T remoteLoad(IService<T> service, UUID uuid, List<String> propertyPaths) {
+        T cdmBase = service.load(uuid, propertyPaths);
+        return load(cdmBase, false);
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#save(eu.etaxonomy.cdm.api.service.IService, eu.etaxonomy.cdm.model.common.CdmBase)
+     */
+    @Override
+    public <T extends CdmBase> UUID remoteSave(IService<T> service, T cdmBase) {
+        UUID uuid = service.save(cdmBase).getUuid();
+        load(cdmBase,false);
+        return uuid;
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#update(eu.etaxonomy.cdm.api.service.IService, eu.etaxonomy.cdm.model.common.CdmBase)
+     */
+    @Override
+    public <T extends CdmBase> T remoteUpdate(IService<T> service, T cdmBase) {
+        T mergedCdmBase = service.merge(cdmBase, true).getMergedEntity();
+        return mergedCdmBase;
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#isActive()
+     */
+    @Override
+    public boolean isActive() {
+        return cdmEntitySessionManager.getActiveSession() == this;
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#getOwner()
+     */
+    @Override
+    public ICdmEntitySessionEnabled getOwner() {
+        return sessionOwner;
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#getNoOfObjectsInCache()
+     */
+    @Override
+    public LiveCacheStatistics getCacheStatistics() {
+        return cdmTransientEntityCacher.getCacheStatistics();
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#getRootEntities()
+     */
+    @Override
+    public <T extends CdmBase> Collection<T> getRootEntities() {
+        return sessionOwner.getRootEntities();
+    }
+
+    public CdmTransientEntityCacher getCacher() {
+        return cdmTransientEntityCacher;
+    }
+
+    @Override
+    public List<String> getPropertyPaths(Object obj) {
+        Map<Object, List<String>> propertyPathsMap = sessionOwner.getPropertyPathsMap();
+        if(propertyPathsMap == null || propertyPathsMap.isEmpty()) {
+            return null;
+        }
+        return propertyPathsMap.get(obj);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#addNewCdmEntity(eu.etaxonomy.cdm.model.common.CdmBase)
+     */
+    @Override
+    public void addNewCdmEntity(CdmBase newEntity) {
+        cdmTransientEntityCacher.addNewEntity(newEntity);
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionManager.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionManager.java
new file mode 100644 (file)
index 0000000..5582df7
--- /dev/null
@@ -0,0 +1,264 @@
+// $Id$
+/**
+ * Copyright (C) 2014 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.session;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
+
+/**
+ * @author cmathew
+ * @date 16 Oct 2014
+ *
+ */
+@Component
+public class CdmEntitySessionManager implements ICdmEntitySessionManager {
+    private static final Logger logger = Logger.getLogger(CdmEntitySessionManager.class);
+
+    private final Map<ICdmEntitySessionEnabled, ICdmEntitySession> ownerSessionMap =
+            new HashMap<ICdmEntitySessionEnabled, ICdmEntitySession>();
+
+    private final List<ICdmEntitySessionManagerObserver> sessionObservers = new ArrayList<ICdmEntitySessionManagerObserver>();
+
+    //private ICdmEntitySession activeSession;
+
+    private final InheritableThreadLocal<ICdmEntitySession> tlActiveSession = new InheritableThreadLocal<ICdmEntitySession>();
+
+    private  NullSession nullSession;
+
+    @Override
+    public ICdmEntitySession getNullSession() {
+        return nullSession;
+    }
+
+    @Override
+    public ICdmEntitySession newSession(ICdmEntitySessionEnabled sessionOwner, boolean setAsActive) {
+        ICdmEntitySession session = ownerSessionMap.get(sessionOwner);
+        if(session == null) {
+            session = new CdmEntitySession(sessionOwner, this);
+            addToOwnerSessionMap(sessionOwner, session);
+        }
+
+        if(setAsActive) {
+            setActiveSession(session);
+        }
+
+        return session;
+    }
+
+    @Override
+    public ICdmEntitySession bindNullSession() {
+
+        if(nullSession == null) {
+            nullSession = new NullSession(null, this);
+        }
+
+        setActiveSession(nullSession);
+
+        return nullSession;
+    }
+
+    @Override
+    public ICdmEntitySession getActiveSession() {
+        return tlActiveSession.get();
+    }
+
+
+    private void setActiveSession(ICdmEntitySession activeSession) {
+       this. tlActiveSession.set(activeSession);
+        notifyObservers();
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#getSessions()
+     */
+    @Override
+    public Collection<ICdmEntitySession> getSessions() {
+        return ownerSessionMap.values();
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#bind(eu.etaxonomy.taxeditor.session.ISessionEventListener)
+     */
+    @Override
+    public void bind(ICdmEntitySessionEnabled sessionOwner) {
+        if(sessionOwner == null) {
+            setActiveSession(null);
+            return;
+        }
+        ICdmEntitySession session  = ownerSessionMap.get(sessionOwner);
+        if(session == null) {
+            throw new CdmClientSessionException("Trying to bind session which does not exist");
+        }
+
+        setActiveSession(session);
+
+    }
+
+    @Override
+    public boolean contains(ICdmEntitySessionEnabled sessionOwner) {
+        return ownerSessionMap.containsKey(sessionOwner);
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#load(T)
+     */
+    @Override
+    public <T extends Object> T load(T obj, boolean update) {
+        if(tlActiveSession.get() == null) {
+            return obj;
+        } else {
+            return tlActiveSession.get().load(obj, update);
+        }
+    }
+
+
+    @Override
+    public <T extends CdmBase> void update() {
+        if(tlActiveSession.get() != null) {
+            tlActiveSession.get().update();
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#load(T)
+     */
+    @Override
+    public <T extends CdmBase> T load(T cdmBase, boolean update) {
+        if(tlActiveSession.get() == null) {
+            return cdmBase;
+        }
+        return tlActiveSession.get().load(cdmBase, update);
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#load(eu.etaxonomy.cdm.api.service.UpdateResult, boolean)
+     */
+    @Override
+    public UpdateResult load(UpdateResult updateResult, boolean update) {
+        if(tlActiveSession.get() == null) {
+            return updateResult;
+        }
+        return tlActiveSession.get().load(updateResult, update);
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#load(eu.etaxonomy.cdm.persistence.dto.MergeResult, boolean)
+     */
+    @Override
+    public MergeResult load(MergeResult mergeResult, boolean update) {
+        if(tlActiveSession.get() == null) {
+            return mergeResult;
+        }
+        return tlActiveSession.get().load(mergeResult, update);
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#load(java.util.Collection)
+     */
+    @Override
+    public <T extends CdmBase> Collection<T> load(Collection<T> cdmBaseList, boolean update) {
+        if(tlActiveSession.get() == null) {
+            return cdmBaseList;
+        }
+        return tlActiveSession.get().load(cdmBaseList, update);
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#dispose(eu.etaxonomy.taxeditor.session.ISessionEventListener)
+     */
+    void remove(ICdmEntitySessionEnabled owner) {
+        ICdmEntitySession session = ownerSessionMap.get(owner);
+        if(session == null) {
+            logger.info("No Session connected to owner, nothing to do");
+            return;
+        }
+        if(session == tlActiveSession.get()) {
+            setActiveSession(null);
+        }
+        ownerSessionMap.remove(owner);
+        notifyObservers();
+
+    }
+
+    @Override
+    public void dispose(ICdmEntitySessionEnabled owner) {
+        ICdmEntitySession session = ownerSessionMap.get(owner);
+        if(session != null) {
+            session.dispose();
+        }
+        if(nullSession != null && nullSession.getOwner() == owner) {
+            nullSession = null;
+        }
+
+    }
+
+
+    @Override
+    public void disposeAll() {
+        Set<ICdmEntitySessionEnabled> owners =
+                new HashSet<ICdmEntitySessionEnabled>(ownerSessionMap.keySet());
+        for(ICdmEntitySessionEnabled owner : owners) {
+            ICdmEntitySession session = ownerSessionMap.get(owner);
+            if(session != null) {
+                session.dispose();
+            }
+        }
+
+    }
+
+    void addToOwnerSessionMap(ICdmEntitySessionEnabled owner, ICdmEntitySession session) {
+        ownerSessionMap.put(owner, session);
+        notifyObservers();
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#addSessionListener()
+     */
+    @Override
+    public void addSessionObserver(ICdmEntitySessionManagerObserver sessionObserver) {
+        sessionObservers.add(sessionObserver);
+    }
+
+    public void notifyObservers() {
+        for(ICdmEntitySessionManagerObserver sessionObserver : sessionObservers) {
+            sessionObserver.changed();
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#isRemoting()
+     */
+    @Override
+    public boolean isRemoting() {
+        // FIXME:Remoting stupid method to check whether we are in remoting
+        return true;
+    }
+
+}
+
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/DefaultNewEntityListener.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/DefaultNewEntityListener.java
new file mode 100644 (file)
index 0000000..dc519d8
--- /dev/null
@@ -0,0 +1,42 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.session;
+
+import org.apache.log4j.Logger;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.model.NewEntityListener;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+
+/**
+ * @author cmathew
+ * @date 30 Sep 2015
+ *
+ */
+public class DefaultNewEntityListener implements NewEntityListener {
+
+    private static final Logger logger = Logger.getLogger(DefaultNewEntityListener.class);
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.model.NewEntityListener#onCreate(eu.etaxonomy.cdm.model.common.CdmBase)
+     */
+    @Override
+    public void onCreate(CdmBase cdmBase) {
+        logger.info("New Entity created : " + cdmBase);
+        if(CdmApplicationState.getCurrentAppConfig() instanceof CdmApplicationRemoteController){
+            ICdmEntitySession activeSession = ((CdmApplicationRemoteController)CdmApplicationState.getCurrentAppConfig()).getCdmEntitySessionManager().getActiveSession();
+            if(activeSession != null) {
+                activeSession.addNewCdmEntity(cdmBase);
+            }
+        }
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySession.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySession.java
new file mode 100644 (file)
index 0000000..bbd744f
--- /dev/null
@@ -0,0 +1,96 @@
+package eu.etaxonomy.taxeditor.session;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.UUID;
+
+import net.sf.ehcache.statistics.LiveCacheStatistics;
+import eu.etaxonomy.cdm.api.service.IService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
+import eu.etaxonomy.taxeditor.remoting.cache.EntityCacherDebugResult;
+
+public interface ICdmEntitySession {
+
+    public ICdmEntitySessionEnabled getOwner();
+
+    public LiveCacheStatistics getCacheStatistics();
+
+       public  <O extends Object> O load(O obj, boolean update);
+
+       public  <T extends CdmBase> T load(T cdmBase, boolean update);
+
+       public  UpdateResult load(UpdateResult updateResult, boolean update);
+
+       public  <T extends CdmBase> MergeResult<T> load(MergeResult<T> mergeResult, boolean update);
+
+       public <T extends CdmBase> EntityCacherDebugResult debug(T cdmBase);
+
+       public <T extends CdmBase> EntityCacherDebugResult debug(Collection<T> cdmBase);
+
+       public <T extends CdmBase> EntityCacherDebugResult debug();
+
+       public <T extends CdmBase> Collection<T> load(Collection<T> cdmBaseList, boolean update);
+
+       public  void setEntitiesAsLatest();
+
+       public <T extends CdmBase> Collection<T> getRootEntities();
+
+       public  void dispose();
+
+    public void bind();
+
+//    public void addEvent(ICdmBase cdmBase, Set<CdmBase> affectedObjects, EventType eventType);
+
+    public  <T extends CdmBase> T remoteLoad(IService<T> service, UUID uuid);
+
+    public  <T extends CdmBase> T remoteLoad(IService<T> service, UUID uuid, List<String> propertyPaths);
+
+    public <T extends CdmBase> UUID remoteSave(IService<T> service, T cdmBase);
+
+    public <T extends CdmBase> T remoteUpdate(IService<T> service, T cdmBase);
+
+
+//    /**
+//     * @param cdmBase
+//     * @param affectedObjects
+//     */
+//    public <T extends ICdmBase> void update(T cdmBase, Set<CdmBase> affectedObjects);
+//
+//    /**
+//     * @param cdmBase
+//     * @param affectedObjects
+//     */
+//    public <T extends ICdmBase> void delete(T cdmBase, Set<CdmBase> affectedObjects);
+//
+//    /**
+//     * @param cdmBase
+//     * @param affectedObjects
+//     */
+//    public <T extends ICdmBase> void delete(Set<T> cdmBases, Set<CdmBase> affectedObjects);
+
+
+    public boolean isActive();
+
+//    /**
+//     * @param cdmBase
+//     * @param affectedObject
+//     */
+//    public <T extends ICdmBase> void update(T cdmBase, CdmBase affectedObject);
+
+    /**
+     *
+     */
+    public <T extends CdmBase> void update();
+
+
+    /**
+     * @param obj
+     * @return
+     */
+    public List<String> getPropertyPaths(Object obj);
+
+    public void addNewCdmEntity(CdmBase newEntity);
+
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySessionEnabled.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySessionEnabled.java
new file mode 100644 (file)
index 0000000..be2e46c
--- /dev/null
@@ -0,0 +1,17 @@
+package eu.etaxonomy.taxeditor.session;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+
+public interface ICdmEntitySessionEnabled {
+
+    public ICdmEntitySession getCdmEntitySession();
+
+    public <T extends CdmBase> Collection<T> getRootEntities();
+
+    public Map<Object, List<String>> getPropertyPathsMap();
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySessionManager.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySessionManager.java
new file mode 100644 (file)
index 0000000..f6418ae
--- /dev/null
@@ -0,0 +1,79 @@
+package eu.etaxonomy.taxeditor.session;
+
+import java.util.Collection;
+
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
+
+public interface ICdmEntitySessionManager {
+
+    public abstract ICdmEntitySession newSession(ICdmEntitySessionEnabled sessionOwner, boolean setAsActive);
+
+    /**
+     * @param sessionOwner
+     * @return
+     */
+    public ICdmEntitySession bindNullSession();
+
+
+       public abstract void bind(ICdmEntitySessionEnabled sessionOwner);
+
+
+       public abstract <T extends Object> T load(T obj, boolean update);
+
+
+       public abstract <T extends CdmBase> T load(T cdmBase, boolean update);
+
+
+       public abstract UpdateResult load(UpdateResult updateResult, boolean update);
+
+       public abstract MergeResult load(MergeResult mergeResult, boolean update);
+
+
+       public abstract <T extends CdmBase> Collection<T> load(Collection<T> cdmBaseList, boolean update);
+
+
+    /**
+     * @return
+     */
+    public ICdmEntitySession getActiveSession();
+
+    public Collection<ICdmEntitySession> getSessions();
+
+    public void addSessionObserver(ICdmEntitySessionManagerObserver sessionObserver);
+
+
+
+
+    public boolean isRemoting();
+
+    /**
+     * @param owner
+     */
+    public void dispose(ICdmEntitySessionEnabled owner);
+
+    /**
+     *
+     */
+    public void disposeAll();
+
+
+    /**
+     *
+     */
+    public <T extends CdmBase> void update();
+
+    /**
+     * @param sessionOwner
+     * @return
+     */
+    public boolean contains(ICdmEntitySessionEnabled sessionOwner);
+
+    /**
+     * @return
+     */
+    public ICdmEntitySession getNullSession();
+
+
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySessionManagerObserver.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySessionManagerObserver.java
new file mode 100644 (file)
index 0000000..d2e3252
--- /dev/null
@@ -0,0 +1,21 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.session;
+
+/**
+ * @author cmathew
+ * @date 16 Feb 2015
+ *
+ */
+public interface ICdmEntitySessionManagerObserver {
+
+    public void changed();
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/NullSession.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/NullSession.java
new file mode 100644 (file)
index 0000000..22aa7be
--- /dev/null
@@ -0,0 +1,233 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.session;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import net.sf.ehcache.statistics.LiveCacheStatistics;
+import eu.etaxonomy.cdm.api.service.IService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
+import eu.etaxonomy.taxeditor.remoting.cache.EntityCacherDebugResult;
+
+/**
+ * @author cmathew
+ * @date 30 Jul 2015
+ *
+ */
+public class NullSession implements ICdmEntitySession {
+
+    private ICdmEntitySessionEnabled sessionOwner;
+    private final CdmEntitySessionManager cdmEntitySessionManager;
+
+    public NullSession(ICdmEntitySessionEnabled sessionOwner, CdmEntitySessionManager cdmEntitySessionManager) {
+        this.sessionOwner = sessionOwner;
+        this.cdmEntitySessionManager = cdmEntitySessionManager;
+    }
+
+    public void setOwner(ICdmEntitySessionEnabled sessionOwner) {
+        this.sessionOwner = sessionOwner;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#getOwner()
+     */
+    @Override
+    public ICdmEntitySessionEnabled getOwner() {
+        return sessionOwner;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#getCacheStatistics()
+     */
+    @Override
+    public LiveCacheStatistics getCacheStatistics() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(java.lang.Object, boolean)
+     */
+    @Override
+    public <O> O load(O obj, boolean update) {
+        return obj;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(eu.etaxonomy.cdm.model.common.CdmBase, boolean)
+     */
+    @Override
+    public <T extends CdmBase> T load(T cdmBase, boolean update) {
+        return cdmBase;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(eu.etaxonomy.cdm.api.service.UpdateResult, boolean)
+     */
+    @Override
+    public UpdateResult load(UpdateResult updateResult, boolean update) {
+        return updateResult;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#debug(eu.etaxonomy.cdm.model.common.CdmBase)
+     */
+    @Override
+    public <T extends CdmBase> EntityCacherDebugResult debug(T cdmBase) {
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#debug(java.util.Collection)
+     */
+    @Override
+    public <T extends CdmBase> EntityCacherDebugResult debug(Collection<T> cdmBase) {
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#debug()
+     */
+    @Override
+    public <T extends CdmBase> EntityCacherDebugResult debug() {
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(java.util.Collection, boolean)
+     */
+    @Override
+    public <T extends CdmBase> Collection<T> load(Collection<T> cdmBaseList, boolean update) {
+        return cdmBaseList;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#setEntitiesAsLatest()
+     */
+    @Override
+    public void setEntitiesAsLatest() {
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#getRootEntities()
+     */
+    @Override
+    public <T extends CdmBase> Collection<T> getRootEntities() {
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#dispose()
+     */
+    @Override
+    public void dispose() {
+        cdmEntitySessionManager.remove(sessionOwner);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#bind()
+     */
+    @Override
+    public void bind() {
+        cdmEntitySessionManager.bindNullSession();
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#remoteLoad(eu.etaxonomy.cdm.api.service.IService, java.util.UUID)
+     */
+    @Override
+    public <T extends CdmBase> T remoteLoad(IService<T> service, UUID uuid) {
+        T cdmBase = service.load(uuid);
+        return load(cdmBase, false);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#remoteLoad(eu.etaxonomy.cdm.api.service.IService, java.util.UUID, java.util.List)
+     */
+    @Override
+    public <T extends CdmBase> T remoteLoad(IService<T> service, UUID uuid, List<String> propertyPaths) {
+        T cdmBase = service.load(uuid, propertyPaths);
+        return load(cdmBase, false);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#remoteSave(eu.etaxonomy.cdm.api.service.IService, eu.etaxonomy.cdm.model.common.CdmBase)
+     */
+    @Override
+    public <T extends CdmBase> UUID remoteSave(IService<T> service, T cdmBase) {
+        UUID uuid = service.save(cdmBase).getUuid();
+        load(cdmBase,false);
+        return uuid;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#remoteUpdate(eu.etaxonomy.cdm.api.service.IService, eu.etaxonomy.cdm.model.common.CdmBase)
+     */
+    @Override
+    public <T extends CdmBase> T remoteUpdate(IService<T> service, T cdmBase) {
+        T mergedCdmBase = service.merge(cdmBase, true).getMergedEntity();
+        return mergedCdmBase;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#isActive()
+     */
+    @Override
+    public boolean isActive() {
+        return cdmEntitySessionManager.getActiveSession() == this;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#update()
+     */
+    @Override
+    public <T extends CdmBase> void update() {
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#getPropertyPaths(java.lang.Object)
+     */
+    @Override
+    public List<String> getPropertyPaths(Object obj) {
+        if(sessionOwner == null) {
+            return null;
+        }
+        Map<Object, List<String>> propertyPathsMap = sessionOwner.getPropertyPathsMap();
+        if(propertyPathsMap == null || propertyPathsMap.isEmpty()) {
+            return null;
+        }
+        return propertyPathsMap.get(obj);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#addNewCdmEntity(eu.etaxonomy.cdm.model.common.CdmBase)
+     */
+    @Override
+    public void addNewCdmEntity(CdmBase newEntity) {
+        // TODO Auto-generated method stub
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(eu.etaxonomy.cdm.persistence.dto.MergeResult, boolean)
+     */
+    @Override
+    public <T extends CdmBase> MergeResult<T> load(MergeResult<T> mergeResult, boolean update) {
+        return mergeResult;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/mock/MockCdmEntitySession.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/mock/MockCdmEntitySession.java
new file mode 100644 (file)
index 0000000..efe8b7e
--- /dev/null
@@ -0,0 +1,220 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.session.mock;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.UUID;
+
+import net.sf.ehcache.statistics.LiveCacheStatistics;
+import eu.etaxonomy.cdm.api.service.IService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
+import eu.etaxonomy.taxeditor.remoting.cache.EntityCacherDebugResult;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
+
+/**
+ * @author cmathew
+ * @date 29 Jan 2015
+ *
+ */
+public class MockCdmEntitySession implements ICdmEntitySession  {
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(java.lang.Object)
+     */
+    @Override
+    public <O extends Object> O load(O obj, boolean update) {
+        return obj;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(eu.etaxonomy.cdm.model.common.CdmBase)
+     */
+    @Override
+    public  <T extends CdmBase> T load(T cdmBase, boolean update) {
+        return cdmBase;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(java.util.Collection)
+     */
+    @Override
+    public  <T extends CdmBase> Collection<T> load(Collection<T> cdmBaseList, boolean update) {
+        return cdmBaseList;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#setEntitiesAsLatest()
+     */
+    @Override
+    public void setEntitiesAsLatest() {
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#dispose()
+     */
+    @Override
+    public void dispose() {
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#bind()
+     */
+    @Override
+    public void bind() {
+        // TODO Auto-generated method stub
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#debug(eu.etaxonomy.cdm.model.common.CdmBase)
+     */
+    @Override
+    public  <T extends CdmBase> EntityCacherDebugResult debug(T cdmBase) {
+
+        return new EntityCacherDebugResult();
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(java.util.UUID, eu.etaxonomy.cdm.api.service.IService)
+     */
+    @Override
+    public <T extends CdmBase> T remoteLoad(IService<T> service, UUID uuid) {
+        return service.load(uuid);
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(eu.etaxonomy.cdm.api.service.IService, java.util.UUID, java.util.List)
+     */
+    @Override
+    public <T extends CdmBase> T remoteLoad(IService<T> service, UUID uuid, List<String> propertyPaths) {
+        return service.load(uuid, propertyPaths);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#save(eu.etaxonomy.cdm.api.service.IService, eu.etaxonomy.cdm.model.common.CdmBase)
+     */
+    @Override
+    public <T extends CdmBase> UUID remoteSave(IService<T> service, T cdmBase) {
+        return service.save(cdmBase).getUuid();
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#update(eu.etaxonomy.cdm.api.service.IService, eu.etaxonomy.cdm.model.common.CdmBase)
+     */
+    @Override
+    public <T extends CdmBase> T remoteUpdate(IService<T> service, T cdmBase) {
+        return cdmBase;
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#getOwner()
+     */
+    @Override
+    public ICdmEntitySessionEnabled getOwner() {
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#getCacheStatistics()
+     */
+    @Override
+    public LiveCacheStatistics getCacheStatistics() {
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#isActive()
+     */
+    @Override
+    public boolean isActive() {
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#getRootEntities()
+     */
+    @Override
+    public <T extends CdmBase> List<T> getRootEntities() {
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#debug(java.util.List)
+     */
+    @Override
+    public <T extends CdmBase> EntityCacherDebugResult debug(Collection<T> cdmBase) {
+
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#debug()
+     */
+    @Override
+    public <T extends CdmBase> EntityCacherDebugResult debug() {
+
+        return null;
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#update()
+     */
+    @Override
+    public <T extends CdmBase> void update() {
+        // TODO Auto-generated method stub
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(eu.etaxonomy.cdm.api.service.UpdateResult, boolean)
+     */
+    @Override
+    public UpdateResult load(UpdateResult updateResult, boolean update) {
+        return updateResult;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#getPropertyPath(java.lang.Class)
+     */
+    @Override
+    public List<String> getPropertyPaths(Object obj) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#addNewCdmEntity(eu.etaxonomy.cdm.model.common.CdmBase)
+     */
+    @Override
+    public void addNewCdmEntity(CdmBase newEntity) {
+        // TODO Auto-generated method stub
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#load(eu.etaxonomy.cdm.persistence.dto.MergeResult, boolean)
+     */
+    @Override
+    public <T extends CdmBase> MergeResult<T> load(MergeResult<T> mergeResult, boolean update) {
+        return mergeResult;
+    }
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/mock/MockCdmEntitySessionManager.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/mock/MockCdmEntitySessionManager.java
new file mode 100644 (file)
index 0000000..263efab
--- /dev/null
@@ -0,0 +1,146 @@
+package eu.etaxonomy.taxeditor.session.mock;
+
+import java.util.Collection;
+
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManagerObserver;
+
+
+public class MockCdmEntitySessionManager implements ICdmEntitySessionManager {
+
+
+       @Override
+       public void bind(ICdmEntitySessionEnabled sessionOwner) {
+       }
+
+       @Override
+       public <T> T load(T obj, boolean update) {
+               return obj;
+       }
+
+       @Override
+       public <T extends CdmBase> T load(T obj, boolean update) {
+               return obj;
+       }
+
+
+       @Override
+       public <T extends CdmBase> Collection<T> load(Collection<T> cdmBaseList, boolean update) {
+               return cdmBaseList;
+       }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#newSession(eu.etaxonomy.taxeditor.session.ISessionEventListener, boolean)
+     */
+    @Override
+    public ICdmEntitySession newSession(ICdmEntitySessionEnabled sessionOwner, boolean setAsActive) {
+        return new MockCdmEntitySession();
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#getActiveSession()
+     */
+    @Override
+    public ICdmEntitySession getActiveSession() {
+        return new MockCdmEntitySession();
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#getSessions()
+     */
+    @Override
+    public Collection<ICdmEntitySession> getSessions() {
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#addSessionObserver(eu.etaxonomy.taxeditor.session.ICdmEntitySessionManagerObserver)
+     */
+    @Override
+    public void addSessionObserver(ICdmEntitySessionManagerObserver sessionObserver) {
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#isRemoting()
+     */
+    @Override
+    public boolean isRemoting() {
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#dispose(eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled)
+     */
+    @Override
+    public void dispose(ICdmEntitySessionEnabled owner) {
+
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#disposeAll()
+     */
+    @Override
+    public void disposeAll() {
+
+
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#update()
+     */
+    @Override
+    public <T extends CdmBase> void update() {
+        // TODO Auto-generated method stub
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#load(eu.etaxonomy.cdm.api.service.UpdateResult, boolean)
+     */
+    @Override
+    public UpdateResult load(UpdateResult updateResult, boolean update) {
+        return updateResult;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#contains(eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled)
+     */
+    @Override
+    public boolean contains(ICdmEntitySessionEnabled sessionOwner) {
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#bindNullSession(eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled)
+     */
+    @Override
+    public ICdmEntitySession bindNullSession() {
+        return new MockCdmEntitySession();
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#getNullSession()
+     */
+    @Override
+    public ICdmEntitySession getNullSession() {
+        return new MockCdmEntitySession();
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#load(eu.etaxonomy.cdm.persistence.dto.MergeResult, boolean)
+     */
+    @Override
+    public MergeResult load(MergeResult mergeResult, boolean update) {
+        return mergeResult;
+    }
+
+}
index 1bc42c44fbef5dc66862dd34bcc8e7793e529717..e37e53034929c7e339fea7df90b0034a01cf7f34 100644 (file)
 package org.hibernate.collection.internal;
 
 import java.io.Serializable;
+import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.ListIterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
 
 import javax.naming.NamingException;
 
@@ -63,20 +59,45 @@ import org.hibernate.pretty.MessageHelper;
 import org.hibernate.type.Type;
 import org.jboss.logging.Logger;
 
-import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
-import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
-import eu.etaxonomy.cdm.api.service.ICommonService;
-import eu.etaxonomy.cdm.model.common.PersistentMultiLanguageText;
+import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteConfiguration;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.taxeditor.remoting.CdmEagerLoadingException;
+import eu.etaxonomy.taxeditor.remoting.cache.ProxyUtils;
+import eu.etaxonomy.taxeditor.service.ICachedCommonService;
 
 /**
  * Base class implementing {@link org.hibernate.collection.spi.PersistentCollection}
  *
+ * This a extended copy of the original class from hibernate. It has been extended to
+ * allow making remote service calls to spring httpinvoker services (see section at the bottom
+ * of this class).
+ *
+ *
  * @author Gavin King
+ * @author Cherian Mathew
  */
 public abstract class AbstractPersistentCollection implements Serializable, PersistentCollection {
        private static final Logger log = Logger.getLogger( AbstractPersistentCollection.class );
 
-       private static final long serialVersionUID = -7238232378593030571L;
+       /**
+        * <b>IMPORTANT:</b><br>
+        * This serialVersionUID must be kept in sync with the serialVersionUID which is generated
+        * on the fly for serialized AbstractPersistentCollection objects coming from the httpInvoker
+        * service.
+        * This is most probably necessary after updating hibernate to a newer version. In any case
+        * it the need for updating this <code>serialVersionUID</code> becomes obvious when the attempt
+        * to connect to the server side fails with an  <code>InvalidClassException</code>:
+        *
+        * <pre>
+        * java.io.InvalidClassException: org.hibernate.collection.internal.AbstractPersistentCollection;
+        * local class incompatible:
+        * stream classdesc serialVersionUID = 2742261122392386159,
+        * local class serialVersionUID = -7238232378593030571
+        * </pre>
+        * The correct <code>serialVersionUID</code> is the <code>stream classdesc serialVersionUID</code>
+        * from the error message.
+        */
+       private static final long serialVersionUID = 2742261122392386159L;
 
        private transient SessionImplementor session;
        private boolean initialized;
@@ -239,11 +260,11 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
                if ( isTempSession ) {
                        // TODO: On the next major release, add an
                        // 'isJTA' or 'getTransactionFactory' method to Session.
-                       isJTA = session.getTransactionCoordinator()
+                       /*isJTA = session.getTransactionCoordinator()
                                        .getTransactionContext().getTransactionEnvironment()
                                        .getTransactionFactory()
-                                       .compatibleWithJtaSynchronization();
-
+                                       .compatibleWithJtaSynchronization();*/
+                       isJTA = session.getTransactionCoordinator().getTransactionCoordinatorBuilder().isJta();
                        if ( !isJTA ) {
                                // Explicitly handle the transactions only if we're not in
                                // a JTA environment.  A lazy loading temporary session can
@@ -596,26 +617,25 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
         * @throws LazyInitializationException if we cannot initialize
         */
        protected final void initialize(final boolean writing) {
-               // In remoting we are sure that session is null
-               // both when using property paths and switching off conversations
-               if(session == null && remoting) {
-                       remoteInitialize();
-               }
-
-               if ( initialized ) {
-                       return;
-               }
-
-
-               withTemporarySessionIfNeeded(
-                               new LazyInitializationWork<Object>() {
-                                       @Override
-                                       public Object doWork() {
-                                               session.initializeCollection( AbstractPersistentCollection.this, writing );
-                                               return null;
-                                       }
-                               }
-               );
+           if ( initialized ) {
+               return;
+           }
+
+           // In remoting we are sure that session is null
+           // both when using property paths and switching off conversations
+           if(session == null && remoting) {
+               remoteInitialize();
+           } else {
+               withTemporarySessionIfNeeded(
+                       new LazyInitializationWork<Object>() {
+                           @Override
+                           public Object doWork() {
+                               session.initializeCollection( AbstractPersistentCollection.this, writing );
+                               return null;
+                           }
+                       }
+                       );
+           }
        }
 
        private void throwLazyInitializationExceptionIfNotConnected() {
@@ -1284,17 +1304,12 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
        // readElementExistence(final Object element)
        // readElementByIndex(final Object index)
 
-       private static ICdmApplicationConfiguration configuration;
+       private static CdmApplicationRemoteConfiguration configuration;
        private static boolean remoting = false;
 
-       public static void setConfiguration(ICdmApplicationConfiguration conf) {
+       public static void setConfiguration(CdmApplicationRemoteConfiguration conf) {
+           remoting = true;
                configuration = conf;
-
-               if(conf instanceof CdmApplicationRemoteController) {
-                       remoting = true;
-               } else {
-                       remoting = false;
-               }
        }
 
 
@@ -1305,99 +1320,46 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
                        try {
                                String role = getRole();
                                String fieldName = role.substring(role.lastIndexOf(".") + 1);
-                               log.info("--> Remote Lazy Initializing " + getRole() + " , key : " + getKey() + " , field : " + fieldName);
+                               log.info("--> Remote Lazy Initializing Collection " + getRole() + " , owner : " + getOwner().getClass() + "/" + getKey() + " , field : " + fieldName);
                                Object owner = getOwner();
-
+                               CdmBase cdmBase;
+                               if(owner instanceof CdmBase) {
+                                   cdmBase = (CdmBase)owner;
+                               } else {
+                                   throw new HibernateException("Owner of persistent collection is not a cdm entity");
+                               }
                                if(configuration == null) {
                                        throw new HibernateException("CdmApplicationRemoteConfiguration not initialized (null)");
                                }
-                               ICommonService commonService = configuration.getCommonService();
-                               if(commonService == null) {
+                               ICachedCommonService cachedCommonService = configuration.getCachedCommonService();
+                               if(cachedCommonService == null) {
                                        throw new HibernateException("commonService not initialized (null)");
                                }
 
-//                             PersistentCollection col = commonService.initializeCollection(this);
-//                             afterInitialize();
-//
-//                             Class<?> clazz = getClass();
-//                             if (clazz != null) {
-//                                     CollectionField cf = getCollectionField(col);
-//                                     Field field = clazz.getDeclaredField(cf.getFieldName());
-//                                     field.setAccessible(true);
-//                                     field.set(this, cf.getCollection());
-//                             }
-                       } catch (Exception ex) {
-                               log.warn(ex.getMessage());
-                       }
-                       log.warn("This code is invalid");
-               }
-       }
-
+                               //Object obj = ProxyUtils.deproxy(cachedCommonService.initializeCollection(this));
+                               Object obj = ProxyUtils.deproxy(cachedCommonService.initializeCollection(cdmBase.getUuid(), fieldName));
+                               if(ProxyUtils.isProxy(obj)) {
+                                   throw new HibernateException("Persistent Collection initialized but is still a proxy");
+                               }
+                               afterInitialize();
+
+                               Class<?> clazz = getClass();
+                               if (clazz != null) {
+                                       //CollectionField cf = cachedCommonService.getCollectionField(col);
+                                       //cachedCommonService.updatePersistentCollection(cf);
+                                   Object collectionType = ProxyUtils.getCollectionType(obj);
+                                       Field field = clazz.getDeclaredField(collectionType.toString());
+                                       field.setAccessible(true);
+                                       field.set(this, obj);
+                                       ProxyUtils.setRoleValueInOwner(owner, role, obj);
 
-       private CollectionField getCollectionField(PersistentCollection pc) {
-               if(pc != null) {
-                       if(pc instanceof PersistentSet) {
-                               return new CollectionField(new HashSet((Set)pc), "set");
-                       }
-                       if(pc instanceof PersistentSortedSet) {
-                               return new CollectionField(new TreeSet((Set)pc), "set");
-                       }
-                       if(pc instanceof PersistentList) {
-                               return new CollectionField(new ArrayList((List)pc), "list");
-                       }
-                       if(pc instanceof PersistentMap || pc instanceof PersistentMultiLanguageText) {
-                               return new CollectionField(new HashMap((Map)pc), "map");
-                       }
-                       if(pc instanceof PersistentSortedMap) {
-                               return new CollectionField(new TreeMap((Map)pc), "map");
+                               }
+                       } catch (Exception ex) {
+                               throw new CdmEagerLoadingException(ex);
                        }
                }
-               return null;
        }
 
-       private String getCollectionFieldName(PersistentCollection pc) {
-               if(pc != null) {
-                       if(pc instanceof PersistentSet || pc instanceof PersistentSortedSet) {
-                               return "set";
-                       }
-                       if(pc instanceof PersistentList) {
-                               return "list";
-                       }
-                       if(pc instanceof PersistentMap || pc instanceof PersistentMultiLanguageText) {
-                               return "map";
-                       }
-               }
-               return null;
-       }
-
-       private class CollectionField {
-               private final Object col;
-               private final String fieldName;
-               public CollectionField(Object col, String fieldName) {
-                       this.col = col;
-                       this.fieldName = fieldName;
-               }
-
-               public Object getCollection() {
-                       return this.col;
-               }
-
-               public String getFieldName() {
-                       return this.fieldName;
-               }
-       }
-
-       public static boolean isInitialized(List list) {
-               return ((AbstractPersistentCollection)list).initialized;
-       }
-
-       public static boolean isInitialized(Map map) {
-               return ((AbstractPersistentCollection)map).initialized;
-       }
-
-       public static boolean isInitialized(Set set) {
-               return ((AbstractPersistentCollection)set).initialized;
-       }
 
 
 }
index 4d2db1551f9dc872e5a57a94573326f1870cb469..f9920b67822dd9f39d97619af4c6024a749053e5 100644 (file)
@@ -24,7 +24,6 @@
 package org.hibernate.proxy;
 
 import java.io.Serializable;
-import java.util.Set;
 
 import javax.naming.NamingException;
 
@@ -33,21 +32,17 @@ import org.hibernate.LazyInitializationException;
 import org.hibernate.Session;
 import org.hibernate.SessionException;
 import org.hibernate.TransientObjectException;
-import org.hibernate.collection.internal.AbstractPersistentCollection;
 import org.hibernate.engine.spi.EntityKey;
 import org.hibernate.engine.spi.SessionFactoryImplementor;
 import org.hibernate.engine.spi.SessionImplementor;
 import org.hibernate.internal.SessionFactoryRegistry;
 import org.hibernate.persister.entity.EntityPersister;
 import org.jboss.logging.Logger;
-import org.springframework.beans.factory.annotation.Autowire;
-import org.springframework.beans.factory.annotation.Configurable;
-import org.springframework.stereotype.Component;
 
-import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
-import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
-import eu.etaxonomy.cdm.api.service.ICommonService;
+import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteConfiguration;
 import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.taxeditor.remoting.cache.ProxyUtils;
+import eu.etaxonomy.taxeditor.service.ICachedCommonService;
 
 /**
  * Convenience base class for lazy initialization handlers.  Centralizes the basic plumbing of doing lazy
@@ -56,8 +51,6 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
  *
  * @author Gavin King
  */
-@Component
-@Configurable(dependencyCheck = true,autowire = Autowire.BY_TYPE)
 public abstract class AbstractLazyInitializer implements LazyInitializer {
        private static final Logger log = Logger.getLogger( AbstractLazyInitializer.class );
 
@@ -207,14 +200,16 @@ public abstract class AbstractLazyInitializer implements LazyInitializer {
                                SessionFactoryImplementor sf = (SessionFactoryImplementor)
                                                SessionFactoryRegistry.INSTANCE.getSessionFactory( sessionFactoryUuid );
                                SessionImplementor session = (SessionImplementor) sf.openSession();
-                               
+
                                // TODO: On the next major release, add an
                                // 'isJTA' or 'getTransactionFactory' method to Session.
-                               boolean isJTA = session.getTransactionCoordinator()
+                               /*boolean isJTA = session.getTransactionCoordinator()
                                                .getTransactionContext().getTransactionEnvironment()
                                                .getTransactionFactory()
                                                .compatibleWithJtaSynchronization();
-                               
+                               */
+                               boolean isJTA = session.getTransactionCoordinator().getTransactionCoordinatorBuilder().isJta();
+
                                if ( !isJTA ) {
                                        // Explicitly handle the transactions only if we're not in
                                        // a JTA environment.  A lazy loading temporary session can
@@ -422,48 +417,46 @@ public abstract class AbstractLazyInitializer implements LazyInitializer {
        public void setUnwrap(boolean unwrap) {
                this.unwrap = unwrap;
        }
-       
+
        /** Below is section of code which makes remote service calls */
-       
-       private static ICdmApplicationConfiguration configuration;
+
+       private static CdmApplicationRemoteConfiguration configuration;
        private static boolean remoting = false;
-       
-       public static void setConfiguration(ICdmApplicationConfiguration conf) {
-               configuration = conf;
-               
-               if(conf instanceof CdmApplicationRemoteController) {
-                       remoting = true;
-               } else {
-                       remoting = false;
-               }
+
+       public static void setConfiguration(CdmApplicationRemoteConfiguration conf) {
+           remoting = true;
+           configuration = conf;
        }
-       
-       
-       private void remoteInitialize() {               
-               
-               if(!initialized) {                              
+
+
+       private void remoteInitialize() {
+
+               if(!initialized) {
                        int classid = ((Integer)getIdentifier()).intValue();
-                       log.debug("--> Remote Lazy Initializing" + getEntityName() + " with id " + classid);
+                       log.info("--> Remote Lazy Initializing Object " + getEntityName() + " with id " + classid);
                        Class clazz;
                        try {
-                               clazz = (Class<? extends CdmBase>) Class.forName(getEntityName());
+                               clazz = Class.forName(getEntityName());
                        } catch (ClassNotFoundException e) {
                                throw new HibernateException("Class for " + getEntityName() + " not found", e);
                        }
                        if(configuration == null) {
                                throw new HibernateException("CdmApplicationRemoteConfiguration not initialized (null)");
                        }
-                       ICommonService commonService = configuration.getCommonService();
-                       if(commonService == null) {
+                       ICachedCommonService cachedCommonService = configuration.getCachedCommonService();
+                       if(cachedCommonService == null) {
                                throw new HibernateException("commonService not initialized (null)");
                        }
-                       
-                       CdmBase cdmBase = CdmBase.deproxy(commonService.find(clazz,classid),clazz);
+
+                       CdmBase cdmBase = cachedCommonService.find(clazz,classid);
+            if(ProxyUtils.isProxy(cdmBase)) {
+                throw new HibernateException("CdmBase Object initialized but is still a proxy");
+            }
                        setImplementation(cdmBase);
-                       
+
                }
        }
-       
+
        public static boolean isInitialized(AbstractLazyInitializer obj) {
                return obj.initialized;
        }
index e3c0f9fd8ef75e7c6a175a3d9c1a5fd0d74c6dba..1451f372184243e1413cf848d4e15672249d473d 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>\r
 <beans xmlns="http://www.springframework.org/schema/beans"\r
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-       xmlns:context="http://www.springframework.org/schema/context"\r
-       xmlns:tx="http://www.springframework.org/schema/tx"\r
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
-    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd\r
-    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">\r
-\r
-       \r
-   <bean id="agentService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/agent.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IAgentService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="annotationService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/annotation.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IAnnotationService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="auditeventService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/auditevent.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IAuditEventService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="classificationService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/classification.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IClassificationService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="collectionService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/collection.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.ICollectionService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="commonService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/common.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.ICommonService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="descriptionService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/description.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IDescriptionService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-       \r
-   <bean id="editGeoService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/editgeo.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.ext.geo.IEditGeoService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="featureNodeService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/featurenode.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IFeatureNodeService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="featureTreeService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/featuretree.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IFeatureTreeService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="groupService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/group.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IGroupService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="identificationKeyService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/identificationkey.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IIdentificationKeyService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="locationService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/location.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.ILocationService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="markerService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/marker.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IMarkerService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="mediaService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/media.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IMediaService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="nameService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/name.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.INameService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="occurrenceService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/occurrence.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IOccurrenceService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="polytomousKeyNodeService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/polytomouskeynode.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="polytomousKeyService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/polytomouskey.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IPolytomousKeyService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="referenceService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/reference.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IReferenceService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-       \r
-<!-- \r
-   <bean id="serviceService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/service.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IService</value>\r
-               </property>\r
-       </bean>\r
- -->\r
\r
-   <bean id="taxonNodeService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/taxonnode.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.ITaxonNodeService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="taxonService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/taxon.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.ITaxonService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="termService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/term.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.ITermService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="userService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/user.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IUserService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="vocabularyService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/vocabulary.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IVocabularyService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-   <bean id="workingSetService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/workingset.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IWorkingSetService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-       \r
-   <bean id="grantedAuthorityService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/grantedauthority.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IGrantedAuthorityService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-       \r
-   <bean id="databaseService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/database.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.IDatabaseService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-       \r
-   <bean id="lsidAuthorityService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/lsidauthoruty.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.lsid.LSIDAuthorityService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-       \r
-   <bean id="lsidMetadataService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/lsidmetadata.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.lsid.LSIDMetadataService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-       \r
-   <bean id="lsiDataService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/lsiddata.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.lsid.LSIDDataService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-\r
-       <bean id="providerManager"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/authenticationManager.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>org.springframework.security.authentication.AuthenticationManager</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-       \r
-       <bean id="primerService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/primer.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.molecular.IPrimerService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-       \r
-       <bean id="amplificationService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/amplification.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.molecular.IAmplificationService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
-       \r
-       <bean id="sequenceService"\r
-               class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
-               <property name="serviceUrl">\r
-                       <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/sequence.service</value>\r
-               </property>\r
-               <property name="serviceInterface">\r
-                       <value>eu.etaxonomy.cdm.api.service.molecular.ISequenceService</value>\r
-               </property>\r
-               <property name="httpInvokerRequestExecutor">\r
-                       <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
-               </property>\r
-       </bean>\r
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"\r
+  xmlns:tx="http://www.springframework.org/schema/tx"\r
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd\r
+    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd\r
+    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">\r
+\r
+\r
+  <bean id="agentService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/agent.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IAgentService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="annotationService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/annotation.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IAnnotationService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="auditeventService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/auditevent.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IAuditEventService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="classificationService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/classification.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IClassificationService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="collectionService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/collection.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.ICollectionService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="commonService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/common.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.ICommonService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="descriptionService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/description.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IDescriptionService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="editGeoService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/editgeo.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.ext.geo.IEditGeoService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="featureNodeService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/featurenode.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IFeatureNodeService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="featureTreeService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/featuretree.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IFeatureTreeService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="groupService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/group.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IGroupService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="identificationKeyService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/identificationkey.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IIdentificationKeyService\r
+      </value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="locationService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/location.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.ILocationService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="markerService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/marker.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IMarkerService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="mediaService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/media.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IMediaService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="nameService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/name.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.INameService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="occurrenceService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/occurrence.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IOccurrenceService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="polytomousKeyNodeService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/polytomouskeynode.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService\r
+      </value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="polytomousKeyService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/polytomouskey.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IPolytomousKeyService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="referenceService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/reference.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IReferenceService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="taxonNodeService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/taxonnode.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.ITaxonNodeService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="taxonService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/taxon.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.ITaxonService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="termService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/term.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.ITermService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.TermServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="userService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting-public/user.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IUserService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="vocabularyService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/vocabulary.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IVocabularyService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="workingSetService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/workingset.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IWorkingSetService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="grantedAuthorityService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/grantedauthority.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IGrantedAuthorityService\r
+      </value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="databaseService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/database.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IDatabaseService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="lsidAuthorityService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/lsidauthoruty.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.lsid.LSIDAuthorityService\r
+      </value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="lsidMetadataService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/lsidmetadata.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.lsid.LSIDMetadataService\r
+      </value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="lsiDataService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/lsiddata.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.lsid.LSIDDataService</value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+\r
+\r
+  <bean id="primerService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/primer.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.molecular.IPrimerService\r
+      </value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="amplificationService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/amplification.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.molecular.IAmplificationService\r
+      </value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="sequenceService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/sequence.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.molecular.ISequenceService\r
+      </value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="eventBaseService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/eventbase.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IEventBaseService\r
+      </value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="entityValidationService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/entityvalidation.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IEntityValidationService\r
+      </value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="entityConstraintViolationService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/entityconstraintviolation.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.IEntityConstraintViolationService\r
+      </value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+  \r
+  <bean id="ioService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/io.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.io.service.IIOService\r
+      </value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmAuthenticatedHttpInvokerRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="testService" lazy-init="true"\r
+    class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
+    <property name="serviceUrl">\r
+      <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/test.service\r
+      </value>\r
+    </property>\r
+    <property name="serviceInterface">\r
+      <value>eu.etaxonomy.cdm.api.service.ITestService\r
+      </value>\r
+    </property>\r
+    <property name="httpInvokerRequestExecutor">\r
+      <bean class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor">\r
+        <property name="readTimeout" value="0" />\r
+      </bean>\r
+    </property>\r
+\r
+  </bean>\r
 \r
 \r
 \r
index 524d83c4ddd1ff18324aa3de9035021bdb620b29..f09d0c992267aad02f7cee2b7af1d28d7d9cb05e 100644 (file)
@@ -1,31 +1,37 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:context="http://www.springframework.org/schema/context"
-       xmlns:tx="http://www.springframework.org/schema/tx"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+  xmlns:tx="http://www.springframework.org/schema/tx"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
     http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd">
-       
-       
-    <!-- Default application context and term initializer -->
-  <import resource="classpath:/eu/etaxonomy/cdm/defaultApplicationContext.xml"/>
+
+  
+  <!-- Default application context and term initializer -->
+  <import resource="classpath:/eu/etaxonomy/cdm/defaultApplicationContext.xml" />
   <bean id="persistentTermInitializer" class="eu.etaxonomy.cdm.database.PersistentTermInitializer">
     <property name="omit" value="false" />
   </bean>
-    
-  <import resource="classpath:/eu/etaxonomy/cdm/remote.xml"/>
-  <import resource="classpath:eu/etaxonomy/cdm/remote/json/jsonConfigurations.xml"/>
-  
-  <context:component-scan base-package="eu/etaxonomy/cdm/ext"/>
-  
+
+  <context:component-scan base-package="eu/etaxonomy/taxeditor/session" />
+  <import resource="classpath:/eu/etaxonomy/cdm/remote.xml" />
+  <import resource="classpath:eu/etaxonomy/cdm/remote/json/jsonConfigurations.xml" />
+
+  <context:component-scan base-package="eu/etaxonomy/cdm/ext" />
+
   <context:component-scan base-package="eu/etaxonomy/cdm/remote">
-    <context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.remote\.config\.DataSourceConfigurer" />
-    <context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.remote\.config\.LoggingConfigurer" />
-    <context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.remote\.view\.PatternViewResolver" />
-    <context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.remote\.vaadin\..*" />
-    <context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.remote\.controller\..*Portal.*" /> 
+    <context:exclude-filter type="regex"
+      expression="eu\.etaxonomy\.cdm\.remote\.config\.DataSourceConfigurer" />
+    <context:exclude-filter type="regex"
+      expression="eu\.etaxonomy\.cdm\.remote\.config\.LoggingConfigurer" />
+    <context:exclude-filter type="regex"
+      expression="eu\.etaxonomy\.cdm\.remote\.view\.PatternViewResolver" />
+    <context:exclude-filter type="regex"
+      expression="eu\.etaxonomy\.cdm\.remote\.vaadin\..*" />
+    <context:exclude-filter type="regex"
+      expression="eu\.etaxonomy\.cdm\.remote\.controller\..*Portal.*" />
   </context:component-scan>
-  
+
+  <context:component-scan base-package="eu/etaxonomy/taxeditor/remoting/session/mock" />
 
 </beans>
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/mappings/hibernate.cfg.xml b/eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/mappings/hibernate.cfg.xml
new file mode 100644 (file)
index 0000000..e48ff8a
--- /dev/null
@@ -0,0 +1,213 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE hibernate-configuration PUBLIC\r
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"\r
+ "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">\r
+\r
+<hibernate-configuration>\r
+    <session-factory>\r
+\r
+      <property name="connection.release_mode">after_transaction</property>\r
+\r
+      <!-- Connection Pooling -->\r
+<!--       <property name="hibernate.connection.provider_class">org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider</property> -->\r
+      <property name="hibernate.connection.provider_class">org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl</property>\r
+           <!--\r
+          Configuring the C3P0ConnectionProvider\r
+          ========================================\r
+          see http://www.mchange.com/projects/c3p0/index.html#hibernate-specific\r
+          and also org.springframework.orm.hibernate3.AbstractSessionFactoryBean.setDataSource(DataSource dataSource)\r
+\r
+          IMPORTANT:\r
+          Because of the constraint (1) the org.hibernate.connection.C3P0ConnectionProvider are not be used\r
+          for the Cdm Library because it requires the dataSource bean in some cases.\r
+\r
+          (1)\r
+          Do NOT specify the dataSource in the sessionFactory for example in the\r
+          org.springframework.orm.hibernate3.LocalSessionFactoryBean\r
+          !!!==> If *dataSource* is set, this will override corresponding settings in Hibernate properties.!!!\r
+                         If this is set, the Hibernate settings should not define a connection provider to\r
+                     avoid meaningless double configuration.\r
+          (2)\r
+          Hibernate uses the hibernate.c3p0.max_size property to determine if c3p0\r
+          is beeing used.  Therefore the max_size property MUST be set. - maybe not need in hibernate 3.4 +\r
+\r
+          (3) If you are using Hibernate's C3P0ConnectionProvider you must set the following properties\r
+          in your hibernate configuration, using hibernate-specific configuration keys.\r
+          All other properties must be defined as usual in a c3p0.properties file.\r
+          This is confusing, and will hopefully be simplified some time in the future, but for now...\r
+          \r
+          DOCUMENTATION UPDATE (2015-05-22):\r
+          Hibernate's C3P0ConnectionProvider renames 7 c3p0 configuration properties, which, \r
+          if set in your hibernate configuration, will override any configuration you may have set \r
+          in a c3p0.properties file.\r
+          TODO: are points (2) and (3) still valid? I don't think so! (AK)\r
+\r
+            hibernate.c3p0.acquire_increment\r
+                       hibernate.c3p0.idle_test_period\r
+                       hibernate.c3p0.timeout\r
+                       hibernate.c3p0.max_size\r
+                       hibernate.c3p0.max_statements\r
+                       hibernate.c3p0.min_size\r
+                       hibernate.c3p0.validate\r
+      -->\r
+      <mapping package="eu.etaxonomy.cdm.model.common"/>\r
+      <!-- Annotation Package -->\r
+      <mapping class="eu.etaxonomy.cdm.model.agent.Address"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.agent.AgentBase"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.agent.Contact"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.agent.Institution"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.agent.InstitutionalMembership"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.agent.Person"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.agent.Team"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.agent.TeamOrPersonBase"/>\r
+      <!-- Common Package -->\r
+      <mapping class="eu.etaxonomy.cdm.model.common.Annotation"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.AnnotationType"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.Credit"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.DefinedTerm"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.DefinedTermBase"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.Extension"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.ExtensionType"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.IdentifiableSource"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.Identifier"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.IntextReference"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.Group"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.Language"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.LanguageString"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.LSID"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.LSIDAuthority"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.Marker"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.MarkerType"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.OrderedTerm"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.OrderedTermBase"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.OrderedTermVocabulary"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.OriginalSourceBase"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.RelationshipTermBase"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.Representation"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.TermVocabulary"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.common.User"/>\r
+      <!-- Description Package -->\r
+      <mapping class="eu.etaxonomy.cdm.model.description.CategoricalData"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.CommonTaxonName"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionBase"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionElementBase"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionElementSource"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.Distribution"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.Feature"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.FeatureNode"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.FeatureTree"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.KeyStatement"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.MediaKey"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.IndividualsAssociation"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.MeasurementUnit"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.MultiAccessKey"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.PolytomousKey"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.PolytomousKeyNode"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.QuantitativeData"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.SpecimenDescription"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.State"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.StateData"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.StatisticalMeasure"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.TaxonDescription"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.TaxonInteraction"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.TaxonNameDescription"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.TextData"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.TextFormat"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.description.WorkingSet"/>\r
+      <!-- Location Package -->\r
+      <mapping class="eu.etaxonomy.cdm.model.location.NamedArea"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.location.NamedAreaLevel"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.location.NamedAreaType"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.location.ReferenceSystem"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.location.Point"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.location.Country"/>\r
+      <!-- Media Package -->\r
+      <mapping class="eu.etaxonomy.cdm.model.media.AudioFile"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.media.ImageFile"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.media.Media"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.media.MediaRepresentation"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.media.MediaRepresentationPart"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.media.MovieFile"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.media.Rights"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.media.RightsType"/>\r
+      <!-- Meta Data Package -->\r
+      <mapping class="eu.etaxonomy.cdm.model.metadata.CdmMetaData"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.metadata.CdmPreference"/>\r
+      <!-- Molecular Package -->\r
+      <mapping class="eu.etaxonomy.cdm.model.molecular.PhylogeneticTree"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.molecular.DnaQuality"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.molecular.DnaSample"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.molecular.Amplification"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.molecular.AmplificationResult"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.molecular.Primer"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.molecular.Sequence"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.molecular.SequenceString"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.molecular.SingleRead"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.molecular.SingleReadAlignment"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.molecular.Cloning"/>\r
+      <!-- Name Package -->\r
+      <mapping class="eu.etaxonomy.cdm.model.name.BacterialName"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.BotanicalName"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.CultivarPlantName"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.HomotypicalGroup"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.HybridRelationship"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.HybridRelationshipType"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.NameRelationship"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.NameRelationshipType"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.NameTypeDesignation"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalCode"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalStatus"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalStatusType"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.NonViralName"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.Rank"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.TaxonNameBase"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.TypeDesignationBase"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.ViralName"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.name.ZoologicalName"/>\r
+      <!-- Occurrence Package -->\r
+      <mapping class="eu.etaxonomy.cdm.model.occurrence.Collection"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.occurrence.DerivationEvent"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.occurrence.DerivationEventType"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.occurrence.DerivedUnit"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.occurrence.MaterialOrMethodEvent"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.occurrence.MediaSpecimen"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.occurrence.DeterminationEvent"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.occurrence.FieldUnit"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.occurrence.GatheringEvent"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.occurrence.PreservationMethod"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase"/>\r
+      <!-- Reference Package -->\r
+      <mapping class="eu.etaxonomy.cdm.model.reference.Reference"/>\r
+\r
+      <!-- Taxon Package -->\r
+      <mapping class="eu.etaxonomy.cdm.model.taxon.Synonym"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.taxon.SynonymRelationship"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.taxon.Taxon"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonBase"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonNode"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonNodeAgentRelation"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.taxon.Classification"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonRelationship"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType"/>\r
+      \r
+      <!-- Validation Package -->\r
+      <mapping class="eu.etaxonomy.cdm.model.validation.EntityValidation"/>\r
+      <mapping class="eu.etaxonomy.cdm.model.validation.EntityConstraintViolation"/>\r
+      \r
+      <!-- View Package -->\r
+      <mapping class="eu.etaxonomy.cdm.model.view.AuditEvent"/>\r
+      \r
+      <!-- for filling caches -->\r
+      <!-- since hibernate 4 listeners are not handled via hibernate.cfg.xml anymore -->\r
+      <!--  http://stackoverflow.com/questions/8616146/eventlisteners-using-hibernate-4-0-with-spring-3-1-0-release\r
+            https://community.jboss.org/wiki/HibernateCoreMigrationGuide40 -->\r
+\r
+    </session-factory>\r
+</hibernate-configuration>
\ No newline at end of file
index e67e9b4534c51d886c6815d8e473d40bdebce036..604b197fbf54a92f9dd9fe280cbd241fd55c9ddf 100644 (file)
@@ -1,40 +1,81 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <beans xmlns="http://www.springframework.org/schema/beans"\r
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-       xmlns:context="http://www.springframework.org/schema/context"\r
-       xmlns:tx="http://www.springframework.org/schema/tx"\r
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
-    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
-    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd">\r
-       \r
-       \r
-    <!--  <bean id="remoteTermInitializer" class="eu.etaxonomy.cdm.remote.service.RemoteTermInitializer"/>-->\r
-        \r
-       <context:annotation-config/>\r
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"\r
+  xmlns:tx="http://www.springframework.org/schema/tx"\r
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
+    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
+    http://www.springframework.org/schema/context  http://www.springframework.org/schema/context/spring-context-3.1.xsd">\r
+\r
+  <import resource="classpath:/eu/etaxonomy/cdm/httpInvokerServiceClients.xml" />\r
+\r
+  <bean id="cdmEntitySessionManager"  \r
+    class="eu.etaxonomy.taxeditor.session.CdmEntitySessionManager" />\r
+\r
+  <bean id="cdmApplicationRemoteConfiguration" \r
+    class="eu.etaxonomy.cdm.api.application.CdmApplicationRemoteConfiguration" />\r
+\r
+  \r
+  <bean id="cdmServiceRequestExecutor" \r
+    class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
+    \r
+  <bean id="cachedCommonService" \r
+    class="eu.etaxonomy.taxeditor.service.CachedCommonServiceImpl" />\r
+    \r
+  \r
+  <bean id="defaultExport"\r
+    class="eu.etaxonomy.cdm.io.common.CdmApplicationAwareDefaultExport" />\r
     \r
-    <import resource="classpath:/eu/etaxonomy/cdm/httpInvokerServiceClients.xml"/>\r
+  <bean id="jaxbExport"\r
+    class="eu.etaxonomy.cdm.io.jaxb.JaxbExport" />\r
     \r
-    <bean id="cdmApplicationRemoteConfiguration" class="eu.etaxonomy.cdm.api.application.CdmApplicationRemoteConfiguration"/>    \r
+  <bean id="accessDecisionManager" \r
+    class="eu.etaxonomy.cdm.persistence.hibernate.permission.UnanimousBasedUnrevokable" >\r
     \r
-       <import resource="classpath:/eu/etaxonomy/cdm/remoting_services_security.xml"/>         \r
-       \r
-       <bean id="cdmTermCacher" class="eu.etaxonomy.cdm.api.cache.CdmTermCacher"/>\r
-       \r
-       \r
-       <!-- EditGeoService was moved to ext. Therefore it will not be found by the default component scan.
-       We added it here because the Editor needs it. However, this is only a temporary solution.
-       In the future we want to pass in an application context with the editor. -->\r
-\r
-\r
-       <!-- <bean id="conversationHolder" class="eu.etaxonomy.cdm.api.conversation.ConversationHolder" scope="prototype"/> -->\r
-\r
-       <!-- TODO move to io -->\r
-<!-- \r
-       <context:component-scan base-package="eu/etaxonomy/cdm/io">\r
-               <context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.io\.berlinModel.*" />\r
-       </context:component-scan>\r
- -->\r
-       <!-- enable the configuration of transactional behavior based on annotations -->\r
-       <!-- <tx:annotation-driven transaction-manager="transactionManager"/> -->\r
+    <property name="decisionVoters">\r
+      <list>\r
+        <bean\r
+          class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.GrantAlwaysVoter" />\r
+        <bean\r
+          class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.TaxonNodeVoter" />\r
+        <bean\r
+          class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.TaxonBaseVoter" />\r
+        <bean\r
+          class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.DescriptionBaseVoter" />\r
+        <bean\r
+          class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.DescriptionElementVoter" />\r
+      </list>\r
+    </property>\r
+  </bean>\r
+\r
+  <!-- CdmPermissionEvaluator.hasPermissions() evaluates the CdmPermissions \r
+    like TAXONNODE.UPDATE{20c8f083-5870-4cbd-bf56-c5b2b98ab6a7} -->\r
+  <bean id="cdmPermissionEvaluator" \r
+    class="eu.etaxonomy.cdm.persistence.hibernate.permission.CdmPermissionEvaluator">\r
+    <property name="accessDecisionManager" ref="accessDecisionManager" />\r
+  </bean>\r
+\r
+  <bean id="authenticationManager"\r
+    class="org.springframework.security.authentication.ProviderManager">\r
+    <property name="providers">\r
+      <list>\r
+        <ref local="daoAuthenticationProvider" />\r
+      </list>\r
+    </property>\r
+  </bean>\r
+\r
+  <bean id="daoAuthenticationProvider" \r
+    class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">\r
+    <property name="userDetailsService" ref="userService" />\r
+    <property name="saltSource" ref="saltSource" />\r
+    <property name="passwordEncoder" ref="passwordEncoder" />\r
+  </bean>\r
+\r
+  <bean id="passwordEncoder" \r
+    class="org.springframework.security.authentication.encoding.Md5PasswordEncoder" />\r
+\r
+  <bean id="saltSource" \r
+    class="org.springframework.security.authentication.dao.ReflectionSaltSource">\r
+    <property name="userPropertyToUse" value="getUsername" />\r
+  </bean>\r
 \r
 </beans>\r
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/remoting_persistence_security.xml b/eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/remoting_persistence_security.xml
deleted file mode 100644 (file)
index d70bca5..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"\r
-  xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"\r
-  xsi:schemaLocation="http://www.springframework.org/schema/beans\r
-    http://www.springframework.org/schema/beans/spring-beans-3.2.xsd\r
-    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd\r
-    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd\r
-    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd\r
-    ">\r
-\r
-\r
-    <!--\r
-      ============================== SECURITY ==============================\r
-    -->\r
-    <bean id="accessDecisionManager" class="eu.etaxonomy.cdm.persistence.hibernate.permission.UnanimousBasedUnrevokable">\r
-        <property name="decisionVoters">\r
-            <list>\r
-                <bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.GrantAlwaysVoter" />\r
-                <bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.TaxonNodeVoter" />\r
-                <bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.TaxonBaseVoter" />\r
-                <bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.DescriptionBaseVoter" />\r
-                <bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.DescriptionElementVoter" />\r
-            </list>\r
-        </property>\r
-    </bean>\r
-\r
-    <!--\r
-        CdmPermissionEvaluator.hasPermissions() evaluates the CdmPermissions like TAXONNODE.UPDATE{20c8f083-5870-4cbd-bf56-c5b2b98ab6a7}\r
-    -->\r
-    <bean id="cdmPermissionEvaluator" class="eu.etaxonomy.cdm.persistence.hibernate.permission.CdmPermissionEvaluator">\r
-        <property name="accessDecisionManager" ref="accessDecisionManager" />\r
-    </bean>\r
-\r
-    <!-- The CdmSecurityHibernateInterceptor checks onSave() and on flushDirty() if the currently authenticated principal or token  has\r
-    sufficient permissions on the entity to be persisted -->\r
-    <bean id="securityHibernateInterceptor" class="eu.etaxonomy.cdm.persistence.hibernate.CdmSecurityHibernateInterceptor">\r
-        <property name="permissionEvaluator" ref="cdmPermissionEvaluator" />\r
-    </bean>\r
-\r
-</beans>\r
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/remoting_services_security.xml b/eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/remoting_services_security.xml
deleted file mode 100644 (file)
index 6a09db4..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xmlns:context="http://www.springframework.org/schema/context"\r
-  xmlns:security="http://www.springframework.org/schema/security"\r
-  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd\r
-    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd\r
-    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd\r
-    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"\r
-    >\r
-\r
-    <import resource="classpath:/eu/etaxonomy/cdm/remoting_persistence_security.xml"/>\r
-    <!--\r
-        ======================================================================\r
-          security specific configuration\r
-        ======================================================================\r
-     -->\r
-    <security:global-method-security pre-post-annotations="enabled" run-as-manager-ref="runAsManager" >\r
-        <security:expression-handler ref="expressionHandler" />\r
-    </security:global-method-security>\r
-\r
-    <!--\r
-        To use "hasPermission()" in the Spring EL method annotations like @PreAuthorize we explicitly configure the permissionEvaluator\r
-        the cdmPermissionEvaluator is already defined in the persistence security context\r
-    -->\r
-    <bean id="expressionHandler" class="org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler">\r
-        <property name="permissionEvaluator" ref="cdmPermissionEvaluator" />\r
-    </bean>\r
-\r
-    <bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager">\r
-        <property name="providers">\r
-            <list>\r
-                <ref local="daoAuthenticationProvider"/>\r
-            </list>\r
-        </property>\r
-    </bean>\r
-\r
-    <bean id="daoAuthenticationProvider" class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">\r
-        <property name="userDetailsService" ref="userService"/>\r
-        <property name="saltSource" ref="saltSource"/>\r
-        <property name="passwordEncoder" ref="passwordEncoder"/>\r
-    </bean>\r
-\r
-    <bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.Md5PasswordEncoder"/>\r
-\r
-    <bean id="saltSource" class="org.springframework.security.authentication.dao.ReflectionSaltSource">\r
-        <property name="userPropertyToUse" value="getUsername"/>\r
-    </bean>\r
-\r
-    <!--\r
-        Run-As Authentication Replacement for system operations\r
-        as e.g. performed by the eu.etaxonomy.cdm.api.application.FirstDataInserter\r
-\r
-        the key must match FirstDataInserter.RUN_AS_KEY\r
-     -->\r
-    <bean id="runAsManager"\r
-        class="org.springframework.security.access.intercept.RunAsManagerImpl">\r
-      <property name="key" value="TtlCx3pgKC4l"/>\r
-    </bean>\r
-\r
-\r
-</beans>\r
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/resources/log4j.xml b/eu.etaxonomy.taxeditor.cdmlib/src/main/resources/log4j.xml
new file mode 100644 (file)
index 0000000..14b670b
--- /dev/null
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
+  debug="false">
+  <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+    <param name="Target" value="System.out" />
+    <layout class="org.apache.log4j.PatternLayout">
+      <param name="ConversionPattern" value="%d %p [%c] - %m%n" />
+    </layout>
+    <filter class="org.apache.log4j.filter.ExpressionFilter">
+      <param name="expression"
+        value="msg like  '.*has a maxElementsInMemory of 0. This might lead to performance degradation or OutOfMemoryError at Terracotta client.*'" />
+      <param name="acceptOnMatch" value="false" />
+    </filter>
+    <filter class="org.apache.log4j.filter.ExpressionFilter">
+      <param name="expression"
+        value="msg like  '.*object references was reached while attempting to calculate the size of the object graph.*'" />
+      <param name="acceptOnMatch" value="false" />
+    </filter>
+  </appender>
+  <root>
+    <priority value="WARN" />
+    <appender-ref ref="CONSOLE" />
+  </root>
+<!--   <logger name="org.hibernate.proxy.AbstractLazyInitializer"> -->
+<!--     <level value="info" /> -->
+<!--   </logger> -->
+<!--   <logger -->
+<!--     name="org.hibernate.collection.internal.AbstractPersistentCollection"> -->
+<!--     <level value="info" /> -->
+<!--   </logger> -->
+<!--   <logger -->
+<!--     name="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor"> -->
+<!--     <level value="info" /> -->
+<!--   </logger> -->
+<!--   <logger -->
+<!--     name="eu.etaxonomy.taxeditor.session.DefaultNewEntityListener"> -->
+<!--     <level value="info" /> -->
+<!--   </logger> -->
+<!--     <logger -->
+<!--     name="eu.etaxonomy.taxeditor.util.ProgressMonitorClientManager"> -->
+<!--     <level value="info" /> -->
+<!--   </logger> -->
+</log4j:configuration>
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/test/resources/eu/etaxonomy/cdm/datasources/cdm.datasources.xml b/eu.etaxonomy.taxeditor.cdmlib/src/test/resources/eu/etaxonomy/cdm/datasources/cdm.datasources.xml
deleted file mode 100644 (file)
index f306cad..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:context="http://www.springframework.org/schema/context"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans 
-    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
-    http://www.springframework.org/schema/context
-    http://www.springframework.org/schema/context/spring-context-2.5.xsd">
-
-       <bean id="defaultRemoteSource">
-        <property name="server" value="127.0.0.1"/>
-        <property name="port" value="8080"/>
-        <property name="contextPath" value=""/>
-    </bean>        
-    
-    <bean id="incompleteRemoteSource">
-        <property name="server" value="127.0.0.1"/>
-        <property name="contextPath" value=""/>
-    </bean>      
-       
-</beans>
\ No newline at end of file
index 1389dff1f7b6604e2e9992e96b02938cad915866..13a030a921aeff76fcc5b7e9a4e2ef05c8eda717 100644 (file)
@@ -1,9 +1,9 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
-       <classpathentry including="**/*.java" kind="src" path="src/main/java"/>\r
-       <classpathentry including="**/*.java" kind="src" path="src/test/java"/>\r
-       <classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry including="**/*.java" kind="src" path="src/main/java"/>
+       <classpathentry including="**/*.java" kind="src" path="src/test/java"/>
+       <classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index d4471b24e77cb6f4e5a656b8fcce88e8d1df0757..661ab52e66651585625314e2e889ddbebe64674b 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Editor Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.editor;singleton:=true
-Bundle-Version: 3.8.0.qualifier
+Bundle-Version: 4.0.0.qualifier
 Bundle-Activator: eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: OSGI-INF/l10n/plugin
@@ -12,8 +12,9 @@ Export-Package: eu.etaxonomy.taxeditor.editor,
  eu.etaxonomy.taxeditor.editor.key.polytomous,
  eu.etaxonomy.taxeditor.editor.name,
  eu.etaxonomy.taxeditor.editor.name.handler,
+ eu.etaxonomy.taxeditor.editor.name.operation,
  eu.etaxonomy.taxeditor.editor.view.concept,
- eu.etaxonomy.taxeditor.editor.view.dataimport,
+ eu.etaxonomy.taxeditor.editor.view.derivate,
  eu.etaxonomy.taxeditor.editor.view.descriptive,
  eu.etaxonomy.taxeditor.editor.view.media,
  eu.etaxonomy.taxeditor.editor.view.uses
@@ -27,7 +28,7 @@ Require-Bundle: org.eclipse.ui,
  org.eclipse.zest.layouts,
  eu.etaxonomy.taxeditor.cdmlib,
  org.eclipse.ui.ide
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
 Bundle-ActivationPolicy: lazy
 Import-Package: org.eclipse.core.databinding.beans,
  org.eclipse.core.databinding.observable.list,
@@ -44,138 +45,3 @@ Import-Package: org.eclipse.core.databinding.beans,
  org.eclipse.zest.core.viewers,
  org.eclipse.zest.layouts,
  org.osgi.framework
-Bundle-ClassPath: .,
- activation-1.1.jar,
- antlr-2.7.6.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,
- dom4j-1.6.1.jar,
- dozer-5.3.0-sources.jar,
- dozer-5.3.0.jar,
- ehcache-1.2.3.jar,
- ejb3-persistence.jar,
- ezmorph-1.0.4.jar,
- fop.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,
- 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,
- 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,
- 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,
- servlet-api-2.5.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,
- xml-apis-ext-1.3.04.jar,
- xml-apis.jar,
- xml-resolver-1.2.jar,
- xmlgraphics-commons-1.3.1.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
diff --git a/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages.properties b/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages.properties
new file mode 100644 (file)
index 0000000..40a9a44
--- /dev/null
@@ -0,0 +1,41 @@
+CreateDerivateContextMenu_ADD=Add...
+CreateDerivateContextMenu_DNA_SAMPLE=DNA Sample
+CreateDerivateContextMenu_MEDIA=Media...
+CreateDerivateContextMenu_MEDIA_EXISTING=Use existing media item
+CreateDerivateContextMenu_MEDIA_SPECIMEN=Media item
+CreateDerivateContextMenu_NO_CHILD_DERIVATE=No child derivatives
+CreateDerivateContextMenu_SEQUENCE=Consensus Sequence
+CreateDerivateContextMenu_SINGLE_READ=Single Read
+CreateDerivateContextMenu_SPECIMEN=Specimen
+CreateDerivateContextMenu_TISSUE_SAMPLE=Tissue Sample
+
+SingleReadSequenceContextMenu_REMOVE_FROM_SEQUENCE=Remove from this Sequence
+SingleReadSequenceContextMenu_REUSE_FOR_SEQUENCE=Reuse for other Sequence
+SingleReadSequenceContextMenu_REUSE_SINGLE_READ_HERE=Reuse SingleRead here
+
+DerivateView_DERIVATIVE_EDITOR=Derivative Editor
+DerivateView_SAVING_HIERARCHY=Saving hierarchy
+DerivateView_UNSAVED_CHANGES=View has unsaved changes
+DerivateView_YOU_NEED_TO_SAVE=You need to save before performing this action
+
+DeleteDerivateOperation_AND_CHILDREN= and its children
+DeleteDerivateOperation_CONFIRM=Confirm Deletion
+DeleteDerivateOperation_DELETE_FAILED=Deletion failed
+DeleteDerivateOperation_REALLY_DELETE=Do you really want to delete the selected element
+
+DerivateDropListener_MOVE_TO=Moving "%s" to "%s"
+
+DerivateViewEditorInput_FAIL_INIT=Failed initializing editor
+DerivateViewEditorInput_NO_ROOT=No root element found\!
+
+MoveDerivateOperation_MOVE_NOT_POSSIBLE=Moving derivatives not possible\!
+MoveDerivateOperation_MOVE_TO_NOT_POSSIBLE=Moving "%s" to "%s" is not possible\!
+
+OpenDerivateEditorForTaxonHandler_COULD_NOT_OPEN_EDITOR=Could not open Derivative Editor
+OpenDerivateEditorForTaxonHandler_FAILED_TO_OPEN=Failed to open Editor
+OpenDerivateEditorForTaxonHandler_HIERARCHY_CORRUPTED=The derivative hierarchy is corrupted\!
+OpenDerivateEditorForTaxonHandler_NO_DERIVATIVES_FOUND=No Derivatives found
+
+DeleteTaxonBaseHandler_CONFIRM_DELETION=Confirm Deletion
+DeleteTaxonBaseHandler_ELEMENT_MUST_BE_SYNONYM_MISAPP_CONCEPT=Element has to be Synonym, Misapplication or Concept
+DeleteTaxonBaseHandler_REALLY_DELETE_TAXON=Are you sure you want to delete the selected taxon?
diff --git a/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages_de.properties b/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages_de.properties
new file mode 100644 (file)
index 0000000..cf767cd
--- /dev/null
@@ -0,0 +1,41 @@
+CreateDerivateContextMenu_ADD=Hinzufügen...
+CreateDerivateContextMenu_DNA_SAMPLE=DNA Probe
+CreateDerivateContextMenu_MEDIA=Media...
+CreateDerivateContextMenu_MEDIA_EXISTING=Vorhandendes Medienobjekt verwenden
+CreateDerivateContextMenu_MEDIA_SPECIMEN=Medienobjekt
+CreateDerivateContextMenu_NO_CHILD_DERIVATE=Keine Kind-Derivate
+CreateDerivateContextMenu_SEQUENCE=Konsensussequenz
+CreateDerivateContextMenu_SINGLE_READ=Single Read
+CreateDerivateContextMenu_SPECIMEN=Beleg
+CreateDerivateContextMenu_TISSUE_SAMPLE=Gewebeprobe
+
+SingleReadSequenceContextMenu_REMOVE_FROM_SEQUENCE=Von Sequenz entfernen
+SingleReadSequenceContextMenu_REUSE_FOR_SEQUENCE=Für andere Sequenz verwenden
+SingleReadSequenceContextMenu_REUSE_SINGLE_READ_HERE=SingleRead hier verwenden
+
+DerivateView_DERIVATIVE_EDITOR=Derivat-Editor
+DerivateView_SAVING_HIERARCHY=Speichere Hierarchie
+DerivateView_UNSAVED_CHANGES=Ungepeicherte Ã„nderungen
+DerivateView_YOU_NEED_TO_SAVE=Sie müssen speichern, um diese Aktion auszuführen
+
+DeleteDerivateOperation_CONFIRM=Löschen bestätigen
+DeleteDerivateOperation_DELETE_FAILED=Löschen fehlgeschlagen
+DeleteDerivateOperation_REALLY_DELETE=Wollen Sie wirklich das ausgewählte Element löschen
+DeleteDerivateOperation_AND_CHILDREN= (mit Kind-Elementen)
+
+DerivateDropListener_MOVE_TO=Verschiebe "%s" nach "%s"
+
+DerivateViewEditorInput_FAIL_INIT=Initialisierung des Editor fehlgeschlagen
+DerivateViewEditorInput_NO_ROOT=Kein Root-Element gefunden\!
+
+MoveDerivateOperation_MOVE_NOT_POSSIBLE=Verschieben von Derivaten nicht möglich\!
+MoveDerivateOperation_MOVE_TO_NOT_POSSIBLE=Verschieben von "%s" nach "%s" nicht möglich\!
+
+OpenDerivateEditorForTaxonHandler_COULD_NOT_OPEN_EDITOR=Konnte Derivat-Editor nicht Ã¶ffnen
+OpenDerivateEditorForTaxonHandler_FAILED_TO_OPEN=Öffnen des Editors fehlgeschlagen
+OpenDerivateEditorForTaxonHandler_HIERARCHY_CORRUPTED=Die Derivathierarchie ist korrumpiert\!
+OpenDerivateEditorForTaxonHandler_NO_DERIVATIVES_FOUND=Keine Derivate gefunden
+
+DeleteTaxonBaseHandler_CONFIRM_DELETION=Löschen bestätigen
+DeleteTaxonBaseHandler_ELEMENT_MUST_BE_SYNONYM_MISAPP_CONCEPT=Element muss Synonym, Misapplication oder Konzept sein
+DeleteTaxonBaseHandler_REALLY_DELETE_TAXON=Wollen Sie wirklich das ausgewählte Taxon löschen?
index 8281fca55730c8e4d81a2fa766ff092f498fea7d..8483db30b4dc6a2a6df02b75509ee7067bbb9912 100644 (file)
@@ -101,7 +101,6 @@ command.name.23 = New Reference
 command.name.24 = New Name\r
 command.name.25 = New Team\r
 command.name.26 = New Person\r
-command.name.27 = New Specimen\r
 category.name.5 = -- Polytomous Keys\r
 command.name.28 = New Child Node\r
 command.name.29 = New Sibling Node\r
@@ -149,7 +148,7 @@ command.label.54 = Delete (with children)
 command.tooltip = Show Only Individuals Associations\r
 command.label.55 = Open Associated Specimens\r
 command.name.41 = Show Only Individual Associations\r
-command.name.42 = Open Taxon Editor\r
+command.name.42 = Open Taxon Editor for taxon\r
 command.name.43 = Create Field Unit\r
 command.name.44 = Deep Delete\r
 command.name.46 = Move Synonym (Homotypical Group) to another Accepted Taxon\r
@@ -161,4 +160,21 @@ commandParameter.name = taxonUUID
 Bundle-Name = Editor Bundle\r
 command.name.48 = delete\r
 command.name.49 = delete\r
-command.name.50 = delete
\ No newline at end of file
+command.name.50 = delete\r
+command.name.51 = delete
+\r
+editor.name.DERIVATIVE_EDITOR = Derivative Editor\r
+command.label.DERIVATIVE_EDITOR = Derivative Editor\r
+command.label.LINK_WITH_TAXON_SELECTION = Link with taxon selection\r
+command.label.UNLINK_FROM_TAXON_SELECTION = Unlink from taxon selection\r
+command.label.REUSE_SINGLE_READ_HERE = Reuse single read here\r
+command.label.REUSE_SINGLE_READ_FOR_OTHER_SEQUENCE = Reuse for other sequence\r
+command.label.REMOVE_SINGLE_READ_FROM_THIS_SEQUENCE = Remove from this sequence\r
+command.label.LINK_WITH_TAXON_SELECTIO = Link with Taxon Selection\r
+command.name.OPEN_NAME_EDITOR_FOR_TAXON_NODE = Open Taxon Editor for taxonnode\r
+command.name.OPEN_DERIVATIVE_EDITOR = Open Derivative Editor\r
+command.name.LINK_WITH_TAXON_SELECTION = Link with taxon selection\r
+command.name.COPY_SINGLE_READ_TO_CLIPBOARD = Copy SingleRead to clipboard\r
+command.name.REUSE_SINGLE_READ = Reuse SingleRead\r
+command.name.REMOVE_SINGLE_READ = Remove SingleRead from sequence\r
+command.name.TOGGLE_LINK_WITH_TAXON_SELECTION = Toggle link with taxon selection
\ No newline at end of file
index a4d096a11d103606e828005e75ba6cb461142e33..f5e3a1ab81e66dad7899164a223a266bf274c2db 100644 (file)
@@ -101,7 +101,6 @@ command.name.23 = Neue Referenz
 command.name.24 = Neuer Name
 command.name.25 = Neues Team
 command.name.26 = Neue Person
-command.name.27 = Neuer Beleg
 category.name.5 = -- Polytomer Bestimmungsschl\u00fcssel
 command.name.28 = Neue Kinderknoten
 command.name.29 = Neuer Geschwisterknoten
@@ -112,7 +111,7 @@ command.name.32 = Erstelle Konzeptrelationen
 command.name.33 = \u00d6ffne verbundenes Konzept
 category.name.7 = -- Gruppe
 command.name.34 = Bearbeite CDM Rechte
-command.name.35 = \u00d6ffne Derivat-Editor
+command.name.35 = \u00d6ffne Specimen-Editor
 scheme.description = Die Standard Tastenkombinationsschema f\u00fcr den Taxonomischen Editor
 scheme.name = Taxonomic Editor Standard Tastenkombinationen
 editor.name.6 = Specimen Import Editor
@@ -153,4 +152,29 @@ command.name.42 = \u00d6ffne Taxon Editor
 command.name.43 = Neue Field Unit
 command.name.44 = L\u00f6schen (mit Kindern)
 command.name.46 = Verschiebe Synonym(Homotypische Gruppe) zu neuem Akzeptierten Taxon
-command.label.56 = Verschiebe Synonym(Homotypische Gruppe) zu neuem Akzeptierten Taxon
\ No newline at end of file
+command.label.56 = Verschiebe Synonym(Homotypische Gruppe) zu neuem Akzeptierten Taxon
+markerContentGenerator.name = Validation Problems Marker Generator
+command.name.45 = L\u00f6schen
+command.name.47 = L\u00f6schen
+commandParameter.name = taxonUUID
+Bundle-Name = Editor Bundle
+command.name.48 = L\u00f6schen
+command.name.49 = L\u00f6schen
+command.name.50 = L\u00f6schen
+command.name.51 = L\u00f6schen
+
+editor.name.DERIVATIVE_EDITOR = Specimen-Editor
+command.label.DERIVATIVE_EDITOR = Specimen-Editor
+command.label.LINK_WITH_TAXON_SELECTION = Verknüpfe mit Taxonauswahl
+command.label.UNLINK_FROM_TAXON_SELECTION = Verknüpfung mit Taxonauswahl aufheben
+command.label.REUSE_SINGLE_READ_HERE = Single-Read hier wiederverwenden
+command.label.REUSE_SINGLE_READ_FOR_OTHER_SEQUENCE = Für ander Sequenz wiederverwenden
+command.label.REMOVE_SINGLE_READ_FROM_THIS_SEQUENCE = Von dieser Sequenz entfernen
+command.label.LINK_WITH_TAXON_SELECTIO = Verknüpfe mit Taxonauswahl
+command.name.OPEN_NAME_EDITOR_FOR_TAXON_NODE = Ã–ffne Namenseditor für Taxonknoten
+command.name.OPEN_DERIVATIVE_EDITOR = Ã–ffne Specimen-Editor
+command.name.LINK_WITH_TAXON_SELECTION = Verknüpfe mit Taxonauswahl
+command.name.COPY_SINGLE_READ_TO_CLIPBOARD = Kopiere Single-Read in die Zwischenablage
+command.name.REUSE_SINGLE_READ = Single-Read wiederverwenden
+command.name.REMOVE_SINGLE_READ = Entferne Single-Read von Sequenz
+command.name.TOGGLE_LINK_WITH_TAXON_SELECTION = De-/Aktiviere Verknüpfung mit Taxonauswahl
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_en.properties b/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_en.properties
deleted file mode 100644 (file)
index 17a5b04..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-#Properties file for taxeditor-editor\r
-Bundle-Vendor.0 = EDIT\r
-Bundle-Name.0 = EDIT Taxonomic Editor - Editor Bundle\r
-command.name.17 = Set Basionym\r
-command.name.18 = Remove Basionym\r
-editor.name = Multipage Taxon Editor\r
-editor.name.0 = Taxon Name Editor\r
-editor.name.1 = Key\r
-editor.name.2 = Polytomous Key Graph Editor\r
-editor.name.3 = Polytomous Key List Editor\r
-editor.name.4 = Cdm Authority Editor\r
-editor.name.5 = Derivate View\r
-view.name = Factual Data\r
-view.name.0 = Uses\r
-view.name.1 = Media\r
-view.name.2 = Concept Relations\r
-view.name.3 = Concept Graph\r
-category.name = Taxonomic Editor\r
-command.label = Reference\r
-command.label.0 = Name\r
-command.label.1 = Team\r
-command.label.2 = Person\r
-command.label.3 = Specimen\r
-command.label.4 = Factual Data\r
-command.label.5 = Media\r
-command.label.6 = Concept\r
-command.label.7 = Concept Graph\r
-command.label.8 = Open Parent\r
-menu.label = New\r
-command.label.9 = Heterotypic Synonym\r
-command.label.10 = Homotypic Synonym\r
-command.label.11 = Synonym In Homotypical Group\r
-menu.label.0 = Change To\r
-command.label.12 = Accepted Taxon\r
-command.label.13 = Synonym\r
-command.label.14 = Misapplication\r
-command.label.15 = Delete\r
-command.label.16 = Delete All Empty Names\r
-command.label.17 = Swap Synonym With Accepted\r
-command.label.18 = Show Details\r
-command.label.19 = Save\r
-command.label.20 = New Node\r
-command.label.21 = Delete\r
-command.label.22 = Apply Layout\r
-command.label.23 = New Key Number\r
-command.label.24 = New Alternative\r
-command.label.25 = Refresh Nodes\r
-command.label.26 = Delete\r
-command.label.27 = New Factual Data\r
-menu.label.1 = New\r
-command.label.28 = Move Description to Taxon\r
-command.label.29 = Move Elements to Taxon\r
-command.label.30 = Delete\r
-command.label.31 = Save\r
-menu.label.2 = New Derivate\r
-command.label.32 = New Use\r
-command.label.33 = New Use Summary\r
-command.label.34 = New Use Record\r
-command.label.35 = Delete\r
-command.label.36 = Save\r
-command.label.37 = New Image Gallery\r
-command.label.38 = New Image\r
-command.label.39 = Move Image Up In List\r
-command.label.40 = Move Image Down In List\r
-command.label.41 = Delete\r
-command.label.42 = Save\r
-menu.label.3 = New\r
-command.label.43 = Open Related Concept\r
-command.label.44 = Delete\r
-command.label.45 = Edit Authorities\r
-extension.name = Name Commands\r
-category.name.0 = -- Name Editor\r
-command.name = Open Parent\r
-command.name.0 = Create Homotypic Synonym\r
-command.name.1 = Create Heterotypic Synonym\r
-command.name.2 = Create Synonym In Homotypical Group\r
-command.name.3 = Change To Synonym\r
-command.name.4 = Change To Accepted Taxon\r
-command.name.5 = Change To Misapplication\r
-command.name.6 = Swap Synonym With Accepted\r
-command.name.7 = Set Basionym / Original Combination\r
-command.name.8 = Remove Basionym / Original Combination\r
-command.name.9 = Delete All Empty Names\r
-category.name.1 = -- Factual\r
-command.name.10 = Create Description Element\r
-command.name.11 = New Description\r
-command.name.12 = Move Description Elements to Taxon\r
-command.name.13 = Move Description to Taxon\r
-category.name.2 = -- New Uses\r
-command.name.14 = New Use\r
-command.name.15 = New Use Summary\r
-command.name.16 = New Use Record\r
-category.name.3 = -- Media\r
-command.name.19 = Move Image Down In List\r
-command.name.20 = New Image Gallery\r
-command.name.21 = New Image\r
-command.name.22 = Move Image Up In List\r
-category.name.4 = -- New Entity\r
-command.name.23 = New Reference\r
-command.name.24 = New Name\r
-command.name.25 = New Team\r
-command.name.26 = New Person\r
-command.name.27 = New Specimen\r
-category.name.5 = -- Polytomous Keys\r
-command.name.28 = New Child Node\r
-command.name.29 = New Sibling Node\r
-command.name.30 = Refresh Node Numbering\r
-command.name.31 = Apply Layout\r
-category.name.6 = -- Concept Relations\r
-command.name.32 = Create Concept Relation\r
-command.name.33 = Open Related Concept\r
-category.name.7 = -- Group\r
-command.name.34 = Edit CDM Authorities\r
-scheme.description = The default key binding scheme for the Taxonomic Editor\r
-scheme.name = Taxonomic Editor Default Key Bindingseditor.name.6 = Specimen Import Editor\r
-editor.name.7 = Gbif Import Editor\r
-editor.name.8 = Checklist Editor\r
-view.name.4 = Specimen Import\r
-view.name.5 = GBIF Specimen Import\r
-command.label.46 = Name\r
-command.label.47 = Reference\r
-command.label.48 = Datasource\r
-command.label.49 = Misapplication\r
-command.label.50 = Use Existing Image\r
-command.name.36 = Create Misapplication\r
-command.name.37 = Use Existing Image\r
-command.name.38 = Open Checklist Editor\r
-command.name.39 = New Datasource\r
-wizard.name = Specimen Search/Import\r
-wizard.description = Queries data provider for specimens with specified parameters.\nNote: Query results are currently limited to 100.\r
-command.name.40 = Validation\r
-view.name.6 = Validation\r
-marker.field.0 = Object Type\r
-marker.field.1 = Object\r
-marker.field.2 = Attribute\r
-marker.field.3 = Problematic Value\r
-marker.field.4 = Problem description\r
-marker.field.5 = Validator\r
-marker.field.6 = Entity Class\r
-marker.field.7 = Entity Id
\ No newline at end of file
index 51792637faccc249bf51af76837e830741d53322..24738e1dfaf717fa166e7801e0a6fd638a42219c 100644 (file)
@@ -5,5 +5,4 @@ bin.includes = META-INF/,\
                plugin.xml,\
                icons/,\
                p2.inf,\
-               OSGI-INF/l10n/plugin.properties,\
-               OSGI-INF/l10n/plugin_de.properties
+               OSGI-INF/
diff --git a/eu.etaxonomy.taxeditor.editor/icons/synced.gif b/eu.etaxonomy.taxeditor.editor/icons/synced.gif
new file mode 100644 (file)
index 0000000..870934b
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/icons/synced.gif differ
index 66def47309837982fcbfaea4fa1efb79fc917fc0..22b08f1933de631fb02b789fb6967a0fea5ddb21 100644 (file)
             id="eu.etaxonomy.taxeditor.editor.group.authority"
             name="%editor.name.4">
       </editor>
-      <editor
-            class="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"
-            default="false"
-            icon="icons/derivate_view-16x16-32.png"
-            id="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"
-            name="%editor.name.5">
-      </editor>
       <editor
             class="eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportEditor"
             default="false"
             id="eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor"
             name="%editor.name.8">
       </editor>
+         <editor
+               class="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"
+               default="false"
+               icon="icons/derivate_view-16x16-32.png"
+               id="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"
+               name="%editor.name.DERIVATIVE_EDITOR">
+         </editor>
    </extension>
       <extension
             point="org.eclipse.ui.views">
                commandId="eu.etaxonomy.taxeditor.editor.command.new.name"
                label="%command.label.46"
                style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.editor.command.new.reference"
                label="%command.label.47"
                style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.editor.command.new.team"
                label="%command.label.1"
                style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.editor.command.new.person"
                label="%command.label.2"
                style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
          <separator
                name="eu.etaxonomy.navigation.menu.new.separator2"
                visible="true">
          </separator>
-         <command
-               commandId="eu.etaxonomy.taxeditor.editor.command.new.specimen"
-               label="%command.label.3"
-               style="push">
-         </command>
          <separator
                name="eu.etaxonomy.navigation.menu.new.separator3"
                visible="true">
                   name="org.eclipse.ui.views.showView.viewId"
                   value="eu.etaxonomy.taxeditor.editor.view.descriptive">
             </parameter>
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
          <command
                commandId="org.eclipse.ui.views.showView"
                   name="org.eclipse.ui.views.showView.viewId"
                   value="eu.etaxonomy.taxeditor.editor.view.media">
             </parameter>
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
          <command
                commandId="org.eclipse.ui.views.showView"
                   name="org.eclipse.ui.views.showView.viewId"
                   value="eu.etaxonomy.taxeditor.editor.view.concept">
             </parameter>
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
          <command
                commandId="org.eclipse.ui.views.showView"
                   value="eu.etaxonomy.taxeditor.editor.view.concept.graph">
             </parameter>
             <visibleWhen
-                  checkEnabled="false">
+                  checkEnabled="true">
+               <and>
+                  <reference
+                        definitionId="isShowExperimentalFeatures">
+                  </reference>
+                  <reference
+                        definitionId="isCdmStoreConnected">
+                  </reference>
+               </and>
+            </visibleWhen>
+         </command>
+         <separator
+               name="eu.etaxonomy.taxeditor.store.separator_derivative_start"
+               visible="true">
+         </separator>
+         <command
+               commandId="eu.etaxonomy.taxeditor.editor.openSpecimenEditorFromMenu"
+               label="%command.label.DERIVATIVE_EDITOR"
+               style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
+         </command>
+         <separator
+               name="eu.etaxonomy.taxeditor.editor.separator1"
+               visible="true">
+         </separator>
+      </menuContribution>
+      <menuContribution
+            locationURI="menu:eu.etaxonomy.taxeditor.menu.showView?before=eu.etaxonomy.taxeditor.store.showViewMenu.internal">
+         <separator
+               name="eu.etaxonomy.taxeditor.store.showViewMenu.validation.separator"
+               visible="true">
+         </separator>
+         <command
+               commandId="org.eclipse.ui.views.showView"
+               label="%command.name.40"
+               style="push">
+            <parameter
+                  name="org.eclipse.ui.views.showView.viewId"
+                  value="eu.etaxonomy.taxeditor.editor.view.validation.problems">
+            </parameter>
+            <visibleWhen
+                  checkEnabled="true">
                <reference
-                     definitionId="isShowExperimentalFeatures">
+                     definitionId="isCdmStoreConnected">
                </reference>
             </visibleWhen>
          </command>
                         <reference
                               definitionId="isMisapplication">
                         </reference>
+                        <reference
+                              definitionId="isHomotypicSynonymOfAcceptedTaxon">
+                        </reference>
                      </or>
                   </not>
                </visibleWhen>
                label="%command.label.27"
                style="push">
          </command>
-         <separator
-               name="eu.etaxonomy.taxeditor.taxonDescriptionEditor.separator3"
-               visible="true">
-         </separator>
          <menu
                label="%menu.label.1">
             <dynamic
             </visibleWhen>
          </menu>
          <separator
-               name="taxeditor-editor.separator1"
+               name="eu.etaxonomy.taxeditor.taxonDescriptionEditor.separator3"
                visible="true">
          </separator>
-         <command
-               commandId="eu.etaxonomy.taxeditor.editor.handler.openDerivateView"
-               label="%command.label.51"
-               style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <and>
-                  <with
-                        variable="selection">
-                     <count
-                           value="+">
-                     </count>
-                  </with>
-                  <reference
-                        definitionId="isIndividualsAssociation">
-                  </reference>
-               </and>
-            </visibleWhen>
-         </command>
          <command
                commandId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.moveDescriptionToTaxon"
                label="%command.label.28"
               </or>
             </visibleWhen>
          </command>
+         <separator
+               name="eu.etaxonomy.taxeditor.editor.separator1">
+         </separator>
+         <dynamic
+               class="eu.etaxonomy.taxeditor.view.CdmViewerContextMenu"
+               id="eu.etaxonomy.taxeditor.editor.descriptive.cdmViewerContextMenu">
+         </dynamic>
+         <separator
+               name="eu.etaxonomy.taxeditor.editor.separator1">
+         </separator>
          <separator
                name="eu.etaxonomy.taxeditor.taxonDescriptionEditor.separator.afterNew"
                visible="true">
                commandId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.delete"
                label="%command.label.30"
                style="push">
+                     <visibleWhen
+                           checkEnabled="true">
+                        <count
+                              value="+">
+                        </count>
+                     </visibleWhen>
          </command>
          <separator
                name="eu.etaxonomy.taxeditor.taxonDescriptionEditor.separator.afterDelete"
       </menuContribution>
       <menuContribution
             locationURI="popup:eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView">
+         <separator
+               name="eu.etaxonomy.taxeditor.editor.separator4"
+               visible="true">
+         </separator>
+         <dynamic
+               class="eu.etaxonomy.taxeditor.view.CdmViewerContextMenu"
+               id="eu.etaxonomy.taxeditor.editor.derivativeEditor.CdmViewerContextMenu">
+         </dynamic>
+         <dynamic
+               class="eu.etaxonomy.taxeditor.editor.view.derivate.contextMenu.DerivateViewContextMenu"
+               id="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateContextMenu">
+         </dynamic>
          <command
-               commandId="eu.etaxonomy.taxeditor.editor.derivate.delete"
-               label="%command.label.52"
+               commandId="eu.etaxonomy.taxeditor.editor.derivative.toggleLinkWithTaxonSelection"
+               label="%command.label.LINK_WITH_TAXON_SELECTION"
                style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <not>
+                  <reference
+                        definitionId="isDerivativeEditorLinkedToTaxonSelection">
+                  </reference>
+               </not>
+            </visibleWhen>
          </command>
          <command
-               commandId="eu.etaxonomy.taxeditor.editor.derivate.createFieldUnit"
-               label="%command.label.53"
+               commandId="eu.etaxonomy.taxeditor.editor.derivative.toggleLinkWithTaxonSelection"
+               label="%command.label.UNLINK_FROM_TAXON_SELECTION"
+               style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isDerivativeEditorLinkedToTaxonSelection">
+               </reference>
+            </visibleWhen>
+         </command>
+         <separator
+               name="eu.etaxonomy.taxeditor.editor.separator3"
+               visible="true">
+         </separator>
+         <command
+               commandId="eu.etaxonomy.taxeditor.editor.derivative.reuseSingleRead"
+               id="eu.etaxonomy.taxeditor.editor.derivative.reuseSingleReadMenuItem"
+               label="%command.label.REUSE_SINGLE_READ_HERE"
+               style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isSingleReadReusableHere">
+               </reference>
+            </visibleWhen>
+         </command>
+         <command
+               commandId="eu.etaxonomy.taxeditor.editor.derivative.copySingleReadToClipBoard"
+               label="%command.label.REUSE_SINGLE_READ_FOR_OTHER_SEQUENCE"
+               style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isSingleRead">
+               </reference>
+            </visibleWhen>
+         </command>
+         <command
+               commandId="eu.etaxonomy.taxeditor.editor.derivative.removeSingleReadFromSequence"
+               label="%command.label.REMOVE_SINGLE_READ_FROM_THIS_SEQUENCE"
+               style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isSingleReadReused">
+               </reference>
+            </visibleWhen>
+         </command>
+         <separator
+               name="eu.etaxonomy.taxeditor.editor.separator7"
+               visible="true">
+         </separator>
+         <command
+               commandId="org.eclipse.ui.edit.delete"
+               label="%command.label.52"
                style="push">
          </command>
          <command
                label="%command.label.54"
                style="push">
          </command>
-         <dynamic
-               class="eu.etaxonomy.taxeditor.editor.view.derivate.contextMenu.DerivateViewContextMenu"
-               id="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateContextMenu">
-         </dynamic>
       </menuContribution>
       <menuContribution
             locationURI="popup:eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportEditor">
       </menuContribution>
       <menuContribution
             allPopups="false"
-            locationURI="popup:eu.etaxonomy.taxeditor.navigation.navigatorpopup?after=taxeditor-navigation.separator2">
-         <command
-               commandId="eu.etaxonomy.taxeditor.editor.handler.openDerivateView"
-               label="%command.label.55"
-               style="push">
-            <visibleWhen
-                  checkEnabled="false">
-               <and>
-                  <reference
-                        definitionId="isCdmStoreConnected">
-                  </reference>
-                  <reference
-                        definitionId="isTaxonNode">
-                  </reference>
-               </and>
-            </visibleWhen>
-         </command>
-         <separator
-               name="eu.etaxonomy.taxeditor.editor.separator1"
-               visible="true">
-         </separator>
-      </menuContribution>
-      <menuContribution
-            locationURI="menu:eu.etaxonomy.taxeditor.menu.showView?after=org.eclipse.ui.views.showView.supplemental">
-         <separator
-               name="eu.etaxonomy.taxeditor.store.showViewMenu.validation.separator"
-               visible="true">
-         </separator>
-         <command
-               commandId="org.eclipse.ui.views.showView"
-               label="%command.name.40"
-               style="push">
-            <parameter
-                  name="org.eclipse.ui.views.showView.viewId"
-                  value="eu.etaxonomy.taxeditor.editor.view.validation.problems">
-            </parameter>
-         </command>
+            locationURI="toolbar:org.eclipse.ui.main.toolbar?after=eu.etaxonomy.taxeditor.navigation.search.toolbar">
+         <toolbar
+               id="eu.etaxonomy.taxeditor.editor.derivativeViewToolbar">
+            <command
+                  commandId="eu.etaxonomy.taxeditor.editor.derivative.listenToSelectionChange"
+                  icon="icons/synced.gif"
+                  label="%command.label.LINK_WITH_TAXON_SELECTIO"
+                  style="toggle">
+               <visibleWhen
+                     checkEnabled="true">
+                  <with
+                        variable="activePartId">
+                     <equals
+                           value="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView">
+                     </equals>
+                  </with>
+               </visibleWhen>
+            </command>
+         </toolbar>
       </menuContribution>
    </extension>
    <extension
       </handler>
       <handler
             class="eu.etaxonomy.taxeditor.editor.view.derivate.handler.DeleteDerivateHandler"
-            commandId="eu.etaxonomy.taxeditor.editor.view.derivate.command.delete">
+            commandId="org.eclipse.ui.edit.delete">
          <activeWhen>
             <with
                   variable="activePartId">
          </activeWhen>
       </handler>
       <handler
-            class="eu.etaxonomy.taxeditor.editor.view.derivate.handler.OpenDerivateEditorForTaxonHandler"
-            commandId="eu.etaxonomy.taxeditor.editor.handler.openDerivateView">
+            class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.ToggleShowOnlyIndividualAssociationsHandler"
+            commandId="eu.etaxonomy.taxeditor.editor.handler.showOnlyIndividualAssociations">
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.key.polytomous.handler.RemotingCreateChildPolytomousKeyNodeHandler"
+            commandId="eu.etaxonomy.taxeditor.key.polytomous.command.new.child">
+         <activeWhen>
+            <reference
+                  definitionId="isRemoting">
+            </reference>
+         </activeWhen>
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.key.polytomous.handler.RemotingCreateSiblingPolytomousKeyNodeHandler"
+            commandId="eu.etaxonomy.taxeditor.key.polytomous.command.new.sibling">
+         <activeWhen>
+            <reference
+                  definitionId="isRemoting">
+            </reference>
+         </activeWhen>
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.handler.defaultHandler.OpenReferencingObjectsView"
+            commandId="eu.etaxonomy.taxeditor.openReferencingObjectsView">
          <activeWhen>
             <with
                   variable="activePartId">
                <equals
-                     value="eu.etaxonomy.taxeditor.navigation.navigator">
+                     value="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView">
                </equals>
             </with>
          </activeWhen>
       </handler>
       <handler
-            class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.ToggleShowOnlyIndividualAssociationsHandler"
-            commandId="eu.etaxonomy.taxeditor.editor.handler.showOnlyIndividualAssociations">
+            class="eu.etaxonomy.taxeditor.editor.view.derivate.handler.OpenDerivativeEditorForDescriptionElement"
+            commandId="eu.etaxonomy.taxeditor.editor.openSpecimenEditor">
+         <activeWhen>
+            <with
+                  variable="activePartId">
+               <equals
+                     value="eu.etaxonomy.taxeditor.editor.view.descriptive">
+               </equals>
+            </with>
+         </activeWhen>
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.view.derivate.handler.OpenDerivativeEditorForTaxonNode"
+            commandId="eu.etaxonomy.taxeditor.editor.openSpecimenEditor">
+         <activeWhen>
+            <with
+                  variable="selection">
+               <reference
+                     definitionId="isTaxonNode">
+               </reference>
+            </with>
+         </activeWhen>
       </handler>
    </extension>
    <extension
             id="eu.etaxonomy.taxeditor.editor.command.new.person"
             name="%command.name.26">
       </command>
-      <command
-            categoryId="eu.etaxonomy.taxeditor.editor.new.category"
-            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.create.NewSpecimenHandler"
-            id="eu.etaxonomy.taxeditor.editor.command.new.specimen"
-            name="%command.name.27">
-      </command>
       <category
             id="eu.etaxonomy.taxeditor.editor.key.category"
             name="%category.name.5">
             id="eu.etaxonomy.taxeditor.editor.view.concept.command.open"
             name="%command.name.33">
       </command>
+      <command
+            categoryId="eu.etaxonomy.taxeditor.editor.view.concept.category"
+            defaultHandler="eu.etaxonomy.taxeditor.editor.view.concept.handler.DeleteConceptRelationHandler"
+            id="eu.etaxonomy.taxeditor.editor.view.concept.command.delete"
+            name="%command.name.51">
+      </command>
       <category
             id="eu.etaxonomy.taxeditor.bulkeditor.group.category"
             name="%category.name.7">
             defaultHandler="eu.etaxonomy.taxeditor.editor.group.authority.handler.EditCdmAuthoritiesHandler"
             id="eu.etaxonomy.taxeditor.group.cdmauthorities.edit"
             name="%command.name.34">
-      </command>
-      <command
-            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenDerivateViewHandler"
-            id="eu.etaxonomy.taxeditor.editor.handler.openDerivateView"
-            name="%command.name.35">
       </command>
        <command
              defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler"
             name="%command.name.41">
       </command>
       <command
-            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenTaxonEditorHandler"
-            id="eu.etaxonomy.taxeditor.editor.openTaxonEditor"
+            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.defaultHandler.DefaultOpenTaxonEditorForTaxonHandler"
+            id="eu.etaxonomy.taxeditor.editor.openTaxonEditorForTaxon"
             name="%command.name.42">
          <commandParameter
-               id="eu.etaxonomy.taxeditor.editor.taxonParameter"
+               id="eu.etaxonomy.taxeditor.editor.openTaxonEditorForTaxon.uuid"
                name="%commandParameter.name"
                optional="false"
-               typeId="eu.etaxonomy.taxeditor.editor.taxonParameterType">
+               typeId="eu.etaxonomy.taxeditor.uuidParameterType">
          </commandParameter>
       </command>
-      <commandParameterType
-            converter="eu.etaxonomy.taxeditor.editor.handler.TaxonParameterConverter"
-            id="eu.etaxonomy.taxeditor.editor.taxonParameterType"
-            type="eu.etaxonomy.cdm.model.taxon.TaxonBase">
-      </commandParameterType>
       <command
-            defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.CreateFieldUnitHandler"
-            id="eu.etaxonomy.taxeditor.editor.derivate.createFieldUnit"
-            name="%command.name.43">
+            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.defaultHandler.DefaultOpenTaxonEditorForTaxonNodeHandler"
+            id="eu.etaxonomy.taxeditor.editor.openTaxonEditorForTaxonNode"
+            name="%command.name.OPEN_NAME_EDITOR_FOR_TAXON_NODE">
+         <commandParameter
+               id="eu.etaxonomy.taxeditor.editor.openTaxonEditorForTaxonNode.uuid"
+               name="taxon node uuid"
+               optional="true"
+               typeId="eu.etaxonomy.taxeditor.uuidParameterType">
+         </commandParameter>
       </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.DeleteDerivateHandler"
             id="eu.etaxonomy.taxeditor.editor.view.descriptive.command.moveDescriptionElements"
             name="%command.name.12">
       </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenDerivateViewHandler"
+            id="eu.etaxonomy.taxeditor.editor.openSpecimenEditor"
+            name="%command.name.OPEN_DERIVATIVE_EDITOR">
+         <commandParameter
+               id="eu.etaxonomy.taxeditor.editor.openSpecimenEditor.uuid"
+               name="Specimen Uuids"
+               optional="true"
+               typeId="eu.etaxonomy.taxeditor.uuidParameterType">
+         </commandParameter>
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenDerivateViewHandler"
+            id="eu.etaxonomy.taxeditor.editor.openSpecimenEditorFromMenu"
+            name="%command.name.OPEN_DERIVATIVE_EDITOR">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.ListenToSelectionChangeHandler"
+            id="eu.etaxonomy.taxeditor.editor.derivative.listenToSelectionChange"
+            name="%command.name.LINK_WITH_TAXON_SELECTION">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.SingleReadHandler"
+            id="eu.etaxonomy.taxeditor.editor.derivative.copySingleReadToClipBoard"
+            name="%command.name.COPY_SINGLE_READ_TO_CLIPBOARD">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.SingleReadHandler"
+            id="eu.etaxonomy.taxeditor.editor.derivative.reuseSingleRead"
+            name="%command.name.REUSE_SINGLE_READ">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.SingleReadHandler"
+            id="eu.etaxonomy.taxeditor.editor.derivative.removeSingleReadFromSequence"
+            name="%command.name.REMOVE_SINGLE_READ">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.ToggleLinkWithTaxonSelectionHandler"
+            id="eu.etaxonomy.taxeditor.editor.derivative.toggleLinkWithTaxonSelection"
+            name="%command.name.TOGGLE_LINK_WITH_TAXON_SELECTION">
+      </command>
         
    </extension>
    <extension
             </test>
          </with>
       </definition>
+      <definition
+            id="isNotHomotypicSynonymOfAcceptedTaxon">
+         <with
+               variable="selection">
+            <test
+                  property="eu.etaxonomy.taxeditor.editor.name.propertyTester.isHomotypicSynonymOfAcceptedTaxon">
+            </test>
+         </with>
+      </definition>
       <definition
             id="isSynonym">
          <with
             </test>
          </with>
       </definition>
+      <definition
+            id="isRemoting">
+         <test
+               property="eu.etaxonomy.taxeditor.preference.CdmStorePropertyTester.isRemoting">
+         </test>
+      </definition>
       <definition
             id="isSequence">
          <with
             </test>
          </with>
       </definition>
+      <definition
+            id="isSingleReadReusableHere">
+         <with
+               variable="selection">
+            <test
+                  property="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester.isSingleReadReusableHere">
+            </test>
+         </with>
+      </definition>
+      <definition
+            id="isSingleReadReused">
+         <with
+               variable="selection">
+            <test
+                  property="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester.isSingleReadReused">
+            </test>
+         </with>
+      </definition>
+      <definition
+            id="isDerivativeEditorLinkedToTaxonSelection">
+         <with
+               variable="activeEditor">
+            <test
+                  property="eu.etaxonomy.taxeditor.editor.view.derivate.DerivativeEditorPropertyTester.isLinkedWithTaxonSelection">
+            </test>
+         </with>
+      </definition>
    </extension>
    <extension
          point="org.eclipse.core.expressions.propertyTesters">
             class="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester"
             id="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester"
             namespace="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester"
-            properties="isSequence,isSingleRead"
+            properties="isSequence,isSingleRead,isSingleReadReusableHere,isSingleReadReused"
             type="org.eclipse.jface.viewers.IStructuredSelection">
       </propertyTester>
+      <propertyTester
+            class="eu.etaxonomy.taxeditor.editor.view.derivate.DerivativeEditorPropertyTester"
+            id="eu.etaxonomy.taxeditor.editor.view.derivate.DerivativeEditorPropertyTester"
+            namespace="eu.etaxonomy.taxeditor.editor.view.derivate.DerivativeEditorPropertyTester"
+            properties="isLinkedWithTaxonSelection"
+            type="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView">
+      </propertyTester>
    </extension>
    <extension
          point="org.eclipse.ui.bindings">   
             name="%scheme.name">
       </scheme>
    </extension>
-    <extension
+    <!--extension
          point="org.eclipse.ui.importWizards">
       <wizard
             category="eu.etaxonomy.taxeditor.import.category.cdm"
             %wizard.description
          </description>
       </wizard>
-   </extension>
-    <extension
+   </extension-->
+   <extension
           point="eu.etaxonomy.taxeditor.store.cdmViewer">
-       <cdmViewer
-             class="eu.etaxonomy.taxeditor.editor.EditorCdmViewer">
-       </cdmViewer>
+      <viewCommandMapping
+            commandId="eu.etaxonomy.taxeditor.editor.openTaxonEditorForTaxonNode"
+            selection="eu.etaxonomy.cdm.model.taxon.TaxonNode"
+            viewerName="Name Editor">
+      </viewCommandMapping>
+      <viewCommandMapping
+            commandId="eu.etaxonomy.taxeditor.editor.openTaxonEditorForTaxon"
+            selection="eu.etaxonomy.cdm.model.taxon.TaxonBase"
+            viewerName="Name Editor">
+      </viewCommandMapping>
+      <viewCommandMapping
+            commandId="eu.etaxonomy.taxeditor.editor.openSpecimenEditor"
+            selection="eu.etaxonomy.cdm.model.description.IndividualsAssociation"
+            viewerName="Derivative Editor">
+      </viewCommandMapping>
+      <viewCommandMapping
+            commandId="eu.etaxonomy.taxeditor.editor.openSpecimenEditor"
+            selection="eu.etaxonomy.cdm.model.taxon.TaxonNode"
+            viewerName="Derivative Editor">
+      </viewCommandMapping>
     </extension>
 </plugin>
index eaeafdfc83c09f7347350c379d6867acd2425869..9cee5ff8f465b6189b28323852edcbc8d07c1d46 100644 (file)
@@ -1,9 +1,10 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   
   <parent>
        <groupId>eu.etaxonomy</groupId>
        <artifactId>taxeditor-parent</artifactId>
-    <version>3.8.0-SNAPSHOT</version>
+    <version>4.0.0-SNAPSHOT</version>
   </parent>
   
   <modelVersion>4.0.0</modelVersion>
@@ -11,7 +12,7 @@
   <packaging>eclipse-plugin</packaging>
   
   <name>Editor Bundle</name>
-  <description />
+  <description></description>
   <url>http://dev.e-taxonomy.eu/trac/wiki/TaxonomicEditorEditorBundle</url>
   
 </project>
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorCdmViewer.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorCdmViewer.java
deleted file mode 100644 (file)
index 796d19a..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2015 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.editor;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-import org.eclipse.ui.PartInitException;
-
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.view.ICdmViewer;
-
-/**
- * @author pplitzner
- * @date Feb 23, 2015
- *
- */
-public class EditorCdmViewer implements ICdmViewer {
-
-    private final Logger logger = Logger.getLogger(EditorCdmViewer.class);
-
-    @Override
-    public void show(Object input, Class<?> viewerClass) {
-        try {
-            if(viewerClass.equals(MultiPageTaxonEditor.class)){
-                if(input instanceof TaxonBase){
-                    TaxonEditorInput editorInput = TaxonEditorInput.NewInstanceFromTaxonBase(((TaxonBase<?>) input).getUuid());
-                    EditorUtil.open(editorInput);
-                }
-            }
-            else if(viewerClass.equals(DerivateView.class)){
-                if(input instanceof SpecimenOrObservationBase){
-                }
-            }
-        } catch (PartInitException e) {
-            String errorMessage = "Could not open editor";
-            logger.error(errorMessage, e);
-            MessagingUtils.error(EditorCdmViewer.class, errorMessage, e);
-        }
-    }
-
-    @Override
-    public Map<Class<?>, String> getViewerClasses(Object input) {
-        Map<Class<?>, String> viewerNameMap = new HashMap<Class<?>, String>();
-        if(input instanceof TaxonBase){
-            viewerNameMap.put(MultiPageTaxonEditor.class, "Taxon Editor");
-        }
-        return viewerNameMap;
-    }
-
-}
index e87142c40ea62fbe582d74221d87aa1d5b932a1a..97bfe0e5a514644cefd5a4f6f1965e16102ee769 100644 (file)
@@ -24,14 +24,17 @@ import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.model.common.ITreeNode;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditor;
 import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditorInput;
 import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
@@ -39,12 +42,12 @@ import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
 import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
 import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditorInput;
-import eu.etaxonomy.taxeditor.editor.view.dataimport.BioCaseEditorInput;
-import eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportEditor;
-import eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportEditorInput;
-import eu.etaxonomy.taxeditor.editor.view.dataimport.GbifImportEditor;
-import eu.etaxonomy.taxeditor.editor.view.dataimport.GbifImportEditorInput;
-import eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportEditor;
+//import eu.etaxonomy.taxeditor.store.view.dataimport.BioCaseEditorInput;
+//import eu.etaxonomy.taxeditor.view.dataimport.DataImportEditor;
+//import eu.etaxonomy.taxeditor.view.dataimport.DataImportEditorInput;
+//import eu.etaxonomy.taxeditor.view.dataimport.GbifImportEditor;
+//import eu.etaxonomy.taxeditor.view.dataimport.GbifImportEditorInput;
+//import eu.etaxonomy.taxeditor.view.dataimport.SpecimenImportEditor;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -73,7 +76,14 @@ public class EditorUtil extends AbstractUtility {
         */
        private static IEditorPart open(final IEditorInput input,
                        final String editorId) throws PartInitException {
-               return getActivePage().openEditor(input, editorId);
+               IEditorPart editor = getActivePage().openEditor(input, editorId);
+               if(input != null &&
+                       editor.getEditorInput() != null &&
+                       input != editor.getEditorInput() &&
+                       input instanceof CdmEntitySessionInput) {
+                   ((CdmEntitySessionInput)input).dispose();
+               }
+               return editor;
        }
 
        /**
@@ -125,15 +135,15 @@ public class EditorUtil extends AbstractUtility {
         * @param input a {@link DataImportEditorInput}
         * @throws PartInitException
         */
-       public static void open(DataImportEditorInput<?> input)
-               throws PartInitException {
-           if(input instanceof BioCaseEditorInput){
-               open(input, SpecimenImportEditor.ID);
-           }
-           else if(input instanceof GbifImportEditorInput){
-               open(input, GbifImportEditor.ID);
-           }
-       }
+//     public static void open(DataImportEditorInput<?> input)
+//             throws PartInitException {
+//         if(input instanceof BioCaseEditorInput){
+//             open(input, SpecimenImportEditor.ID);
+//         }
+//         else if(input instanceof GbifImportEditorInput){
+//             open(input, GbifImportEditor.ID);
+//         }
+//     }
 
        /**
         * Taxon Editors may be opened by supplying a taxon node uuid. Session gets
@@ -386,6 +396,12 @@ public class EditorUtil extends AbstractUtility {
                open(input);
        }
 
+//     public static void openPolytomousKeyEditor(UUID polytomousKeyUuid, String name)
+//             throws Exception {
+//         PolytomousKeyEditorInput input = new PolytomousKeyEditorInput(polytomousKeyUuid, name);
+//         open(input);
+//     }
+
        public static void openCdmAuthorities(UUID groupUuid)
                        throws Exception {
                CdmAuthorityEditorInput input = CdmAuthorityEditorInput.NewInstance(groupUuid);
@@ -416,20 +432,6 @@ public class EditorUtil extends AbstractUtility {
            }
        }
 
-       /**
-        * Iterates recursively over all originals having the given specimen as a derivate.
-        * If a {@link FieldUnit} is found it is returned
-        * @param specimen the start element for which the originals are iterated recursively
-        * @return the FieldUnit if found, <code>null</code> otherwise
-        */
-    public static FieldUnit getFieldUnit(SpecimenOrObservationBase<?> specimen){
-        SpecimenOrObservationBase<?> topMostDerivate = getTopMostDerivate(specimen);
-        if(topMostDerivate instanceof FieldUnit) {
-            return (FieldUnit) topMostDerivate;
-        }
-        return null;
-    }
-
     /**
      * If the current selection is a single {@link TreeNode} it will be returned.
      * @param selection the selection to check
@@ -455,4 +457,28 @@ public class EditorUtil extends AbstractUtility {
             openTaxonBase(((TaxonBase<?>) object).getUuid());
         }
     }
+
+    public static boolean closeObsoleteEditor(TaxonNode taxonNode, IWorkbenchPage activePage){
+        boolean result = true;
+        for (IEditorReference ref : activePage.getEditorReferences()) {
+            try {
+                String treeIndex = ((ITreeNode)taxonNode).treeIndex();
+
+
+                IEditorInput input = ref.getEditorInput();
+                if (input instanceof TaxonEditorInput) {
+                    TaxonNode node = ((TaxonEditorInput) input).getTaxonNode();
+                    //if node is a child of taxonNode then close the editor
+                    if( ((ITreeNode) node).treeIndex().startsWith(treeIndex)){
+                    //if (taxonNode.equals(node)) {
+                        result &= activePage.closeEditor(ref.getEditor(false), true);
+
+                    }
+                }
+            } catch (PartInitException e) {
+                continue;
+            }
+        }
+        return result;
+    }
 }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/Messages.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/Messages.java
new file mode 100644 (file)
index 0000000..5a3fd53
--- /dev/null
@@ -0,0 +1,61 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.editor;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author pplitzner
+ * @date 09.09.2015
+ *
+ */
+public class Messages extends NLS {
+    private static final String BUNDLE_NAME = "OSGI-INF/l10n/messages"; //$NON-NLS-1$
+    public static String CreateDerivateContextMenu_ADD;
+    public static String CreateDerivateContextMenu_DNA_SAMPLE;
+    public static String CreateDerivateContextMenu_MEDIA;
+    public static String CreateDerivateContextMenu_MEDIA_EXISTING;
+    public static String CreateDerivateContextMenu_MEDIA_SPECIMEN;
+    public static String CreateDerivateContextMenu_NO_CHILD_DERIVATE;
+    public static String CreateDerivateContextMenu_SEQUENCE;
+    public static String CreateDerivateContextMenu_SINGLE_READ;
+    public static String CreateDerivateContextMenu_SPECIMEN;
+    public static String CreateDerivateContextMenu_TISSUE_SAMPLE;
+    public static String DeleteDerivateOperation_AND_CHILDREN;
+    public static String DeleteDerivateOperation_CONFIRM;
+    public static String DeleteDerivateOperation_DELETE_FAILED;
+    public static String DeleteDerivateOperation_REALLY_DELETE;
+    public static String DeleteTaxonBaseHandler_CONFIRM_DELETION;
+    public static String DeleteTaxonBaseHandler_ELEMENT_MUST_BE_SYNONYM_MISAPP_CONCEPT;
+    public static String DeleteTaxonBaseHandler_REALLY_DELETE_TAXON;
+    public static String DerivateDropListener_MOVE_TO;
+    public static String DerivateView_DERIVATIVE_EDITOR;
+    public static String DerivateView_SAVING_HIERARCHY;
+    public static String DerivateView_UNSAVED_CHANGES;
+    public static String DerivateView_YOU_NEED_TO_SAVE;
+    public static String DerivateViewEditorInput_FAIL_INIT;
+    public static String DerivateViewEditorInput_NO_ROOT;
+    public static String MoveDerivateOperation_MOVE_NOT_POSSIBLE;
+    public static String MoveDerivateOperation_MOVE_TO_NOT_POSSIBLE;
+    public static String OpenDerivateEditorForTaxonHandler_COULD_NOT_OPEN_EDITOR;
+    public static String OpenDerivateEditorForTaxonHandler_FAILED_TO_OPEN;
+    public static String OpenDerivateEditorForTaxonHandler_HIERARCHY_CORRUPTED;
+    public static String OpenDerivateEditorForTaxonHandler_NO_DERIVATIVES_FOUND;
+    public static String SingleReadSequenceContextMenu_REMOVE_FROM_SEQUENCE;
+    public static String SingleReadSequenceContextMenu_REUSE_FOR_SEQUENCE;
+    public static String SingleReadSequenceContextMenu_REUSE_SINGLE_READ_HERE;
+    static {
+        // initialize resource bundle
+        NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+    }
+
+    private Messages() {
+    }
+}
index 74e264dc5ec66cf1fb4a4b8ac7ed7e2c1dcb6cc8..e58a897b2426f9d5d69d82de6188620a37fa4ccf 100644 (file)
@@ -54,72 +54,79 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
  * @version 1.0
  */
 public class MultiPageTaxonEditor extends FormEditor implements
-        IPartContentHasFactualData, IConversationEnabled, IPostOperationEnabled,
-               IDirtyMarkable, IPartContentHasDetails, ISecuredEditor, IPartContentHasMedia {
-
-       /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.taxon"{trunked}</code> */
-       public static final String ID = "eu.etaxonomy.taxeditor.editor.taxon";
-
-       private boolean dirty;
-
-       private ConversationHolder conversation;
-       private IDataChangeBehavior dataChangeBehavior;
-       private IUndoContext undoContext;
-
-       private TaxonEditorInput input;
-
-       /**
-        * <p>
-        * Constructor for MultiPageTaxonEditor.
-        * </p>
-        */
-       public MultiPageTaxonEditor() {
-               super();
-               undoContext = new UndoContext();
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       public void dispose() {
-               conversation.unregisterForDataStoreChanges(this);
-               conversation.close();
-               super.dispose();
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       protected void addPages() {
-               input = (TaxonEditorInput) getEditorInput();
-               conversation = input.getConversationHolder();
-               conversation.registerForDataStoreChanges(this);
-
-               try {
-                       addPage(Page.NAME.getIndex(), new TaxonNameEditor(this),
-                                       getEditorInput());
-                       // setPageText(Page.NAME.getIndex(), Page.NAME.getTitle());
-
-                       // TODO lazy create
-                       // addPage(Page.DESCRIPTIVE.getIndex(), new
-                       // TaxonDescriptionTreeEditor(this), getEditorInput());
-                       // setPageText(Page.DESCRIPTIVE.getIndex(),
-                       // Page.DESCRIPTIVE.getTitle());
-
-                       // EditorUtil.showPropertySheet();
-
-               } catch (PartInitException e) {
-                       MessagingUtils.error(getClass(), e);
-               }
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       public void doSave(IProgressMonitor monitor) {
-               monitor.beginTask("Saving Editor", 4);
-               try {
-                       if (!conversation.isBound()) {
-                               conversation.bind();
-                       }
-                       monitor.worked(1);
+IPartContentHasFactualData, IConversationEnabled, IPostOperationEnabled,
+IDirtyMarkable, IPartContentHasDetails, ISecuredEditor, IPartContentHasMedia {
+
+    /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.taxon"{trunked}</code> */
+    public static final String ID = "eu.etaxonomy.taxeditor.editor.taxon";
+
+    private boolean dirty;
+
+    private ConversationHolder conversation;
+    private IDataChangeBehavior dataChangeBehavior;
+    private IUndoContext undoContext;
+
+    private TaxonEditorInput input;
+
+    /**
+     * <p>
+     * Constructor for MultiPageTaxonEditor.
+     * </p>
+     */
+    public MultiPageTaxonEditor() {
+        super();
+        undoContext = new UndoContext();
+
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void dispose() {
+        input.dispose();
+        conversation.unregisterForDataStoreChanges(this);
+        conversation.close();
+        super.dispose();
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.eclipse.ui.forms.editor.FormEditor#addPages()
+     */
+    /** {@inheritDoc} */
+    @Override
+    protected void addPages() {
+        input = (TaxonEditorInput) getEditorInput();
+        conversation = input.getConversationHolder();
+        conversation.registerForDataStoreChanges(this);
+
+        try {
+            addPage(Page.NAME.getIndex(), new TaxonNameEditor(this),
+                    getEditorInput());
+            // setPageText(Page.NAME.getIndex(), Page.NAME.getTitle());
+
+            // TODO lazy create
+            // addPage(Page.DESCRIPTIVE.getIndex(), new
+            // TaxonDescriptionTreeEditor(this), getEditorInput());
+            // setPageText(Page.DESCRIPTIVE.getIndex(),
+            // Page.DESCRIPTIVE.getTitle());
+
+            // EditorUtil.showPropertySheet();
+
+        } catch (PartInitException e) {
+            MessagingUtils.error(getClass(), e);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void doSave(IProgressMonitor monitor) {
+        monitor.beginTask("Saving Editor", 4);
+        try {
+            if (!conversation.isBound()) {
+                conversation.bind();
+            }
+            monitor.worked(1);
 
             for (IEditorPart editorPage : getPages()) {
                 if (editorPage instanceof TaxonNameEditor) {
@@ -135,9 +142,11 @@ public class MultiPageTaxonEditor extends FormEditor implements
                 monitor.worked(1);
             }
 
-                       // commit the conversation and start a new transaction immediately
-                       conversation.commit(true);
-                       monitor.worked(1);
+            // commit the conversation and start a new transaction immediately
+
+            input.merge();
+            conversation.commit(true);
+            monitor.worked(1);
 
             this.setDirty(false);
             monitor.worked(1);
@@ -148,119 +157,143 @@ public class MultiPageTaxonEditor extends FormEditor implements
         } finally {
             monitor.done();
         }
-       }
-
-       private void disableEditor(boolean isOnError) {
-               for (IMultiPageTaxonEditorPage editorPage : getPages()) {
-                       if(isOnError){
-                               editorPage.setOnError();
-                       }else {
-                               editorPage.setDisabled();
-                       }
-               }
-               conversation.unregisterForDataStoreChanges(this);
-               conversation.close();
-               setDirty(false);
-       }
-
-       private void setDirty(boolean dirty) {
-               this.dirty = dirty;
-               firePropertyChange(PROP_DIRTY);
-       }
-
-       @Override
+    }
+
+    private void disableEditor(boolean isOnError) {
+        for (IMultiPageTaxonEditorPage editorPage : getPages()) {
+            if(isOnError){
+                editorPage.setOnError();
+            }else {
+                editorPage.setDisabled();
+            }
+        }
+
+        conversation.unregisterForDataStoreChanges(this);
+        conversation.close();
+        setDirty(false);
+    }
+
+    private void setDirty(boolean dirty) {
+        this.dirty = dirty;
+        firePropertyChange(PROP_DIRTY);
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.eclipse.ui.part.MultiPageEditorPart#isDirty()
+     */
+    /**
+     * <p>
+     * isDirty
+     * </p>
+     *
+     * @return a boolean.
+     */
+    @Override
     public boolean isDirty() {
-               return dirty;
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       public void editorDirtyStateChanged() {
-               dirty = true;
-               super.editorDirtyStateChanged();
-       }
-
-       /**
-        * {@inheritDoc}
-        *
-        * Checks whether nested editors are calling
-        * <code>firePropertyChange(PROP_DIRTY)</code> to signal an edit has taken
-        * place before passing property change along to
-        * <code>super.handlePropertyChange(int propertyId)</code>.
-        */
-       @Override
+        return dirty;
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.eclipse.ui.forms.editor.FormEditor#editorDirtyStateChanged()
+     */
+    /** {@inheritDoc} */
+    @Override
+    public void editorDirtyStateChanged() {
+        dirty = true;
+        super.editorDirtyStateChanged();
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * Checks whether nested editors are calling
+     * <code>firePropertyChange(PROP_DIRTY)</code> to signal an edit has taken
+     * place before passing property change along to
+     * <code>super.handlePropertyChange(int propertyId)</code>.
+     */
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.eclipse.ui.part.MultiPageEditorPart#handlePropertyChange(int)
+     */
+    @Override
     protected void handlePropertyChange(int propertyId) {
-               if (propertyId == PROP_DIRTY) {
-                       setDirty(true);
-               }
-               super.handlePropertyChange(propertyId);
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       public void doSaveAs() {
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       public boolean isSaveAsAllowed() {
-               return false;
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       public void init(IEditorSite site, IEditorInput input)
-                       throws PartInitException {
-
-               if (!(input instanceof TaxonEditorInput)) {
+        if (propertyId == PROP_DIRTY) {
+            setDirty(true);
+        }
+        super.handlePropertyChange(propertyId);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void doSaveAs() {
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public boolean isSaveAsAllowed() {
+        return false;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void init(IEditorSite site, IEditorInput input)
+            throws PartInitException {
+
+        if (!(input instanceof TaxonEditorInput)) {
             throw new PartInitException(
-                                       "Invalid Input: Must be TaxonEditorInput");
+                    "Invalid Input: Must be TaxonEditorInput");
+        }
+
+        this.input = (TaxonEditorInput) input;
+
+
+        // try {
+        // // Listen for name changes,
+        // // change tab for this taxon editor accordingly
+        // getTaxon().addPropertyChangeListener("name",
+        // new PropertyChangeListener() {
+        // public void propertyChange(PropertyChangeEvent e) {
+        // setPartName();
+        // }
+        // });
+        // } catch (NullPointerException e) {
+        // EditorUtil.warn(getClass(),
+        // "Caught an NPE while initing an editor. This is most " +
+        // "likely due to the unsuccesful attempt to restore the former " +
+        // "state of the application. We ignore this because the workbench " +
+        // "will simply be reset.");
+        // }
+        setPartName();
+
+        super.init(site, input);
+    }
+
+    /**
+     * Calls <code>MultiPageEditorPart.setPartName(String partName)</code> with
+     * text appropriate to the state of the taxon: any taxon that has been saved
+     * will by necessity have a name to display; a new taxon should display
+     * "New taxon" in the editor tab.
+     */
+    protected void setPartName() {
+
+        String partName = null;
+        TaxonNameBase<?, ?> name = getTaxon().getName();
+
+        if (name != null) {
+            partName = name.getTitleCache();
+        }
+
+        if (partName == null || partName.equals("")) {
+            partName = ("New taxon");
         }
 
-               this.input = (TaxonEditorInput) input;
-
-               // try {
-               // // Listen for name changes,
-               // // change tab for this taxon editor accordingly
-               // getTaxon().addPropertyChangeListener("name",
-               // new PropertyChangeListener() {
-               // public void propertyChange(PropertyChangeEvent e) {
-               // setPartName();
-               // }
-               // });
-               // } catch (NullPointerException e) {
-               // EditorUtil.warn(getClass(),
-               // "Caught an NPE while initing an editor. This is most " +
-               // "likely due to the unsuccesful attempt to restore the former " +
-               // "state of the application. We ignore this because the workbench " +
-               // "will simply be reset.");
-               // }
-               setPartName();
-
-               super.init(site, input);
-       }
-
-       /**
-        * Calls <code>MultiPageEditorPart.setPartName(String partName)</code> with
-        * text appropriate to the state of the taxon: any taxon that has been saved
-        * will by necessity have a name to display; a new taxon should display
-        * "New taxon" in the editor tab.
-        */
-       protected void setPartName() {
-
-               String partName = null;
-               TaxonNameBase<?, ?> name = getTaxon().getName();
-
-               if (name != null) {
-                       partName = name.getTitleCache();
-               }
-
-               if (partName == null || partName.equals("")) {
-                       partName = ("New taxon");
-               }
-
-               setPartName(partName);
-       }
+        setPartName(partName);
+    }
 
     /**
      * {@inheritDoc}
@@ -285,48 +318,100 @@ public class MultiPageTaxonEditor extends FormEditor implements
         setPartName();
     }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#forceDirty()
+     */
     @Override
     public void forceDirty() {
         changed(null);
     }
 
-       /**
-        * The accepted taxon that is the input for this editor
-        *
-        * @return the accepted taxon
-        */
-       public Taxon getTaxon() {
-               return input.getTaxon();
-       }
+    /**
+     * The accepted taxon that is the input for this editor
+     *
+     * @return the accepted taxon
+     */
+    public Taxon getTaxon() {
+        return input.getTaxon();
+    }
 
-       @Override
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder
+     * ()
+     */
+    /**
+     * <p>
+     * getConversationHolder
+     * </p>
+     *
+     * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
+     *         object.
+     */
+    @Override
     public ConversationHolder getConversationHolder() {
-               return conversation;
-       }
-
-       public void setConversationHolder(ConversationHolder conversation) {
-               this.conversation = conversation;
-       }
-
-       public IUndoContext getUndoContext() {
-               return undoContext;
-       }
-
-       public void setUndoContext(IUndoContext undoContext) {
-               this.undoContext = undoContext;
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       public void setFocus() {
-               // logger.warn("Setting focus to editor");
-               // bind the conversation
-               getConversationHolder().bind();
-               // pass focus to the active editor page
-               getActiveEditor().setFocus();
-       }
-
-       /** {@inheritDoc} */
+        return conversation;
+    }
+
+    /**
+     * <p>
+     * setConversationHolder
+     * </p>
+     *
+     * @param conversation
+     *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
+     *            object.
+     */
+    public void setConversationHolder(ConversationHolder conversation) {
+        this.conversation = conversation;
+    }
+
+    /**
+     * <p>
+     * Getter for the field <code>undoContext</code>.
+     * </p>
+     *
+     * @return a {@link org.eclipse.core.commands.operations.IUndoContext}
+     *         object.
+     */
+    public IUndoContext getUndoContext() {
+        return undoContext;
+    }
+
+    /**
+     * <p>
+     * Setter for the field <code>undoContext</code>.
+     * </p>
+     *
+     * @param undoContext
+     *            a {@link org.eclipse.core.commands.operations.IUndoContext}
+     *            object.
+     */
+    public void setUndoContext(IUndoContext undoContext) {
+        this.undoContext = undoContext;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void setFocus() {
+        // logger.warn("Setting focus to editor");
+        // bind the conversation
+        getConversationHolder().bind();
+        input.bind();
+        // pass focus to the active editor page
+        getActiveEditor().setFocus();
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.cdm.persistence.hibernate.ICdmPostCrudObserver#update(eu
+     * .etaxonomy.cdm.persistence.hibernate.CdmCrudEvent)
+     */
+    /** {@inheritDoc} */
     @Override
     public void update(CdmDataChangeMap events) {
         if (dataChangeBehavior == null) {
@@ -336,6 +421,13 @@ public class MultiPageTaxonEditor extends FormEditor implements
         DataChangeBridge.handleDataChange(events, dataChangeBehavior);
     }
 
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.taxeditor.store.operations.IPostOperationEnabled#postOperation
+     * ()
+     */
     /** {@inheritDoc} */
     @Override
     public boolean postOperation(CdmBase objectAffectedByOperation) {
@@ -353,68 +445,75 @@ public class MultiPageTaxonEditor extends FormEditor implements
         return false;
     }
 
-       /**
-        * Returns an <code>IEditorPart</code> implementation by type
-        *
-        * @param page
-        *            the page type
-        * @return a {@link eu.etaxonomy.taxeditor.editor.IMultiPageTaxonEditorPage}
-        *         object.
-        */
-       public IMultiPageTaxonEditorPage getPage(Page page) {
-               for (IEditorPart editor : this.getPages()) {
-                       if (editor.getClass().equals(page.getClazz())) {
-                               return (IMultiPageTaxonEditorPage) editor;
-                       }
-               }
-               return null;
-       }
-
-       /**
-        * Return a list of <code>AbstractTaxonEditor</code>s registered with this
-        * <code>MultiPageTaxonEditor</code>.
-        *
-        * @return a {@link java.util.List} object.
-        */
-       public List<IMultiPageTaxonEditorPage> getPages() {
-               ArrayList<IMultiPageTaxonEditorPage> editors = new ArrayList<IMultiPageTaxonEditorPage>();
-               for (int i = 0; i < this.getPageCount(); i++) {
-
-                       editors.add((IMultiPageTaxonEditorPage) this.getEditor(i));
-               }
-               return editors;
-       }
-
-       /**
-        * Refreshes a certain page of the MultipageTaxonEditor
-        *
-        * @param page
-        *            a {@link eu.etaxonomy.taxeditor.editor.Page} object.
-        * @return a boolean.
-        */
-       public boolean redraw(Page page) {
-               return redraw(page, true);
-       }
-
-       /**
-        * Refreshes a certain page of the MultipageTaxonEditor and sets focus to
-        * that page
-        *
-        * @param page
-        *            a {@link eu.etaxonomy.taxeditor.editor.Page} object.
-        * @param focus
-        *            a boolean.
-        * @return a boolean.
-        */
-       public boolean redraw(Page page, boolean focus) {
-               IMultiPageTaxonEditorPage editorPage = getPage(page);
-               return editorPage != null && editorPage.redraw(focus);
-       }
-
-       @Override
+    /**
+     * Returns an <code>IEditorPart</code> implementation by type
+     *
+     * @param page
+     *            the page type
+     * @return a {@link eu.etaxonomy.taxeditor.editor.IMultiPageTaxonEditorPage}
+     *         object.
+     */
+    public IMultiPageTaxonEditorPage getPage(Page page) {
+        for (IEditorPart editor : this.getPages()) {
+            if (editor.getClass().equals(page.getClazz())) {
+                return (IMultiPageTaxonEditorPage) editor;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Return a list of <code>AbstractTaxonEditor</code>s registered with this
+     * <code>MultiPageTaxonEditor</code>.
+     *
+     * @return a {@link java.util.List} object.
+     */
+    public List<IMultiPageTaxonEditorPage> getPages() {
+        ArrayList<IMultiPageTaxonEditorPage> editors = new ArrayList<IMultiPageTaxonEditorPage>();
+        for (int i = 0; i < this.getPageCount(); i++) {
+
+            editors.add((IMultiPageTaxonEditorPage) this.getEditor(i));
+        }
+        return editors;
+    }
+
+    /**
+     * Refreshes a certain page of the MultipageTaxonEditor
+     *
+     * @param page
+     *            a {@link eu.etaxonomy.taxeditor.editor.Page} object.
+     * @return a boolean.
+     */
+    public boolean redraw(Page page) {
+        return redraw(page, true);
+    }
+
+    /**
+     * Refreshes a certain page of the MultipageTaxonEditor and sets focus to
+     * that page
+     *
+     * @param page
+     *            a {@link eu.etaxonomy.taxeditor.editor.Page} object.
+     * @param focus
+     *            a boolean.
+     * @return a boolean.
+     */
+    public boolean redraw(Page page, boolean focus) {
+        IMultiPageTaxonEditorPage editorPage = getPage(page);
+        return editorPage != null && editorPage.redraw(focus);
+    }
+
+    /**
+     * <p>
+     * onComplete
+     * </p>
+     *
+     * @return a boolean.
+     */
+    @Override
     public boolean onComplete() {
-               return false;
-       }
+        return false;
+    }
 
     /**
      * Reloads the data for this
@@ -444,22 +543,26 @@ public class MultiPageTaxonEditor extends FormEditor implements
         }
     }
 
-       @Override
-       public String toString() {
-               return String.format("%s[%s]", this.getClass().getSimpleName(), getEditorInput());
-       }
-
-       @Override
-       public boolean permissionsSatisfied() {
-               IEditorPart activeEditor = getActiveEditor();
-               if(activeEditor != null && ISecuredEditor.class.isAssignableFrom(activeEditor.getClass())){
-                       return ((ISecuredEditor)activeEditor).permissionsSatisfied();
-               }
-               return true;
-       }
-
-       @Override
-       public boolean canAttachMedia() {
-           return true;
-       }
+    @Override
+    public String toString() {
+        return String.format("%s[%s]", this.getClass().getSimpleName(), getEditorInput());
+    }
+
+    @Override
+    public boolean permissionsSatisfied() {
+        IEditorPart activeEditor = getActiveEditor();
+        if(activeEditor != null && ISecuredEditor.class.isAssignableFrom(activeEditor.getClass())){
+            return ((ISecuredEditor)activeEditor).permissionsSatisfied();
+        }
+        return true;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.model.IPartContentHasMedia#canAttachMedia()
+     */
+    @Override
+    public boolean canAttachMedia() {
+        return true;
+    }
+
 }
index d0a7b205caa42da4894b53c89c0fb1db7ec9b52c..fc6951c5cf732d87a2466bb6f66c0b04f41c6971 100644 (file)
@@ -1,15 +1,19 @@
 /**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
 
 package eu.etaxonomy.taxeditor.editor;
 
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 
@@ -46,345 +50,369 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @created 19.03.2009
  * @version 1.0
  */
-public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPersistableElement {
+public class TaxonEditorInput  extends CdmEntitySessionInput implements IEditorInput, IConversationEnabled, IPersistableElement {
 
-       private final ConversationHolder conversation;
+    private final ConversationHolder conversation;
 
-       private final TaxonNode taxonNode;
+    private TaxonNode taxonNode;
 
-       private TaxonEditorInputDataChangeBehaviour dataChangeBehavior;
+    private TaxonEditorInputDataChangeBehaviour dataChangeBehavior;
 
-       private TaxonBase initiallySelectedTaxonBase;
+    private TaxonBase initiallySelectedTaxonBase;
 
-       private TaxonEditorInput(TaxonNode taxonNode, ConversationHolder conversation){
-               this.conversation = conversation;
-               this.taxonNode = taxonNode;
-       }
+    private enum CdmType {
+        TAXON_NODE,
+        TAXON_BASE,
+        PARENT_TAXON_NODE
+    }
 
+    private TaxonEditorInput(UUID uuid, CdmType type) {
+        super(true);
+        this.conversation = CdmStore.createConversation();
+        switch(type) {
+        case PARENT_TAXON_NODE:
+            initForParentTaxonNode(uuid);
+            break;
+        case TAXON_BASE:
+            initForTaxonBase(uuid);
+            break;
+        case TAXON_NODE:
+            initForTaxonNode(uuid);
+            break;
+        }
+    }
 
+    private void init(TaxonNode taxonNode) {
+        this.taxonNode = taxonNode;
+    }
 
-       /**
-        * <p>NewInstance</p>
-        *
-        * @param taxonNodeUuid a {@link java.util.UUID} object.
-        * @return a {@link eu.etaxonomy.taxeditor.editor.TaxonEditorInput} object.
-        * @throws java.lang.Exception if any.
-        */
-       public static TaxonEditorInput NewInstance(UUID taxonNodeUuid) throws Exception{
-               try{
-                       ConversationHolder conversation = CdmStore.createConversation();
-                       return NewInstance(taxonNodeUuid, conversation);
-               }catch(Exception e){
-                       throw e;
-               }
-       }
 
     /**
+     * <p>NewInstance</p>
      *
-     * @param taxonNodeUuid
-     * @param conversation
-     * @return
+     * @param taxonNodeUuid a {@link java.util.UUID} object.
+     * @return a {@link eu.etaxonomy.taxeditor.editor.TaxonEditorInput} object.
+     * @throws java.lang.Exception if any.
      */
-    private static TaxonEditorInput NewInstance(UUID taxonNodeUuid, ConversationHolder conversation){
+    private void initForTaxonNode(UUID taxonNodeUuid) {
 
 
-       TaxonNode taxonNode = CdmStore.getService(ITaxonNodeService.class).load(taxonNodeUuid, null);
+        TaxonNode taxonNode = CdmStore.getService(ITaxonNodeService.class).load(taxonNodeUuid, getTaxonNodePropertyPaths());
 
-               if(taxonNode == null){
-                       MessagingUtils.warningDialog("Not yet implemented", TaxonEditorInput.class, "Selected element is not of type TaxonNode but [null].");
-                       return null;
-               }
+        if(taxonNode == null){
+            MessagingUtils.warningDialog("Not yet implemented", TaxonEditorInput.class, "Selected element is not type TaxonBase.");
+        }
+        init(taxonNode);
+
+    }
 
-       return new TaxonEditorInput(taxonNode, conversation);
+    private void initForTaxonBase(UUID taxonBaseUuid) {
+        TaxonBase taxonBase = CdmStore.getService(ITaxonService.class).load(taxonBaseUuid, getTaxonBasePropertyPaths());
+        if (taxonBase != null){
+            if(taxonBase.isInstanceOf(Taxon.class)){
+                Taxon taxon = CdmBase.deproxy(taxonBase, Taxon.class);
+
+                if (taxon.getTaxonNodes().size() == 0 && taxon.isMisapplication()){
+                    // TODO get accepted taxon
+                    MessagingUtils.info("trying to open Mispplied Name ");
+
+                    Set<Taxon> acceptedTaxa = new HashSet<Taxon>();
+                    Set<TaxonRelationship> relations = taxon.getRelationsFromThisTaxon();
+                    for(TaxonRelationship relation : relations){
+                        if(relation.getType().equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR())){
+                            acceptedTaxa.add(relation.getToTaxon());
+                        }
+                    }
+                    setInputForMultipleTaxa(conversation, acceptedTaxa);
+
+                }else{
+                    setInputForMultipleNodes(conversation, taxon.getTaxonNodes());
+                }
+            }else if(taxonBase instanceof Synonym){
+                Synonym synonym = (Synonym) taxonBase;
+
+                Set<Taxon> taxa = synonym.getAcceptedTaxa();
+                setInputForMultipleTaxa(conversation, taxa);
+            }
+        }
     }
 
+
     /**
-     * <p>NewInstanceFromTaxonBase</p>
+     * <p>NewEmptyInstance</p>
      *
-     * @param taxonBaseUuid a {@link java.util.UUID} object.
+     * @param parentNodeUuid a {@link java.util.UUID} object.
      * @return a {@link eu.etaxonomy.taxeditor.editor.TaxonEditorInput} object.
      */
-    public static TaxonEditorInput NewInstanceFromTaxonBase(UUID taxonBaseUuid){
-       ConversationHolder conversation = CdmStore.createConversation();
-
-       TaxonEditorInput input = null;
-
-       TaxonBase taxonBase = CdmStore.getService(ITaxonService.class).find(taxonBaseUuid);
-       if (taxonBase != null){
-               if(taxonBase.isInstanceOf(Taxon.class)){
-                       Taxon taxon = CdmBase.deproxy(taxonBase, Taxon.class);
-
-                       if (taxon.getTaxonNodes().size() == 0 && taxon.isMisapplication()){
-                               // TODO get accepted taxon
-                               MessagingUtils.info("trying to open misapplied Name ");
-
-                               Set<Taxon> acceptedTaxa = new HashSet<Taxon>();
-                               Set<TaxonRelationship> relations = taxon.getRelationsFromThisTaxon();
-                               for(TaxonRelationship relation : relations){
-                                       if(relation.getType().equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR())){
-                                               acceptedTaxa.add(relation.getToTaxon());
-                                       }
-                               }
-                               input =  getInputForMultipleTaxa(conversation, acceptedTaxa);
-
-                       }else{
-                               input = getInputForMultipleNodes(conversation, taxon.getTaxonNodes());
-                       }
-               }else if(taxonBase instanceof Synonym){
-                       Synonym synonym = (Synonym) taxonBase;
-
-                       Set<Taxon> taxa = synonym.getAcceptedTaxa();
-                       input = getInputForMultipleTaxa(conversation, taxa);
-               }
-               if (input != null){
-                       input.setInitiallySelectedTaxonBase(taxonBase);
-               }
-       }
-
-
-       return input;
+    private void initForParentTaxonNode(UUID parentNodeUuid){
+
+
+        TaxonNameBase<?, ?> name = PreferencesUtil.getPreferredNomenclaturalCode().getNewTaxonNameInstance(null);
+        ITaxonTreeNode parentNode = CdmStore.getService(IClassificationService.class).getTreeNodeByUuid(parentNodeUuid);
+
+        Taxon newTaxon = Taxon.NewInstance(name, parentNode.getReference());
+        TaxonNode newTaxonNode = parentNode.addChildTaxon(newTaxon, parentNode.getReference(), parentNode.getMicroReference());
+
+        // add the new taxon to the editors persistence context
+        UUID newTaxonNodeUuid = CdmStore.getService(ITaxonNodeService.class).save(newTaxonNode).getUuid();
+
+        initForTaxonNode(newTaxonNodeUuid);
     }
 
-       private static TaxonEditorInput getInputForMultipleNodes(ConversationHolder conversation, Set<TaxonNode> taxonNodes){
-       if(taxonNodes.size() == 1){
-               TaxonNode taxonNode = taxonNodes.iterator().next();
-               return NewInstance(taxonNode.getUuid(), conversation);
-       }else if(taxonNodes.size() > 1){
-                       TaxonNode taxonNode = ChooseFromMultipleTaxonNodesDialog.choose(taxonNodes);
-                       if(taxonNode != null){
-                               return NewInstance(taxonNode.getUuid(), conversation);
-                       }
-               }else if(taxonNodes.size() == 0){
-                       // this is an undesired state
-                       MessagingUtils.warningDialog("Incorrect state", TaxonEditorInput.class, "The accepted taxon is not part of any classification. This should not have happened.");
-               }
-       return null;
+
+
+
+    private void setInputForMultipleNodes(ConversationHolder conversation, Set<TaxonNode> taxonNodes){
+        if(taxonNodes.size() == 1){
+            TaxonNode taxonNode = taxonNodes.iterator().next();
+            init(taxonNode);
+        }else if(taxonNodes.size() > 1){
+            TaxonNode taxonNode = ChooseFromMultipleTaxonNodesDialog.choose(taxonNodes);
+            if(taxonNode != null){
+                init(taxonNode);
+            }
+        }else if(taxonNodes.size() == 0){
+            // this is an undesired state
+            MessagingUtils.warningDialog("Incorrect state", TaxonEditorInput.class, "The accepted taxon is not part of any classification. This should not have happened.");
+        }
     }
 
-    private static TaxonEditorInput getInputForMultipleTaxa(ConversationHolder conversation, Set<Taxon> taxa){
-       if(taxa.size() == 1){
-               Taxon taxon = taxa.iterator().next();
-               Set<TaxonNode> nodes = taxon.getTaxonNodes();
-               return getInputForMultipleNodes(conversation, nodes);
-       }else if(taxa.size() > 1){
-               Set<TaxonNode> taxonNodes = new HashSet<TaxonNode>();
-                       for ( Taxon taxon : taxa ){
-                               taxonNodes.addAll(taxon.getTaxonNodes());
-                       }
-                       return getInputForMultipleNodes(conversation, taxonNodes);
-               }else if(taxa.size() == 0){
-                       // this is an undesired state
-                       MessagingUtils.warningDialog("Incorrect state", TaxonEditorInput.class, "Trying to open accepted taxon for a synonym or misapplication but" +
-                                       " no accepted taxa are present. This should not have happened.");
-               }
-       return null;
+    private void setInputForMultipleTaxa(ConversationHolder conversation, Set<Taxon> taxa){
+        if(taxa.size() == 1){
+            Taxon taxon = taxa.iterator().next();
+            Set<TaxonNode> nodes = taxon.getTaxonNodes();
+            setInputForMultipleNodes(conversation, nodes);
+        }else if(taxa.size() > 1){
+            Set<TaxonNode> taxonNodes = new HashSet<TaxonNode>();
+            for ( Taxon taxon : taxa ){
+                taxonNodes.addAll(taxon.getTaxonNodes());
+            }
+            setInputForMultipleNodes(conversation, taxonNodes);
+        }else if(taxa.size() == 0){
+            // this is an undesired state
+            MessagingUtils.warningDialog("Incorrect state", TaxonEditorInput.class, "Trying to open accepted taxon for a synonym or misapplication but" +
+                    " no accepted taxa are present. This should not have happened.");
+        }
     }
 
     /**
-     * <p>NewEmptyInstance</p>
+     * <p>NewInstance</p>
      *
-     * @param parentNodeUuid a {@link java.util.UUID} object.
+     * @param taxonNodeUuid a {@link java.util.UUID} object.
      * @return a {@link eu.etaxonomy.taxeditor.editor.TaxonEditorInput} object.
+     * @throws java.lang.Exception if any.
      */
-    public static TaxonEditorInput NewEmptyInstance(UUID parentNodeUuid){
-       ConversationHolder conversation = CdmStore.createConversation();
+    public static TaxonEditorInput NewInstance(UUID taxonNodeUuid) throws Exception {
+        return new TaxonEditorInput(taxonNodeUuid, CdmType.TAXON_NODE);
 
-               TaxonNameBase<?, ?> name = PreferencesUtil.getPreferredNomenclaturalCode().getNewTaxonNameInstance(null);
-               ITaxonTreeNode parentNode = CdmStore.getService(IClassificationService.class).getTreeNodeByUuid(parentNodeUuid);
+    }
 
-               Taxon newTaxon = Taxon.NewInstance(name, parentNode.getReference());
-               TaxonNode newTaxonNode = parentNode.addChildTaxon(newTaxon, parentNode.getReference(), parentNode.getMicroReference());
+    /**
+     * <p>NewInstanceFromTaxonBase</p>
+     *
+     * @param taxonBaseUuid a {@link java.util.UUID} object.
+     * @return a {@link eu.etaxonomy.taxeditor.editor.TaxonEditorInput} object.
+     */
+    public static TaxonEditorInput NewInstanceFromTaxonBase(UUID taxonBaseUuid){
+        return new TaxonEditorInput(taxonBaseUuid, CdmType.TAXON_BASE);
+    }
 
-               // add the new taxon to the editors persistence context
-               UUID newTaxonNodeUuid = CdmStore.getService(ITaxonNodeService.class).save(newTaxonNode).getUuid();
 
-               return new TaxonEditorInput(newTaxonNode, conversation);
+    /**
+     * <p>NewEmptyInstance</p>
+     *
+     * @param parentNodeUuid a {@link java.util.UUID} object.
+     * @return a {@link eu.etaxonomy.taxeditor.editor.TaxonEditorInput} object.
+     */
+    public static TaxonEditorInput NewEmptyInstance(UUID parentNodeUuid){
+        return new TaxonEditorInput(parentNodeUuid, CdmType.PARENT_TAXON_NODE);
     }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IEditorInput#exists()
-        */
-       /**
-        * <p>exists</p>
-        *
-        * @return a boolean.
-        */
-       @Override
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#exists()
+     */
+    /**
+     * <p>exists</p>
+     *
+     * @return a boolean.
+     */
+    @Override
     public boolean exists() {
-               return taxonNode != null;
-       }
-
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
-        */
-       /**
-        * <p>getImageDescriptor</p>
-        *
-        * @return a {@link org.eclipse.jface.resource.ImageDescriptor} object.
-        */
-       @Override
+        return taxonNode != null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+     */
+    /**
+     * <p>getImageDescriptor</p>
+     *
+     * @return a {@link org.eclipse.jface.resource.ImageDescriptor} object.
+     */
+    @Override
     public ImageDescriptor getImageDescriptor() {
-               return null;
-       }
-
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IEditorInput#getName()
-        */
-       /**
-        * <p>getName</p>
-        *
-        * @return a {@link java.lang.String} object.
-        */
-       @Override
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#getName()
+     */
+    /**
+     * <p>getName</p>
+     *
+     * @return a {@link java.lang.String} object.
+     */
+    @Override
     public String getName() {
-               if(getTaxon() == null){
-                       return null;
-               }
-               TaxonNameBase<?, ?> name = getTaxon().getName();
-               if (name == null || name.getTitleCache() == null) {
-                       return "New taxon";
-               } else {
-                       return name.getTitleCache();
-               }
-       }
-
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IEditorInput#getPersistable()
-        */
-       /**
-        * <p>getPersistable</p>
-        *
-        * @return a {@link org.eclipse.ui.IPersistableElement} object.
-        */
-       @Override
+        if(getTaxon() == null){
+            return null;
+        }
+        TaxonNameBase<?, ?> name = getTaxon().getName();
+        if (name == null || name.getTitleCache() == null) {
+            return "New taxon";
+        } else {
+            return name.getTitleCache();
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#getPersistable()
+     */
+    /**
+     * <p>getPersistable</p>
+     *
+     * @return a {@link org.eclipse.ui.IPersistableElement} object.
+     */
+    @Override
     public IPersistableElement getPersistable() {
-//             if(CdmStore.isActive()){
-//                     TaxonNode test = CdmStore.getTaxonTreeService().getTaxonNodeByUuid(taxonNode.getUuid());
-//                     boolean isPersistable = CdmStore.getTaxonTreeService().getTaxonNodeByUuid(taxonNode.getUuid()) != null;
-//                     if (isPersistable) {
-//                             return this;
-//                     }
-//             }
-               return null;
-       }
-
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IEditorInput#getToolTipText()
-        */
-       /**
-        * <p>getToolTipText</p>
-        *
-        * @return a {@link java.lang.String} object.
-        */
-       @Override
+        //             if(CdmStore.isActive()){
+        //                     TaxonNode test = CdmStore.getTaxonTreeService().getTaxonNodeByUuid(taxonNode.getUuid());
+        //                     boolean isPersistable = CdmStore.getTaxonTreeService().getTaxonNodeByUuid(taxonNode.getUuid()) != null;
+        //                     if (isPersistable) {
+        //                             return this;
+        //                     }
+        //             }
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#getToolTipText()
+     */
+    /**
+     * <p>getToolTipText</p>
+     *
+     * @return a {@link java.lang.String} object.
+     */
+    @Override
     public String getToolTipText() {
-               return getName();
-       }
-
-       /* (non-Javadoc)
-        * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
-        */
-       /** {@inheritDoc} */
-       @Override
+        return getName();
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+     */
+    /** {@inheritDoc} */
+    @Override
     public Object getAdapter(Class adapter) {
 
-               if (adapter == Taxon.class) {
-                       return taxonNode.getTaxon();
-               }
+        if (adapter == Taxon.class) {
+            return getTaxon();
+        }
 
-               if (adapter == TaxonNode.class) {
-                       return taxonNode;
-               }
+        if (adapter == TaxonNode.class) {
+            return taxonNode;
+        }
 
-               return null;
-       }
+        return null;
+    }
 
-       /**
-        * {@inheritDoc}
-        *
-        * Overrides equals to ensure that a taxon can only be edited by
-        * one editor at a time.
-        */
-       @Override
+    /**
+     * {@inheritDoc}
+     *
+     * Overrides equals to ensure that a taxon can only be edited by
+     * one editor at a time.
+     */
+    @Override
     public boolean equals(Object obj) {
-               if (TaxonEditorInput.class.equals(obj.getClass())
-                               && getTaxon() != null
-                               && getTaxon().equals(((TaxonEditorInput) obj).getTaxon())){
-                       if(((TaxonEditorInput) obj).getInitiallySelectedTaxonBase() != null){
-                               setInitiallySelectedTaxonBase(((TaxonEditorInput) obj).getInitiallySelectedTaxonBase());
-                       }
-                       return true;
-               }
-               return false;
-       }
-
-       /**
-        * <p>getTaxon</p>
-        *
-        * @return the taxon
-        */
-       public Taxon getTaxon(){
-               return taxonNode.getTaxon();
-       }
-
-       /**
-        * <p>Getter for the field <code>taxonNode</code>.</p>
-        *
-        * @return the taxonNode
-        */
-       public TaxonNode getTaxonNode() {
-               return taxonNode;
-       }
-
-       /*
-        * (non-Javadoc)
-        * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
-        */
-       /**
-        * <p>getConversationHolder</p>
-        *
-        * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        */
-       @Override
+        if (TaxonEditorInput.class.equals(obj.getClass())
+                && getTaxon() != null
+                && getTaxon().equals(((TaxonEditorInput) obj).getTaxon())){
+            if(((TaxonEditorInput) obj).getInitiallySelectedTaxonBase() != null){
+                setInitiallySelectedTaxonBase(((TaxonEditorInput) obj).getInitiallySelectedTaxonBase());
+            }
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * <p>getTaxon</p>
+     *
+     * @return the taxon
+     */
+    public Taxon getTaxon(){
+        Taxon taxon = CdmBase.deproxy(taxonNode.getTaxon(), Taxon.class);
+        return taxon;
+    }
+
+    /**
+     * <p>Getter for the field <code>taxonNode</code>.</p>
+     *
+     * @return the taxonNode
+     */
+    public TaxonNode getTaxonNode() {
+        return taxonNode;
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
+     */
+    /**
+     * <p>getConversationHolder</p>
+     *
+     * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
+     */
+    @Override
     public ConversationHolder getConversationHolder() {
-               return conversation;
-       }
-
-       /*
-        * (non-Javadoc)
-        * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostCrudObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmCrudEvent)
-        */
-       /** {@inheritDoc} */
-       @Override
+        return conversation;
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostCrudObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmCrudEvent)
+     */
+    /** {@inheritDoc} */
+    @Override
     public void update(CdmDataChangeMap events) {
-               if(dataChangeBehavior == null){
-                       dataChangeBehavior = new TaxonEditorInputDataChangeBehaviour(this);
-               }
-
-               DataChangeBridge.handleDataChange(events, dataChangeBehavior);
-       }
-
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IPersistableElement#getFactoryId()
-        */
-       /**
-        * <p>getFactoryId</p>
-        *
-        * @return a {@link java.lang.String} object.
-        */
-       @Override
+        if(dataChangeBehavior == null){
+            dataChangeBehavior = new TaxonEditorInputDataChangeBehaviour(this);
+        }
+
+        DataChangeBridge.handleDataChange(events, dataChangeBehavior);
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IPersistableElement#getFactoryId()
+     */
+    /**
+     * <p>getFactoryId</p>
+     *
+     * @return a {@link java.lang.String} object.
+     */
+    @Override
     public String getFactoryId() {
-               return TaxonEditorInputFactory.getFactoryId();
-       }
-
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
-        */
-       /** {@inheritDoc} */
-       @Override
+        return TaxonEditorInputFactory.getFactoryId();
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
+     */
+    /** {@inheritDoc} */
+    @Override
     public void saveState(IMemento memento) {
-               TaxonEditorInputFactory.saveState(memento, this);
-       }
+        TaxonEditorInputFactory.saveState(memento, this);
+    }
 
 
     /**
@@ -393,20 +421,91 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
      * @param taxonBase a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.
      */
     public void setInitiallySelectedTaxonBase(TaxonBase taxonBase) {
-               this.initiallySelectedTaxonBase = taxonBase;
-       }
-
-       /**
-        * <p>Getter for the field <code>initiallySelectedTaxonBase</code>.</p>
-        *
-        * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.
-        */
-       public TaxonBase getInitiallySelectedTaxonBase() {
-               return initiallySelectedTaxonBase;
-       }
-
-       @Override
-       public String toString() {
-               return String.format("%s[%s]", this.getClass().getSimpleName(), getTaxon());
-       }
+        this.initiallySelectedTaxonBase = taxonBase;
+    }
+
+    /**
+     * <p>Getter for the field <code>initiallySelectedTaxonBase</code>.</p>
+     *
+     * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.
+     */
+    public TaxonBase getInitiallySelectedTaxonBase() {
+        return initiallySelectedTaxonBase;
+    }
+
+//    @Override
+//    public String toString() {
+//        return String.format("%s[%s]", this.getClass().getSimpleName(), getTaxon());
+//    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getRootEntities()
+     */
+    @Override
+    public List<TaxonNode> getRootEntities() {
+        return Arrays.asList(taxonNode);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput#merge()
+     */
+    @Override
+    public void merge() {
+        if(CdmStore.getCurrentSessionManager().isRemoting()) {
+            CdmStore.getService(ITaxonNodeService.class).merge(taxonNode, true);
+        }
+    }
+
+    @Override
+    public Map<Object, List<String>> getPropertyPathsMap() {
+        return null;
+    }
+
+    private List<String> getTaxonNodePropertyPaths() {
+        List<String> taxonNodePropertyPaths = new ArrayList<String>();
+        for(String propertyPath : getTaxonBasePropertyPaths()) {
+            taxonNodePropertyPaths.add("taxon." + propertyPath);
+        }
+        return taxonNodePropertyPaths;
+    }
+
+    private List<String> getTaxonBasePropertyPaths() {
+        List<String> taxonBasePropertyPaths = Arrays.asList(new String[] {
+                "sec",
+                "createdBy",
+                "updatedBy",
+                "annotations",
+                "markers",
+                "credits",
+                "extensions",
+                "rights",
+                "sources",
+                "descriptions",
+                "relationsToThisTaxon",
+                "relationsFromThisTaxon",
+                "taxonNodes",
+                "descriptions.descriptionElements.feature",
+                "descriptions.descriptionElements.area",
+                "descriptions.descriptionElements.status",
+                "descriptions.markers",
+                "name.descriptions",
+                "name.typeDesignations",
+                "name.status",
+                "name.nomenclaturalReference.inReference",
+                "name.taxonBases.taxonNodes",
+                "name.relationsFromThisName",
+                "name.relationsToThisName",
+                "name.homotypicalGroup.typifiedNames.taxonBases.synonymRelations.synonym.name.status",
+                "name.homotypicalGroup.typifiedNames.relationsToThisName.fromName",
+                "synonymRelations.synonym.name.status.type",
+                "synonymRelations.synonym.name.relationsToThisName.fromName",
+                "synonymRelations.synonym.name.nomenclaturalReference.inReference.authorship",
+                "synonymRelations.synonym.name.nomenclaturalReference.authorship",
+                "synonymRelations.synonym.name.homotypicalGroup.typifiedNames.taxonBases.synonymRelations"
+        });
+
+        return taxonBasePropertyPaths;
+    }
+
 }
index a5bf4e6bedcf4aa0357509d06b8f6214c8ea451c..5c697e7f343913c9e74973b25e29bcc3c14cf198 100644 (file)
@@ -66,6 +66,7 @@ public class CdmAuthorityEditor extends EditorPart implements IConversationEnabl
        @Override
        public void setFocus() {
            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setFocus();
+           ((CdmAuthorityEditorInput) getEditorInput()).bind();
        }
 
        /* (non-Javadoc)
@@ -76,6 +77,7 @@ public class CdmAuthorityEditor extends EditorPart implements IConversationEnabl
                try {
                        monitor.beginTask("Saving CDM Authority Editor", 1);
                        getConversationHolder().commit(true);
+                       ((CdmAuthorityEditorInput) getEditorInput()).merge();
                        dirty = false;
                        firePropertyChange(PROP_DIRTY);
                        monitor.worked(1);
@@ -172,6 +174,7 @@ public class CdmAuthorityEditor extends EditorPart implements IConversationEnabl
        public void dispose() {
                conversation.unregisterForDataStoreChanges(this);
                conversation.close();
+               ((CdmAuthorityEditorInput) getEditorInput()).getCdmEntitySession().dispose();
                super.dispose();
        }
 }
index 0e2553a51756e8a4d3dad6c6c607ee3dd78a533b..fa78b41d88044db94249d9b55fe250b10df73211 100644 (file)
@@ -1,57 +1,62 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 package eu.etaxonomy.taxeditor.editor.group.authority;
 
+import java.util.Arrays;
+import java.util.Collection;
 import java.util.UUID;
 
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IPersistableElement;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IGroupService;
 import eu.etaxonomy.cdm.model.common.Group;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * Editor input for the {@link CdmAuthorityEditor}.
- * 
+ *
  * @author cmathew
  * @created Mar 28, 2013
  *
  */
 
-public class CdmAuthorityEditorInput implements IEditorInput, IConversationEnabled {
+public class CdmAuthorityEditorInput extends CdmEntitySessionInput implements IEditorInput, IConversationEnabled {
        private ConversationHolder conversation;
        private Group group;
-       
+
        protected CdmAuthorityEditorInput(ConversationHolder conversation, Group group) {
+           super(true);
                this.conversation = conversation;
-               this.group = group;
-               
+               this.group = CdmApplicationState.getCurrentAppConfig().getGroupService().load(group.getUuid());
+
        }
-       
+
        /**
         * Creates a new instance of the input for a given group.
-        * 
+        *
         * @param groupUuid
         * @return
         * @throws Exception
         */
        public static CdmAuthorityEditorInput NewInstance(UUID groupUuid) throws Exception{
                ConversationHolder conversation = CdmStore.createConversation();
-               Group group = CdmStore.getService(IGroupService.class).load(groupUuid, null);                   
+               Group group = CdmStore.getService(IGroupService.class).load(groupUuid, null);
                return new CdmAuthorityEditorInput(conversation, group);
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
         */
@@ -59,8 +64,8 @@ public class CdmAuthorityEditorInput implements IEditorInput, IConversationEnabl
        public Object getAdapter(Class adapter) {
                if (adapter == Group.class) {
                        return this.group;
-               }               
-               
+               }
+
                return null;
        }
        /* (non-Javadoc)
@@ -69,7 +74,7 @@ public class CdmAuthorityEditorInput implements IEditorInput, IConversationEnabl
        @Override
        public void update(CdmDataChangeMap changeEvents) {
                // TODO Auto-generated method stub
-               
+
        }
        /* (non-Javadoc)
         * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
@@ -114,8 +119,8 @@ public class CdmAuthorityEditorInput implements IEditorInput, IConversationEnabl
        @Override
        public String getToolTipText() {
                return getName();
-       }       
-       
+       }
+
        /* (non-Javadoc)
         * @see java.lang.Object#equals(java.lang.Object)
         */
@@ -129,13 +134,31 @@ public class CdmAuthorityEditorInput implements IEditorInput, IConversationEnabl
                }
                return super.equals(object);
        }
-       
+
        /**
         * Getter method for group member.
-        * 
+        *
         * @return
         */
        public Group getGroup() {
                return this.group;
        }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getRootEntities()
+     */
+    @Override
+    public Collection<Group> getRootEntities() {
+        return Arrays.asList(group);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput#merge()
+     */
+    @Override
+    public void merge() {
+        if(CdmStore.getCurrentSessionManager().isRemoting()) {
+            group = CdmStore.getService(IGroupService.class).merge(group, true).getMergedEntity();
+        }
+    }
 }
index 318191f82fa760fed8d2b965fd9bf183f57cb0a0..4ef59f6c1433f5935d69d4292783e69bb6cca948 100644 (file)
@@ -1,60 +1,22 @@
 package eu.etaxonomy.taxeditor.editor.handler;
 
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.UUID;
-
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.handlers.HandlerUtil;
 
-import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 public class OpenDerivateViewHandler extends AbstractHandler {
 
-    /* (non-Javadoc)
-     * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-     */
     @Override
     public Object execute(ExecutionEvent event) throws ExecutionException {
-        ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
-        if(currentSelection instanceof IStructuredSelection){
-            Iterator<?> selectionIterator = ((IStructuredSelection) currentSelection).iterator();
-            Set<UUID> selectedElementUUIDs = new HashSet<UUID>();
-            while(selectionIterator.hasNext()){
-                Object object = selectionIterator.next();
-                if(object instanceof SpecimenOrObservationBase<?>){
-                    selectedElementUUIDs.add(((SpecimenOrObservationBase<?>) object).getUuid());
-                }
-                else if(object instanceof IndividualsAssociation){
-                    SpecimenOrObservationBase specimen = ((IndividualsAssociation) object).getAssociatedSpecimenOrObservation();
-                    if(specimen!=null){
-                        selectedElementUUIDs.add(specimen.getUuid());
-                    }
-                }
-            }
-            if(!selectedElementUUIDs.isEmpty()){
-                DerivateViewEditorInput input = new DerivateViewEditorInput(selectedElementUUIDs);
-                try {
-                    EditorUtil.open(input);
-                } catch (PartInitException e) {
-                    MessagingUtils.error(OpenDerivateViewHandler.class, "Could not open Derivative Editor", e);
-                } catch (NullPointerException npe){
-                    MessagingUtils.messageDialog("Failed to open Editor", OpenDerivateViewHandler.class, "Could not open Derivative Editor. The derivate hierarchy is corrupted!", npe);
-                }
-            }
-            else{
-                MessagingUtils.informationDialog("Empty selection", "No Specimen selected.");
-            }
+        try {
+            EditorUtil.open(new DerivateViewEditorInput());
+        } catch (PartInitException e) {
+            MessagingUtils.error(OpenDerivateViewHandler.class, "Derivative Editor could not be opened", e);
         }
         return null;
     }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenTaxonEditorHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenTaxonEditorHandler.java
deleted file mode 100644 (file)
index b416726..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-package eu.etaxonomy.taxeditor.editor.handler;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.ParameterType;
-import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.ui.PartInitException;
-
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-
-
-public class OpenTaxonEditorHandler extends AbstractHandler {
-
-    @Override
-    public Object execute(ExecutionEvent event) throws ExecutionException {
-        Object object = event.getObjectParameterForExecution("eu.etaxonomy.taxeditor.editor.taxonParameter");
-
-        try {
-            ParameterType parameterType = event.getCommand().getParameterType("eu.etaxonomy.taxeditor.editor.taxonParameter");
-            if(parameterType.isCompatible(object)){
-                EditorUtil.openTaxonEditor(object);
-            }
-        } catch (NotDefinedException e) {
-            MessagingUtils.error(this.getClass(), "Parameter type not defined", e);
-        } catch (PartInitException e) {
-            MessagingUtils.error(OpenTaxonEditorHandler.class, "Error opening the editor", e);
-        }
-        return null;
-    }
-
-}
index eb3995c8e6bb215aa3602a0449e2f30a852b9bec..ec87507347dcae1450e3727e8a03b29fea76c186 100644 (file)
@@ -2,12 +2,17 @@ package eu.etaxonomy.taxeditor.editor.handler;
 
 
 import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.jface.util.LocalSelectionTransfer;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.TreeNode;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
 
 import eu.etaxonomy.cdm.model.molecular.Sequence;
 import eu.etaxonomy.cdm.model.molecular.SingleRead;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 
 
 
@@ -20,6 +25,8 @@ import eu.etaxonomy.taxeditor.editor.EditorUtil;
 public class SpecimenPropertyTester extends PropertyTester {
     private static final String SEQUENCE = "isSequence";
     private static final String SINGLE_READ = "isSingleRead";
+    private static final String IS_SINGLEREAD_REUSABLE_HERE = "isSingleReadReusableHere";
+    private static final String IS_SINGLEREAD_REUSED = "isSingleReadReused";
 
 
     public SpecimenPropertyTester() {}
@@ -37,12 +44,39 @@ public class SpecimenPropertyTester extends PropertyTester {
                 else if (SINGLE_READ.equals(property)) {
                        return isSingleReadAlignment(treeNodeOfSelection.getValue());
                 }
+                else if (IS_SINGLEREAD_REUSABLE_HERE.equals(property)) {
+                    return isSingleReadReusableHere(treeNodeOfSelection.getValue());
+                }
+                else if (IS_SINGLEREAD_REUSED.equals(property)) {
+                    return isSingleReadReused(treeNodeOfSelection.getValue());
+                }
             }
         }
         return false;
     }
 
-       private boolean isSequence(Object object) {
+    private boolean isSingleReadReused(Object value) {
+        final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+        final IEditorPart activeEditor = window.getActivePage().getActiveEditor();
+        if(value instanceof SingleRead){
+            if(activeEditor instanceof DerivateView
+                    && ((DerivateView) activeEditor).getMultiLinkSingleReads().contains(value)){
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private boolean isSingleReadReusableHere(Object value) {
+        TreeNode clipboardNode = EditorUtil.getTreeNodeOfSelection(LocalSelectionTransfer.getTransfer().getSelection());
+        if(value instanceof Sequence && clipboardNode!=null && clipboardNode.getValue() instanceof SingleRead
+                && !((Sequence) value).getSingleReads().contains(clipboardNode.getValue())){
+            return true;
+        }
+        return false;
+    }
+
+    private boolean isSequence(Object object) {
        return (object instanceof Sequence);
        }
 
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/TaxonParameterConverter.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/TaxonParameterConverter.java
deleted file mode 100644 (file)
index 0283f4d..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package eu.etaxonomy.taxeditor.editor.handler;
-
-import java.util.UUID;
-
-import org.eclipse.core.commands.AbstractParameterValueConverter;
-import org.eclipse.core.commands.ParameterValueConversionException;
-
-import eu.etaxonomy.cdm.api.service.ITaxonService;
-import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-public class TaxonParameterConverter extends AbstractParameterValueConverter {
-
-    public TaxonParameterConverter() {
-    }
-
-    @Override
-    public Object convertToObject(String parameterValue) throws ParameterValueConversionException {
-        return CdmStore.getService(ITaxonService.class).load(UUID.fromString(parameterValue));
-    }
-
-    @Override
-    public String convertToString(Object parameterValue) throws ParameterValueConversionException {
-        if(parameterValue instanceof TaxonBase<?>){
-            return ((TaxonBase<?>) parameterValue).getUuid().toString();
-        }
-        return null;
-    }
-
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/create/NewSpecimenHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/create/NewSpecimenHandler.java
deleted file mode 100644 (file)
index 8ada87f..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.editor.handler.create;
-
-import java.util.Collections;
-
-import org.apache.log4j.Logger;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.PartInitException;
-
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeCacheStrategy;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeFieldUnitCacheStrategy;
-import eu.etaxonomy.cdm.api.service.IOccurrenceService;
-import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
-import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-/**
- * <p>NewSpecimenHandler class.</p>
- *
- * @author n.hoffmann
- * @created Jun 16, 2010
- * @version 1.0
- */
-public class NewSpecimenHandler extends AbstractHandler {
-       private static final Logger logger = Logger
-                       .getLogger(NewSpecimenHandler.class);
-
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-        */
-       /** {@inheritDoc} */
-       @Override
-    public Object execute(ExecutionEvent event) throws ExecutionException {
-           ConversationHolder conversation = CdmStore.createConversation();
-           conversation.bind();
-           FieldUnit fieldUnit = FieldUnit.NewInstance();
-           DerivedUnit derivedUnit = DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
-           DerivationEvent.NewSimpleInstance(fieldUnit, derivedUnit, DerivationEventType.GATHERING_IN_SITU());
-           fieldUnit.setCacheStrategy(new DerivedUnitFacadeFieldUnitCacheStrategy());
-           derivedUnit.setCacheStrategy(new DerivedUnitFacadeCacheStrategy());
-        CdmStore.getService(IOccurrenceService.class).save(fieldUnit);
-        CdmStore.getService(IOccurrenceService.class).save(derivedUnit);
-        conversation.commit();
-        DerivateViewEditorInput input = new DerivateViewEditorInput(Collections.singleton(fieldUnit.getUuid()));
-        try {
-            EditorUtil.open(input);
-        } catch (PartInitException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-//             NewDerivedUnitBaseWizard wizard = new NewDerivedUnitBaseWizard();
-//             wizard.init(null, null);
-//             WizardDialog dialog = new WizardDialog(HandlerUtil.getActiveShell(event), wizard);
-//             dialog.open();
-               return null;
-       }
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/defaultHandler/DefaultOpenTaxonEditorForTaxonHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/defaultHandler/DefaultOpenTaxonEditorForTaxonHandler.java
new file mode 100644 (file)
index 0000000..7584a80
--- /dev/null
@@ -0,0 +1,31 @@
+package eu.etaxonomy.taxeditor.editor.handler.defaultHandler;
+import java.util.UUID;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.ui.PartInitException;
+
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.handler.defaultHandler.DefaultOpenHandlerBase;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+
+public class DefaultOpenTaxonEditorForTaxonHandler extends DefaultOpenHandlerBase<TaxonBase> {
+
+    @Override
+    protected TaxonBase getEntity(UUID uuid) {
+        return CdmStore.getService(ITaxonService.class).load(uuid);
+    }
+
+    @Override
+    protected void open(ExecutionEvent event, TaxonBase entity) {
+        try {
+            EditorUtil.openTaxonBase(entity.getUuid());
+        } catch (PartInitException e) {
+            MessagingUtils.error(DefaultOpenTaxonEditorForTaxonHandler.class, "Could not open taxon editor for taxon/synonym "+entity, e);
+        }
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/defaultHandler/DefaultOpenTaxonEditorForTaxonNodeHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/defaultHandler/DefaultOpenTaxonEditorForTaxonNodeHandler.java
new file mode 100644 (file)
index 0000000..52937c8
--- /dev/null
@@ -0,0 +1,33 @@
+package eu.etaxonomy.taxeditor.editor.handler.defaultHandler;
+import java.util.UUID;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.ui.PartInitException;
+
+import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.handler.defaultHandler.DefaultOpenHandlerBase;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+
+public class DefaultOpenTaxonEditorForTaxonNodeHandler extends DefaultOpenHandlerBase<TaxonNode> {
+
+    @Override
+    protected TaxonNode getEntity(UUID uuid) {
+        return CdmStore.getService(ITaxonNodeService.class).load(uuid);
+    }
+
+    @Override
+    protected void open(ExecutionEvent event, TaxonNode entity) {
+        TaxonEditorInput input = TaxonEditorInput.NewInstanceFromTaxonBase(entity.getTaxon().getUuid());
+        try {
+            EditorUtil.open(input);
+        } catch (PartInitException e) {
+            MessagingUtils.error(DefaultOpenTaxonEditorForTaxonNodeHandler.class, "Could not open taxon editor for taxon "+input.getTaxon(), e);
+        }
+    }
+
+}
index 4bf11c90dff393d6db4ec30929588e7f2533bfbf..15c75555946e302a0acfcbfec2ddb64a4c3d26b3 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.editor.key;
 
@@ -11,23 +11,25 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.description.IIdentificationKey;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput;
 
 /**
  * @author n.hoffmann
- * 
+ *
  */
 public abstract class AbstractIdentificationEditorInput<T extends IIdentificationKey>
-               implements IEditorInput, IConversationEnabled {
+               extends CdmEntitySessionInput implements IEditorInput, IConversationEnabled {
 
        private final ConversationHolder conversation;
 
        protected AbstractIdentificationEditorInput(ConversationHolder conversation) {
+           super(true);
                this.conversation = conversation;
        }
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
         */
        @Override
@@ -38,7 +40,7 @@ public abstract class AbstractIdentificationEditorInput<T extends IIdentificatio
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.IEditorInput#exists()
         */
        @Override
@@ -48,7 +50,7 @@ public abstract class AbstractIdentificationEditorInput<T extends IIdentificatio
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
         */
        @Override
@@ -59,7 +61,7 @@ public abstract class AbstractIdentificationEditorInput<T extends IIdentificatio
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.IEditorInput#getPersistable()
         */
        @Override
@@ -70,7 +72,7 @@ public abstract class AbstractIdentificationEditorInput<T extends IIdentificatio
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.IEditorInput#getToolTipText()
         */
        @Override
@@ -80,7 +82,7 @@ public abstract class AbstractIdentificationEditorInput<T extends IIdentificatio
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.IEditorInput#getName()
         */
        @Override
@@ -98,7 +100,7 @@ public abstract class AbstractIdentificationEditorInput<T extends IIdentificatio
        @Override
        public void update(CdmDataChangeMap changeEvents) {
        }
-       
+
        /* (non-Javadoc)
         * @see java.lang.Object#equals(java.lang.Object)
         */
index 7b9a605cf3719f445a17a58678363142ff271d39..5eecbd208e2b59fa4769b599f4199f2fa82dc49f 100644 (file)
 package eu.etaxonomy.taxeditor.editor.key;
 
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.forms.editor.FormEditor;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
+import eu.etaxonomy.cdm.api.application.ICdmChangeListener;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyGraphEditor;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListEditor;
 import eu.etaxonomy.taxeditor.model.DataChangeBridge;
@@ -32,7 +39,7 @@ import eu.etaxonomy.taxeditor.model.MessagingUtils;
  * @version 1.0
  */
 public class KeyEditor extends FormEditor implements IConversationEnabled,
-               IDirtyMarkable, IPartContentHasDetails {
+               IDirtyMarkable, IPartContentHasDetails, ICdmChangeListener {
 
        public static final String ID = "eu.etaxonomy.taxeditor.editor.key";
 
@@ -42,6 +49,22 @@ public class KeyEditor extends FormEditor implements IConversationEnabled,
 
        private KeyEditorDataChangeBehaviour dataChangeBehavior;
 
+       private PolytomousKeyEditorInput polytomousKeyEditorInput;
+
+       /*
+     * (non-Javadoc)
+     *
+     * @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite,
+     * org.eclipse.ui.IEditorInput)
+     */
+    @Override
+    public void init(IEditorSite site, IEditorInput input)
+            throws PartInitException {
+        polytomousKeyEditorInput = (PolytomousKeyEditorInput)input;
+        CdmApplicationState.getCurrentDataChangeService().register(this);
+        super.init(site, input);
+    }
+
        /*
         * (non-Javadoc)
         *
@@ -54,6 +77,7 @@ public class KeyEditor extends FormEditor implements IConversationEnabled,
                        monitor.beginTask("Saving Editor", 1);
                        getConversationHolder().bind();
                        getConversationHolder().commit(true);
+                       polytomousKeyEditorInput.merge();
                        setDirty(false);
                        monitor.worked(1);
                } finally {
@@ -85,6 +109,7 @@ public class KeyEditor extends FormEditor implements IConversationEnabled,
        public void setFocus() {
                getConversationHolder().commit(true);
                getConversationHolder().bind();
+               polytomousKeyEditorInput.bind();
                super.setFocus();
        }
        /*
@@ -181,6 +206,8 @@ public class KeyEditor extends FormEditor implements IConversationEnabled,
        public void dispose() {
                conversation.unregisterForDataStoreChanges(this);
                conversation.close();
+               polytomousKeyEditorInput.dispose();
+               CdmApplicationState.getCurrentDataChangeService().unregister(this);
                super.dispose();
        }
 
@@ -191,14 +218,13 @@ public class KeyEditor extends FormEditor implements IConversationEnabled,
         */
        @Override
        protected void addPages() {
-               AbstractIdentificationEditorInput input = (AbstractIdentificationEditorInput) getEditorInput();
-               conversation = input.getConversationHolder();
+               conversation = polytomousKeyEditorInput.getConversationHolder();
                conversation.registerForDataStoreChanges(this);
 
                try {
-                       addPage(0, new PolytomousKeyListEditor(this), input);
+                       addPage(0, new PolytomousKeyListEditor(this), polytomousKeyEditorInput);
                        setPageText(0, "List");
-                       addPage(1, new PolytomousKeyGraphEditor(this), input);
+                       addPage(1, new PolytomousKeyGraphEditor(this), polytomousKeyEditorInput);
                        setPageText(1, "Graph");
                } catch (PartInitException e) {
                        MessagingUtils.error(getClass(), e);
@@ -214,8 +240,21 @@ public class KeyEditor extends FormEditor implements IConversationEnabled,
         *
         */
        public void setPartName() {
-               AbstractIdentificationEditorInput input = (AbstractIdentificationEditorInput) getEditorInput();
-               PolytomousKey key = (PolytomousKey) input.getKey();
+               PolytomousKey key = polytomousKeyEditorInput.getKey();
                setPartName(key.getTitleCache());
        }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+     */
+    @Override
+    public void onChange(CdmChangeEvent event) {
+        editorDirtyStateChanged();
+        IEditorPart activeEditor = getActiveEditor();
+        if (activeEditor instanceof IDirtyMarkable) {
+            for(CdmBase cdmBase : event.getChangedObjects()) {
+                ((IDirtyMarkable) activeEditor).changed(cdmBase);
+            }
+        }
+    }
 }
index 73d84ec90dedf96b50cbcba5d7f81de54e56c36f..7a190f4323be88cf4668390e437fc48080a72867 100644 (file)
@@ -1,8 +1,12 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.editor.key.polytomous;
 
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 import java.util.UUID;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
@@ -17,56 +21,90 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class PolytomousKeyEditorInput extends AbstractIdentificationEditorInput<PolytomousKey> {
 
-       private PolytomousKey key;
-
-       protected PolytomousKeyEditorInput(ConversationHolder conversation,
-                       PolytomousKey key) {
-               super(conversation);
-               this.key = key;
-       }
-       
-       
-
-       public static PolytomousKeyEditorInput NewInstance(UUID polytomousKeyUuid) throws Exception{
-               try{
-                       ConversationHolder conversation = CdmStore.createConversation();
-                                               
-                       return NewInstance(polytomousKeyUuid, conversation);
-               }catch(Exception e){
-                       throw e;
-               }
-       }
-       
-       public static PolytomousKeyEditorInput NewInstance(UUID polytomousKeyUuid, ConversationHolder conversation) throws Exception{
-               PolytomousKey polytomousKey = CdmStore.getService(IPolytomousKeyService.class).load(polytomousKeyUuid, null);
-                       
-               return new PolytomousKeyEditorInput(conversation, polytomousKey);
-       }
-       
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IEditorInput#getName()
-        */
-       @Override
-       public String getName() {
-               return key.getTitleCache();
-       }
-       
-       @Override
-       public PolytomousKey getKey() {
-               return key;
-       }
-       
-       /* (non-Javadoc)
-        * @see java.lang.Object#equals(java.lang.Object)
-        */
-       @Override
-       public boolean equals(Object object) {
-               if (object instanceof PolytomousKeyEditorInput
-                               && getKey() != null
-                               && getKey().equals(((PolytomousKeyEditorInput) object).getKey())
-               ){
-                       return true;
-               }
-               return super.equals(object);
-       }
+    private final String name;
+    private final UUID keyUuid;
+    private PolytomousKey key;
+
+
+    protected PolytomousKeyEditorInput(ConversationHolder conversation,
+            UUID polytomousKeyUuid) {
+        super(conversation);
+        this.keyUuid = polytomousKeyUuid;
+        this.key = CdmStore.getService(IPolytomousKeyService.class).load(polytomousKeyUuid, null);
+        this.name = key.getTitleCache();
+    }
+
+//    public PolytomousKeyEditorInput(UUID polytomousKeyUuid, String name) {
+//        super(CdmStore.createConversation());
+//        this.keyUuid = polytomousKeyUuid;
+//        this.name = name;
+//    }
+
+
+    public static PolytomousKeyEditorInput NewInstance(UUID polytomousKeyUuid) throws Exception{
+        try{
+            ConversationHolder conversation = CdmStore.createConversation();
+            return new PolytomousKeyEditorInput(conversation, polytomousKeyUuid);
+        }catch(Exception e){
+            throw e;
+        }
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#getName()
+     */
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public PolytomousKey getKey() {
+        return key;
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object object) {
+        if (object instanceof PolytomousKeyEditorInput
+                && getKey() != null
+                && getKey().equals(((PolytomousKeyEditorInput) object).getKey())
+                ){
+            return true;
+        }
+        return super.equals(object);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getRootEntities()
+     */
+    @Override
+    public  List<PolytomousKey> getRootEntities() {
+        return Arrays.asList(key);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput#merge()
+     */
+    @Override
+    public void merge() {
+        if(CdmStore.getCurrentSessionManager().isRemoting()) {
+            key = CdmStore.getService(IPolytomousKeyService.class).merge(key,true).getMergedEntity();
+        }
+    }
+
+    @Override
+    public Map<Object, List<String>> getPropertyPathsMap() {
+        Map<Object,List<String>> propertyPathsMap = new HashMap<Object,List<String>>();
+
+        List<String> polytomousKeyNodePropertyPaths = Arrays.asList(new String[] {
+                "statement"
+        });
+         propertyPathsMap.put("children", polytomousKeyNodePropertyPaths);
+         return propertyPathsMap;
+    }
+
 }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyEditorLabels.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyEditorLabels.java
new file mode 100644 (file)
index 0000000..82ee611
--- /dev/null
@@ -0,0 +1,24 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.editor.key.polytomous;
+
+/**
+ * @author cmathew
+ * @date 21 Jul 2015
+ *
+ */
+public interface PolytomousKeyEditorLabels {
+
+    public static final String CREATE_CHILD_POLYTOMOUS_KEY_NODE_LABEL = "Create Child Polytomous Key Node";
+    public static final String CREATE_SIBLING_POLYTOMOUS_KEY_NODE_LABEL = "Create Sibling Polytomous Key Node";
+
+    public static final String NO_KEY_NODE_FOR_CHILD_SELECTED_MESSAGE = "No Key Node Selected.Please right-click on a specific key node to create a new child key node.";
+    public static final String NO_KEY_NODE_FOR_SIBLING_SELECTED_MESSAGE = "No Key Node Selected.Please right-click on a specific key node to create a new sibling key node.";
+}
index a17c56a0a503afd56d350188b8ed65d5c4179f51..2f2575378987ece8a1108cbe79a134f90e4efe27 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -16,7 +16,6 @@ import java.util.List;
 import org.eclipse.jface.viewers.IStructuredContentProvider;
 import org.eclipse.jface.viewers.Viewer;
 
-import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 
 /**
@@ -29,7 +28,7 @@ public class PolytomousKeyListContentProvider implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.jface.viewers.IContentProvider#dispose()
         */
        @Override
@@ -38,7 +37,7 @@ public class PolytomousKeyListContentProvider implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface
         * .viewers.Viewer, java.lang.Object, java.lang.Object)
@@ -49,17 +48,17 @@ public class PolytomousKeyListContentProvider implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java
         * .lang.Object)
         */
        @Override
        public Object[] getElements(Object inputElement) {
-               if (inputElement instanceof PolytomousKey) {
+               if (inputElement instanceof PolytomousKeyEditorInput) {
                        List<PolytomousKeyNode> result = new ArrayList<PolytomousKeyNode>();
 
-                       PolytomousKeyNode root = ((PolytomousKey) inputElement).getRoot();
+                       PolytomousKeyNode root = ((PolytomousKeyEditorInput) inputElement).getKey().getRoot();
 
                        getChildrenBreadthFirst(result, root);
                        return result.toArray();
@@ -70,6 +69,9 @@ public class PolytomousKeyListContentProvider implements
 
        private void getChildrenBreadthFirst(List<PolytomousKeyNode> result,
                        PolytomousKeyNode node) {
+           if (node == null){
+               return;
+           }
                if (!node.getChildren().isEmpty()) {
                        result.addAll(node.getChildren());
                        for (PolytomousKeyNode internalNode : node.getChildren()) {
index dc81964bcb980a3f797810c654c7f6c6b073264f..c86490eadfd07a4f1ed1113227534ab41cc353a3 100644 (file)
@@ -74,6 +74,11 @@ public class PolytomousKeyListEditor extends EditorPart implements
                        Point point = new Point(event.x, event.y);
 
                        int selectedColumn = getSelectedColumn(table, point);
+
+                       if (table == null || point == null ){
+                           return;
+                       }
+
                        PolytomousKeyNode node = (PolytomousKeyNode) getTableItem(
                         table, point).getData();
 
@@ -173,7 +178,6 @@ public class PolytomousKeyListEditor extends EditorPart implements
         */
        @Override
        public void doSave(IProgressMonitor monitor) {
-
        }
 
        /*
@@ -250,7 +254,7 @@ public class PolytomousKeyListEditor extends EditorPart implements
 
                setPartName(key.getTitleCache());
 
-               viewer.setInput(key);
+               viewer.setInput(getEditorInput());
        }
 
        public int getTableItemCount() {
@@ -262,7 +266,7 @@ public class PolytomousKeyListEditor extends EditorPart implements
        }
 
        public PolytomousKey getViewerInputKey() {
-           return (PolytomousKey) viewer.getInput();
+           return ((PolytomousKeyEditorInput) viewer.getInput()).getKey();
        }
        private void createMenu() {
                // register context menu
@@ -313,18 +317,18 @@ public class PolytomousKeyListEditor extends EditorPart implements
         */
        @Override
        public void changed(Object element) {
-           if(element != null) {
-               viewer.update(element, null);
-           }
-
-               if (element instanceof PolytomousKeyNode) {
-                       List<PolytomousKeyNode> children = ((PolytomousKeyNode) element)
-                                       .getParent().getChildren();
-                       for (PolytomousKeyNode child : children) {
-                               viewer.update(child, null);
-                       }
-               }
+        if(element != null) {
+            viewer.update(element, null);
+        }
 
+        if (element instanceof PolytomousKeyNode) {
+            List<PolytomousKeyNode> children = ((PolytomousKeyNode) element)
+                    .getParent().getChildren();
+            for (PolytomousKeyNode child : children) {
+                viewer.update(child, null);
+            }
+        }
+        viewer.refresh();
        }
 
     /* (non-Javadoc)
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/RemotingCreateChildPolytomousKeyNodeHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/RemotingCreateChildPolytomousKeyNodeHandler.java
new file mode 100644 (file)
index 0000000..1d679a8
--- /dev/null
@@ -0,0 +1,90 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.editor.key.polytomous.handler;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.operations.AbstractOperation;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
+import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
+import eu.etaxonomy.taxeditor.editor.key.polytomous.IPolytomousKeyEditorPage;
+import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorLabels;
+import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListEditor;
+import eu.etaxonomy.taxeditor.editor.key.polytomous.operation.RemotingCreatePolytomousKeyNodeOperation;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmHandler;
+
+/**
+ * @author cmathew
+ * @date 21 Jul 2015
+ *
+ */
+public class RemotingCreateChildPolytomousKeyNodeHandler extends RemotingCdmHandler {
+
+    private PolytomousKeyNode parentNode;
+
+    public RemotingCreateChildPolytomousKeyNodeHandler() {
+        super(PolytomousKeyEditorLabels.CREATE_CHILD_POLYTOMOUS_KEY_NODE_LABEL);
+    }
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#allowOperations(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public IStatus allowOperations(ExecutionEvent event) {
+        IEditorPart editor = HandlerUtil.getActiveEditor(event);
+
+        if (editor instanceof KeyEditor) {
+            IPolytomousKeyEditorPage editorPage = (IPolytomousKeyEditorPage) ((KeyEditor) editor)
+                    .getActiveEditor();
+
+            if (editorPage instanceof PolytomousKeyListEditor) {
+                PolytomousKeyListEditor klEditor = (PolytomousKeyListEditor) editorPage;
+                if(klEditor.getTableItemCount() == 0) {
+                    PolytomousKey pk = klEditor.getViewerInputKey();
+                    parentNode = pk.getRoot();
+
+                } else {
+                    IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+                    if (selection.getFirstElement() instanceof PolytomousKeyNode) {
+                        parentNode = (PolytomousKeyNode) selection.getFirstElement();
+                    } else {
+                        return new Status(IStatus.ERROR,
+                                "unknown",
+                                PolytomousKeyEditorLabels.NO_KEY_NODE_FOR_CHILD_SELECTED_MESSAGE);
+                    }
+                }
+            }
+        }
+        return Status.OK_STATUS;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#prepareOperation(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public AbstractOperation prepareOperation(ExecutionEvent event) {
+        return new RemotingCreatePolytomousKeyNodeOperation(event.getTrigger(), false, parentNode);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#onComplete()
+     */
+    @Override
+    public void onComplete() {
+        // TODO Auto-generated method stub
+
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/RemotingCreateSiblingPolytomousKeyNodeHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/RemotingCreateSiblingPolytomousKeyNodeHandler.java
new file mode 100644 (file)
index 0000000..7f726a8
--- /dev/null
@@ -0,0 +1,72 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.editor.key.polytomous.handler;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.operations.AbstractOperation;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
+import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorLabels;
+import eu.etaxonomy.taxeditor.editor.key.polytomous.operation.RemotingCreatePolytomousKeyNodeOperation;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmHandler;
+
+/**
+ * @author cmathew
+ * @date 21 Jul 2015
+ *
+ */
+public class RemotingCreateSiblingPolytomousKeyNodeHandler extends RemotingCdmHandler {
+
+    private PolytomousKeyNode parentNode;
+
+    public RemotingCreateSiblingPolytomousKeyNodeHandler() {
+        super(PolytomousKeyEditorLabels.CREATE_SIBLING_POLYTOMOUS_KEY_NODE_LABEL);
+    }
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#allowOperations(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public IStatus allowOperations(ExecutionEvent event) {
+
+        IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+
+        if (selection.getFirstElement() instanceof PolytomousKeyNode) {
+            parentNode = (PolytomousKeyNode) selection.getFirstElement();
+        } else {
+            return new Status(IStatus.ERROR,
+                    "unknown",
+                    PolytomousKeyEditorLabels.NO_KEY_NODE_FOR_SIBLING_SELECTED_MESSAGE);
+        }
+
+        return Status.OK_STATUS;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#prepareOperation(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public AbstractOperation prepareOperation(ExecutionEvent event) {
+        return new RemotingCreatePolytomousKeyNodeOperation(event.getTrigger(), false, parentNode.getParent());
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#onComplete()
+     */
+    @Override
+    public void onComplete() {
+        // TODO Auto-generated method stub
+
+    }
+
+}
index f45ce48b021ba42043a23a5448c5e02835b9c33a..aa1a363f964e4966947112a26db956c8903fbe07 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.editor.key.polytomous.operation;
 
@@ -21,7 +21,7 @@ public class CreateNodeOperation extends AbstractPostTaxonOperation {
 
        PolytomousKeyNode parentNode;
        private PolytomousKeyNode childNode;
-       
+
        public CreateNodeOperation(String label,
                        IUndoContext undoContext, PolytomousKeyNode parentNode, IPostOperationEnabled postOperationEnabled) {
                super(label, undoContext, postOperationEnabled);
@@ -36,7 +36,7 @@ public class CreateNodeOperation extends AbstractPostTaxonOperation {
                        throws ExecutionException {
 
                childNode = PolytomousKeyNode.NewInstance();
-               
+
                parentNode.addChild(childNode);
 
                return postExecute(childNode);
index f31a83125aa62cf9cf7d9846550908e69a0b318d..684d8eebd7ea30f60d6c3356ae05b1d9ebb62371 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.editor.key.polytomous.operation;
 
@@ -9,12 +9,10 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService;
-import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 import eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
@@ -24,7 +22,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * @author n.hoffmann
- * 
+ *
  */
 public class DeleteNodeOperation extends AbstractPostTaxonOperation {
 
@@ -40,7 +38,7 @@ public class DeleteNodeOperation extends AbstractPostTaxonOperation {
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse
         * .core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
@@ -48,12 +46,12 @@ public class DeleteNodeOperation extends AbstractPostTaxonOperation {
        @Override
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
-               
+
                //parent.removeChild(node);
                ICdmApplicationConfiguration controller;
-               
-               controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration();
-               
+
+               controller = CdmStore.getCurrentApplicationConfiguration();
+
                IPolytomousKeyNodeService service = controller.getPolytomousKeyNodeService();
                DeleteResult result;
                if (node.getChildren().size()>0){
@@ -82,7 +80,7 @@ public class DeleteNodeOperation extends AbstractPostTaxonOperation {
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse
         * .core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
@@ -95,7 +93,7 @@ public class DeleteNodeOperation extends AbstractPostTaxonOperation {
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse
         * .core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/RemotingCreatePolytomousKeyNodeOperation.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/RemotingCreatePolytomousKeyNodeOperation.java
new file mode 100644 (file)
index 0000000..c63350e
--- /dev/null
@@ -0,0 +1,48 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.editor.key.polytomous.operation;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmDefaultOperation;
+
+/**
+ * @author cmathew
+ * @date 21 Jul 2015
+ *
+ */
+public class RemotingCreatePolytomousKeyNodeOperation extends RemotingCdmDefaultOperation {
+
+    private final PolytomousKeyNode parentNode;
+
+    private final static String LABEL = "Create new polytomous key node";
+
+    public RemotingCreatePolytomousKeyNodeOperation(Object source,
+            boolean async,
+            PolytomousKeyNode parentNode){
+        super(LABEL, Action.Create, source, async);
+        this.parentNode = parentNode;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmSimpleOperation#doSimpleExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+     */
+    @Override
+    protected CdmBase doSimpleExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
+      PolytomousKeyNode childNode = PolytomousKeyNode.NewInstance();
+      parentNode.addChild(childNode);
+      return childNode;
+    }
+
+}
index b3cd23d0d5c3b1d348496b9af6cd0c8edc26e363..ce6ff028a2b353521620864c3af847638ff839c6 100644 (file)
@@ -44,7 +44,6 @@ import org.eclipse.ui.part.EditorPart;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
-import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
@@ -53,7 +52,6 @@ import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.CdmDataTransfer;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.IDropTargetable;
 import eu.etaxonomy.taxeditor.editor.IMultiPageTaxonEditorPage;
 import eu.etaxonomy.taxeditor.editor.ISecuredEditor;
@@ -74,8 +72,8 @@ import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.TaxeditorPartService;
 import eu.etaxonomy.taxeditor.preference.Resources;
 import eu.etaxonomy.taxeditor.security.RequiredPermissions;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>
@@ -121,6 +119,8 @@ public class TaxonNameEditor extends EditorPart implements
 
        private TaxonBase objectAffectedByLastOperation;
 
+       private ICdmEntitySession cdmEntitySession;
+
        /**
         * <p>
         * Constructor for TaxonNameEditor.
@@ -235,12 +235,12 @@ public class TaxonNameEditor extends EditorPart implements
         * </p>
         */
        public void createOrUpdateNameComposites() {
-               //this.taxon = (Taxon)CdmStore.getService(ITaxonService.class).load(this.getTaxon().getUuid());
-               //this.taxon = HibernateProxyHelper.deproxy(this.taxon, Taxon.class);
+//             this.taxon = (Taxon)CdmStore.getService(ITaxonService.class).load(this.getTaxon().getUuid());
                ContainerFactory.createOrUpdateAcceptedTaxonsHomotypicGroup(this);
                ContainerFactory.createOrUpdateHeterotypicSynonymyGroups(this);
                ContainerFactory.createOrUpdateMisapplicationsGroup(this);
 
+
                // Redraw composite
                managedForm.reflow(true);
        }
@@ -509,7 +509,7 @@ public class TaxonNameEditor extends EditorPart implements
         }
 
                if (input.getAdapter(Taxon.class) != null) {
-                       taxon = (Taxon) input.getAdapter(Taxon.class);
+                       taxon = CdmBase.deproxy(input.getAdapter(Taxon.class), Taxon.class);
                } else {
                        throw new PartInitException("Invalid Input: Taxon cannot be null");
                }
@@ -948,4 +948,7 @@ public class TaxonNameEditor extends EditorPart implements
                Color background =  AbstractUtility.getColor(enabled ? Resources.COLOR_COMPOSITE_BACKGROUND : Resources.COLOR_TEXT_DISABLED_BACKGROUND);
                setEnabled(enabled, background);
        }
+
+
+
 }
index ae2a122fdbd738146306917a4517ee62aeac7cab..d37adb99a22d7fbee1d7d1c31e005ea1affa676f 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -23,7 +23,7 @@ import eu.etaxonomy.taxeditor.preference.Resources;
  * @version 1.0
  */
 public class MisapplicationContainer extends AbstractGroupedContainer<Taxon> {
-       
+
        /**
         * <p>Constructor for MisapplicationContainer.</p>
         *
@@ -34,7 +34,7 @@ public class MisapplicationContainer extends AbstractGroupedContainer<Taxon> {
        public MisapplicationContainer(AbstractGroup group, Taxon misappliedName) {
                super(misappliedName);
        }
-       
+
 
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.editor.name.NameComposite#initializeComposite()
@@ -44,9 +44,9 @@ public class MisapplicationContainer extends AbstractGroupedContainer<Taxon> {
        protected void initializeComposite() {
                setIsDraggable(true);
                setFont(getViewerFont());
-               
-               showSec();              
-               
+
+               showSec();
+
                initTextViewer();
        }
 
@@ -54,20 +54,29 @@ public class MisapplicationContainer extends AbstractGroupedContainer<Taxon> {
        protected void updateIcon() {
                setIcon(MISAPPLIEDNAME_ICON);
        }
-       
+
        private void showSec() {
                if (getMisappliedName() == null) {
                        return;
                }
-               
+
                if (getMisappliedName().getSec() == null) {
-                       setNonEditableInfo("sec. ???", false);
+                   if (getMisappliedName().getAppendedPhrase() != null ){
+                       setNonEditableInfo(getMisappliedName().getAppendedPhrase(), false);
+                   }else{
+                       setNonEditableInfo("sec. ???", false);
+                   }
                } else {
                        String title = getMisappliedName().getSec().getTitleCache();
-                       setNonEditableInfo("sec. " + title, false);
+                       title = title.replace("&", "&&");
+                       String sec = "sec. ";
+                       if (getMisappliedName().getAppendedPhrase() != null ){
+                           sec = getMisappliedName().getAppendedPhrase() + " "+sec;
+                       }
+                       setNonEditableInfo(sec + title, false);
                }
        }
-       
+
        /**
         * <p>getMisappliedName</p>
         *
@@ -82,7 +91,7 @@ public class MisapplicationContainer extends AbstractGroupedContainer<Taxon> {
        protected Font getViewerFont() {
                return EditorUtil.getFont(Resources.MISAPPLIEDNAME_FONT);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.editor.name.container.AbstractGroupedContainer#showAnnotations()
         */
@@ -94,7 +103,7 @@ public class MisapplicationContainer extends AbstractGroupedContainer<Taxon> {
                }
                super.showAnnotations();
        }
-       
+
 
        /** {@inheritDoc} */
        @Override
index e76b8475e3a91bd43d8587fadb357dc6e94bd129..5d5f449d254145e6c856a80a7e762fa58df015c8 100644 (file)
@@ -1,15 +1,16 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.editor.name.handler;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 import java.util.UUID;
@@ -38,6 +39,7 @@ import eu.etaxonomy.taxeditor.editor.name.operation.ChangeSynonymToAcceptedTaxon
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
 
 /**
@@ -51,16 +53,17 @@ public class ChangeSynonymToAcceptedTaxonHandler extends AbstractHandler impleme
        private static final Logger logger = Logger
                        .getLogger(ChangeSynonymToAcceptedTaxonHandler.class);
        private MultiPageTaxonEditor editor;
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
         */
        /** {@inheritDoc} */
-       public Object execute(ExecutionEvent event) throws ExecutionException {
+       @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
                editor =  (MultiPageTaxonEditor) HandlerUtil.getActiveEditor(event);
                Shell shell = HandlerUtil.getActiveShell(event);
                IEditorInput input = editor.getEditorInput();
-               
+
                if (!(input instanceof TaxonEditorInput)) {
                        logger.error("Editor input is not TaxonEditorInput");
                        return null;
@@ -74,7 +77,7 @@ public class ChangeSynonymToAcceptedTaxonHandler extends AbstractHandler impleme
                }
 
                Synonym synonym = (Synonym) selection.getFirstElement();
-               
+
                // Force user to save taxon - not really necessary though, is it?
                if (!EditorUtil.forceUserSave(editor, shell)) {
                        return null;
@@ -82,25 +85,28 @@ public class ChangeSynonymToAcceptedTaxonHandler extends AbstractHandler impleme
 
                // Get taxon
                Taxon taxon = ((TaxonEditorInput) input).getTaxon();
-               
+
                TaxonNode parentNode = (TaxonNode) HibernateProxyHelper.deproxy(((TaxonEditorInput) input).getTaxonNode().getParent());
-               
-               List<UUID> excludeTaxa = null;
-               
-               TaxonNode newParentNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), editor.getConversationHolder(), "Select parent", excludeTaxa, null, null);
-               
+
+               List<UUID> excludeTaxa = new ArrayList<UUID>();
+               //excludeTaxa.add(taxon.getUuid());//there are some cases where the accepted taxon should be the parent of the new created accepted taxon
+
+               TaxonNode newParentNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), editor.getConversationHolder(), "Select parent", null, null, ((TaxonEditorInput) input).getTaxonNode().getClassification());
+
+
                if(newParentNode != null){
-                       
+
                        // TODO get synonyms from homotypical group and add them as homotypic synonyms to new accepted taxon
                        // apply confirmation dialog
                        HomotypicalGroup group = synonym.getHomotypicGroup();
                        Set<TaxonNameBase> namesInGroup = group.getTypifiedNames();
                        // FIXME with this implementation we can not create a taxonNode that is a direct child of the classification node
-                       AbstractPostOperation operation = new ChangeSynonymToAcceptedTaxonOperation("Change synonym to accepted taxon", EditorUtil.getUndoContext(), 
-                                       taxon, newParentNode, synonym, namesInGroup, this, editor); //$NON-NLS-1$
+                       AbstractPostOperation operation = new ChangeSynonymToAcceptedTaxonOperation("Change synonym to accepted taxon", EditorUtil.getUndoContext(),
+                                       taxon, newParentNode, synonym, namesInGroup, this, editor, (ICdmEntitySessionEnabled)editor.getEditorInput()); //$NON-NLS-1$
+
                        EditorUtil.executeOperation(operation);
                }
-               
+
                return null;
        }
 
@@ -108,19 +114,20 @@ public class ChangeSynonymToAcceptedTaxonHandler extends AbstractHandler impleme
         * @see eu.etaxonomy.taxeditor.operations.IPostOperationEnabled#postOperation(eu.etaxonomy.cdm.model.common.CdmBase)
         */
        /** {@inheritDoc} */
-       public boolean postOperation(CdmBase objectAffectedByOperation) {
-               
+       @Override
+    public boolean postOperation(CdmBase objectAffectedByOperation) {
+
                // Redraw existing editor
                ((IPostOperationEnabled) editor).postOperation(null);
-               
+
                editor.doSave(EditorUtil.getMonitor());
-               
+
                if (objectAffectedByOperation instanceof TaxonNode) {
-               
+
                        // Open new unsaved editor with existing taxon's parent as temporary parent
                        TaxonNode newNode = (TaxonNode) objectAffectedByOperation;
 //                     TaxonNode newNode = parentNode.addChild(newTaxon);
-                                       
+
                        try {
                                // TODO
                                /*
@@ -129,7 +136,7 @@ public class ChangeSynonymToAcceptedTaxonHandler extends AbstractHandler impleme
                                 *  doesn't work yet.
                                 */
                                EditorUtil.openTaxonNode(newNode.getUuid());
-                               
+
                        } catch (PartInitException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
@@ -145,7 +152,8 @@ public class ChangeSynonymToAcceptedTaxonHandler extends AbstractHandler impleme
         *
         * @return a boolean.
         */
-       public boolean onComplete() {
+       @Override
+    public boolean onComplete() {
                // TODO Auto-generated method stub
                return false;
        }
index 02288fa44f83e4923e931268f000c26badfc9fa2..a3b53d3584b566b7bcf0a48798bb5ac0816402ef 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,11 +16,14 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.IHandler;
 import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
 import eu.etaxonomy.taxeditor.editor.Page;
 import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeConceptRelationshipTypeOperation;
@@ -43,28 +46,33 @@ public class ChangeToMisapplicationHandler extends AbstractHandler implements
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
         */
        /** {@inheritDoc} */
-       public Object execute(ExecutionEvent event) throws ExecutionException {
+       @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
                TaxonNameEditor editor = (TaxonNameEditor) EditorUtil.getActiveEditorPage(
                                Page.NAME);
-
+               Shell shell = HandlerUtil.getActiveShell(event);
+               MultiPageTaxonEditor multiPageTaxonEditor = EditorUtil.getActiveMultiPageTaxonEditor();
+               if (!EditorUtil.forceUserSave(multiPageTaxonEditor, shell)) {
+            return null;
+        }
                Object selectedElement = EditorUtil.getSelection(event).getFirstElement();
-               
+
                AbstractPostOperation operation = null;
                try {
                        if(selectedElement instanceof Taxon){
-                               operation = new ChangeConceptRelationshipTypeOperation(event.getCommand().getName(), 
+                               operation = new ChangeConceptRelationshipTypeOperation(event.getCommand().getName(),
                                                                                editor.getUndoContext(), editor.getTaxon(), (Taxon) selectedElement, TaxonRelationshipType.MISAPPLIED_NAME_FOR(), editor);
                        }
                        if(selectedElement instanceof Synonym){
-                               operation = new ChangeSynonymToMisapplicationOperation(event.getCommand().getName(), 
+                               operation = new ChangeSynonymToMisapplicationOperation(event.getCommand().getName(),
                                                editor.getUndoContext(), editor.getTaxon(), (Synonym) selectedElement, editor);
                        }
-                       
+
                        EditorUtil.executeOperation(operation);
                } catch (NotDefinedException e) {
                        logger.warn("Command name not set");
                }
-               
+
                return null;
        }
 }
index 9f76a0967f0cd16c447c67674e9fc46980a37053..9047c2a137d4e65b3527d10cacd85cd1ffcd6218 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import org.eclipse.core.commands.IHandler;
 import org.eclipse.core.commands.common.NotDefinedException;
 
 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.Page;
@@ -40,22 +40,23 @@ public class CreateHomotypicSynonymHandler extends AbstractHandler implements
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
         */
        /** {@inheritDoc} */
-       public Object execute(ExecutionEvent event) throws ExecutionException {
+       @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
                TaxonNameEditor editor = (TaxonNameEditor) EditorUtil.getActiveEditorPage(
                                Page.NAME);
                Taxon taxon = editor.getTaxon();
                HomotypicalGroup group = taxon.getHomotypicGroup();
-               TaxonNameBase newSynonymName = ParseHandler.createEmptyName();
-               
+               NonViralName newSynonymName = ParseHandler.createEmptyName();
+
                AbstractPostOperation operation;
                try {
-                       operation = new CreateSynonymInExistingHomotypicalGroupOperation(event.getCommand().getName(), 
+                       operation = new CreateSynonymInExistingHomotypicalGroupOperation(event.getCommand().getName(),
                                        editor.getUndoContext(), taxon, group, newSynonymName, editor);
                        EditorUtil.executeOperation(operation);
                } catch (NotDefinedException e) {
                        MessagingUtils.error(getClass(), e);
                }
-               
+
 
                return null;
        }
index 4d19f059ce7e6e6544a901a9900e971a44e99a89..45dc4776ccf30ab26a2cd3acac1122996815af70 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -21,7 +21,7 @@ import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.Page;
@@ -46,26 +46,27 @@ public class CreateSynonymInHomotypicalGroupHandler extends AbstractHandler
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
         */
        /** {@inheritDoc} */
-       public Object execute(ExecutionEvent event) throws ExecutionException {
+       @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
                TaxonNameEditor editor = (TaxonNameEditor) EditorUtil.getActiveEditorPage(
                                Page.NAME);
                ISelection menuSelection = HandlerUtil.getCurrentSelection(event);
-               
+
                Object selecteObject = ((StructuredSelection) menuSelection).getFirstElement();
-               
+
                if(! (selecteObject instanceof Synonym)){
                        return null;
                }
-               
-               
+
+
                Synonym synonym = (Synonym) selecteObject;
-               
+
                HomotypicalGroup group = synonym.getHomotypicGroup();
-               
-               TaxonNameBase newSynonymName = ParseHandler.createEmptyName();
-               
+
+               NonViralName newSynonymName = ParseHandler.createEmptyName();
+
                AbstractPostOperation operation;
-               
+
                try {
                        operation = new CreateSynonymInExistingHomotypicalGroupOperation(event.getCommand().getName(), editor.getUndoContext(),
                                                                editor.getTaxon(), group, newSynonymName, editor);
@@ -73,7 +74,7 @@ public class CreateSynonymInHomotypicalGroupHandler extends AbstractHandler
                } catch (NotDefinedException e) {
                        logger.warn("Command name not set");
                }
-               
+
                return null;
        }
 }
index ed85b64c00acdb64cf79575bc147cb35fb9d14b0..b5851aa77d6fb7574abe2a0e1cab3ac4a1c322af 100644 (file)
@@ -23,6 +23,7 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.Messages;
 import eu.etaxonomy.taxeditor.editor.Page;
 import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
 import eu.etaxonomy.taxeditor.editor.name.operation.DeleteMisapplicationOperation;
@@ -32,10 +33,9 @@ import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 
 /**
- * <p>DeleteTaxonBaseHandler class.</p>
- *
  * @author n.hoffmann
  * @created 21.04.2009
  * @version 1.0
@@ -43,9 +43,6 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 public class DeleteTaxonBaseHandler extends AbstractHandler implements IHandler, IPostOperationEnabled {
 
        TaxonNameEditor editor;
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-        */
        /** {@inheritDoc} */
        @Override
     public Object execute(ExecutionEvent event) throws ExecutionException {
@@ -58,12 +55,6 @@ public class DeleteTaxonBaseHandler extends AbstractHandler implements IHandler,
                return null;
        }
 
-       /**
-        * @param editor
-        * @param selectedElement
-        * @param operation
-        * @param commandName
-        */
        protected void doExecute(ExecutionEvent event, TaxonNameEditor editor, Object selectedElement) {
                AbstractPostOperation operation = null;
                String commandName = null;
@@ -85,18 +76,26 @@ public class DeleteTaxonBaseHandler extends AbstractHandler implements IHandler,
                }
                else if (selectedElement instanceof Taxon){
                        //TODO: how to get the actual classification
-                       if(! MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Confirm Deletion", "Are you sure you want to delete the selected taxon?")){
+                       if(! MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), Messages.DeleteTaxonBaseHandler_CONFIRM_DELETION, Messages.DeleteTaxonBaseHandler_REALLY_DELETE_TAXON)){
                                return ;
                        }
 
                        IWorkbenchPage activePage = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();
 
-                       operation = new DeleteTaxonOperation(commandName, editor.getUndoContext(),(Taxon) selectedElement, new TaxonDeletionConfigurator(), null, activePage, this, editor);
+                       operation = new DeleteTaxonOperation(commandName,
+                               editor.getUndoContext(),
+                               (Taxon) selectedElement,
+                               new TaxonDeletionConfigurator(),
+                               null,
+                               activePage,
+                               this,
+                               editor,
+                               (ICdmEntitySessionEnabled)editor.getEditorInput());
                        //editor.dispose();
 
                }
                else {
-                       throw new IllegalArgumentException("Element has to be Synonym, Misapplication or Concept");
+                       throw new IllegalArgumentException(Messages.DeleteTaxonBaseHandler_ELEMENT_MUST_BE_SYNONYM_MISAPP_CONCEPT);
                }
 
                AbstractUtility.executeOperation(operation);
index 82198663a13e18411e7dee7eccfc8ae0b623af0d..bb5fb10aceb55dc921bf38d1c598a8bd1517afcc 100644 (file)
@@ -1,82 +1,90 @@
-package eu.etaxonomy.taxeditor.editor.name.handler;\r
-\r
-import java.util.UUID;\r
-\r
-import org.apache.log4j.Logger;\r
-import org.eclipse.core.commands.AbstractHandler;\r
-import org.eclipse.core.commands.ExecutionEvent;\r
-import org.eclipse.core.commands.ExecutionException;\r
-import org.eclipse.core.commands.common.NotDefinedException;\r
-import org.eclipse.core.commands.operations.IUndoContext;\r
-import org.eclipse.jface.dialogs.MessageDialog;\r
-import org.eclipse.jface.viewers.StructuredSelection;\r
-import org.eclipse.swt.widgets.Shell;\r
-import org.eclipse.ui.IEditorInput;\r
-import org.eclipse.ui.handlers.HandlerUtil;\r
-\r
-import eu.etaxonomy.cdm.model.common.CdmBase;\r
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
-import eu.etaxonomy.cdm.model.taxon.Synonym;\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
-import eu.etaxonomy.taxeditor.editor.EditorUtil;\r
-import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;\r
-import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;\r
-import eu.etaxonomy.taxeditor.editor.name.operation.MoveSynonymToAnotherAcceptedTaxonOperation;\r
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
-import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;\r
-\r
-public class MoveSynonymToAnotherAcceptedTaxonHandler extends AbstractHandler implements IPostOperationEnabled {\r
-       private static final Logger logger = Logger\r
-       .getLogger(MoveSynonymToAnotherAcceptedTaxonHandler.class);\r
-       private MultiPageTaxonEditor editor;\r
-       \r
-       @Override\r
-       public Object execute(ExecutionEvent event) throws ExecutionException {\r
-               editor =  (MultiPageTaxonEditor) HandlerUtil.getActiveEditor(event);\r
-               Shell shell = HandlerUtil.getActiveShell(event);\r
-               IEditorInput input = editor.getEditorInput();\r
-               if (!EditorUtil.forceUserSave(editor, shell)) {\r
-                       return null;\r
-               }\r
-               \r
-               if (!(input instanceof TaxonEditorInput)) {\r
-                       logger.error("Editor input is not TaxonEditorInput");\r
-                       return null;\r
-               }\r
-\r
-               // Get synonym from selection\r
-               StructuredSelection selection = (StructuredSelection) HandlerUtil.getCurrentSelection(event);\r
-               if (!(selection.getFirstElement() instanceof Synonym)) {\r
-                       logger.error("Selection does not contain a Synonym");\r
-                       return null;\r
-               }\r
-\r
-               Synonym synonym = (Synonym) selection.getFirstElement();\r
-               TaxonNode newParentNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), editor.getConversationHolder(), "Select new accepted taxon", null, null, null);\r
-               Taxon oldParent = ((TaxonEditorInput)input).getTaxon();\r
-       \r
-                       MoveSynonymToAnotherAcceptedTaxonOperation operation = new MoveSynonymToAnotherAcceptedTaxonOperation("Change accepted Taxon of Synonym", EditorUtil.getUndoContext(),\r
-                                       oldParent.getUuid(), synonym.getUuid(), newParentNode.getTaxon(), editor);\r
-                       \r
-                       EditorUtil.executeOperation(operation);\r
-       \r
-\r
-               return null;\r
-       }\r
-\r
-       @Override\r
-       public boolean postOperation(CdmBase objectAffectedByOperation) {\r
-               // TODO Auto-generated method stub\r
-               return false;\r
-       }\r
-\r
-       @Override\r
-       public boolean onComplete() {\r
-               // TODO Auto-generated method stub\r
-               return false;\r
-       }\r
-       \r
-       \r
-\r
-}\r
+package eu.etaxonomy.taxeditor.editor.name.handler;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.taxon.Synonym;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
+import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.editor.name.operation.MoveSynonymToAnotherAcceptedTaxonOperation;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
+
+public class MoveSynonymToAnotherAcceptedTaxonHandler extends AbstractHandler implements IPostOperationEnabled {
+       private static final Logger logger = Logger
+       .getLogger(MoveSynonymToAnotherAcceptedTaxonHandler.class);
+       private MultiPageTaxonEditor editor;
+
+       @Override
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               editor =  (MultiPageTaxonEditor) HandlerUtil.getActiveEditor(event);
+               Shell shell = HandlerUtil.getActiveShell(event);
+               IEditorInput input = editor.getEditorInput();
+               // Get synonym from selection before possible save dialog
+               // because the selection will be null if save dialog is shown
+               StructuredSelection selection = (StructuredSelection) HandlerUtil.getCurrentSelection(event);
+
+               if (!EditorUtil.forceUserSave(editor, shell)) {
+                       return null;
+               }
+
+               if (!(input instanceof TaxonEditorInput)) {
+                       logger.error("Editor input is not TaxonEditorInput");
+                       return null;
+               }
+
+               if (selection==null || !(selection.getFirstElement() instanceof Synonym)) {
+                   MessagingUtils.warningDialog("No selection", this, "No synonym selected");
+                       logger.error("Selection does not contain a Synonym");
+                       return null;
+               }
+
+               Synonym synonym = (Synonym) selection.getFirstElement();
+               Taxon oldParent = ((TaxonEditorInput)input).getTaxon();
+               List<UUID> excludeTaxa = new ArrayList<UUID>();
+               excludeTaxa.add(oldParent.getUuid());
+
+                               
+               TaxonNode newParentNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), editor.getConversationHolder(), "Select new accepted taxon", excludeTaxa, null, ((TaxonEditorInput)input).getTaxonNode().getClassification());
+
+               if(newParentNode!=null){
+                  MoveSynonymToAnotherAcceptedTaxonOperation operation = new MoveSynonymToAnotherAcceptedTaxonOperation("Change accepted Taxon of Synonym", EditorUtil.getUndoContext(),
+                           oldParent.getUuid(), synonym.getUuid(), newParentNode.getTaxon(), editor);
+
+                   AbstractUtility.executeOperation(operation);
+
+               }
+               return null;
+       }
+
+       @Override
+       public boolean postOperation(CdmBase objectAffectedByOperation) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       @Override
+       public boolean onComplete() {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+
+
+}
index 73c2f94d0eeb09e1a0c80aa04ed91d2a75adbd4c..270d9aa2dc3b01bb73ecd504624230f5bc087ac1 100644 (file)
@@ -35,6 +35,8 @@ public class NameEditorMenuPropertyTester extends org.eclipse.core.expressions.P
        private static final String CONCEPT = "isConceptRelation";
        private static final String EMPTY_NAMES = "hasEmptyNames";
        private static final String ACCEPTED_AND_NO_HOMOTYPIC_SYNONYMS = "isAcceptedAndHasNoHomotypicSynonyms";
+       private static final String HOMOTYPIC_SYNONYM_OF_ACCEPTED = "isHomotypicSynonymOfAcceptedTaxon";
+       
 
        /**
         * <p>Constructor for NameEditorMenuPropertyTester.</p>
@@ -76,7 +78,10 @@ public class NameEditorMenuPropertyTester extends org.eclipse.core.expressions.P
                        }
                        else if(ACCEPTED_AND_NO_HOMOTYPIC_SYNONYMS.equals(property)){
                                return isAcceptedAndHasNoHomotypicSynonyms(selectedElement);
+                       }else if (HOMOTYPIC_SYNONYM_OF_ACCEPTED.equals(property)){
+                               return isHomotypicSynonymOfAcceptedTaxon(selectedElement);
                        }
+                       
                }
 
                return false;
@@ -90,6 +95,19 @@ public class NameEditorMenuPropertyTester extends org.eclipse.core.expressions.P
                }
                return false;
        }
+       
+       private boolean isHomotypicSynonymOfAcceptedTaxon(Object selectedElement) {
+               if (isSynonym(selectedElement)){
+                       Synonym synonym = (Synonym) selectedElement;
+                       for (Taxon taxon:synonym.getAcceptedTaxa()){
+                               if (taxon.getHomotypicGroup().equals(synonym.getHomotypicGroup())){
+                                       return false;
+                               }
+                       }
+               }
+               return true;
+       }
+
 
        /**
         * @param receiver
index d8c0e370fdd71db8eb35e3d8c90721fd68edc9b7..014f92da1cfa6c34d8f7f914ea7011bb92327c66 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -28,6 +28,7 @@ import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
 import eu.etaxonomy.taxeditor.editor.name.operation.SwapSynonymAndAcceptedOperation;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 
 /**
  * <p>SwapSynonymAndAcceptedHandler class.</p>
@@ -47,26 +48,31 @@ public class SwapSynonymAndAcceptedHandler extends AbstractHandler implements
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
         */
        /** {@inheritDoc} */
-       public Object execute(ExecutionEvent event) throws ExecutionException {
+       @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
                editor = EditorUtil.getActiveMultiPageTaxonEditor();
                Shell shell = HandlerUtil.getActiveShell(event);
                Synonym synonym = (Synonym) EditorUtil.getSelection(event).getFirstElement();
-               
+
 
                // Force user to save taxon - not really necessary though, is it?
                if (!EditorUtil.forceUserSave(editor, shell)) {
                        return null;
                }
-               
+
                try {
-                       SwapSynonymAndAcceptedOperation operation = new SwapSynonymAndAcceptedOperation(event.getCommand().getName(), editor.getUndoContext(),
-                                                               editor.getTaxon(), synonym, this);
-                       
+                       SwapSynonymAndAcceptedOperation operation = new SwapSynonymAndAcceptedOperation(event.getCommand().getName(),
+                               editor.getUndoContext(),
+                               editor.getTaxon(),
+                               synonym,
+                               this,
+                               (ICdmEntitySessionEnabled)editor.getEditorInput());
+
                        EditorUtil.executeOperation(operation);
-                       
+
                } catch (NotDefinedException e) {
                        logger.warn("Command name not set");
-               } 
+               }
 
                return null;
        }
@@ -78,15 +84,15 @@ public class SwapSynonymAndAcceptedHandler extends AbstractHandler implements
        public boolean postOperation(CdmBase objectAffectedByOperation) {
                // Redraw existing editor
                //((IPostOperationEnabled) editor).postOperation(null);
-               
+
                editor.doSave(EditorUtil.getMonitor());
                editor.close(true);
-               
+
                if (objectAffectedByOperation instanceof Taxon) {
-               
+
                        taxon = (Taxon) objectAffectedByOperation;
-                                       
-                       
+
+
                }
                return true;
        }
@@ -98,14 +104,15 @@ public class SwapSynonymAndAcceptedHandler extends AbstractHandler implements
        public boolean onComplete() {
                Display display = Display.getCurrent();
                display.asyncExec(new Runnable() {
-                       public void run() {
+                       @Override
+            public void run() {
                                try {
                                        EditorUtil.openTaxonBase(taxon.getUuid());
-                                       
+
                                } catch (Exception e) {
                                        MessagingUtils.warningDialog("Could not open editor for taxon", this, e.getMessage());
                                }
-                               
+
                        }
                });
                return true;
index e3657991601b789219259873cc67af3b9de223db..d964006d30b462496e472b5fc1ffa16299f1760a 100644 (file)
@@ -21,9 +21,9 @@ 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.Synonym;
 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.model.MessagingUtils;
@@ -93,13 +93,17 @@ public class ChangeConceptToSynonymOperation extends
                TaxonNameBase<?, ?> synonymName = concept.getName();
                Synonym synonym = null;
                try {
-                       synonym = CdmStore.getService(ITaxonService.class).changeRelatedTaxonToSynonym(concept, element, taxonRelationship.getType(), null);
+                       synonym =
+                               (Synonym) CdmStore.getService(ITaxonService.class).changeRelatedTaxonToSynonym(concept.getUuid(),
+                                       element.getUuid(),
+                                       taxonRelationship.getType(),
+                                       null).getCdmEntity();
                } catch (DataChangeNoRollbackException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
-               
-       
+
+
                return postExecute(synonym);
        }
 
index 679b3396e261973291c1feebb38623e9219ab80d..4804d525ec1fc9001bdace129a6e409c3f936e59 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,10 +16,8 @@ import org.eclipse.core.commands.operations.IUndoContext;
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
 
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
@@ -36,7 +34,7 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
  */
 public class ChangeHomotypicalGroupBasionymOperation extends
                AbstractPostTaxonOperation {
-       private TaxonBase taxonBase;
+       private final TaxonBase taxonBase;
 
        /**
         * <p>Constructor for ChangeHomotypicalGroupBasionymOperation.</p>
@@ -50,7 +48,7 @@ public class ChangeHomotypicalGroupBasionymOperation extends
        public ChangeHomotypicalGroupBasionymOperation(String text,
                        IUndoContext undoContext, Taxon taxon, TaxonBase taxonBase, IPostOperationEnabled postOperationEnabled) {
                super(text, undoContext, taxon, postOperationEnabled);
-               
+
                this.taxonBase = taxonBase;
        }
 
@@ -61,16 +59,16 @@ public class ChangeHomotypicalGroupBasionymOperation extends
        @Override
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
-               
+
                TaxonNameBase<?, ?> name = taxonBase.getName();
-               
+
                monitor.worked(20);
                name = HibernateProxyHelper.deproxy(name, TaxonNameBase.class);
                HomotypicalGroup group = HibernateProxyHelper.deproxy(name.getHomotypicalGroup(), HomotypicalGroup.class);
         TaxonNameBase oldBasionym = name.getBasionym();
-        
+
                name.setAsGroupsBasionym();
-               
+
                monitor.worked(40);
                oldBasionym = HibernateProxyHelper.deproxy(oldBasionym, TaxonNameBase.class);
                if (oldBasionym != null){
@@ -80,6 +78,7 @@ public class ChangeHomotypicalGroupBasionymOperation extends
                                postExecute(oldBasionymTaxonBase);
                        }
                }
+
                return postExecute(taxonBase);
        }
 
@@ -103,9 +102,9 @@ public class ChangeHomotypicalGroupBasionymOperation extends
                // TODO replace w method from cdmlib
                // FIXME this is also old code: reimplement
 //             CdmUtil.setGroupBasionym(synonym.getName());
-                               
+
                return postExecute(taxonBase);
        }
-       
-       
+
+
 }
index 1b5349173beab2afb4e424aa76c5b6a784279ac0..c62759b72b3a89279d5009c594f00ea81c775d3a 100644 (file)
@@ -28,6 +28,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -40,7 +41,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class ChangeSynonymToAcceptedTaxonOperation extends AbstractPersistentPostOperation {
 
        private Taxon newTaxon;
-       private Synonym synonym;
+       private final Synonym synonym;
        private final ITaxonTreeNode parentNode;
 
        private TaxonNode newNode;
@@ -59,9 +60,16 @@ public class ChangeSynonymToAcceptedTaxonOperation extends AbstractPersistentPos
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
         * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
-       public ChangeSynonymToAcceptedTaxonOperation(String label, IUndoContext undoContext,
-                       Taxon taxon, ITaxonTreeNode parentNode, Synonym synonym, Set<TaxonNameBase> namesInHomotypicalGroup, IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled) {
-               super(label, undoContext, postOperationEnabled, conversationEnabled);
+       public ChangeSynonymToAcceptedTaxonOperation(String label,
+               IUndoContext undoContext,
+                       Taxon taxon,
+                       ITaxonTreeNode parentNode,
+                       Synonym synonym,
+                       Set<TaxonNameBase> namesInHomotypicalGroup,
+                       IPostOperationEnabled postOperationEnabled,
+                       IConversationEnabled conversationEnabled,
+                       ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
 
                this.element = taxon;
                this.parentNode = parentNode;
@@ -78,23 +86,30 @@ public class ChangeSynonymToAcceptedTaxonOperation extends AbstractPersistentPos
                        throws ExecutionException {
 
                try {
-                       newTaxon = CdmStore.getService(ITaxonService.class).changeSynonymToAcceptedTaxon(synonym, element, true, true, null, null);
+                       newNode = (TaxonNode) CdmStore.getService(ITaxonService.class).changeSynonymToAcceptedTaxon(synonym.getUuid(),
+                               element.getUuid(),
+                               parentNode.getUuid(),
+                               true,
+                               true,
+                               null,
+                               null).getCdmEntity();
                } catch (HomotypicalGroupChangeException e) {
                        MessagingUtils.warningDialog("Operation may lead to inconsistent data", getClass(), e.getMessage());
                        return postExecute(null);
                }
                monitor.worked(20);
+               //newTaxon = (Taxon) CdmStore.getService(ITaxonService.class).merge(newTaxon);
+               //element.removeSynonym(synonym);
 
-               element.removeSynonym(synonym);
-               newNode = parentNode.addChildTaxon(newTaxon, null, null);
 
                /*if(namesInHomotypicGroup != null){
                        Taxon taxon = newNode.getTaxon();
                        for (TaxonNameBase synonymName : namesInHomotypicGroup){
                                taxon.addHomotypicSynonymName(synonymName, null, null);
-                               
+
                        }
                }*/
+               //newNode = CdmStore.getService(ITaxonNodeService.class).merge(newNode);
 
                monitor.worked(40);
 
index 65b9e179727c29d0e78317ea004eab4e42e61464..2360ceff0c7be50f350b0d2f9d9d6d52e569e49e 100644 (file)
@@ -17,9 +17,7 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
-import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
@@ -81,7 +79,12 @@ public class ChangeSynonymToMisapplicationOperation extends AbstractPostTaxonOpe
                // add misapplied name to taxon
                // TODO add microcitation for misapplied name to property sheet (if microcitation is indeed needed?!)
                element.addMisappliedName(misapplication, null, null);*/
-               misapplication = CdmStore.getService(ITaxonService.class).changeSynonymToRelatedTaxon(synonym, element, TaxonRelationshipType.MISAPPLIED_NAME_FOR(), null, null);
+               misapplication =
+                       (Taxon) CdmStore.getService(ITaxonService.class).changeSynonymToRelatedTaxon(synonym.getUuid(),
+                               element.getUuid(),
+                               TaxonRelationshipType.MISAPPLIED_NAME_FOR(),
+                               null,
+                               null).getCdmEntity();
                // redraw editor if exists
                return postExecute(misapplication);
        }
index d0d3d74c3caebe2d30b788ff847bda789f81bc76..c53f5d04111e00ef75be0db73d61eb5016aec11b 100644 (file)
@@ -16,7 +16,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
@@ -33,7 +33,7 @@ public class CreateSynonymInExistingHomotypicalGroupOperation extends
                AbstractPostTaxonOperation {
 
        private final HomotypicalGroup group;
-       private final TaxonNameBase newSynonymName;
+       private final NonViralName newSynonymName;
 
        private SynonymRelationship synonymRelationship;
 
@@ -48,7 +48,7 @@ public class CreateSynonymInExistingHomotypicalGroupOperation extends
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
         */
        public CreateSynonymInExistingHomotypicalGroupOperation(String label,
-                       IUndoContext undoContext, Taxon taxon, HomotypicalGroup group, TaxonNameBase newSynonymName, IPostOperationEnabled postOperationEnabled) {
+                       IUndoContext undoContext, Taxon taxon, HomotypicalGroup group, NonViralName newSynonymName, IPostOperationEnabled postOperationEnabled) {
                super(label, undoContext, taxon, postOperationEnabled);
                this.group = group;
                this.newSynonymName = newSynonymName;
index d32db52ea2a316343727fc4326136a255ed69064..0c03146a44868cc2023c304988504454f0a7925f 100644 (file)
@@ -21,7 +21,6 @@ import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator;
 import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
 import eu.etaxonomy.cdm.model.reference.Reference;
 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.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
@@ -68,20 +67,20 @@ public class DeleteMisapplicationOperation extends AbstractPostTaxonOperation {
 
                // Find misapplication relation, save citation information
 
-               for (TaxonRelationship relationship : element.getTaxonRelations()) {
-                       if (relationship.getType().equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR())
-                                       && relationship.getFromTaxon().equals(misapplication)) {
-                               citation = relationship.getCitation();
-                               microcitation = relationship.getCitationMicroReference();
-                       }
-               }
+//             for (TaxonRelationship relationship : element.getTaxonRelations()) {
+//                     if (relationship.getType().equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR())
+//                                     && relationship.getFromTaxon().equals(misapplication)) {
+//                             citation = relationship.getCitation();
+//                             microcitation = relationship.getCitationMicroReference();
+//                     }
+//             }
                monitor.worked(20);
 
                // Remove misapplied name relation from taxon
                element.removeTaxon(misapplication, TaxonRelationshipType.MISAPPLIED_NAME_FOR());
                ICdmApplicationConfiguration controller;
 
-               controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration();
+               controller = CdmStore.getCurrentApplicationConfiguration();
 
                ITaxonService service = controller.getTaxonService();
                TaxonDeletionConfigurator config = new TaxonDeletionConfigurator();
index fdef1cd3544a759252bfb21cf303ba7494794b3b..d005de543ea74455d674c432a0105a0cc81c1068 100644 (file)
@@ -16,7 +16,6 @@ import org.eclipse.core.commands.operations.IUndoContext;
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.MessageDialog;
 
 import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.api.service.DeleteResult;
@@ -24,6 +23,8 @@ import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
+import eu.etaxonomy.taxeditor.model.DeleteResultMessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -71,19 +72,19 @@ public class DeleteSynonymOperation extends AbstractPostTaxonOperation {
 
                                ICdmApplicationConfiguration controller;
 
-                               controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration();
+                               controller = CdmStore.getCurrentApplicationConfiguration();
 
                                ITaxonService service = controller.getTaxonService();
                                if (synonym.getId() == 0){
                                        element.removeSynonym(synonym);
 
                                } else {
-                                       
-                                       DeleteResult result = service.deleteSynonym(synonym, null);
+//TODO: this should be moved to the handler, the operations should not contain ui code
+                                       DeleteResult result = service.deleteSynonym(synonym.getUuid(), element.getUuid(), null);
                                        if (result.isError()){
-                                               MessageDialog.openError(null, "Delete failed", result.toString());
+                                               DeleteResultMessagingUtils.messageDialogWithDetails(result, "Delete failed", TaxeditorEditorPlugin.PLUGIN_ID);
                                        } else if (!result.getUpdatedObjects().isEmpty()){
-                                               MessageDialog.openInformation(null, "Delete successfull", "The Synonym could be deleted, but there is an updated object: " + result.toString());
+                                           DeleteResultMessagingUtils.messageDialogWithDetails(result, "The Synonym could be deleted, but related object(s) could not be deleted", TaxeditorEditorPlugin.PLUGIN_ID);
                                        }
                                }
                        //      taxon.removeSynonym(synonym);
index c65dda535e5f559e04d9da813723b6cab3b6d58f..5d4c6f945ec16770717989b6bf22ab8a411e6580 100644 (file)
@@ -11,15 +11,20 @@ import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;\r
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;\r
 \r
 public class DeleteTaxonBaseOperation extends AbstractPersistentPostOperation {\r
 \r
        protected TaxonDeletionConfigurator configurator;\r
 \r
-       public DeleteTaxonBaseOperation(String label, IUndoContext undoContext,\r
-               TaxonDeletionConfigurator configurator, IWorkbenchPage activePage, IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled) {\r
-               super(label, undoContext, postOperationEnabled,\r
-                                conversationEnabled);\r
+       public DeleteTaxonBaseOperation(String label,\r
+               IUndoContext undoContext,\r
+               TaxonDeletionConfigurator configurator,\r
+               IWorkbenchPage activePage,\r
+               IPostOperationEnabled postOperationEnabled,\r
+               IConversationEnabled conversationEnabled,\r
+               ICdmEntitySessionEnabled cdmEntitySessionEnabled) {\r
+               super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);\r
                this.configurator = configurator;\r
 \r
        }\r
index 8c51e6668ce76e28b8280aeee42a13a4fdcca6b2..48632e45bc1cc2641255b9470f256d27e952f17a 100644 (file)
@@ -8,7 +8,6 @@ import org.eclipse.core.commands.operations.IUndoContext;
 import org.eclipse.core.runtime.IAdaptable;\r
 import org.eclipse.core.runtime.IProgressMonitor;\r
 import org.eclipse.core.runtime.IStatus;\r
-import org.eclipse.jface.dialogs.MessageDialog;\r
 import org.eclipse.ui.IWorkbenchPage;\r
 \r
 import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;\r
@@ -19,17 +18,26 @@ import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
 import eu.etaxonomy.cdm.model.taxon.Classification;\r
 import eu.etaxonomy.cdm.model.taxon.Taxon;\r
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
-import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
+import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;\r
+import eu.etaxonomy.taxeditor.model.DeleteResultMessagingUtils;\r
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 \r
 public class DeleteTaxonOperation extends DeleteTaxonBaseOperation{\r
 \r
     private final Classification classification;\r
 \r
-       public DeleteTaxonOperation(String label, IUndoContext undoContext,\r
-                       Taxon taxon, TaxonDeletionConfigurator configurator, Classification classification, IWorkbenchPage activePage, IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled) {\r
-               super(label, undoContext, configurator, activePage, postOperationEnabled, conversationEnabled);\r
+       public DeleteTaxonOperation(String label,\r
+               IUndoContext undoContext,\r
+                       Taxon taxon,\r
+                       TaxonDeletionConfigurator configurator,\r
+                       Classification classification,\r
+                       IWorkbenchPage activePage,\r
+                       IPostOperationEnabled postOperationEnabled,\r
+                       IConversationEnabled conversationEnabled,\r
+            ICdmEntitySessionEnabled cdmEntitySessionEnabled) {\r
+               super(label, undoContext, configurator, activePage, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);\r
                this.element = taxon;\r
 \r
                Set<TaxonNode> nodes = taxon.getTaxonNodes();\r
@@ -64,12 +72,12 @@ public class DeleteTaxonOperation extends DeleteTaxonBaseOperation{
 \r
                                ITaxonService service = controller.getTaxonService();\r
 \r
-\r
                                DeleteResult result =   service.deleteTaxon(element.getUuid(), configurator, classification.getUuid());\r
+
                                if (result.isError()){\r
-                                       MessageDialog.openError(null, "Delete failed", result.toString());\r
+                                   DeleteResultMessagingUtils.messageDialogWithDetails(result, "Delete failed", TaxeditorEditorPlugin.PLUGIN_ID);\r
                                } else if (!result.getUpdatedObjects().isEmpty()){\r
-                                       MessagingUtils.informationDialog("Delete successfull", result.toString());\r
+                    DeleteResultMessagingUtils.messageDialogWithDetails(result, "The Taxon was deleted, but related object(s) could not be deleted", TaxeditorEditorPlugin.PLUGIN_ID);\r
                                }\r
 \r
                                monitor.worked(40);\r
index 2f0d0900f091e885044e2e2186ecbd59263d292a..1e3b300ded473df1a50d7b42f89c222035ed5ecb 100644 (file)
@@ -11,13 +11,11 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;\r
 \r
 import eu.etaxonomy.cdm.api.service.ITaxonService;\r
+import eu.etaxonomy.cdm.api.service.UpdateResult;\r
 import eu.etaxonomy.cdm.api.service.exception.HomotypicalGroupChangeException;\r
-import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;\r
-import eu.etaxonomy.cdm.model.name.HomotypicalGroup;\r
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
 import eu.etaxonomy.cdm.model.taxon.Synonym;\r
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;\r
-import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;\r
 import eu.etaxonomy.cdm.model.taxon.Taxon;\r
 import eu.etaxonomy.taxeditor.editor.EditorUtil;\r
 import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;\r
@@ -34,8 +32,8 @@ public class MoveSynonymToAnotherAcceptedTaxonOperation extends
        private final Synonym synonym;\r
 \r
        private final Taxon oldTaxon;\r
-       \r
-       \r
+\r
+\r
        /**\r
         * <p>Constructor for MoveSynonymToAnotherAcceptedTaxon.</p>\r
         *\r
@@ -43,12 +41,12 @@ public class MoveSynonymToAnotherAcceptedTaxonOperation extends
         * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.\r
         * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.\r
         * @param synonym a {@link eu.etaxonomy.cdm.model.taxon.Synonym} object.\r
-        \r
+\r
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.\r
         */\r
        public MoveSynonymToAnotherAcceptedTaxonOperation(String label, IUndoContext undoContext,\r
                        UUID oldTaxonUUID, UUID synonymUUID, Taxon taxon, IPostOperationEnabled postOperationEnabled) {\r
-               \r
+\r
                super(label, undoContext, taxon, postOperationEnabled);\r
                List<String> propertyPaths =  new ArrayList<String>();\r
                propertyPaths.add("synonymRelations");\r
@@ -69,28 +67,34 @@ public class MoveSynonymToAnotherAcceptedTaxonOperation extends
                TaxonNameBase<?, ?> synonymName = synonym.getName();\r
                monitor.worked(20);\r
 \r
-               \r
+\r
 \r
                // Switch groups\r
-               \r
+\r
                monitor.worked(40);\r
                SynonymRelationship synRel = synonym.getSynonymRelations().iterator().next();\r
-               \r
-               \r
-               \r
+\r
+\r
+\r
                ((TaxonNameEditor)EditorUtil.getActiveMultiPageTaxonEditor().getActiveEditor()).getConversationHolder().commit();\r
-               \r
-               \r
-               \r
+               UpdateResult result;\r
+\r
+\r
                try {\r
-                       synRel = CdmStore.getService(ITaxonService.class).moveSynonymToAnotherTaxon(synRel, this.element, true, synRel.getType(), null, null, true);\r
+                       result = CdmStore.getService(ITaxonService.class).moveSynonymToAnotherTaxon(synRel,\r
+                               this.element.getUuid(),\r
+                               true,\r
+                               synRel.getType(),\r
+                               null,\r
+                               null,\r
+                               true);\r
                } catch (HomotypicalGroupChangeException e) {\r
                        // TODO Auto-generated catch block\r
                        e.printStackTrace();\r
                }\r
                ((TaxonNameEditor)EditorUtil.getActiveMultiPageTaxonEditor().getActiveEditor()).getConversationHolder().commit();\r
-               \r
-               \r
+\r
+\r
 \r
                // Redraw editor if it exists\r
                return postExecute(synRel.getSynonym());\r
index 1c7da40a872f184372609304c2907d6214083cea..507b2cfe5ad04ace248f3bd414e5b068afa06e96 100644 (file)
@@ -17,12 +17,14 @@ 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.UpdateResult;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -48,8 +50,9 @@ public class SwapSynonymAndAcceptedOperation extends AbstractPostTaxonOperation
         * @param synonym a {@link eu.etaxonomy.cdm.model.taxon.Synonym} object.
         */
        public SwapSynonymAndAcceptedOperation(String label, IUndoContext undoContext,
-                       Taxon taxon, Synonym synonym, IPostOperationEnabled postOperationEnabled) {
-               super("Swap Synonym And Accepted Taxon Operation", undoContext, taxon, postOperationEnabled);
+                       Taxon taxon, Synonym synonym, IPostOperationEnabled postOperationEnabled,
+                       ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super("Swap Synonym And Accepted Taxon Operation", undoContext, taxon, postOperationEnabled, cdmEntitySessionEnabled);
 
                this.synonym = synonym;
        }
@@ -64,7 +67,7 @@ public class SwapSynonymAndAcceptedOperation extends AbstractPostTaxonOperation
 
                monitor.worked(20);
 
-               CdmStore.getService(ITaxonService.class).swapSynonymAndAcceptedTaxon(synonym, element);
+               UpdateResult result = CdmStore.getService(ITaxonService.class).swapSynonymAndAcceptedTaxon(synonym.getUuid(), element.getUuid());
 
                monitor.worked(40);
 
index e5665f3939705e96af0216a134c8ab16d05bedeb..cdecde04a0e8e248afbcace4e134729bc470c3e0 100644 (file)
@@ -12,6 +12,7 @@ package eu.etaxonomy.taxeditor.editor.view.checklist;
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -57,6 +58,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
@@ -75,6 +77,8 @@ import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -87,7 +91,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @version 1.0
  */
 public class ChecklistEditor extends EditorPart implements ISelectionListener, IPartContentHasFactualData,
-        IConversationEnabled, IContextListener, IPartContentHasDetails, IDirtyMarkable {
+        IConversationEnabled, IContextListener, IPartContentHasDetails, IDirtyMarkable, ICdmEntitySessionEnabled {
 
     private static final Logger logger = Logger.getLogger(ChecklistEditor.class);
     /**
@@ -181,6 +185,8 @@ public class ChecklistEditor extends EditorPart implements ISelectionListener, I
 
     private Label statusLabel;
 
+    private final ICdmEntitySession cdmEntitySession;
+
     private SortedSet<DefinedTermBase> terms = null;
        private ToolItem toolItem;
        private ChecklistDropdownSelectionListener dropListener;
@@ -206,6 +212,7 @@ public class ChecklistEditor extends EditorPart implements ISelectionListener, I
      * </p>
      */
     public ChecklistEditor() {
+        cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
     }
 
     /** {@inheritDoc} */
@@ -439,12 +446,14 @@ public class ChecklistEditor extends EditorPart implements ISelectionListener, I
     /** {@inheritDoc} */
     @Override
     public void dispose() {
+        cdmEntitySession.dispose();
         super.dispose();
     }
 
     /** {@inheritDoc} */
     @Override
     public void setFocus() {
+        cdmEntitySession.bind();
         viewer.getControl().setFocus();
     }
 
@@ -757,4 +766,31 @@ public class ChecklistEditor extends EditorPart implements ISelectionListener, I
     public boolean isDirty() {
         return dirty;
     }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getCdmEntitySession()
+     */
+    @Override
+    public ICdmEntitySession getCdmEntitySession() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getRootEntities()
+     */
+    @Override
+    public <T extends CdmBase> Collection<T> getRootEntities() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+     */
+    @Override
+    public Map<Object, List<String>> getPropertyPathsMap() {
+        // TODO Auto-generated method stub
+        return null;
+    }
 }
index 92f55fcf138292f024e87f47b768ae2a0bbc96cf..bab0e949c77cf58b0d0dbe6002e466b6c74992a1 100644 (file)
@@ -137,4 +137,5 @@ public class ConceptViewPart extends AbstractCdmEditorViewPart implements IPartC
                getViewer().refresh();
                super.changed(object);
        }
+
 }
index d3e4b123157f3f31a884686ceab7fda9bfb081ef..40bde0da3e75c2b2e9ac25bd89d470334fd1a1ab 100644 (file)
@@ -22,6 +22,7 @@ import org.hibernate.envers.query.criteria.AuditCriterion;
 
 import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.api.service.IAgentService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
 import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
 import eu.etaxonomy.cdm.api.service.dto.FindByIdentifierDTO;
@@ -44,6 +45,7 @@ import eu.etaxonomy.cdm.model.media.Rights;
 import eu.etaxonomy.cdm.model.view.AuditEvent;
 import eu.etaxonomy.cdm.model.view.AuditEventRecord;
 import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.query.Grouping;
 import eu.etaxonomy.cdm.persistence.query.MatchMode;
@@ -759,13 +761,13 @@ public class TransientAgentService implements IAgentService {
        }
 
        @Override
-       public Team convertPerson2Team(Person arg0) throws MergeException,
+       public UpdateResult convertPerson2Team(Person arg0) throws MergeException,
                        IllegalArgumentException {
                return defaultService.convertPerson2Team(arg0);
        }
 
        @Override
-       public Person convertTeam2Person(Team arg0) throws MergeException,
+       public UpdateResult convertTeam2Person(Team arg0) throws MergeException,
                        IllegalArgumentException {
                return defaultService.convertTeam2Person(arg0);
        }
@@ -792,4 +794,56 @@ public class TransientAgentService implements IAgentService {
        return defaultService.merge(arg0);
     }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#merge(java.util.List, boolean)
+     */
+    @Override
+    public List<MergeResult<AgentBase>> merge(List<AgentBase> arg0, boolean arg1) {
+        return defaultService.merge(arg0, arg1);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase, boolean)
+     */
+    @Override
+    public MergeResult<AgentBase> merge(AgentBase arg0, boolean arg1) {
+       return defaultService.merge(arg0, arg1);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#loadWithUpdate(java.util.UUID)
+     */
+    @Override
+    public AgentBase loadWithUpdate(UUID arg0) {
+        return defaultService.loadWithUpdate(arg0);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IAgentService#convertPerson2Team(java.util.UUID)
+     */
+    @Override
+    public UpdateResult convertPerson2Team(UUID arg0) throws MergeException, IllegalArgumentException {
+        return defaultService.convertPerson2Team(arg0);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IAgentService#convertTeam2Person(java.util.UUID)
+     */
+    @Override
+    public UpdateResult convertTeam2Person(UUID arg0) throws MergeException {
+        return defaultService.convertTeam2Person(arg0);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public List<AgentBase> load(List<UUID> arg0, List<String> arg1) {
+        return defaultService.load(arg0, arg1);
+    }
+
+    @Override
+    public List<Person> getAllAgentsUsedAsUser(){
+        return defaultService.getAllAgentsUsedAsUser();
+    }
 }
index caa6991897609acb5672a25d1935bddccf132a7b..f3d17729b1ae0e56a7cf613a65d19be9e7204ea0 100644 (file)
@@ -18,6 +18,7 @@ import org.springframework.transaction.TransactionStatus;
 import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.IAgentService;
+import eu.etaxonomy.cdm.api.service.IAnnotationService;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.api.service.ICollectionService;
 import eu.etaxonomy.cdm.api.service.ICommonService;
@@ -25,6 +26,7 @@ import eu.etaxonomy.cdm.api.service.IDatabaseService;
 import eu.etaxonomy.cdm.api.service.IDescriptionService;
 import eu.etaxonomy.cdm.api.service.IEntityConstraintViolationService;
 import eu.etaxonomy.cdm.api.service.IEntityValidationService;
+import eu.etaxonomy.cdm.api.service.IEventBaseService;
 import eu.etaxonomy.cdm.api.service.IFeatureNodeService;
 import eu.etaxonomy.cdm.api.service.IFeatureTreeService;
 import eu.etaxonomy.cdm.api.service.IGrantedAuthorityService;
@@ -32,10 +34,12 @@ import eu.etaxonomy.cdm.api.service.IGroupService;
 import eu.etaxonomy.cdm.api.service.IIdentificationKeyService;
 import eu.etaxonomy.cdm.api.service.ILocationService;
 import eu.etaxonomy.cdm.api.service.IMediaService;
+import eu.etaxonomy.cdm.api.service.IMetadataService;
 import eu.etaxonomy.cdm.api.service.INameService;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService;
 import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
+import eu.etaxonomy.cdm.api.service.IProgressMonitorService;
 import eu.etaxonomy.cdm.api.service.IReferenceService;
 import eu.etaxonomy.cdm.api.service.IService;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
@@ -400,6 +404,11 @@ public class TransientCdmRepository implements ICdmApplicationConfiguration {
         return defaultApplicationConfiguration.getSequenceService();
     }
 
+    @Override
+    public IEventBaseService getEventBaseService() {
+        return defaultApplicationConfiguration.getEventBaseService();
+    }
+
        @Override
        public IEntityConstraintViolationService getEntityConstraintViolationService() {
                return defaultApplicationConfiguration.getEntityConstraintViolationService();
@@ -409,4 +418,28 @@ public class TransientCdmRepository implements ICdmApplicationConfiguration {
        public IEntityValidationService getEntityValidationService() {
                return defaultApplicationConfiguration.getEntityValidationService();
        }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getAnnotationService()
+     */
+    @Override
+    public IAnnotationService getAnnotationService() {
+        return defaultApplicationConfiguration.getAnnotationService();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public IProgressMonitorService getProgressMonitorService() {
+        return defaultApplicationConfiguration.getProgressMonitorService();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public IMetadataService getMetadataService() {
+        return defaultApplicationConfiguration.getMetadataService();
+    }
 }
index 07fdcf242c6dcb7a32a98cd34f2f451152bed0e9..9a8a1b83ab794cc5969196afe37cab2674cb3795 100644 (file)
@@ -46,6 +46,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.model.view.AuditEvent;
 import eu.etaxonomy.cdm.model.view.AuditEventRecord;
 import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.query.Grouping;
 import eu.etaxonomy.cdm.persistence.query.MatchMode;
@@ -646,8 +647,8 @@ public class TransientClassificationService implements IClassificationService {
      * @see eu.etaxonomy.cdm.api.service.IClassificationService#getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(eu.etaxonomy.cdm.model.taxon.Classification)
      */
     @Override
-    public List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification) {
-        return defaultService.getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(classification);
+    public List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification, List<UUID> excludeTaxa) {
+        return defaultService.getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(classification, excludeTaxa);
     }
 
     /**
@@ -950,6 +951,45 @@ public class TransientClassificationService implements IClassificationService {
         return defaultService.merge(arg0);
     }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#merge(java.util.List, boolean)
+     */
+    @Override
+    public List<MergeResult<Classification>> merge(List<Classification> arg0, boolean arg1) {
+        return defaultService.merge(arg0, arg1);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase, boolean)
+     */
+    @Override
+    public MergeResult<Classification> merge(Classification arg0, boolean arg1) {
+        return defaultService.merge(arg0, arg1);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#loadWithUpdate(java.util.UUID)
+     */
+    @Override
+    public Classification loadWithUpdate(UUID arg0) {
+        return defaultService.loadWithUpdate(arg0);
+    }
+
+
+       @Override
+       public List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(
+                       UUID classificationUuid, List<UUID> excludeTaxa) {
+
+               return defaultService.getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(classificationUuid, excludeTaxa);
+       }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public List<Classification> load(List<UUID> arg0, List<String> arg1) {
+        return defaultService.load(arg0, arg1);
+    }
 
 
 }
index 64936020cd132d6288bea48dfbfb66d588988cfa..006809900ddd8d45b5783371cd2a92689df5341b 100644 (file)
@@ -38,6 +38,7 @@ import eu.etaxonomy.cdm.model.occurrence.Collection;
 import eu.etaxonomy.cdm.model.view.AuditEvent;
 import eu.etaxonomy.cdm.model.view.AuditEventRecord;
 import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.query.Grouping;
 import eu.etaxonomy.cdm.persistence.query.MatchMode;
@@ -726,4 +727,37 @@ public class TransientCollectionService implements ICollectionService {
         return defaultService.merge(arg0);
     }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#merge(java.util.List, boolean)
+     */
+    @Override
+    public List<MergeResult<Collection>> merge(List<Collection> arg0, boolean arg1) {
+        return defaultService.merge(arg0, arg1);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase, boolean)
+     */
+    @Override
+    public MergeResult<Collection> merge(Collection arg0, boolean arg1) {
+        return defaultService.merge(arg0, arg1);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#loadWithUpdate(java.util.UUID)
+     */
+    @Override
+    public Collection loadWithUpdate(UUID arg0) {
+        return defaultService.loadWithUpdate(arg0);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public List<Collection> load(List<UUID> arg0, List<String> arg1) {
+        return defaultService.load(arg0, arg1);
+    }
+
+
 }
index ebcd3128c38605bd094c12d1f99ad408e7b7f0fe..ee1e09b6bda5ba4d832d9febf8225c163ab08335 100644 (file)
@@ -54,6 +54,7 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.view.AuditEvent;
 import eu.etaxonomy.cdm.model.view.AuditEventRecord;
 import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.query.Grouping;
@@ -545,7 +546,7 @@ public class TransientDescriptionService implements IDescriptionService {
      */
     @Deprecated
     @Override
-    public Pager<DescriptionElementBase> getDescriptionElements(DescriptionBase description, Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+    public <T extends DescriptionElementBase> Pager<T> getDescriptionElements(DescriptionBase description, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
         return defaultService.getDescriptionElements(description, features, type, pageSize, pageNumber, propertyPaths);
     }
 
@@ -625,7 +626,7 @@ public class TransientDescriptionService implements IDescriptionService {
      * @see eu.etaxonomy.cdm.api.service.IDescriptionService#pageDescriptionElements(eu.etaxonomy.cdm.model.description.DescriptionBase, java.lang.Class, java.util.Set, java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List)
      */
     @Override
-    public Pager<DescriptionElementBase> pageDescriptionElements(DescriptionBase description, Class<? extends DescriptionBase> descriptionType, Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+    public <T extends DescriptionElementBase> Pager<T> pageDescriptionElements(DescriptionBase description, Class<? extends DescriptionBase> descriptionType, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
         return defaultService.pageDescriptionElements(description, descriptionType, features, type, pageSize, pageNumber, propertyPaths);
     }
 
@@ -700,7 +701,7 @@ public class TransientDescriptionService implements IDescriptionService {
      */
     @Deprecated
     @Override
-    public List<DescriptionElementBase> listDescriptionElements(DescriptionBase description, Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+    public <T extends DescriptionElementBase> List<T> listDescriptionElements(DescriptionBase description, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
         return defaultService.listDescriptionElements(description, features, type, pageSize, pageNumber, propertyPaths);
     }
 
@@ -793,7 +794,7 @@ public class TransientDescriptionService implements IDescriptionService {
      * @see eu.etaxonomy.cdm.api.service.IDescriptionService#listDescriptionElements(eu.etaxonomy.cdm.model.description.DescriptionBase, java.lang.Class, java.util.Set, java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List)
      */
     @Override
-    public List<DescriptionElementBase> listDescriptionElements(DescriptionBase description, Class<? extends DescriptionBase> descriptionType, Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+    public <T extends DescriptionElementBase> List<T> listDescriptionElements(DescriptionBase description, Class<? extends DescriptionBase> descriptionType, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
         return defaultService.listDescriptionElements(description, descriptionType, features, type, pageSize, pageNumber, propertyPaths);
     }
 
@@ -1075,11 +1076,12 @@ public class TransientDescriptionService implements IDescriptionService {
      * @param descriptionElements
      * @param targetDescription
      * @param isPaste
+     * @return
      * @see eu.etaxonomy.cdm.api.service.IDescriptionService#moveDescriptionElementsToDescription(java.util.Collection, eu.etaxonomy.cdm.model.description.DescriptionBase, boolean)
      */
     @Override
-    public void moveDescriptionElementsToDescription(Collection<DescriptionElementBase> descriptionElements, DescriptionBase targetDescription, boolean isPaste) {
-        defaultService.moveDescriptionElementsToDescription(descriptionElements, targetDescription, isPaste);
+    public UpdateResult moveDescriptionElementsToDescription(Collection<DescriptionElementBase> descriptionElements, DescriptionBase targetDescription, boolean isPaste) {
+        return defaultService.moveDescriptionElementsToDescription(descriptionElements, targetDescription, isPaste);
     }
 
     /* (non-Javadoc)
@@ -1179,4 +1181,63 @@ public class TransientDescriptionService implements IDescriptionService {
         return defaultService.merge(arg0);
     }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IDescriptionService#moveDescriptionElementsToDescription(java.util.Set, java.util.UUID, boolean)
+     */
+    @Override
+    public UpdateResult moveDescriptionElementsToDescription(Set<UUID> arg0, UUID arg1, boolean arg2) {
+        return defaultService.moveDescriptionElementsToDescription(arg0, arg1, arg2);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IDescriptionService#moveDescriptionElementsToDescription(java.util.Set, java.util.UUID, java.lang.String, boolean)
+     */
+    @Override
+    public UpdateResult moveDescriptionElementsToDescription(Set<UUID> arg0, UUID arg1, String arg2, boolean arg3) {
+        return defaultService.moveDescriptionElementsToDescription(arg0, arg1, arg2, arg3);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#merge(java.util.List, boolean)
+     */
+    @Override
+    public List<MergeResult<DescriptionBase>> merge(List<DescriptionBase> arg0, boolean arg1) {
+        return defaultService.merge(arg0, arg1);
+    }
+
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase, boolean)
+     */
+    @Override
+    public MergeResult<DescriptionBase> merge(DescriptionBase arg0, boolean arg1) {
+        return defaultService.merge(arg0, arg1);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#loadWithUpdate(java.util.UUID)
+     */
+    @Override
+    public DescriptionBase loadWithUpdate(UUID arg0) {
+        return defaultService.loadWithUpdate(arg0);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IDescriptionService#moveTaxonDescription(java.util.UUID, java.util.UUID)
+     */
+    @Override
+    public UpdateResult moveTaxonDescription(UUID arg0, UUID arg1) {
+
+        return defaultService.moveTaxonDescriptions(arg0, arg1);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public List<DescriptionBase> load(List<UUID> arg0, List<String> arg1) {
+        return defaultService.load(arg0, arg1);
+    }
+
 }
index 579e6fce7b19568b4c9973d97fcaf8f75755bd9d..9a85236c18668551ff3e583fe0997cae7d8c66f7 100644 (file)
@@ -18,7 +18,7 @@ import java.util.Set;
 import java.util.UUID;
 
 import org.apache.lucene.index.CorruptIndexException;
-import org.apache.lucene.queryParser.ParseException;
+import org.apache.lucene.queryparser.classic.ParseException;
 import org.hibernate.LockOptions;
 import org.hibernate.Session;
 import org.hibernate.criterion.Criterion;
@@ -63,6 +63,7 @@ import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
 import eu.etaxonomy.cdm.model.view.AuditEvent;
 import eu.etaxonomy.cdm.model.view.AuditEventRecord;
 import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.query.Grouping;
 import eu.etaxonomy.cdm.persistence.query.MatchMode;
@@ -292,8 +293,13 @@ public class TransientNameService implements INameService {
      * @see eu.etaxonomy.cdm.api.service.INameService#deleteTypeDesignation(eu.etaxonomy.cdm.model.name.TaxonNameBase, eu.etaxonomy.cdm.model.name.TypeDesignationBase)
      */
     @Override
-    public void deleteTypeDesignation(TaxonNameBase name, TypeDesignationBase typeDesignation) {
-        defaultService.deleteTypeDesignation(name, typeDesignation);
+    public DeleteResult deleteTypeDesignation(TaxonNameBase name, TypeDesignationBase typeDesignation) {
+        return defaultService.deleteTypeDesignation(name, typeDesignation);
+    }
+
+    @Override
+    public DeleteResult deleteTypeDesignation(UUID arg0, UUID arg1) {
+        return defaultService.deleteTypeDesignation(arg0, arg1);
     }
 
     /**
@@ -1197,4 +1203,37 @@ public class TransientNameService implements INameService {
     public List<TaxonNameBase> merge(List<TaxonNameBase> arg0) {
         return defaultService.merge(arg0);
     }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#merge(java.util.List, boolean)
+     */
+    @Override
+    public List<MergeResult<TaxonNameBase>> merge(List<TaxonNameBase> arg0, boolean arg1) {
+        return defaultService.merge(arg0, arg1);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase, boolean)
+     */
+    @Override
+    public MergeResult<TaxonNameBase> merge(TaxonNameBase arg0, boolean arg1) {
+        return defaultService.merge(arg0, arg1);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#loadWithUpdate(java.util.UUID)
+     */
+    @Override
+    public TaxonNameBase loadWithUpdate(UUID arg0) {
+        return defaultService.loadWithUpdate(arg0);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public List<TaxonNameBase> load(List<UUID> arg0, List<String> arg1) {
+        return defaultService.load(arg0, arg1);
+    }
+
 }
index 4b5d0106a9ccb5add07c05655a1f249ba7dccfa3..96726beeb6a67054ff540ae36bb7bf60ad42f3ef 100644 (file)
@@ -18,7 +18,7 @@ import java.util.Set;
 import java.util.UUID;
 
 import org.apache.lucene.index.CorruptIndexException;
-import org.apache.lucene.queryParser.ParseException;
+import org.apache.lucene.queryparser.classic.ParseException;
 import org.hibernate.LockOptions;
 import org.hibernate.Session;
 import org.hibernate.criterion.Criterion;
@@ -41,7 +41,6 @@ import eu.etaxonomy.cdm.api.service.search.SearchResult;
 import eu.etaxonomy.cdm.api.service.util.TaxonRelationshipEdge;
 import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
 import eu.etaxonomy.cdm.model.common.Annotation;
-import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.DefinedTerm;
 import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.common.ISourceable;
@@ -58,8 +57,8 @@ import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.media.Rights;
 import eu.etaxonomy.cdm.model.molecular.DnaSample;
 import eu.etaxonomy.cdm.model.molecular.Sequence;
-import eu.etaxonomy.cdm.model.molecular.SingleRead;
 import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
@@ -70,6 +69,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.view.AuditEvent;
 import eu.etaxonomy.cdm.model.view.AuditEventRecord;
 import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.query.Grouping;
 import eu.etaxonomy.cdm.persistence.query.MatchMode;
@@ -916,11 +916,6 @@ public class TransientOccurenceService implements IOccurrenceService {
         return defaultService.getNonCascadedAssociatedElements(specimen);
     }
 
-    @Override
-    public DeleteResult deleteDerivateHierarchy(CdmBase from, SpecimenDeleteConfigurator config) {
-        return defaultService.deleteDerivateHierarchy(from, config);
-    }
-
     @Override
     public DeleteResult delete(SpecimenOrObservationBase<?> specimen, SpecimenDeleteConfigurator config) {
         return defaultService.delete(specimen, config);
@@ -932,12 +927,6 @@ public class TransientOccurenceService implements IOccurrenceService {
         return defaultService.listIndividualsAssociations(specimen, limit, start, orderHints, propertyPaths);
     }
 
-    @Override
-    public Collection<SpecimenTypeDesignation> listTypeDesignations(SpecimenOrObservationBase<?> specimen,
-            Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
-        return defaultService.listTypeDesignations(specimen, limit, start, orderHints, propertyPaths);
-    }
-
     @Override
     public Collection<DescriptionBase<?>> listDescriptionsWithDescriptionSpecimen(
             SpecimenOrObservationBase<?> specimen, Integer limit, Integer start, List<OrderHint> orderHints,
@@ -987,9 +976,6 @@ public class TransientOccurenceService implements IOccurrenceService {
        }
 
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IService#delete(java.util.UUID)
-     */
     @Override
     public DeleteResult delete(UUID uuid) {
         return defaultService.delete(uuid);
@@ -1000,57 +986,124 @@ public class TransientOccurenceService implements IOccurrenceService {
         return defaultService.delete(arg0);
     }
 
-    @Override
-    public DeleteResult deleteSingleRead(SingleRead singleRead, Sequence sequence){
-        return defaultService.deleteSingleRead(singleRead, sequence);
-    }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IService#merge(java.util.List)
-     */
     @Override
     public List<SpecimenOrObservationBase> merge(List<SpecimenOrObservationBase> arg0) {
         return defaultService.merge(arg0);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#deleteDerivateHierarchy(java.util.UUID, eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator)
+    @Override
+    public UpdateResult moveDerivate(UUID arg0, UUID arg1, UUID arg2) {
+        return defaultService.moveDerivate(arg0, arg1, arg2);
+    }
+
+    @Override
+    public boolean moveDerivate(SpecimenOrObservationBase<?> from, SpecimenOrObservationBase<?> to, DerivedUnit derivate) {
+        return defaultService.moveDerivate(from, to, derivate);
+    }
+
+    @Override
+    public UpdateResult moveSequence(UUID arg0, UUID arg1, UUID arg2) {
+        return defaultService.moveSequence(arg0, arg1, arg2);
+    }
+
+    @Override
+    public Pager<Media> getMediainHierarchy(SpecimenOrObservationBase arg0, Integer arg1, Integer arg2,
+            List<String> arg3) {
+        return defaultService.getMediainHierarchy(arg0, arg1, arg2, arg3);
+    }
+
+    @Override
+    public List<MergeResult<SpecimenOrObservationBase>> merge(List<SpecimenOrObservationBase> arg0, boolean arg1) {
+        return defaultService.merge(arg0, arg1);
+    }
+
+    @Override
+    public MergeResult<SpecimenOrObservationBase> merge(SpecimenOrObservationBase arg0, boolean arg1) {
+        return defaultService.merge(arg0, arg1);
+    }
+
+    /**
+     * {@inheritDoc}
      */
     @Override
-    public DeleteResult deleteDerivateHierarchy(UUID arg0, SpecimenDeleteConfigurator arg1) {
-        return defaultService.deleteDerivateHierarchy(arg0, arg1);
+    public Collection<TaxonBase<?>> listAssociatedTaxa(SpecimenOrObservationBase<?> arg0, Integer arg1, Integer arg2,
+            List<OrderHint> arg3, List<String> arg4) {
+        return defaultService.listAssociatedTaxa(arg0, arg1, arg2, arg3, arg4);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#deleteSingleRead(java.util.UUID, java.util.UUID)
+    @Override
+    public SpecimenOrObservationBase loadWithUpdate(UUID arg0) {
+        return defaultService.loadWithUpdate(arg0);
+    }
+
+    /**
+     * {@inheritDoc}
      */
     @Override
-    public DeleteResult deleteSingleRead(UUID arg0, UUID arg1) {
-        return defaultService.deleteSingleRead(arg0, arg1);
+    public DeleteResult delete(UUID arg0, SpecimenDeleteConfigurator arg1) {
+        return defaultService.delete(arg0, arg1);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#moveDerivate(java.util.UUID, java.util.UUID, java.util.UUID)
+    /**
+     * {@inheritDoc}
      */
     @Override
-    public UpdateResult moveDerivate(UUID arg0, UUID arg1, UUID arg2) {
-        return defaultService.moveDerivate(arg0, arg1, arg2);
+    public Pager<SpecimenOrObservationBase> list(Class<? extends SpecimenOrObservationBase> arg0, TaxonNameBase arg1,
+            Integer arg2, Integer arg3, List<OrderHint> arg4, List<String> arg5) {
+        return defaultService.list(arg0, arg1, arg2, arg3, arg4, arg5);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#moveDerivate(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, eu.etaxonomy.cdm.model.occurrence.DerivedUnit)
+    /**
+     * {@inheritDoc}
      */
     @Override
-    public boolean moveDerivate(SpecimenOrObservationBase<?> from, SpecimenOrObservationBase<?> to, DerivedUnit derivate) {
-        return defaultService.moveDerivate(from, to, derivate);
+    public Collection<DeterminationEvent> listDeterminationEvents(SpecimenOrObservationBase<?> arg0, Integer arg1,
+            Integer arg2, List<OrderHint> arg3, List<String> arg4) {
+        return defaultService.listDeterminationEvents(arg0, arg1, arg2, arg3, arg4);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#moveSequence(java.util.UUID, java.util.UUID, java.util.UUID)
+    @Override
+    public Collection<TaxonBase<?>> listDeterminedTaxa(SpecimenOrObservationBase<?> arg0, Integer arg1, Integer arg2,
+            List<OrderHint> arg3, List<String> arg4) {
+        return defaultService.listDeterminedTaxa(arg0, arg1, arg2, arg3, arg4);
+    }
+
+    @Override
+    public Collection<TaxonBase<?>> listIndividualsAssociationTaxa(SpecimenOrObservationBase<?> arg0, Integer arg1,
+            Integer arg2, List<OrderHint> arg3, List<String> arg4) {
+        return defaultService.listIndividualsAssociationTaxa(arg0, arg1, arg2, arg3, arg4);
+    }
+
+     /**
+     * {@inheritDoc}
      */
     @Override
-    public UpdateResult moveSequence(UUID arg0, UUID arg1, UUID arg2) {
-        return defaultService.moveSequence(arg0, arg1, arg2);
+    public List<SpecimenOrObservationBase> load(List<UUID> arg0, List<String> arg1) {
+        return defaultService.load(arg0, arg1);
+    }
+
+    @Override
+    public Collection<TaxonBase<?>> listTypeDesignationTaxa(DerivedUnit arg0, Integer arg1, Integer arg2,
+            List<OrderHint> arg3, List<String> arg4) {
+        return defaultService.listTypeDesignationTaxa(arg0, arg1, arg2, arg3, arg4);
+    }
+
+    @Override
+    public Map<DerivedUnit, Collection<SpecimenTypeDesignation>> listTypeDesignations(Collection<DerivedUnit> arg0,
+            Integer arg1, Integer arg2, List<OrderHint> arg3, List<String> arg4) {
+        return defaultService.listTypeDesignations(arg0, arg1, arg2, arg3, arg4);
+    }
+
+    @Override
+    public Collection<SpecimenTypeDesignation> listTypeDesignations(DerivedUnit arg0, Integer arg1, Integer arg2,
+            List<OrderHint> arg3, List<String> arg4) {
+        return defaultService.listTypeDesignations(arg0, arg1, arg2, arg3, arg4);
+    }
+
+    @Override
+    public List<DerivedUnit> getAllChildDerivatives(UUID arg0) {
+        return defaultService.getAllChildDerivatives(arg0);
     }
 
 
index 550642d65cf02c00c8fd40c2b5cda77a1a68721e..605f12b780543a8423881eadf4bbeb7bf438fa22 100644 (file)
@@ -40,6 +40,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.view.AuditEvent;
 import eu.etaxonomy.cdm.model.view.AuditEventRecord;
 import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.query.Grouping;
 import eu.etaxonomy.cdm.persistence.query.MatchMode;
@@ -733,4 +734,38 @@ public class TransientReferenceService implements IReferenceService {
     public List<Reference> merge(List<Reference> arg0) {
         return defaultService.merge(arg0);
     }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#merge(java.util.List, boolean)
+     */
+    @Override
+    public List<MergeResult<Reference>> merge(List<Reference> arg0, boolean arg1) {
+        return defaultService.merge(arg0, arg1);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase, boolean)
+     */
+    @Override
+    public MergeResult<Reference> merge(Reference arg0, boolean arg1) {
+        return defaultService.merge(arg0, arg1);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#loadWithUpdate(java.util.UUID)
+     */
+    @Override
+    public Reference loadWithUpdate(UUID arg0) {
+        return defaultService.loadWithUpdate(arg0);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public List<Reference> load(List<UUID> arg0, List<String> arg1) {
+        return defaultService.load(arg0, arg1);
+    }
+
+
 }
index d1daa7b1f27dea8b4fb874d0ca0f72fe003eb84d..aacf841c8e8926187d0b1e4c69d82057a6dac4fa 100644 (file)
@@ -18,7 +18,7 @@ import java.util.Set;
 import java.util.UUID;
 
 import org.apache.lucene.index.CorruptIndexException;
-import org.apache.lucene.queryParser.ParseException;
+import org.apache.lucene.queryparser.classic.ParseException;
 import org.hibernate.LockOptions;
 import org.hibernate.Session;
 import org.hibernate.criterion.Criterion;
@@ -79,6 +79,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.cdm.model.view.AuditEvent;
 import eu.etaxonomy.cdm.model.view.AuditEventRecord;
 import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.fetch.CdmFetch;
 import eu.etaxonomy.cdm.persistence.query.Grouping;
@@ -793,7 +794,7 @@ public class TransientTaxonService implements ITaxonService {
      * @see eu.etaxonomy.cdm.api.service.ITaxonService#moveSynonymToAnotherTaxon(eu.etaxonomy.cdm.model.taxon.SynonymRelationship, eu.etaxonomy.cdm.model.taxon.Taxon, boolean, eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType, eu.etaxonomy.cdm.model.reference.Reference, java.lang.String, boolean)
      */
     @Override
-    public SynonymRelationship moveSynonymToAnotherTaxon(SynonymRelationship oldSynonymRelation, Taxon newTaxon, boolean moveHomotypicGroup, SynonymRelationshipType newSynonymRelationshipType, Reference newReference, String newReferenceDetail, boolean keepReference) throws HomotypicalGroupChangeException {
+    public UpdateResult moveSynonymToAnotherTaxon(SynonymRelationship oldSynonymRelation, Taxon newTaxon, boolean moveHomotypicGroup, SynonymRelationshipType newSynonymRelationshipType, Reference newReference, String newReferenceDetail, boolean keepReference) throws HomotypicalGroupChangeException {
         return defaultService.moveSynonymToAnotherTaxon(oldSynonymRelation, newTaxon, moveHomotypicGroup, newSynonymRelationshipType, newReference, newReferenceDetail, keepReference);
     }
 
@@ -1344,7 +1345,7 @@ public class TransientTaxonService implements ITaxonService {
     public List<List<Synonym>> getSynonymsByHomotypicGroup(Taxon taxon, List<String> propertyPaths) {
         return defaultService.getSynonymsByHomotypicGroup(taxon, propertyPaths);
     }
-    
+
     @Override
     public Synonym changeRelatedTaxonToSynonym(Taxon fromTaxon, Taxon toTaxon,
             TaxonRelationshipType oldRelationshipType,
@@ -1497,6 +1498,15 @@ public class TransientTaxonService implements ITaxonService {
         return defaultService.deleteSynonym(arg0, arg1);
     }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.ITaxonService#changeSynonymToRelatedTaxon(java.util.UUID, java.util.UUID, eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType, eu.etaxonomy.cdm.model.reference.Reference, java.lang.String)
+     */
+    @Override
+    public UpdateResult changeSynonymToRelatedTaxon(UUID arg0, UUID arg1, TaxonRelationshipType arg2, Reference arg3,
+            String arg4) {
+        return defaultService.changeSynonymToRelatedTaxon(arg0, arg1, arg2, arg3, arg4);
+    }
+
     /* (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.ITaxonService#changeRelatedTaxonToSynonym(java.util.UUID, java.util.UUID, eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType, eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType)
      */
@@ -1504,23 +1514,49 @@ public class TransientTaxonService implements ITaxonService {
     public UpdateResult changeRelatedTaxonToSynonym(UUID arg0, UUID arg1, TaxonRelationshipType arg2,
             SynonymRelationshipType arg3) throws DataChangeNoRollbackException {
         return defaultService.changeRelatedTaxonToSynonym(arg0, arg1, arg2, arg3);
+
     }
 
     /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.ITaxonService#changeSynonymToAcceptedTaxon(java.util.UUID, java.util.UUID, boolean, boolean, eu.etaxonomy.cdm.model.reference.Reference, java.lang.String)
+     * @see eu.etaxonomy.cdm.api.service.ITaxonService#changeSynonymToAcceptedTaxon(java.util.UUID, java.util.UUID, java.util.UUID, boolean, boolean, eu.etaxonomy.cdm.model.reference.Reference, java.lang.String)
      */
     @Override
-    public Taxon changeSynonymToAcceptedTaxon(UUID arg0, UUID arg1, boolean arg2, boolean arg3, Reference arg4,
-            String arg5) throws HomotypicalGroupChangeException {
-        return defaultService.changeSynonymToAcceptedTaxon(arg0, arg1, arg2, arg3, arg4, arg5);
+    public UpdateResult changeSynonymToAcceptedTaxon(UUID arg0, UUID arg1, UUID arg2, boolean arg3, boolean arg4,
+            Reference arg5, String arg6) throws HomotypicalGroupChangeException {
+        return defaultService.changeSynonymToAcceptedTaxon(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
     }
 
     /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.ITaxonService#changeSynonymToRelatedTaxon(java.util.UUID, java.util.UUID, eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType, eu.etaxonomy.cdm.model.reference.Reference, java.lang.String)
+     * @see eu.etaxonomy.cdm.api.service.IService#merge(java.util.List, boolean)
      */
     @Override
-    public UpdateResult changeSynonymToRelatedTaxon(UUID arg0, UUID arg1, TaxonRelationshipType arg2, Reference arg3,
-            String arg4) {
-        return defaultService.changeSynonymToRelatedTaxon(arg0, arg1, arg2, arg3, arg4);
+    public List<MergeResult<TaxonBase>> merge(List<TaxonBase> arg0, boolean arg1) {
+        return defaultService.merge(arg0, arg1);
     }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase, boolean)
+     */
+    @Override
+    public MergeResult<TaxonBase> merge(TaxonBase arg0, boolean arg1) {
+        return defaultService.merge(arg0, arg1);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IService#loadWithUpdate(java.util.UUID)
+     */
+    @Override
+    public TaxonBase loadWithUpdate(UUID arg0) {
+        return defaultService.loadWithUpdate(arg0);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public List<TaxonBase> load(List<UUID> arg0, List<String> arg1) {
+        return defaultService.load(arg0, arg1);
+    }
+
+
 }
index ec9867549b3a24e7700ee8931411f936eac742a3..e032eb3eb45a73424fd4344dbd9e6de7da9653b4 100644 (file)
@@ -52,6 +52,7 @@ import eu.etaxonomy.cdm.model.media.Rights;
 import eu.etaxonomy.cdm.model.view.AuditEvent;
 import eu.etaxonomy.cdm.model.view.AuditEventRecord;
 import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.query.Grouping;
 import eu.etaxonomy.cdm.persistence.query.MatchMode;
@@ -852,11 +853,8 @@ public class TransientTermService implements ITermService {
         return defaultService.isDeletable(object, config);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.ITermService#listByTermType(eu.etaxonomy.cdm.model.common.TermType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
-     */
     @Override
-    public List<DefinedTermBase<?>> listByTermType(TermType termType, Integer limit, Integer start,
+    public <T extends DefinedTermBase> List<T> listByTermType(TermType termType, Integer limit, Integer start,
             List<OrderHint> orderHints, List<String> propertyPaths) {
         return defaultService.listByTermType(termType, limit, start, orderHints, propertyPaths);
     }
@@ -872,35 +870,56 @@ public class TransientTermService implements ITermService {
         return defaultService.findByIdentifier(clazz, identifier, identifierType, matchmode, includeEntity, pageSize, pageNumber, propertyPaths);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IService#delete(java.util.UUID)
-     */
     @Override
     public DeleteResult delete(UUID uuid) {
         return defaultService.delete(uuid);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IService#delete(java.util.Collection)
-     */
     @Override
     public DeleteResult delete(Collection<UUID> arg0) {
         return defaultService.delete(arg0);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IService#merge(java.util.List)
-     */
     @Override
     public List<DefinedTermBase> merge(List<DefinedTermBase> arg0) {
         return defaultService.merge(arg0);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.ITermService#delete(java.util.UUID, eu.etaxonomy.cdm.api.service.config.TermDeletionConfigurator)
-     */
     @Override
     public DeleteResult delete(UUID arg0, TermDeletionConfigurator arg1) {
         return defaultService.delete(arg0, arg1);
     }
+
+    @Override
+    public List<MergeResult<DefinedTermBase>> merge(List<DefinedTermBase> arg0, boolean arg1) {
+        return defaultService.merge(arg0, arg1);
+    }
+
+    @Override
+    public MergeResult<DefinedTermBase> merge(DefinedTermBase arg0, boolean arg1) {
+        return defaultService.merge(arg0, arg1);
+    }
+
+    @Override
+    public DefinedTermBase loadWithUpdate(UUID arg0) {
+        return defaultService.loadWithUpdate(arg0);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Language getLanguageByLabel(String arg0) {
+        return defaultService.getLanguageByLabel(arg0);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public List<DefinedTermBase> load(List<UUID> arg0, List<String> arg1) {
+        return defaultService.load(arg0, arg1);
+    }
+
+
 }
index c597eca6c8d21910272feb68ca94b23a994d7b54..e96e5badff0627d016287900d2a1a63a0dc9a7e2 100644 (file)
@@ -33,9 +33,6 @@ public class DerivateDragListener extends DragSourceAdapter{
         this.derivateView = derivateView;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.swt.dnd.DragSourceAdapter#dragSetData(org.eclipse.swt.dnd.DragSourceEvent)
-     */
     @Override
     public void dragSetData(DragSourceEvent event) {
         if (LocalSelectionTransfer.getTransfer().isSupportedType(event.dataType)) {
@@ -44,14 +41,11 @@ public class DerivateDragListener extends DragSourceAdapter{
         }
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.swt.dnd.DragSourceAdapter#dragStart(org.eclipse.swt.dnd.DragSourceEvent)
-     */
     @Override
     public void dragStart(DragSourceEvent event) {
         if(derivateView.isDirty()){
             event.doit = false;
-            MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+            MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
             return;
         }
         ISelection selection = derivateView.getViewer().getSelection();
index 55b2f77520e58795c8e91288fd7a4c61e482d366..4b5a12a5b147235a8e8af8196cf7db2768566fee 100644 (file)
@@ -18,6 +18,7 @@ import org.eclipse.swt.dnd.DropTargetEvent;
 import org.eclipse.swt.dnd.TransferData;
 
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.Messages;
 import eu.etaxonomy.taxeditor.editor.view.derivate.operation.MoveDerivateOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
@@ -36,13 +37,10 @@ public class DerivateDropListener extends ViewerDropAdapter {
         this.derivateView = derivateView;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.ViewerDropAdapter#performDrop(java.lang.Object)
-     */
     @Override
     public boolean performDrop(Object data) {
         if(derivateView.isDirty()){
-            MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+            MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
             return false;
         }
         Object target = getCurrentTarget();
@@ -51,16 +49,13 @@ public class DerivateDropListener extends ViewerDropAdapter {
             TreeNode targetNode = (TreeNode) target;
             TreeNode draggedNode = EditorUtil.getTreeNodeOfSelection(derivateViewSelection.getSelection());
             if(draggedNode!=null){
-                MoveDerivateOperation moveDerivateOperation = new MoveDerivateOperation("Moving \""+derivateView.getLabelProvider().getDerivateText(draggedNode)+"\" to \""+derivateView.getLabelProvider().getDerivateText(targetNode)+"\"", EditorUtil.getUndoContext(), derivateView, draggedNode, targetNode);
+                MoveDerivateOperation moveDerivateOperation = new MoveDerivateOperation(String.format(Messages.DerivateDropListener_MOVE_TO, derivateView.getLabelProvider().getDerivateText(draggedNode), derivateView.getLabelProvider().getDerivateText(targetNode)), EditorUtil.getUndoContext(), derivateView, draggedNode, targetNode);
                 return AbstractUtility.executeOperation(moveDerivateOperation).equals(Status.OK_STATUS)?true:false;
             }
         }
         return false;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.ViewerDropAdapter#validateDrop(java.lang.Object, int, org.eclipse.swt.dnd.TransferData)
-     */
     @Override
     public boolean validateDrop(Object target, int operation, TransferData transferType) {
         return LocalSelectionTransfer.getTransfer().isSupportedType(transferType) && target instanceof TreeNode;
index c805c6f165e7a4d70d2fd3c172b7b67a8a8e2606..632d3153003d40695e75497e158151c4564af7c0 100644 (file)
@@ -1,8 +1,12 @@
 package eu.etaxonomy.taxeditor.editor.view.derivate;
 
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Map.Entry;
+import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 
@@ -11,8 +15,7 @@ import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.util.LocalSelectionTransfer;
 import org.eclipse.jface.viewers.AbstractTreeViewer;
 import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TreeNode;
 import org.eclipse.jface.viewers.TreeSelection;
@@ -20,6 +23,8 @@ import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.dnd.DND;
 import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Menu;
@@ -27,24 +32,37 @@ import org.eclipse.swt.widgets.Tree;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.part.EditorPart;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
-import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.molecular.Sequence;
 import eu.etaxonomy.cdm.model.molecular.SingleRead;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.Messages;
+import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
+import eu.etaxonomy.taxeditor.editor.view.derivate.searchFilter.DerivateSearchCompositeController;
+import eu.etaxonomy.taxeditor.model.IContextListener;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
 import eu.etaxonomy.taxeditor.model.IPartContentHasMedia;
 import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateContentProvider;
 import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
@@ -53,11 +71,29 @@ import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
  * Displays the derivate hierarchy of the specimen specified in the editor input.
  *
  */
-public class DerivateView extends EditorPart implements IPartContentHasFactualData, IDirtyMarkable,
-        IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IPartContentHasMedia,
-        ISelectionChangedListener, IPostOperationEnabled {
-
-    public static final String ID = "eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView";
+public class DerivateView extends EditorPart implements IPartContentHasFactualData, IConversationEnabled,
+        ICdmEntitySessionEnabled, IDirtyMarkable, IPostOperationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IPartContentHasMedia,
+        IContextListener, ISelectionListener {
+    public static final String ID = "eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"; //$NON-NLS-1$
+
+    public static final String YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION = Messages.DerivateView_YOU_NEED_TO_SAVE;
+    public static final String VIEW_HAS_UNSAVED_CHANGES = Messages.DerivateView_UNSAVED_CHANGES;
+
+    private static final List<String> SPECIMEN_INIT_STRATEGY = Arrays.asList(new String[] {
+            "descriptions",
+            "annotations",
+            "markers",
+            "credits",
+            "extensions",
+            "rights",
+            "sources",
+            "derivationEvents.derivatives.annotations",
+            "derivationEvents.derivatives.markers",
+            "derivationEvents.derivatives.credits",
+            "derivationEvents.derivatives.extensions",
+            "derivationEvents.derivatives.rights",
+            "derivationEvents.derivatives.sources"
+    });
 
        private ConversationHolder conversation;
 
@@ -69,9 +105,31 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
 
     private DerivateLabelProvider labelProvider;
 
-    private Set<SingleRead> multiLinkSingleReads;
+    private DerivateContentProvider contentProvider;
+
+    private DerivateSearchCompositeController derivateSearchCompositeController;
+
+    /**
+     * A map with keys being the derivative entities belonging to the {@link UUID}s passed to the constructor
+     * and values being the root elements of the hierarchy (may be the same objects as the derivative entities)
+     */
+    private Map<SpecimenOrObservationBase<?>, SpecimenOrObservationBase<?>> derivateToRootEntityMap;
+
+    /**
+     * The set of root elements
+     */
+    private Set<SpecimenOrObservationBase<?>> rootElements;
+
+    private ICdmEntitySession cdmEntitySession;
 
-    private ISelection selection = null;
+    /**
+     * <code>true</code> if this view is listening to selection  changes
+     */
+    private boolean listenToSelectionChange;
+
+    private Taxon selectedTaxon;
+
+    private ISelectionService selectionService;
 
     /**
      * Default constructor
@@ -79,40 +137,76 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
     public DerivateView() {
     }
 
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+        this.setSite(site);
+        this.setInput(input);
+        this.derivateToRootEntityMap = new HashMap<SpecimenOrObservationBase<?>, SpecimenOrObservationBase<?>>();
+        this.rootElements = new HashSet<SpecimenOrObservationBase<?>>();
+
+        if (CdmStore.isActive() && conversation == null) {
+            conversation = CdmStore.createConversation();
+        }
+        if (CdmStore.isActive()) {
+            cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
+        }
+        //listen to context changes
+        CdmStore.getContextManager().addContextListener(this);
+    }
+
     @Override
     public void createPartControl(Composite parent) {
+
+        parent.setLayout(new GridLayout());
+
+        //---search and filter---
+        derivateSearchCompositeController = new DerivateSearchCompositeController(parent, this);
+        GridData gridDataSearchBar = new GridData();
+        gridDataSearchBar.horizontalAlignment = GridData.FILL;
+        gridDataSearchBar.grabExcessHorizontalSpace = true;
+        derivateSearchCompositeController.setLayoutData(gridDataSearchBar);
+        derivateSearchCompositeController.setEnabled(CdmStore.isActive());
+
+        //---tree viewer---
         viewer = new TreeViewer(new Tree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION));
-        viewer.setContentProvider(new DerivateContentProvider());
+        GridData gridDataTree = new GridData();
+        gridDataTree.horizontalAlignment = GridData.FILL;
+        gridDataTree.verticalAlignment = GridData.FILL;
+        gridDataTree.grabExcessVerticalSpace = true;
+        gridDataTree.grabExcessHorizontalSpace = true;
+        viewer.getTree().setLayoutData(gridDataTree);
+        contentProvider = new DerivateContentProvider();
+        viewer.setContentProvider(contentProvider);
         labelProvider = new DerivateLabelProvider();
         labelProvider.setConversation(conversation);
         viewer.setLabelProvider(labelProvider);
         viewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
+        viewer.getTree().setEnabled(CdmStore.isActive());
         // Propagate selection from viewer
         getSite().setSelectionProvider(viewer);
+
         //listen to selection changes
-        viewer.addSelectionChangedListener(this);
+        selectionService = getSite().getWorkbenchWindow().getSelectionService();
+        selectionService.addSelectionListener(this);
 
         //create context menu
         MenuManager menuManager = new MenuManager();
+        menuManager.setRemoveAllWhenShown(true);
         getSite().registerContextMenu(menuManager, viewer);
         Control control = viewer.getControl();
         Menu menu = menuManager.createContextMenu(control);
         control.setMenu(menu);
 
-        generateMultiLinkSingleReads();
-        labelProvider.setMultiLinkSingleReads(multiLinkSingleReads);
-        IEditorInput editorInput = getEditorInput();
-        viewer.setInput(((DerivateViewEditorInput) editorInput).getRootUUIDs());
-        //set selection to selected derivate if only one was selected
-        if(editorInput instanceof DerivateViewEditorInput){
-            Set<UUID> derivateUUIDs = ((DerivateViewEditorInput) editorInput).getDerivateUUIDs();
-            if(derivateUUIDs.size()==1){
-                SpecimenOrObservationBase<?> specimen = CdmStore.getService(IOccurrenceService.class).load(derivateUUIDs.iterator().next());
-                if(specimen!=null){
-                    viewer.setSelection(new StructuredSelection(new TreeNode(specimen)));
-                }
-            }
-        }
+        //init tree
+        updateRootEntities(((DerivateViewEditorInput)getEditorInput()).getDerivativeUuids());
+        //set taxon filter
+        derivateSearchCompositeController.setTaxonFilter(((DerivateViewEditorInput) getEditorInput()).getTaxonUuid());
+        //reset status bar
+        getEditorSite().getActionBars().getStatusLineManager().setMessage("");
 
         //add drag'n'drop support
         Transfer[] transfers = new Transfer[] {LocalSelectionTransfer.getTransfer(),};
@@ -120,13 +214,91 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         viewer.addDropSupport(dndOperations, transfers, new DerivateDropListener(this));
     }
 
+    public void updateRootEntities() {
+        updateRootEntities((Collection)null);
+    }
+
+    public void updateRootEntities(Collection<UUID> derivativeUuids) {
+        if(conversation!=null){
+            if (!conversation.isBound()) {
+                conversation.bind();
+            }
+            /*
+             * If the active session is not the session of the Derivative Editor
+             * then we will save the active session for later, bind temporarily
+             * to our session and rebind to the original session when we are
+             * done. This happens e.g. if a selection change happens in the
+             * taxon editor and "Link with editor" is enabled. The selection
+             * change event and thus the loading in updateRootEntities() happens
+             * in the session of the taxon editor.
+             */
+            ICdmEntitySession previousCdmEntitySession = CdmStore.getCurrentSessionManager().getActiveSession();
+            if(cdmEntitySession != null) {
+                cdmEntitySession.bind();
+            }
+
+            List<SpecimenOrObservationBase> derivates = null;
+            if(derivativeUuids!=null){
+                this.derivateToRootEntityMap = new HashMap<SpecimenOrObservationBase<?>, SpecimenOrObservationBase<?>>();
+                this.rootElements = new HashSet<SpecimenOrObservationBase<?>>();
+                derivates = CdmStore.getService(IOccurrenceService.class).load(new ArrayList(derivativeUuids), SPECIMEN_INIT_STRATEGY);
+            }
+            updateRootEntities(derivates);
+            previousCdmEntitySession.bind();
+        }
+    }
+
+
+    public void updateRootEntities(List<SpecimenOrObservationBase> derivates) {
+            if(derivates!=null){
+                this.derivateToRootEntityMap = new HashMap<SpecimenOrObservationBase<?>, SpecimenOrObservationBase<?>>();
+                this.rootElements = new HashSet<SpecimenOrObservationBase<?>>();
+                for (SpecimenOrObservationBase derivate : derivates) {
+
+                    if(derivate instanceof FieldUnit){
+                        derivateToRootEntityMap.put(derivate, derivate);
+                    }
+                    else {
+                        SpecimenOrObservationBase<?> topMostDerivate = EditorUtil.getTopMostDerivate(derivate);
+                        if(topMostDerivate!=null){
+                            derivateToRootEntityMap.put(derivate, topMostDerivate);
+                        }
+                        else{
+                            derivateToRootEntityMap.put(derivate, derivate);
+                        }
+                    }
+                }
+                for (SpecimenOrObservationBase<?> specimen : derivateToRootEntityMap.values()) {
+                    rootElements.add(specimen);
+                }
+            }
+            labelProvider.updateLabelCache(rootElements);
+            viewer.setInput(rootElements);
+
+            getEditorSite().getActionBars().getStatusLineManager().setMessage(rootElements.size() +" derivative hierarchies found");
+
+            //set selection to derivatives if the filter criteria
+            //taxon assignment or derivative type are set
+            if(derivates!=null && !derivateSearchCompositeController.isDefaultSearch()){
+                List<TreeNode> nodesToSelect = new ArrayList<TreeNode>();
+                for (SpecimenOrObservationBase specimenOrObservationBase : derivates) {
+                    nodesToSelect.add(new TreeNode(specimenOrObservationBase));
+                }
+                viewer.setSelection(new StructuredSelection(nodesToSelect));
+            }
+            else{
+                viewer.setSelection(null);
+            }
+
+    }
+
+    public void updateLabelCache(){
+        labelProvider.updateLabelCache(rootElements);
+    }
+
     @Override
     public void doSave(IProgressMonitor monitor) {
-        String taskName = "Saving hierarchy";
-        if(getEditorInput() instanceof DerivateViewEditorInput){
-            DerivateViewEditorInput derivateViewEditorInput = (DerivateViewEditorInput) getEditorInput();
-            taskName += " "+derivateViewEditorInput.getName();
-        }
+        String taskName = Messages.DerivateView_SAVING_HIERARCHY;
         monitor.beginTask(taskName, 3);
         if (!conversation.isBound()) {
             conversation.bind();
@@ -135,6 +307,10 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
 
         // commit the conversation and start a new transaction immediately
         conversation.commit(true);
+
+        if(CdmStore.getCurrentSessionManager().isRemoting()) {
+            CdmStore.getService(IOccurrenceService.class).merge(new ArrayList<SpecimenOrObservationBase>(rootElements), true);
+        }
         monitor.worked(1);
 
         this.setDirty(false);
@@ -150,22 +326,7 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
 
     @Override
     public String getTitleToolTip() {
-        if(getEditorInput() instanceof DerivateViewEditorInput){
-            DerivateViewEditorInput derivateViewEditorInput = (DerivateViewEditorInput) getEditorInput();
-            return derivateViewEditorInput.getName();
-        }
-        return "Derivative Editor";
-    }
-
-    @Override
-    public void init(IEditorSite site, IEditorInput input) throws PartInitException {
-        setSite(site);
-        setInput(input);
-        if(input instanceof DerivateViewEditorInput){
-            DerivateViewEditorInput derivateViewEditorInput = (DerivateViewEditorInput) input;
-            conversation = derivateViewEditorInput.getConversationHolder();
-            setPartName(derivateViewEditorInput.getName());
-        }
+        return Messages.DerivateView_DERIVATIVE_EDITOR;
     }
 
     @Override
@@ -189,9 +350,12 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
     public void setFocus() {
         viewer.getControl().setFocus();
         //make sure to bind again if maybe in another view the conversation was unbound
-        if(!conversation.isBound()){
+        if(conversation!=null && !conversation.isBound()){
             conversation.bind();
         }
+        if(cdmEntitySession != null) {
+            cdmEntitySession.bind();
+        }
     }
 
     @Override
@@ -203,18 +367,11 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         return conversation;
     }
 
-    /**
-     * @return the viewer
-     */
-    public TreeViewer getViewer() {
-        return viewer;
-    }
-
     @Override
     public void changed(Object element) {
         setDirty(true);
         firePropertyChange(IEditorPart.PROP_DIRTY);
-        viewer.refresh();
+        viewer.update(new TreeNode(element), null);
     }
 
     @Override
@@ -222,6 +379,24 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         changed(null);
     }
 
+    @Override
+    public Map<Object, List<String>> getPropertyPathsMap() {
+        List<String> specimenPropertyPaths = Arrays.asList(new String[] {
+                "descriptions",
+                "derivationEvents.derivates",
+                "annotations",
+                "markers",
+                "credits",
+                "extensions",
+                "rights",
+                "sources"
+        });
+        Map<Object, List<String>> specimenPropertyPathMap =
+                new HashMap<Object, List<String>>();
+        specimenPropertyPathMap.put(SpecimenOrObservationBase.class,specimenPropertyPaths);
+        return specimenPropertyPathMap;
+    }
+
     /**
      * Refreshes the derivate hierarchy tree and expands the tree
      * to show and select the given object.
@@ -239,35 +414,25 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
      * Refreshes the derivate hierarchy tree
      */
     public void refreshTree(){
-        generateMultiLinkSingleReads();
-        labelProvider.setMultiLinkSingleReads(multiLinkSingleReads);
         viewer.refresh();
     }
 
-    private void generateMultiLinkSingleReads() {
-        Set<SingleRead> multiLinkSingleReads = new HashSet<SingleRead>();
-        for(Entry<SingleRead, Collection<Sequence>> entry:CdmStore.getService(ISequenceService.class).getSingleReadSequencesMap().entrySet()){
-            if(entry.getValue().size()>1){
-                multiLinkSingleReads.add(entry.getKey());
-            }
-        }
-        this.multiLinkSingleReads = multiLinkSingleReads;
+    //FIXME:Remoting hack to make this work for remoting
+    //This should actually be resolved using remoting post operations
+    public void remove(Object obj) {
+        rootElements.remove(obj);
+        viewer.setInput(rootElements);
     }
 
     /**
      * @return a set of {@link SingleRead}s that have multiple parents
      */
     public Set<SingleRead> getMultiLinkSingleReads() {
-        return this.multiLinkSingleReads;
+        return DerivateLabelProvider.getMultiLinkSingleReads();
     }
 
-    @Override
-    public void selectionChanged(SelectionChangedEvent event) {
-        this.selection  = event.getSelection();
-    }
-
-    public ISelection getSelection() {
-        return selection;
+    public Object getSelectionInput() {
+        return selectedTaxon;
     }
 
     public DerivateLabelProvider getLabelProvider() {
@@ -288,9 +453,139 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         return true;
     }
 
+
     @Override
     public boolean canAttachMedia() {
         return true;
     }
 
+    public void addFieldUnit(FieldUnit fieldUnit) {
+        rootElements.add(fieldUnit);
+        derivateToRootEntityMap.put(fieldUnit, fieldUnit);
+    }
+
+    @Override
+    public ICdmEntitySession getCdmEntitySession() {
+        return cdmEntitySession;
+    }
+
+    @Override
+    public void dispose() {
+        super.dispose();
+        if(conversation!=null){
+            conversation.close();
+        }
+        if(cdmEntitySession != null) {
+            cdmEntitySession.dispose();
+        }
+    }
+
+    @Override
+    public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+        if(part == this){
+            return;
+        }
+        if(viewer.getTree().isDisposed()){
+            return;
+        }
+        if(listenToSelectionChange){
+            if(part instanceof MultiPageTaxonEditor){
+                selectedTaxon = ((MultiPageTaxonEditor) part).getTaxon();
+            }
+            else if(selection instanceof IStructuredSelection){
+                Object selectedElement = ((IStructuredSelection) selection).getFirstElement();
+                if(selectedElement instanceof CdmBase){
+                    if(((CdmBase) selectedElement).isInstanceOf(TaxonNode.class)){
+                        selectedTaxon = HibernateProxyHelper.deproxy(selectedElement, TaxonNode.class).getTaxon();
+                    }
+                    else if(((CdmBase) selectedElement).isInstanceOf(Taxon.class)){
+                        selectedTaxon = HibernateProxyHelper.deproxy(selectedElement, Taxon.class);
+                    }
+                }
+            }
+            if(selectedTaxon!=null){
+                Collection<SpecimenOrObservationBase> fieldUnits = CdmStore.getService(IOccurrenceService.class).listFieldUnitsByAssociatedTaxon(selectedTaxon, null, null);
+                Collection<UUID> uuids = new HashSet<UUID>();
+                for (SpecimenOrObservationBase specimenOrObservationBase : fieldUnits) {
+                    uuids.add(specimenOrObservationBase.getUuid());
+                }
+                updateRootEntities(uuids);
+                setPartName("Derivative Editor: " + selectedTaxon.getName());
+            }
+        }
+    }
+
+    public TreeViewer getViewer() {
+        return viewer;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public List<SpecimenOrObservationBase<?>> getRootEntities() {
+        return new ArrayList<SpecimenOrObservationBase<?>>(rootElements);
+    }
+
+    public void toggleListenToSelectionChange() {
+        listenToSelectionChange = !listenToSelectionChange;
+        derivateSearchCompositeController.setEnabled(!listenToSelectionChange);
+        if(!listenToSelectionChange){
+            selectedTaxon = null;
+            setPartName("Derivative Editor");
+        }
+        else if(selectedTaxon==null){
+            setPartName("Derivative Editor [no taxon selected]");
+        }
+    }
+
+    public boolean isListenToSelectionChange(){
+        return listenToSelectionChange;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void contextAboutToStop(IMemento memento, IProgressMonitor monitor) {
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void contextStop(IMemento memento, IProgressMonitor monitor) {
+        derivateSearchCompositeController.setEnabled(false);
+        if(!viewer.getTree().isDisposed()) {
+            viewer.getTree().setEnabled(false);
+            viewer.setInput(null);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void contextStart(IMemento memento, IProgressMonitor monitor) {
+        derivateSearchCompositeController.setEnabled(!listenToSelectionChange);
+        if(!viewer.getTree().isDisposed()){
+            viewer.getTree().setEnabled(true);
+        }
+        refreshTree();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void contextRefresh(IProgressMonitor monitor) {
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
+    }
+
 }
index 7050078e1a47d191c10a4bd35d679ad14c9dd265..76358b0c4f0ffaf330bc8b2ffce631af5b3a77d9 100644 (file)
 */
 package eu.etaxonomy.taxeditor.editor.view.derivate;
 
-import java.util.HashSet;
-import java.util.Set;
+import java.util.Collection;
 import java.util.UUID;
 
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IPersistableElement;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.service.IOccurrenceService;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
-
 /**
- * Editor input for the {@link DerivateView} which holds the currently selected derivate for which
- * the derivate hierarchy should be shown in the DerivateView.<br>
- * It also holds a {@link SpecimenOrObservationBase} which is the root of the hierarchy. (both may be the same object)
+ * Editor input for the {@link DerivateView}
+ *
  * @author pplitzner
- * @date 25.11.2013
+ * @date Nov 11, 2015
  *
  */
-public class DerivateViewEditorInput implements IEditorInput{
-
-    /**
-     * The selected derivate {@link UUID}s
-     */
-    private final Set<UUID> derivateUUIDs;
-    /**
-     * List of the {@link UUID}s of the root elements of the hierarchy (may be the same objects as the derivates)
-     */
-    private Set<UUID> rootUUIDs;
-
-    private final ConversationHolder conversationHolder;
-
-    /**
-     * Creates an editor input for the {@link DerivateView} with the currently selected derivates and the
-     * corresponding {@link FieldUnit}s (both may be the same object).
-     * @param derivateUuids the {@link UUID}s of the derivates for which the derivate hierarchy should be shown
-     * @param rootUUIDs the root of the hierarchy
-     */
-    public DerivateViewEditorInput(Set<UUID> derivateUuids) {
-        super();
-        this.conversationHolder = CdmStore.createConversation();
-        this.derivateUUIDs = derivateUuids;
-        this.rootUUIDs = new HashSet<UUID>();
-        for (UUID uuid : derivateUuids) {
-            SpecimenOrObservationBase<?> derivate = CdmStore.getService(IOccurrenceService.class).load(uuid);
-            if(derivate instanceof FieldUnit){
-                rootUUIDs.add(uuid);
-            }
-            else if(derivate instanceof DerivedUnit){
-                SpecimenOrObservationBase<?> topMostDerivate = EditorUtil.getTopMostDerivate(derivate);
-                if(topMostDerivate!=null){
-                    rootUUIDs.add(topMostDerivate.getUuid());
-                }
-            }
-        }
-        if(rootUUIDs.isEmpty()){
-            rootUUIDs = derivateUUIDs;
-        }
-        if(rootUUIDs.isEmpty()){
-            MessagingUtils.messageDialog("Failed initializing editor", DerivateViewEditorInput.class, "No root element found!");
-        }
+public class DerivateViewEditorInput implements IEditorInput {
+
+    private Collection<UUID> derivativeUuids;
+    private UUID taxonUuid;
+
+    public DerivateViewEditorInput() {
+    }
+
+    public DerivateViewEditorInput(Collection<UUID> derivativeUuids, UUID taxonUuid) {
+        this.derivativeUuids = derivativeUuids;
+        this.taxonUuid = taxonUuid;
+    }
+
+    public DerivateViewEditorInput(Collection<UUID> derivativeUuids) {
+        this(derivativeUuids, null);
+    }
+
+    public Collection<UUID> getDerivativeUuids() {
+        return derivativeUuids;
+    }
+
+    public UUID getTaxonUuid() {
+        return taxonUuid;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
-     */
     @Override
     public Object getAdapter(Class adapter) {
-        // TODO Auto-generated method stub
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#exists()
-     */
     @Override
     public boolean exists() {
         return false;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
-     */
     @Override
     public ImageDescriptor getImageDescriptor() {
-        // TODO Auto-generated method stub
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getName()
-     */
     @Override
     public String getName() {
         return getEditorName();
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getPersistable()
-     */
     @Override
     public IPersistableElement getPersistable() {
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getToolTipText()
-     */
     @Override
     public String getToolTipText() {
         return getEditorName();
     }
 
     private String getEditorName() {
-        String name = null;
-        for(UUID uuid:rootUUIDs){
-            SpecimenOrObservationBase<?> specimen = CdmStore.getService(IOccurrenceService.class).load(uuid);
-            if(specimen!=null){
-                if(name==null){
-                    name = DerivateLabelProvider.getDerivateText(specimen, conversationHolder);
-                }
-                else{
-                    name += " + "+DerivateLabelProvider.getDerivateText(specimen, conversationHolder);
-                }
-            }
-        }
-        return name;
-    }
-
-    public Set<UUID> getRootUUIDs() {
-        return rootUUIDs;
+        return "Derivative Editor";
     }
 
-    public Set<UUID> getDerivateUUIDs() {
-        return derivateUUIDs;
-    }
-
-    public void addRootUuid(UUID root){
-        rootUUIDs.add(root);
-    }
-
-
-    public ConversationHolder getConversationHolder() {
-        return conversationHolder;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#hashCode()
-     */
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((rootUUIDs == null) ? 0 : rootUUIDs.hashCode());
-        return result;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        DerivateViewEditorInput other = (DerivateViewEditorInput) obj;
-        if (rootUUIDs == null) {
-            if (other.rootUUIDs != null) {
-                return false;
-            }
-        } else if (!rootUUIDs.equals(other.rootUUIDs)) {
-            return false;
-        }
-        return true;
-    }
-
-
 }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivativeEditorPropertyTester.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivativeEditorPropertyTester.java
new file mode 100644 (file)
index 0000000..74229d4
--- /dev/null
@@ -0,0 +1,20 @@
+package eu.etaxonomy.taxeditor.editor.view.derivate;
+
+import org.eclipse.core.expressions.PropertyTester;
+
+public class DerivativeEditorPropertyTester extends PropertyTester {
+
+    public DerivativeEditorPropertyTester() {
+        // TODO Auto-generated constructor stub
+    }
+
+    @Override
+    public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+        DerivateView derivateView = (DerivateView)receiver;
+        if(property.equals("isLinkedWithTaxonSelection")){
+            return derivateView.isListenToSelectionChange();
+        }
+        return false;
+    }
+
+}
index e62783ae4bed2908fa2688196f9c3a1e83b496f7..4cffe35bb8f079cdbf2282cae9a2d222167b6ff5 100644 (file)
@@ -13,7 +13,9 @@ import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.actions.CompoundContributionItem;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeCacheStrategy;
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.molecular.DnaSample;
 import eu.etaxonomy.cdm.model.molecular.Sequence;
@@ -26,9 +28,11 @@ import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.Messages;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.MediaSelectionDialog;
 
 /**
@@ -37,6 +41,13 @@ import eu.etaxonomy.taxeditor.ui.dialog.selection.MediaSelectionDialog;
  */
 public class CreateDerivateContextMenu extends CompoundContributionItem {
 
+    private static final String SINGLE_READ = Messages.CreateDerivateContextMenu_SINGLE_READ;
+    private static final String CONSENSUS_SEQUENCE = Messages.CreateDerivateContextMenu_SEQUENCE;
+    private static final String MEDIA_SPECIMEN = Messages.CreateDerivateContextMenu_MEDIA_SPECIMEN;
+    private static final String DNA_SAMPLE = Messages.CreateDerivateContextMenu_DNA_SAMPLE;
+    private static final String TISSUE_SAMPLE = Messages.CreateDerivateContextMenu_TISSUE_SAMPLE;
+    private static final String SPECIMEN = Messages.CreateDerivateContextMenu_SPECIMEN;
+
     @Override
     protected IContributionItem[] getContributionItems() {
         IContributionItem[] contributionItems = new IContributionItem[] {
@@ -44,7 +55,7 @@ public class CreateDerivateContextMenu extends CompoundContributionItem {
                     @Override
                     public void fill(Menu menu, int index) {
                         MenuItem addItem = new MenuItem(menu, SWT.CASCADE);
-                        addItem.setText("Add...");
+                        addItem.setText(Messages.CreateDerivateContextMenu_ADD);
                         Menu addMenu = new Menu(menu);
                         addItem.setMenu(addMenu);
                         final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
@@ -53,40 +64,42 @@ public class CreateDerivateContextMenu extends CompoundContributionItem {
                         if(selectedTreeNode!=null){
                             //context menu for FieldUnit
                             if(selectedTreeNode.getValue() instanceof FieldUnit){
-                                createMenuItem(addMenu, "Specimen", selectedTreeNode, DerivedUnit.class, SpecimenOrObservationType.PreservedSpecimen, DerivationEventType.GATHERING_IN_SITU());
+                                createMenuItem(addMenu, SPECIMEN, selectedTreeNode, DerivedUnit.class, SpecimenOrObservationType.PreservedSpecimen, DerivationEventType.GATHERING_IN_SITU());
                                 new MenuItem(addMenu, SWT.SEPARATOR);
-                                createMenuItem(addMenu, "Tissue Sample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.TissueSample, DerivationEventType.PREPARATION());
-                                createMenuItem(addMenu, "DNA Sample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
-                                createMenuItem(addMenu, "Media Specimen", selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
+                                createMenuItem(addMenu, TISSUE_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.TissueSample, DerivationEventType.PREPARATION());
+                                createMenuItem(addMenu, DNA_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
+                                createMenuItem(addMenu, MEDIA_SPECIMEN, selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
+                                return;
                             }
                             //context menu for Specimen
                             else if(selectedTreeNode.getValue() instanceof DerivedUnit && ((DerivedUnit)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen){
 
-                                createMenuItem(addMenu, "Tissue Sample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.TissueSample, DerivationEventType.PREPARATION());
-                                createMenuItem(addMenu, "DNA Sample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
-                                createMenuItem(addMenu, "Media Specimen", selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
+                                createMenuItem(addMenu, TISSUE_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.TissueSample, DerivationEventType.PREPARATION());
+                                createMenuItem(addMenu, DNA_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
+                                createMenuItem(addMenu, MEDIA_SPECIMEN, selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
+                                return;
                             }
                             //context menu for TissueSample
                             else if(selectedTreeNode.getValue() instanceof DnaSample && ((DnaSample)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.TissueSample){
-                               createMenuItem(addMenu, "DnaSample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
-                               createMenuItem(addMenu, "Media Specimen", selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
+                               createMenuItem(addMenu, DNA_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
+                               createMenuItem(addMenu, MEDIA_SPECIMEN, selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
+                                return;
                             }
                             //context menu for DnaSample
                             else if(selectedTreeNode.getValue() instanceof DnaSample && ((DnaSample)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.DnaSample){
-                                createMenuItem(addMenu, "Consensus Sequence", selectedTreeNode, Sequence.class, null, null);
-                                createMenuItem(addMenu, "Media Specimen", selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
+                                createMenuItem(addMenu, CONSENSUS_SEQUENCE, selectedTreeNode, Sequence.class, null, null);
+                                createMenuItem(addMenu, MEDIA_SPECIMEN, selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
+                                return;
                             }
                             //context menu for Sequence
                             else if(selectedTreeNode.getValue() instanceof Sequence){
-                                createMenuItem(addMenu, "Single Read", selectedTreeNode, SingleRead.class, null, null);
-                            }
-                            //default
-                            else{
-                                MenuItem menuItem = new MenuItem(addMenu, SWT.NONE);
-                                menuItem.setText("No child derivates");
-                                menuItem.setEnabled(false);
+                                createMenuItem(addMenu, SINGLE_READ, selectedTreeNode, SingleRead.class, null, null);
+                                return;
                             }
                         }
+                        MenuItem menuItem = new MenuItem(addMenu, SWT.NONE);
+                        menuItem.setText(Messages.CreateDerivateContextMenu_NO_CHILD_DERIVATE);
+                        menuItem.setEnabled(false);
                     }
 
 
@@ -99,7 +112,7 @@ public class CreateDerivateContextMenu extends CompoundContributionItem {
         if(specimenType!=null && specimenType.equals(SpecimenOrObservationType.Media)){
             //media submenu
             MenuItem mediaItem = new MenuItem(menu, SWT.CASCADE);
-            mediaItem.setText("Media...");
+            mediaItem.setText(Messages.CreateDerivateContextMenu_MEDIA);
             Menu mediaMenu = new Menu(menu);
             mediaItem.setMenu(mediaMenu);
 
@@ -110,33 +123,39 @@ public class CreateDerivateContextMenu extends CompoundContributionItem {
 
             //existing media menu
             MenuItem existingMediaItem = new MenuItem(mediaMenu, SWT.NONE);
-            existingMediaItem.setText("Media Specimen with existing media");
+            existingMediaItem.setText(Messages.CreateDerivateContextMenu_MEDIA_EXISTING);
             existingMediaItem.addSelectionListener(new SelectionAdapter() {
                 @Override
                 public void widgetSelected(SelectionEvent e) {
                     //select media
                     Media media = MediaSelectionDialog.select(AbstractUtility.getShell(), null, null);
-                    //create MediaSpecimen
-                    MediaSpecimen mediaSpecimen = MediaSpecimen.NewInstance(specimenType);
-                    mediaSpecimen.setMediaSpecimen(media);
+                    if(media!=null){
+                        //create MediaSpecimen
+                        MediaSpecimen mediaSpecimen = MediaSpecimen.NewInstance(specimenType);
+                        mediaSpecimen.setMediaSpecimen(media);
 
-                    //attach to parent
-                    if(selectedNode.getValue() instanceof SpecimenOrObservationBase){
-                        SpecimenOrObservationBase<?> specimenOrObservationBase = (SpecimenOrObservationBase<?>)selectedNode.getValue();
+                        //attach to parent
+                        if(selectedNode.getValue() instanceof SpecimenOrObservationBase){
+                            SpecimenOrObservationBase<?> specimenOrObservationBase = (SpecimenOrObservationBase<?>)selectedNode.getValue();
 
-                        specimenOrObservationBase.addDerivationEvent(DerivationEvent.NewSimpleInstance(specimenOrObservationBase, mediaSpecimen, derivationEventType));
-                        mediaSpecimen.setCacheStrategy(new DerivedUnitFacadeCacheStrategy());
-                        mediaSpecimen.getTitleCache(); //update title cache
-                    }
+                            specimenOrObservationBase.addDerivationEvent(DerivationEvent.NewSimpleInstance(specimenOrObservationBase, mediaSpecimen, derivationEventType));
+                            mediaSpecimen.setCacheStrategy(new DerivedUnitFacadeCacheStrategy());
+                            mediaSpecimen.getTitleCache(); //update title cache
+                            if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                                CdmStore.getService(IOccurrenceService.class).merge(specimenOrObservationBase, true);
+                            }
+                        }
 
-                    //refresh view
-                    DerivateView derivateView = null;
-                    if(AbstractUtility.getActivePart() instanceof DerivateView){
-                        derivateView = (DerivateView) AbstractUtility.getActivePart();
-                    }
-                    if(derivateView!=null){
-                        derivateView.getConversationHolder().commit();
-                        derivateView.refreshTree(mediaSpecimen);
+                        //refresh view
+                        DerivateView derivateView = null;
+                        if(AbstractUtility.getActivePart() instanceof DerivateView){
+                            derivateView = (DerivateView) AbstractUtility.getActivePart();
+                        }
+                        if(derivateView!=null){
+
+                            derivateView.getConversationHolder().commit();
+                            derivateView.refreshTree(mediaSpecimen);
+                        }
                     }
                 }
             });
@@ -176,7 +195,7 @@ public class CreateDerivateContextMenu extends CompoundContributionItem {
             if(derivateView!=null){
                 if(derivateView.isDirty()){
                     e.doit = false;
-                    MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+                    MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
                     return;
                 }
             }
@@ -186,16 +205,22 @@ public class CreateDerivateContextMenu extends CompoundContributionItem {
             if(selectedDerivate instanceof DnaSample && ((DnaSample) selectedDerivate).getRecordBasis()==SpecimenOrObservationType.DnaSample){
                 DnaSample dnaSample = (DnaSample)selectedDerivate;
                 if(childClass.equals(Sequence.class)){
-                    Sequence newInstance = Sequence.NewInstance(dnaSample, "", 0);
+                    Sequence newInstance = Sequence.NewInstance(dnaSample, "", 0); //$NON-NLS-1$
                     createdElement = newInstance;
                 }
+                if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                    CdmStore.getService(IOccurrenceService.class).merge((SpecimenOrObservationBase) selectedDerivate, true);
+                }
             }
             else if(selectedDerivate instanceof Sequence){
                 SingleRead newInstance = SingleRead.NewInstance();
                 ((Sequence) selectedDerivate).addSingleRead(newInstance);
                 createdElement = newInstance;
+                if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                    CdmApplicationState.getCurrentAppConfig().getSequenceService().merge((Sequence)selectedDerivate, true);
+                }
             }
-            else if(selectedDerivate instanceof SpecimenOrObservationBase && DerivedUnit.class.isAssignableFrom(childClass)){
+            if(selectedDerivate instanceof SpecimenOrObservationBase && DerivedUnit.class.isAssignableFrom(childClass)){
                 SpecimenOrObservationBase<?> specimenOrObservationBase = (SpecimenOrObservationBase<?>)selectedDerivate;
                 DerivedUnit derivedUnit;
                 if(childClass.equals(DnaSample.class)){
@@ -219,6 +244,9 @@ public class CreateDerivateContextMenu extends CompoundContributionItem {
                 derivedUnit.setCacheStrategy(new DerivedUnitFacadeCacheStrategy());
                 derivedUnit.getTitleCache(); //update title cache
                 createdElement = derivedUnit;
+                if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                    CdmStore.getService(IOccurrenceService.class).merge((SpecimenOrObservationBase) selectedDerivate, true);
+                }
             }
 
             //refresh view
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/CreateFieldUnitContextMenu.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/CreateFieldUnitContextMenu.java
new file mode 100644 (file)
index 0000000..4de8d34
--- /dev/null
@@ -0,0 +1,112 @@
+package eu.etaxonomy.taxeditor.editor.view.derivate.contextMenu;
+
+import org.eclipse.jface.action.ContributionItem;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.CompoundContributionItem;
+
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
+import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * Context menu for the SingleReads in the derivate hierarchy.
+ *
+ */
+public class CreateFieldUnitContextMenu extends CompoundContributionItem {
+
+    private enum CommandType {
+        COPY_TO_CLIPBOARD, REMOVE_FROM_SEQUENCE, ADD_TO_SEQUENCE
+    }
+
+    @Override
+    protected IContributionItem[] getContributionItems() {
+        IContributionItem[] contributionItems = new IContributionItem[] {
+                new ContributionItem() {
+                    @Override
+                    public void fill(Menu menu, int index) {
+                        final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+                        IWorkbenchPart activePart = window.getActivePage().getActivePart();
+                        if(activePart instanceof DerivateView){
+                            final DerivateView derivateView = (DerivateView) activePart;
+                            if(derivateView.isListenToSelectionChange()){
+                                Object selectionInput = derivateView.getSelectionInput();
+                                if(selectionInput instanceof CdmBase && ((CdmBase) selectionInput).isInstanceOf(Taxon.class)){
+                                    final Taxon taxon = HibernateProxyHelper.deproxy(CdmStore.getService(ITaxonService.class).load(((CdmBase)selectionInput).getUuid()), Taxon.class);
+                                    MenuItem item = new MenuItem(menu, SWT.NONE);
+                                    item.setText("Create FieldUnit for "+taxon.getName());
+                                    item.addSelectionListener(new SelectionAdapter() {
+                                        @Override
+                                        public void widgetSelected(SelectionEvent e) {
+                                            if(derivateView.isDirty()){
+                                                MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
+                                                return;
+                                            }
+
+                                            FieldUnit fieldUnit = FieldUnit.NewInstance();
+                                            fieldUnit = CdmBase.deproxy(CdmStore.getService(IOccurrenceService.class).save(fieldUnit), FieldUnit.class);
+                                            IndividualsAssociation association = IndividualsAssociation.NewInstance(fieldUnit);
+                                            TaxonDescription description;
+                                            if(!taxon.getDescriptions().isEmpty()){
+                                                description = taxon.getDescriptions().iterator().next();
+                                            }
+                                            else{
+                                                description = TaxonDescription.NewInstance(taxon);
+                                            }
+                                            description.addElement(association);
+                                            if(CdmStore.getCurrentSessionManager().isRemoting()){
+                                                CdmStore.getService(ITaxonService.class).merge(taxon);
+                                            }
+                                            else{
+                                                CdmStore.getService(ITaxonService.class).saveOrUpdate(taxon);
+                                            }
+
+                                            derivateView.getConversationHolder().commit();
+                                            derivateView.addFieldUnit(fieldUnit);
+                                            derivateView.refreshTree(fieldUnit);
+                                        }
+                                    });
+                                }
+                            }
+                            else{
+                                MenuItem item = new MenuItem(menu, SWT.NONE);
+                                item.setText("Create FieldUnit");
+                                item.addSelectionListener(new SelectionAdapter() {
+                                    @Override
+                                    public void widgetSelected(SelectionEvent e) {
+                                        if(derivateView.isDirty()){
+                                            MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
+                                            return;
+                                        }
+                                        FieldUnit fieldUnit = FieldUnit.NewInstance();
+                                        fieldUnit = CdmBase.deproxy(CdmStore.getService(IOccurrenceService.class).save(fieldUnit), FieldUnit.class);
+                                        derivateView.getConversationHolder().commit();
+                                        derivateView.addFieldUnit(fieldUnit);
+                                        derivateView.updateRootEntities();
+                                        derivateView.refreshTree(fieldUnit);
+                                    }
+                                });
+                            }
+                        }
+                    }
+                }
+        };
+        return contributionItems;
+    }
+}
+
index 17d95b1976ecb4531358069717fe7b26b50c4dac..6657e7127c096b36e93dd63b4892381163229723 100644 (file)
@@ -1,6 +1,7 @@
 package eu.etaxonomy.taxeditor.editor.view.derivate.contextMenu;
 
 import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.Separator;
 import org.eclipse.ui.actions.CompoundContributionItem;
 
 public class DerivateViewContextMenu extends CompoundContributionItem  {
@@ -8,8 +9,10 @@ public class DerivateViewContextMenu extends CompoundContributionItem  {
     @Override
     protected IContributionItem[] getContributionItems() {
         IContributionItem[] contributionItems = new IContributionItem[] {
+                new CreateFieldUnitContextMenu(),
                 new CreateDerivateContextMenu(),
-                new SingleReadSequenceContextMenu()
+                new Separator(),
+//                new ListenToSelectionChangeContextMenu(),
         };
         return contributionItems;
     }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/ListenToSelectionChangeContextMenu.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/ListenToSelectionChangeContextMenu.java
new file mode 100644 (file)
index 0000000..15fa005
--- /dev/null
@@ -0,0 +1,64 @@
+package eu.etaxonomy.taxeditor.editor.view.derivate.contextMenu;
+
+import org.eclipse.jface.action.ContributionItem;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.CompoundContributionItem;
+
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
+import eu.etaxonomy.taxeditor.model.ImageResources;
+
+/**
+ * Context menu for the SingleReads in the derivate hierarchy.
+ *
+ */
+public class ListenToSelectionChangeContextMenu extends CompoundContributionItem {
+
+    @Override
+    protected IContributionItem[] getContributionItems() {
+        IContributionItem[] contributionItems = new IContributionItem[] {
+                new ContributionItem() {
+                    @Override
+                    public void fill(Menu menu, int index) {
+                        final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+                        IWorkbenchPart activePart = window.getActivePage().getActivePart();
+                        if(activePart instanceof DerivateView){
+                            final DerivateView derivateView = (DerivateView) activePart;
+                            MenuItem item = new MenuItem(menu, SWT.NONE);
+                            if(derivateView.isListenToSelectionChange()){
+                                item.setText("Unlink from taxon selection");
+                            }
+                            else{
+                                item.setText("Link with taxon selection");
+                            }
+                            item.setImage(ImageResources.getImage(ImageResources.SYNCED));
+                            item.addSelectionListener(new SelectionAdapterExtension(derivateView));
+                        }
+                    }
+                }
+        };
+        return contributionItems;
+    }
+
+    private final class SelectionAdapterExtension extends SelectionAdapter {
+
+        private final DerivateView derivateView;
+
+        private SelectionAdapterExtension(DerivateView derivateView) {
+            this.derivateView = derivateView;
+        }
+
+        @Override
+        public void widgetSelected(SelectionEvent e) {
+            derivateView.toggleListenToSelectionChange();
+        }
+    }
+}
+
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/SingleReadSequenceContextMenu.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/SingleReadSequenceContextMenu.java
deleted file mode 100644 (file)
index b3164a4..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-package eu.etaxonomy.taxeditor.editor.view.derivate.contextMenu;
-
-import org.eclipse.jface.action.ContributionItem;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.util.LocalSelectionTransfer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.TreeNode;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.CompoundContributionItem;
-
-import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
-import eu.etaxonomy.cdm.model.molecular.Sequence;
-import eu.etaxonomy.cdm.model.molecular.SingleRead;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-/**
- * Context menu for the SingleReads in the derivate hierarchy.
- *
- */
-public class SingleReadSequenceContextMenu extends CompoundContributionItem {
-
-    private enum CommandType{
-        COPY_TO_CLIPBOARD,
-        REMOVE_FROM_SEQUENCE,
-        ADD_TO_SEQUENCE
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
-     */
-    @Override
-    protected IContributionItem[] getContributionItems() {
-        IContributionItem[] contributionItems = new IContributionItem[] {
-                new ContributionItem() {
-                    @Override
-                    public void fill(Menu menu, int index) {
-                        final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-                        final IEditorPart activeEditor = window.getActivePage().getActiveEditor();
-                        final ISelection selection = window.getActivePage().getSelection();
-                        TreeNode selectedTreeNode = EditorUtil.getTreeNodeOfSelection(selection);
-                        TreeNode clipboardNode = EditorUtil.getTreeNodeOfSelection(LocalSelectionTransfer.getTransfer().getSelection());
-                        if(selectedTreeNode!=null){
-                            //context menu for Sequence
-                            if(selectedTreeNode.getValue() instanceof Sequence
-                                    && clipboardNode!=null && clipboardNode.getValue() instanceof SingleRead){
-                                MenuItem item = new MenuItem(menu, SWT.NONE);
-                                item.setText("Reuse SingleRead here");
-                                item.addSelectionListener(new WidgetSelectionListener(CommandType.ADD_TO_SEQUENCE));
-                            }
-                            else if(selectedTreeNode.getValue() instanceof SingleRead){
-                                MenuItem item = new MenuItem(menu, SWT.NONE);
-                                item.setText("Reuse for other Sequence");
-                                item.addSelectionListener(new WidgetSelectionListener(CommandType.COPY_TO_CLIPBOARD));
-                                if(activeEditor instanceof DerivateView
-                                        && ((DerivateView) activeEditor).getMultiLinkSingleReads().contains(selectedTreeNode.getValue())){
-                                    MenuItem unlinkItem = new MenuItem(menu, SWT.NONE);
-                                    unlinkItem.setText("Remove from this Sequence");
-                                    unlinkItem.addSelectionListener(new WidgetSelectionListener(CommandType.REMOVE_FROM_SEQUENCE));
-                                }
-                            }
-                        }
-                    }
-                }
-        };
-        return contributionItems;
-    }
-
-    private class WidgetSelectionListener extends SelectionAdapter{
-        private final CommandType commandType;
-
-        /**
-         * @param selectedTreeNode
-         * @param clipboardNode
-         * @param commandType
-         */
-        public WidgetSelectionListener(CommandType commandType) {
-            this.commandType = commandType;
-        }
-
-        /* (non-Javadoc)
-         * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-         */
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-            ISelection clipBoardSelection = LocalSelectionTransfer.getTransfer().getSelection();
-            final ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getSelection();
-            TreeNode clipBoardTreeNode = EditorUtil.getTreeNodeOfSelection(clipBoardSelection);
-            TreeNode selectedTreeNode = EditorUtil.getTreeNodeOfSelection(selection);
-            switch (commandType) {
-            case REMOVE_FROM_SEQUENCE:
-                if(activeEditor.isDirty()){
-                    MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
-                    return;
-                }
-                if(selectedTreeNode!=null && selectedTreeNode.getParent()!=null &&
-                        selectedTreeNode.getValue() instanceof SingleRead && selectedTreeNode.getParent().getValue() instanceof Sequence) {
-                    Sequence sequence = (Sequence) selectedTreeNode.getParent().getValue();
-                    sequence.removeSingleRead((SingleRead) selectedTreeNode.getValue());
-                    CdmStore.getService(ISequenceService.class).saveOrUpdate(sequence);
-                    if(activeEditor instanceof DerivateView) {
-                        DerivateView derivateView = (DerivateView)activeEditor;
-                        derivateView.getConversationHolder().commit();
-                        derivateView.refreshTree();
-                    }
-                }
-
-                break;
-            case ADD_TO_SEQUENCE:
-                if(activeEditor.isDirty()){
-                    MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
-                    return;
-                }
-                if(clipBoardTreeNode!=null && clipBoardTreeNode.getValue() instanceof SingleRead
-                        && selectedTreeNode!=null && selectedTreeNode.getValue() instanceof Sequence){
-                    SingleRead singleRead = (SingleRead)clipBoardTreeNode.getValue();
-                    Sequence sequence = (Sequence)selectedTreeNode.getValue();
-                    sequence.addSingleRead(singleRead);
-                    CdmStore.getService(ISequenceService.class).saveOrUpdate(sequence);
-                    if(activeEditor instanceof DerivateView) {
-                        DerivateView derivateView = (DerivateView)activeEditor;
-                        derivateView.getConversationHolder().commit();
-                        derivateView.refreshTree();
-                        LocalSelectionTransfer.getTransfer().setSelection(null);
-                    }
-                }
-                break;
-            case COPY_TO_CLIPBOARD:
-                LocalSelectionTransfer.getTransfer().setSelection(selection);
-                break;
-            }
-        }
-    }
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/CreateFieldUnitHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/CreateFieldUnitHandler.java
deleted file mode 100644 (file)
index da8c8db..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-
-import eu.etaxonomy.cdm.api.service.IOccurrenceService;
-import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-public class CreateFieldUnitHandler extends AbstractHandler {
-
-    @Override
-    public Object execute(ExecutionEvent event) throws ExecutionException {
-        if(AbstractUtility.getActivePart() instanceof DerivateView){
-            DerivateView derivateView = (DerivateView)AbstractUtility.getActivePart();
-            if(derivateView.isDirty()){
-                MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
-                return null;
-            }
-            FieldUnit fieldUnit = FieldUnit.NewInstance();
-            CdmStore.getService(IOccurrenceService.class).save(fieldUnit);
-            derivateView.getConversationHolder().commit();
-            DerivateViewEditorInput input = (DerivateViewEditorInput) derivateView.getEditorInput();
-            input.addRootUuid(fieldUnit.getUuid());
-            derivateView.refreshTree();
-        }
-        return null;
-    }
-
-}
index 1f429451b3cd0f2842b1b4e4bc9f1f408f245f3d..28d7f2bd627fd109c98ab2463dc27083d5e89ab3 100644 (file)
@@ -42,9 +42,6 @@ import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
  */
 public class DeleteDerivateHandler extends AbstractHandler {
 
-    /* (non-Javadoc)
-     * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-     */
     /** {@inheritDoc} */
     @Override
     public Object execute(ExecutionEvent event) throws ExecutionException {
@@ -66,10 +63,10 @@ public class DeleteDerivateHandler extends AbstractHandler {
                     if(value instanceof SpecimenOrObservationBase<?> || value instanceof Sequence || value instanceof SingleRead){
                         if(postOperationEnabled instanceof IConversationEnabled){
                             ConversationHolder conversationHolder = ((IConversationEnabled) postOperationEnabled).getConversationHolder();
-                            label += " "+DerivateLabelProvider.getDerivateText(value, conversationHolder);
+                            label += " "+DerivateLabelProvider.getDerivateText(value, conversationHolder); //$NON-NLS-1$
                         }
                         SpecimenDeleteConfigurator config = new SpecimenDeleteConfigurator();
-                        boolean deepDelete = event.getCommand().getId().equals("eu.etaxonomy.taxeditor.editor.derivate.deepDelete");
+                        boolean deepDelete = event.getCommand().getId().equals("eu.etaxonomy.taxeditor.editor.derivate.deepDelete"); //$NON-NLS-1$
                         config.setDeleteChildren(deepDelete);
                         config.setDeleteMolecularData(deepDelete);
                         DeleteDerivateOperation deleteDerivateOperation = new DeleteDerivateOperation(label, undoContext, (CdmBase) value, (TreeNode) object, postOperationEnabled, config);
@@ -82,7 +79,7 @@ public class DeleteDerivateHandler extends AbstractHandler {
             }
 
         } catch (NotDefinedException e) {
-            MessagingUtils.warn(getClass(), "Command name not set.");
+            MessagingUtils.warn(getClass(), "Command name not set");
         }
         return null;
     }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/ListenToSelectionChangeHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/ListenToSelectionChangeHandler.java
new file mode 100644 (file)
index 0000000..413c377
--- /dev/null
@@ -0,0 +1,23 @@
+package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
+
+public class ListenToSelectionChangeHandler extends AbstractHandler {
+
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+        if(activePart instanceof DerivateView){
+            DerivateView derivativeEditor = (DerivateView)activePart;
+            derivativeEditor.toggleListenToSelectionChange();
+        }
+        return null;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivateEditorForTaxonHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivateEditorForTaxonHandler.java
deleted file mode 100644 (file)
index 5f29227..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2014 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.UUID;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-import eu.etaxonomy.cdm.api.service.IOccurrenceService;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.handler.OpenDerivateViewHandler;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-/**
- * @author pplitzner
- * @date Nov 25, 2014
- *
- */
-public class OpenDerivateEditorForTaxonHandler extends AbstractHandler {
-
-    /* (non-Javadoc)
-     * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-     */
-    @Override
-    public Object execute(ExecutionEvent event) throws ExecutionException {
-        ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
-        if(currentSelection instanceof IStructuredSelection){
-            Iterator<?> selectionIterator = ((IStructuredSelection) currentSelection).iterator();
-            Set<UUID> derivateUuids = new HashSet<UUID>();
-            while(selectionIterator.hasNext()){
-                Object object = selectionIterator.next();
-                if(object instanceof TaxonNode){
-                    TaxonNode node = (TaxonNode)object;
-                    Taxon taxon = node.getTaxon();
-                     List<SpecimenOrObservationBase> listByAssociatedTaxon = CdmStore.getService(IOccurrenceService.class).listByAssociatedTaxon(null, null, taxon, null, null, null, null, null);
-                     for (SpecimenOrObservationBase specimenOrObservationBase : listByAssociatedTaxon) {
-                         derivateUuids.add(specimenOrObservationBase.getUuid());
-                    }
-                }
-            }
-            if(derivateUuids.isEmpty()){
-                MessagingUtils.warningDialog("Could not open Derivative Editor", this, "No Derivatives found");
-                return null;
-            }
-            DerivateViewEditorInput input = new DerivateViewEditorInput(derivateUuids);
-            try {
-                EditorUtil.open(input);
-            } catch (PartInitException e) {
-                MessagingUtils.error(OpenDerivateViewHandler.class, "Could not open Derivative Editor", e);
-            } catch (NullPointerException npe){
-                MessagingUtils.messageDialog("Failed to open Editor", OpenDerivateViewHandler.class, "Could not open Derivative Editor. The derivative hierarchy is corrupted!", npe);
-            }
-        }
-        return null;
-    }
-
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivativeEditorForDescriptionElement.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivativeEditorForDescriptionElement.java
new file mode 100644 (file)
index 0000000..1d1dbde
--- /dev/null
@@ -0,0 +1,49 @@
+package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
+
+import java.util.Collections;
+import java.util.UUID;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.ui.PartInitException;
+
+import eu.etaxonomy.cdm.api.service.IDescriptionService;
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.handler.OpenDerivateViewHandler;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
+import eu.etaxonomy.taxeditor.handler.defaultHandler.DefaultOpenHandlerBase;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+public class OpenDerivativeEditorForDescriptionElement extends DefaultOpenHandlerBase<IndividualsAssociation> {
+
+    @Override
+    protected IndividualsAssociation getEntity(UUID uuid) {
+        DescriptionElementBase descriptionElement = CdmStore.getService(IDescriptionService.class).loadDescriptionElement(uuid, null);
+        if(descriptionElement!=null && descriptionElement.isInstanceOf(IndividualsAssociation.class)){
+            return (IndividualsAssociation) descriptionElement;
+        }
+        return null;
+    }
+
+    @Override
+    protected void open(ExecutionEvent event, IndividualsAssociation entity) {
+       if(entity==null || entity.getAssociatedSpecimenOrObservation()==null){
+               MessagingUtils.messageDialog("No specimens found", this, "No specimens found for the selected object. (Maybe there are unsaved changes)");
+               return;
+       }
+        SpecimenOrObservationBase associatedSpecimenOrObservation = entity.getAssociatedSpecimenOrObservation();
+        if(associatedSpecimenOrObservation!=null){
+            UUID specimenUuid = associatedSpecimenOrObservation.getUuid();
+            try {
+                EditorUtil.open(new DerivateViewEditorInput(Collections.singletonList(specimenUuid)));
+            } catch (PartInitException e) {
+                MessagingUtils.error(OpenDerivateViewHandler.class, "Derivative Editor could not be opened", e);
+            }
+        }
+
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivativeEditorForTaxonNode.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivativeEditorForTaxonNode.java
new file mode 100644 (file)
index 0000000..fbaa4e8
--- /dev/null
@@ -0,0 +1,48 @@
+package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.UUID;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.ui.PartInitException;
+
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
+import eu.etaxonomy.cdm.api.service.config.FindOccurrencesConfigurator;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.handler.OpenDerivateViewHandler;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
+import eu.etaxonomy.taxeditor.handler.defaultHandler.DefaultOpenHandlerBase;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+public class OpenDerivativeEditorForTaxonNode extends DefaultOpenHandlerBase<TaxonNode> {
+
+    @Override
+    protected TaxonNode getEntity(UUID uuid) {
+        return CdmStore.getService(ITaxonNodeService.class).load(uuid);
+    }
+
+    @Override
+    protected void open(ExecutionEvent event, TaxonNode entity) {
+        FindOccurrencesConfigurator config = new FindOccurrencesConfigurator();
+        UUID taxonUuid = entity.getTaxon().getUuid();
+        config.setAssociatedTaxonUuid(taxonUuid);
+        List<SpecimenOrObservationBase> specimens = CdmStore.getService(IOccurrenceService.class).findByTitle(config).getRecords();
+        Collection<UUID> specimenUuids = new ArrayList<UUID>();
+        for (SpecimenOrObservationBase specimenOrObservationBase : specimens) {
+            specimenUuids.add(specimenOrObservationBase.getUuid());
+        }
+        try {
+            EditorUtil.open(new DerivateViewEditorInput(specimenUuids, taxonUuid));
+        } catch (PartInitException e) {
+            MessagingUtils.error(OpenDerivateViewHandler.class, "Derivative Editor could not be opened", e);
+        }
+
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadHandler.java
new file mode 100644 (file)
index 0000000..ba5f2b9
--- /dev/null
@@ -0,0 +1,84 @@
+package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.util.LocalSelectionTransfer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.TreeNode;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+
+import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
+import eu.etaxonomy.cdm.model.molecular.Sequence;
+import eu.etaxonomy.cdm.model.molecular.SingleRead;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+public class SingleReadHandler extends AbstractHandler {
+
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+        ISelection clipBoardSelection = LocalSelectionTransfer.getTransfer().getSelection();
+        final ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getSelection();
+        TreeNode clipBoardTreeNode = EditorUtil.getTreeNodeOfSelection(clipBoardSelection);
+        TreeNode selectedTreeNode = EditorUtil.getTreeNodeOfSelection(selection);
+        if(activeEditor instanceof DerivateView) {
+            DerivateView derivateView = (DerivateView)activeEditor;
+            if(event.getCommand().getId().equals("eu.etaxonomy.taxeditor.editor.derivative.copySingleReadToClipBoard")){
+                LocalSelectionTransfer.getTransfer().setSelection(selection);
+            }
+            else if(event.getCommand().getId().equals("eu.etaxonomy.taxeditor.editor.derivative.reuseSingleRead")){
+                if(activeEditor.isDirty()){
+                    MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
+                    return null;
+                }
+                if(clipBoardTreeNode!=null && clipBoardTreeNode.getValue() instanceof SingleRead
+                        && selectedTreeNode!=null && selectedTreeNode.getValue() instanceof Sequence){
+                    SingleRead singleRead = (SingleRead)clipBoardTreeNode.getValue();
+                    Sequence sequence = (Sequence)selectedTreeNode.getValue();
+                    sequence.addSingleRead(singleRead);
+                    if(CdmStore.getCurrentSessionManager().isRemoting()){
+                        CdmStore.getService(ISequenceService.class).merge(sequence);
+                    }
+                    else{
+                        CdmStore.getService(ISequenceService.class).saveOrUpdate(sequence);
+                    }
+                    if(activeEditor instanceof DerivateView) {
+                        derivateView.getConversationHolder().commit();
+                        derivateView.refreshTree();
+                        LocalSelectionTransfer.getTransfer().setSelection(null);
+                    }
+                }
+            }
+            else if(event.getCommand().getId().equals("eu.etaxonomy.taxeditor.editor.derivative.removeSingleReadFromSequence")){
+                if(activeEditor.isDirty()){
+                    MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
+                    return null;
+                }
+                if(selectedTreeNode!=null && selectedTreeNode.getParent()!=null &&
+                        selectedTreeNode.getValue() instanceof SingleRead && selectedTreeNode.getParent().getValue() instanceof Sequence) {
+                    Sequence sequence = (Sequence) selectedTreeNode.getParent().getValue();
+                    sequence.removeSingleRead((SingleRead) selectedTreeNode.getValue());
+                    if(CdmStore.getCurrentSessionManager().isRemoting()){
+                        CdmStore.getService(ISequenceService.class).merge(sequence);
+                    }
+                    else{
+                        CdmStore.getService(ISequenceService.class).saveOrUpdate(sequence);
+                    }
+                    if(activeEditor instanceof DerivateView) {
+                        derivateView.getConversationHolder().commit();
+                        derivateView.refreshTree();
+                    }
+                }
+            }
+            derivateView.updateLabelCache();
+            derivateView.refreshTree();
+        }
+        return null;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/ToggleLinkWithTaxonSelectionHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/ToggleLinkWithTaxonSelectionHandler.java
new file mode 100644 (file)
index 0000000..3af34dd
--- /dev/null
@@ -0,0 +1,19 @@
+package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
+
+public class ToggleLinkWithTaxonSelectionHandler extends AbstractHandler {
+
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        DerivateView derivateView = (DerivateView) HandlerUtil.getActiveEditor(event);
+        derivateView.toggleListenToSelectionChange();
+        return null;
+    }
+
+}
index c467a943e007f923330bb62fdee50b8681b1a0c4..f5956fa1bebf439a99de347d0b52c9efb07a8d8f 100644 (file)
@@ -21,11 +21,12 @@ import org.eclipse.ui.ISaveablePart;
 import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator;
+import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.molecular.Sequence;
 import eu.etaxonomy.cdm.model.molecular.SingleRead;
+import eu.etaxonomy.taxeditor.editor.Messages;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
@@ -60,16 +61,16 @@ public class DeleteDerivateOperation extends AbstractPostOperation<CdmBase> {
     @Override
     public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
         if(getPostOperationEnabled() instanceof ISaveablePart){
-            String confirmationQuestion = "Do you really want to delete the selected element";
+            String confirmationQuestion = Messages.DeleteDerivateOperation_REALLY_DELETE;
             if(deleteConfigurator.isDeleteChildren()){
-                confirmationQuestion += " and its children";
+                confirmationQuestion += Messages.DeleteDerivateOperation_AND_CHILDREN;
             }
-            confirmationQuestion += "?";
-            if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(deleteConfigurator, null, "Confirm Deletion", confirmationQuestion)){
+            confirmationQuestion += "?"; //$NON-NLS-1$
+            if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(deleteConfigurator, null, Messages.DeleteDerivateOperation_CONFIRM, confirmationQuestion)){
                 return Status.CANCEL_STATUS;
             }
             if(((ISaveablePart) getPostOperationEnabled()).isDirty()){
-                MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+                MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
                 return Status.CANCEL_STATUS;
             }
         }
@@ -78,26 +79,25 @@ public class DeleteDerivateOperation extends AbstractPostOperation<CdmBase> {
                 && treeNode.getValue().equals(element)
                 && treeNode.getParent()!=null
                 && treeNode.getParent().getValue() instanceof Sequence){
-            deleteResult = CdmStore.getService(IOccurrenceService.class).deleteSingleRead((SingleRead)element, (Sequence) treeNode.getParent().getValue());
-        }
-        else{
-            deleteResult = CdmStore.getService(IOccurrenceService.class).deleteDerivateHierarchy(element, deleteConfigurator);
+            deleteResult = CdmStore.getService(ISequenceService.class).deleteSingleRead(((SingleRead)element).getUuid(),
+                    ((Sequence) treeNode.getParent().getValue()).getUuid());
+        } else if(element instanceof Sequence){
+            deleteResult = CdmStore.getService(ISequenceService.class).delete(element.getUuid());
+        } else {
+            deleteResult = CdmStore.getService(IOccurrenceService.class).delete(element.getUuid(), deleteConfigurator);
         }
         if(deleteResult.isOk()){
             if(getPostOperationEnabled() instanceof DerivateView){
                 DerivateView derivateView = (DerivateView) getPostOperationEnabled();
+                derivateView.remove(element);
                 //update DerivateView
                 derivateView.getConversationHolder().commit();
                 IStatus returnStatus = postExecute(null);
-                //close if no more items left
-                if(derivateView.getViewer().getTree().getItemCount()<1){
-                    AbstractUtility.close(derivateView);
-                }
                 return returnStatus;
             }
         }
         else{
-            MessagingUtils.warningDialog("Deletion failed", this, deleteResult.toString());
+            MessagingUtils.warningDialog(Messages.DeleteDerivateOperation_DELETE_FAILED, this, deleteResult.toString());
             return Status.CANCEL_STATUS;
         }
         return Status.OK_STATUS;
index e7bfe694f565d2a18d89b8a5848860145a0a04ba..b1426ddb673af35d7b75cbb7597c9257b95a9d5b 100644 (file)
@@ -9,6 +9,8 @@
 */
 package eu.etaxonomy.taxeditor.editor.view.derivate.operation;
 
+import java.util.UUID;
+
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.operations.IUndoContext;
 import org.eclipse.core.runtime.IAdaptable;
@@ -28,6 +30,7 @@ import eu.etaxonomy.cdm.model.molecular.SingleRead;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
+import eu.etaxonomy.taxeditor.editor.Messages;
 import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
@@ -53,9 +56,6 @@ public class MoveDerivateOperation extends AbstractPostOperation<CdmBase>  {
         this.targetNode = targetNode;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-     */
     @Override
     public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
         DerivateView derivateView = null;
@@ -63,23 +63,27 @@ public class MoveDerivateOperation extends AbstractPostOperation<CdmBase>  {
             derivateView = (DerivateView) getPostOperationEnabled();
         }
         if(derivateView==null){
-            MessagingUtils.operationDialog(this, new NullPointerException("Derivative Editor was null"), TaxeditorEditorPlugin.PLUGIN_ID, this.getLabel(), getLabel());
+            MessagingUtils.operationDialog(this, new NullPointerException("Derivative Editor was null"), TaxeditorEditorPlugin.PLUGIN_ID, this.getLabel(), getLabel()); //$NON-NLS-1$
             return Status.CANCEL_STATUS;
         }
         if(derivateView.isDirty()){
-            MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+            MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
             return Status.CANCEL_STATUS;
         }
 
         fromNode = draggedNode.getParent();
         if(moveTreeNode(draggedNode, fromNode, targetNode)){
+            //special case if derivative with no parent was moved
+            if(fromNode==null && draggedNode!=null && draggedNode.getValue()!=null){
+                derivateView.remove(draggedNode.getValue());
+            }
             //update DerivateView
             derivateView.getConversationHolder().commit();
             LocalSelectionTransfer.getTransfer().setSelection(null);
             return postExecute(null);
         }
         else{
-            MessagingUtils.warningDialog("Moving derivatives not possible!", derivateView, "Moving \""+derivateView.getLabelProvider().getDerivateText(draggedNode)+"\" to \""+derivateView.getLabelProvider().getDerivateText(targetNode)+"\" is not possible!");
+            MessagingUtils.warningDialog(Messages.MoveDerivateOperation_MOVE_NOT_POSSIBLE, derivateView, String.format(Messages.MoveDerivateOperation_MOVE_TO_NOT_POSSIBLE, derivateView.getLabelProvider().getDerivateText(draggedNode), derivateView.getLabelProvider().getDerivateText(targetNode)));
         }
         return Status.CANCEL_STATUS;
     }
@@ -98,10 +102,14 @@ public class MoveDerivateOperation extends AbstractPostOperation<CdmBase>  {
             DerivedUnit draggedSpecimen = (DerivedUnit) draggedNodeValue;
             SpecimenOrObservationBase<?> targetSpecimen = (SpecimenOrObservationBase<?>) targetNodeValue;
             //check if type is a sub derivate type
-            if(fromParentSpecimen instanceof SpecimenOrObservationBase<?>
-            && fromNode!=null
-            && !fromNode.equals(targetNode)){//don't drag on direct parent node)
-                return occurrenceService.moveDerivate((SpecimenOrObservationBase<?>)fromParentSpecimen, targetSpecimen, draggedSpecimen);
+            if(fromNode==null || !fromNode.equals(targetNode)){//don't drag on direct parent node)
+                UUID fromUuid = null;
+                if(fromParentSpecimen!=null){
+                    fromUuid = ((SpecimenOrObservationBase<?>)fromParentSpecimen).getUuid();
+                }
+                return occurrenceService.moveDerivate(fromUuid,
+                        targetSpecimen.getUuid(),
+                        draggedSpecimen.getUuid()).isOk();
             }
         }
 
@@ -109,7 +117,10 @@ public class MoveDerivateOperation extends AbstractPostOperation<CdmBase>  {
         else if(draggedNodeValue instanceof SingleRead && targetNodeValue instanceof Sequence){
             SingleRead singleRead = (SingleRead) draggedNodeValue;
             if(fromParentSpecimen instanceof Sequence){
-                return CdmStore.getService(ISequenceService.class).moveSingleRead((Sequence)fromParentSpecimen, (Sequence)targetNodeValue, singleRead).isOk();
+                return CdmStore.getService(ISequenceService.class).moveSingleRead(((Sequence)fromParentSpecimen).getUuid(),
+                        ((Sequence)targetNodeValue).getUuid(),
+                        singleRead.getUuid()).isOk();
+
             }
         }
 
@@ -117,16 +128,15 @@ public class MoveDerivateOperation extends AbstractPostOperation<CdmBase>  {
         else if(draggedNodeValue instanceof Sequence && targetNodeValue instanceof DnaSample && ((SpecimenOrObservationBase<?>) targetNodeValue).getRecordBasis()==SpecimenOrObservationType.DnaSample){
             Sequence sequence = (Sequence)draggedNodeValue;
             if(fromParentSpecimen instanceof DnaSample && ((SpecimenOrObservationBase<?>) targetNodeValue).getRecordBasis()==SpecimenOrObservationType.DnaSample){
-                return occurrenceService.moveSequence((DnaSample)fromParentSpecimen, (DnaSample)targetNodeValue, sequence).isOk();
+                return occurrenceService.moveSequence(((DnaSample)fromParentSpecimen).getUuid(),
+                        ((DnaSample)targetNodeValue).getUuid(),
+                        sequence.getUuid()).isOk();
+
             }
         }
         return false;
     }
 
-
-    /* (non-Javadoc)
-     * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-     */
     @Override
     public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
         //swap fromNode and targetNode
@@ -134,9 +144,6 @@ public class MoveDerivateOperation extends AbstractPostOperation<CdmBase>  {
         return execute(new NullProgressMonitor(), null);
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-     */
     @Override
     public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
         //swap fromNode and targetNode
@@ -7,12 +7,9 @@
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
-package eu.etaxonomy.taxeditor.view.derivateSearch;
+package eu.etaxonomy.taxeditor.editor.view.derivate.searchFilter;
 
-import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
@@ -20,7 +17,6 @@ import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.wb.swt.ResourceManager;
@@ -30,72 +26,82 @@ import org.eclipse.wb.swt.ResourceManager;
  *
  */
 public class DerivateSearchComposite extends Composite {
+
+    public static final int ALL_SPECIMENS = 0;
+    public static final int ASSIGNED_SPECIMENS = 1;
+    public static final int UNASSIGNED_SPECIMENS = 2;
+
     private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
     private final Text searchField;
-    private final Table table;
-    private final TableViewer resultViewer;
     private final Combo comboDerivateType;
     private final Button buttonSearch;
-    private final Button btnFilterUndeterminedSpecimen;
     private final Text textTaxonName;
     private final Button btnBrowseTaxa;
     private final Label lblTaxon;
     private final Label lblDerivateType;
     private final Button btnClearTaxon;
+    private Label lbltaxonAssignment;
+    private Combo comboTaxonAssignment;
+    private Label lblTitleCache;
 
     /**
      * Create the composite.
+     *
      * @param parent
      * @param style
      */
     public DerivateSearchComposite(Composite parent, int style) {
         super(parent, style);
-        setLayout(new GridLayout(4, false));
+        setLayout(new GridLayout(7, false));
 
         lblTaxon = new Label(this, SWT.NONE);
         lblTaxon.setText("Taxon");
 
-        textTaxonName = formToolkit.createText(this, "New Text", SWT.NONE);
+        textTaxonName = formToolkit.createText(this, "New Text", SWT.BORDER);
         textTaxonName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
         textTaxonName.setEnabled(false);
         textTaxonName.setText("");
 
         btnBrowseTaxa = formToolkit.createButton(this, "", SWT.NONE);
-        btnBrowseTaxa.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/open.gif"));
+        btnBrowseTaxa.setAlignment(SWT.RIGHT);
+        btnBrowseTaxa.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/prj_obj.gif"));
 
         btnClearTaxon = formToolkit.createButton(this, "", SWT.NONE);
-        btnClearTaxon.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
+        btnClearTaxon.setAlignment(SWT.RIGHT);
+        btnClearTaxon.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false, 1, 1));
         btnClearTaxon.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/trash.gif"));
 
+        lbltaxonAssignment = new Label(this, SWT.NONE);
+        lbltaxonAssignment.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        lbltaxonAssignment.setText("Taxon assignment");
+
+        comboTaxonAssignment = new Combo(this, SWT.NONE);
+        comboTaxonAssignment.setItems(new String[] { "All", "Yes", "No" });
+        comboTaxonAssignment.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+        formToolkit.adapt(comboTaxonAssignment);
+        formToolkit.paintBordersFor(comboTaxonAssignment);
+        comboTaxonAssignment.select(ALL_SPECIMENS);
+        new Label(this, SWT.NONE);
+
+        lblTitleCache = new Label(this, SWT.NONE);
+        lblTitleCache.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        lblTitleCache.setText("Title Cache");
+
+        searchField = formToolkit.createText(this, "New Text", SWT.BORDER);
+        searchField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1));
+        searchField.setText("");
+
         lblDerivateType = new Label(this, SWT.NULL);
+        lblDerivateType.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
         lblDerivateType.setText("Derivative Type");
 
         comboDerivateType = new Combo(this, SWT.READ_ONLY);
         comboDerivateType.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
         formToolkit.paintBordersFor(comboDerivateType);
 
-        btnFilterUndeterminedSpecimen = new Button(this, SWT.CHECK);
-        btnFilterUndeterminedSpecimen.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
-        btnFilterUndeterminedSpecimen.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-            }
-        });
-        btnFilterUndeterminedSpecimen.setText("Determined");
-
-                buttonSearch = new Button(this, SWT.NONE);
-                formToolkit.adapt(buttonSearch, true, true);
-                buttonSearch.setText("Search");
-
-                searchField = formToolkit.createText(this, "New Text", SWT.NONE);
-                searchField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
-                searchField.setText("");
-                new Label(this, SWT.NONE);
-                new Label(this, SWT.NONE);
-
-                resultViewer = new TableViewer(this, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
-                table = resultViewer.getTable();
-                table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 4, 1));
+        buttonSearch = new Button(this, SWT.NONE);
+        formToolkit.adapt(buttonSearch, true, true);
+        buttonSearch.setText("Search");
 
     }
 
@@ -103,42 +109,51 @@ public class DerivateSearchComposite extends Composite {
     protected void checkSubclass() {
         // Disable the check that prevents subclassing of SWT components
     }
+
     public Text getSearchField() {
         return searchField;
     }
-    public TableViewer getResultViewer() {
-        return resultViewer;
-    }
+
     public Combo getComboDerivateType() {
         return comboDerivateType;
     }
+
     public Button getButtonSearch() {
         return buttonSearch;
     }
 
     @Override
-    public void setEnabled(boolean enabled){
+    public void setEnabled(boolean enabled) {
         super.setEnabled(enabled);
         searchField.setEnabled(enabled);
-        table.setEnabled(enabled);
-        //        resultViewer.setEnabled(enabled);
         comboDerivateType.setEnabled(enabled);
+        comboTaxonAssignment.setEnabled(enabled);
         buttonSearch.setEnabled(enabled);
-        btnFilterUndeterminedSpecimen.setEnabled(enabled);
         btnBrowseTaxa.setEnabled(enabled);
+        btnClearTaxon.setEnabled(enabled);
         lblTaxon.setEnabled(enabled);
+        lblTitleCache.setEnabled(enabled);
+        lbltaxonAssignment.setEnabled(enabled);
         lblDerivateType.setEnabled(enabled);
     }
-    public Button getBtnFilterUndeterminedSpecimen() {
-        return btnFilterUndeterminedSpecimen;
-    }
+
+
     public Button getBtnBrowseTaxa() {
         return btnBrowseTaxa;
     }
+
     public Text getTextTaxonName() {
         return textTaxonName;
     }
+
     public Button getBtnClearTaxon() {
         return btnClearTaxon;
     }
+    public Combo getComboTaxonAssignment() {
+        return comboTaxonAssignment;
+    }
+
+    public Label getLbltaxonAssignment() {
+        return lbltaxonAssignment;
+    }
 }
@@ -7,38 +7,33 @@
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-package eu.etaxonomy.taxeditor.view.derivateSearch;
+package eu.etaxonomy.taxeditor.editor.view.derivate.searchFilter;
 
-import java.util.ArrayList;
 import java.util.List;
+import java.util.UUID;
 
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.NotEnabledException;
-import org.eclipse.core.commands.NotHandledException;
-import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.handlers.IHandlerService;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.api.service.config.FindOccurrencesConfigurator;
+import eu.etaxonomy.cdm.api.service.config.FindOccurrencesConfigurator.AssignmentStatus;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.SearchManager;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.SelectionDialogFactory;
 import eu.etaxonomy.taxeditor.ui.mvc.combo.EnumTermComboController;
+import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
 
 /**
  * Controller class for the {@link DerivateSearchComposite}.<br>
@@ -50,17 +45,13 @@ public class DerivateSearchCompositeController implements Listener{
 
     private final DerivateSearchComposite derivateSearchComposite;
     private EnumTermComboController<SpecimenOrObservationType> comboSpecimenTypeController;
-    private final DerivateSearchView derivateSearchView;
        private DerivateLabelProvider labelProvider;
        private Taxon selectedTaxon;
+    private DerivateView derivativeEditor;
 
-    /**
-     * @param parent
-     * @param derivateSearchView
-     */
-    public DerivateSearchCompositeController(Composite parent, DerivateSearchView derivateSearchView) {
+    public DerivateSearchCompositeController(Composite parent, DerivateView derivativeEditor) {
         this.derivateSearchComposite = new DerivateSearchComposite(parent, SWT.NONE);
-        this.derivateSearchView = derivateSearchView;
+        this.derivativeEditor = derivativeEditor;
         init();
     }
 
@@ -75,40 +66,9 @@ public class DerivateSearchCompositeController implements Listener{
         derivateSearchComposite.getBtnBrowseTaxa().addListener(SWT.Selection, this);
         derivateSearchComposite.getBtnClearTaxon().addListener(SWT.Selection, this);
 
-
-        //result table
-        TableViewer resultViewer = derivateSearchComposite.getResultViewer();
-        resultViewer.setContentProvider(new ArrayContentProvider());
-        labelProvider = new DerivateLabelProvider();
-        resultViewer.setLabelProvider(labelProvider);
-        resultViewer.addDoubleClickListener(new IDoubleClickListener() {
-            @Override
-            public void doubleClick(DoubleClickEvent event) {
-                String commandId = "eu.etaxonomy.taxeditor.editor.handler.openDerivateView";
-
-                IHandlerService handlerService = (IHandlerService) AbstractUtility.getService(IHandlerService.class);
-                try {
-                    handlerService.executeCommand(commandId, null);
-                } catch (ExecutionException e) {
-                    MessagingUtils.error(DerivateSearchCompositeController.class, e);
-                } catch (NotDefinedException e) {
-                    MessagingUtils.error(DerivateSearchCompositeController.class, e);
-                } catch (NotEnabledException e) {
-                    MessagingUtils.error(DerivateSearchCompositeController.class, e);
-                } catch (NotHandledException e) {
-                    MessagingUtils.error(DerivateSearchCompositeController.class, e);
-                }
-
-            }
-        });
-
     }
 
     private void searchDerivates(){
-        if(!derivateSearchView.getConversationHolder().isBound()){
-            derivateSearchView.setFocus(); //rebind the conversation
-        }
-
         String queryString = derivateSearchComposite.getSearchField().getText();
         SpecimenOrObservationType specimenType = comboSpecimenTypeController.getSelection();
 
@@ -117,36 +77,25 @@ public class DerivateSearchCompositeController implements Listener{
         config.setSpecimenType(specimenType.equals(SpecimenOrObservationType.Unknown)?null:specimenType);//unknown := all types
         config.setTitleSearchString(queryString);
         if(selectedTaxon!=null){
-            config.setRetrieveIndirectlyAssociatedSpecimens(true);
             config.setSpecimenType(null);
         }
-
-        SearchManager searchManager = new SearchManager();
-        List<SpecimenOrObservationBase> occurrences = searchManager.findOccurrences(config);
-
-        //filter out specimens of wrong type (only if an associated taxon was selected)
-        if(selectedTaxon!=null && !specimenType.equals(SpecimenOrObservationType.Unknown)){
-            List<SpecimenOrObservationBase> specimensOfCorrectType = new ArrayList<SpecimenOrObservationBase>();
-            for(SpecimenOrObservationBase<?> occurrence:occurrences){
-                if(occurrence.getRecordBasis().equals(specimenType)
-                        || occurrence.getRecordBasis().isKindOf(specimenType)){
-                    specimensOfCorrectType.add(occurrence);
-                }
-            }
-            occurrences = specimensOfCorrectType;
+        switch (derivateSearchComposite.getComboTaxonAssignment().getSelectionIndex()) {
+        case DerivateSearchComposite.ALL_SPECIMENS:
+            config.setAssignmentStatus(AssignmentStatus.ALL_SPECIMENS);
+            break;
+        case DerivateSearchComposite.ASSIGNED_SPECIMENS:
+            config.setAssignmentStatus(AssignmentStatus.ASSIGNED_SPECIMENS);
+            break;
+        case DerivateSearchComposite.UNASSIGNED_SPECIMENS:
+            config.setAssignmentStatus(AssignmentStatus.UNASSIGNED_SPECIMENS);
+            break;
+        default:
+            break;
         }
 
-        //filter out assigned specimens
-        if(derivateSearchComposite.getBtnFilterUndeterminedSpecimen().getSelection()){
-            List<SpecimenOrObservationBase> specimensWithNoDetermination = new ArrayList<SpecimenOrObservationBase>();
-            for(SpecimenOrObservationBase<?> result:occurrences){
-                if(CdmStore.getService(IOccurrenceService.class).countDeterminations(result, null)==0){
-                    specimensWithNoDetermination.add(result);
-                }
-            }
-            occurrences = specimensWithNoDetermination;
-        }
-        derivateSearchComposite.getResultViewer().setInput(occurrences);
+        SearchManager searchManager = new SearchManager();
+        List<SpecimenOrObservationBase> occurrences = searchManager.findOccurrences(config, true);
+        derivativeEditor.updateRootEntities(occurrences);
     }
 
     @Override
@@ -157,14 +106,20 @@ public class DerivateSearchCompositeController implements Listener{
             searchDerivates();
         }
         else if(eventSource==derivateSearchComposite.getBtnBrowseTaxa()){
-            selectedTaxon = SelectionDialogFactory.getSelectionFromDialog(Taxon.class, derivateSearchView.getSite().getShell(), derivateSearchView.getConversationHolder(), null);
+            selectedTaxon = SelectionDialogFactory.getSelectionFromDialog(Taxon.class, this.derivateSearchComposite.getShell(), derivativeEditor.getConversationHolder(), null);
             if(selectedTaxon!=null){
                 derivateSearchComposite.getTextTaxonName().setText(selectedTaxon.getTitleCache());
             }
+            derivateSearchComposite.getComboTaxonAssignment().select(DerivateSearchComposite.ASSIGNED_SPECIMENS);
+            derivateSearchComposite.getComboTaxonAssignment().setEnabled(false);
+            derivateSearchComposite.getLbltaxonAssignment().setEnabled(false);
         }
         else if(eventSource==derivateSearchComposite.getBtnClearTaxon()){
             selectedTaxon = null;
             derivateSearchComposite.getTextTaxonName().setText("");
+            derivateSearchComposite.getComboTaxonAssignment().select(DerivateSearchComposite.ALL_SPECIMENS);
+            derivateSearchComposite.getComboTaxonAssignment().setEnabled(true);
+            derivateSearchComposite.getLbltaxonAssignment().setEnabled(true);
         }
     }
 
@@ -174,16 +129,34 @@ public class DerivateSearchCompositeController implements Listener{
      */
     public void setEnabled(boolean enabled) {
         if(!derivateSearchComposite.isDisposed()){
-            derivateSearchComposite.setEnabled(enabled);
+            GridData layoutData = (GridData) derivateSearchComposite.getLayoutData();
+            layoutData.exclude = !enabled;
+            derivateSearchComposite.setVisible(enabled);
+            derivateSearchComposite.getParent().layout(true);
         }
     }
 
+    public void setLayoutData(Object layoutData){
+        derivateSearchComposite.setLayoutData(layoutData);
+    }
+
+    /**
+     * Checks whether or not the search criteria are set to their default value.<br>
+     * This does not consider the title search field.
+     * @return <code>true</code> if search criteria are set to default.
+     */
+    public boolean isDefaultSearch(){
+        boolean isDefault = true;
+        isDefault &= comboSpecimenTypeController.getSelection()==SpecimenOrObservationType.Unknown;
+        isDefault &= derivateSearchComposite.getComboTaxonAssignment().getSelectionIndex()==DerivateSearchComposite.ALL_SPECIMENS;
+        isDefault &= selectedTaxon==null;
+        return isDefault;
+    }
     /**
      * Resets all input fields
      */
     public void reset(){
         if(!derivateSearchComposite.isDisposed()){
-            derivateSearchComposite.getResultViewer().setInput(null);
             derivateSearchComposite.getSearchField().setText("");
             derivateSearchComposite.getComboDerivateType().deselectAll();
             comboSpecimenTypeController.setSelection(SpecimenOrObservationType.Unknown);
@@ -191,19 +164,19 @@ public class DerivateSearchCompositeController implements Listener{
         selectedTaxon = null;
     }
 
-    public TableViewer getResultViewer() {
-        return derivateSearchComposite.getResultViewer();
-    }
-
-    public void setFocus() {
-        derivateSearchComposite.getResultViewer().getControl().setFocus();
-    }
-
-    /**
-     * @param conversationHolder
-     */
     public void setConversation(ConversationHolder conversationHolder) {
         labelProvider.setConversation(conversationHolder);
     }
 
+    public void setTaxonFilter(UUID taxonUuid) {
+        TaxonBase taxonBase = CdmStore.getService(ITaxonService.class).load(taxonUuid);
+        if(taxonBase!=null && taxonBase.isInstanceOf(Taxon.class)){
+            selectedTaxon = HibernateProxyHelper.deproxy(taxonBase, Taxon.class);
+            derivateSearchComposite.getTextTaxonName().setText(taxonBase.getTitleCache());
+            derivateSearchComposite.getLbltaxonAssignment().setEnabled(false);
+            derivateSearchComposite.getComboTaxonAssignment().select(DerivateSearchComposite.ASSIGNED_SPECIMENS);
+            derivateSearchComposite.getComboTaxonAssignment().setEnabled(false);
+        }
+    }
+
 }
index de3e46f0da432566a11f7895ac149f8ced59ef1c..86c95a2c1f1aa20558b5339f08e80b7baddb95bf 100644 (file)
@@ -18,6 +18,7 @@ import org.eclipse.swt.dnd.DND;
 import org.eclipse.swt.dnd.DragSourceAdapter;
 import org.eclipse.swt.dnd.DragSourceEvent;
 
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
@@ -30,6 +31,7 @@ import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 public class DescriptionElementDragListener extends DragSourceAdapter {
 
        private DescriptiveViewPart part;
+       private DescriptionBase description;
        
        public DescriptionElementDragListener(DescriptiveViewPart part){
                this.part = part;
@@ -43,9 +45,10 @@ public class DescriptionElementDragListener extends DragSourceAdapter {
                        return;
                // FIXME what to do here?
                if (event.detail != DND.DROP_NONE) {
-                       IStructuredSelection selection = (IStructuredSelection) part.getViewer()
-                                       .getSelection();
-                       part.changed(null);
+                       //IStructuredSelection selection = (IStructuredSelection) part.getViewer().getSelection();
+                       part.getViewer().refresh();
+                       
+               part.changed(null);
                }
        }
        
@@ -58,7 +61,11 @@ public class DescriptionElementDragListener extends DragSourceAdapter {
                List<DescriptionElementBase> descriptionElements = new ArrayList<DescriptionElementBase>();
                for (Object object : selection.toList()){
                        if(object instanceof DescriptionBase){
-                               descriptionElements.addAll(((DescriptionBase) object).getElements());
+                               if (!((DescriptionBase) object).getElements().isEmpty()){
+                                       descriptionElements.addAll(((DescriptionBase) object).getElements());
+                               }
+                               description = HibernateProxyHelper.deproxy(object, DescriptionBase.class);
+                               
                        }else if(object instanceof FeatureNodeContainer){
                                descriptionElements.addAll(((FeatureNodeContainer) object).getDescriptionElements());
                        }else if(object instanceof DescriptionElementBase){
@@ -68,8 +75,12 @@ public class DescriptionElementDragListener extends DragSourceAdapter {
                }
                if (DescriptionElementTransfer.getInstance().isSupportedType(
                                event.dataType)) {
-                       event.data = descriptionElements.toArray(new DescriptionElementBase[descriptionElements.size()]);
+                       if (!descriptionElements.isEmpty()){
+                               event.data = descriptionElements.toArray(new DescriptionElementBase[descriptionElements.size()]);
+                       }
+                       
                }
+               
        }
        
        /**
index 488cc775b7e87432c1332de543d7ed07c623d6cd..465e3f0c085719b9e0fee56151fbb3facbbf10a9 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -46,35 +46,40 @@ public class DescriptionElementDropAdapter extends ViewerDropAdapter {
        public boolean performDrop(Object data) {
                TaxonDescription target = (TaxonDescription) getCurrentTarget();
                Object[] droppedElements = (Object[]) data;
-               
+
                Collection<DescriptionElementBase> descriptionElements = new ArrayList<DescriptionElementBase>();
-               
+
                boolean isCopy = getCurrentOperation() == DND.DROP_COPY ? true : false;
-               
+
                // cannot drop a feature node onto itself
-               for (Object droppedElement : droppedElements) {                 
-                       if (droppedElement == null){
-                               MessagingUtils.warningDialog("Operation not supported yet", this, "We are currently unable to drag and drop a newly created element. Please save the editor to make this work.");
-                               return false;
-                       }
-                       if(! (droppedElement instanceof DescriptionElementBase)){
-                               return false;
-                       }else{
-                               DescriptionElementBase descriptionElement = (DescriptionElementBase) droppedElement;
-                               
-                               if (descriptionElement.getInDescription().equals(target)) {
+               if (droppedElements != null){
+                       for (Object droppedElement : droppedElements) {
+                               if (droppedElement == null){
+                                       MessagingUtils.warningDialog("Operation not supported yet", this, "We are currently unable to drag and drop a newly created element. Please save the editor to make this work.");
                                        return false;
                                }
-                               
-                               descriptionElements.add(descriptionElement);
-                       }                       
+                               if(! (droppedElement instanceof DescriptionElementBase)){
+                                       return false;
+                               }else{
+                                       DescriptionElementBase descriptionElement = (DescriptionElementBase) droppedElement;
+
+                                       if (descriptionElement.getInDescription().equals(target)) {
+                                               return false;
+                                       }
+
+                                       descriptionElements.add(descriptionElement);
+                               }
+                       }
+
+                       AbstractPostOperation operation = new MoveDescriptionElementsOperation("Move Descriptions", EditorUtil.getUndoContext(), target, descriptionElements, isCopy, null);
+
+                       EditorUtil.executeOperation(operation);
+                       return true;
                }
-               
-               AbstractPostOperation operation = new MoveDescriptionElementsOperation("Move Descriptions", EditorUtil.getUndoContext(), target, descriptionElements, isCopy, null);
-               
-               EditorUtil.executeOperation(operation);
-               
-               return true;
+               MessagingUtils.warningDialog("Operation not supported yet", this, "We are unable to drag and drop empty descriptions");
+
+               return false;
+
        }
 
        /* (non-Javadoc)
@@ -85,7 +90,6 @@ public class DescriptionElementDropAdapter extends ViewerDropAdapter {
                        TransferData transferData) {
                boolean transferDataIsSupported = DescriptionElementTransfer.getInstance().isSupportedType(
                                transferData);
-               System.out.println(target);
                return target instanceof TaxonDescription && transferDataIsSupported;
        }
 
index 3171375485ddfad8afbd1c4fb09ff7c8d173e551..b0aeb0f4d0b1727c19d85ae5d2cbf08d4eecbc1c 100644 (file)
@@ -20,6 +20,7 @@ import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.FeatureTree;
 import eu.etaxonomy.cdm.model.description.IDescribable;
 import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
+import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainerTree;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
@@ -39,6 +40,7 @@ public class DescriptiveContentProvider implements ITreeContentProvider {
        protected Map<DescriptionBase<?>, FeatureNodeContainerTree> featureNodeContainerCache;
        private boolean showOnlyIndividualAssociations;
 
+
        public DescriptiveContentProvider(Map<DescriptionBase<?>, FeatureNodeContainerTree> featureNodeContainerCache) {
            this(featureNodeContainerCache, false);
        }
@@ -144,8 +146,8 @@ public class DescriptiveContentProvider implements ITreeContentProvider {
         * @return
         */
        private FeatureTree getFeatureTree(DescriptionBase description){
-               FeatureTree featureTree = null;
 
+           FeatureTree featureTree;
                // TODO change this to the feature tree associated with this taxon description
                if (description.hasStructuredData()){
                        featureTree = PreferencesUtil.getDefaultFeatureTreeForStructuredDescription();
@@ -155,7 +157,7 @@ public class DescriptiveContentProvider implements ITreeContentProvider {
 
                // create a transient tree with all features if none was selected
                if(featureTree == null){
-                       featureTree = FeatureTree.NewInstance(TermStore.getTerms(Feature.class));
+                       featureTree = TermEditorInput.getDefaultFeatureTree();
                }
 
                return featureTree;
index 7556a73d2612f9b93ca11525614197de02a0c09a..11ff7124edf97127df911c5551ea6f6ab3ee359e 100644 (file)
 package eu.etaxonomy.taxeditor.editor.view.descriptive;
 
 import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
 
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.GroupMarker;
@@ -23,14 +19,11 @@ import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.IToolBarManager;
 import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TreeNode;
-import org.eclipse.jface.viewers.TreeSelection;
 import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.SWT;
@@ -43,20 +36,18 @@ import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.Tree;
 import org.eclipse.ui.IWorkbenchActionConstants;
 import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
 
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.IDescribable;
-import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
+import eu.etaxonomy.taxeditor.editor.view.media.MediaViewPart;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainerTree;
@@ -64,14 +55,12 @@ import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
 import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
 import eu.etaxonomy.taxeditor.model.ImageResources;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
 import eu.etaxonomy.taxeditor.view.detail.DetailsViewPart;
 import eu.etaxonomy.taxeditor.view.supplementaldata.SupplementalDataViewPart;
 
 /**
- * <p>DescriptiveViewPart class.</p>
- *
  * @author n.hoffmann
  * @created Jun 9, 2010
  * @version 1.0
@@ -124,58 +113,8 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
 
                createToolbar();
 
-               // set initial input
-//             if(getEditor() != null){
-//                     viewer.setInput(getEditor().getEditorInput());
-//             }
-
-               viewer.addDoubleClickListener(new IDoubleClickListener() {
-            @Override
-            public void doubleClick(DoubleClickEvent event) {
-                //Open derivate editor when specimen description element is double clicked
-                TreeSelection selection = (TreeSelection) viewer.getSelection();
-                Iterator iterator = selection.iterator();
-                Set<UUID> specimenUuids = new HashSet<UUID>();
-                while(iterator.hasNext()){
-                    Object next = iterator.next();
-                    if(next instanceof IndividualsAssociation){
-                        SpecimenOrObservationBase<?> specimen = ((IndividualsAssociation)next).getAssociatedSpecimenOrObservation();
-                        if(specimen!=null){
-                            specimenUuids.add(specimen.getUuid());
-                        }
-                    }
-                }
-                try {
-                    if(!specimenUuids.isEmpty()){
-                        EditorUtil.open(new DerivateViewEditorInput(specimenUuids));
-                    }
-                } catch (PartInitException e) {
-                    MessagingUtils.error(DescriptiveViewPart.class, "Could not open Derivative Editor", e);
-                }
-
-
-                    //TODO: extend command to accept parameter to open editor
-//                    String commandId = "eu.etaxonomy.taxeditor.editor.handler.openDerivateView";
-//                    IHandlerService handlerService = (IHandlerService) AbstractUtility.getService(IHandlerService.class);
-//                    try {
-//                        handlerService.executeCommand(commandId, null);
-//                    } catch (ExecutionException e) {
-//                        MessagingUtils.error(DerivateSearchCompositeController.class, e);
-//                    } catch (NotDefinedException e) {
-//                        MessagingUtils.error(DerivateSearchCompositeController.class, e);
-//                    } catch (NotEnabledException e) {
-//                        MessagingUtils.error(DerivateSearchCompositeController.class, e);
-//                    } catch (NotHandledException e) {
-//                        MessagingUtils.error(DerivateSearchCompositeController.class, e);
-//                    }
-
-            }
-        });
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#getInitialSelection()
-        */
        /** {@inheritDoc} */
        @Override
        protected ISelection getInitialSelection() {
@@ -197,6 +136,7 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
         */
        protected void createMenu(){
                MenuManager menuManager = new MenuManager();
+               menuManager.setRemoveAllWhenShown(true);
                menuManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
 
                getSite().registerContextMenu(menuManager, viewer);
@@ -223,10 +163,12 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
                if(part == this){
                    return;
                }
-               if(part instanceof DetailsViewPart || part instanceof SupplementalDataViewPart){
-                   // do not show empty page as these views are also used to edit the description selected in this view
-                   return;
-               }
+        if (part instanceof DetailsViewPart || part instanceof SupplementalDataViewPart
+                || part instanceof MediaViewPart) {
+            // do not show empty page as these views are also used to edit the
+            // description selected in this view
+            return;
+        }
                // unpackage TreeNode of DerivateView
                else if(part instanceof DerivateView){
                    TreeNode treeNodeOfSelection = EditorUtil.getTreeNodeOfSelection(selection);
@@ -336,8 +278,13 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
                }
                if(part instanceof BulkEditor && !(object instanceof SpecimenOrObservationBase<?>)){
                    ((BulkEditor) part).forceDirty();
+                   if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                       IStructuredSelection selection = (IStructuredSelection) ((BulkEditor) part).getSelectionProvider().getSelection();
+                       ((BulkEditor) part).changed(selection.getFirstElement());
+                   }
                }
 
+
                super.changed(object);
        }
 
@@ -347,11 +294,6 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
                return viewer;
        }
 
-       /**
-        * <p>onComplete</p>
-        *
-        * @return a boolean.
-        */
        @Override
     public boolean onComplete() {
                return false;
index fc7a044a9bc9005f345431cea3faa3c21827a1e6..31b1169581baa6ebc788d62e0d4c05f3e5b10f8d 100644 (file)
@@ -39,6 +39,7 @@ import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 
 /**
  * <p>DeleteDescriptionHandler class.</p>
@@ -59,6 +60,7 @@ public class DeleteHandler extends AbstractHandler {
 
                IWorkbenchPart part = HandlerUtil.getActivePart(event);
                IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part : null;
+               ICdmEntitySessionEnabled cdmEntitySessionEnabled = (part instanceof ICdmEntitySessionEnabled) ? (ICdmEntitySessionEnabled) part : null;
 
                try {
                        String label = event.getCommand().getName();
@@ -71,20 +73,20 @@ public class DeleteHandler extends AbstractHandler {
 
                                // TaxonDescription
                                if(object instanceof TaxonDescription){
-                                       operations.add(new DeleteTaxonDescriptionOperation(label, undoContext, (TaxonDescription) object, postOperationEnabled));
+                                       operations.add(new DeleteTaxonDescriptionOperation(label, undoContext, (TaxonDescription) object, postOperationEnabled, cdmEntitySessionEnabled));
                                }
                                else if(object instanceof SpecimenDescription){
-                                   operations.add(new DeleteSpecimenDescriptionOperation(label, undoContext, (SpecimenDescription) object, postOperationEnabled));
+                                   operations.add(new DeleteSpecimenDescriptionOperation(label, undoContext, (SpecimenDescription) object, postOperationEnabled, cdmEntitySessionEnabled)) ;
                                }
                                // DescriptionElementBase
                                else if(object instanceof DescriptionElementBase){
-                                       operations.add(new DeleteDescriptionElementOperation(label, undoContext, (DescriptionElementBase) object, postOperationEnabled));
+                                       operations.add(new DeleteDescriptionElementOperation(label, undoContext, (DescriptionElementBase) object, postOperationEnabled, cdmEntitySessionEnabled));
                                }
                                else if(object instanceof FeatureNodeContainer){
                                        List<DescriptionElementBase> descriptions = ((FeatureNodeContainer) object).getDescriptionElementsForEntireBranch();
 
                                        for(DescriptionElementBase description : descriptions){
-                                               operations.add(new DeleteDescriptionElementOperation(label, undoContext, description, postOperationEnabled));
+                                               operations.add(new DeleteDescriptionElementOperation(label, undoContext, description, postOperationEnabled, cdmEntitySessionEnabled));
                                        }
                                }
                                // Media
index 3c1fee4fb25fe4fedafaefdb96797c876f3bb951..459cd29bba13a3a685e091e2a81ab968f240ca69 100644 (file)
@@ -26,10 +26,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.api.service.IDescriptionService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.model.common.Annotation;
-import eu.etaxonomy.cdm.model.common.AnnotationType;
 import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
@@ -58,9 +55,7 @@ import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
 public class MoveDescriptionElementsHandler extends AbstractHandler implements IPostOperationEnabled{
        private UUID newAcceptedTaxonNodeUuid;
        private TaxonNameEditor editor;
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-        */
+
        @Override
        public Object execute(ExecutionEvent event) throws ExecutionException {
 
@@ -93,22 +88,25 @@ public class MoveDescriptionElementsHandler extends AbstractHandler implements I
                        }
                        DescriptionBase description = elements.get(0).getInDescription();
                        List<UUID> excludeTaxa = new ArrayList<UUID>();
-                       if (description.isInstanceOf(TaxonDescription.class)){
+                       if (description!=null && description.isInstanceOf(TaxonDescription.class)){
                                TaxonDescription taxonDescription = HibernateProxyHelper.deproxy(description, TaxonDescription.class);
                                actualTaxon = taxonDescription.getTaxon();
                                excludeTaxa.add(actualTaxon.getUuid());
                        }
                        Classification classification = null;
+                       TaxonNode actualNode = null;
                        if (actualTaxon != null){
                            if (!actualTaxon.getTaxonNodes().isEmpty() && actualTaxon.getTaxonNodes().size() ==1){
-                               classification = actualTaxon.getTaxonNodes().iterator().next().getClassification();
+                               actualNode = actualTaxon.getTaxonNodes().iterator().next();
+                               classification = actualNode.getClassification();
+
                            }
                        }
                        TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event),
                                        editor.getConversationHolder(),
                                        "Choose the accepted taxon",
                                        excludeTaxa,
-                                       null,classification
+                                       null, classification
                                        );
                        if (newAcceptedTaxonNode != null){
                        Taxon targetTaxon = newAcceptedTaxonNode.getTaxon();
@@ -118,19 +116,15 @@ public class MoveDescriptionElementsHandler extends AbstractHandler implements I
                                return null;
                        }
                        newAcceptedTaxonNodeUuid = newAcceptedTaxonNode.getUuid();
-                       TaxonDescription targetDescription = TaxonDescription.NewInstance(targetTaxon);
+
                        String moveMessage = String.format("Elements moved from %s", EditorUtil.getActiveMultiPageTaxonEditor().getTaxon());
-                       targetDescription.setTitleCache(moveMessage, true);
-                       Annotation annotation = Annotation.NewInstance(moveMessage, Language.getDefaultLanguage());
-                       annotation.setAnnotationType(AnnotationType.TECHNICAL());
-                       targetDescription.addAnnotation(annotation);
 
                        try {
                                AbstractPostOperation operation = new MoveDescriptionElementsOperation(
                                                event.getCommand().getName(), EditorUtil.getUndoContext(),
-                                               targetDescription, elements, false, this);
+                                               targetTaxon.getUuid(), moveMessage, elements, false, this);
 
-                               EditorUtil.executeOperation(operation);
+                               AbstractUtility.executeOperation(operation);
 
                                //CdmStore.getService(ITaxonService.class).saveOrUpdate(targetTaxon);
 
@@ -143,9 +137,6 @@ public class MoveDescriptionElementsHandler extends AbstractHandler implements I
                return null;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.operations.IPostOperationEnabled#postOperation(eu.etaxonomy.cdm.model.common.CdmBase)
-        */
        /** {@inheritDoc} */
        @Override
     public boolean postOperation(CdmBase objectAffectedByOperation) {
@@ -180,7 +171,6 @@ public class MoveDescriptionElementsHandler extends AbstractHandler implements I
 
        @Override
        public boolean onComplete() {
-               // TODO Auto-generated method stub
                return false;
        }
 
index c4b57e9cb4629968822bd35d951b0bbb9c407a00..c51d0ee05057162159b7c88b79b87eb7e48262cb 100644 (file)
@@ -12,6 +12,7 @@ import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.swt.widgets.Display;
@@ -22,16 +23,17 @@ import eu.etaxonomy.cdm.api.service.IDescriptionService;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
-import eu.etaxonomy.taxeditor.editor.Page;
-import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
+import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionToOtherTaxonOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
 
@@ -50,7 +52,7 @@ public class MoveDescriptionToOtherTaxonHandler extends AbstractHandler
        private MoveDescriptionToOtherTaxonOperation operation;
 
        private UUID newAcceptedTaxonNodeUuid;
-       private TaxonNameEditor editor;
+       private MultiPageTaxonEditor editor;
 
        /* (non-Javadoc)
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
@@ -60,6 +62,18 @@ public class MoveDescriptionToOtherTaxonHandler extends AbstractHandler
     public Object execute(ExecutionEvent event) throws ExecutionException {
 
                ISelection selection = HandlerUtil.getCurrentSelection(event);
+               editor = EditorUtil.getActiveMultiPageTaxonEditor();
+               if (this.editor.isDirty()){
+                   boolean proceed = MessageDialog.openQuestion(null,
+                          "Save changes", "You have made changes that must be saved before this query can be executed. Would you like to proceed?");
+               if (proceed) {
+                   editor.doSave(EditorUtil.getMonitor());
+               } else {
+                   return null;
+               }
+
+               }
+
 
                if(selection instanceof IStructuredSelection){
 
@@ -74,7 +88,7 @@ public class MoveDescriptionToOtherTaxonHandler extends AbstractHandler
                                }       else if (element instanceof DescriptionBase){
                                        uuid = ((DescriptionBase)element).getUuid();
                                }
-                               
+
                                if (uuid != null){
                                        descriptions.add((TaxonDescription) CdmStore.getService(IDescriptionService.class).load(uuid, null));
                                }
@@ -85,14 +99,24 @@ public class MoveDescriptionToOtherTaxonHandler extends AbstractHandler
 
                        // Choose the target taxon
                        List<UUID> excludeTaxa = new ArrayList<UUID>();
-                       editor = (TaxonNameEditor) EditorUtil.getActiveEditorPage(Page.NAME);
+
+
                        excludeTaxa.add(descriptions.get(0).getTaxon().getUuid());
+
+                       //get current taxon node
+                       TaxonNode node = null;
+                       Classification classification = null;
+                       MultiPageTaxonEditor taxonEditor = EditorUtil.getActiveMultiPageTaxonEditor();
+            if(taxonEditor!=null){
+                node = ((TaxonEditorInput) taxonEditor.getEditorInput()).getTaxonNode();
+                classification = node.getClassification();
+            }
                        TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event),
                                        editor.getConversationHolder(),
                                        "Choose the accepted taxon",
                                        excludeTaxa,
-                                       null,
-                                       null);
+                                       node,
+                                       classification);
 
                        if (newAcceptedTaxonNode == null) {
                                return null;
@@ -103,7 +127,12 @@ public class MoveDescriptionToOtherTaxonHandler extends AbstractHandler
                        try {
                                for(TaxonDescription description : descriptions){
                                        operation = new MoveDescriptionToOtherTaxonOperation(event.getCommand().getName(),
-                                                                                       editor.getUndoContext(), description, newAcceptedTaxonNode, this, editor);
+                                                                                       editor.getUndoContext(),
+                                                                                       description,
+                                                                                       newAcceptedTaxonNode,
+                                                                                       this,
+                                                                                       editor,
+                                                                                       (ICdmEntitySessionEnabled)editor.getEditorInput());
                                        AbstractUtility.executeOperation(operation);
                                }
 
@@ -126,7 +155,7 @@ public class MoveDescriptionToOtherTaxonHandler extends AbstractHandler
 
                        @Override
             public void run() {
-                               AbstractUtility.close(editor.getMultiPageTaxonEditor());
+                               AbstractUtility.close(editor);
 
                                try {
                                        MultiPageTaxonEditor possibleOpenEditor = (MultiPageTaxonEditor) EditorUtil.findEditorByTaxonNodeUuid(newAcceptedTaxonNodeUuid);
index ed86d4b2b6a9dc7d0590651fcb48f6d0d89a3821..0c5ded96a98fc79da8af76b361dd185c23175a6a 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -20,6 +20,7 @@ import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 
 /**
  * <p>DeleteDescriptionElementOperation class.</p>
@@ -29,8 +30,8 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
  * @version 1.0
  */
 public class DeleteDescriptionElementOperation extends AbstractPostTaxonOperation {
-       
-       private DescriptionElementBase element;
+
+       private final DescriptionElementBase element;
        private DescriptionBase description = null;
 
        /**
@@ -42,9 +43,10 @@ public class DeleteDescriptionElementOperation extends AbstractPostTaxonOperatio
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
         */
        public DeleteDescriptionElementOperation(String label, IUndoContext undoContext,
-                       DescriptionElementBase element, IPostOperationEnabled postOperationEnabled) {
-               super(label, undoContext, postOperationEnabled);
-               
+                       DescriptionElementBase element, IPostOperationEnabled postOperationEnabled,
+                       ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, postOperationEnabled, cdmEntitySessionEnabled);
+
                this.element = element;
        }
 
@@ -55,11 +57,11 @@ public class DeleteDescriptionElementOperation extends AbstractPostTaxonOperatio
        @Override
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
-               
+
                description = element.getInDescription();
-               
+
                monitor.worked(20);
-               
+
                // Remove element from description
                if (description == null) {
                        MessagingUtils.error(this.getClass(), "Couldn't find element's description!", null);
@@ -91,7 +93,7 @@ public class DeleteDescriptionElementOperation extends AbstractPostTaxonOperatio
                        throws ExecutionException {
 
                description.addElement(element);
-               
+
                return postExecute(element);
        }
 }
index 6b5b7f6ecd5c9f38985d63d553823499d89999b5..4f2a465509a71327322ac7fef6760b65b80bf8e2 100644 (file)
@@ -20,6 +20,7 @@ import eu.etaxonomy.cdm.model.description.SpecimenDescription;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -32,9 +33,12 @@ public class DeleteSpecimenDescriptionOperation extends AbstractPostOperation<Sp
 
        private final SpecimenDescription description;
 
-       public DeleteSpecimenDescriptionOperation(String label, IUndoContext undoContext,
-               SpecimenDescription description, IPostOperationEnabled postOperationEnabled) {
-               super(label, undoContext, description.getDescribedSpecimenOrObservation(), postOperationEnabled);
+       public DeleteSpecimenDescriptionOperation(String label,
+               IUndoContext undoContext,
+               SpecimenDescription description,
+               IPostOperationEnabled postOperationEnabled,
+               ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, description.getDescribedSpecimenOrObservation(), postOperationEnabled, cdmEntitySessionEnabled);
                this.description = description;
        }
 
index 5a6cebd41ada0fb17b00e2184025bbf119f9adbc..4c87ecca134ea7fb30df7a71bfec462e6ae63203 100644 (file)
@@ -9,9 +9,6 @@
 
 package eu.etaxonomy.taxeditor.editor.view.descriptive.operation;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.operations.IUndoContext;
 import org.eclipse.core.runtime.IAdaptable;
@@ -22,6 +19,7 @@ import eu.etaxonomy.cdm.api.service.IDescriptionService;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -44,9 +42,12 @@ public class DeleteTaxonDescriptionOperation extends AbstractPostTaxonOperation
         * @param description a {@link eu.etaxonomy.cdm.model.description.TaxonDescription} object.
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
         */
-       public DeleteTaxonDescriptionOperation(String label, IUndoContext undoContext,
-                       TaxonDescription description, IPostOperationEnabled postOperationEnabled) {
-               super(label, undoContext, postOperationEnabled);
+       public DeleteTaxonDescriptionOperation(String label,
+               IUndoContext undoContext,
+                       TaxonDescription description,
+                       IPostOperationEnabled postOperationEnabled,
+                       ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, postOperationEnabled, cdmEntitySessionEnabled);
 
                this.description = description;
                element = description.getTaxon();
@@ -62,14 +63,11 @@ public class DeleteTaxonDescriptionOperation extends AbstractPostTaxonOperation
 
                monitor.worked(20);
                if (description != null){
-                       List<String> propertyPaths = new ArrayList<String>();
-                       propertyPaths.add("taxon");
-                       TaxonDescription loadedDescription = (TaxonDescription) CdmStore.getService(IDescriptionService.class).load(description.getUuid(), propertyPaths);
-                       CdmStore.getService(IDescriptionService.class).deleteDescription(loadedDescription);
+                   CdmStore.getService(IDescriptionService.class).deleteDescription(description.getUuid());
                        return postExecute(description);
                }
                return null;
-               
+
        }
 
        /* (non-Javadoc)
index fd74d72745e6dc55a6ef9ba1e3f7b74ca6c2f8d1..d2f26b6dff050bcea0368b88d3f95175067b5b54 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 package eu.etaxonomy.taxeditor.editor.view.descriptive.operation;
 
 import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.UUID;
 
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.operations.IUndoContext;
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PartInitException;
 
 import eu.etaxonomy.cdm.api.service.IDescriptionService;
-import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -42,10 +39,12 @@ public class MoveDescriptionElementsOperation extends AbstractPostTaxonOperation
        private Collection<DescriptionElementBase> descriptionElements;
        private DescriptionBase targetDescription;
        private IDescriptionService service;
+       private UUID targetTaxonUuid;
+       private String moveMessage;
        private boolean isCopy;
 
        /**
-        * 
+        *
         * @param label
         * @param undoContext
         * @param targetDescription
@@ -54,28 +53,50 @@ public class MoveDescriptionElementsOperation extends AbstractPostTaxonOperation
         * @param postOperationEnabled
         */
        public MoveDescriptionElementsOperation(String label,
-                       IUndoContext undoContext, DescriptionBase targetDescription, 
+                       IUndoContext undoContext, DescriptionBase targetDescription,
                        Collection<DescriptionElementBase> descriptionElements, boolean isCopy,
                        IPostOperationEnabled postOperationEnabled) {
                super(label, undoContext, postOperationEnabled);
                this.targetDescription = targetDescription;
                this.descriptionElements = descriptionElements;
                this.isCopy = isCopy;
-               
+
                service = CdmStore.getService(IDescriptionService.class);
        }
 
+       public MoveDescriptionElementsOperation(String label,
+               IUndoContext undoContext, UUID targetTaxonUuid,String moveMessage,
+               Collection<DescriptionElementBase> descriptionElements, boolean isCopy,
+               IPostOperationEnabled postOperationEnabled) {
+           super(label, undoContext, postOperationEnabled);
+           this.targetTaxonUuid = targetTaxonUuid;
+           this.descriptionElements = descriptionElements;
+           this.moveMessage = moveMessage;
+           this.isCopy = isCopy;
+
+           service = CdmStore.getService(IDescriptionService.class);
+       }
+
        /* (non-Javadoc)
         * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
         */
        @Override
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
-               
-               
-               service.moveDescriptionElementsToDescription(descriptionElements, targetDescription, isCopy);
-               
-               
+
+               Set<UUID> descriptionElementsUuid = new HashSet<UUID>();
+               for(DescriptionElementBase deBase : descriptionElements) {
+                   descriptionElementsUuid.add(deBase.getUuid());
+               }
+               UpdateResult result; 
+               if(targetDescription == null){
+                       result = service.moveDescriptionElementsToDescription(descriptionElementsUuid, targetTaxonUuid, moveMessage, isCopy);
+
+               } else {
+                   UUID targetDescriptionUuid = targetDescription.getUuid();
+                   result = service.moveDescriptionElementsToDescription(descriptionElementsUuid, targetDescriptionUuid, isCopy);
+                   
+               }
                return postExecute(targetDescription);
        }
 
@@ -98,7 +119,7 @@ public class MoveDescriptionElementsOperation extends AbstractPostTaxonOperation
                // TODO Auto-generated method stub
                return null;
        }
-       
-       
+
+
 
 }
index 8ab3fe60b5235e890a0223edc1650b4aa5361ad5..588ef9d1c22bc2384abd76f2c6172cca532dd4bc 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -17,6 +17,8 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IDescriptionService;
 import eu.etaxonomy.cdm.model.common.Annotation;
@@ -27,6 +29,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -37,11 +40,11 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class MoveDescriptionToOtherTaxonOperation extends
                AbstractPersistentPostOperation {
-       
-       private TaxonNode newAcceptedTaxonNode;
 
-       private TaxonDescription description;
-       
+       private final TaxonNode newAcceptedTaxonNode;
+
+       private final TaxonDescription description;
+
        /**
         * <p>Constructor for ChangeAcceptedTaxonToSynonymOperation.</p>
         *
@@ -53,9 +56,13 @@ public class MoveDescriptionToOtherTaxonOperation extends
         * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
        public MoveDescriptionToOtherTaxonOperation(String label,
-                       IUndoContext undoContext, TaxonDescription description, TaxonNode targetTaxonNode,
-                       IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled) {
-               super(label, undoContext, postOperationEnabled, conversationEnabled); // FIXME is this the right constructor ???
+                       IUndoContext undoContext,
+                       TaxonDescription description,
+                       TaxonNode targetTaxonNode,
+                       IPostOperationEnabled postOperationEnabled,
+                       IConversationEnabled conversationEnabled,
+            ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled); // FIXME is this the right constructor ???
                this.description = description;
                this.newAcceptedTaxonNode = targetTaxonNode;
        }
@@ -71,7 +78,7 @@ public class MoveDescriptionToOtherTaxonOperation extends
 
                monitor.worked(20);
                bind();
-               
+
                String moveMessage = String.format("Description moved from %s", EditorUtil.getActiveMultiPageTaxonEditor().getTaxon());
                if(description.isProtectedTitleCache()){
                        String separator = "";
@@ -84,9 +91,15 @@ public class MoveDescriptionToOtherTaxonOperation extends
                annotation.setAnnotationType(AnnotationType.TECHNICAL());
                description.addAnnotation(annotation);
                newAcceptedTaxonNode.getTaxon().addDescription(description);
-               CdmStore.getService(IDescriptionService.class).saveOrUpdate(description);       
+               if (CdmApplicationState.getCurrentAppConfig() instanceof CdmApplicationRemoteController) {
+            CdmStore.getService(IDescriptionService.class).merge(description, true);
+        } else {
+            CdmStore.getService(IDescriptionService.class).saveOrUpdate(description);
+        }
+
+       //      CdmStore.getService(IDescriptionService.class).moveTaxonDescription(description.getUuid(), newAcceptedTaxonNode.getTaxon().getUuid());
                monitor.worked(40);
-        
+
                return postExecute(description);
        }
 
index f3c171437b0dbc43a0d7a84bba5871bb49badb24..331526d40397a50d0d24cd73c10560d87031aced 100644 (file)
@@ -23,41 +23,34 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchActionConstants;
 import org.eclipse.ui.IWorkbenchPart;
 
+import eu.etaxonomy.cdm.model.description.IDescribable;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
-import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
+import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.IPartContentHasMedia;
 import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
 import eu.etaxonomy.taxeditor.view.detail.DetailsViewPart;
 import eu.etaxonomy.taxeditor.view.supplementaldata.SupplementalDataViewPart;
 
 /**
- * <p>MediaViewPart class.</p>
- *
  * @author n.hoffmann
  * @created Jun 15, 2010
  * @version 1.0
  */
 public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartContentHasDetails, IPartContentHasSupplementalData {
 
-       /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.view.medi"{trunked}</code> */
        public static final String ID = "eu.etaxonomy.taxeditor.editor.view.media";
 
 
        private TreeViewer viewer;
 
-       /*
-        * (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createViewer(org.eclipse.swt.widgets.Composite)
-        */
        /** {@inheritDoc} */
        @Override
        public void createViewer(Composite parent) {
@@ -83,9 +76,6 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
 
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#getInitialSelection()
-        */
        /** {@inheritDoc} */
        @Override
        protected ISelection getInitialSelection() {
@@ -107,31 +97,28 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
                        return;
                }
 
-        if(part instanceof DetailsViewPart || part instanceof SupplementalDataViewPart){
-            // do not show empty page as these views are also used to edit the description selected in this view
+        if (part instanceof DetailsViewPart || part instanceof SupplementalDataViewPart
+                || part instanceof DescriptiveViewPart) {
+            // do not show empty page as these views are also used to edit the
+            // description selected in this view
             return;
         }
 
                if(part instanceof IPartContentHasMedia && ((IPartContentHasMedia) part).canAttachMedia()){
-                   if(part instanceof MultiPageTaxonEditor){
-                       IEditorInput input = ((IEditorPart) part).getEditorInput();
-                       showViewer(part, new StructuredSelection(input));
-                   }
-                   else if(selection instanceof IStructuredSelection){
+                   if(selection instanceof IStructuredSelection){
                        Object firstElement = ((IStructuredSelection) selection).getFirstElement();
                        if(firstElement instanceof TreeNode){
                            showViewer(part, new StructuredSelection(((TreeNode) firstElement).getValue()));
+                           return;
                        }
-                       else{
+                       else if(firstElement!=null
+                           && firstElement instanceof IDescribable<?>){
                            showViewer(part, (IStructuredSelection) selection);
+                           return;
                        }
-                   }else{
-                       showEmptyPage();
                    }
                }
-               else{
-                   showEmptyPage();
-               }
+               showEmptyPage();
        }
 
        /** {@inheritDoc} */
@@ -148,6 +135,10 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
            // take a look at ISaveblePart
            if(part instanceof BulkEditor && !(object instanceof SpecimenOrObservationBase<?>)){
                ((BulkEditor) part).forceDirty();
+               if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                IStructuredSelection selection = (IStructuredSelection) ((BulkEditor) part).getSelectionProvider().getSelection();
+                ((BulkEditor) part).changed(selection.getFirstElement());
+            }
            }
            super.changed(object);
        }
@@ -158,11 +149,6 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
                return viewer;
        }
 
-       /**
-        * <p>onComplete</p>
-        *
-        * @return a boolean.
-        */
        @Override
     public boolean onComplete() {
                return true;
index 4664282982638f122139ec308f039423d4e558e3..894440b0bbc64a74154b1d2734829c18456591e1 100644 (file)
@@ -7,28 +7,16 @@ import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeNode;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
-import eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
-import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.AddDerivedUnitFacadeMediaOperation;
-import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateSpecimenDescriptionOperation;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateTaxonDescriptionOperation;
 import eu.etaxonomy.taxeditor.editor.view.media.MediaViewPart;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -37,89 +25,44 @@ import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
 /**
- * <p>AddImageGalleryHandler class.</p>
- *
  * @author p.ciardelli
  * @version $Id: $
  */
 public class AddImageGalleryHandler extends AbstractHandler {
 
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-        */
        /** {@inheritDoc} */
        @Override
     public Object execute(ExecutionEvent event) throws ExecutionException {
 
-               IWorkbenchPart part = HandlerUtil.getActivePart(event);
-               IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part : null;
+           IWorkbenchPart part = HandlerUtil.getActivePart(event);
+           IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part : null;
 
+           if(part instanceof MediaViewPart){
+               Object viewerInput = ((MediaViewPart)part).getViewer().getInput();
+               try {
+                   if(viewerInput instanceof CdmBase){
+                       if(((CdmBase) viewerInput).isInstanceOf(Taxon.class)){
+                           Taxon taxon = HibernateProxyHelper.deproxy(viewerInput, Taxon.class);
 
-               IEditorPart editor = HandlerUtil.getActiveEditor(event);
-               IEditorInput input = editor.getEditorInput();
+                           AbstractPostOperation<?> operation = new CreateTaxonDescriptionOperation(event.getCommand().getName(),
+                                   EditorUtil.getUndoContext(), taxon, postOperationEnabled, true);
 
-               if (input instanceof TaxonEditorInput) {
-                       Taxon taxon = ((TaxonEditorInput) input).getTaxon();
-                       AbstractPostOperation<?> operation;
-                       try {
-                               // TODO use undo context specific to editor
-                               operation = new CreateTaxonDescriptionOperation(event.getCommand().getName(),
-                                               EditorUtil.getUndoContext(), taxon, postOperationEnabled, true);
-                               AbstractUtility.executeOperation(operation);
-                       } catch (NotDefinedException e) {
-                               MessagingUtils.warn(getClass(), "Command name not set.");
-                       }
-               }
-               else if(input instanceof OccurrenceEditorInput){
-                   BulkEditor bulkEditor = (BulkEditor) editor;
-                   ISelection selection = bulkEditor.getSelectionProvider().getSelection();
-                   invokeOperation(event, postOperationEnabled, selection);
-               }
-               else if(input instanceof DerivateViewEditorInput){
-                   ISelection selection = ((DerivateView)editor).getSelection();
-                   invokeOperation(event, postOperationEnabled, selection);
-               } else if(part instanceof MediaViewPart){
-                   Object viewerInput = ((MediaViewPart)part).getViewer().getInput();
-                   
-                   if(viewerInput instanceof Taxon){
-                       Taxon taxon = HibernateProxyHelper.deproxy(viewerInput, Taxon.class);
-                       AbstractPostOperation<?> operation;
-                               try {
-                                       // TODO use undo context specific to editor
-                                       operation = new CreateTaxonDescriptionOperation(event.getCommand().getName(),
-                                                       EditorUtil.getUndoContext(), taxon, postOperationEnabled, true);
-                                       AbstractUtility.executeOperation(operation);
-                               } catch (NotDefinedException e) {
-                                       MessagingUtils.warn(getClass(), "Command name not set.");
-                               }
-                       
-                   }
-               }
-               
-               return null;
-       }
+                           AbstractUtility.executeOperation(operation);
+                       }
+                       else if(((CdmBase) viewerInput).isInstanceOf(SpecimenOrObservationBase.class)){
+                           SpecimenOrObservationBase<?> specimen = HibernateProxyHelper.deproxy(viewerInput, SpecimenOrObservationBase.class);
 
-    /**
-     * @param event
-     * @param postOperationEnabled
-     * @param selection
-     */
-    private void invokeOperation(ExecutionEvent event, IPostOperationEnabled postOperationEnabled, ISelection selection) {
-        if(selection instanceof IStructuredSelection){
-            Object element = ((IStructuredSelection) selection).getFirstElement();
-            if(element instanceof TreeNode){
-                element = ((TreeNode) element).getValue();
-            }
-            if(element instanceof SpecimenOrObservationBase<?>){
-                try {
-                    AbstractPostOperation<?> operation = new AddDerivedUnitFacadeMediaOperation(event.getCommand().getName(),
-                            BulkEditorUtil.getUndoContext(), (SpecimenOrObservationBase<?>)element, postOperationEnabled);
-                    AbstractUtility.executeOperation(operation);
-                } catch (NotDefinedException e) {
-                    MessagingUtils.warn(getClass(), "Command name not set.");
-                }
-            }
-        }
-    }
+                        AbstractPostOperation<?> operation = new AddDerivedUnitFacadeMediaOperation(event.getCommand().getName(),
+                                   BulkEditorUtil.getUndoContext(), specimen, postOperationEnabled);
+
+                           AbstractUtility.executeOperation(operation);
+                       }
+                   }
+               } catch (NotDefinedException e) {
+                   MessagingUtils.warn(getClass(), "Command name not set.");
+               }
+           }
+           return null;
+       }
 
-}
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/resources/log4j.properties b/eu.etaxonomy.taxeditor.editor/src/main/resources/log4j.properties
deleted file mode 100644 (file)
index 5f2aacc..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-### ************ APPENDER ***********************************###\r
-\r
-### direct log messages to stdout ###\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.Target=System.out\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n\r
-\r
-### direct messages to file hibernate.log ###\r
-log4j.appender.file=org.apache.log4j.FileAppender\r
-log4j.appender.file.File=taxeditor.log\r
-log4j.appender.file.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n\r
-\r
-### ************* LOG LEVELS *********************************###\r
-\r
-### set log levels - for more verbose logging change 'info' to 'debug' ###\r
-### levels: error, warn, debug, info\r
-log4j.rootLogger=INFO, stdout\r
-\r
-### set directory-specific levels below\r
-\r
-### basic level for editor directory\r
-log4j.logger.eu.etaxonomy.taxeditor.editor = WARN, stdout \r
-\r
-log4j.logger.eu.etaxonomy.taxeditor.editor.handler = DEBUG, stdout\r
-\r
-### log level for conversation handler\r
-#log4j.logger.eu.etaxonomy.cdm.api.application = DEBUG, stdout\r
-\r
-log4j.logger.org.springframework.orm.hibernate3 = WARN, stdout \r
-\r
-\r
index 39909f5cfc37f7d1a7f65024e98c61a99b3d6348..7f476f1d79f643f8b2b797b2097f0c9fb85b3a30 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -17,11 +17,9 @@ import org.junit.Test;
 
 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
 import eu.etaxonomy.cdm.model.name.NonViralName;
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInExistingHomotypicalGroupOperation;
 import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
 /**
@@ -31,115 +29,115 @@ import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBas
  */
 public class CreateSynonymInExisitingHomotypicalGroupOperationTest extends AbstractTaxeditorOperationTestBase {
 
-       private TaxonNameBase newSynonymName;
+       private NonViralName newSynonymName;
 
        private HomotypicalGroup homotypicalGroup;
 
 
        private NonViralName<?> taxonName;
-       
+
        /**
         * @throws java.lang.Exception
         */
        @Before
        public void setUp() throws Exception {
-               
+
                taxonName = NonViralName.NewInstance(null);
                taxon = Taxon.NewInstance(taxonName, null);
-               
+
                homotypicalGroup = HomotypicalGroup.NewInstance();
                newSynonymName = NonViralName.NewInstance(null);
-               
+
                operation = new CreateSynonymInExistingHomotypicalGroupOperation("Create Synonym In Existing Homotypical Group",
                                                        undoContext, taxon, homotypicalGroup, newSynonymName, postOperation);
        }
 
        /**
         * Test method for {@link eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInExistingHomotypicalGroupOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)}.
-        * 
+        *
         * Homotypic group is the Taxons homotypic group, so we expect the synonym to be homotypic to the accepted taxon.
-        * 
-        * @throws ExecutionException 
+        *
+        * @throws ExecutionException
         */
        @Test
-       public void testExecuteTaxonHomotypicGroup() throws ExecutionException {                
+       public void testExecuteTaxonHomotypicGroup() throws ExecutionException {
                homotypicalGroup.addTypifiedName(taxonName);
                operation.execute(monitor, info);
-               
+
                Assert.assertTrue("Taxon should have a synonym now.", taxon.getSynonyms().size() > 0);
                Assert.assertTrue("Taxon should have a homotypic synonym now", taxon.getHomotypicSynonymsByHomotypicGroup().size() > 0);
        }
-       
+
        /**
         * Test method for {@link eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInExistingHomotypicalGroupOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)}.
-        * 
+        *
         * Homotypic group is not the accepted taxons. Heterotypic synonym should be created.
-        * 
-        * @throws ExecutionException 
+        *
+        * @throws ExecutionException
         */
        @Test
-       public void testExecuteSynonymHomotypicGroup() throws ExecutionException {              
+       public void testExecuteSynonymHomotypicGroup() throws ExecutionException {
                // test heterotypic synonym
                operation.execute(monitor, info);
-               
+
                Assert.assertTrue("Taxon should have a synonym now.", taxon.getSynonyms().size() > 0);
                Assert.assertTrue("Taxon should have a homotypic group", taxon.getHomotypicSynonymyGroups().size() > 0);
                Assert.assertEquals("Synonym relationship should be heterotypic", SynonymRelationshipType.HETEROTYPIC_SYNONYM_OF(), taxon.getSynonymRelations().toArray(new SynonymRelationship[0])[0].getType());
        }
-       
+
 
        /**
         * Test method for {@link eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInExistingHomotypicalGroupOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)}.
-        * @throws ExecutionException 
+        * @throws ExecutionException
         */
        @Test
        public void testUndoTaxonHomotypicGroup() throws ExecutionException {
                homotypicalGroup.addTypifiedName(taxonName);
-               
+
                operation.execute(monitor, info);
                operation.undo(monitor, info);
-               
+
                Assert.assertTrue("There should not be synonym relationships for the taxon", taxon.getSynonyms().size() == 0);
        }
-       
+
        /**
         * Test method for {@link eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInExistingHomotypicalGroupOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)}.
-        * @throws ExecutionException 
+        * @throws ExecutionException
         */
        @Test
        public void testUndoSynonymHomotypicGroup() throws ExecutionException {
                operation.execute(monitor, info);
                operation.undo(monitor, info);
-               
+
                Assert.assertTrue("There should not be synonym relationships for the taxon", taxon.getSynonyms().size() == 0);
        }
 
        /**
         * Test method for {@link eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInExistingHomotypicalGroupOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)}.
-        * @throws ExecutionException 
+        * @throws ExecutionException
         */
        @Test
        public void testRedoTaxonHomotypicGroup() throws ExecutionException {
                homotypicalGroup.addTypifiedName(taxonName);
-               
+
                operation.execute(monitor, info);
-               operation.undo(monitor, info);          
+               operation.undo(monitor, info);
                operation.redo(monitor, info);
-               
+
                Assert.assertTrue("Taxon should have a synonym now.", taxon.getSynonyms().size() > 0);
                Assert.assertTrue("Taxon should have a homotypic synonym now", taxon.getHomotypicSynonymsByHomotypicGroup().size() > 0);
        }
-       
+
        /**
         * Test method for {@link eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInExistingHomotypicalGroupOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)}.
-        * @throws ExecutionException 
+        * @throws ExecutionException
         */
        @Test
        public void testRedoSynonymHomotypicGroup() throws ExecutionException {
                operation.execute(monitor, info);
-               operation.undo(monitor, info);          
+               operation.undo(monitor, info);
                operation.redo(monitor, info);
-               
+
                Assert.assertTrue("Taxon should have a synonym now.", taxon.getSynonyms().size() > 0);
                Assert.assertTrue("Taxon should have a homotypic group", taxon.getHomotypicSynonymyGroups().size() > 0);
                Assert.assertEquals("Synonym relationship should be heterotypic", SynonymRelationshipType.HETEROTYPIC_SYNONYM_OF(), taxon.getSynonymRelations().toArray(new SynonymRelationship[0])[0].getType());
index 1dc962c6cec7e27282f6eb41471cf9e948b6d969..f5dd35aec3689082225d10e63d8e4eb8c728e9b1 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -32,7 +32,7 @@ public class DeleteDescriptionElementOperationTest extends AbstractTaxeditorOper
        private static DescriptionElementBase descriptionElement;
 
        private static TaxonDescription description;
-       
+
        /**
         * @throws java.lang.Exception
         */
@@ -40,48 +40,48 @@ public class DeleteDescriptionElementOperationTest extends AbstractTaxeditorOper
        public static void setUpBeforeClass() throws Exception {
                taxon = Taxon.NewInstance(null, null);
                descriptionElement = TextData.NewInstance();
-               
+
                description = TaxonDescription.NewInstance();
-               
+
                description.addElement(descriptionElement);
-               
+
                taxon.addDescription(description);
-               
-               
-               operation = new DeleteDescriptionElementOperation("", undoContext, descriptionElement, postOperation);
+
+
+               operation = new DeleteDescriptionElementOperation("", undoContext, descriptionElement, postOperation, cdmEntitySessionEnabled);
        }
 
        /**
         * Test method for {@link eu.etaxonomy.taxeditor.editor.view.descriptive.operation.DeleteDescriptionElementOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)}.
-        * @throws ExecutionException 
+        * @throws ExecutionException
         */
        @Test
        public void testExecuteIProgressMonitorIAdaptable() throws ExecutionException {
                operation.execute(monitor, info);
-               
+
                Assert.assertTrue(taxon.getDescriptions().toArray(new TaxonDescription[0])[0].getElements().size() == 0);
        }
 
        /**
         * Test method for {@link eu.etaxonomy.taxeditor.editor.view.descriptive.operation.DeleteDescriptionElementOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)}.
-        * @throws ExecutionException 
+        * @throws ExecutionException
         */
        @Test
        public void testUndoIProgressMonitorIAdaptable() throws ExecutionException {
                operation.undo(monitor, info);
-               
+
                Assert.assertTrue(taxon.getDescriptions().toArray(new TaxonDescription[0])[0].getElements().size() > 0);
                Assert.assertEquals(descriptionElement, taxon.getDescriptions().toArray(new TaxonDescription[0])[0].getElements().toArray(new DescriptionElementBase[0])[0]);
        }
 
        /**
         * Test method for {@link eu.etaxonomy.taxeditor.editor.view.descriptive.operation.DeleteDescriptionElementOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)}.
-        * @throws ExecutionException 
+        * @throws ExecutionException
         */
        @Test
        public void testRedoIProgressMonitorIAdaptable() throws ExecutionException {
                operation.redo(monitor, info);
-               
+
                Assert.assertTrue(taxon.getDescriptions().toArray(new TaxonDescription[0])[0].getElements().size() == 0);
        }
 }
index 38e6e88611c9231c87dd096779b6df617cc2023d..4876aed8b27b14f089511498de0b536cbfe7e054 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -26,7 +26,6 @@ import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
 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.operation.SwapSynonymAndAcceptedOperation;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
@@ -38,7 +37,7 @@ import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBas
 public class SwapSynonymAndAcceptedOperationTest extends AbstractTaxeditorOperationTestBase {
        private static final Logger logger = Logger
                        .getLogger(SwapSynonymAndAcceptedOperationTest.class);
-       
+
        private static AbstractPostOperation operation;
 
        private static Taxon taxon;
@@ -65,19 +64,19 @@ public class SwapSynonymAndAcceptedOperationTest extends AbstractTaxeditorOperat
 
        private static NonViralName<?> oldTaxonName;
 
-       
+
        /**
         * @throws java.lang.Exception
         */
        @BeforeClass
        public static void setUpBeforeClass() throws Exception {
-               
+
                (new DefaultTermInitializer()).initialize();
-               
+
                // Create the original accepted taxon
                oldTaxonName = NonViralName.NewInstance(null);
                taxon = Taxon.NewInstance(oldTaxonName, null);
-               
+
                // Create its parent taxon
                parentTaxon = Taxon.NewInstance(NonViralName.NewInstance(null), null);
                parentTaxon.addTaxonomicChild(taxon, null, null);
@@ -85,14 +84,14 @@ public class SwapSynonymAndAcceptedOperationTest extends AbstractTaxeditorOperat
                // Give it a child taxon
                childTaxon = Taxon.NewInstance(NonViralName.NewInstance(null), null);
                childTaxon.setTaxonomicParent(taxon, null, null);
-               
+
                // Create a homotypic synonym for the accepted taxon
                taxon.addHomotypicSynonymName(NonViralName.NewInstance(null), null, null);
 //             homotypicSynonym = Synonym.NewInstance(NonViralName.NewInstance(null), null);
 //             HomotypicalGroup acceptedHomotypicalGroup = HomotypicalGroup.NewInstance();
 //             acceptedHomotypicalGroup.addTypifiedName(oldTaxon.getName());
 //             acceptedHomotypicalGroup.addTypifiedName(homotypicSynonym.getName());
-               
+
                // Create a heterotypic synonym that will be used to create the new accepted taxon
                oldSynonymName = NonViralName.NewInstance(null);
                oldHeterotypicSynonym = Synonym.NewInstance(oldSynonymName, null);
@@ -100,51 +99,51 @@ public class SwapSynonymAndAcceptedOperationTest extends AbstractTaxeditorOperat
                heteroypicalGroup = HomotypicalGroup.NewInstance();
                heteroypicalGroup.addTypifiedName(oldHeterotypicSynonym.getName());
                taxon.addSynonym(oldHeterotypicSynonym, SynonymRelationshipType.HETEROTYPIC_SYNONYM_OF());
-               
+
                // Create a misapplication
                misapplication = Taxon.NewInstance(NonViralName.NewInstance(null), null);
-               taxon.addMisappliedName(misapplication, null, null);    
-               
+               taxon.addMisappliedName(misapplication, null, null);
+
                // Create a concept relation
                concept = Taxon.NewInstance(NonViralName.NewInstance(null), null);
                conceptRelationshipType = TaxonRelationshipType.CONGRUENT_TO();
-               concept.addTaxonRelation(taxon, conceptRelationshipType, null, null);   
-               
+               concept.addTaxonRelation(taxon, conceptRelationshipType, null, null);
+
                // Create a description
                description = TaxonDescription.NewInstance();
                taxon.addDescription(description);
-               
+
                operation = new SwapSynonymAndAcceptedOperation
-                               (null, undoContext, taxon, oldHeterotypicSynonym, postOperation);
+                               (null, undoContext, taxon, oldHeterotypicSynonym, postOperation, cdmEntitySessionEnabled);
        }
 
 
        /**
         * Test method for {@link eu.etaxonomy.taxeditor.editor.name.operation.ChangeHomotypicGroupOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)}.
-        * @throws ExecutionException 
+        * @throws ExecutionException
         */
        @Test
        public void testExecute() throws ExecutionException {
                operation.execute(null, null);
-               
-               // New taxon has correct name?          
+
+               // New taxon has correct name?
                Assert.assertEquals(taxon.getName(), oldSynonymName);
-               
+
                // New taxon has correct parent?
                Assert.assertEquals(taxon.getTaxonomicParent(), parentTaxon);
-               
+
                // New taxon has correct child?
                Assert.assertTrue(taxon.getTaxonomicChildren().contains(childTaxon));
-               
+
                // New taxon has 2 synonyms?
                Assert.assertEquals(taxon.getSynonyms().size(), 2);
-               
+
                // New taxon has a synonym with the name of the previous accepted taxon?
                Assert.assertTrue(taxon.getSynonymNames().contains(oldTaxonName));
-               
+
                // New taxon has misapplication?
                Assert.assertTrue(taxon.getMisappliedNames().contains(misapplication));
-               
+
                // New taxon has 1 concept relation?
                int conceptRelCount = 0;
                for (TaxonRelationship relation : taxon.getTaxonRelations()) {
@@ -155,30 +154,30 @@ public class SwapSynonymAndAcceptedOperationTest extends AbstractTaxeditorOperat
                        conceptRelCount++;
                }
                Assert.assertEquals(conceptRelCount, 1);
-               
+
                // New taxon has description?
                taxon.getDescriptions().contains(description);
        }
 
        /**
         * Test method for {@link eu.etaxonomy.taxeditor.editor.name.operation.ChangeHomotypicGroupOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)}.
-        * @throws ExecutionException 
+        * @throws ExecutionException
         */
        @Test
        public void testUndo() throws ExecutionException {
                operation.undo(null, null);
-               
+
 //             Assert.assertEquals(oldHomotypicalGroup, synonym.getHomotypicGroup());
        }
-       
+
        /**
         * Test method for {@link eu.etaxonomy.taxeditor.editor.name.operation.ChangeHomotypicGroupOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)}.
-        * @throws ExecutionException 
+        * @throws ExecutionException
         */
        @Test
        public void testRedo() throws ExecutionException {
                operation.redo(null, null);
-               
+
 //             Assert.assertEquals(newHomotypicalGroup, synonym.getHomotypicGroup());
        }
 
diff --git a/eu.etaxonomy.taxeditor.feature.jre.linux64/.gitignore b/eu.etaxonomy.taxeditor.feature.jre.linux64/.gitignore
new file mode 100644 (file)
index 0000000..b83d222
--- /dev/null
@@ -0,0 +1 @@
+/target/
diff --git a/eu.etaxonomy.taxeditor.feature.jre.linux64/.project b/eu.etaxonomy.taxeditor.feature.jre.linux64/.project
new file mode 100644 (file)
index 0000000..a4450e6
--- /dev/null
@@ -0,0 +1,24 @@
+<projectDescription>
+  <name>eu.etaxonomy.taxeditor.feature.jre.linux64</name>
+  <comment></comment>
+  <projects>
+    <project>eu.etaxonomy.taxeditor.application</project>
+    <project>eu.etaxonomy.taxeditor.bulkeditor</project>
+    <project>eu.etaxonomy.taxeditor.cdmlib</project>
+    <project>eu.etaxonomy.taxeditor.editor</project>
+    <project>eu.etaxonomy.taxeditor.feature.platform</project>
+    <project>eu.etaxonomy.taxeditor.navigation</project>
+    <project>eu.etaxonomy.taxeditor.printpublisher</project>
+    <project>eu.etaxonomy.taxeditor.store</project>
+  </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.pde.FeatureBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.FeatureNature</nature>
+       </natures>
+</projectDescription>
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.feature.jre.linux64/LICENSE.TXT b/eu.etaxonomy.taxeditor.feature.jre.linux64/LICENSE.TXT
new file mode 100644 (file)
index 0000000..e56def0
--- /dev/null
@@ -0,0 +1,4 @@
+The contents of this feature are subject to the Eclipse Public License Version 1.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at
+http://www.eclipse.org/legal/epl-v10.html
+
+Software distributed under the License is distributed on an &quot;AS IS&quot; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.feature.jre.linux64/build.properties b/eu.etaxonomy.taxeditor.feature.jre.linux64/build.properties
new file mode 100644 (file)
index 0000000..a8b2d4a
--- /dev/null
@@ -0,0 +1,3 @@
+bin.includes = feature.xml,\
+               p2.inf,\
+               jre/
diff --git a/eu.etaxonomy.taxeditor.feature.jre.linux64/feature.xml b/eu.etaxonomy.taxeditor.feature.jre.linux64/feature.xml
new file mode 100644 (file)
index 0000000..03e7840
--- /dev/null
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+      id="eu.etaxonomy.taxeditor.feature.jre.linux64"
+      label="Taxonomic Editor JRE Linux64"
+      version="4.0.0.qualifier"
+      provider-name="EDIT"
+      plugin="eu.etaxonomy.taxeditor.application"
+      os="linux"
+      ws="gtk"
+      arch="x86_64">
+
+   <description url="http://www.example.com/description">
+      [Enter Feature Description here.]
+   </description>
+
+   <copyright url="http://www.example.com/copyright">
+      [Enter Copyright Description here.]
+   </copyright>
+
+   <requires>
+      <import plugin="org.eclipse.ui"/>
+      <import plugin="org.eclipse.core.runtime"/>
+      <import plugin="org.eclipse.equinox.ds"/>
+      <import plugin="org.eclipse.equinox.util"/>
+      <import plugin="org.eclipse.equinox.p2.core"/>
+      <import plugin="org.eclipse.equinox.p2.ui"/>
+      <import plugin="org.eclipse.equinox.p2.ui.sdk"/>
+      <import plugin="org.eclipse.equinox.p2.updatechecker"/>
+      <import plugin="org.eclipse.equinox.p2.operations"/>
+      <import plugin="org.eclipse.equinox.app"/>
+      <import plugin="org.eclipse.osgi"/>
+      <import plugin="org.eclipse.ui.editors"/>
+      <import plugin="org.eclipse.core.expressions"/>
+      <import plugin="eu.etaxonomy.taxeditor.cdmlib" version="3.0.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.jface.text"/>
+      <import plugin="org.eclipse.ui.ide"/>
+      <import plugin="org.eclipse.ui.forms"/>
+      <import plugin="org.eclipse.core.databinding.beans"/>
+      <import plugin="org.eclipse.core.databinding.observable"/>
+      <import plugin="org.eclipse.core.resources"/>
+      <import plugin="org.eclipse.jface.databinding"/>
+      <import plugin="org.eclipse.ui.navigator"/>
+      <import plugin="org.eclipse.ui.navigator.resources"/>
+      <import plugin="org.eclipse.core.jobs"/>
+      <import plugin="org.eclipse.pde.runtime"/>
+      <import plugin="org.eclipse.core.commands"/>
+      <import plugin="org.eclipse.jface"/>
+      <import plugin="org.eclipse.swt"/>
+      <import plugin="org.eclipse.equinox.common" version="3.6.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.update.configurator"/>
+      <import plugin="org.eclipse.equinox.p2.publisher.eclipse"/>
+   </requires>
+
+</feature>
diff --git a/eu.etaxonomy.taxeditor.feature.jre.linux64/jre/test b/eu.etaxonomy.taxeditor.feature.jre.linux64/jre/test
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/eu.etaxonomy.taxeditor.feature.jre.linux64/p2.inf b/eu.etaxonomy.taxeditor.feature.jre.linux64/p2.inf
new file mode 100644 (file)
index 0000000..48251bc
--- /dev/null
@@ -0,0 +1,4 @@
+instructions.configure=\
+org.eclipse.equinox.p2.touchpoint.eclipse.setJvm(jvm:features/eu.etaxonomy.taxeditor.feature.jre.linux64_3.12.0/jre/bin);
+instructions.unconfigure=\
+org.eclipse.equinox.p2.touchpoint.eclipse.setJvm(jvm:null);
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.feature.jre.linux64/pom.xml b/eu.etaxonomy.taxeditor.feature.jre.linux64/pom.xml
new file mode 100644 (file)
index 0000000..9feab6e
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <parent>
+    <groupId>eu.etaxonomy</groupId>
+    <artifactId>taxeditor-parent</artifactId>
+    <version>4.0.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>eu.etaxonomy.taxeditor.feature.jre.linux64</artifactId>
+  <packaging>eclipse-feature</packaging>
+
+  <name>Taxonomic Editor Feature JRE Linux 64</name>
+  <description />
+  <url>http://dev.e-taxonomy.eu/trac/wiki/TaxonomicEditorEditorBundle</url>
+</project>
index e7506bdf237a45693d2180bf2895fc8e9a8a0aeb..01f73aa70fb1a108935b5cd2e63e0465e9856f8c 100644 (file)
@@ -2,7 +2,7 @@
 <feature
       id="eu.etaxonomy.taxeditor.feature.platform"
       label="Taxeditor Dependencies"
-      version="3.8.0.qualifier"
+      version="4.0.0.qualifier"
       os="linux,macosx,win32"
       ws="cocoa,gtk,win32"
       arch="x86,x86_64">
       <update label="EDIT Taxonomic Editor" url="http://wp5.e-taxonomy.eu/taxeditor/update"/>
    </url>
 
-   <plugin
-         id="com.ibm.icu"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
    <plugin
          id="org.eclipse.ant.core"
          download-size="0"
          version="0.0.0"
          unpack="false"/>
 
-   <plugin
-         id="org.sat4j.core"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.sat4j.pb"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
    <plugin
          id="org.eclipse.equinox.p2.metadata.repository"
          download-size="0"
          fragment="true"
          unpack="false"/>
 
-   <plugin
-         id="org.apache.lucene"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.apache.lucene.analysis"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
    <plugin
          id="org.eclipse.help.base"
          download-size="0"
          version="0.0.0"
          unpack="false"/>
 
-   <plugin
-         id="org.apache.lucene.core"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
    <plugin
          id="org.eclipse.equinox.jsp.jasper"
          download-size="0"
          version="0.0.0"
          unpack="false"/>
 
-   <plugin
-         id="org.apache.commons.httpclient"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.apache.httpcomponents.httpclient"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
    <plugin
          id="org.eclipse.ecf.provider.filetransfer.httpclient"
          download-size="0"
index 89384ec77a0122a29541acd408708fa5bbddf974..072d89c2cb698b32ddafca229d5a22f588d00da3 100644 (file)
@@ -3,7 +3,7 @@
        <parent>
                <groupId>eu.etaxonomy</groupId>
                <artifactId>taxeditor-parent</artifactId>
-               <version>3.8.0-SNAPSHOT</version>
+               <version>4.0.0-SNAPSHOT</version>
        </parent>
        <modelVersion>4.0.0</modelVersion>
        <artifactId>eu.etaxonomy.taxeditor.feature.platform</artifactId>
diff --git a/eu.etaxonomy.taxeditor.feature/README.txt b/eu.etaxonomy.taxeditor.feature/README.txt
deleted file mode 100644 (file)
index a4a2fdf..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-when updating the build.properties file make sure to apply the updates on both
-build.properties.with.jre and
-build.properties.wo.jre
index 421dda37b47695e7305d74400a71e3d3e1ac2a72..8ffba51568e2c70cc70dfbf79fdf49ed34b2b7bd 100644 (file)
@@ -8,4 +8,4 @@ root.win32.win32.x86_64.permissions.755=jre/bin/**
 root.win32.win32.x86=win-32
 root.win32.win32.x86.permissions.755=jre/bin/**
 root.macosx.cocoa.x86_64=mac-64
-root.macosx.cocoa.x86_64.permissions.755=jre/Contents/Home/jre/bin/**
\ No newline at end of file
+root.macosx.cocoa.x86_64.permissions.755=jre/Contents/Home/jre/bin/**
index 71062e2e8eab8ba742b7c768da36cf326977accb..37f412f3795102d73e4ef5243757a443fb53f529 100644 (file)
@@ -2,7 +2,7 @@
 <feature
       id="eu.etaxonomy.taxeditor.feature"
       label="Taxonomic Editor"
-      version="3.8.0.qualifier"
+      version="4.0.0.qualifier"
       provider-name="EDIT"
       plugin="eu.etaxonomy.taxeditor.application"
       os="linux,macosx,win32"
          version="0.0.0"
          unpack="false"/>
 
+   <plugin
+         id="eu.etaxonomy.taxeditor.webapp"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
 </feature>
index e75d41e1ab26b9b07c5e5a1bffb3b9817b67fa10..a48c7cf4fb814da825780ee4e607c1e6a717c109 100644 (file)
@@ -3,7 +3,7 @@
   <parent>
     <groupId>eu.etaxonomy</groupId>
     <artifactId>taxeditor-parent</artifactId>
-    <version>3.8.0-SNAPSHOT</version>
+    <version>4.0.0-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>eu.etaxonomy.taxeditor.feature</artifactId>
index 46c53338887a945b806e82ae7453bc7e9e747454..bcb633e0f217f6f4d37080116c3e4137c43e7fcd 100644 (file)
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
-       <classpathentry kind="src" path="src"/>\r
-       <classpathentry kind="output" path="target"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="output" path="target"/>
+</classpath>
index 09d99f6074f5d13455191684a99c870ded2b4742..56c40162f4bd0afab59d489c1fe1f0eeb0973584 100644 (file)
@@ -2,12 +2,12 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Help
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.help; singleton:=true
-Bundle-Version: 3.8.0.qualifier
+Bundle-Version: 4.0.0.qualifier
 Bundle-Activator: eu.etaxonomy.taxeditor.help.Activator
 Bundle-Vendor: EDIT
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
  org.eclipse.help.ui,
  org.eclipse.help.webapp
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
 Bundle-ActivationPolicy: lazy
index 6a4b52361d3573478da7fc876e320662d3272315..16683618be2ebae1f99985d87d0d42997f4e44f6 100644 (file)
@@ -3,7 +3,7 @@
        <parent>
                <groupId>eu.etaxonomy</groupId>
                <artifactId>taxeditor-parent</artifactId>
-               <version>3.8.0-SNAPSHOT</version>
+               <version>4.0.0-SNAPSHOT</version>
        </parent>
 
        <modelVersion>4.0.0</modelVersion>
index 1d66dd2b81568156878dbdd0d0e521fa9c2c49da..93500de9a57feca5a688defc652384d304870834 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry exported="true" kind="lib" path="lib/bioinfweb-commons-bio-2-SNAPSHOT.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/bioinfweb-commons-core-2-SNAPSHOT.jar"/>
index 3ee9c828b60a847b69207b75793900e1e9b5c4a2..e6c64f01682fa6d4900413d0f37a52de5acf256d 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: eu.etaxonomy.taxeditor.molecular.lib
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.molecular.lib;singleton:=true
-Bundle-Version: 3.8.0.qualifier
+Bundle-Version: 4.0.0.qualifier
 Bundle-ClassPath: .,
  lib/bioinfweb-commons-bio-2-SNAPSHOT.jar,
  lib/bioinfweb-commons-core-2-SNAPSHOT.jar,
@@ -162,3 +162,4 @@ Export-Package: info.bioinfweb.commons,
 Bundle-ActivationPolicy: lazy
 Import-Package: javax.swing
 Require-Bundle: org.eclipse.swt
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
index 5700ef85e5c9bdce5c2391835b30aba88b2240a9..730578b0df4557df9a20948baaa8a30ad0651da8 100644 (file)
@@ -7,7 +7,7 @@
   <parent>
     <groupId>eu.etaxonomy</groupId>
     <artifactId>taxeditor-parent</artifactId>
-    <version>3.8.0-SNAPSHOT</version>
+    <version>4.0.0-SNAPSHOT</version>
   </parent>
 
   <build>
                   timestamp</echo>
                 <move todir="./lib">
                   <fileset dir="./lib" />
-                  <mapper type="regexp"
-                    from="(^bioinfweb\-.*\-[0-9]-)[0-9.-]+(\.jar)" to="\1SNAPSHOT\2" />
+                  <mapper type="regexp" from="(^bioinfweb\-.*\-[0-9]-)[0-9.-]+(\.jar)" to="\1SNAPSHOT\2" />
                 </move>
                 <move todir="./lib">
                   <fileset dir="./lib" />
-                  <mapper type="regexp"
-                    from="(^libralign\-.*\-[0-9]-)[0-9.-]+(\.jar)" to="\1SNAPSHOT\2" />
+                  <mapper type="regexp" from="(^libralign\-.*\-[0-9]-)[0-9.-]+(\.jar)" to="\1SNAPSHOT\2" />
                 </move>
                 <move todir="./lib">
                   <fileset dir="./lib" />
-                  <mapper type="regexp"
-                    from="(^tic\-.*\-[0-9]-)[0-9.-]+(\.jar)" to="\1SNAPSHOT\2" />
+                  <mapper type="regexp" from="(^tic\-.*\-[0-9]-)[0-9.-]+(\.jar)" to="\1SNAPSHOT\2" />
                 </move>
                 <move todir="./lib">
                   <fileset dir="./lib" />
-                  <mapper type="regexp"
-                    from="(^core\-[0-9]\.[0-9]\.[0-9])(\.jar)" to="\1-SNAPSHOT\2" />
+                  <mapper type="regexp" from="(^core\-[0-9]\.[0-9]\.[0-9])(\.jar)" to="\1-SNAPSHOT\2" />
                 </move>
                 <move todir="./lib">
                   <fileset dir="./lib" />
-                  <mapper type="regexp"
-                    from="(^sequencing\-[0-9]\.[0-9]\.[0-9])(\.jar)" to="\1-SNAPSHOT\2" />
+                  <mapper type="regexp" from="(^sequencing\-[0-9]\.[0-9]\.[0-9])(\.jar)" to="\1-SNAPSHOT\2" />
                 </move>
               </target>
             </configuration>
index f14ba2c2e26a0591f2789a408011882ac75ed185..60dea2f68d1f381ff10da83942a19d76d08ab4e8 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry including="**/*.java" kind="src" path="src/main/java"/>
        <classpathentry kind="output" path="target/classes"/>
index 05dba64f189a6a8eeac1d30c54bd3e541a0f3c3d..2b9ee3480f927822a9e6b097340d6292260188e5 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Molecular Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.molecular;singleton:=true
-Bundle-Version: 3.8.0.qualifier
+Bundle-Version: 4.0.0.qualifier
 Bundle-Activator: eu.etaxonomy.taxeditor.molecular.TaxeditorMolecularPlugin
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
@@ -13,10 +13,9 @@ Require-Bundle: org.eclipse.ui,
  eu.etaxonomy.taxeditor.editor,
  eu.etaxonomy.taxeditor.store,
  eu.etaxonomy.taxeditor.molecular.lib
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
 Bundle-ActivationPolicy: lazy
 Bundle-Vendor: EDIT
 Export-Package: eu.etaxonomy.taxeditor.molecular,
  eu.etaxonomy.taxeditor.molecular.editor,
  eu.etaxonomy.taxeditor.molecular.handler
-Bundle-ClassPath: .
diff --git a/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/bundle.properties b/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/bundle.properties
new file mode 100644 (file)
index 0000000..06f7cf3
--- /dev/null
@@ -0,0 +1,21 @@
+#Properties file for eu.etaxonomy.taxeditor.molecular
+editor.ALIGNMENT_EDITOR = Alignment Editor
+view.PHEROGRAM_VIEW = Pherogram View
+command.EDIT_SEQUENCE = Edit Sequence
+command.name.SHOW_PHEROGRAM = Show Pherogram
+command.name.CUT_PHEROGRAM_LEFT = Cut pherogram left
+command.name.CUT_PHEROGRAM_RIGHT = Cut pherogram right
+command.name.REVERSE_COMPLEMENT_SELECTED_ROWS = Reverse complement selected rows
+command.name.CREATE_CONSENUS_SEQUENCE = (Re)create consensus sequence
+command.name.UPDATE_CONSENSUS_SEQUENCE = Update consensus sequence
+command.name.TOGGLE_SHOW_PROBABILITY_VALUES = Toggle show probability values
+command.name.TOGGLE_SHOW_BASE_CALL_LINES = Toggle show base call lines
+command.name.CHANGE_QUALITY_OUTPUT = Change quality output
+command.name.LOAD_PHEROGRAM = Load Pherogram
+command.name.TOGGLE_INSERT_OVERWRITE = Toggle insert/overwrite
+command.name.TOGGLE_LEFT_RIGHT_INSERTION = Toggle left/right insertion in base call sequence
+command.TOGGLE_INSERT_OVERWRITE = Toggle insert/overwrite
+menu.ALIGNMENT_EDITOR = Alignment Editor
+menu.label.PHEROGRAM_VIEW = Pherogram View
+command.label.EDIT_SEQUENCE = Edit Sequence
+command.label.SHOW_PHEROGRAM = Show Pherogram
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/bundle_de.properties b/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/bundle_de.properties
new file mode 100644 (file)
index 0000000..5903692
--- /dev/null
@@ -0,0 +1,21 @@
+#Properties file for eu.etaxonomy.taxeditor.molecular
+editor.ALIGNMENT_EDITOR = Alignment Editor
+view.PHEROGRAM_VIEW = PherogramView
+command.EDIT_SEQUENCE = Edit Sequence
+command.name.SHOW_PHEROGRAM = Show Pherogram
+command.name.CUT_PHEROGRAM_LEFT = Cut pherogram left
+command.name.CUT_PHEROGRAM_RIGHT = Cut pherogram right
+command.name.REVERSE_COMPLEMENT_SELECTED_ROWS = Reverse complement selected rows
+command.name.CREATE_CONSENUS_SEQUENCE = (Re)create consensus sequence
+command.name.UPDATE_CONSENSUS_SEQUENCE = Update consensus sequence
+command.name.TOGGLE_SHOW_PROBABILITY_VALUES = Toggle show probability values
+command.name.TOGGLE_SHOW_BASE_CALL_LINES = Toggle show base call lines
+command.name.CHANGE_QUALITY_OUTPUT = Change quality output
+command.name.LOAD_PHEROGRAM = Load Pherogram
+command.name.TOGGLE_INSERT_OVERWRITE = Toggle insert/overwrite
+command.name.TOGGLE_LEFT_RIGHT_INSERTION = Toggle left/right insertion in base call sequence
+command.TOGGLE_INSERT_OVERWRITE = Toggle insert/overwrite
+menu.ALIGNMENT_EDITOR = Alignment Editor
+menu.label.PHEROGRAM_VIEW = Pherogram View
+command.label.EDIT_SEQUENCE = Edit Sequence
+command.label.SHOW_PHEROGRAM = Show Pherogram
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin.properties b/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin.properties
deleted file mode 100644 (file)
index e2943e3..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-#Properties file for taxeditor-editor
-Bundle-Vendor.0 = EDIT
-Bundle-Name.0 = EDIT Taxonomic Editor - Editor Bundle
-command.name.17 = Set Basionym
-command.name.18 = Remove Basionym
-editor.name = Multipage Taxon Editor
-editor.name.0 = Taxon Name Editor
-editor.name.1 = Key
-editor.name.2 = Polytomous Key Graph Editor
-editor.name.3 = Polytomous Key List Editor
-editor.name.4 = Cdm Authority Editor
-editor.name.5 = Derivative View
-view.name = Factual Data
-view.name.0 = Uses
-view.name.1 = Media
-view.name.2 = Concept Relations
-view.name.3 = Concept Graph
-category.name = Taxonomic Editor
-command.label = Reference
-command.label.0 = Name
-command.label.1 = Team
-command.label.2 = Person
-command.label.3 = Specimen
-command.label.4 = Factual Data
-command.label.5 = Media
-command.label.6 = Concept
-command.label.7 = Concept Graph
-command.label.8 = Open Parent
-menu.label = New
-command.label.9 = Heterotypic Synonym
-command.label.10 = Homotypic Synonym
-command.label.11 = Synonym In Homotypical Group
-menu.label.0 = Change To
-command.label.12 = Accepted Taxon
-command.label.13 = Synonym
-command.label.14 = Misapplication
-command.label.15 = Delete
-command.label.16 = Delete All Empty Names
-command.label.17 = Swap Synonym With Accepted
-command.label.18 = Show Details
-command.label.19 = Save
-command.label.20 = New Node
-command.label.21 = Delete
-command.label.22 = Apply Layout
-command.label.23 = New Key Number
-command.label.24 = New Alternative
-command.label.25 = Refresh Nodes
-command.label.26 = Delete
-command.label.27 = New Factual Data
-menu.label.1 = New
-command.label.28 = Move Description to Taxon
-command.label.29 = Move Elements to Taxon
-command.label.30 = Delete
-command.label.31 = Save
-menu.label.2 = New Derivative
-command.label.32 = New Use
-command.label.33 = New Use Summary
-command.label.34 = New Use Record
-command.label.35 = Delete
-command.label.36 = Save
-command.label.37 = New Image Gallery
-command.label.38 = New Image
-command.label.39 = Move Image Up In List
-command.label.40 = Move Image Down In List
-command.label.41 = Delete
-command.label.42 = Save
-menu.label.3 = New
-command.label.43 = Open Related Concept
-command.label.44 = Delete
-command.label.45 = Edit Authorities
-extension.name = Name Commands
-category.name.0 = -- Name Editor
-command.name = Open Parent
-command.name.0 = Create Homotypic Synonym
-command.name.1 = Create Heterotypic Synonym
-command.name.2 = Create Synonym In Homotypical Group
-command.name.3 = Change To Synonym
-command.name.4 = Change To Accepted Taxon
-command.name.5 = Change To Misapplication
-command.name.6 = Swap Synonym With Accepted
-
-command.name.7 = Set Basionym / Original Combination
-command.name.8 = Remove Basionym / Original Combination
-command.name.9 = Delete All Empty Names
-category.name.1 = -- Factual
-command.name.10 = Create Description Element
-command.name.11 = New Description
-command.name.12 = Move Description Elements to Taxon
-command.name.13 = Move Description to Taxon
-category.name.2 = -- New Uses
-command.name.14 = New Use
-command.name.15 = New Use Summary
-command.name.16 = New Use Record
-category.name.3 = -- Media
-command.name.19 = Move Image Down In List
-command.name.20 = New Image Gallery
-command.name.21 = New Image
-command.name.22 = Move Image Up In List
-category.name.4 = -- New Entity
-command.name.23 = New Reference
-command.name.24 = New Name
-command.name.25 = New Team
-command.name.26 = New Person
-command.name.27 = New Specimen
-category.name.5 = -- Polytomous Keys
-command.name.28 = New Child Node
-command.name.29 = New Sibling Node
-command.name.30 = Refresh Node Numbering
-command.name.31 = Apply Layout
-category.name.6 = -- Concept Relations
-command.name.32 = Create Concept Relation
-command.name.33 = Open Related Concept
-category.name.7 = -- Group
-command.name.34 = Edit CDM Authorities
-command.name.35 = Open Derivative View
-scheme.description = The default key binding scheme for the Taxonomic Editor
-scheme.name = Taxonomic Editor Default Key Bindings
-editor.name.6 = Specimen Import Editor
-editor.name.7 = Gbif Import Editor
-editor.name.8 = Checklist Editor
-view.name.4 = Specimen Import
-view.name.5 = GBIF Specimen Import
-command.label.46 = Name
-command.label.47 = Reference
-command.label.48 = Datasource
-command.label.49 = Misapplication
-command.label.50 = Use Existing Image
-command.name.36 = Create Misapplication
-command.name.37 = Use Existing Image
-command.name.38 = Open Checklist Editor
-command.name.39 = New Datasource
-wizard.name = Specimen Search/Import
-wizard.description = Queries data provider for specimens with specified parameters.\nNote: Query results are currently limited to 100.
-command.name.40 = Validation
-view.name.6 = Validation
-marker.field.0 = Object Type
-marker.field.1 = Object
-marker.field.2 = Attribute
-marker.field.3 = Problematic Value
-marker.field.4 = Problem description
-marker.field.5 = Validator
-marker.field.6 = Entity Class
-marker.field.7 = Entity Id
-extension.name.0 = Validation Error
-command.label.51 = Open in Specimen Editor
-command.label.52 = Delete
-command.label.53 = Create Field Unit
-command.label.54 = Delete (with children)
-command.tooltip = Show Only Individuals Associations
-command.label.55 = Open Associated Specimens
-command.name.41 = Show Only Individual Associations
-command.name.42 = Open Taxon Editor
-command.name.43 = Create Field Unit
-command.name.44 = Deep Delete
-command.name.46 = Move Synonym (Homotypical Group) to another Accepted Taxon
-command.label.56 = Move Synonym (Homotypical Group) to another Accepted Taxon
-markerContentGenerator.name = Validation Problems Marker Generator
-command.name.45 = Delete
-command.name.47 = Delete
-commandParameter.name = taxonUUID
-Bundle-Name = Editor Bundle
-command.name.48 = delete
-command.name.49 = delete
-command.name.50 = delete
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin_de.properties b/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin_de.properties
deleted file mode 100644 (file)
index 8c098c3..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-# Properties file for taxeditor-editor
-Bundle-Vendor.0 = EDIT
-Bundle-Name.0 = EDIT Taxonomischer Editor - Editor Bundle
-command.name.17 = Setze Basionym
-command.name.18 = Entferne Basionym
-editor.name = Multipage Taxon Editor
-editor.name.0 = Editor Taxonname
-editor.name.1 = Bestimmungsschl\u00fcssel
-editor.name.2 = Polytomer Bestimmungsschl\u00fcssel Graph Editor
-editor.name.3 = Polytomer Bestimmungsschl\u00fcssel List Editor
-editor.name.4 = CDM Rechtemanagement
-editor.name.5 = Ansicht Derivate
-view.name = Faktendaten
-view.name.0 = Nutzung
-view.name.1 = Medien
-view.name.2 = Konzeptrelationen
-view.name.3 = Konzeptgraph
-category.name = Taxonomischer Editor
-command.label = Referenz
-command.label.0 = Name
-command.label.1 = Team
-command.label.2 = Person
-command.label.3 = Beleg
-command.label.4 = Faktendaten
-command.label.5 = Medien
-command.label.6 = Konzeptrelationen
-command.label.7 = Konzeptgraph
-command.label.8 = \u00d6ffne Parent
-menu.label = Neue
-command.label.9 = Heterotypisches Synonym
-command.label.10 = Homotypisches Synonym
-command.label.11 = Synonym in Homotypischer Gruppe
-menu.label.0 = \u00c4ndere zu
-command.label.12 = Akzeptiertes Taxon
-command.label.13 = Synonym
-command.label.14 = Misapplication
-command.label.15 = L\u00f6schen
-command.label.16 = L\u00f6sche alle leeren Namen
-command.label.17 = Tausche Synonym mit akzeptiertem Namen
-command.label.18 = Zeige Details
-command.label.19 = Speichern
-command.label.20 = Neue Knoten
-command.label.21 = L\u00f6schen
-command.label.22 = Wende Layout an
-command.label.23 = Neue Bestimmungsschl\u00fcsselnummer
-command.label.24 = Neue Alternative
-command.label.25 = Erneuere Knoten
-command.label.26 = L\u00f6schen
-command.label.27 = Neue Faktendaten
-menu.label.1 = Neue
-command.label.28 = Verschiebe Eigenschaften zu Taxon
-command.label.29 = Verschiebe Elemente zu Taxon
-command.label.30 = L\u00f6schen
-command.label.31 = Speichern
-menu.label.2 = Neue Derivate
-command.label.32 = Neue Nutzung
-command.label.33 = Neue Zusammenfassung
-command.label.34 = Neuer Nutzungsdatensatz
-command.label.35 = L\u00f6schen
-command.label.36 = Speichern
-command.label.37 = Neue Bildergalerie
-command.label.38 = Neues Bild
-command.label.39 = Bild nach oben
-command.label.40 = Bild nach unten
-command.label.41 = L\u00f6schen
-command.label.42 = Speichern
-menu.label.3 = Neue
-command.label.43 = \u00d6ffne verbundenes Konzept
-command.label.44 = L\u00f6schen
-command.label.45 = Bearbeite Rechte
-extension.name = Namensbefehle
-category.name.0 = -- Namenseditor
-command.name = \u00d6ffne Elter
-command.name.0 = Erstelle homotypisches Synonym
-command.name.1 = Erstelle heterotypisches Synonym
-command.name.2 = Erstelle Synonym in homotypischer Gruppe
-command.name.3 = \u00c4ndere zu Synonym
-command.name.4 = \u00c4ndere zu akzeptiertem Taxon
-command.name.5 = \u00c4ndere zu Misapplication
-command.name.6 = Tausche Synonym mit akzeptiertem Namen
-
-command.name.7 = Setze Basionym / Originalkombination
-command.name.8 = Entferne Basionym / Originalkombination
-command.name.9 = L\u00f6sche alle leeren Namen
-category.name.1 = -- Fakten
-command.name.10 = Erstelle Beschreibungselement
-command.name.11 = Neue Beschreibung
-command.name.12 = Bewege Beschreibungselement zu Taxon
-command.name.13 = Bewege Beschreibung zu Taxon
-category.name.2 = -- Neue Nutzung
-command.name.14 = Neue Nutzung
-command.name.15 = Neue Zusammenfassung
-command.name.16 = Neuer Nutzungsdatensatz
-category.name.3 = -- Media
-command.name.19 = Bewege Bild nach unten
-command.name.20 = Neue Bildergalerie
-command.name.21 = Neues Bild
-command.name.22 = Bewege Bild nach oben
-category.name.4 = -- Neue Entit\u00e4t
-command.name.23 = Neue Referenz
-command.name.24 = Neuer Name
-command.name.25 = Neues Team
-command.name.26 = Neue Person
-command.name.27 = Neuer Beleg
-category.name.5 = -- Polytomer Bestimmungsschl\u00fcssel
-command.name.28 = Neue Kinderknoten
-command.name.29 = Neuer Geschwisterknoten
-command.name.30 = Knotennummerierung aktualisieren
-command.name.31 = Layout anwenden
-category.name.6 = -- Konzeptbeziehungen
-command.name.32 = Erstelle Konzeptrelationen
-command.name.33 = \u00d6ffne verbundenes Konzept
-category.name.7 = -- Gruppe
-command.name.34 = Bearbeite CDM Rechte
-command.name.35 = \u00d6ffne Derivate Ansicht
-scheme.description = Die Standard Tastenkombinationsschema f\u00fcr den Taxonomischen Editor
-scheme.name = Taxonomic Editor Standard Tastenkombinationen
-editor.name.6 = Specimen Import Editor
-editor.name.7 = GBIF Import Editor
-editor.name.8 = Checklist Editor
-view.name.4 = Specimen Import
-view.name.5 = GBIF Specimen Import
-command.label.46 = Name
-command.label.47 = Referenz
-command.label.48 = Datenquelle
-command.label.49 = Misapplication
-command.label.50 = Benutze vorhandenes Bild
-command.name.36 = Erstelle Misapplication
-command.name.37 = Benutze vorhandenes Bild
-command.name.38 = \u00d6ffne Checklist Editor
-command.name.39 = Neue Datenquelle
-wizard.name = Specimen Suche/Import
-wizard.description = Sendet eine Anfrage mit den eingegebenen Parametern an den Datenprovider.\nHinweis: Die Anzahl der Anfrageergebnisse sind auf 100 begrenzt.
-command.name.40 = Validierung
-view.name.6 = Validierung
-marker.field.0 = Objekttyp
-marker.field.1 = Objekt
-marker.field.2 = Attribut
-marker.field.3 = Problematischer Wert
-marker.field.4 = Problembeschreibung
-marker.field.5 = Validierer
-marker.field.6 = Entit�tsklasse
-marker.field.7 = Entit�ts ID
-extension.name.0 = Validierungs-Fehler
-command.label.51 = \u00d6ffne Specimen-Editor
-command.label.52 = L\u00f6schen
-command.label.53 = Neue Field Unit
-command.label.54 = L\u00f6schen (mit Kindern)
-command.tooltip = Nur Individuals Associations anzeigen
-command.label.55 = \u00d6ffne zugeh\u00f6rige Specimens
-command.name.41 = Nur Individuals Associations anzeigen
-command.name.42 = \u00d6ffne Taxon Editor
-command.name.43 = Neue Field Unit
-command.name.44 = L\u00f6schen (mit Kindern)
-command.name.46 = Verschiebe Synonym(Homotypische Gruppe) zu neuem Akzeptierten Taxon
-command.label.56 = Verschiebe Synonym(Homotypische Gruppe) zu neuem Akzeptierten Taxon
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin_en.properties b/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin_en.properties
deleted file mode 100644 (file)
index 897175a..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-#Properties file for taxeditor-editor
-Bundle-Vendor.0 = EDIT
-Bundle-Name.0 = EDIT Taxonomic Editor - Editor Bundle
-command.name.17 = Set Basionym
-command.name.18 = Remove Basionym
-editor.name = Multipage Taxon Editor
-editor.name.0 = Taxon Name Editor
-editor.name.1 = Key
-editor.name.2 = Polytomous Key Graph Editor
-editor.name.3 = Polytomous Key List Editor
-editor.name.4 = Cdm Authority Editor
-editor.name.5 = Derivate View
-view.name = Factual Data
-view.name.0 = Uses
-view.name.1 = Media
-view.name.2 = Concept Relations
-view.name.3 = Concept Graph
-category.name = Taxonomic Editor
-command.label = Reference
-command.label.0 = Name
-command.label.1 = Team
-command.label.2 = Person
-command.label.3 = Specimen
-command.label.4 = Factual Data
-command.label.5 = Media
-command.label.6 = Concept
-command.label.7 = Concept Graph
-command.label.8 = Open Parent
-menu.label = New
-command.label.9 = Heterotypic Synonym
-command.label.10 = Homotypic Synonym
-command.label.11 = Synonym In Homotypical Group
-menu.label.0 = Change To
-command.label.12 = Accepted Taxon
-command.label.13 = Synonym
-command.label.14 = Misapplication
-command.label.15 = Delete
-command.label.16 = Delete All Empty Names
-command.label.17 = Swap Synonym With Accepted
-command.label.18 = Show Details
-command.label.19 = Save
-command.label.20 = New Node
-command.label.21 = Delete
-command.label.22 = Apply Layout
-command.label.23 = New Key Number
-command.label.24 = New Alternative
-command.label.25 = Refresh Nodes
-command.label.26 = Delete
-command.label.27 = New Factual Data
-menu.label.1 = New
-command.label.28 = Move Description to Taxon
-command.label.29 = Move Elements to Taxon
-command.label.30 = Delete
-command.label.31 = Save
-menu.label.2 = New Derivate
-command.label.32 = New Use
-command.label.33 = New Use Summary
-command.label.34 = New Use Record
-command.label.35 = Delete
-command.label.36 = Save
-command.label.37 = New Image Gallery
-command.label.38 = New Image
-command.label.39 = Move Image Up In List
-command.label.40 = Move Image Down In List
-command.label.41 = Delete
-command.label.42 = Save
-menu.label.3 = New
-command.label.43 = Open Related Concept
-command.label.44 = Delete
-command.label.45 = Edit Authorities
-extension.name = Name Commands
-category.name.0 = -- Name Editor
-command.name = Open Parent
-command.name.0 = Create Homotypic Synonym
-command.name.1 = Create Heterotypic Synonym
-command.name.2 = Create Synonym In Homotypical Group
-command.name.3 = Change To Synonym
-command.name.4 = Change To Accepted Taxon
-command.name.5 = Change To Misapplication
-command.name.6 = Swap Synonym With Accepted
-command.name.7 = Set Basionym / Original Combination
-command.name.8 = Remove Basionym / Original Combination
-command.name.9 = Delete All Empty Names
-category.name.1 = -- Factual
-command.name.10 = Create Description Element
-command.name.11 = New Description
-command.name.12 = Move Description Elements to Taxon
-command.name.13 = Move Description to Taxon
-category.name.2 = -- New Uses
-command.name.14 = New Use
-command.name.15 = New Use Summary
-command.name.16 = New Use Record
-category.name.3 = -- Media
-command.name.19 = Move Image Down In List
-command.name.20 = New Image Gallery
-command.name.21 = New Image
-command.name.22 = Move Image Up In List
-category.name.4 = -- New Entity
-command.name.23 = New Reference
-command.name.24 = New Name
-command.name.25 = New Team
-command.name.26 = New Person
-command.name.27 = New Specimen
-category.name.5 = -- Polytomous Keys
-command.name.28 = New Child Node
-command.name.29 = New Sibling Node
-command.name.30 = Refresh Node Numbering
-command.name.31 = Apply Layout
-category.name.6 = -- Concept Relations
-command.name.32 = Create Concept Relation
-command.name.33 = Open Related Concept
-category.name.7 = -- Group
-command.name.34 = Edit CDM Authorities
-command.name.35 = Open Derivate View
-scheme.description = The default key binding scheme for the Taxonomic Editor
-scheme.name = Taxonomic Editor Default Key Bindingseditor.name.6 = Specimen Import Editor
-editor.name.7 = Gbif Import Editor
-editor.name.8 = Checklist Editor
-view.name.4 = Specimen Import
-view.name.5 = GBIF Specimen Import
-command.label.46 = Name
-command.label.47 = Reference
-command.label.48 = Datasource
-command.label.49 = Misapplication
-command.label.50 = Use Existing Image
-command.name.36 = Create Misapplication
-command.name.37 = Use Existing Image
-command.name.38 = Open Checklist Editor
-command.name.39 = New Datasource
-wizard.name = Specimen Search/Import
-wizard.description = Queries data provider for specimens with specified parameters.\nNote: Query results are currently limited to 100.
-command.name.40 = Validation
-view.name.6 = Validation
-marker.field.0 = Object Type
-marker.field.1 = Object
-marker.field.2 = Attribute
-marker.field.3 = Problematic Value
-marker.field.4 = Problem description
-marker.field.5 = Validator
-marker.field.6 = Entity Class
-marker.field.7 = Entity Id
\ No newline at end of file
index bbd575d4f5967503855d575fe4720c91500e80f3..78b734fd1ad72db0d93c26f003d3331af3159af4 100644 (file)
@@ -7,7 +7,7 @@
             class="eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor"
             default="false"
             id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor"
-            name="Alignment Editor">
+            name="%editor.ALIGNMENT_EDITOR">
       </editor>
    </extension>
       <extension
@@ -16,7 +16,7 @@
                allowMultiple="true"
                class="eu.etaxonomy.taxeditor.molecular.editor.PherogramViewPart"
                id="eu.etaxonomy.taxeditor.molecular.PherogramView"
-               name="PherogramView"
+               name="%view.PHEROGRAM_VIEW"
                restorable="true">
          </view>
       </extension>
          <command
                defaultHandler="eu.etaxonomy.taxeditor.molecular.handler.EditSequenceHandler"
                id="eu.etaxonomy.taxeditor.molecular.editSequence"
-               name="Edit Sequence">
+               name="%command.EDIT_SEQUENCE">
          </command>
          <command
                defaultHandler="eu.etaxonomy.taxeditor.molecular.handler.ShowPherogramHandler"
                id="eu.etaxonomy.taxeditor.molecular.showPherogram"
-               name="Show Pherogram">
+               name="%command.name.SHOW_PHEROGRAM">
          </command>
          <command
                id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.cutPherogramLeft"
-               name="Cut pherogram left">
+               name="%command.name.CUT_PHEROGRAM_LEFT">
          </command>
          <command
                id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.cutPherogramRight"
-               name="Cut pherogram right">
+               name="%command.name.CUT_PHEROGRAM_RIGHT">
          </command>
          <command
                id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.reverseComplementRows"
-               name="Reverse complement selected rows">
+               name="%command.name.REVERSE_COMPLEMENT_SELECTED_ROWS">
          </command>
          <command
                id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.createConsensus"
-               name="(Re)create consensus sequence">
+               name="%command.name.CREATE_CONSENUS_SEQUENCE">
          </command>
          <command
                id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.updateConsensus"
-               name="Update consensus sequence">
+               name="%command.name.UPDATE_CONSENSUS_SEQUENCE">
          </command>
          <command
                id="eu.etaxonomy.taxeditor.molecular.pherogramComponent.toggleShowProbabilities"
-               name="Toggle show probability values">
+               name="%command.name.TOGGLE_SHOW_PROBABILITY_VALUES">
          </command>
          <command
                id="eu.etaxonomy.taxeditor.molecular.pherogramComponent.toggleShowBaseCallLines"
-               name="Toggle show base call lines">
+               name="%command.name.TOGGLE_SHOW_BASE_CALL_LINES">
          </command>
          <command
                id="eu.etaxonomy.taxeditor.molecular.pherogramComponent.changeQualityOutput"
-               name="Change quality output">
+               name="%command.name.CHANGE_QUALITY_OUTPUT">
          </command>
          <command
                id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.loadPherogram"
-               name="Load Pherogram">
+               name="%command.name.LOAD_PHEROGRAM">
          </command>
          <command
                id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.toggleInsertOverwrite"
-               name="Toggle insert/overwrite">
+               name="%command.name.TOGGLE_INSERT_OVERWRITE">
          </command>
          <command
                id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.toggleLeftRightInsertion"
-               name="Toggle left/right insertion in base call sequence">
+               name="%command.name.TOGGLE_LEFT_RIGHT_INSERTION">
          </command>
       </extension>
       <extension
@@ -85,7 +85,7 @@
                   id="eu.etaxonomy.taxeditor.molecular.alignmentToolbar">
                <command
                      commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.toggleInsertOverwrite"
-                     label="Toggle insert/overwrite"
+                     label="%command.TOGGLE_INSERT_OVERWRITE"
                      style="push">
                   <visibleWhen
                         checkEnabled="true">
                allPopups="false"
                locationURI="menu:org.eclipse.ui.main.menu">
             <menu
-                  label="Alignment Editor">
+                  label="%menu.ALIGNMENT_EDITOR">
                <command
                      commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.loadPherogram"
                      style="push">
                </visibleWhen>
             </menu>
             <menu
-                  label="Pherogram View">
+                  label="%menu.label.PHEROGRAM_VIEW">
                <command
                      commandId="eu.etaxonomy.taxeditor.molecular.pherogramComponent.changeQualityOutput"
                      style="push">
             </menu>
          </menuContribution>
          <menuContribution
-               locationURI="popup:eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView?before=eu.etaxonomy.taxeditor.editor.view.derivate.DerivateContextMenu">
+               locationURI="popup:eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView?before=eu.etaxonomy.taxeditor.editor.derivative.reuseSingleReadMenuItem">
+            <separator
+                  name="eu.etaxonomy.taxeditor.molecular.separator5"
+                  visible="true">
+            </separator>
             <command
                   commandId="eu.etaxonomy.taxeditor.molecular.editSequence"
-                  label="Edit Sequence"
+                  label="%command.label.EDIT_SEQUENCE"
                   style="push">
                <visibleWhen
                      checkEnabled="true">
             </command>
             <command
                   commandId="eu.etaxonomy.taxeditor.molecular.showPherogram"
-                  label="Show Pherogram"
+                  label="%command.label.SHOW_PHEROGRAM"
                   style="push">
                <visibleWhen
                      checkEnabled="true">
index 1e91c23b5485a8efa209b33091ba62c3f86c736f..4e5b97a953ca639b145caa3f8f262fcbb652b584 100644 (file)
@@ -1,10 +1,9 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
   <parent>
     <groupId>eu.etaxonomy</groupId>
     <artifactId>taxeditor-parent</artifactId>
-    <version>3.8.0-SNAPSHOT</version>
+    <version>4.0.0-SNAPSHOT</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
index 8afc0af98dd4e42f0d7ac43f785f31092cb67220..57608d5d8c04625d32347ba0502d6e59f8d5f471 100644 (file)
@@ -104,7 +104,7 @@ public class AlignmentEditor extends EditorPart {
        public static final String DEFAULT_READ_NAME_PREFIX = "Read ";
        public static final String CONSENSUS_NAME = "Consensus";
 
-       
+
     private final ConversationHolder conversationHolder;
        private final AlignmentModelChangeListener DIRTY_LISTENER = new AlignmentModelChangeListener() {
                                @Override
@@ -130,8 +130,8 @@ public class AlignmentEditor extends EditorPart {
                                }
                        };
        private final AlignmentEditorActionUpdater ACTION_UPDATER = new AlignmentEditorActionUpdater();
-       public final Clipboard CLIPBOARD = new Clipboard(Display.getCurrent());  //TODO Move to global EDITor class. 
-                       
+       public final Clipboard CLIPBOARD = new Clipboard(Display.getCurrent());  //TODO Move to global EDITor class.
+
 
     private MultipleAlignmentsContainer alignmentsContainer = null;
     private final Map<Integer, SingleReadAlignment> cdmMap = new TreeMap<Integer, SingleReadAlignment>();  //TODO Move this to ContigSequenceDataProvider
@@ -144,7 +144,7 @@ public class AlignmentEditor extends EditorPart {
        //conversationHolder = null;
     }
 
-    
+
     private void refreshToolbarElement(String id) {
                ICommandService commandService =
                                (ICommandService)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(ICommandService.class);
@@ -153,7 +153,7 @@ public class AlignmentEditor extends EditorPart {
                }
     }
 
-    
+
     private void registerEditSettingListener(MultipleAlignmentsContainer container) {
         container.getEditSettings().addListener(new EditSettingsListener() {
             @Override
@@ -195,7 +195,7 @@ public class AlignmentEditor extends EditorPart {
                return result;
        }
 
-    
+
     private AlignmentArea createConsensusHintArea(MultipleAlignmentsContainer container,
                AlignmentArea labeledArea) {
 
@@ -206,11 +206,11 @@ public class AlignmentEditor extends EditorPart {
                return result;
     }
 
-    
+
     private MultipleAlignmentsContainer getAlignmentsContainer() {
        if (alignmentsContainer == null) {
                alignmentsContainer = new MultipleAlignmentsContainer();
-               
+
                AlignmentAreaList list = alignmentsContainer.getAlignmentAreas();
                AlignmentArea readsArea = createEditableAlignmentArea(alignmentsContainer, true);
                readsArea.getSelection().addSelectionListener(ACTION_UPDATER);
@@ -220,27 +220,27 @@ public class AlignmentEditor extends EditorPart {
                editableConsensusArea.getSelection().addSelectionListener(ACTION_UPDATER);
                list.add(editableConsensusArea);  // Make sure COMSENSUS_AREA_INDEX is correct.
                list.add(createConsensusHintArea(alignmentsContainer, readsArea));
-               
+
                registerEditSettingListener(alignmentsContainer);
                }
                return alignmentsContainer;
        }
 
-    
+
     public AlignmentArea getReadsArea() {
        return getAlignmentsContainer().getAlignmentAreas().get(READS_AREA_INDEX);
     }
 
-    
+
     public AlignmentArea getEditableConsensusArea() {
        return getAlignmentsContainer().getAlignmentAreas().get(EDITABLE_CONSENSUS_AREA_INDEX);
     }
-    
-    
+
+
     /**
      * Checks whether {@link #getReadsArea()} or {@link #getEditableConsensusArea()} currently
-     * have the user focus and returns the according component. 
-     * 
+     * have the user focus and returns the according component.
+     *
      * @return either the reads or the consensus alignment area or {@code null} if none of these
      *         components is currently focused
      */
@@ -259,13 +259,13 @@ public class AlignmentEditor extends EditorPart {
                }
        }
     }
-    
-    
+
+
     /**
      * Checks whether the specified alignment area or one of its subcomponents currently has the
      * focus.
-     * 
-     * @param area the alignment area to be checked (Can only be {@link #getReadsArea()} or 
+     *
+     * @param area the alignment area to be checked (Can only be {@link #getReadsArea()} or
      *        {@link #getEditableConsensusArea()}.)
      * @return {@code true} if the specified component is focused and is either equal to
      *         {@link #getReadsArea()} or {@link #getEditableConsensusArea()}or {@code false} otherwise
@@ -273,13 +273,13 @@ public class AlignmentEditor extends EditorPart {
     private boolean hasFocus(AlignmentArea area) {
        return SWTUtils.childHasFocus((Composite)area.getToolkitComponent());
     }
-    
-    
+
+
     public boolean hasPherogram(int sequenceID) {
         return getReadsArea().getDataAreas().getSequenceAreas(sequenceID).size() > PHEROGRAM_AREA_INDEX;
     }
 
-    
+
     public PherogramArea getPherogramArea(int sequenceID) {
         if (hasPherogram(sequenceID)) {
             return (PherogramArea)getReadsArea().getDataAreas().getSequenceAreas(sequenceID).get(PHEROGRAM_AREA_INDEX);
@@ -289,14 +289,14 @@ public class AlignmentEditor extends EditorPart {
         }
     }
 
-    
+
     private ConsensusSequenceArea getConsensusHintDataArea() {
         return (ConsensusSequenceArea)getAlignmentsContainer().getAlignmentAreas().
                 get(CONSENSUS_HINT_AREA_INDEX).getDataAreas().getBottomAreas().
                 get(CONSENSUS_DATA_AREA_INDEX);
     }
 
-    
+
     @Deprecated  //TODO Remove as soon as testing period is over
     private void createTestContents() {
                // Just for testing:
@@ -320,7 +320,7 @@ public class AlignmentEditor extends EditorPart {
                }
     }
 
-    
+
     private void readCDMData(Sequence sequenceNode) {
        //TODO If called from somewhere else than createPartControl() the editorInput needs to be checked and previous contents need to be cleared (or updated).
 
@@ -356,7 +356,7 @@ public class AlignmentEditor extends EditorPart {
                //TODO Can the consensus sequence also be null? / Should it be created here, if nothing is in the DB?
     }
 
-    
+
     @Override
     public void createPartControl(Composite parent) {
                SWTComponentFactory.getInstance().getSWTComponent(getAlignmentsContainer(), parent, SWT.NONE);
@@ -383,12 +383,13 @@ public class AlignmentEditor extends EditorPart {
                }
        }
 
-    
+
     @Override
        public void dispose() {
                Display.getCurrent().removeFilter(SWT.FocusIn, ACTION_UPDATER);
                Display.getCurrent().removeFilter(SWT.FocusOut, ACTION_UPDATER);
                CLIPBOARD.dispose();
+        ((AlignmentEditorInput)getEditorInput()).dispose();
                super.dispose();
        }
 
@@ -401,7 +402,7 @@ public class AlignmentEditor extends EditorPart {
                        (getReadsArea().getEditSettings().isInsertLeftInDataArea() ? "Left" : "Right"));
     }
 
-    
+
     private SingleReadAlignment.Shift[] convertToCDMShifts(PherogramAreaModel model) {
        Iterator<ShiftChange> iterator = model.shiftChangeIterator();
        List<Shift> shifts = new ArrayList<SingleReadAlignment.Shift>();
@@ -412,7 +413,7 @@ public class AlignmentEditor extends EditorPart {
        return shifts.toArray(new Shift[]{});
     }
 
-    
+
     @Override
     public void doSave(IProgressMonitor monitor) {
        if (getEditorInput() instanceof AlignmentEditorInput) {
@@ -421,6 +422,7 @@ public class AlignmentEditor extends EditorPart {
 
             //re-loading sequence to avoid session conflicts
                Sequence sequenceNode = CdmStore.getService(ISequenceService.class).load(((AlignmentEditorInput)getEditorInput()).getSequenceNodeUuid());
+               ((AlignmentEditorInput)getEditorInput()).setSequenceNode(sequenceNode);
                StringAdapter stringProvider = new StringAdapter(getEditableConsensusArea().getAlignmentModel(), false);  // Throws an exception if a token has more than one character.
 
                // Write consensus sequence:
@@ -465,6 +467,7 @@ public class AlignmentEditor extends EditorPart {
             }
             monitor.worked(1);
 
+            ((AlignmentEditorInput)getEditorInput()).merge();
             // Commit the conversation and start a new transaction immediately:
             conversationHolder.commit(true);
             monitor.worked(1);
@@ -479,44 +482,44 @@ public class AlignmentEditor extends EditorPart {
        }
     }
 
-    
+
     @Override
     public void doSaveAs() {}
 
-    
+
     @Override
     public void init(IEditorSite site, IEditorInput input) throws PartInitException {
         setSite(site);
         setInput(input);
     }
 
-    
+
     @Override
     public boolean isDirty() {
         return dirty;
     }
 
-    
+
     private void setDirty() {
        dirty = true;
        firePropertyChange(IEditorPart.PROP_DIRTY);
     }
 
-    
+
     @Override
     public boolean isSaveAsAllowed() {
         return false;  // "Save as" not allowed.
     }
 
-    
+
     @Override
     public void setFocus() {
         if(conversationHolder != null){
             conversationHolder.bind();
         }
+        ((AlignmentEditorInput)getEditorInput()).bind();
     }
 
-    
     public boolean isInsertMode() {
         return getAlignmentsContainer().getEditSettings().isInsert();
     }
@@ -526,17 +529,17 @@ public class AlignmentEditor extends EditorPart {
         return getAlignmentsContainer().getEditSettings().isInsertLeftInDataArea();
     }
 
-    
+
     public void toggleLeftRightInsertionInPherogram() {
        getAlignmentsContainer().getEditSettings().toggleInsertLeftInDataArea();
     }
 
-    
+
     public void toggleInsertOverwrite() {
        getAlignmentsContainer().getEditSettings().toggleInsert();
     }
 
-    
+
     private String cutPherogram(boolean left) {
         SelectionModel selection = getReadsArea().getSelection();
         if (selection.getCursorHeight() != 1) {
@@ -569,17 +572,17 @@ public class AlignmentEditor extends EditorPart {
         }
     }
 
-    
+
     public String cutPherogramLeft() {
         return cutPherogram(true);
     }
 
-    
+
     public String cutPherogramRight() {
         return cutPherogram(false);
     }
 
-    
+
     public void reverseComplementSelectedSequences() {
        SelectionModel selection = getReadsArea().getSelection();
        AlignmentModel<?> model = getReadsArea().getAlignmentModel();
@@ -596,7 +599,7 @@ public class AlignmentEditor extends EditorPart {
                }
     }
 
-    
+
     /**
      * Recreates the whole consensus sequence from all single read sequences. The previous consensus
      * sequence is overwritte.
@@ -617,7 +620,7 @@ public class AlignmentEditor extends EditorPart {
         model.insertTokensAt(sequenceID, 0, tokens);
     }
 
-    
+
     /**
      * Updates the current consensus sequence by replacing gaps by the according consensus tokens
      * calculated from the single read sequences and extends the consensus sequence if necessary.
@@ -651,7 +654,7 @@ public class AlignmentEditor extends EditorPart {
         }
     }
 
-    
+
        public static PherogramProvider readPherogram(URI uri) throws IOException, UnsupportedChromatogramFormatException {
            PherogramProvider result;
                InputStream stream = uri.toURL().openStream();
@@ -664,7 +667,7 @@ public class AlignmentEditor extends EditorPart {
                return result;
        }
 
-       
+
        private String newReadName() {
                int index = 1;
                while (getReadsArea().getAlignmentModel().sequenceIDByName(DEFAULT_READ_NAME_PREFIX + index)
@@ -675,12 +678,12 @@ public class AlignmentEditor extends EditorPart {
                return DEFAULT_READ_NAME_PREFIX + index;
        }
 
-       
+
     public void addRead(URI pherogramURI, boolean reverseComplemented) throws IOException, UnsupportedChromatogramFormatException {
        addRead(newReadName(), pherogramURI, reverseComplemented, null, null, null, null, null);
     }
 
-    
+
     /**
      * Adds a new sequence with attached phergram data area to the reads alignment.
      * <p>
index b82362551ddcb2e537f800eb2d0c32ed0695b12d..4bc956e3c574047187657a788b2118005a810ed3 100644 (file)
 package eu.etaxonomy.taxeditor.molecular.editor;
 
 
+import java.util.Arrays;
+import java.util.List;
 import java.util.UUID;
 
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IPersistableElement;
 
+import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
+import eu.etaxonomy.cdm.model.molecular.Sequence;
+import eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
 
 
 /**
@@ -23,16 +30,17 @@ import org.eclipse.ui.IPersistableElement;
  * @author Ben Stöver
  * @date 04.08.2014
  */
-public class AlignmentEditorInput implements IEditorInput {
+public class AlignmentEditorInput extends CdmEntitySessionInput implements IEditorInput {
     private static final String name = "AlignmentEditor";
 
 
     private final UUID sequenceNodeUuid;
-
+    private Sequence sequenceNode;
 
     public AlignmentEditorInput(UUID sequenceNodeUuid) {
-               super();
+        super(false);
                this.sequenceNodeUuid = sequenceNodeUuid;
+               initSession();
        }
 
 
@@ -135,4 +143,28 @@ public class AlignmentEditorInput implements IEditorInput {
         }
                return true;
        }
+
+
+       public void setSequenceNode(Sequence sequenceNode) {
+           this.sequenceNode = sequenceNode;
+       }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getRootEntities()
+     */
+    @Override
+    public List<Sequence> getRootEntities() {
+        return Arrays.asList(sequenceNode);
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput#merge()
+     */
+    @Override
+    public void merge() {
+        if(CdmStore.getCurrentSessionManager().isRemoting()) {
+            CdmStore.getService(ISequenceService.class).merge(sequenceNode, true);
+        }
+    }
 }
index 5676d8defce714ab1bbae9d46af48bee291e802e..3a227f05814acad9472fa21d561c804ffb4de221 100644 (file)
@@ -1,9 +1,9 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
-       <classpathentry including="**/*.java" kind="src" path="src/main/java"/>\r
-       <classpathentry including="**/*.java" kind="src" path="src/test/java"/>\r
-       <classpathentry including="**/*.java" kind="src" path="src/test/resources"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry including="**/*.java" kind="src" path="src/main/java"/>
+       <classpathentry including="**/*.java" kind="src" path="src/test/java"/>
+       <classpathentry including="**/*.java" kind="src" path="src/test/resources"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 2debdb9bdeb730adbe99bf6df85c3df0640c8af1..e0c440a7338acbbc41f0d2cd54f16813d7c3d2a2 100644 (file)
@@ -2,13 +2,15 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Navigation Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.navigation;singleton:=true
-Bundle-Version: 3.8.0.qualifier
+Bundle-Version: 4.0.0.qualifier
 Bundle-Vendor: EDIT
 Export-Package: eu.etaxonomy.cdm,
  eu.etaxonomy.taxeditor.navigation,
  eu.etaxonomy.taxeditor.navigation.internal,
  eu.etaxonomy.taxeditor.navigation.key.polytomous,
+ eu.etaxonomy.taxeditor.navigation.key.polytomous.operation,
  eu.etaxonomy.taxeditor.navigation.navigator,
+ eu.etaxonomy.taxeditor.navigation.navigator.operation,
  eu.etaxonomy.taxeditor.navigation.search
 Require-Bundle: org.eclipse.ui,
  org.eclipse.ui.navigator,
@@ -25,139 +27,4 @@ Import-Package: org.eclipse.core.resources,
  org.eclipse.ui.forms.widgets,
  org.osgi.framework
 Bundle-Activator: eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-ClassPath: .,
- activation-1.1.jar,
- antlr-2.7.6.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,
- dom4j-1.6.1.jar,
- dozer-5.3.0-sources.jar,
- dozer-5.3.0.jar,
- ehcache-1.2.3.jar,
- ejb3-persistence.jar,
- ezmorph-1.0.4.jar,
- fop.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,
- 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,
- 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,
- 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,
- servlet-api-2.5.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,
- xml-apis-ext-1.3.04.jar,
- xml-apis.jar,
- xml-resolver-1.2.jar,
- xmlgraphics-commons-1.3.1.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
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
index acd510f0792316f66a6a68d3244295224f21cf44..2fb82b9b45b27bde1450dee803864b6b24f866f5 100644 (file)
@@ -1,7 +1,7 @@
 SearchBar_0=Use "*" for wildcard searching\r
 SearchBar_1=Search\r
 SearchBar_2=Could not execute search\r
-SearchBar_3=Please type at least one character when using the "*" wildcard.\r
+SearchBar_3=Please type at least one character\r
 SearchBar_4=Error opening search result.\r
 SearchBar_6=Taxa\r
 SearchBar_7=Synonyms\r
index 3ab85da0c8544c96a3d87e96f1d5e9a993a053eb..0546737ff481618bd80b48e251d466867f950ab7 100644 (file)
@@ -1,7 +1,7 @@
 SearchBar_0=Benutze "*" f\u00FCr Platzhalter-Suche\r
 SearchBar_1=Suche\r
 SearchBar_2=Suche konnte nicht ausgef\u00FChrt werden\r
-SearchBar_3=Bitte geben Sie mindestens ein Zeichen ein, wenn Sie den "*" Platzhalter benutzen wollen\r
+SearchBar_3=Bitte geben Sie mindestens einen Buchstaben ein\r
 SearchBar_4=Fehler beim f\u00fcffnen des Suchergebnisses\r
 SearchBar_6=Taxa\r
 SearchBar_7=Synonyme\r
index 9d828fb455d36b9a94c4fbefd695a12d73f2c5d5..c01bb7ad94cae5787c4123353518b419f71c59b9 100644 (file)
          <dynamic
                class="eu.etaxonomy.taxeditor.navigation.RecentNamesContributionItem"
                id="eu.etaxonomy.taxeditor.navigation.recentnames">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </dynamic>
       </menuContribution>
       <menuContribution
                   name="org.eclipse.ui.views.showView.viewId"
                   value="eu.etaxonomy.taxeditor.navigation.navigator">
             </parameter>
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
          <command
                commandId="org.eclipse.ui.views.showView"
                   name="org.eclipse.ui.views.showView.viewId"
                   value="eu.etaxonomy.taxeditor.navigation.key.polytomous.polytomousKeyViewPart">
             </parameter>
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
       </menuContribution>
       <menuContribution
             locationURI="popup:eu.etaxonomy.taxeditor.navigation.search.searchResultView">
-         <command
-               commandId="eu.etaxonomy.taxeditor.navigation.command.editTaxon"
-               label="%command.label.1"
-               style="push">
-         </command>
+         <dynamic
+               class="eu.etaxonomy.taxeditor.view.CdmViewerContextMenu"
+               id="eu.etaxonomy.taxeditor.navigation.cdmViewerContextMenu">
+         </dynamic>
+         <separator
+               name="eu.etaxonomy.taxeditor.navigation.separator2">
+         </separator>
       </menuContribution>
       <menuContribution
             locationURI="popup:eu.etaxonomy.taxeditor.navigation.navigatorpopup">
                name="taxeditor-navigation.separator1"
                visible="true">
          </separator>
-         <command
-               commandId="eu.etaxonomy.taxeditor.navigation.command.update.editSelection"
-               label="%command.label.5"
-               style="push">       
-            <visibleWhen
-                  checkEnabled="true">
-               <or>
-                  <reference
-                        definitionId="isTaxonNode">
-                  </reference>
-                  <reference
-                        definitionId="isTaxonomicTree">
-                  </reference>
-               </or>
-            </visibleWhen>
-         </command>
-         <command
-               commandId="eu.etaxonomy.taxeditor.store.open"
-               label="Edit"
-               style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <with
-                     variable="selection">
-                  <reference
-                        definitionId="isClassification">
-                  </reference>
-               </with>
-            </visibleWhen>
-         </command>
+         <dynamic
+               class="eu.etaxonomy.taxeditor.view.CdmViewerContextMenu"
+               id="eu.etaxonomy.taxeditor.navigation.cdmViewerContextMenu">
+         </dynamic>
+         <separator
+               name="eu.etaxonomy.taxeditor.navigation.separator2">
+         </separator>
          <command
                commandId="eu.etaxonomy.taxeditor.navigator.command.update.changeAcceptedToSynonym"
                label="%command.label.6"
                commandId="eu.etaxonomy.taxeditor.navigation.command.create.taxonNode"
                label="%command.label.13"
                style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
          <separator
                name="eu.etaxonomy.navigation.menu.new.separator1"
                id="eu.etaxonomy.taxeditor.navigation.create.classificationHandler"
                label="%command.label.14"
                style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
       </menuContribution>
       <menuContribution
    </extension>
    <extension
          point="org.eclipse.ui.commands">
-      <command
-            defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.EditHandler"
-            id="eu.etaxonomy.taxeditor.navigation.command.update.editSelection"
-            name="%command.name.1">
-      </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.MoveTaxonHandler"
             id="eu.etaxonomy.taxeditor.navigation.command.update.moveTaxon"
             </with>
          </activeWhen>
       </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.navigation.navigator.handler.RemotingChangeAcceptedTaxonToSynonymHandler"
+            commandId="eu.etaxonomy.taxeditor.navigator.command.update.changeAcceptedToSynonym">
+         <activeWhen>
+            <reference
+                  definitionId="isRemoting">
+            </reference>
+         </activeWhen>
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.navigation.navigator.handler.RemotingMoveFactualDataHandler"
+            commandId="eu.etaxonomy.taxeditor.navigation.moveFactualData">
+         <activeWhen>
+            <reference
+                  definitionId="isRemoting">
+            </reference>
+         </activeWhen>
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.navigation.navigator.handler.RemotingMoveTaxonNodeHandler"
+            commandId="eu.etaxonomy.taxeditor.navigation.command.update.moveTaxon">
+         <activeWhen>
+            <reference
+                  definitionId="isRemoting">
+            </reference>
+         </activeWhen>
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.navigation.navigator.handler.RemotingDeleteTaxonNodeHandler"
+            commandId="eu.etaxonomy.taxeditor.navigation.command.delete">
+         <activeWhen>
+            <reference
+                  definitionId="isRemoting">
+            </reference>
+         </activeWhen>
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.navigation.key.polytomous.handler.RemotingDeletePolytomousKeyHandler"
+            commandId="eu.etaxonomy.taxeditor.navigation.key.polytomous.command.delete">
+         <activeWhen>
+            <reference
+                  definitionId="isRemoting">
+            </reference>
+         </activeWhen>
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.navigation.key.polytomous.handler.RemotingUpdatePolytomousKeyAllNodesHandler"
+            commandId="eu.etaxonomy.taxeditor.navigation.key.polytomous.refreshKeyNodes">
+         <activeWhen>
+            <reference
+                  definitionId="isRemoting">
+            </reference>
+         </activeWhen>
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.navigation.key.polytomous.handler.RemotingEditPolytomousKeyNodesHandler"
+            commandId="eu.etaxonomy.taxeditor.navigation.key.polytomous.editNodes">
+         <activeWhen>
+            <reference
+                  definitionId="isRemoting">
+            </reference>
+         </activeWhen>
+      </handler>
    </extension>
 
       
          class="eu.etaxonomy.taxeditor.preference.CdmStorePropertyTester"
          id="eu.etaxonomy.taxeditor.preference.CdmStorePropertyTester"
          namespace="eu.etaxonomy.taxeditor.preference.CdmStorePropertyTester"
-         properties="isCdmStoreConnected"
+         properties="isCdmStoreConnected,isRemoting,isStandAlone"
          type="java.lang.Object">
    </propertyTester>
    </extension>
             </test>
          </with>
       </definition>
-   </extension>
-   <extension
-         point="eu.etaxonomy.taxeditor.store.cdmViewer">
-      <cdmViewer
-            class="eu.etaxonomy.taxeditor.navigation.NavigationCdmViewer">
-      </cdmViewer>
+      <definition
+            id="isRemoting">
+         <test
+               property="eu.etaxonomy.taxeditor.preference.CdmStorePropertyTester.isRemoting">
+         </test>
+      </definition>
+      <definition
+            id="isStandAlone">
+         <test
+               property="eu.etaxonomy.taxeditor.preference.CdmStorePropertyTester.isStandAlone">
+         </test>
+      </definition>
    </extension>
 </plugin>
index 992838c22da67c0d344a5140f600a529cf4981a1..61123c06c32ecf4ca8c04f8a0c8f4f0a8f2a6acc 100644 (file)
@@ -3,7 +3,7 @@
        <parent>
                <groupId>eu.etaxonomy</groupId>
                <artifactId>taxeditor-parent</artifactId>
-               <version>3.8.0-SNAPSHOT</version>
+               <version>4.0.0-SNAPSHOT</version>
        </parent>
 
        <modelVersion>4.0.0</modelVersion>
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/NavigationCdmViewer.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/NavigationCdmViewer.java
deleted file mode 100644 (file)
index 8ba357d..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-package eu.etaxonomy.taxeditor.navigation;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.ui.PlatformUI;
-
-import eu.etaxonomy.cdm.model.taxon.Classification;
-import eu.etaxonomy.taxeditor.newWizard.NewClassificationWizard;
-import eu.etaxonomy.taxeditor.view.ICdmViewer;
-
-public class NavigationCdmViewer implements ICdmViewer {
-
-
-    @SuppressWarnings("unused")
-    private final Logger logger = Logger.getLogger(NavigationCdmViewer.class);
-
-    @Override
-    public void show(Object input, Class<?> viewerClass) {
-        if(viewerClass.equals(NewClassificationWizard.class)){
-            if(input instanceof Classification){
-                Classification classification = (Classification)input;
-                NewClassificationWizard classificationWizard = new NewClassificationWizard();
-                classificationWizard.init(null, null);
-                classificationWizard.setEntity(classification);
-                WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), classificationWizard);
-                dialog.open();
-            }
-        }
-    }
-
-    @Override
-    public Map<Class<?>, String> getViewerClasses(Object input) {
-        Map<Class<?>, String> viewerNameMap = new HashMap<Class<?>, String>();
-        if(input instanceof Classification){
-            viewerNameMap.put(NewClassificationWizard.class, "Classification Wizard");
-        }
-        return viewerNameMap;
-    }
-
-}
index 7e48f97fcf6066329bdb081c0b236c6e0c17236f..a6d5975fe9491aae808c267699f90bbd46ad0e1f 100644 (file)
@@ -12,30 +12,27 @@ package eu.etaxonomy.taxeditor.navigation;
 import java.util.Set;
 import java.util.UUID;
 
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.NotEnabledException;
-import org.eclipse.core.commands.NotHandledException;
-import org.eclipse.core.commands.common.NotDefinedException;
 import org.eclipse.core.commands.operations.IUndoContext;
 import org.eclipse.core.commands.operations.UndoContext;
 import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IEditorReference;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.navigator.CommonViewer;
 
 import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
@@ -43,6 +40,8 @@ import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin;
 import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
+import eu.etaxonomy.taxeditor.newWizard.NewClassificationWizard;
+import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
 /**
  * <p>NavigationUtil class.</p>
@@ -54,27 +53,6 @@ import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
 public class NavigationUtil extends AbstractUtility{
        private static IUndoContext defaultUndoContext;
 
-       /**
-        * <p>executeEditHandler</p>
-        */
-       public static void executeEditHandler(){
-
-               String commandId = "eu.etaxonomy.taxeditor.navigation.command.update.editSelection";
-
-               IHandlerService handlerService = (IHandlerService) AbstractUtility.getService(IHandlerService.class);
-               try {
-                       handlerService.executeCommand(commandId, null);
-               } catch (ExecutionException e) {
-                       MessagingUtils.error(NavigationUtil.class, e);
-               } catch (NotDefinedException e) {
-                       MessagingUtils.error(NavigationUtil.class, e);
-               } catch (NotEnabledException e) {
-                       MessagingUtils.error(NavigationUtil.class, e);
-               } catch (NotHandledException e) {
-                       MessagingUtils.error(NavigationUtil.class, e);
-               }
-       }
-
        /**
         * <p>openEditor</p>
         *
@@ -83,7 +61,14 @@ public class NavigationUtil extends AbstractUtility{
        public static void openEditor(ICdmBase selectedObject){
                UUID entityUuid = selectedObject.getUuid();
                try {
-                       if(selectedObject instanceof TaxonNode){
+                       if(selectedObject instanceof Classification){
+                       NewClassificationWizard classificationWizard = new NewClassificationWizard();
+                       classificationWizard.init(null, null);
+                       classificationWizard.setEntity((Classification) selectedObject);
+                       WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), classificationWizard);
+                       dialog.open();
+                       }
+                       else if(selectedObject instanceof TaxonNode){
                                EditorUtil.openTaxonNode(entityUuid);
                        }else if(selectedObject instanceof TaxonBase){
                                EditorUtil.openTaxonBase(entityUuid);
@@ -98,24 +83,12 @@ public class NavigationUtil extends AbstractUtility{
                } catch (PartInitException e) {
                        MessagingUtils.error(NavigationUtil.class, "Error opening the editor", e);
                } catch (Exception e) {
-                       MessagingUtils.warningDialog("Could not create Taxon", NavigationUtil.class, e.getMessage());
-               }
-       }
+                   MessagingUtils.errorDialog("Could not create Taxon",
+                           NavigationUtil.class,
+                           e.getMessage(), TaxeditorStorePlugin.PLUGIN_ID,
+                           e,
+                           true);
 
-       public static void openEditor(Object selectedObject){
-               if (selectedObject instanceof UuidAndTitleCache){
-                       Class type = ((UuidAndTitleCache) selectedObject).getType();
-                       if(type == Taxon.class || type == Synonym.class){
-                               try {
-                                       EditorUtil.openTaxonBase(((UuidAndTitleCache) selectedObject).getUuid());
-                               } catch (PartInitException e) {
-                                       MessagingUtils.error(NavigationUtil.class, "Error opening the editor", e);
-                               }
-                       }
-               }else if(selectedObject instanceof ICdmBase){
-                       openEditor((ICdmBase) selectedObject);
-               }else{
-                       MessagingUtils.error(NavigationUtil.class, new IllegalArgumentException("Selected object is not supported: " + selectedObject));
                }
        }
 
index c25b2af7970e7a63b353b62f8cdc258fc5609cee..0ec7431c9cf026e110b40767cdd0df19a89526de 100644 (file)
@@ -6,6 +6,8 @@ import org.eclipse.ui.IMemento;
 
 import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;
 import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
+import eu.etaxonomy.taxeditor.preference.CdmPreferences;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
 /**
  * <p>NavigatorStateManager class.</p>
@@ -26,7 +28,12 @@ public class NavigatorStateManager extends ContextListenerAdapter {
                TaxonNavigator navigator = NavigationUtil.getNavigator(true);
                if(navigator != null){
                        navigator.init();
-                       navigator.restore(memento, monitor);
+                       if (PreferencesUtil.isStoreNavigatorState()){
+                               navigator.restore(memento, monitor);
+                       } else {
+                               navigator.restore(null, monitor);
+                       }
+                       
                }
        }
        
@@ -59,6 +66,7 @@ public class NavigatorStateManager extends ContextListenerAdapter {
        @Override
        public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
                saveNavigatorState(memento, monitor);
+       
        }
        
        /**
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/PolytomousKeyViewLabels.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/PolytomousKeyViewLabels.java
new file mode 100644 (file)
index 0000000..6961c3a
--- /dev/null
@@ -0,0 +1,25 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.navigation.key.polytomous;
+
+/**
+ * @author cmathew
+ * @date 25 Jun 2015
+ *
+ */
+public interface PolytomousKeyViewLabels {
+
+    public static final String DELETE_POLYTOMOUS_KEY_LABEL = "Delete Polytomous Key";
+    public static final String UPDATE_ALL_POLYTOMOUS_KEY_NODES_LABEL = "Update All Polytomous Key Nodes";
+
+    public static final String ERROR_OPENING_KEY_EDITOR_MESSAGE = "Error opening Polytomous Key Editor";
+
+
+}
index 09861da31f570eab8ec72987fa1871250de4df73..e6757a31ba5d57fcb2b4071587dab500ac2706a9 100644 (file)
@@ -4,6 +4,7 @@
 package eu.etaxonomy.taxeditor.navigation.key.polytomous;
 
 import java.util.List;
+import java.util.Map;
 
 import org.eclipse.core.commands.Command;
 import org.eclipse.core.commands.common.NotDefinedException;
@@ -33,6 +34,10 @@ import org.eclipse.ui.commands.ICommandService;
 import org.eclipse.ui.handlers.IHandlerService;
 import org.eclipse.ui.part.ViewPart;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
+import eu.etaxonomy.cdm.api.application.ICdmChangeListener;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
@@ -44,6 +49,8 @@ import eu.etaxonomy.taxeditor.model.DataChangeBridge;
 import eu.etaxonomy.taxeditor.model.IContextListener;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 
@@ -52,7 +59,8 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
  *
  */
 public class PolytomousKeyViewPart extends ViewPart implements
-               IConversationEnabled, IPostOperationEnabled {
+               IConversationEnabled, ICdmEntitySessionEnabled, IPostOperationEnabled,
+               ICdmChangeListener {
 
        private class FilterModifyListener implements ModifyListener{
                @Override
@@ -111,6 +119,7 @@ public class PolytomousKeyViewPart extends ViewPart implements
        private IContextListener contextListener;
        private final CdmFormFactory formFactory;
        private Text text_filter;
+       private ICdmEntitySession cdmEntitySession;
 
        private PolytomousKeyViewPartDataChangeBehavior dataChangeBehavior;
 
@@ -195,6 +204,9 @@ public class PolytomousKeyViewPart extends ViewPart implements
        private void setInput() {
                conversation = CdmStore.createConversation();
                conversation.registerForDataStoreChanges(this);
+               cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
+               CdmApplicationState.getCurrentDataChangeService().register(this);
+
                List<PolytomousKey> input = CdmStore.getService(IPolytomousKeyService.class).list(PolytomousKey.class, null, null, null, null);
                if(!viewer.getControl().isDisposed()){
                    viewer.setInput(input);
@@ -206,6 +218,9 @@ public class PolytomousKeyViewPart extends ViewPart implements
         */
        @Override
        public void setFocus() {
+           if(cdmEntitySession != null) {
+            cdmEntitySession.bind();
+        }
                viewer.getControl().setFocus();
        }
 
@@ -239,6 +254,10 @@ public class PolytomousKeyViewPart extends ViewPart implements
                conversation.close();
                CdmStore.getContextManager().removeContextListener(contextListener);
            }
+           if(cdmEntitySession != null) {
+               cdmEntitySession.dispose();
+           }
+           CdmApplicationState.getCurrentDataChangeService().unregister(this);
                super.dispose();
        }
 
@@ -278,4 +297,40 @@ public class PolytomousKeyViewPart extends ViewPart implements
                return (List<PolytomousKey>)viewer.getInput();
        }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getCdmEntitySession()
+     */
+    @Override
+    public ICdmEntitySession getCdmEntitySession() {
+        return cdmEntitySession;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getRootEntities()
+     */
+    @Override
+    public  List<PolytomousKey> getRootEntities() {
+        return getKeys();
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+     */
+    @Override
+    public void onChange(CdmChangeEvent event) {
+        if(event.getAction() == Action.Delete && PolytomousKey.class.equals(event.getEntityType())) {
+            refresh();
+        }
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+     */
+    @Override
+    public Map<Object, List<String>> getPropertyPathsMap() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
 }
index 449a661f0835530b985a3910961d8153e197905b..07e8caca4bf020d8a7c44996152382c4090030be 100644 (file)
@@ -17,14 +17,9 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.common.NotDefinedException;
 import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
-import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.key.polytomous.PolytomousKeyViewPart;
@@ -38,33 +33,32 @@ import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
  */
 public class DeleteHandler extends AbstractHandler {
 
-    protected IWorkbenchPage activePage;
        /* (non-Javadoc)
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
         */
        @Override
        public Object execute(ExecutionEvent event) throws ExecutionException {
                IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
-               activePage =  HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();
+
                List<PolytomousKey> keys = selection.toList();
 
                if(keys.isEmpty()){
                        return null;
                }
-               for (PolytomousKey key : keys){
-                   closeObsoleteEditor(key);
-               }
-               boolean confirmation = MessagingUtils.confirmDialog("Confirm deletion", "Do you want to delete the selected key" + (keys.size() == 1 ? "" : "s") + "?");
+
+               boolean confirmation = MessagingUtils.confirmDialog("Confirm deletaion", "Do you want to delete the selected key" + (keys.size() == 1 ? "" : "s") + "?");
 
                if(confirmation){
 
                        for(PolytomousKey key : keys){
                                try {
+                                   PolytomousKeyViewPart pkvp = (PolytomousKeyViewPart) NavigationUtil.getView(PolytomousKeyViewPart.ID, false);
                                        AbstractPostOperation operation = new DeleteOperation(
                                                        event.getCommand().getName(),
                                                        NavigationUtil.getUndoContext(), key,
-                                                       (PolytomousKeyViewPart) NavigationUtil.getView(PolytomousKeyViewPart.ID, false),
-                                                       (PolytomousKeyViewPart) NavigationUtil.getView(PolytomousKeyViewPart.ID, false));
+                                                       pkvp,
+                                                       pkvp,
+                                                       pkvp);
                                        NavigationUtil.executeOperation(operation);
                                } catch (NotDefinedException e) {
                                        MessagingUtils.error(getClass(), e);
@@ -75,26 +69,4 @@ public class DeleteHandler extends AbstractHandler {
                return null;
        }
 
-
-       protected boolean closeObsoleteEditor(PolytomousKey key){
-        boolean result = true;
-        for (IEditorReference ref : activePage.getEditorReferences()) {
-            try {
-
-                IEditorInput input = ref.getEditorInput();
-                if (input instanceof PolytomousKeyEditorInput) {
-                    PolytomousKey pKey = ((PolytomousKeyEditorInput)input).getKey();
-                    //if node is a child of taxonNode then close the editor
-                    if(key.equals(pKey)){
-                    //if (taxonNode.equals(node)) {
-                        result &= activePage.closeEditor(ref.getEditor(false), true);
-
-                    }
-                }
-            } catch (PartInitException e) {
-                continue;
-            }
-        }
-        return result;
-    }
 }
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/RemotingDeletePolytomousKeyHandler.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/RemotingDeletePolytomousKeyHandler.java
new file mode 100644 (file)
index 0000000..691cccb
--- /dev/null
@@ -0,0 +1,83 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.navigation.key.polytomous.handler;
+
+import java.util.List;
+import java.util.UUID;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.operations.AbstractOperation;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.navigation.key.polytomous.PolytomousKeyViewLabels;
+import eu.etaxonomy.taxeditor.navigation.key.polytomous.operation.RemotingDeletePolytomousKeyOperation;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmHandler;
+import eu.etaxonomy.taxeditor.util.OperationsUtil;
+
+/**
+ * @author cmathew
+ * @date 25 Jun 2015
+ *
+ */
+public class RemotingDeletePolytomousKeyHandler extends RemotingCdmHandler {
+
+    List<UUID> keysToDelete;
+    /**
+     * @param label
+     */
+    public RemotingDeletePolytomousKeyHandler() {
+        super(PolytomousKeyViewLabels.DELETE_POLYTOMOUS_KEY_LABEL);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#allowOperations(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public IStatus allowOperations(ExecutionEvent event) {
+        IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+
+        keysToDelete = OperationsUtil.convertToUuidList(selection.toList());
+
+        if(keysToDelete.isEmpty()){
+           return Status.CANCEL_STATUS;
+        }
+
+        boolean confirmation = MessagingUtils.confirmDialog("Confirm deletaion", "Do you want to delete the selected key" + (keysToDelete.size() == 1 ? "" : "s") + "?");
+
+        if(!confirmation) {
+            return Status.CANCEL_STATUS;
+        }
+        return Status.OK_STATUS;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#prepareOperation(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public AbstractOperation prepareOperation(ExecutionEvent event) {
+        return new RemotingDeletePolytomousKeyOperation(event.getTrigger(),
+                false,
+                keysToDelete);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#onComplete()
+     */
+    @Override
+    public void onComplete() {
+        // TODO Auto-generated method stub
+
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/RemotingEditPolytomousKeyNodesHandler.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/RemotingEditPolytomousKeyNodesHandler.java
new file mode 100644 (file)
index 0000000..56949fc
--- /dev/null
@@ -0,0 +1,90 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.navigation.key.polytomous.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.widgets.Display;
+
+import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
+import eu.etaxonomy.taxeditor.navigation.key.polytomous.PolytomousKeyViewLabels;
+import eu.etaxonomy.taxeditor.navigation.key.polytomous.PolytomousKeyViewPart;
+
+/**
+ * @author cmathew
+ * @date 29 Jun 2015
+ *
+ */
+public class RemotingEditPolytomousKeyNodesHandler extends AbstractHandler {
+
+    /* (non-Javadoc)
+     * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public Object execute(final ExecutionEvent event) throws ExecutionException {
+        PolytomousKeyViewPart view = (PolytomousKeyViewPart) NavigationUtil.getView(PolytomousKeyViewPart.ID, false);
+
+        ISelection selection = view.getSite().getSelectionProvider().getSelection();
+        if(selection instanceof StructuredSelection){
+
+            final StructuredSelection structuredSelection = (StructuredSelection) selection;
+
+            Job job = new Job("Opening Polytomous Keys"){
+
+                @Override
+                protected IStatus run(IProgressMonitor monitor) {
+                    monitor.beginTask("Opening Polytomous Keys", structuredSelection.size());
+
+                    for(final Object selectedObject : structuredSelection.toArray()){
+                        if(selectedObject instanceof PolytomousKey){
+
+                            Display.getDefault().asyncExec(new Runnable(){
+
+                                @Override
+                                public void run() {
+                                    try {
+                                        PolytomousKey key = (PolytomousKey) selectedObject;
+                                    EditorUtil.openPolytomousKey(key.getUuid());
+                                    } catch(Exception ex) {
+                                        MessagingUtils.warningDialog(PolytomousKeyViewLabels.ERROR_OPENING_KEY_EDITOR_MESSAGE,
+                                                event.getTrigger(),
+                                                ex.getLocalizedMessage());
+                                        ex.printStackTrace();
+                                    }
+                                }
+
+                            });
+                            monitor.worked(1);
+                        }
+                    }
+                    monitor.done();
+                    return Status.OK_STATUS;
+                }
+
+            };
+
+            job.setPriority(Job.SHORT);
+            job.schedule();
+
+        }
+        return null;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/RemotingUpdatePolytomousKeyAllNodesHandler.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/RemotingUpdatePolytomousKeyAllNodesHandler.java
new file mode 100644 (file)
index 0000000..6c5ec41
--- /dev/null
@@ -0,0 +1,60 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.navigation.key.polytomous.handler;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.operations.AbstractOperation;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+
+import eu.etaxonomy.taxeditor.navigation.key.polytomous.PolytomousKeyViewLabels;
+import eu.etaxonomy.taxeditor.navigation.key.polytomous.operation.RemotingUpdatePolytomousKeyAllNodesOperation;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmHandler;
+
+/**
+ * @author cmathew
+ * @date 29 Jun 2015
+ *
+ */
+public class RemotingUpdatePolytomousKeyAllNodesHandler extends RemotingCdmHandler {
+
+    /**
+     * @param label
+     */
+    public RemotingUpdatePolytomousKeyAllNodesHandler() {
+        super(PolytomousKeyViewLabels.UPDATE_ALL_POLYTOMOUS_KEY_NODES_LABEL);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#allowOperations(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public IStatus allowOperations(ExecutionEvent event) {
+        return Status.OK_STATUS;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#prepareOperation(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public AbstractOperation prepareOperation(ExecutionEvent event) {
+        return new RemotingUpdatePolytomousKeyAllNodesOperation(event.getTrigger(), false);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#onComplete()
+     */
+    @Override
+    public void onComplete() {
+        // TODO Auto-generated method stub
+
+    }
+
+}
index 868116c208841f12714ec1f7265d8557e9e81a2c..01bf873c5afdf670c0eb81b50edf62d82e794da2 100644 (file)
@@ -23,6 +23,7 @@ import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -33,6 +34,8 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class DeleteOperation extends AbstractPersistentPostOperation {
 
        private final PolytomousKey key;
+       private final ICdmEntitySessionEnabled cdmEntitySessionEnabled;
+
 
        /**
         * @param label
@@ -41,9 +44,12 @@ public class DeleteOperation extends AbstractPersistentPostOperation {
         */
        public DeleteOperation(String label, IUndoContext undoContext,
                        PolytomousKey key,
-                       IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled) {
-               super(label, undoContext, postOperationEnabled, conversationEnabled);
+                       IPostOperationEnabled postOperationEnabled,
+                       IConversationEnabled conversationEnabled,
+                       ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
                this.key = key;
+               this.cdmEntitySessionEnabled = cdmEntitySessionEnabled;
        }
 
        @Override
@@ -52,6 +58,7 @@ public class DeleteOperation extends AbstractPersistentPostOperation {
                bind();
 
                DeleteResult result = CdmStore.getService(IPolytomousKeyService.class).delete(key);
+
                if (result.isError() && !result.getExceptions().isEmpty()){
                        MessageDialog.openError(null, "Delete failed", result.getExceptions().iterator().next().getMessage());
 
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/operation/RemotingDeletePolytomousKeyOperation.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/operation/RemotingDeletePolytomousKeyOperation.java
new file mode 100644 (file)
index 0000000..6551fe3
--- /dev/null
@@ -0,0 +1,57 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.navigation.key.polytomous.operation;
+
+import java.util.List;
+import java.util.UUID;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
+import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author cmathew
+ * @date 25 Jun 2015
+ *
+ */
+public class RemotingDeletePolytomousKeyOperation extends RemotingCdmUpdateOperation {
+
+    private final static String LABEL = "Delete Polytomous Key operation";
+
+    private final List<UUID> keysToDelete;
+    /**
+     * @param label
+     * @param action
+     * @param source
+     * @param async
+     */
+    public RemotingDeletePolytomousKeyOperation(Object source,
+            boolean async,
+            List<UUID> keysToDelete) {
+        super(LABEL, Action.Delete, source, async);
+        this.keysToDelete = keysToDelete;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+     */
+    @Override
+    protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
+        entityType = PolytomousKey.class;
+        return CdmStore.getService(IPolytomousKeyService.class).delete(keysToDelete);
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/operation/RemotingUpdatePolytomousKeyAllNodesOperation.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/operation/RemotingUpdatePolytomousKeyAllNodesOperation.java
new file mode 100644 (file)
index 0000000..f002c93
--- /dev/null
@@ -0,0 +1,66 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.navigation.key.polytomous.operation;
+
+import java.util.UUID;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
+import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author cmathew
+ * @date 29 Jun 2015
+ *
+ */
+public class RemotingUpdatePolytomousKeyAllNodesOperation extends RemotingCdmUpdateOperation {
+
+    private final UUID polytomousKeyUuid;
+    /**
+     * @param label
+     * @param action
+     * @param source
+     * @param async
+     */
+    public RemotingUpdatePolytomousKeyAllNodesOperation(Object source,
+            boolean async,
+            UUID polytomousKeyUuid) {
+        super(LABEL, Action.Update, source, async);
+        this.polytomousKeyUuid = polytomousKeyUuid;
+
+    }
+
+    public RemotingUpdatePolytomousKeyAllNodesOperation(Object source,
+            boolean async) {
+        super(LABEL, Action.Update, source, async);
+        // this implies that we have to update all nodes of all keys
+        this.polytomousKeyUuid = null;
+    }
+
+    private final static String LABEL = "Update All Polytomous Key Nodes operation";
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+     */
+    @Override
+    protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
+        if(polytomousKeyUuid == null) {
+            return CdmStore.getService(IPolytomousKeyService.class).updateAllNodeNumberings();
+        } else {
+            return CdmStore.getService(IPolytomousKeyService.class).updateAllNodeNumberings(polytomousKeyUuid);
+        }
+    }
+
+}
index ef4e0317c1c1c878e12207b33c43417f5a6edd3e..55b29173d78d2b7adcd76de258e0cbba337040fd 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -38,8 +38,8 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class Root extends PlatformObject implements IAdaptable, IPersistableElement, IElementFactory, IConversationEnabled {
 
-       private ConversationHolder conversation;
-       
+       private final ConversationHolder conversation;
+
        /**
         * <p>Constructor for Root.</p>
         *
@@ -48,26 +48,28 @@ public class Root extends PlatformObject implements IAdaptable, IPersistableElem
        public Root (ConversationHolder conversation){
                this.conversation = conversation;
        }
-       
+
        /**
         * <p>getParentBeans</p>
         *
         * @return a {@link java.util.List} object.
         */
        public List<Classification> getParentBeans() {
-               List<String> propertyPaths = Arrays.asList(new String[]{"name"});
-               
+               List<String> propertyPaths = Arrays.asList(new String[]{
+                       "name",
+                       "rootNode.childNodes"});
+
                List<Classification> classifications = CdmStore.getService(IClassificationService.class).list(null, null, null, null, propertyPaths);
-               
+
                if(classifications.size() == 0){
                        Classification classification = Classification.NewInstance("My Classification");
-                       AbstractPostOperation operation = new CreateClassification("Creating initial classification", NavigationUtil.getUndoContext(), classification, NavigationUtil.getNavigator(false), NavigationUtil.getNavigator(false));
+                       AbstractPostOperation operation = new CreateClassification("Creating initial classification", NavigationUtil.getUndoContext(), classification, NavigationUtil.getNavigator(false), NavigationUtil.getNavigator(false), NavigationUtil.getNavigator(false));
                        NavigationUtil.executeOperation(operation);
-                       
+
                        classifications = CdmStore.getService(IClassificationService.class).list(null, null, null, null, propertyPaths);
                }
-               
-               return classifications; 
+
+               return classifications;
        }
 
        /* (non-Javadoc)
@@ -78,7 +80,8 @@ public class Root extends PlatformObject implements IAdaptable, IPersistableElem
         *
         * @return a {@link java.lang.String} object.
         */
-       public String getFactoryId() {
+       @Override
+    public String getFactoryId() {
                return null;
        }
 
@@ -86,14 +89,16 @@ public class Root extends PlatformObject implements IAdaptable, IPersistableElem
         * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
         */
        /** {@inheritDoc} */
-       public void saveState(IMemento memento) {
+       @Override
+    public void saveState(IMemento memento) {
        }
 
        /* (non-Javadoc)
         * @see org.eclipse.ui.IElementFactory#createElement(org.eclipse.ui.IMemento)
         */
        /** {@inheritDoc} */
-       public IAdaptable createElement(IMemento memento) {
+       @Override
+    public IAdaptable createElement(IMemento memento) {
                return null;
        }
 
index 1d30e554f83d3011fc589edeaa8313451b48c384..bacbf1f98c2e5e17932a66eaf3fb9be1c39524c2 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -13,7 +13,6 @@ package eu.etaxonomy.taxeditor.navigation.navigator;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.navigator.ILinkHelper;
 
@@ -33,28 +32,29 @@ public class TaxonLinkHelper implements ILinkHelper {
 
        /** Constant <code>ID="eu.etaxonomy.taxeditor.navigation.taxon"{trunked}</code> */
        public static final String ID = "eu.etaxonomy.taxeditor.navigation.taxonlinkhelper"; //$NON-NLS-1$
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.navigator.ILinkHelper#activateEditor(org.eclipse.ui.IWorkbenchPage, org.eclipse.jface.viewers.IStructuredSelection)
         */
        /** {@inheritDoc} */
-       public void activateEditor(IWorkbenchPage page,
+       @Override
+    public void activateEditor(IWorkbenchPage page,
                        IStructuredSelection selection) {
                try {
                        if (selection == null || selection.isEmpty()) {
                                return;
                        }
-                       if (selection.getFirstElement() instanceof TaxonNode) {
-                               TaxonNode taxonNode = (TaxonNode) selection.getFirstElement();
-                               TaxonEditorInput taxonEditorInput;
-                               
-                                       taxonEditorInput = TaxonEditorInput.NewInstance(taxonNode.getUuid());
-                               
-                               IEditorPart editor = null;
-                               if ((editor = page.findEditor(taxonEditorInput)) != null) {
-                                       page.bringToTop(editor);
-                               }
-                       }
+//                     if (selection.getFirstElement() instanceof TaxonNode) {
+//                             TaxonNode taxonNode = (TaxonNode) selection.getFirstElement();
+//                             TaxonEditorInput taxonEditorInput;
+//
+//                                     taxonEditorInput = TaxonEditorInput.NewInstance(taxonNode.getUuid());
+//
+//                             IEditorPart editor = null;
+//                             if ((editor = page.findEditor(taxonEditorInput)) != null) {
+//                                     page.bringToTop(editor);
+//                             }
+//                     }
                } catch (Exception e) {
                        MessagingUtils.warningDialog("Could not create Taxon", this, e.getMessage());
                }
@@ -64,7 +64,8 @@ public class TaxonLinkHelper implements ILinkHelper {
         * @see org.eclipse.ui.navigator.ILinkHelper#findSelection(org.eclipse.ui.IEditorInput)
         */
        /** {@inheritDoc} */
-       public IStructuredSelection findSelection(IEditorInput editorInput) {
+       @Override
+    public IStructuredSelection findSelection(IEditorInput editorInput) {
                if (editorInput instanceof TaxonEditorInput) {
                        TaxonNode taxonNode = ((TaxonEditorInput) editorInput).getTaxonNode();
                        if (taxonNode != null) {
index 273d9ad36383f11750f991bcafab80a3f7fcc5aa..ea945e1041a8a5fcd966c4ba94a4c54566f3f969 100644 (file)
 package eu.etaxonomy.taxeditor.navigation.navigator;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Comparator;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Observable;
 import java.util.Observer;
 import java.util.Set;
@@ -22,18 +25,27 @@ import java.util.UUID;
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.TreePath;
 import org.eclipse.ui.IMemento;
 import org.eclipse.ui.IViewSite;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.navigator.CommonNavigator;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
+import eu.etaxonomy.cdm.api.application.ICdmChangeListener;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.ICdmBase;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.TaxonNaturalComparator;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.model.taxon.TaxonNodeByNameComparator;
 import eu.etaxonomy.cdm.model.taxon.TaxonNodeByRankAndNameComparator;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.model.DataChangeBridge;
@@ -42,8 +54,11 @@ import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.LoginManager;
+import eu.etaxonomy.taxeditor.view.CdmViewerChooser;
 
 /**
  * Taxonomic tree implementation using Common Navigator Framework.
@@ -54,7 +69,8 @@ import eu.etaxonomy.taxeditor.store.LoginManager;
  * @version 1.0
  */
 public class TaxonNavigator extends CommonNavigator implements
-               IPostOperationEnabled, IConversationEnabled, Observer {
+               IPostOperationEnabled, IConversationEnabled, Observer,
+               ICdmEntitySessionEnabled, ICdmChangeListener {
 
        /**
         * Constant
@@ -68,10 +84,14 @@ public class TaxonNavigator extends CommonNavigator implements
 
        private ConversationHolder conversation;
 
+       private ICdmEntitySession cdmEntitySession;
+
        private String partNameCache;
 
        private IDataChangeBehavior dataChangeBehavior;
 
+       private Root root;
+
        /*
         * (non-Javadoc)
         *
@@ -83,7 +103,9 @@ public class TaxonNavigator extends CommonNavigator implements
                Comparator<TaxonNode> comparator;
                if (PreferencesUtil.getSortNodesNaturally()){
                        comparator = new TaxonNaturalComparator();
-               } else{
+               } else if (PreferencesUtil.getSortNodesStrictlyAlphabetically()){
+                       comparator = new TaxonNodeByNameComparator();
+               }else {
                        comparator = new TaxonNodeByRankAndNameComparator();
                }
                TaxonNodeNavigatorComparator viewerComparator = new TaxonNodeNavigatorComparator(comparator);
@@ -111,8 +133,8 @@ public class TaxonNavigator extends CommonNavigator implements
                        // we do not preserve state. Closing the view, in contrary to
                        // closing the whole application
                        // should be handled by the state manager too
-
-                       return new Root(conversation);
+                   root = new Root(conversation);
+                       return root;
                }
                return new EmptyRoot();
        }
@@ -130,10 +152,15 @@ public class TaxonNavigator extends CommonNavigator implements
         * </p>
         */
        public void init() {
+
                if (CdmStore.isActive() && conversation == null) {
                        conversation = CdmStore.createConversation();
                        conversation.registerForDataStoreChanges(TaxonNavigator.this);
                }
+               if (CdmStore.isActive()) {
+                   cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
+                   CdmApplicationState.getCurrentDataChangeService().register(this);
+               }
                CdmStore.getLoginManager().addObserver(this);
        }
 
@@ -151,6 +178,15 @@ public class TaxonNavigator extends CommonNavigator implements
                getCommonViewer().refresh();
        }
 
+          /**
+     * Refresh this navigators viewer
+     */
+    public void refresh(Set objects) {
+        for(Object obj : objects) {
+            getCommonViewer().refresh(obj);
+        }
+    }
+
        /**
         * Removes all content
         */
@@ -169,8 +205,9 @@ public class TaxonNavigator extends CommonNavigator implements
         *            a {@link org.eclipse.core.runtime.IProgressMonitor} object.
         */
        public void restore(IMemento memento, IProgressMonitor monitor) {
+           root = new Root(conversation);
                if (memento == null) {
-                       getCommonViewer().setInput(new Root(conversation));
+                       getCommonViewer().setInput(root);
                        return;
                }
                int mementoWork = 0;
@@ -198,7 +235,7 @@ public class TaxonNavigator extends CommonNavigator implements
                subProgressMonitor.worked(1);
                conversation.registerForDataStoreChanges(TaxonNavigator.this);
                subProgressMonitor.worked(1);
-               getCommonViewer().setInput(new Root(conversation));
+               getCommonViewer().setInput(root);
                subProgressMonitor.worked(1);
                getCommonViewer().refresh();
                subProgressMonitor.worked(1);
@@ -359,6 +396,12 @@ public class TaxonNavigator extends CommonNavigator implements
                if (conversation != null) {
                        conversation.unregisterForDataStoreChanges(this);
                }
+               if(cdmEntitySession != null) {
+                   cdmEntitySession.dispose();
+               }
+               if(CdmApplicationState.getCurrentDataChangeService() != null) {
+                   CdmApplicationState.getCurrentDataChangeService().unregister(this);
+               }
        }
 
        /*
@@ -374,6 +417,9 @@ public class TaxonNavigator extends CommonNavigator implements
                if (getConversationHolder() != null) {
                        getConversationHolder().bind();
                }
+               if(cdmEntitySession != null) {
+                   cdmEntitySession.bind();
+               }
        }
 
        /*
@@ -410,8 +456,14 @@ public class TaxonNavigator extends CommonNavigator implements
 
        /** {@inheritDoc} */
        @Override
-       protected void handleDoubleClick(DoubleClickEvent anEvent) {
-               NavigationUtil.executeEditHandler();
+       protected void handleDoubleClick(DoubleClickEvent event) {
+               ISelection selection = event.getSelection();
+               if(selection instanceof IStructuredSelection){
+                       Object firstElement = ((IStructuredSelection) selection).getFirstElement();
+                       if(firstElement instanceof ICdmBase){
+                               NavigationUtil.openEditor((ICdmBase) firstElement);
+                       }
+               }
                // If the double click is passed up to the super-class it will
                // expand/collapse trees.
                // We do not want that
@@ -461,4 +513,60 @@ public class TaxonNavigator extends CommonNavigator implements
                }
 
        }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getCdmEntitySession()
+     */
+    @Override
+    public ICdmEntitySession getCdmEntitySession() {
+       return cdmEntitySession;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getRootEntities()
+     */
+    @Override
+    public List<Classification> getRootEntities() {
+        if(root != null) {
+            return root.getParentBeans();
+        }
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+     */
+    @Override
+    public void onChange(CdmChangeEvent event) {
+        if(event.getAction() == Action.Delete && Classification.class.equals(event.getEntityType())) {
+            refresh();
+            return;
+        }
+        for(CdmBase cb : event.getChangedObjects()) {
+            if(cb instanceof TaxonNode) {
+                TaxonNode tn = (TaxonNode)cb;
+                if(tn.getTaxon() == null) {
+                    getCommonViewer().refresh(tn.getClassification());
+                } else {
+                    getCommonViewer().refresh(cb);
+                }
+            } else if (cb instanceof Classification) {
+                getCommonViewer().refresh();
+            }
+        }
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+     */
+    @Override
+    public Map<Object, List<String>> getPropertyPathsMap() {
+        Map<Object, List<String>> propertyPathsMap = new HashMap<Object, List<String>>();
+        List<String> taxonNodePropertyPaths = Arrays.asList(new String[] {
+                "taxon.name"
+        });
+         propertyPathsMap.put("childNodes", taxonNodePropertyPaths);
+        return propertyPathsMap;
+    }
 }
index 0bb6c999c8d7c1d111b17677e594e3a94763c939..b1a636182f437497435f86860f87cc197b8712d8 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -19,6 +19,7 @@ import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IEditorPart;
 
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
@@ -26,7 +27,6 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent.EventType;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.model.AbstractDataChangeBehaviour;
 import eu.etaxonomy.taxeditor.model.IDataChangeBehavior;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
@@ -38,13 +38,13 @@ import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
  * @created 01.04.2009
  * @version 1.0
  */
-public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviour implements 
+public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviour implements
                IDataChangeBehavior {
 
-       private TaxonNavigator source;
+       private final TaxonNavigator source;
 
        private Set<CdmBase> staleObjects;
-       
+
        /**
         * <p>Constructor for TaxonNavigatorDataChangeBehavior.</p>
         *
@@ -53,7 +53,7 @@ public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviou
        public TaxonNavigatorDataChangeBehavior(TaxonNavigator taxonNavigator) {
                source = taxonNavigator;
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.store.model.IDataChangeBehavior#isRelevant(java.lang.Object, eu.etaxonomy.cdm.persistence.hibernate.CdmCrudEvent)
         */
@@ -64,22 +64,29 @@ public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviou
         * @return a boolean.
         */
        public boolean isRelevant(CdmDataChangeMap events) {
-               
+
                // TODO react only on insert/update/delete of taxon and synonym objects
                // and on update of name objects
                boolean relevant = false;
                staleObjects = new HashSet<CdmBase>();
-               
+
                for(CdmDataChangeEvent event : events.getAllEvents()){
                        EventType eventType = event.getEventType();
                        CdmBase eventEntity = event.getEntity();
-                       
+
+                       Set<CdmBase> affectedObjects = event.getAffectedObjects();
+                       if(affectedObjects != null) {
+                           for(CdmBase cb : affectedObjects) {
+                               staleObjects.add((CdmBase)HibernateProxyHelper.deproxy(cb));
+                           }
+                       }
+
                        // all tree node changes are relevant
-                       if((eventType == EventType.INSERT || eventType == EventType.DELETE || eventType == EventType.UPDATE) 
+                       if((eventType == EventType.INSERT || eventType == EventType.DELETE || eventType == EventType.UPDATE)
                                        && event.getEntity() instanceof ITaxonTreeNode){
                                return true;
                        }
-                       
+
                        // name updates of the accepted taxon of open editors are relevant
                        if(eventType == EventType.UPDATE && event.getEntity() instanceof TaxonNameBase){
                                TaxonNameBase name = null;
@@ -90,10 +97,10 @@ public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviou
                                }else{
                                        continue;
                                }
-                               
+
                                Set<IEditorPart> openEditors = NavigationUtil.getOpenEditors();
                                /*for(IEditorPart editor : openEditors){
-                                       
+
                                        if(name.equals(((TaxonEditorInput) editor.getEditorInput()).getTaxon().getName())){
                                                return true;
                                        }
@@ -102,7 +109,9 @@ public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviou
                        if (eventType == EventType.DELETE){
                                return true;
                        }
-                       
+
+
+
                        if(eventType == EventType.UPDATE && event.getEntity() instanceof Taxon){
                                TaxonNameBase name = null;
                                if(eventEntity instanceof Taxon){
@@ -110,16 +119,16 @@ public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviou
                                }else{
                                        continue;
                                }
-                               
-                               Set<IEditorPart> openEditors = NavigationUtil.getOpenEditors();
+
+                               // Set<IEditorPart> openEditors = NavigationUtil.getOpenEditors();
                                /*for(IEditorPart editor : openEditors){
-                                       
+
                                        if(name.equals(((TaxonEditorInput) editor.getEditorInput()).getTaxon().getName())){
                                                return true;
                                        }
                                }*/
                        }
-                       
+
 //                     if(eventType == EventType.UPDATE){
 //                             relevant = true;
 //                             CdmBase entity = event.getEntity();
@@ -130,9 +139,9 @@ public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviou
 //                             }
 //                     }
                }
-               
+
                return false;
-               
+
                // @deprecated
                // react on everything except load
 //             if(events.sizeByEventType(EventType.INSERT) > 0){
@@ -156,12 +165,12 @@ public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviou
 
                        final Display display = Display.getCurrent();
                        Job job = new Job("Updating Taxon Navigator") {
-                               
+
                                @Override
                                protected IStatus run(IProgressMonitor monitor) {
                                        monitor.beginTask("Updating Taxon Navigator", 3);
                                        monitor.worked(1);
-                                       
+
                                        // clear the session completely
                                        monitor.subTask("Clearing Taxon Navigators session");
                                        display.asyncExec(new Runnable() {
@@ -169,8 +178,8 @@ public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviou
                                                 public void run() {
                                                         source.getConversationHolder().clear();
                                                 }
-                                       });                                     
-                                       // FIXME completely clearing the session is a brute force approach. 
+                                       });
+                                       // FIXME completely clearing the session is a brute force approach.
                                        // It would be much more elegant to clear only those elements that have been changed.
                                        // I could not get that to work but we should consider workin on this because we might
                                        // run into serious performance issues, especially when it comes to large trees
@@ -178,27 +187,31 @@ public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviou
                                        // at least, we moved this to a job so it can run in a background thred
                                        // seems to improve the situation but not sure if final solution
                                        monitor.worked(1);
-                                       
+
                                        monitor.subTask("Refreshing viewer");
-                                       
+
                                        display.asyncExec(new Runnable() {
                                            @Override
                                            public void run() {
-                                               source.refresh();
+                                               if(staleObjects != null && staleObjects.size() > 0) {
+                                                  source.refresh(staleObjects);
+                                               } else {
+                                                   source.refresh();
+                                               }
                                            }
                                        });
-                                       
-                                       
-                                       
+
+
+
                                        monitor.worked(1);
                                        monitor.done();
                                        return Status.OK_STATUS;
                                }
                        };
-                       
+
                        job.setPriority(Job.SHORT);
                        job.schedule();
-                       
+
                }
        }
 }
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigatorLabels.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigatorLabels.java
new file mode 100644 (file)
index 0000000..2b579e4
--- /dev/null
@@ -0,0 +1,36 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.navigation.navigator;
+
+/**
+ * @author cmathew
+ * @date 19 Jun 2015
+ *
+ */
+public interface TaxonNavigatorLabels {
+
+    public static final String CHANGE_ACCEPTED_TAXON_TO_SYNONYM_LABEL = "Change Accepted Taxon to Synonym";
+    public static final String MOVE_TAXON_LABEL = "Move Taxon";
+    public static final String MOVE_FACTUAL_DATA_LABEL = "Move Factual Data";
+    public static final String DELETE_TAXON_NODE_LABEL = "Delete Taxon Node";
+
+    public static final String NO_TAXON_SELECTION_MESSAGE = "No taxon tree node selected for operation.";
+    public static final String SINGLE_TAXON_SELECTION_MESSAGE = "The chosen operation is available only for a single taxon.";
+    public static final String SOURCE_TAXON_HAS_CHILDREN_MESSAGE = "The chosen taxon must not have any childen. You need to move all childen to " +
+            "another taxon node in the TaxonNavigator before attempting to turn the accepted " +
+            "taxon into a synonym.";
+    public static final String RELATED_EDITOR_NOT_CLOSED_MESSAGE = "Could not close related taxon name editor. " +
+            "Please close it manually and try again.";
+    public static final String SELECTED_OBJECT_NOT_TREE_NODE_MESSAGE = "Selected object is not a taxon tree node";
+    public static final String UNSAVED_CHANGES_MESSAGE = "There are unsaved changes in the source taxon. Please save first.";
+
+
+
+}
index c7a431daf0b0df9e1c6b47149300112a9fe82d91..36e87ee8548e6066c0a1e850871bf4dda435a173 100644 (file)
@@ -10,6 +10,8 @@
 
 package eu.etaxonomy.taxeditor.navigation.navigator;
 
+import java.util.List;
+
 import org.apache.log4j.Logger;
 import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.Viewer;
@@ -38,7 +40,12 @@ public class TaxonNodeContentProvider implements ITreeContentProvider {
 
                if(parentElement instanceof ITaxonTreeNode){
                    ITaxonTreeNode treeNode = (ITaxonTreeNode) HibernateProxyHelper.deproxy(parentElement);
-                       children = treeNode.getChildNodes().toArray();
+                       List<TaxonNode> childrenSet = treeNode.getChildNodes();
+                       while (childrenSet.contains(null)){
+                           childrenSet.remove(null);
+                       }
+                   children = childrenSet.toArray();
+
                }
 
                return children != null ? children : NO_CHILDREN;
index e0f8a056682c00baa38a17452a86ab1df8f46d55..bdf2eb91cfed78ef4a8ac22aa47a92c4b91d722f 100644 (file)
@@ -238,7 +238,7 @@ public class TreeNodeDropAdapter extends ViewerDropAdapter implements IPostOpera
                                TaxonNode targetNode = (TaxonNode) targetITaxonTreeNode;
 
                                AbstractPostOperation operation = new MoveTaxonOperation
-                                               ("Move Taxon", workspaceUndoContext, uuids, targetNode.getParent(), this, taxonNavigator, false);
+                                               ("Move Taxon", workspaceUndoContext, uuids, targetNode, this, taxonNavigator, false);
                                NavigationUtil.executeOperation(operation);
 
                                logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
index 289d9d1b99596249b0fc4da64faf594532475e2a..0f16d0e8d075650a4028e95aba411948672f66ee 100644 (file)
@@ -17,6 +17,7 @@ import java.util.Set;
 import java.util.UUID;
 
 import org.apache.log4j.Logger;
+import org.eclipse.core.commands.operations.AbstractOperation;
 import org.eclipse.core.commands.operations.IUndoContext;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
@@ -37,6 +38,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.navigator.operation.MoveTaxonOperation;
+import eu.etaxonomy.taxeditor.navigation.navigator.operation.RemotingMoveTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
@@ -195,9 +197,14 @@ public class TreeNodeDropAdapterAssistant extends CommonDropAdapterAssistant imp
                                return Status.CANCEL_STATUS;
                        }
 
-                       AbstractPostOperation operation = new MoveTaxonOperation
-                                       ("Move Taxon", workspaceUndoContext, uuids, targetITaxonTreeNode, this, taxonNavigator, true);
-                       NavigationUtil.executeOperation(operation);
+                       if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                           AbstractOperation operation = new RemotingMoveTaxonOperation(taxonNavigator, false, uuids, (TaxonNode)targetITaxonTreeNode, true);
+                           NavigationUtil.executeOperation(operation, null);
+                       } else {
+                           AbstractPostOperation operation = new MoveTaxonOperation
+                                   ("Move Taxon", workspaceUndoContext, uuids, targetITaxonTreeNode, this, taxonNavigator, true);
+                           NavigationUtil.executeOperation(operation);
+            }
 
                        logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
                        return Status.OK_STATUS;
@@ -213,9 +220,14 @@ public class TreeNodeDropAdapterAssistant extends CommonDropAdapterAssistant imp
                                        return Status.CANCEL_STATUS;
                                }
 
-                               AbstractPostOperation operation = new MoveTaxonOperation
-                                               ("Move Taxon", workspaceUndoContext, uuids, targetITaxonTreeNode, this, taxonNavigator, true);
-                               NavigationUtil.executeOperation(operation);
+                               if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                                   AbstractOperation operation = new RemotingMoveTaxonOperation(taxonNavigator, false, uuids, (TaxonNode)targetITaxonTreeNode, true);
+                                   NavigationUtil.executeOperation(operation, null);
+                               } else {
+                                   AbstractPostOperation operation = new MoveTaxonOperation
+                                           ("Move Taxon", workspaceUndoContext, uuids, targetITaxonTreeNode, this, taxonNavigator, true);
+                                   NavigationUtil.executeOperation(operation);
+                               }
 
                                logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
                                return Status.OK_STATUS;
@@ -226,10 +238,15 @@ public class TreeNodeDropAdapterAssistant extends CommonDropAdapterAssistant imp
                                        return Status.CANCEL_STATUS;
                                }
                                TaxonNode targetNode = (TaxonNode) targetITaxonTreeNode;
-                               AbstractPostOperation operation = new MoveTaxonOperation
-                                               ("Move Taxon", workspaceUndoContext, uuids, targetNode.getParent(), this, taxonNavigator, false);
-                               NavigationUtil.executeOperation(operation);
 
+                               if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                                   AbstractOperation operation = new RemotingMoveTaxonOperation(taxonNavigator, false, uuids, targetNode, false);
+                                   NavigationUtil.executeOperation(operation, null);
+                               } else {
+                                   AbstractPostOperation operation = new MoveTaxonOperation
+                                           ("Move Taxon", workspaceUndoContext, uuids, targetNode, this, taxonNavigator, false);
+                                   NavigationUtil.executeOperation(operation);
+                               }
                                logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
                                return Status.OK_STATUS;
                        } else{
index 3763adc75f9daa0fa9295d72c26fe8ea89f4f38e..a60bd2e321a302423561dbccd02174752214d513 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.navigation.navigator.handler;
 
@@ -11,33 +11,25 @@ import java.util.Set;
 import java.util.UUID;
 
 import org.apache.log4j.Logger;
-import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.IHandler;
 import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.core.commands.operations.IUndoContext;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.TreeSelection;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.handlers.HandlerUtil;
 
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
-import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
 import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
-import eu.etaxonomy.taxeditor.editor.Page;
-import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.navigator.operation.ChangeAcceptedTaxonToSynonymOperation;
-import eu.etaxonomy.taxeditor.navigation.navigator.operation.DeleteOperation;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
@@ -57,14 +49,15 @@ public class ChangeAcceptedTaxonToSynonymHandler extends DeleteHandler
 
        private UUID newAcceptedTaxonNodeUuid;
        private TaxonNameEditor editor;
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
         */
        /** {@inheritDoc} */
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               
-               
+       @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+
+
                 activePage = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();
 
                taxonNavigator = NavigationUtil.showNavigator();
@@ -73,8 +66,8 @@ public class ChangeAcceptedTaxonToSynonymHandler extends DeleteHandler
 
                String plural = selection.size() > 1 ? "s" : "";
                // Prompt user for confirmation
-               
-               
+
+
 
                Iterator selectionIterator = selection.iterator();
                Set<ITaxonTreeNode> treeNodes = new HashSet<ITaxonTreeNode>();
@@ -94,50 +87,55 @@ public class ChangeAcceptedTaxonToSynonymHandler extends DeleteHandler
                AbstractPostOperation operation = null;
                if (treeNodes.size() == 1 ){
                        try {
-                               
+
                                ITaxonTreeNode treeNode = treeNodes.iterator().next();
                                ITaxonTreeNode oldAcceptedTaxonNode =treeNode;
-                               
+
                                // check if taxon has no children
                                if(((TaxonNode)oldAcceptedTaxonNode).getCountChildren() > 0) {
-                                       MessagingUtils.warningDialog("Prerequisite not met", this, 
+                                       MessagingUtils.warningDialog("Prerequisite not met", this,
                                                        "The accepted taxon must not have any childen. You need to move all childen to " +
                                                        "another taxon node in the TaxonNavigator before attempting to turn the accepted " +
                                                        "taxon into a synonym.");
                                        return null;
                                }
                                /*if(((TaxonNode)oldAcceptedTaxonNode).getTaxon().hasSynonyms()) {
-                                       EditorUtil.warningDialog("Prerequisite not met", this, 
+                                       EditorUtil.warningDialog("Prerequisite not met", this,
                                                        "The accepted taxon must not have any synonyms. You need to move all synonyms to " +
                                                        "another taxon before attempting to turn the accepted " +
                                                        "taxon into a synonym.");
                                        return null;
                                }*/
-                               
+
                                List<UUID> excludeTaxa = new ArrayList<UUID>();
-                               excludeTaxa.add(oldAcceptedTaxonNode.getUuid());
-                               TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), 
-                                               taxonNavigator.getConversationHolder(), 
-                                               "Choose the accepted taxon", 
-                                               excludeTaxa, 
-                                               null, 
-                                               ((TaxonNode)oldAcceptedTaxonNode).getClassification());                 
+                               excludeTaxa.add(((TaxonNode)oldAcceptedTaxonNode).getTaxon().getUuid());
+                               TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event),
+                                               taxonNavigator.getConversationHolder(),
+                                               "Choose the accepted taxon",
+                                               excludeTaxa,
+                                               null,
+                                               ((TaxonNode)oldAcceptedTaxonNode).getClassification());
 
                                if (newAcceptedTaxonNode == null) {
                                        return null;
                                }
-       
+
                                if (allEditorsClosed){
-                                       
-                                               operation = new ChangeAcceptedTaxonToSynonymOperation(event.getCommand().getName(), NavigationUtil.getUndoContext(), oldAcceptedTaxonNode, newAcceptedTaxonNode,
-                                                               taxonNavigator, taxonNavigator);
-                       
+
+                                               operation = new ChangeAcceptedTaxonToSynonymOperation(event.getCommand().getName(),
+                                                       NavigationUtil.getUndoContext(),
+                                                       oldAcceptedTaxonNode,
+                                                       newAcceptedTaxonNode,
+                                                               taxonNavigator,
+                                                               taxonNavigator,
+                                                               taxonNavigator);
+
                                                NavigationUtil.executeOperation(operation);
                                                //}
                                }
-       
-               
-       
+
+
+
                        } catch (NotDefinedException e) {
                                MessagingUtils.warn(getClass(), "Command name not set");
                        }
@@ -146,22 +144,24 @@ public class ChangeAcceptedTaxonToSynonymHandler extends DeleteHandler
                                return null;
                        }
                }
-               
-               
+
+
                return null;
-               
+
        }
 
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.operations.IPostOperationEnabled#postOperation(eu.etaxonomy.cdm.model.common.CdmBase)
         */
        /** {@inheritDoc} */
-       public boolean postOperation(CdmBase objectAffectedByOperation) {
+       @Override
+    public boolean postOperation(CdmBase objectAffectedByOperation) {
                Display.getDefault().asyncExec(new Runnable(){
 
-                       public void run() {
+                       @Override
+            public void run() {
                                EditorUtil.close(editor.getMultiPageTaxonEditor());
-                               
+
                                try {
                                        MultiPageTaxonEditor possibleOpenEditor = (MultiPageTaxonEditor) EditorUtil.findEditorByTaxonNodeUuid(newAcceptedTaxonNodeUuid);
                                        if(possibleOpenEditor != null){
@@ -175,10 +175,10 @@ public class ChangeAcceptedTaxonToSynonymHandler extends DeleteHandler
                                        MessagingUtils.warningDialog("Could not create Taxon", this, e.getMessage());
                                }
                        }
-                       
+
                });
-               
-               
+
+
                return true;
        }
 
@@ -187,8 +187,9 @@ public class ChangeAcceptedTaxonToSynonymHandler extends DeleteHandler
         *
         * @return a boolean.
         */
-       public boolean onComplete() {
+       @Override
+    public boolean onComplete() {
                // TODO Auto-generated method stub
                return false;
-       }       
+       }
 }
index f8e789caf1eb1b506a52ed9e2f6d577a481374f2..ea3fb60d95574044088195bfcc1cd162e470636c 100644 (file)
@@ -28,13 +28,12 @@ import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
 import eu.etaxonomy.cdm.api.service.config.TaxonNodeDeletionConfigurator;
-import eu.etaxonomy.cdm.api.service.config.TaxonNodeDeletionConfigurator.ChildHandling;
+import eu.etaxonomy.cdm.api.service.config.NodeDeletionConfigurator.ChildHandling;
 import eu.etaxonomy.cdm.model.common.ITreeNode;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
@@ -64,6 +63,12 @@ public class DeleteHandler extends AbstractHandler{
 
                TreeSelection selection = (TreeSelection) HandlerUtil.getCurrentSelection(event);
 
+
+               String plural = selection.size() > 1 ? "s" : "";
+               // Prompt user for confirmation
+
+
+
                Iterator selectionIterator = selection.iterator();
                Set<ITaxonTreeNode> treeNodes = new HashSet<ITaxonTreeNode>();
 
@@ -81,12 +86,15 @@ public class DeleteHandler extends AbstractHandler{
                }
                AbstractPostOperation operation = null;
                TaxonDeletionConfigurator config = new TaxonDeletionConfigurator();
+               config.setDeleteInAllClassifications(false);
+
                if (treeNodes.size() == 1 ){
                        try {
 
                                ITaxonTreeNode treeNode = treeNodes.iterator().next();
                                ITaxonTreeNode taxonNode =treeNode;
                                TaxonNodeDeletionConfigurator configNodes = new TaxonNodeDeletionConfigurator();
+
                                //configNodes.setDeleteTaxon(false);
                                if (taxonNode instanceof Classification && taxonNode.hasChildNodes()){
                                        if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the classification? The tree has children, they will be deleted, too.")){
@@ -107,17 +115,17 @@ public class DeleteHandler extends AbstractHandler{
                                 "Do you really want to delete the selected node? It has childnodes, they will be deleted, too.",
                                 MessageDialog.WARNING, new String[] { "Delete all children",
                                         "Move children to parent node", "Skip" }, 0);
-                                               int result = dialog.open();
+                                               int dialog_result = dialog.open();
 
-                                               if (result == 0){
+                                               if (dialog_result == 0){
                                                        //delete all children
                                                        configNodes.setChildHandling(ChildHandling.DELETE);
                                                        config.setTaxonNodeConfig(configNodes);
-                                               } else if (result == 1){
+                                               } else if (dialog_result == 1){
                                                        //move children
                                                        configNodes.setChildHandling(ChildHandling.MOVE_TO_PARENT);
                                                        config.setTaxonNodeConfig(configNodes);
-                                               } else if (result == 2){
+                                               } else if (dialog_result == 2){
                                                        //skip
                                                        return null;
 
@@ -134,11 +142,17 @@ public class DeleteHandler extends AbstractHandler{
                                        /*if(! MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the selected nodes?")){
                                                return null;
                                        }*/
-                                               operation = new DeleteOperation(
-                                                               event.getCommand().getName(), NavigationUtil.getUndoContext(),
-                                                               taxonNode, config, taxonNavigator, taxonNavigator);
 
-                                               AbstractUtility.executeOperation(operation);
+                                               operation = new DeleteOperation(event.getCommand().getName(),
+                                                       NavigationUtil.getUndoContext(),
+                                                               taxonNode,
+                                                               config,
+                                                               taxonNavigator,
+                                                               taxonNavigator,
+                                                               taxonNavigator);
+
+                                               NavigationUtil.executeOperation(operation);
+
                                                //}
                                }
 
@@ -155,11 +169,17 @@ public class DeleteHandler extends AbstractHandler{
                                        return null;
                                }
                                if (allEditorsClosed){
-                                       operation = new DeleteOperation(
-                                                       event.getCommand().getName(), NavigationUtil.getUndoContext(),
-                                                       treeNodes, new TaxonDeletionConfigurator(), taxonNavigator, taxonNavigator);
 
-                                       AbstractUtility.executeOperation(operation);
+                                       operation = new DeleteOperation(event.getCommand().getName(),
+                                               NavigationUtil.getUndoContext(),
+                                                       treeNodes,
+                                                       new TaxonDeletionConfigurator(),
+                                                       taxonNavigator,
+                                                       taxonNavigator,
+                                                       taxonNavigator);
+
+                                       NavigationUtil.executeOperation(operation);
+
                                }
                        }catch (NotDefinedException e) {
                                MessagingUtils.warn(getClass(), "Command name not set");
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/EditHandler.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/EditHandler.java
deleted file mode 100644 (file)
index e4876d3..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-package eu.etaxonomy.taxeditor.navigation.navigator.handler;
-// $Id$
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-import eu.etaxonomy.cdm.model.taxon.Classification;
-import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
-import eu.etaxonomy.taxeditor.newWizard.NewClassificationWizard;
-
-/**
- * <p>EditHandler class.</p>
- *
- * @author n.hoffmann
- * @created May 12, 2010
- * @version 1.0
- */
-public class EditHandler extends AbstractHandler implements IHandler{
-
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-        */
-       /** {@inheritDoc} */
-       @Override
-    public Object execute(ExecutionEvent event) throws ExecutionException {
-
-               ISelection selection = HandlerUtil.getCurrentSelection(event);
-
-               if(selection instanceof IStructuredSelection){
-                       final IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-
-                       if(structuredSelection.size() == 1 && structuredSelection.getFirstElement() instanceof Classification){
-                               Classification classification = (Classification) structuredSelection.getFirstElement();
-
-                               NewClassificationWizard classificationWizard = new NewClassificationWizard();
-                               classificationWizard.init(null, null);
-                               classificationWizard.setEntity(classification);
-                               WizardDialog dialog = new WizardDialog(HandlerUtil.getActiveShell(event), classificationWizard);
-                               dialog.open();
-
-                       }
-                       else{
-
-                               Job job = new Job("Opening editor") {
-
-                                       @Override
-                                       protected IStatus run(IProgressMonitor monitor) {
-                                               for(final Object selectedObject : structuredSelection.toArray()){
-
-                                                       Display.getDefault().asyncExec(new Runnable(){
-
-                                                               @Override
-                                public void run() {
-                                                                       NavigationUtil.openEditor(selectedObject);
-                                                               }
-
-                                                       });
-                                               }
-                                               return Status.OK_STATUS;
-                                       }
-                               };
-
-                               job.schedule();
-                       }
-               }
-
-               return null;
-       }
-}
index d89a11fda672cc994a353abcbc617d7d0460bee3..9810418ca26bf8fbf9f4d0346f609b2398665922 100644 (file)
@@ -4,7 +4,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.UUID;
 
-import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
@@ -21,10 +20,6 @@ import eu.etaxonomy.cdm.api.service.IDescriptionService;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.model.common.Annotation;
-import eu.etaxonomy.cdm.model.common.AnnotationType;
-import eu.etaxonomy.cdm.model.common.Language;
-import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
@@ -69,8 +64,8 @@ public class MoveFactualDataHandler extends AbstractHandler {
                             navigator.getConversationHolder(),
                             "Choose the accepted taxon",
                             excludeTaxa,
-                            null,
-                            null);
+                            sourceTaxonNode,
+                            sourceTaxonNode.getClassification());
                     if (dialogTaxonNode == null) {
                         return null;
                     }
@@ -81,26 +76,10 @@ public class MoveFactualDataHandler extends AbstractHandler {
                                 "changes in the target taxon. Please save first.");
                         return null;
                     }
-                    for(TaxonDescription description : taxon.getDescriptions()){
-                        //reload to avoid session conflicts
-                        description = HibernateProxyHelper.deproxy(CdmStore.getService(IDescriptionService.class).load(description.getUuid()), TaxonDescription.class);
+                    CdmStore.getService(IDescriptionService.class).moveTaxonDescriptions(taxon.getUuid(),targetTaxonNode.getTaxon().getUuid());
 
-                        String moveMessage = String.format("Description moved from %s", taxon);
-                        if(description.isProtectedTitleCache()){
-                            String separator = "";
-                            if(!StringUtils.isBlank(description.getTitleCache())){
-                                separator = " - ";
-                            }
-                            description.setTitleCache(description.getTitleCache() + separator + moveMessage, true);
-                        }
-                        Annotation annotation = Annotation.NewInstance(moveMessage, Language.getDefaultLanguage());
-                        annotation.setAnnotationType(AnnotationType.TECHNICAL());
-                        description.addAnnotation(annotation);
-                        targetTaxonNode.getTaxon().addDescription(description);
-                        CdmStore.getService(IDescriptionService.class).saveOrUpdate(description);
-                        navigator.getConversationHolder().bind();
-                        navigator.getConversationHolder().commit();
-                    }
+                    navigator.getConversationHolder().bind();
+                    navigator.getConversationHolder().commit();
 
                     Display.getDefault().asyncExec(new Runnable(){
 
index a761433ad4462b238d487c9d39d809ea973cc21b..9cc52f1b9aed1428ce1abe5a31e40e07d89ba19e 100644 (file)
@@ -26,6 +26,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
@@ -84,14 +85,15 @@ public class MoveTaxonHandler extends AbstractHandler implements IPostOperationE
 
 //             TaxonNode taxonNode = (TaxonNode) selection.getFirstElement();
                if (taxonNodes.size() >= 1){
+                   Classification classification = taxonNodes.iterator().next().getClassification();
                        boolean moveToNewParent = true;
                        if (PreferencesUtil.getSortNodesNaturally()){
                                if(!MessageDialog.openQuestion(null, "Target node", "The choosen target node should be the parent?")){
                                        moveToNewParent = false;
                                }
-                               parentTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), taxonNavigator.getConversationHolder(), "Choose the taxon above the moved taxon.", excludeTaxa, null, null);
+                               parentTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), taxonNavigator.getConversationHolder(), "Choose the taxon above the moved taxon.", excludeTaxa, null, classification);
                        }else{
-                               parentTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), taxonNavigator.getConversationHolder(), "Choose new parent", excludeTaxa, null, null);
+                               parentTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), taxonNavigator.getConversationHolder(), "Choose new parent", excludeTaxa, null, classification);
                        }
                        if(parentTaxonNode != null){
                                if(NavigationUtil.isDirty(parentTaxonNode)){
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/NavigatorHandlerUtils.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/NavigatorHandlerUtils.java
new file mode 100644 (file)
index 0000000..3b1eae7
--- /dev/null
@@ -0,0 +1,55 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.navigation.navigator.handler;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.model.common.ITreeNode;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+
+/**
+ * @author cmathew
+ * @date 16 Jun 2015
+ *
+ */
+public class NavigatorHandlerUtils {
+
+    protected static boolean closeObsoleteEditor(ExecutionEvent event, TaxonNode taxonNode){
+        IWorkbenchPage activePage = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();
+        boolean result = true;
+        for (IEditorReference ref : activePage.getEditorReferences()) {
+            try {
+                String treeIndex = ((ITreeNode)taxonNode).treeIndex();
+
+
+                IEditorInput input = ref.getEditorInput();
+                if (input instanceof TaxonEditorInput) {
+                    TaxonNode node = ((TaxonEditorInput) input).getTaxonNode();
+                    //if node is a child of taxonNode then close the editor
+                    if( ((ITreeNode) node).treeIndex().startsWith(treeIndex)){
+                    //if (taxonNode.equals(node)) {
+                        result &= activePage.closeEditor(ref.getEditor(false), true);
+
+                    }
+                }
+            } catch (PartInitException e) {
+                continue;
+            }
+        }
+        return result;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/RemotingChangeAcceptedTaxonToSynonymHandler.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/RemotingChangeAcceptedTaxonToSynonymHandler.java
new file mode 100644 (file)
index 0000000..c4f6df3
--- /dev/null
@@ -0,0 +1,133 @@
+/**
+ *
+ */
+package eu.etaxonomy.taxeditor.navigation.navigator.handler;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.operations.AbstractOperation;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolderMock;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigatorLabels;
+import eu.etaxonomy.taxeditor.navigation.navigator.operation.RemotingChangeAcceptedTaxonToSynonymOperation;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmHandler;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
+
+/**
+ * <p>ChangeAcceptedTaxonToSynonymHandler class.</p>
+ *
+ * @author n.hoffmann
+ * @created Jan 4, 2010
+ * @version 1.0
+ */
+public class RemotingChangeAcceptedTaxonToSynonymHandler extends RemotingCdmHandler {
+
+    private static final Logger logger = Logger
+            .getLogger(RemotingChangeAcceptedTaxonToSynonymHandler.class);
+
+
+    private ITaxonTreeNode oldTaxonNode;
+
+       /**
+     * @param label
+     */
+    public RemotingChangeAcceptedTaxonToSynonymHandler() {
+        super(TaxonNavigatorLabels.CHANGE_ACCEPTED_TAXON_TO_SYNONYM_LABEL);
+    }
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#allowOperations(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public IStatus allowOperations(ExecutionEvent event) {
+        TreeSelection selection = (TreeSelection) HandlerUtil.getCurrentSelection(event);
+        // check that only a single taxon tree node has been selected
+        if(selection.size() > 1) {
+            return new Status(IStatus.ERROR,
+                    "unknown",
+                    TaxonNavigatorLabels.SINGLE_TAXON_SELECTION_MESSAGE);
+        }
+
+        // check for no taxon tree node selected
+        if(selection.size() == 0) {
+            return new Status(IStatus.ERROR,
+                    "unknown",
+                    TaxonNavigatorLabels.NO_TAXON_SELECTION_MESSAGE);
+        }
+
+        // check that selected object is a taxon node
+        Object obj = selection.iterator().next();
+        if(obj instanceof ITaxonTreeNode) {
+            oldTaxonNode = (ITaxonTreeNode)obj;
+        } else {
+            return new Status(IStatus.ERROR,
+                    "unknown",
+                    TaxonNavigatorLabels.SELECTED_OBJECT_NOT_TREE_NODE_MESSAGE);
+        }
+        // check that the source taxon node does not have children
+        if(((TaxonNode)oldTaxonNode).getCountChildren() > 0) {
+            return new Status(IStatus.ERROR,
+                    "unknown",
+                    TaxonNavigatorLabels.SOURCE_TAXON_HAS_CHILDREN_MESSAGE);
+
+        }
+
+        // check if corresponding name editor is closed
+        boolean editorClosed = NavigatorHandlerUtils.closeObsoleteEditor(event, (TaxonNode) oldTaxonNode);
+        if(editorClosed != true) {
+            return new Status(IStatus.ERROR,
+                    "unknown",
+                    TaxonNavigatorLabels.RELATED_EDITOR_NOT_CLOSED_MESSAGE);
+        }
+
+        return Status.OK_STATUS;
+    }
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#doOperations(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public AbstractOperation prepareOperation(ExecutionEvent event) {
+        List<UUID> excludeTaxa = new ArrayList<UUID>();
+        excludeTaxa.add(((TaxonNode)oldTaxonNode).getTaxon().getUuid());
+        TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event),
+                new ConversationHolderMock(),
+                "Choose the accepted taxon",
+                excludeTaxa,
+                null,
+                ((TaxonNode)oldTaxonNode).getClassification());
+
+        if (newAcceptedTaxonNode == null) {
+            return null;
+        }
+
+        RemotingChangeAcceptedTaxonToSynonymOperation rcattso =
+                new RemotingChangeAcceptedTaxonToSynonymOperation(event.getTrigger(),
+                        false,
+                        oldTaxonNode.getUuid(),
+                        newAcceptedTaxonNode.getUuid());
+
+        return rcattso;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#onComplete(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public void onComplete() {
+        // TODO Auto-generated method stub
+
+    }
+
+
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/RemotingDeleteTaxonNodeHandler.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/RemotingDeleteTaxonNodeHandler.java
new file mode 100644 (file)
index 0000000..374ca7e
--- /dev/null
@@ -0,0 +1,165 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.navigation.navigator.handler;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.operations.AbstractOperation;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.config.TaxonNodeDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.config.NodeDeletionConfigurator.ChildHandling;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigatorLabels;
+import eu.etaxonomy.taxeditor.navigation.navigator.operation.RemotingDeleteTaxonNodeOperation;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmHandler;
+import eu.etaxonomy.taxeditor.ui.dialog.deleteConfigurator.DeleteConfiguratorDialog;
+
+/**
+ * @author cmathew
+ * @date 22 Jun 2015
+ *
+ */
+public class RemotingDeleteTaxonNodeHandler extends RemotingCdmHandler {
+
+    private TaxonDeletionConfigurator config;
+    private Set<ITaxonTreeNode> treeNodes;
+
+    /**
+     * @param label
+     */
+    public RemotingDeleteTaxonNodeHandler() {
+        super(TaxonNavigatorLabels.DELETE_TAXON_NODE_LABEL);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#allowOperations(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public IStatus allowOperations(ExecutionEvent event) {
+        TreeSelection selection = (TreeSelection) HandlerUtil.getCurrentSelection(event);
+
+        Iterator selectionIterator = selection.iterator();
+        treeNodes = new HashSet<ITaxonTreeNode>();
+
+        while (selectionIterator.hasNext()){
+            Object object = selectionIterator.next();
+            if(object instanceof ITaxonTreeNode) {
+                treeNodes.add((ITaxonTreeNode) object);
+            }
+        }
+        boolean allEditorsClosed = true;
+        IWorkbenchPage activePage = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();
+        for (ITaxonTreeNode treeNode : treeNodes) {
+            if(treeNode instanceof TaxonNode) {
+                allEditorsClosed &= EditorUtil.closeObsoleteEditor((TaxonNode) treeNode, activePage);
+            }
+        }
+        if(!allEditorsClosed) {
+            return new Status(IStatus.WARNING,
+                    "unknown",
+                    TaxonNavigatorLabels.RELATED_EDITOR_NOT_CLOSED_MESSAGE);
+        }
+
+        config = new TaxonDeletionConfigurator();
+
+        if (treeNodes.size() == 1 ){
+               ITaxonTreeNode treeNode = treeNodes.iterator().next();
+            ITaxonTreeNode taxonNode = treeNode;
+            if (taxonNode instanceof Classification){
+                taxonNode = CdmApplicationState.getCurrentAppConfig().getClassificationService().load(taxonNode.getUuid());
+            }else{
+                taxonNode = CdmApplicationState.getCurrentAppConfig().getTaxonNodeService().load(taxonNode.getUuid());
+            }
+            if (taxonNode == null){
+               MessagingUtils.informationDialog("Node already deleted", "The taxon node was already deleted. Please reopen the taxon navigator to refresh the view.");
+               return Status.CANCEL_STATUS;
+
+            }
+            TaxonNodeDeletionConfigurator configNodes = new TaxonNodeDeletionConfigurator();
+            if (taxonNode instanceof Classification && taxonNode.hasChildNodes()){
+                if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the classification? The tree has children, they will be deleted, too.")){
+                    return Status.CANCEL_STATUS;
+                }
+            } else if (taxonNode instanceof Classification && !taxonNode.hasChildNodes()){
+                if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the classification?")){
+                    return Status.CANCEL_STATUS;
+                }
+            } else {
+
+                if (taxonNode.hasChildNodes()){
+                    DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(
+                            config,
+                            HandlerUtil.getActiveShell(event),
+                            "Confirm Deletion",
+                            null,
+                            "Do you really want to delete the selected node? It has childnodes, they will be deleted, too.",
+                            MessageDialog.WARNING, new String[] { "Delete all children",
+                                "Move children to parent node", "Skip" }, 0);
+                    int result = dialog.open();
+
+                    if (result == 0){
+                        //delete all children
+                        configNodes.setChildHandling(ChildHandling.DELETE);
+                        config.setTaxonNodeConfig(configNodes);
+                    } else if (result == 1){
+                        //move children
+                        configNodes.setChildHandling(ChildHandling.MOVE_TO_PARENT);
+                        config.setTaxonNodeConfig(configNodes);
+                    } else if (result == 2){
+                        return Status.CANCEL_STATUS;
+                    }
+                } else{
+                    if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(configNodes, HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the selected node?")){
+                        return Status.CANCEL_STATUS;
+                    }
+                    config.setTaxonNodeConfig(configNodes);
+                }
+            }
+        }
+        return Status.OK_STATUS;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#prepareOperation(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public AbstractOperation prepareOperation(ExecutionEvent event) {
+        return new RemotingDeleteTaxonNodeOperation(event.getTrigger(),
+                false,
+                treeNodes,
+                config);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#onComplete()
+     */
+    @Override
+    public void onComplete() {
+        // TODO Auto-generated method stub
+
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/RemotingMoveFactualDataHandler.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/RemotingMoveFactualDataHandler.java
new file mode 100644 (file)
index 0000000..1d6b008
--- /dev/null
@@ -0,0 +1,155 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.navigation.navigator.handler;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.operations.AbstractOperation;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolderMock;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
+import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigatorLabels;
+import eu.etaxonomy.taxeditor.navigation.navigator.operation.RemotingMoveFactualDataOperation;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmHandler;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
+
+/**
+ * @author cmathew
+ * @date 19 Jun 2015
+ *
+ */
+public class RemotingMoveFactualDataHandler extends RemotingCdmHandler {
+
+
+    private TaxonNode sourceTaxonNode;
+    private TaxonNode targetTaxonNode;
+    /**
+     * @param label
+     */
+    public RemotingMoveFactualDataHandler() {
+        super(TaxonNavigatorLabels.MOVE_FACTUAL_DATA_LABEL);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#allowOperations(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public IStatus allowOperations(ExecutionEvent event) {
+        TreeSelection selection = (TreeSelection) HandlerUtil.getCurrentSelection(event);
+        // check that only a single taxon tree node has been selected
+        if(selection.size() > 1) {
+            return new Status(IStatus.ERROR,
+                    "unknown",
+                    TaxonNavigatorLabels.SINGLE_TAXON_SELECTION_MESSAGE);
+        }
+
+        // check for no taxon tree node selected
+        if(selection.size() == 0) {
+            return new Status(IStatus.ERROR,
+                    "unknown",
+                    TaxonNavigatorLabels.NO_TAXON_SELECTION_MESSAGE);
+        }
+
+        // check that selected object is a taxon node
+        Object obj = selection.iterator().next();
+        if(obj instanceof ITaxonTreeNode) {
+            sourceTaxonNode = (TaxonNode)obj;
+        } else {
+            return new Status(IStatus.ERROR,
+                    "unknown",
+                    TaxonNavigatorLabels.SELECTED_OBJECT_NOT_TREE_NODE_MESSAGE);
+        }
+
+        if(NavigationUtil.isDirty(sourceTaxonNode)) {
+            return new Status(IStatus.ERROR,
+                    "unknown",
+                    TaxonNavigatorLabels.UNSAVED_CHANGES_MESSAGE);
+        }
+
+        List<UUID> excludeTaxa = new ArrayList<UUID>();
+        excludeTaxa.add(sourceTaxonNode.getTaxon().getUuid());
+
+        targetTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event),
+                new ConversationHolderMock(),
+                "Choose the accepted taxon",
+                excludeTaxa,
+                null,
+                sourceTaxonNode.getClassification());
+
+        if(targetTaxonNode == null) {
+            return new Status(IStatus.CANCEL,
+                    "unknown",
+                    "");
+        }
+        if(NavigationUtil.isDirty(targetTaxonNode)){
+            return new Status(IStatus.ERROR,
+                    "unknown",
+                    TaxonNavigatorLabels.UNSAVED_CHANGES_MESSAGE);
+        }
+        return Status.OK_STATUS;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#prepareOperation(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public AbstractOperation prepareOperation(ExecutionEvent event) {
+        return new RemotingMoveFactualDataOperation(event.getTrigger(),
+                false,
+                sourceTaxonNode.getTaxon().getUuid(),
+                targetTaxonNode.getTaxon().getUuid());
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#onComplete()
+     */
+    @Override
+    public void onComplete() {
+        Display.getDefault().asyncExec(new Runnable(){
+            @Override
+            public void run() {
+                try {
+                    //close and re-open to refresh factual data view
+                    MultiPageTaxonEditor sourceEditor = (MultiPageTaxonEditor) EditorUtil.findEditorByTaxonNodeUuid(sourceTaxonNode.getUuid());
+                    MultiPageTaxonEditor targetEditor = (MultiPageTaxonEditor) EditorUtil.findEditorByTaxonNodeUuid(targetTaxonNode.getUuid());
+                    if(targetEditor != null){
+                        AbstractUtility.close(sourceEditor);
+                        AbstractUtility.close(targetEditor);
+                    }
+                    EditorUtil.openTaxonNode(sourceTaxonNode.getUuid());
+                    EditorUtil.openTaxonNode(targetTaxonNode.getUuid());
+                } catch (PartInitException e) {
+                    MessagingUtils.error(this.getClass(), e);
+                    throw new RuntimeException(e);
+                } catch (Exception e) {
+                    MessagingUtils.warningDialog("Could not create Taxon", this, e.getMessage());
+                }
+            }
+
+        });
+
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/RemotingMoveTaxonNodeHandler.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/RemotingMoveTaxonNodeHandler.java
new file mode 100644 (file)
index 0000000..3458faa
--- /dev/null
@@ -0,0 +1,139 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.navigation.navigator.handler;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.operations.AbstractOperation;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolderMock;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
+import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigatorLabels;
+import eu.etaxonomy.taxeditor.navigation.navigator.operation.RemotingMoveTaxonOperation;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmHandler;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
+
+/**
+ * @author cmathew
+ * @date 19 Jun 2015
+ *
+ */
+public class RemotingMoveTaxonNodeHandler extends RemotingCdmHandler {
+
+    private TaxonNode oldTaxonNode;
+
+    public RemotingMoveTaxonNodeHandler() {
+        super(TaxonNavigatorLabels.MOVE_TAXON_LABEL);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#allowOperations(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public IStatus allowOperations(ExecutionEvent event) {
+        TreeSelection selection = (TreeSelection) HandlerUtil.getCurrentSelection(event);
+        // check that only a single taxon tree node has been selected
+        if(selection.size() > 1) {
+            return new Status(IStatus.ERROR,
+                    "unknown",
+                    TaxonNavigatorLabels.SINGLE_TAXON_SELECTION_MESSAGE);
+        }
+
+        // check for no taxon tree node selected
+        if(selection.size() == 0) {
+            return new Status(IStatus.ERROR,
+                    "unknown",
+                    TaxonNavigatorLabels.NO_TAXON_SELECTION_MESSAGE);
+        }
+        // check that selected object is a taxon node
+        Object obj = selection.iterator().next();
+        if(obj instanceof TaxonNode) {
+            oldTaxonNode = (TaxonNode)obj;
+        } else {
+            return new Status(IStatus.ERROR,
+                    "unknown",
+                    TaxonNavigatorLabels.SELECTED_OBJECT_NOT_TREE_NODE_MESSAGE);
+        }
+        return Status.OK_STATUS;
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#prepareOperation(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public AbstractOperation prepareOperation(ExecutionEvent event) {
+        Shell activeShell = HandlerUtil.getActiveShell(event);
+        TaxonNode parentTaxonNode;
+
+        List<UUID> excludeTaxa = new ArrayList<UUID>();
+        excludeTaxa.add(oldTaxonNode.getTaxon().getUuid());
+
+        boolean moveToNewParent = true;
+
+        if (PreferencesUtil.getSortNodesNaturally()){
+            if(!MessageDialog.openQuestion(activeShell, "Target node", "Should the choosen target node be the parent of this taxon node?")){
+                moveToNewParent = false;
+            }
+            parentTaxonNode = TaxonNodeSelectionDialog.select(activeShell,
+                    new ConversationHolderMock(),
+                    "Choose the taxon above the moved taxon.",
+                    excludeTaxa,
+                    null,
+                    oldTaxonNode.getClassification());
+        } else {
+            parentTaxonNode = TaxonNodeSelectionDialog.select(activeShell,
+                    new ConversationHolderMock(),
+                    "Choose new parent",
+                    excludeTaxa,
+                    null,
+                    oldTaxonNode.getClassification());
+        }
+
+
+        if(parentTaxonNode != null){
+            if(NavigationUtil.isDirty(parentTaxonNode)){
+                MessageDialog.openWarning(activeShell,
+                        "Unsaved Parent Taxon",
+                        "There are unsaved changes in the parent taxon. Please save first.");
+                return null;
+            }
+
+            return new RemotingMoveTaxonOperation(event.getTrigger(),
+                    false,
+                    oldTaxonNode.getUuid(),
+                    parentTaxonNode.getUuid(),
+                    moveToNewParent);
+        }
+
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#onComplete()
+     */
+    @Override
+    public void onComplete() {
+        // TODO Auto-generated method stub
+
+    }
+
+}
index b9c5e9dd38111a6106b3364f3cb6d892697ffbba..6d9d0f091393e80123d7535b5952b0759b2895e8 100644 (file)
@@ -16,11 +16,10 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.MessageDialog;
 
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
-import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
 import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
@@ -29,6 +28,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -42,6 +42,8 @@ public class ChangeAcceptedTaxonToSynonymOperation extends
        DeleteOperation {
 
        private final TaxonNode newAcceptedTaxonNode;
+       private final ICdmEntitySessionEnabled cdmEntitySessionEnabled;
+
 
        //private TaxonNode oldTaxonNode;
 
@@ -56,10 +58,15 @@ public class ChangeAcceptedTaxonToSynonymOperation extends
         * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
        public ChangeAcceptedTaxonToSynonymOperation(String label,
-                       IUndoContext undoContext, ITaxonTreeNode oldTaxonNode, TaxonNode newAcceptedTaxonNode,
-                       IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled) {
-               super(label, undoContext, oldTaxonNode, new TaxonDeletionConfigurator(),postOperationEnabled, conversationEnabled);
+                       IUndoContext undoContext,
+                       ITaxonTreeNode oldTaxonNode,
+                       TaxonNode newAcceptedTaxonNode,
+                       IPostOperationEnabled postOperationEnabled,
+                       IConversationEnabled conversationEnabled,
+            ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, oldTaxonNode, new TaxonDeletionConfigurator(),postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
                this.newAcceptedTaxonNode = newAcceptedTaxonNode;
+               this.cdmEntitySessionEnabled = cdmEntitySessionEnabled;
        }
 
 
@@ -73,26 +80,36 @@ public class ChangeAcceptedTaxonToSynonymOperation extends
 
                monitor.worked(20);
                bind();
-       Taxon oldTaxon = (Taxon) HibernateProxyHelper.deproxy(((TaxonNode) taxonNode).getTaxon());
+
+       Taxon oldTaxon = HibernateProxyHelper.deproxy(((TaxonNode) taxonNode).getTaxon(), Taxon.class);
+       Taxon newAcceptedTaxon = HibernateProxyHelper.deproxy(newAcceptedTaxonNode.getTaxon(), Taxon.class);
+
                try {
-                   DeleteResult result = CdmStore.getService(ITaxonNodeService.class).makeTaxonNodeASynonymOfAnotherTaxonNode((TaxonNode) taxonNode, newAcceptedTaxonNode, null, null, null);
-        
+                   UpdateResult result = CdmStore.getService(ITaxonNodeService.class).makeTaxonNodeASynonymOfAnotherTaxonNode(taxonNode.getUuid(), newAcceptedTaxonNode.getUuid(), null, null, null);
+
+
                    if (!result.getExceptions().isEmpty() && result.isOk()){
                        String separator = ", ";
                            String exceptionString = "";
+                           int count = result.getExceptions().size();
+                           int n = 0;
                            for (Exception exception : result.getExceptions()) {
-                           exceptionString += exception.getLocalizedMessage()+separator;
+                               n++;
+                           exceptionString += exception.getLocalizedMessage();
+                           if (n<count){
+                               exceptionString += separator;
+                           }
                        }
-                               
-                       MessagingUtils.informationDialog("Synonym created but taxon is not deleted.", exceptionString);                 
+
+                       MessagingUtils.informationDialog("Synonym created but taxon deletion not possible.", exceptionString);
                    } else if (result.isAbort() || result.isError()){
-                       MessagingUtils.errorDialog("Synonym could not created", null, result.toString(), TaxeditorNavigationPlugin.PLUGIN_ID, null, true);
+                       MessagingUtils.errorDialog("Synonym creation not possible", null, result.toString(), TaxeditorNavigationPlugin.PLUGIN_ID, null, true);
                    }
                } catch (IllegalArgumentException e) {
             MessagingUtils.errorDialog("Operation failed", this, e.getMessage(), TaxeditorNavigationPlugin.PLUGIN_ID, e, false);
             return Status.CANCEL_STATUS;
         }
-               
+
                monitor.worked(40);
 
                return postExecute(oldTaxon);
index 5e78bd2ddb6ff8da75c17075ec28f1443afec236..ee5880e967155116444bdb8576206b8a53d54612 100644 (file)
@@ -1,23 +1,24 @@
 // $Id$
 /**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
 
 package eu.etaxonomy.taxeditor.navigation.navigator.operation;
 
+import java.util.HashSet;
 import java.util.Set;
+import java.util.UUID;
 
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.operations.IUndoContext;
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.MessageDialog;
 
 import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
@@ -29,9 +30,11 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.model.DeleteResultMessagingUtils;
+import eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -43,45 +46,51 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class DeleteOperation extends AbstractPersistentPostOperation{
 
-       private Set<ITaxonTreeNode> treeNodes;
-       protected final TaxonDeletionConfigurator config;
+    private Set<ITaxonTreeNode> treeNodes;
+    protected final TaxonDeletionConfigurator config;
+    private final ICdmEntitySessionEnabled cdmEntitySessionEnabled;
+
+    /**
+     * <p>Constructor for DeleteTreeNodeOperation.</p>
+     *
+     * @param label a {@link java.lang.String} object.
+     * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
+     * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
+     * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
+     * @param treeNodes a {@link java.util.Set} object.
+     */
+    public DeleteOperation(String label, IUndoContext undoContext,
+            ITaxonTreeNode taxonNode, TaxonDeletionConfigurator config,
+            IPostOperationEnabled postOperationEnabled,
+            IConversationEnabled conversationEnabled,
+            ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+        super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
+        this.taxonNode = (ITaxonTreeNode)CdmBase.deproxy(taxonNode, CdmBase.class);
+        this.config = config;
+        this.cdmEntitySessionEnabled = cdmEntitySessionEnabled;
+    }
+
+    /**
+     * <p>Constructor for DeleteTreeNodeOperation.</p>
+     *
+     * @param label a {@link java.lang.String} object.
+     * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
+     * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
+     * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
+     * @param treeNodes a {@link java.util.Set} object.
+     */
+    public DeleteOperation(String label, IUndoContext undoContext,
+            Set<ITaxonTreeNode> treeNodes, TaxonDeletionConfigurator config,
+            IPostOperationEnabled postOperationEnabled,
+            IConversationEnabled conversationEnabled,
+            ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+        super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
+        this.treeNodes = treeNodes;
+        this.config = config;
+        this.cdmEntitySessionEnabled = cdmEntitySessionEnabled;
+    }
 
 
-       /**
-        * <p>Constructor for DeleteTreeNodeOperation.</p>
-        *
-        * @param label a {@link java.lang.String} object.
-        * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
-        * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
-        * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
-        * @param treeNodes a {@link java.util.Set} object.
-        */
-       public DeleteOperation(String label, IUndoContext undoContext,
-                       ITaxonTreeNode taxonNode, TaxonDeletionConfigurator config,
-                       IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled) {
-               super(label, undoContext, postOperationEnabled, conversationEnabled);
-               this.taxonNode = (ITaxonTreeNode)CdmBase.deproxy(taxonNode, CdmBase.class);
-               this.config = config;
-       }
-
-       /**
-        * <p>Constructor for DeleteTreeNodeOperation.</p>
-        *
-        * @param label a {@link java.lang.String} object.
-        * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
-        * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
-        * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
-        * @param treeNodes a {@link java.util.Set} object.
-        */
-       public DeleteOperation(String label, IUndoContext undoContext,
-                       Set<ITaxonTreeNode> treeNodes, TaxonDeletionConfigurator config,
-                       IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled) {
-               super(label, undoContext, postOperationEnabled, conversationEnabled);
-               this.treeNodes = treeNodes;
-               this.config = config;
-       }
 
 
        /* (non-Javadoc)
@@ -96,88 +105,73 @@ public class DeleteOperation extends AbstractPersistentPostOperation{
                monitor.worked(20);
                ICdmApplicationConfiguration controller = CdmStore.getCurrentApplicationConfiguration();
                ITaxonNodeService service = controller.getTaxonNodeService();
-                       if(taxonNode != null && taxonNode instanceof TaxonNode){
-                               //((TaxonNode) treeNode).delete();
-
-                               element = ((TaxonNode)taxonNode).getTaxon();
-
-                               DeleteResult result = service.deleteTaxonNode((TaxonNode)taxonNode, config);
-                               if (result.isError() && !result.getExceptions().isEmpty()){
-                                       //TODO:Error message!
-                                       MessageDialog.openError(null, "Delete failed", result.getExceptions().iterator().next().getMessage());
-                               } else if (!result.getExceptions().isEmpty()){
-                                       String separator = ", ";
-                                   String exceptionString = "";
-                                   int count = 1;
-                                   for (Exception exception : result.getExceptions()) {
-                                       exceptionString += exception.getLocalizedMessage();
-                                       if (count < result.getExceptions().size()){
-                                           exceptionString += separator;
-                                       }
-                               }
-                                       MessagingUtils.informationDialog("Delete of the node was successful but the taxon could not be deleted.", exceptionString);
-                               }
-
-
-                       }else if(taxonNode != null && taxonNode instanceof Classification){
-                               Classification taxonomicTree = (Classification) taxonNode;
-                               /*if(taxonomicTree.hasChildNodes()){
-                                       if(! MessageDialog.openConfirm(null, "Confirm Deletion", "The selected tree has children, do yu realy want to delete the whole tree with its children?")){
-                                               return null;
-                                       }
-                               }*/
-
-                               DeleteResult result = CdmStore.getService(IClassificationService.class).delete(taxonomicTree);
-                               if (result.isError() && !result.getExceptions().isEmpty()){
-                                   String separator = ", ";
-                    String exceptionString = "";
-                    for (Exception exception : result.getExceptions()) {
-                        exceptionString += exception.getLocalizedMessage()+separator;
-                    }
-                                   MessagingUtils.error(null, exceptionString, result.getExceptions().iterator().next());
-                               }
-
-                               /*}else{
-                                       try{
-                                       CdmStore.getService(IClassificationService.class).delete(taxonomicTree);
-                                       }catch(ReferencedObjectUndeletableException e){
-                                               throw new ExecutionException(e.getMessage());
-                                       }
-                               }*/
-                       } else {
-
-                               DeleteResult result =service.deleteTaxonNodes(treeNodes, config);
-                               if (result.isError() && !result.getExceptions().isEmpty()){
-                                   String separator = ", ";
-                    String exceptionString = "";
-                    for (Exception exception : result.getExceptions()) {
-                        exceptionString += exception.getLocalizedMessage()+separator;
-                    }
-                    MessagingUtils.error(null, exceptionString, result.getExceptions().iterator().next());
-                               }
+               if(taxonNode != null && taxonNode instanceof TaxonNode){
+                       //((TaxonNode) treeNode).delete();
+
+                       element = ((TaxonNode)taxonNode).getTaxon();
+
+                       DeleteResult result = service.deleteTaxonNode((TaxonNode)taxonNode, config);
+                       if (result.isError() && !result.getExceptions().isEmpty()){
+
+                               DeleteResultMessagingUtils.messageDialogWithDetails(result, "TaxonNode could not be deleted.", TaxeditorNavigationPlugin.PLUGIN_ID);
+                       } else if (!result.getExceptions().isEmpty()){
+                               String separator = ", ";
+                           String exceptionString = "";
+                           for (Exception exception : result.getExceptions()) {
+                           exceptionString += exception.getLocalizedMessage()+separator;
+                       }
+                           DeleteResultMessagingUtils.messageDialogWithDetails(result, "TaxonNode was successfully deleted, but related object(s) could not be deleted", TaxeditorNavigationPlugin.PLUGIN_ID);
                        }
 
-               monitor.worked(40);
-               return postExecute(null);
-       }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-        */
-       /** {@inheritDoc} */
-       @Override
-       public IStatus redo(IProgressMonitor monitor, IAdaptable info)
-                       throws ExecutionException {
-               return null;
-       }
+               }else if(taxonNode != null && taxonNode instanceof Classification){
+                       Classification taxonomicTree = (Classification) taxonNode;
+
+                       DeleteResult result = CdmStore.getService(IClassificationService.class).delete(taxonomicTree.getUuid());
+            if (result.isError() && !result.getExceptions().isEmpty()){
+                //TODO:Error message!
+                DeleteResultMessagingUtils.messageDialogWithDetails(result, "TaxonNode could not be deleted.", TaxeditorNavigationPlugin.PLUGIN_ID);
+            }
+        } else {
+            Set<UUID> treeNodeUuids = new HashSet<UUID>();
+            ITaxonTreeNode entity = null;
+            for(ITaxonTreeNode treeNode : treeNodes) {
+                if(entity == null) {
+                    entity = treeNode;
+                }
+                treeNodeUuids.add(treeNode.getUuid());
+            }
+
+            DeleteResult result = service.deleteTaxonNodes(treeNodeUuids, config);
+            if (result.isError() && !result.getExceptions().isEmpty()){
+                               //TODO:Error message!
+                DeleteResultMessagingUtils.messageDialogWithDetails(result, "TaxonNode could not be deleted.", TaxeditorNavigationPlugin.PLUGIN_ID);
+                       }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-        */
-       /** {@inheritDoc} */
-       @Override
-       public IStatus undo(IProgressMonitor monitor, IAdaptable info)
-                       throws ExecutionException {
-               return null;
-       }
+        }
+
+        monitor.worked(40);
+
+        return postExecute(null);
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public IStatus redo(IProgressMonitor monitor, IAdaptable info)
+            throws ExecutionException {
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public IStatus undo(IProgressMonitor monitor, IAdaptable info)
+            throws ExecutionException {
+        return null;
+    }
 }
index 072fc2fb526ad56c2443f11c69ddb7e6076a0a46..f8ee6d9f1c14a154d3f68365a272f35419722711 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -21,6 +21,7 @@ import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -31,7 +32,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @version 1.0
  */
 public class EditClassificationOperation extends AbstractPersistentPostOperation {
-       private Classification classification;
+       private final Classification classification;
 
        /**
         * <p>Constructor for EditTaxonomicTreeOperation.</p>
@@ -44,12 +45,13 @@ public class EditClassificationOperation extends AbstractPersistentPostOperation
         */
        public EditClassificationOperation(String label, IUndoContext undoContext, Classification classification,
                        IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled) {
-               super(label, undoContext, postOperationEnabled, conversationEnabled);
-               
+                       IConversationEnabled conversationEnabled,
+            ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
+
                this.classification = classification;
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
         */
@@ -58,13 +60,13 @@ public class EditClassificationOperation extends AbstractPersistentPostOperation
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
                bind();
-               
+
                CdmStore.getService(IClassificationService.class).save(classification);
-               
+
                monitor.worked(40);
 
                return postExecute(classification);
-               
+
        }
 
        /* (non-Javadoc)
index 830d572a4cb9088551fbeca75738c0cfdec9846b..eef8af10c273dad438d0a6265e88a86113949038 100644 (file)
@@ -84,7 +84,7 @@ public class MoveTaxonOperation extends AbstractPersistentPostOperation {
                bind();
                monitor.worked(20);
 
-               UpdateResult result = CdmStore.getService(ITaxonNodeService.class).moveTaxonNodes(this.taxonNodesUuid,newParentTreeNode.getUuid());
+               UpdateResult result = CdmStore.getService(ITaxonNodeService.class).moveTaxonNodes(this.taxonNodesUuid,newParentTreeNode.getUuid(), moveToParentNode);
 //             try {
 //                     for (TaxonNode taxonNode : taxonNodes){
 //                             TaxonNode newTaxonNode = newParentTreeNode.addChildNode(taxonNode,
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/RemotingChangeAcceptedTaxonToSynonymOperation.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/RemotingChangeAcceptedTaxonToSynonymOperation.java
new file mode 100644 (file)
index 0000000..ac34629
--- /dev/null
@@ -0,0 +1,61 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.navigation.navigator.operation;
+
+import java.util.UUID;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
+import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
+
+
+/**
+ * @author cmathew
+ * @date 17 Jun 2015
+ *
+ */
+public class RemotingChangeAcceptedTaxonToSynonymOperation extends RemotingCdmUpdateOperation {
+
+    private final UUID oldTaxonNodeUuid;
+    private final UUID newAcceptedTaxonNodeUuid;
+
+
+    private final static String LABEL = "Change Accepted Taxon to Synonym operation";
+
+    /**
+     * @param label
+     */
+    public RemotingChangeAcceptedTaxonToSynonymOperation(Object source,
+            boolean async,
+            UUID oldTaxonNodeUuid,
+            UUID newAcceptedTaxonNodeUuid) {
+        super(LABEL, Action.Update, source, async);
+        this.oldTaxonNodeUuid = oldTaxonNodeUuid;
+        this.newAcceptedTaxonNodeUuid = newAcceptedTaxonNodeUuid;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+     */
+    @Override
+    protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
+        return CdmApplicationState.getService(ITaxonNodeService.class).makeTaxonNodeASynonymOfAnotherTaxonNode(oldTaxonNodeUuid,
+                newAcceptedTaxonNodeUuid,
+                null,
+                null,
+                null);
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/RemotingDeleteTaxonNodeOperation.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/RemotingDeleteTaxonNodeOperation.java
new file mode 100644 (file)
index 0000000..4fefa62
--- /dev/null
@@ -0,0 +1,87 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.navigation.navigator.operation;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.UUID;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
+
+/**
+ * @author cmathew
+ * @date 22 Jun 2015
+ *
+ */
+public class RemotingDeleteTaxonNodeOperation extends RemotingCdmUpdateOperation {
+
+    private final static String LABEL = "Delete Taxon Node operation";
+
+    private final Set<ITaxonTreeNode> treeNodes;
+    private final TaxonDeletionConfigurator config;
+
+    /**
+     * @param label
+     * @param action
+     * @param source
+     * @param async
+     */
+    public RemotingDeleteTaxonNodeOperation(Object source,
+            boolean async,
+            Set<ITaxonTreeNode> treeNodes,
+            TaxonDeletionConfigurator config) {
+        super(LABEL, Action.Delete, source, async);
+        this.treeNodes = treeNodes;
+        this.config = config;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+     */
+    @Override
+    protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
+
+
+        if(treeNodes.size() == 1) {
+            // when single node this is either a taxon or a classification
+            ITaxonTreeNode node = treeNodes.iterator().next();
+            if(node instanceof TaxonNode) {
+                return CdmApplicationState.getCurrentAppConfig().getTaxonNodeService().deleteTaxonNode(((TaxonNode)node).getUuid(), config);
+            } else if(node instanceof Classification) {
+                entityType = Classification.class;
+                return CdmApplicationState.getCurrentAppConfig().getClassificationService().delete(((Classification)node).getUuid());
+            }
+        } else {
+            // when list we assume all are taxon nodes
+            Set<UUID> treeNodeUuids = new HashSet<UUID>();
+            ITaxonTreeNode entity = null;
+            for(ITaxonTreeNode treeNode : treeNodes) {
+                if(entity == null) {
+                    entity = treeNode;
+                }
+                treeNodeUuids.add(treeNode.getUuid());
+            }
+
+            return CdmApplicationState.getCurrentAppConfig().getTaxonNodeService().deleteTaxonNodes(treeNodeUuids, new TaxonDeletionConfigurator());
+        }
+        return null;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/RemotingMoveFactualDataOperation.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/RemotingMoveFactualDataOperation.java
new file mode 100644 (file)
index 0000000..15351e9
--- /dev/null
@@ -0,0 +1,59 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.navigation.navigator.operation;
+
+import java.util.UUID;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
+import eu.etaxonomy.cdm.api.service.IDescriptionService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
+
+/**
+ * @author cmathew
+ * @date 19 Jun 2015
+ *
+ */
+public class RemotingMoveFactualDataOperation extends RemotingCdmUpdateOperation {
+
+    private final static String LABEL = "Move Factual Data operation";
+
+    private final UUID sourceTaxonUuid;
+    private final UUID targetParentTaxonUuid;
+
+    /**
+     * @param label
+     * @param action
+     * @param source
+     * @param async
+     */
+    public RemotingMoveFactualDataOperation(Object source,
+            boolean async,
+            UUID sourceTaxonUuid,
+            UUID targetParentTaxonUuid) {
+        super(LABEL, Action.Update, source, async);
+        this.sourceTaxonUuid = sourceTaxonUuid;
+        this.targetParentTaxonUuid = targetParentTaxonUuid;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+     */
+    @Override
+    protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
+        return CdmApplicationState.getService(IDescriptionService.class).moveTaxonDescriptions(sourceTaxonUuid,
+                targetParentTaxonUuid);
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/RemotingMoveTaxonOperation.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/RemotingMoveTaxonOperation.java
new file mode 100644 (file)
index 0000000..fca68db
--- /dev/null
@@ -0,0 +1,83 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.navigation.navigator.operation;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.UUID;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
+import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
+
+/**
+ * @author cmathew
+ * @date 19 Jun 2015
+ *
+ */
+public class RemotingMoveTaxonOperation extends RemotingCdmUpdateOperation {
+
+    private final static String LABEL = "Move Taxon operation";
+
+    private final Set<UUID> taxonNodesToMoveUuid;
+    private final UUID newParentTreeNodeUuid;
+    private final boolean moveToParentNode;
+
+    public RemotingMoveTaxonOperation(Object source,
+            boolean async,
+            UUID taxonNodeToMoveUuid,
+            UUID newParentTreeNodeUuid,
+            boolean moveToParentNode) {
+        super(LABEL, Action.Update, source,async);
+        taxonNodesToMoveUuid = new HashSet<UUID>();
+        taxonNodesToMoveUuid.add(taxonNodeToMoveUuid);
+        this.newParentTreeNodeUuid = newParentTreeNodeUuid;
+        this.moveToParentNode = moveToParentNode;
+    }
+
+    public RemotingMoveTaxonOperation(Object source,
+            boolean async,
+            TaxonNode taxonNodeToMove,
+            TaxonNode newParentTreeNode,
+            boolean moveToParentNode) {
+        super(LABEL, Action.Update, source,async);
+        taxonNodesToMoveUuid = new HashSet<UUID>();
+        taxonNodesToMoveUuid.add(taxonNodeToMove.getUuid());
+        this.newParentTreeNodeUuid = newParentTreeNode.getUuid();
+        this.moveToParentNode = moveToParentNode;
+    }
+
+    public RemotingMoveTaxonOperation(Object source,
+            boolean async,
+            Set<UUID> taxonNodesToMoveUuid,
+            TaxonNode newParentTreeNode,
+            boolean moveToParentNode) {
+        super(LABEL, Action.Update, source,async);
+        this.taxonNodesToMoveUuid = taxonNodesToMoveUuid;
+        this.newParentTreeNodeUuid = newParentTreeNode.getUuid();
+        this.moveToParentNode = moveToParentNode;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+     */
+    @Override
+    protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
+        return CdmApplicationState.getService(ITaxonNodeService.class).moveTaxonNodes(taxonNodesToMoveUuid,
+                newParentTreeNodeUuid, moveToParentNode);
+    }
+
+}
index 12c9d5548fad1aba909026ac100cb3f967e8c926..ea53a013928a74a8022c76ca106c8576c73f7841 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -23,6 +23,7 @@ import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -35,8 +36,8 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 @Deprecated // we do not undo creation of elements
 public class CreateClassification extends AbstractPersistentPostOperation {
 
-       private Classification classification;
-       
+       private final Classification classification;
+
        /**
         * <p>Constructor for SaveClassificationOperation.</p>
         *
@@ -48,13 +49,14 @@ public class CreateClassification extends AbstractPersistentPostOperation {
         */
        public CreateClassification(String label, IUndoContext undoContext, Classification classification,
                        IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled) {
-               super(label, undoContext, postOperationEnabled, conversationEnabled);
-               
+                       IConversationEnabled conversationEnabled,
+                       ICdmEntitySessionEnabled cdmEntitiySessionEnabled) {
+               super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitiySessionEnabled);
+
                this.classification = classification;
-               
+
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
         */
@@ -64,15 +66,15 @@ public class CreateClassification extends AbstractPersistentPostOperation {
                        throws ExecutionException {
                bind();
                monitor.worked(20);
-               
+
                if(classification.getReference() == null){
                        Reference reference = ReferenceFactory.newGeneric();
                        reference.setTitleCache(classification.getTitleCache());
                        classification.setReference(reference);
                }
-               
+
                CdmStore.getService(IClassificationService.class).saveOrUpdate(classification);
-               
+
                monitor.worked(40);
 
                return postExecute(classification);
index 293811bd11a655df8a4c995e6f8eb57d595afd8f..051f408b4790102dc16ce98ba1808bbfaee5f7dd 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -21,6 +21,7 @@ import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -31,7 +32,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 @Deprecated // we do not undo creation of elements
 public class CreatePolytomousKey extends AbstractPersistentPostOperation {
 
-       private PolytomousKey key;
+       private final PolytomousKey key;
 
        /**
         * @param label
@@ -43,8 +44,9 @@ public class CreatePolytomousKey extends AbstractPersistentPostOperation {
                        IUndoContext undoContext,
                        PolytomousKey key,
                        IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled) {
-               super(label, undoContext, postOperationEnabled, conversationEnabled);
+                       IConversationEnabled conversationEnabled,
+                       ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
                this.key = key;
        }
 
@@ -58,7 +60,7 @@ public class CreatePolytomousKey extends AbstractPersistentPostOperation {
                monitor.worked(20);
                CdmStore.getService(IPolytomousKeyService.class).saveOrUpdate(key);
                monitor.worked(40);
-               
+
                return postExecute(key);
        }
 
index 8b391876f1be3125b2d7227c94cef08589b70b5d..495f009dc3a942b01143ef4d471268dbe7b48801 100644 (file)
@@ -26,6 +26,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -38,7 +39,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 @Deprecated // we do not undo creation of elements
 public class CreateTaxonNode extends AbstractPersistentPostOperation {
 
-       private Taxon newTaxon;
+       private final Taxon newTaxon;
 
        private TaxonNode childTaxonNode;
 
@@ -52,10 +53,13 @@ public class CreateTaxonNode extends AbstractPersistentPostOperation {
         * @param parentNode a {@link eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode} object.
         * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
-       public CreateTaxonNode(String label, IUndoContext undoContext,
-               ITaxonTreeNode parentNode, TaxonNameBase<?, ?> name, IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled) {
-               super(label, undoContext, parentNode, postOperationEnabled, conversationEnabled);
+       public CreateTaxonNode(String label,
+               IUndoContext undoContext,
+               ITaxonTreeNode parentNode, TaxonNameBase<?, ?> name,
+               IPostOperationEnabled postOperationEnabled,
+                       IConversationEnabled conversationEnabled,
+            ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, parentNode, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
 
                newTaxon = Taxon.NewInstance(name, null);
        }
@@ -70,10 +74,14 @@ public class CreateTaxonNode extends AbstractPersistentPostOperation {
         * @param parentNode a {@link eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode} object.
         * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
-       public CreateTaxonNode(String label, IUndoContext undoContext,
-               ITaxonTreeNode parentNode, Taxon taxon, IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled) {
-               super(label, undoContext, parentNode, postOperationEnabled, conversationEnabled);
+       public CreateTaxonNode(String label,
+               IUndoContext undoContext,
+               ITaxonTreeNode parentNode,
+               Taxon taxon,
+               IPostOperationEnabled postOperationEnabled,
+                       IConversationEnabled conversationEnabled,
+            ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, parentNode, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
 
                this.newTaxon = taxon;
        }
index bd04a0febe04f5be864afbb76ce684595bb4d0fe..dbfa16e5e54c8b2bac826a4ec62554d78a0bab8e 100644 (file)
@@ -10,6 +10,7 @@
 
 package eu.etaxonomy.taxeditor.navigation.search;
 
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.FocusEvent;
 import org.eclipse.swt.events.FocusListener;
@@ -27,6 +28,7 @@ import org.eclipse.swt.widgets.MenuItem;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.swt.widgets.ToolBar;
 import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.ui.IMemento;
 import org.eclipse.ui.IViewPart;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;
@@ -35,24 +37,25 @@ import org.eclipse.ui.menus.WorkbenchWindowControlContribution;
 import org.eclipse.ui.swt.IFocusService;
 
 import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.IContextListener;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin;
 import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>SearchBar class.</p>
- *
  * @author n.hoffmann
  * @author e.-m.lee
  * @created 15.04.2009
  * @version 1.0
  */
-public class SearchBar extends WorkbenchWindowControlContribution{
+public class SearchBar extends WorkbenchWindowControlContribution implements IContextListener{
        private Text text_search;
        private String secondaryId;
+       private ToolBar toolBar;
 
        private final String defaultText = Messages.SearchBar_0;
 
@@ -67,6 +70,8 @@ public class SearchBar extends WorkbenchWindowControlContribution{
                createSearchTextField(composite);
                createToolBar(composite);
                registerAtFocusService();
+               //register for context refreshes
+               CdmStore.getContextManager().addContextListener(this);
 
                return composite;
        }
@@ -87,10 +92,11 @@ public class SearchBar extends WorkbenchWindowControlContribution{
         * @param composite
         */
        private void createToolBar(Composite composite) {
-               final ToolBar toolBar = new ToolBar(composite, SWT.NULL);
+               toolBar = new ToolBar(composite, SWT.NULL);
 
                ToolItem toolItem = new ToolItem(toolBar, SWT.DROP_DOWN | SWT.BORDER);
                toolItem.setText(Messages.SearchBar_1);
+               toolBar.setEnabled(false);
 
                DropdownSelectionListener dropdownListener = new DropdownSelectionListener(
                                toolItem);
@@ -112,8 +118,9 @@ public class SearchBar extends WorkbenchWindowControlContribution{
                // is applied. I am not sure how to get rid of this.
                text_search = new Text(composite, SWT.BORDER | SWT.SINGLE
                                | SWT.FULL_SELECTION);
-               text_search.setForeground(NavigationUtil.getColor(Resources.SEARCH_VIEW_FOREGROUND));
+               text_search.setForeground(AbstractUtility.getColor(Resources.SEARCH_VIEW_FOREGROUND));
                text_search.setText(defaultText);
+        text_search.setEnabled(false);
 
                addTextListeners();
        }
@@ -126,7 +133,7 @@ public class SearchBar extends WorkbenchWindowControlContribution{
 
                        @Override
             public void focusGained(FocusEvent e) {
-                               text_search.setForeground(NavigationUtil.getColor(Resources.SEARCH_VIEW_FOCUS));
+                               text_search.setForeground(AbstractUtility.getColor(Resources.SEARCH_VIEW_FOCUS));
                                if (defaultText.equals(text_search.getText())) {
                                        text_search.setText("");
                                }
@@ -135,17 +142,13 @@ public class SearchBar extends WorkbenchWindowControlContribution{
                        @Override
             public void focusLost(FocusEvent e) {
                                if (text_search.getText() == "") {
-                                       text_search.setForeground(NavigationUtil.getColor(Resources.SEARCH_VIEW_FOREGROUND));
+                                       text_search.setForeground(AbstractUtility.getColor(Resources.SEARCH_VIEW_FOREGROUND));
                                        text_search.setText(defaultText);
                                }
                        }
                });
 
                text_search.addKeyListener(new KeyAdapter() {
-                       /*
-                        * (non-Javadoc)
-                        * @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent)
-                        */
                        @Override
                        public void keyPressed(KeyEvent e) {
                                if (e.keyCode == SWT.CR) {
@@ -179,7 +182,7 @@ public class SearchBar extends WorkbenchWindowControlContribution{
                        return;
                }
 
-               if("*".equals(searchString.trim())){
+               if(!searchString.trim().matches(".*\\p{L}+.*")){
                        MessagingUtils.warningDialog(Messages.SearchBar_2, this, Messages.SearchBar_3);
                        return;
                }
@@ -270,13 +273,6 @@ public class SearchBar extends WorkbenchWindowControlContribution{
 
                private IFindTaxaAndNamesConfigurator configurator = PreferencesUtil.getSearchConfigurator();
 
-               /*
-                * (non-Javadoc)
-                *
-                * @see
-                * org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse
-                * .swt.events.SelectionEvent)
-                */
                @Override
                public void widgetSelected(SelectionEvent e) {
                        SearchOption option = (SearchOption) e.widget.getData();
@@ -334,7 +330,7 @@ public class SearchBar extends WorkbenchWindowControlContribution{
 
                public boolean getPreference() {
                        if (!PreferencesUtil.getPreferenceStore().contains(
-                                       PreferencesUtil.TAXON_SERVICE_CONFIGURATOR_TAXA)) {
+                                       IPreferenceKeys.TAXON_SERVICE_CONFIGURATOR_TAXA)) {
                                // initializes the search configurator
                                PreferencesUtil.initializeSearchConfigurator();
                        }
@@ -342,21 +338,49 @@ public class SearchBar extends WorkbenchWindowControlContribution{
                        switch (this) {
                        case TAXON:
                                boolean result = PreferencesUtil.getPreferenceStore().getBoolean(
-                                                               PreferencesUtil.TAXON_SERVICE_CONFIGURATOR_TAXA);
+                                                               IPreferenceKeys.TAXON_SERVICE_CONFIGURATOR_TAXA);
                                return result;
                        case SYNONYM:
                                return PreferencesUtil.getPreferenceStore().getBoolean(
-                                               PreferencesUtil.TAXON_SERVICE_CONFIGURATOR_SYNONYMS);
+                                               IPreferenceKeys.TAXON_SERVICE_CONFIGURATOR_SYNONYMS);
                        case NAME:
                                return PreferencesUtil.getPreferenceStore().getBoolean(
-                                               PreferencesUtil.TAXON_SERVICE_CONFIGURATOR_NAMES);
+                                               IPreferenceKeys.TAXON_SERVICE_CONFIGURATOR_NAMES);
                        case COMMON_NAME:
                                return PreferencesUtil.getPreferenceStore().getBoolean(
-                                                               PreferencesUtil.TAXON_SERVICE_CONFIGURATOR_COMMON_NAMES);
+                                                               IPreferenceKeys.TAXON_SERVICE_CONFIGURATOR_COMMON_NAMES);
                        }
 
                        return true;
                }
 
        }
+
+    @Override
+    public void contextAboutToStop(IMemento memento, IProgressMonitor monitor) {
+    }
+
+    @Override
+    public void contextStop(IMemento memento, IProgressMonitor monitor) {
+        if(!text_search.isDisposed()){
+            text_search.setEnabled(false);
+        }
+        if(!toolBar.isDisposed()){
+            toolBar.setEnabled(false);
+        }
+    }
+
+    @Override
+    public void contextStart(IMemento memento, IProgressMonitor monitor) {
+        text_search.setEnabled(true);
+        toolBar.setEnabled(true);
+    }
+
+    @Override
+    public void contextRefresh(IProgressMonitor monitor) {
+    }
+
+    @Override
+    public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
+    }
 }
index 9e8d5e40d8845d19f02ae27992996dcf78057d17..45925d809591d68e4ab0437062a4925ca7bc3379 100644 (file)
@@ -21,6 +21,7 @@ import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.viewers.ArrayContentProvider;
 import org.eclipse.jface.viewers.DoubleClickEvent;
 import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
@@ -41,12 +42,13 @@ import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.cdm.persistence.query.MatchMode;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;
 import eu.etaxonomy.taxeditor.model.IContextListener;
-import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.search.SearchBar.SearchOption;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.view.CdmViewerChooser;
 
 /**
  * <p>SearchResultView class.</p>
@@ -115,7 +117,11 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
                resultViewer.addDoubleClickListener(new IDoubleClickListener() {
                        @Override
             public void doubleClick(DoubleClickEvent event) {
-                               NavigationUtil.executeEditHandler();
+                           if(event.getSelection() instanceof IStructuredSelection){
+                               Object selectedObject = ((IStructuredSelection) event.getSelection()).getFirstElement();
+                               CdmViewerChooser chooser = new CdmViewerChooser(getSite().getShell());
+                               chooser.chooseViewer(selectedObject);
+                           }
                        }
                });
 
@@ -186,6 +192,7 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
                if(configurator.isDoTaxaByCommonNames()){
                        includedEntities.add(SearchOption.COMMON_NAME.getLabel());
                }
+               configurator.setMatchMode(MatchMode.LIKE);
 
                String includedEntitiesString = "";
                for (int i = 0; i < includedEntities.size(); i++){
diff --git a/eu.etaxonomy.taxeditor.navigation/src/test/resources/log4j.properties b/eu.etaxonomy.taxeditor.navigation/src/test/resources/log4j.properties
deleted file mode 100644 (file)
index 10ed8e4..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-### ************ APPENDER ***********************************###
-
-### direct log messages to stdout ###
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
-
-### direct messages to file hibernate.log ###
-log4j.appender.file=org.apache.log4j.FileAppender
-log4j.appender.file.File=taxeditor.log
-log4j.appender.file.layout=org.apache.log4j.PatternLayout
-log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
-
-### ************* LOG LEVELS *********************************###
-
-### set log levels - for more verbose logging change 'info' to 'debug' ###
-### levels: error, warn, debug, info
-log4j.rootLogger=WARN, stdout
-
-### set directory-specific levels below
-
-### basic level for editor directory
-log4j.logger.eu.etaxonomy.taxeditor.editor = INFO, stdout 
-
-log4j.logger.eu.etaxonomy.taxeditor.editor.handler = INFO, stdout
-
-### log level for conversation handler
-#log4j.logger.eu.etaxonomy.cdm.api.application = DEBUG, stdout
index f14ba2c2e26a0591f2789a408011882ac75ed185..60dea2f68d1f381ff10da83942a19d76d08ab4e8 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry including="**/*.java" kind="src" path="src/main/java"/>
        <classpathentry kind="output" path="target/classes"/>
index bb4cbcbe76bb59bf34705f0b3bc236898ab62501..dac7c498ba4dbeaebca840a00618367870efab43 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Printpublisher Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.printpublisher;singleton:=true
-Bundle-Version: 3.8.0.qualifier
+Bundle-Version: 4.0.0.qualifier
 Require-Bundle: org.eclipse.osgi,
  org.eclipse.ui,
  eu.etaxonomy.taxeditor.cdmlib,
@@ -15,139 +15,4 @@ Import-Package: org.apache.log4j,
 Bundle-ActivationPolicy: lazy
 Bundle-Vendor: EDIT
 Bundle-Activator: eu.etaxonomy.taxeditor.printpublisher.internal.PrintpublisherPlugin
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-ClassPath: .,
- activation-1.1.jar,
- antlr-2.7.6.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,
- dom4j-1.6.1.jar,
- dozer-5.3.0-sources.jar,
- dozer-5.3.0.jar,
- ehcache-1.2.3.jar,
- ejb3-persistence.jar,
- ezmorph-1.0.4.jar,
- fop.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,
- 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,
- 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,
- 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,
- servlet-api-2.5.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,
- xml-apis-ext-1.3.04.jar,
- xml-apis.jar,
- xml-resolver-1.2.jar,
- xmlgraphics-commons-1.3.1.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
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
index 4c2859ebb5d3ac23d6cd6209157b0ca3ca3bf4d4..dbd1f6a9dd6cb7e2f0c07e94e326d2b2e69e97e9 100644 (file)
@@ -3,7 +3,7 @@
        <parent>
                <artifactId>taxeditor-parent</artifactId>
                <groupId>eu.etaxonomy</groupId>
-               <version>3.8.0-SNAPSHOT</version>
+               <version>4.0.0-SNAPSHOT</version>
        </parent>
 
        <modelVersion>4.0.0</modelVersion>
index acbc9748821008767ce40bd4aa9ed5b7a5983cf0..db46751e9dcd8c5406379f4e094bc1d00328f50f 100644 (file)
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
-       <classpathentry including="**/*.java" kind="src" path="src/main/java"/>\r
-       <classpathentry including="**/*.java" kind="src" path="src/test/java"/>\r
-       <classpathentry kind="src" path="src/main/resources"/>\r
-       <classpathentry including="**/*.java" kind="src" path="src/test/resources"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry including="**/*.java" kind="src" path="src/main/java"/>
+       <classpathentry including="**/*.java" kind="src" path="src/test/java"/>
+       <classpathentry kind="src" path="src/main/resources"/>
+       <classpathentry including="**/*.java" kind="src" path="src/test/resources"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index e7a05f6b5bb0d40a6ed573d659b073264771eb28..0ac70dbf7b5b5c37188540a8bf80fa373fe618e3 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: DataStore Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.store;singleton:=true
-Bundle-Version: 3.8.0.qualifier
+Bundle-Version: 4.0.0.qualifier
 Bundle-Activator: eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin
 Bundle-Vendor: EDIT
 Export-Package: eu.etaxonomy.cdm,
@@ -12,8 +12,10 @@ Export-Package: eu.etaxonomy.cdm,
  eu.etaxonomy.taxeditor.dnd.transfer,
  eu.etaxonomy.taxeditor.editor,
  eu.etaxonomy.taxeditor.editor.definedterm,
+ eu.etaxonomy.taxeditor.editor.definedterm.input,
  eu.etaxonomy.taxeditor.featuretree,
  eu.etaxonomy.taxeditor.handler,
+ eu.etaxonomy.taxeditor.handler.defaultHandler,
  eu.etaxonomy.taxeditor.io,
  eu.etaxonomy.taxeditor.io.wizard,
  eu.etaxonomy.taxeditor.labels,
@@ -36,6 +38,7 @@ Export-Package: eu.etaxonomy.cdm,
  eu.etaxonomy.taxeditor.ui.dialog.selection,
  eu.etaxonomy.taxeditor.ui.element,
  eu.etaxonomy.taxeditor.ui.group.grantedauthority,
+ eu.etaxonomy.taxeditor.ui.mvc.combo,
  eu.etaxonomy.taxeditor.ui.section,
  eu.etaxonomy.taxeditor.ui.section.agent,
  eu.etaxonomy.taxeditor.ui.section.classification,
@@ -47,13 +50,15 @@ Export-Package: eu.etaxonomy.cdm,
  eu.etaxonomy.taxeditor.ui.section.supplemental,
  eu.etaxonomy.taxeditor.ui.section.taxon,
  eu.etaxonomy.taxeditor.ui.selection,
+ eu.etaxonomy.taxeditor.util,
  eu.etaxonomy.taxeditor.view,
  eu.etaxonomy.taxeditor.view.datasource,
  eu.etaxonomy.taxeditor.view.datasource.handler,
  eu.etaxonomy.taxeditor.view.derivateSearch,
  eu.etaxonomy.taxeditor.view.detail,
  eu.etaxonomy.taxeditor.view.specimenSearch,
- eu.etaxonomy.taxeditor.view.supplementaldata
+ eu.etaxonomy.taxeditor.view.supplementaldata,
+ org.eclipse.wb.swt
 Require-Bundle: org.eclipse.osgi,
  org.eclipse.ui,
  org.eclipse.jface.text,
@@ -65,7 +70,8 @@ Require-Bundle: org.eclipse.osgi,
  org.eclipse.core.databinding.observable,
  org.eclipse.core.databinding.property,
  org.eclipse.jface.databinding
-Import-Package: org.eclipse.core.commands,
+Import-Package: eu.etaxonomy.taxeditor.webapp,
+ org.eclipse.core.commands,
  org.eclipse.core.commands.operations,
  org.eclipse.core.expressions,
  org.eclipse.core.runtime,
@@ -84,164 +90,8 @@ Import-Package: org.eclipse.core.commands,
  org.eclipse.ui.editors.text,
  org.eclipse.ui.forms.widgets,
  org.eclipse.ui.ide.undo,
- org.osgi.framework
+ org.osgi.framework,
+ org.osgi.service.prefs;version="1.1.1"
 Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-ClassPath: .,
- activation-1.1.1.jar,
- antlr-2.7.7.jar,
- aopalliance-1.0.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,
- 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,
- 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,
- 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,
- 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-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,
- 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,
- 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-resolver-1.2.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,
- xpp3-1.1.4c.jar,
- xpp3_min-1.1.4c.jar,
- xstream-1.4.4.jar,
- yjp-controller-api-redist-9.0.8.jar
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
 Bundle-Localization: OSGI-INF/l10n/bundle
index 14ce99859929ece86fb1049e56f92d4939cc4ab5..a583b3c6e92ce25acdf2abeff40e43145cf8ebba 100644 (file)
@@ -135,7 +135,7 @@ page.name.31 = Order of Taxonnodes
 extension.name.0 = Popup Menu Commands\r
 command.name.8 = Clone Datasource\r
 command.name.9 = Open Feature Tree Editor Wizard\r
-command.name.10 = Open Password Wizzard\r
+command.name.10 = Open Password Wizard\r
 command.name.11 = Open Distribution Editor Wizard\r
 command.name.12 = Connect\r
 wizard.name.18 = CSV\r
@@ -151,11 +151,19 @@ activity.description.2 = ROLE_USER_MANAGER dependent ui contributions
 activity.name.2 = UserManagement\r
 activity.description.3 = ROLE_PROJECT_MANAGER dependent ui contributions\r
 activity.name.3 = ProjectManagement\r
-extension-point.name = Cdm Viewer\r
 Bundle-Vendor = EDIT\r
 Bundle-Name = DataStore Bundle\r
 command.name.13 = delete\r
 command.name.14 = delete\r
-page.name.32 = TaxonNavigator\r
+page.name.32 = Taxon Navigator\r
 page.name.33 = Sort of Taxonnodes\r
-command.name.15 = Open
\ No newline at end of file
+page.name.34 = Debug Preferences\r
+command.name.15 = Open\r
+view.name.SESSIONS = Sessions\r
+command.label.SESSION = Sessions\r
+command.label.CONNECT = Connect\r
+command.label.RE_CONNECT = Re-Connect\r
+command.name.CONNECT = Connect\r
+command.name.RE_CONNECT = Re-Connect\r
+command.name.OPEN_CLASSIFICATION_WIZARD = Open Classification Wizard\r
+command.name.OPEN_TAXONNODE_WIZARD = Open Taxon Node Wizard
\ No newline at end of file
index fdc32d0692732090b3a5cdbd64382a4a76178335..2b82b3b32ef99b290bd476a30849689e442fa629 100644 (file)
@@ -129,7 +129,30 @@ page.name.27 = Media
 page.name.28 = Checklisten Editor
 page.name.29 = Editor Profil
 page.name.30 = Sprache
-page.name.32 = TaxonNavigator
+page.name.32 = Taxon Navigator
 page.name.33 = Sortierung im TaxonNavigator
+page.name.34 = Debug Einstellungen
 command.label.clone = Klonen
-command.label.openInSpecimenEditor = \u00d6ffnen im Specimen-Editor
\ No newline at end of file
+command.label.openInSpecimenEditor = \u00d6ffnen im Specimen-Editor
+page.name.31 = Taxon-Node-Reihenfolge
+extension.name.0 = Popup Menu Befehle
+command.name.8 = Datenquelle klonen
+command.name.9 = \u00d6ffne Feature Tree-Wizard
+command.name.10 = \u00d6ffne Passwort-Wizard
+command.name.11 = \u00d6ffne Verbreitungs-Wizard
+command.name.12 = Verbinden
+wizard.name.18 = CSV
+wizard.name.19 = CSV_NAME
+wizard.name.20 = CSV_PRINT
+command.name.13 = L\u00f6schen
+command.name.14 = L\u00f6schen
+page.name.32 = Taxon Navigator
+page.name.33 = Reihenfolge der Taxon-Nodes
+command.name.15 = \u00d6ffnen
+view.name.SESSIONS = Sessions
+command.label.SESSION = Sessions
+command.label.CONNECT = Verbinden
+command.label.RE_CONNECT = Aktualisiere Verbindung
+command.name.CONNECT = Verbinden
+command.name.RE_CONNECT = Aktualisiere Verbindung
+command.name.OPEN_CLASSIFICATION_WIZARD = \u00d6ffne Klassifikations-Wizardcommand.name.OPEN_TAXONNODE_WIZARD = \u00d6ffne Taxon Node-Wizard
\ No newline at end of file
index f7a01268f93f05b428b927c4244e5289f704b165..ad278768865dd660e7124d0b37f01fea95807d89 100644 (file)
@@ -16,7 +16,24 @@ LanguageEditorPreferencePage_PleaseRestart=Please Restart
 LanguageEditorPreferencePage_RestartRequired=After changing the default language, a restart is required,\nin order for the new settings to take effect.\r
 OrderPreferencePage_NewNavigatorWindowRequired=After changing the order of the taxon nodes, closing and reopen of the taxon navigator is required.\r
 OrderPreferencePage_PleaseReopenNavigator=Please close and reopen the taxon navigator.\r
-UriWithLabelElement_URL_NOT_SAVED=URL won't be saved\! \r
-UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Could not open external browser. URL is invalid.\r
-UriWithLabelElement_INVALID_URL=Invalid URL\r
+UriWithLabelElement_URL_NOT_SAVED=URI won't be saved\! \r
+UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Could not open external browser. URI is invalid.\r
+UriWithLabelElement_INVALID_URL=Invalid URI\r
 UriWithLabelElement_OPEN_EXTERNAL_BROWSER=Open in external browser\r
+\r
+ChangeConnectionHandler_ALREADY_CONNECTING=Already connecting\r
+ChangeConnectionHandler_CONFIRM_DATASOURCE=Confirm Datasource Connection\r
+ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY=You are currently connecting to a different datasource already.\r
+ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE=Chosen datasource is not available\r
+ChangeConnectionHandler_REALLY_WANT_TO_CONNECT=Do you really want to connect to this datasource?\n\n\r
+ChangeConnectionHandler_NOT_AVAILABLE_REASONS=This could mean that either the database server is not running or the machine is not reachable.\n\n Please also make sure that you are connected to the network when trying to connect to a remote datasource.\r
+\r
+LoginDialog_CANCEL_MESSAGE=Aborting the login procedure will close the database.\r
+LoginDialog_LOGIN=Login\r
+LoginDialog_PASSWORD=Password\r
+LoginDialog_REALLY_CANCEL=Do you really want to cancel?\r
+LoginDialog_USER_LOGIN=User Login\r
+LoginDialog_USER_NAME=Username\r
+\r
+CdmViewerContextMenu_OPEN=Open (%s)\r
+CdmViewerContextMenu_OPEN_IN=Open in...\r
index 1241f571fe803e28d4d546f5c2394032b890f7a1..7cab6fc636e7291f0213774ba18e90402353d830 100644 (file)
@@ -15,7 +15,25 @@ LanguageEditorPreferencePage_EditorHasToRestart=Der Anwendung muss neu gestartet
 LanguageEditorPreferencePage_PleaseRestart=Bitte neu starten
 LanguageEditorPreferencePage_RestartRequired=Nach dem Wechsel der Standardsprache ist ein Neustart erforderlich.
 OrderPreferencePage_NewNavigatorWindowRequired=Nach dem Ã„ndern der Taxon Sortierung, ist das Schließen und erneute Ã–ffnen des taxon Navigators erforderlich.
-UriWithLabelElement_URL_NOT_SAVED=URL wird nicht gespeichert\! 
-UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Externer Browser konnt nicht geöffnet werden. URL is ung\u00FCtlig.
-UriWithLabelElement_INVALID_URL=Ung\u00FCltiger URL
-UriWithLabelElement_OPEN_EXTERNAL_BROWSER=Im Browser Ã¶ffnen 
\ No newline at end of file
+UriWithLabelElement_URL_NOT_SAVED=URI wird nicht gespeichert\! 
+UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Externer Browser konnte nicht geöffnet werden. URI ist ung\u00FCtlig.
+UriWithLabelElement_INVALID_URL=Ung\u00FCltige URI
+UriWithLabelElement_OPEN_EXTERNAL_BROWSER=Im Browser Ã¶ffnen 
+
+ChangeConnectionHandler_ALREADY_CONNECTING=Verbindung wird aufgebaut
+ChangeConnectionHandler_CONFIRM_DATASOURCE=Verbindung bestätigen
+ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY=Es wird schon eine Verbindung zu einer Datenquelle aufgebaut
+ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE=Gewählte Datenquelle nicht verfügbar
+ChangeConnectionHandler_REALLY_WANT_TO_CONNECT=Wollen Sie sich wirklich mit dieser Datenquelle verbinden?\n\n
+ChangeConnectionHandler_NOT_AVAILABLE_REASONS=Eventuell ist der Server nicht verfügbar oder erreichbar.\n\nStellen Sie bitte auch sicher, dass sie Netzzugang haben, wenn sie sich zu einer Remote-Datenquelle verbinden.
+
+LoginDialog_CANCEL_MESSAGE=Ein Abbruch wird die Verbindung zur Datenquelle schließen.
+LoginDialog_LOGIN=Login
+LoginDialog_PASSWORD=Passwort
+LoginDialog_REALLY_CANCEL=Wollen Sie wirklich abbrechen?
+LoginDialog_USER_LOGIN=Benutzer Login
+LoginDialog_USER_NAME=Benutzername
+
+CdmViewerContextMenu_OPEN=\u00d6ffnen (%s)
+CdmViewerContextMenu_OPEN_IN=\u00d6ffnen in...
+
diff --git a/eu.etaxonomy.taxeditor.store/icons/specimen_derivate_type-16x16-32.png b/eu.etaxonomy.taxeditor.store/icons/specimen_derivate_type-16x16-32.png
new file mode 100644 (file)
index 0000000..e5f6faf
Binary files /dev/null and b/eu.etaxonomy.taxeditor.store/icons/specimen_derivate_type-16x16-32.png differ
index 320968a8ba32cac8b9abdb71a6e7b08e4d0451ce..768db4a3e12809060043ebf65b24be7937bcba21 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.2"?>
 <plugin>
-   <extension-point id="eu.etaxonomy.taxeditor.store.cdmViewer" name="%extension-point.name" schema="schema/eu.etaxonomy.taxeditor.store.cdmViewer.exsd"/>
+   <extension-point id="eu.etaxonomy.taxeditor.store.cdmViewer" name="Cdm Viewer" schema="schema/eu.etaxonomy.taxeditor.store.cdmViewer.exsd"/>
    <extension
          point="org.eclipse.ui.preferencePages">
       <page
@@ -39,6 +39,7 @@
             id="eu.etaxonomy.taxeditor.preferences.nomenclatural"
             name="%page.name.4">
       </page>
+     
       <!--page
             class="eu.etaxonomy.taxeditor.store.preference.CdmPreferences"
             id="eu.etaxonomy.taxeditor.preferences.cdm"
             id="eu.etaxonomy.taxeditor.preference.TaxonNavigator"
             name="%page.name.32">
       </page>
+       <page
+            category="eu.etaxonomy.taxeditor.preferences.general"
+            class="eu.etaxonomy.taxeditor.preference.DebugPreferences"
+            id="eu.etaxonomy.taxeditor.preferences.debug"
+            name="%page.name.34">
+      </page>
    </extension>
    <extension
          point="org.eclipse.ui.views">
         restorable="true">
   </view>
   <view
-        class="eu.etaxonomy.taxeditor.view.derivateSearch.DerivateSearchView"
-        icon="icons/derivate_search_view-16x16-32.png"
-        id="eu.etaxonomy.taxeditor.view.derivateSearch.DerivateSearchView"
-        name="%view.name.6"
-        restorable="true">
+        allowMultiple="false"
+        class="eu.etaxonomy.taxeditor.view.sessions.SessionsViewPart"
+        id="eu.etaxonomy.taxeditor.view.sessions.SessionsViewPart"
+        name="%view.name.SESSIONS"
+        restorable="false">
   </view>
    </extension>
    <extension
                label="%menu.label">
             <command
                   commandId="org.eclipse.ui.views.showView"
-                  label="%command.label"
-                  style="push">
-               <parameter
-                     name="org.eclipse.ui.views.showView.viewId"
-                     value="eu.etaxonomy.taxeditor.view.derivateSearch.DerivateSearchView">
-               </parameter>
-            </command>
-            <separator
-                  name="eu.etaxonomy.taxeditor.store.showViewMenu.details"
-                  visible="true">
-            </separator>
-            <command
-                  commandId="org.eclipse.ui.views.showView"
+                  id="eu.etaxonomy.taxeditor.store.showViewMenu.details"
                   label="%command.label.0"
                   style="push">
                <parameter
                      name="org.eclipse.ui.views.showView.viewId"
                      value="eu.etaxonomy.taxeditor.view.detail">
                </parameter>
+               <visibleWhen
+                     checkEnabled="true">
+                  <reference
+                        definitionId="isCdmStoreConnected">
+                  </reference>
+               </visibleWhen>
             </command>
             <command
                   commandId="org.eclipse.ui.views.showView"
                      name="org.eclipse.ui.views.showView.viewId"
                      value="eu.etaxonomy.taxeditor.view.supplementalData">
                </parameter>
+               <visibleWhen
+                     checkEnabled="true">
+                  <reference
+                        definitionId="isCdmStoreConnected">
+                  </reference>
+               </visibleWhen>
             </command>
             <!-- Originally used by validation framework, currently not in use -->
        <!--        <command
                      name="org.eclipse.ui.views.showView.viewId"
                      value="eu.etaxonomy.taxeditor.reporting.viewPart">
                </parameter>
+               <visibleWhen
+                     checkEnabled="true">
+                  <and>
+                     <reference
+                           definitionId="isShowExperimentalFeatures">
+                     </reference>
+                     <reference
+                           definitionId="isCdmStoreConnected">
+                     </reference>
+                  </and>
+               </visibleWhen>
+            </command>
+            <command
+                  commandId="org.eclipse.ui.views.showView"
+                  label="%command.label.SESSION"
+                  style="push">
+               <parameter
+                     name="org.eclipse.ui.views.showView.viewId"
+                     value="eu.etaxonomy.taxeditor.view.sessions.SessionsViewPart">
+               </parameter>
                <visibleWhen
                      checkEnabled="true">
                   <reference
-                        definitionId="isShowExperimentalFeatures">
+                        definitionId="isCdmStoreConnected">
                   </reference>
                </visibleWhen>
             </command>
          </menu>
       </menuContribution>
-      <menuContribution
-            class="eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermMenuFactory"
-            locationURI="menu:org.eclipse.ui.main.menu.window?before=eu.etaxonomy.taxeditor.application.windowMenu.last">
+      <menuContribution 
+         allPopups="false" 
+                 locationURI="menu:org.eclipse.ui.main.menu.window?before=eu.etaxonomy.taxeditor.application.windowMenu.last"> 
+           <dynamic 
+                    class="eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermMenu" 
+                   id="eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermMenu"> 
+              <visibleWhen 
+                      checkEnabled="true"> 
+                  <reference 
+                        definitionId="isCdmStoreConnected"> 
+                  </reference> 
+             </visibleWhen> 
+        </dynamic> 
       </menuContribution>
       <menuContribution
             locationURI="menu:org.eclipse.ui.main.menu.file?after=eu.etaxonomy.taxeditor.application.filemenu.io">
+         <command
+               commandId="eu.etaxonomy.taxeditor.store.operations.showRemotingLoginWindow"
+               label="%command.label.CONNECT"
+               style="push">
+         </command>
          <command
                commandId="eu.etaxonomy.taxeditor.store.operations.showLoginWindow"
                label="%command.label.5"
                style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isUserLoggedIn">
+               </reference>
+            </visibleWhen>
+         </command>
+         <command
+               commandId="eu.etaxonomy.taxeditor.store.operations.reconnect"
+               label="%command.label.RE_CONNECT"
+               style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isUserLoggedIn">
+               </reference>
+            </visibleWhen>
          </command>
          <separator
                name="eu.etaxonomy.taxeditor.application.filemenu.login"
             </visibleWhen>
          </command>
       </menuContribution>
-      <menuContribution
-            allPopups="false"
-            locationURI="popup:eu.etaxonomy.taxeditor.view.derivateSearch.DerivateSearchView">
-         <command
-               commandId="eu.etaxonomy.taxeditor.editor.handler.openDerivateView"
-               label="%command.label.openInSpecimenEditor"
-               style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <with
-                     variable="selection">
-                  <count
-                        value="+">
-                  </count>
-               </with>
-            </visibleWhen>
-         </command>
-      </menuContribution>
    </extension>
    <extension
          point="org.eclipse.ui.handlers">
          </activeWhen>
       </handler>
       <handler
-            class="eu.etaxonomy.taxeditor.handler.ShowLoginWindowHandler"
-            commandId="eu.etaxonomy.taxeditor.store.operations.showLoginWindow">
-         <enabledWhen>
-            <reference
-                  definitionId="isUserLoggedIn">
-            </reference></enabledWhen>
+            class="eu.etaxonomy.taxeditor.handler.ShowRemotingLoginWindowHandler"
+            commandId="eu.etaxonomy.taxeditor.store.operations.showRemotingLoginWindow">
       </handler>
       <handler
             class="eu.etaxonomy.taxeditor.handler.OpenPasswordWizzardHandler"
             </reference>
          </activeWhen>
       </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.handler.SwitchUserHandler"
+            commandId="eu.etaxonomy.taxeditor.store.operations.showLoginWindow">
+         <activeWhen>
+            <reference
+                  definitionId="isRemoting">
+            </reference>
+         </activeWhen>
+      </handler>
    </extension>
    <extension
          name="%extension.name.0"
             name="%command.name.3">
       </command>
       <command
+            defaultHandler="eu.etaxonomy.taxeditor.handler.ShowLoginWindowHandler"
             id="eu.etaxonomy.taxeditor.store.operations.showLoginWindow"
             name="%command.name.4">
       </command>
+      <command
+            id="eu.etaxonomy.taxeditor.store.operations.showRemotingLoginWindow"
+            name="%command.name.CONNECT">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.handler.ReconnectHandler"
+            id="eu.etaxonomy.taxeditor.store.operations.reconnect"
+            name="%command.name.RE_CONNECT">
+      </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.editor.definedterm.handler.OpenDefinedTermEditorHandler"
             id="eu.etaxonomy.taxeditor.store.openDefinedTermEditor"
             id="eu.etaxonomy.taxeditor.editor.definedTerms.delete"
             name="%command.name.14">
       </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.handler.OpenInspectSessionsHandler"
+            id="eu.etaxonomy.taxeditor.store.open.InspectSessionsDialog"
+            name="Inspect Active Session">
+      </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.handler.OpenHandler"
             id="eu.etaxonomy.taxeditor.store.open"
             name="%command.name.15">
       </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.handler.defaultHandler.DefaultOpenClassificationWizardHandler"
+            id="eu.etaxonomy.taxeditor.command.openClassificationWizard"
+            name="%command.name.OPEN_CLASSIFICATION_WIZARD">
+         <commandParameter
+               id="eu.etaxonomy.taxeditor.command.openClassificationWizard.uuid"
+               name="Classification Uuid"
+               optional="true"
+               typeId="eu.etaxonomy.taxeditor.uuidParameterType">
+         </commandParameter>
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.handler.defaultHandler.DefaultOpenTaxonNodeWizardHandler"
+            id="eu.etaxonomy.taxeditor.command.openTaxonNodeWizard"
+            name="%command.name.OPEN_TAXONNODE_WIZARD">
+         <commandParameter
+               id="eu.etaxonomy.taxeditor.command.openTaxonNodeWizard.uuid"
+               name="TaxonNode Uuid"
+               optional="true"
+               typeId="eu.etaxonomy.taxeditor.uuidParameterType">
+         </commandParameter>
+      </command>
+   </extension>
+   <extension
+         point="org.eclipse.ui.commands">
+      <commandParameterType
+            converter="eu.etaxonomy.taxeditor.handler.UuidsParameterTypeConverter"
+            id="eu.etaxonomy.taxeditor.uuidParameterType"
+            type="java.util.UUID">
+      </commandParameterType>
+      <commandParameterType
+            converter="eu.etaxonomy.taxeditor.handler.UuidsParameterTypeConverter"
+            id="eu.etaxonomy.taxeditor.uuidsParameterType"
+            type="java.util.List">
+      </commandParameterType>
    </extension>
    <extension
          point="org.eclipse.ui.importWizards">
       </variable>
    </sourceProvider>
 </extension>
+<extension
+      point="eu.etaxonomy.taxeditor.store.cdmViewer">
+   <viewCommandMapping
+         commandId="eu.etaxonomy.taxeditor.command.openClassificationWizard"
+         selection="eu.etaxonomy.cdm.model.taxon.Classification"
+         viewerName="Classification Wizard">
+   </viewCommandMapping>
+   <viewCommandMapping
+         commandId="eu.etaxonomy.taxeditor.command.openTaxonNodeWizard"
+         selection="eu.etaxonomy.cdm.model.taxon.TaxonNode"
+         viewerName="TaxonNode Wizard">
+   </viewCommandMapping>
+</extension>
 </plugin>
index 30f30166fd06b5790f12000c70f100795d077c0a..be8b4ca35d21df029ef04b9391f1342c07ab468e 100644 (file)
@@ -3,7 +3,7 @@
   <parent>
        <groupId>eu.etaxonomy</groupId>
        <artifactId>taxeditor-parent</artifactId>
-       <version>3.8.0-SNAPSHOT</version>
+       <version>4.0.0-SNAPSHOT</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
index 42791ec3b89d6c6967cb86041814a7d482ff7619..7393c60f656bd949f72e45f1f7cc80d7bc31ca37 100644 (file)
@@ -21,7 +21,7 @@
       </annotation>
       <complexType>
          <sequence>
-            <element ref="cdmViewer" minOccurs="1" maxOccurs="unbounded"/>
+            <element ref="viewCommandMapping" minOccurs="0" maxOccurs="unbounded"/>
          </sequence>
          <attribute name="point" type="string" use="required">
             <annotation>
       </complexType>
    </element>
 
-   <element name="cdmViewer">
+   <element name="viewCommandMapping">
       <annotation>
          <documentation>
-            A Cdm Viewer knows what viewer or editor can show which input.
+            Maps a viewing class, like editors or views, to a command which opens it.
          </documentation>
       </annotation>
       <complexType>
-         <sequence>
-         </sequence>
-         <attribute name="class" type="string" use="required">
+         <attribute name="commandId" type="string" use="required">
             <annotation>
                <documentation>
-                  The class of the viewer.
+                  The command which opens the viewer to show the selected object
                </documentation>
                <appInfo>
-                  <meta.attribute kind="java" basedOn=":eu.etaxonomy.taxeditor.view.ICdmViewer"/>
+                  <meta.attribute kind="identifier" basedOn="org.eclipse.ui.commands/command/@id"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+         <attribute name="viewerName" type="string">
+            <annotation>
+               <documentation>
+                  The name of the viewer which shows the selected element
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="selection" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The class of the selected element
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="java"/>
                </appInfo>
             </annotation>
          </attribute>
index 0aa1e9c64bf59c75a92f0ac8e4439478b7219c74..9d094c53a35ce28ba86f38d04f7f5f03797cdf21 100644 (file)
@@ -22,6 +22,12 @@ public class Messages extends NLS {
     public static String LanguageEditorPreferencePage_EditorHasToRestart;
     public static String LanguageEditorPreferencePage_PleaseRestart;
     public static String LanguageEditorPreferencePage_RestartRequired;
+    public static String LoginDialog_CANCEL_MESSAGE;
+    public static String LoginDialog_LOGIN;
+    public static String LoginDialog_PASSWORD;
+    public static String LoginDialog_REALLY_CANCEL;
+    public static String LoginDialog_USER_LOGIN;
+    public static String LoginDialog_USER_NAME;
     public static String OrderPreferencePage_NewNavigatorWindowRequired;
     public static String OrderPreferencePage_PleaseReopenNavigator;
     public static String CdmDataSourceViewPart_1;
@@ -36,6 +42,14 @@ public class Messages extends NLS {
     public static String CdmDataSourceViewPart_7;
     public static String CdmDataSourceViewPart_8;
     public static String CdmDataSourceViewPart_9;
+    public static String CdmViewerContextMenu_OPEN;
+    public static String CdmViewerContextMenu_OPEN_IN;
+    public static String ChangeConnectionHandler_ALREADY_CONNECTING;
+    public static String ChangeConnectionHandler_CONFIRM_DATASOURCE;
+    public static String ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY;
+    public static String ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE;
+    public static String ChangeConnectionHandler_REALLY_WANT_TO_CONNECT;
+    public static String ChangeConnectionHandler_NOT_AVAILABLE_REASONS;
     public static String UriWithLabelElement_COULD_NOT_OPEN_BROWSER;
     public static String UriWithLabelElement_INVALID_URL;
     public static String UriWithLabelElement_OPEN_EXTERNAL_BROWSER;
index d676ca2a2ace038346efb62bceadab981bee56e5..0275cc47100a772f81bd429b74d96f82ddc37257 100644 (file)
@@ -30,12 +30,13 @@ import eu.etaxonomy.cdm.database.CdmPersistentDataSource;
 import eu.etaxonomy.cdm.database.DataSourceNotFoundException;
 import eu.etaxonomy.cdm.database.ICdmDataSource;
 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
-import eu.etaxonomy.cdm.remote.CdmPersistentRemoteSource;
-import eu.etaxonomy.cdm.remote.CdmRemoteSourceException;
-import eu.etaxonomy.cdm.remote.ICdmRemoteSource;
+
 import eu.etaxonomy.taxeditor.model.MementoHelper;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.remoting.source.CdmPersistentRemoteSource;
+import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSourceException;
+import eu.etaxonomy.taxeditor.remoting.source.ICdmRemoteSource;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 public class CdmDataSourceRepository{
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/CdmEntitySessionInput.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/CdmEntitySessionInput.java
new file mode 100644 (file)
index 0000000..8b9362d
--- /dev/null
@@ -0,0 +1,63 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.editor;
+
+import java.util.List;
+import java.util.Map;
+
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author cmathew
+ * @date 5 Feb 2015
+ *
+ */
+public abstract class CdmEntitySessionInput implements ICdmEntitySessionEnabled {
+
+    private ICdmEntitySession cdmEntitySession;
+
+    public CdmEntitySessionInput(boolean init) {
+        if(init) {
+            initSession();
+        }
+    }
+
+    protected void initSession() {
+        cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
+    }
+
+    @Override
+    public ICdmEntitySession getCdmEntitySession() {
+        return cdmEntitySession;
+    }
+
+    public void bind() {
+        cdmEntitySession.bind();
+    }
+
+    public void dispose() {
+        cdmEntitySession.dispose();
+    }
+
+    public abstract void merge();
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+     */
+    @Override
+    public Map<Object, List<String>> getPropertyPathsMap() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}
index 7ea235d19d1a2e77b68cd694b2cc32233cb6fc3d..07b5abb84e8b1698c4ac606493933b2fd98b5f85 100644 (file)
@@ -49,7 +49,6 @@ public class DefinedTermDropAdapter extends ViewerDropAdapter {
 \r
                TermBase target = (TermBase) getCurrentTarget();//can be vocab\r
                int currentLocation = getCurrentLocation();\r
-               System.out.println("current location : " + currentLocation + " , target : " + target.getTitleCache());\r
                //DefinedTermBase[] droppedElements = (DefinedTermBase[]) data;\r
                Object[] droppedTerms = (Object[]) data;\r
                Collection<DefinedTermBase> sourceTerms = new ArrayList<DefinedTermBase>(); //Arrays.asList(droppedElements)\r
index 8cae931e980bcd485a7b65b85932fae29afce75c..d4592ef3fb6d9d9f1d5cf103e7a8b0d3c962d310 100644 (file)
@@ -61,7 +61,6 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
        private boolean dirty;\r
 \r
 \r
-\r
        private final int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;\r
        /**\r
         *\r
@@ -149,8 +148,10 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
        @Override\r
        public void doSave(IProgressMonitor monitor) {\r
                getConversationHolder().commit();\r
+               getDefinedTermEditorInput().merge();\r
                setDirty(false);\r
                getDefinedTermEditorInput().initialiseVocabularies();\r
+               viewer.refresh();\r
        }\r
 \r
 \r
@@ -178,6 +179,7 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
        public void setFocus() {\r
            viewer.getControl().setFocus();\r
                getConversationHolder().bind();\r
+               getDefinedTermEditorInput().bind();\r
        }\r
 \r
        @Override\r
@@ -245,10 +247,10 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
                    OrderedTermBase otbe2 = (OrderedTermBase)e2;\r
                    if(otbe1.getOrderIndex() == otbe2.getOrderIndex()) {\r
                        return 0;\r
-                   } else if(otbe1.isHigher(otbe2)) {\r
-                       return 1;\r
-                   } else {\r
-                       return -1;\r
+                   } else if (otbe1.getOrderIndex() < otbe2.getOrderIndex()){\r
+                       return -1;\r
+                   } else{\r
+                       return 1;\r
                    }\r
                } else {\r
                    return super.compare(viewer, e1, e2);\r
@@ -256,5 +258,9 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
            }\r
        }\r
 \r
-\r
+       @Override\r
+       public void dispose() {\r
+           getDefinedTermEditorInput().dispose();\r
+           super.dispose();\r
+       }\r
 }
\ No newline at end of file
similarity index 57%
rename from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenuFactory.java
rename to eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenu.java
index 9bd7ccbda2d8ed188e837b2cd847829e0abab79a..4f3e7770f5ec7011fd5eb248c1f43e6aeaa6a48c 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2009 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -11,6 +11,7 @@
 package eu.etaxonomy.taxeditor.editor.definedterm;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.EnumSet;
@@ -23,89 +24,89 @@ import org.eclipse.jface.action.IContributionItem;
 import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.action.Separator;
 import org.eclipse.swt.SWT;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.CompoundContributionItem;
 import org.eclipse.ui.menus.CommandContributionItem;
 import org.eclipse.ui.menus.CommandContributionItemParameter;
-import org.eclipse.ui.menus.ExtensionContributionFactory;
-import org.eclipse.ui.menus.IContributionRoot;
-import org.eclipse.ui.services.IServiceLocator;
 
 import eu.etaxonomy.cdm.model.common.TermType;
 
 /**
- * Menu factory used in the store plugin xml to dynamically generate menu (sub-menu) contribution items
+ * Menu used in the store plugin xml to dynamically generate menu (sub-menu) contribution items
  * for term types which when clicked open the defined term editor for the chosen term type
- * 
- * @author c.mathew
- * @date 18 Jul 2013
+ *
+ * @author pplitzner
+ * @date 21 Jul 2015
  *
  */
 
-public class DefinedTermMenuFactory extends ExtensionContributionFactory {     
-       
-       @Override
-       public void createContributionItems(IServiceLocator serviceLocator,
-                       IContributionRoot additions) {
-               
-               MenuManager dtMenuManager = 
-                               new MenuManager("Term Editor","eu.etaxonomy.taxeditor.store.definedTermEditorMenu"); 
-               
-               dtMenuManager.setVisible(true);
-        
-               additions.addContributionItem(dtMenuManager, null);
-               List<TermType> ttList = new ArrayList<TermType>(EnumSet.allOf(TermType.class));
-               Collections.sort(ttList,new SortByTermTypeMessage());
-        for (TermType tt : ttList)
-        {
-               // if term type has a parent, do not add it
-               // it will be added in the recursive call
-               if(tt.getKindOf() == null) {
-                       IContributionItem ici = addChildTermsToMenuManager(tt, serviceLocator);                 
-                       if(ici != null) {                                                       
-                               dtMenuManager.add(ici);
-                       }
-               }
-        }                                     
+public class DefinedTermMenu extends CompoundContributionItem {
+
+
+    @Override
+    protected IContributionItem[] getContributionItems() {
+        Collection<IContributionItem> items = new ArrayList<IContributionItem>();
+           MenuManager dtMenuManager =
+                   new MenuManager("Term Editor","eu.etaxonomy.taxeditor.store.definedTermEditorMenu");
+
+           dtMenuManager.setVisible(true);
+
+           items.add(dtMenuManager);
+           List<TermType> ttList = new ArrayList<TermType>(EnumSet.allOf(TermType.class));
+           Collections.sort(ttList,new SortByTermTypeMessage());
+           for (TermType tt : ttList)
+           {
+               // if term type has a parent, do not add it
+               // it will be added in the recursive call
+               if(tt.getKindOf() == null) {
+                   IContributionItem ici = addChildTermsToMenuManager(tt);
+                   if(ici != null) {
+                       dtMenuManager.add(ici);
+                   }
+               }
+           }
+           return items.toArray(new IContributionItem[]{});
        }
-       
-       private IContributionItem addChildTermsToMenuManager(TermType termType, IServiceLocator serviceLocator) {
-       
+
+       private IContributionItem addChildTermsToMenuManager(TermType termType) {
+
                //FIXME : need a better way to find out if a term type can be editable (ticket 3853)
                if(termType.getEmptyDefinedTermBase() != null) {
                        Set<TermType> children = termType.getGeneralizationOf();
                        // term type has no children, so create menu item
-                       if(children.isEmpty()) {                        
-                               return createMenuItem(termType, serviceLocator);
+                       if(children.isEmpty()) {
+                               return createMenuItem(termType);
                        }
-                       // term type has children, so create sub menu           
-                       MenuManager dtMenuManager = 
-                                       new MenuManager(termType.getMessage(),"eu.etaxonomy.taxeditor.store." + termType.getKey() + "Menu"); 
+                       // term type has children, so create sub menu
+                       MenuManager dtMenuManager =
+                                       new MenuManager(termType.getMessage(),"eu.etaxonomy.taxeditor.store." + termType.getKey() + "Menu");
                        dtMenuManager.setVisible(true);
-                       dtMenuManager.add(createDefaultMenuItem(termType, serviceLocator));
+                       dtMenuManager.add(createDefaultMenuItem(termType));
 
                        Separator sep = new Separator();
                        dtMenuManager.add(sep);
                        // add child items to the sub menu
-                       for(TermType tt : children) {                   
-                               IContributionItem item = addChildTermsToMenuManager(tt,serviceLocator);
-                               if(item != null) {                              
+                       for(TermType tt : children) {
+                               IContributionItem item = addChildTermsToMenuManager(tt);
+                               if(item != null) {
                                        dtMenuManager.add(item);
-                               }                                       
-                       }               
+                               }
+                       }
                        return dtMenuManager;
                } else {
                        return null;
                }
-               
+
        }
-       
-       private CommandContributionItem createMenuItem(TermType termType, IServiceLocator serviceLocator) {
-               
+
+       private CommandContributionItem createMenuItem(TermType termType) {
+
                Map<String, String> params = new HashMap<String, String>();
                params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
-                               termType.getUuid().toString());         
-               
+                               termType.getUuid().toString());
+
         CommandContributionItemParameter p = new CommandContributionItemParameter(
-                serviceLocator, 
+                PlatformUI.getWorkbench(),
                 "",
                 "eu.etaxonomy.taxeditor.store.openDefinedTermEditor",
                 params,
@@ -114,24 +115,24 @@ public class DefinedTermMenuFactory extends ExtensionContributionFactory {
                 null,
                 termType.getMessage(),
                 "",
-                "",                
+                "",
                 SWT.PUSH,
                 "",
                 true);
-   
-        CommandContributionItem item = new CommandContributionItem(p);   
+
+        CommandContributionItem item = new CommandContributionItem(p);
         return item;
-               
+
        }
-       
-       private CommandContributionItem createDefaultMenuItem(TermType termType, IServiceLocator serviceLocator) {
-               
+
+       private CommandContributionItem createDefaultMenuItem(TermType termType) {
+
                Map<String, String> params = new HashMap<String, String>();
                params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
-                               termType.getUuid().toString());         
-               
+                               termType.getUuid().toString());
+
         CommandContributionItemParameter p = new CommandContributionItemParameter(
-                serviceLocator, 
+                PlatformUI.getWorkbench(),
                 "",
                 "eu.etaxonomy.taxeditor.store.openDefinedTermEditor",
                 params,
@@ -140,23 +141,24 @@ public class DefinedTermMenuFactory extends ExtensionContributionFactory {
                 null,
                 "Other " + termType.getMessage() + "s",
                 "",
-                "",                
+                "",
                 SWT.PUSH,
                 "",
                 true);
-        
-        
-   
-        CommandContributionItem item = new CommandContributionItem(p);   
+
+
+
+        CommandContributionItem item = new CommandContributionItem(p);
         return item;
-               
+
        }
-       
+
        private class SortByTermTypeMessage implements Comparator<TermType> {
-           public int compare(TermType t1, TermType t2) {
+           @Override
+        public int compare(TermType t1, TermType t2) {
                return t1.getMessage().compareTo(t2.getMessage());
            }
        }
-       
+
 
 }
index 6a2038534709ea63958236e57366fcd948d9a4a6..ac9ff958b45ff5dca05480a8533cbb1390e3bdb5 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -16,12 +16,16 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;\r
 import org.eclipse.core.commands.common.NotDefinedException;\r
 import org.eclipse.core.commands.operations.IUndoContext;\r
+import org.eclipse.jface.dialogs.MessageDialog;\r
+import org.eclipse.jface.viewers.ISelection;\r
 import org.eclipse.jface.viewers.IStructuredSelection;\r
+import org.eclipse.ui.IEditorPart;\r
 import org.eclipse.ui.handlers.HandlerUtil;\r
 \r
 import eu.etaxonomy.cdm.model.common.TermBase;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.operation.DeleteTermBaseOperation;\r
+import eu.etaxonomy.taxeditor.model.AbstractUtility;\r
 import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
 import eu.etaxonomy.taxeditor.store.StoreUtil;\r
@@ -33,42 +37,48 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  */\r
 public class DeleteTermBaseHandler extends AbstractHandler {\r
 \r
-       /* (non-Javadoc)\r
-        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)\r
-        */\r
        @Override\r
        public Object execute(ExecutionEvent event) throws ExecutionException {\r
-               DefinedTermEditor editor = (DefinedTermEditor) HandlerUtil\r
+               IEditorPart editor = HandlerUtil\r
                                .getActiveEditor(event);\r
 \r
+               if (editor.isDirty()){\r
+                       boolean proceed = MessageDialog.openQuestion(null,\r
+                                       "Save changes", "You have made changes that must be saved before this query can be executed. Would you like to proceed?");\r
+                       if (proceed) {\r
+                               editor.doSave(null);\r
+                       } else {\r
+                               return null;\r
+                       }\r
+               }\r
                if (editor instanceof DefinedTermEditor){\r
-                       DefinedTermEditor dfe = (DefinedTermEditor) editor;\r
-                       try {\r
-                               String label = event.getCommand().getName();\r
-                               IUndoContext undoContext = StoreUtil.getUndoContext();\r
+                   DefinedTermEditor dfe = (DefinedTermEditor) editor;\r
+                   try {\r
+                       String label = event.getCommand().getName();\r
+                       IUndoContext undoContext = StoreUtil.getUndoContext();\r
 \r
-                               IStructuredSelection selection = (IStructuredSelection) HandlerUtil\r
-                                               .getCurrentSelection(event);\r
+                       ISelection selection = dfe.getViewer().getSelection();\r
+                       if(selection instanceof IStructuredSelection){\r
 \r
-                               Iterator<TermBase> selectionIterator = selection.iterator();\r
+                           Iterator<TermBase> selectionIterator = ((IStructuredSelection) selection).iterator();\r
 \r
-                               while (selectionIterator.hasNext()){\r
+                           while (selectionIterator.hasNext()){\r
 \r
-                                       TermBase term = selectionIterator.next();\r
+                               TermBase term = selectionIterator.next();\r
 \r
 \r
-                                       AbstractPostOperation operation = \r
-                                                       new DeleteTermBaseOperation(label, \r
-                                                                       undoContext,\r
-                                                                       term,\r
-                                                                       dfe.getDefinedTermEditorInput(), \r
-                                                                       editor);\r
-                                       StoreUtil.executeOperation(operation);\r
-\r
-                               }       \r
-                       } catch (NotDefinedException e) {\r
-                               MessagingUtils.error(getClass(), e);\r
-                       }\r
+                               AbstractPostOperation operation =\r
+                                       new DeleteTermBaseOperation(label,\r
+                                               undoContext,\r
+                                               term,\r
+                                               dfe.getDefinedTermEditorInput(),\r
+                                               dfe);\r
+                               AbstractUtility.executeOperation(operation);\r
+                           }\r
+                       }\r
+                   } catch (NotDefinedException e) {\r
+                       MessagingUtils.error(getClass(), e);\r
+                   }\r
                }\r
                return null;\r
        }\r
index c18d397be4a1c70b74517e0f507cec3ad804c39c..0a41321743639d691e6de8164b60263bfffe8b7d 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
  * Copyright (C) 2009 EDIT\r
- * European Distributed Institute of Taxonomy \r
+ * European Distributed Institute of Taxonomy\r
  * http://www.e-taxonomy.eu\r
- * \r
+ *\r
  * The contents of this file are subject to the Mozilla Public License Version 1.1\r
  * See LICENSE.TXT at the top of this package for the full license terms.\r
  */\r
@@ -16,19 +16,20 @@ import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IPersistableElement;\r
 \r
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
+import eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput;\r
 \r
 /**\r
  * @author l.morris\r
  * @date 3 Jan 2012\r
  *\r
  */\r
-public abstract class AbstractDefinedTermEditorInput<T extends DefinedTermBase> implements IEditorInput {\r
+public abstract class AbstractDefinedTermEditorInput<T extends DefinedTermBase> extends CdmEntitySessionInput implements IEditorInput {\r
 \r
        /**\r
-        * \r
+        *\r
         */\r
        public AbstractDefinedTermEditorInput() {\r
-               super();\r
+               super(true);\r
        }\r
 \r
        @Override\r
@@ -59,7 +60,7 @@ public abstract class AbstractDefinedTermEditorInput<T extends DefinedTermBase>
        /**\r
         * @return\r
         */\r
-       public abstract List<String> getTermClasses();          \r
+       public abstract List<String> getTermClasses();\r
+\r
 \r
-       \r
 }
\ No newline at end of file
index aef64fe08ab79c6fd90b3fc315b194532f2b94c1..518382f1f1f494a3b3f6e4c211807f0e4e9db7c5 100644 (file)
@@ -1,14 +1,15 @@
 // $Id$
 /**
 * Copyright (C) 2009 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 package eu.etaxonomy.taxeditor.editor.definedterm.input;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
@@ -19,7 +20,10 @@ import eu.etaxonomy.cdm.model.common.DefinedTerm;
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
 import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.description.FeatureTree;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.TermStore;
 
 
 
@@ -32,10 +36,15 @@ public class TermEditorInput extends AbstractDefinedTermEditorInput<DefinedTerm>
 
        private TermType termType;
        private Set<TermVocabulary<DefinedTermBase>> vocabularies;
+
+       // FIXME: the default feature should be move to CdmApplicationState
+       //        where it is a singleton instance variable
+       private static FeatureTree defaultFeatureTree = null;
+
        private List<String> termClasses = Arrays.asList(new String[]{
                        DefinedTerm.class.getName()
        });
-       
+
        public TermEditorInput(TermType termType) {
                this.termType = termType;
                vocabularies = new HashSet<TermVocabulary<DefinedTermBase>>();
@@ -56,21 +65,52 @@ public class TermEditorInput extends AbstractDefinedTermEditorInput<DefinedTerm>
        public List<String> getTermClasses() {
                return termClasses;
        }
-       
+
        public TermType getTermType() {
                return termType;
        }
-       
+
        public void initialiseVocabularies() {
                if(vocabularies != null) {
                        vocabularies.clear();
-               } 
+               }
                List<TermVocabulary<DefinedTermBase>> vocs = CdmStore.getService(IVocabularyService.class).findByTermType(termType);
-               vocabularies.addAll(vocs);                      
+               vocabularies.addAll(vocs);
        }
-       
+
        public Set<TermVocabulary<DefinedTermBase>> getVocabularies() {
                return vocabularies;
        }
 
+       public void updateDefaultFeatureTree() {
+           for(TermVocabulary vocab : getVocabularies()) {
+               if(vocab != null && TermType.Feature.equals(vocab.getTermType())) {
+                   defaultFeatureTree = null;
+               }
+           }
+       }
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Set<TermVocabulary<DefinedTermBase>>  getRootEntities() {
+        return getVocabularies();
+    }
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void merge() {
+        if(CdmStore.getCurrentSessionManager().isRemoting()) {
+            CdmStore.getService(IVocabularyService.class).merge(new ArrayList<TermVocabulary>(getRootEntities()), true);
+            updateDefaultFeatureTree();
+        }
+    }
+
+    public static FeatureTree getDefaultFeatureTree() {
+        if(defaultFeatureTree == null) {
+            defaultFeatureTree = FeatureTree.NewInstance(TermStore.getTerms(Feature.class));
+        }
+        return defaultFeatureTree;
+    }
 }
\ No newline at end of file
index b96cacdc0e3799702e0e3e5a416485751b8a5873..7d0439b6dd08e978d02f40e4a0ed4a3ce26ac404 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -23,6 +23,7 @@ import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;\r
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
+import eu.etaxonomy.taxeditor.store.CdmStore;\r
 import eu.etaxonomy.taxeditor.store.StoreUtil;\r
 \r
 /**\r
@@ -32,10 +33,10 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  */\r
 public class CreateDefinedTermOperation extends AbstractPostTaxonOperation {\r
 \r
-       \r
 \r
-       private TermBase parentTermBase;\r
-       private TermEditorInput definedTermInput;\r
+\r
+       private final TermBase parentTermBase;\r
+       private final TermEditorInput definedTermInput;\r
 \r
        /**\r
         * @param label\r
@@ -43,7 +44,7 @@ public class CreateDefinedTermOperation extends AbstractPostTaxonOperation {
         * @param postOperationEnabled\r
         */\r
        public CreateDefinedTermOperation(String label,\r
-                       IUndoContext undoContext, \r
+                       IUndoContext undoContext,\r
                        TermBase termBase,\r
                        TermEditorInput definedTermInput,\r
                        IPostOperationEnabled postOperationEnabled) {\r
@@ -58,27 +59,28 @@ public class CreateDefinedTermOperation extends AbstractPostTaxonOperation {
        @Override\r
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)\r
                        throws ExecutionException {\r
-               \r
+\r
                DefinedTermBase newTerm = definedTermInput.getTermType().getEmptyDefinedTermBase();\r
                if (newTerm == null) {\r
-                       IStatus status = \r
-                                       new Status(IStatus.CANCEL, \r
-                                                       StoreUtil.getPluginId(), \r
+                       IStatus status =\r
+                                       new Status(IStatus.CANCEL,\r
+                                                       StoreUtil.getPluginId(),\r
                                                        "Creation of term corresponding to type '" + definedTermInput.getTermType().getMessage() + "' is not yet supported");\r
                        MessagingUtils.warningDialog("Cannot create term", newTerm, status);\r
                        return status;\r
                }\r
-               \r
+               newTerm = CdmStore.getCurrentApplicationConfiguration().getTermService().save(newTerm);\r
+\r
                if (parentTermBase instanceof TermVocabulary){\r
                        TermVocabulary vocabulary = (TermVocabulary) parentTermBase;\r
                        vocabulary.addTerm(newTerm);\r
                } else if (parentTermBase instanceof DefinedTermBase) {\r
-                       DefinedTermBase parent = (DefinedTermBase) parentTermBase;                      \r
-                       parent.addIncludes(newTerm);                    \r
+                       DefinedTermBase parent = (DefinedTermBase) parentTermBase;\r
+                       parent.addIncludes(newTerm);\r
                        TermVocabulary vocabulary = parent.getVocabulary();\r
                        vocabulary.addTerm(newTerm);\r
                }\r
-               \r
+\r
                return postExecute(newTerm);\r
        }\r
 \r
index 74a8b7cf821cf881ef6b316d8a0cf89cef583461..7911410a71c708154a8a57aae37894b852b5440e 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -29,16 +29,16 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */\r
 public class CreateTermVocabularyOperation extends AbstractPostTaxonOperation {\r
 \r
-       private TermEditorInput definedEditorInput;\r
-       \r
+       private final TermEditorInput definedEditorInput;\r
+\r
        /**\r
         * @param label\r
         * @param undoContext\r
         * @param postOperationEnabled\r
         */\r
        public CreateTermVocabularyOperation(String label,\r
-                       IUndoContext undoContext, \r
-                       TermEditorInput definedEditorInput, \r
+                       IUndoContext undoContext,\r
+                       TermEditorInput definedEditorInput,\r
                        IPostOperationEnabled postOperationEnabled) {\r
                super(label, undoContext, postOperationEnabled);\r
                this.definedEditorInput = definedEditorInput;\r
@@ -50,17 +50,17 @@ public class CreateTermVocabularyOperation extends AbstractPostTaxonOperation {
        @Override\r
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)\r
                        throws ExecutionException {\r
-       \r
-               TermVocabulary termVocabulary = \r
+\r
+               TermVocabulary termVocabulary =\r
                                        TermVocabulary.NewInstance(definedEditorInput.getTermType(),\r
-                                               null, \r
-                                               "Untitled", \r
-                                               null, \r
-                                               null);          \r
-               \r
-               CdmStore.getService(IVocabularyService.class).save(termVocabulary);\r
+                                               null,\r
+                                               "Untitled",\r
+                                               null,\r
+                                               null);\r
+\r
+               termVocabulary = CdmStore.getService(IVocabularyService.class).save(termVocabulary);\r
                definedEditorInput.getVocabularies().add(termVocabulary);\r
-               \r
+\r
                return postExecute(termVocabulary);\r
        }\r
 \r
index 043332141b11245bd21714525c6e8b070aa65639..6ec4fc4c2e04a7fb1fb58a2cb2102cceafb5c1f0 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -20,8 +20,6 @@ import org.eclipse.jface.dialogs.MessageDialog;
 import eu.etaxonomy.cdm.api.service.DeleteResult;\r
 import eu.etaxonomy.cdm.api.service.ITermService;\r
 import eu.etaxonomy.cdm.api.service.IVocabularyService;\r
-import eu.etaxonomy.cdm.api.service.exception.DataChangeNoRollbackException;\r
-import eu.etaxonomy.cdm.model.common.DefinedTerm;\r
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
 import eu.etaxonomy.cdm.model.common.TermBase;\r
 import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
@@ -40,22 +38,22 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  */\r
 public class DeleteTermBaseOperation extends AbstractPostTaxonOperation {\r
 \r
-       private TermEditorInput definedEditorInput;\r
-       private TermBase termBase;\r
+       private final TermEditorInput definedEditorInput;\r
+       private final TermBase termBase;\r
        private DefinedTermEditor definedTermEditor;\r
        /**\r
         * @param label\r
         * @param undoContext\r
         * @param postOperationEnabled\r
         */\r
-       public DeleteTermBaseOperation(String label, \r
-                       IUndoContext undoContext, \r
+       public DeleteTermBaseOperation(String label,\r
+                       IUndoContext undoContext,\r
                        TermBase termBase,\r
                        TermEditorInput definedEditorInput,\r
                        IPostOperationEnabled postOperationEnabled) {\r
                super(label, undoContext, postOperationEnabled);\r
                this.termBase = termBase;\r
-               this.definedEditorInput = definedEditorInput;           \r
+               this.definedEditorInput = definedEditorInput;\r
        }\r
 \r
        /* (non-Javadoc)\r
@@ -64,25 +62,25 @@ public class DeleteTermBaseOperation extends AbstractPostTaxonOperation {
        @Override\r
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)\r
                        throws ExecutionException {\r
-               \r
-               \r
-               \r
+\r
+\r
+\r
                if (termBase instanceof TermVocabulary) {\r
                        if (((TermVocabulary)termBase).getCreatedBy() == null) {\r
                                IStatus status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "This is a CDM system vocabulary");\r
                                MessagingUtils.warningDialog("Cannot delete vocabulary", termBase, status);\r
                                return status;\r
                        }\r
-                       \r
+\r
                        if (!((TermVocabulary)termBase).getTerms().isEmpty()) {\r
                                IStatus status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "Delete all terms from this vocaulary before deleting the vocabulary.");\r
                                MessagingUtils.warningDialog("Vocabulary not empty", termBase, status);\r
                                return status;\r
-                       }                       \r
+                       }\r
 \r
-                       definedEditorInput.getVocabularies().remove((TermVocabulary)termBase); \r
-                       \r
-                       DeleteResult result =   CdmStore.getService(IVocabularyService.class).delete((TermVocabulary)termBase);\r
+                       definedEditorInput.getVocabularies().remove(termBase);\r
+\r
+                       DeleteResult result =   CdmStore.getService(IVocabularyService.class).delete(termBase.getUuid());\r
                        if (result.isError()){\r
                                StringBuffer errorString = new StringBuffer();\r
                                for (Exception e:result.getExceptions()){\r
@@ -90,41 +88,41 @@ public class DeleteTermBaseOperation extends AbstractPostTaxonOperation {
                                }\r
                                MessageDialog.openError(null, "Delete failed", errorString.toString());\r
                        }\r
-                       \r
+\r
                } else if (termBase instanceof DefinedTermBase) {\r
-                       \r
-                       \r
+\r
+\r
                        DefinedTermBase definedTermBase = (DefinedTermBase) termBase;\r
-                       \r
+\r
                        if (((DefinedTermBase)termBase).getCreatedBy() == null) {\r
                                IStatus status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "This is a CDM system defined term");\r
                                MessagingUtils.warningDialog("Cannot delete defined term", termBase, status);\r
                                return status;\r
                        }\r
                        if(!definedTermBase.getIncludes().isEmpty()){\r
-                               IStatus status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "This term includes other terms. Please delete the included terms before deleting this term.");                            \r
+                               IStatus status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "This term includes other terms. Please delete the included terms before deleting this term.");\r
                                MessagingUtils.warningDialog("Term has included terms", termBase, status);\r
                                return status;\r
-                       } \r
-                                               \r
+                       }\r
+\r
 \r
                        DefinedTermBase partOf = definedTermBase.getPartOf();\r
                        if(partOf != null){\r
                                partOf.removeIncludes(definedTermBase);\r
                        }\r
-                       \r
+\r
                        DefinedTermBase kindOf = definedTermBase.getKindOf();\r
                        if(kindOf != null){\r
                                definedTermBase.removeGeneralization(kindOf);\r
                        }\r
-                       \r
+\r
                        TermVocabulary vocabulary = definedTermBase.getVocabulary();\r
                        if(vocabulary != null){\r
                                vocabulary.removeTerm(definedTermBase);\r
                        }\r
-                       \r
-                       DeleteResult result =   CdmStore.getService(ITermService.class).delete((DefinedTermBase)termBase);\r
-                       \r
+\r
+                       DeleteResult result =   CdmStore.getService(ITermService.class).delete(termBase.getUuid());\r
+\r
                        if (result.isError()){\r
                                StringBuffer errorString = new StringBuffer();\r
                                for (Exception e:result.getExceptions()){\r
@@ -133,7 +131,7 @@ public class DeleteTermBaseOperation extends AbstractPostTaxonOperation {
                                MessageDialog.openError(null, "Delete failed", errorString.toString());\r
                        }\r
                }\r
-               \r
+\r
                return postExecute(termBase);\r
        }\r
 \r
index e6513b9a60912384a7c5cc4ea2f03e1c3d9cf5aa..bd14d0b5707b5e0915ec3c48961a0f0eda57d00e 100644 (file)
@@ -104,17 +104,23 @@ public class MoveDefinedTermOperation extends AbstractPostTaxonOperation {
                                        // DefinedTermEditor's ViewerSorter (DefinedTermSorter) class\r
                                        if(currentLocation == ViewerDropAdapter.LOCATION_BEFORE) {\r
                                            otVoc.addTermBelow((OrderedTermBase)term, (OrderedTermBase)targetTermOrVocabulary);\r
+                                           ((DefinedTermBase) targetTermOrVocabulary).getPartOf().addIncludes(term);\r
                                        }\r
 \r
                                        if(currentLocation == ViewerDropAdapter.LOCATION_AFTER) {\r
                                            otVoc.addTermAbove((OrderedTermBase)term, (OrderedTermBase)targetTermOrVocabulary);\r
+                                           ((DefinedTermBase) targetTermOrVocabulary).getPartOf().addIncludes(term);\r
                                        }\r
+                                       if(currentLocation == ViewerDropAdapter.LOCATION_ON) {\r
+                                                   targetDefinedTerm.addIncludes(term);\r
+                                                   targetDefinedTerm.getVocabulary().addTerm(term);\r
+                                               }\r
                                    }\r
-                               }\r
-                               if(currentLocation == ViewerDropAdapter.LOCATION_ON) {\r
-                                   targetDefinedTerm.addIncludes(term);\r
+                               } else{\r
+                                       targetDefinedTerm.addIncludes(term);\r
                                    targetDefinedTerm.getVocabulary().addTerm(term);\r
                                }\r
+                               \r
                        }\r
 \r
                }\r
index 3c4466647a4ad9405d9fb6d47ed03f01f9f6fe19..16efff5520ac843b5d9f63c5e16bd6ca3e597be7 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -49,7 +49,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * <p>
  * EditFeatureTreeWizardPage class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Aug 5, 2010
  * @version 1.0
@@ -69,7 +69,7 @@ public class EditFeatureTreeWizardPage extends WizardPage implements
         * <p>
         * Constructor for EditFeatureTreeWizardPage.
         * </p>
-        * 
+        *
         * @param pageName
         *            a {@link java.lang.String} object.
         */
@@ -80,7 +80,7 @@ public class EditFeatureTreeWizardPage extends WizardPage implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
         * .Composite)
@@ -153,7 +153,7 @@ public class EditFeatureTreeWizardPage extends WizardPage implements
         * <p>
         * setSelectedTree
         * </p>
-        * 
+        *
         * @param featureTree
         *            a {@link eu.etaxonomy.cdm.model.description.FeatureTree}
         *            object.
@@ -163,7 +163,9 @@ public class EditFeatureTreeWizardPage extends WizardPage implements
                viewer.setInput(featureTree);
 
                text_title.removeModifyListener(this);
-               text_title.setText(featureTree.getTitleCache());
+               if (featureTree != null){
+                       text_title.setText(featureTree.getTitleCache());
+               }
                text_title.addModifyListener(this);
        }
 
@@ -200,8 +202,11 @@ public class EditFeatureTreeWizardPage extends WizardPage implements
                                                .getAdditionalFeatures();
                                for (Feature feature : additionalFeatures) {
                                        FeatureNode child = FeatureNode.NewInstance(feature);
-                                       CdmStore.getService(IFeatureNodeService.class)
-                                                       .saveOrUpdate(child);
+                                       if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                                           CdmStore.getService(IFeatureNodeService.class).merge(child, true);
+                                       } else {
+                                           CdmStore.getService(IFeatureNodeService.class).saveOrUpdate(child);
+                                       }
                                        parent.addChild(child);
                                }
                                viewer.refresh();
@@ -237,8 +242,9 @@ public class EditFeatureTreeWizardPage extends WizardPage implements
                 */
                @Override
                public void dragFinished(DragSourceEvent event) {
-                       if (!event.doit)
-                               return;
+                       if (!event.doit) {
+                return;
+            }
                        // if the featureNode was moved, remove it from the source viewer
                        if (event.detail == DND.DROP_MOVE) {
                                IStructuredSelection selection = (IStructuredSelection) viewer
index 24a7795afecaed2f557a64ebf55cac2976e0f693..d65ad420e94c6cb1c34220b7246246ccedccc893 100644 (file)
@@ -1,20 +1,26 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.featuretree;
 
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
 import org.eclipse.jface.wizard.Wizard;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.IFeatureTreeService;
 import eu.etaxonomy.cdm.model.description.FeatureTree;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -24,30 +30,35 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @created Aug 5, 2010
  * @version 1.0
  */
-public class FeatureTreeEditorWizard extends Wizard {
-       
+public class FeatureTreeEditorWizard extends Wizard implements ICdmEntitySessionEnabled {
+
        private SelectFeatureTreeWizardPage selectFeatureTreePage;
        private EditFeatureTreeWizardPage editFeatureTreePage;
-       
+
        private FeatureTree selectedFeatureTree;
 
        private ConversationHolder conversation;
-       
+       private ICdmEntitySession cdmEntitySession;
+       private ICdmEntitySession previousCdmEntitySession;
+
        /**
         * <p>Constructor for FeatureTreeEditorWizard.</p>
         */
        public FeatureTreeEditorWizard(){
                conversation = CdmStore.createConversation();
+               previousCdmEntitySession = CdmStore.getCurrentSessionManager().getActiveSession();
+               cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
                setWindowTitle("Feature Tree Editor");
        }
-       
+
        /**
         * <p>addPages</p>
         */
-       public void addPages() {
+       @Override
+    public void addPages() {
                selectFeatureTreePage = new SelectFeatureTreeWizardPage("SELECT");
                addPage(selectFeatureTreePage);
-               
+
                editFeatureTreePage = new EditFeatureTreeWizardPage("EDIT");
                addPage(editFeatureTreePage);
        }
@@ -59,16 +70,34 @@ public class FeatureTreeEditorWizard extends Wizard {
        public boolean performFinish() {
                try{
                        if (selectedFeatureTree != null){
-                               CdmStore.getService(IFeatureTreeService.class).saveOrUpdate(selectedFeatureTree);
+                           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                               CdmStore.getService(IFeatureTreeService.class).merge(selectedFeatureTree, true);
+                           } else {
+                               CdmStore.getService(IFeatureTreeService.class).saveOrUpdate(selectedFeatureTree);
+                           }
                        }
                        conversation.commit();
                }finally{
                        conversation.close();
+                       cdmEntitySession.dispose();
+                       if(previousCdmEntitySession != null) {
+                           previousCdmEntitySession.bind();
+                       }
                }
-               
+
                return true;
        }
 
+       /** {@inheritDoc} */
+    @Override
+    public boolean performCancel() {
+        cdmEntitySession.dispose();
+        if(previousCdmEntitySession != null) {
+            previousCdmEntitySession.bind();
+        }
+        return true;
+    }
+
        /**
         * <p>Setter for the field <code>selectedFeatureTree</code>.</p>
         *
@@ -87,5 +116,31 @@ public class FeatureTreeEditorWizard extends Wizard {
        public FeatureTree getSelectedFeatureTree() {
                return selectedFeatureTree;
        }
-       
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getCdmEntitySession()
+     */
+    @Override
+    public ICdmEntitySession getCdmEntitySession() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getRootEntities()
+     */
+    @Override
+    public List<FeatureTree> getRootEntities() {
+        return Arrays.asList(selectedFeatureTree);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+     */
+    @Override
+    public Map<Object, List<String>> getPropertyPathsMap() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
 }
index 9457d0969e75f394043336e778a4d343786473f0..409dae7e618292496c491b0506838e6f42cda02b 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -11,8 +11,8 @@
 package eu.etaxonomy.taxeditor.featuretree;
 
 import java.util.List;
+import java.util.logging.ErrorManager;
 
-import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.ListViewer;
@@ -33,10 +33,10 @@ import org.eclipse.swt.widgets.Text;
 
 import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.api.service.IFeatureTreeService;
-import eu.etaxonomy.cdm.api.service.exception.DataChangeNoRollbackException;
 import eu.etaxonomy.cdm.model.description.FeatureTree;
+import eu.etaxonomy.taxeditor.model.DeleteResultMessagingUtils;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>SelectFeatureTreeWizardPage class.</p>
@@ -61,7 +61,7 @@ public class SelectFeatureTreeWizardPage extends WizardPage implements ISelectio
                super(pageName);
                setMessage("Select a Feature Tree or create a new one.");
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
         */
@@ -69,48 +69,48 @@ public class SelectFeatureTreeWizardPage extends WizardPage implements ISelectio
        @Override
        public void createControl(Composite parent) {
                Composite composite = new Composite(parent, SWT.NULL);
-               
+
                composite.setLayout(new GridLayout());
-               
+
                Composite composite_treeContent = new Composite(composite, SWT.NULL);
                composite_treeContent.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
                                true, true));
                composite_treeContent.setLayout(new GridLayout(2, false));
-               
+
                viewer = new ListViewer(composite_treeContent);
                viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-       
+
                button_remove = new Button(composite_treeContent, SWT.PUSH);
                button_remove.setText("Remove");
                button_remove.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false));
-               
+
                Composite composite_treeTitle = new Composite(composite, SWT.NULL);
                composite_treeTitle.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true,
                                false));
                composite_treeTitle.setLayout(new GridLayout(3, false));
 
-               
-               
+
+
                Label label_title = new Label(composite_treeTitle, SWT.NULL);
                label_title.setText("New Feature Tree");
 
                text_title = new Text(composite_treeTitle, SWT.NULL);
                text_title.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-               
+
                button_add = new Button(composite_treeTitle, SWT.PUSH);
                button_add.setText("Add");
-                               
+
                viewer.setContentProvider(new FeatureTreeContentProvider());
                viewer.setLabelProvider(new FeatureTreeLabelProvider());
-               
+
                viewer.addSelectionChangedListener(this);
-               
+
                text_title.addModifyListener(this);
                button_add.addSelectionListener(new AddButtonSelectionListener());
                button_remove.addSelectionListener(new RemoveButtonSelectionListener());
-               
+
                List<FeatureTree> input = CdmStore.getService(IFeatureTreeService.class).list(FeatureTree.class, null, null, null, null);
-               
+
                viewer.setInput(input);
                modifyText(null);
                setControl(composite);
@@ -120,15 +120,15 @@ public class SelectFeatureTreeWizardPage extends WizardPage implements ISelectio
        @Override
        public void selectionChanged(SelectionChangedEvent event) {
                IStructuredSelection selection = (IStructuredSelection) event.getSelection();
-                       
+
                if(selection.size() == 1){
                        FeatureTree selectedFeatureTree = (FeatureTree) selection.getFirstElement();
                        ((FeatureTreeEditorWizard) getWizard()).setSelectedFeatureTree(selectedFeatureTree);
-                       
+
                }
-               
+
                setPageComplete(true);
-               
+
                button_remove.setEnabled(selection.size() >= 1);
        }
 
@@ -137,36 +137,43 @@ public class SelectFeatureTreeWizardPage extends WizardPage implements ISelectio
        public boolean canFlipToNextPage() {
                return ((IStructuredSelection) viewer.getSelection()).size() == 1;
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public void modifyText(ModifyEvent e) {
                button_add.setEnabled(! text_title.getText().isEmpty());
        }
-       
+
        private class AddButtonSelectionListener extends SelectionAdapter {
-               public void widgetSelected(SelectionEvent e) {
+               @Override
+        public void widgetSelected(SelectionEvent e) {
                        FeatureTree featureTree = FeatureTree.NewInstance();
                        featureTree.setTitleCache(text_title.getText(), true);
-                       
+
                        viewer.add(featureTree);
-                       CdmStore.getService(IFeatureTreeService.class).saveOrUpdate(featureTree);
+                       if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                CdmStore.getService(IFeatureTreeService.class).merge(featureTree, true);
+                       } else {
+                           CdmStore.getService(IFeatureTreeService.class).saveOrUpdate(featureTree);
+                       }
                        text_title.setText("");
                        viewer.setSelection(new StructuredSelection(featureTree));
-                       
+
                }
        }
-       
+
        private class RemoveButtonSelectionListener extends SelectionAdapter {
-               public void widgetSelected(SelectionEvent e) {
+               @Override
+        public void widgetSelected(SelectionEvent e) {
                        IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
+                       Object source = e.getSource();
                        for(Object element : selection.toArray()){
                                viewer.remove(element);
-                               
-                               DeleteResult result =   CdmStore.getService(IFeatureTreeService.class).delete((FeatureTree) element);
-                               
+                               ((FeatureTreeEditorWizard) getWizard()).setSelectedFeatureTree(null);
+                               DeleteResult result =   CdmStore.getService(IFeatureTreeService.class).delete(((FeatureTree) element).getUuid());
+
                                if (result.isError()){
-                                       
+                                       DeleteResultMessagingUtils.messageDialogWithDetails(result, "The delete of the feature tree was not successful.", null);
                                }
                                viewer.setSelection(new StructuredSelection(new Object[0]));
                        }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenInspectSessionsHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenInspectSessionsHandler.java
new file mode 100644 (file)
index 0000000..6a61501
--- /dev/null
@@ -0,0 +1,62 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.handler;
+
+import java.util.Collection;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.swt.SWT;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.view.sessions.InspectSessionsDialog;
+
+/**
+ * @author cmathew
+ * @date 18 Feb 2015
+ *
+ */
+public class OpenInspectSessionsHandler extends AbstractHandler implements IHandler {
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+
+        Object principal = CdmStore.getCurrentAuthentiation().getPrincipal();
+
+        ICdmEntitySession activeSession = CdmStore.getCurrentSessionManager().getActiveSession();
+
+        if(activeSession == null) {
+            MessagingUtils.warningDialog("No Active Session", this, "Active Session is null");
+        } else {
+            Collection<CdmBase> rootEntities = activeSession.getRootEntities();
+            if(rootEntities == null || rootEntities.isEmpty()) {
+                MessagingUtils.warningDialog("No Root Entities", this, "No root entities to inspect");
+            } else {
+                InspectSessionsDialog dialog = new InspectSessionsDialog(AbstractUtility.getShell(), SWT.NONE);
+                dialog.open();
+            }
+
+        }
+
+        return null;
+
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/ReconnectHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/ReconnectHandler.java
new file mode 100644 (file)
index 0000000..28ffa45
--- /dev/null
@@ -0,0 +1,46 @@
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.swt.SWT;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSource;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.dialog.RemotingLoginDialog;
+
+/**
+ *
+ *
+ * @author c.mathew
+ */
+public class ReconnectHandler extends AbstractHandler implements IHandler {
+
+       /* (non-Javadoc)
+        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+        */
+       /** {@inheritDoc} */
+       @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+
+               RemotingLoginDialog loginDialog = new RemotingLoginDialog(HandlerUtil.getActiveShell(event),
+                       SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+
+               loginDialog.open((CdmRemoteSource) CdmStore.getActiveCdmSource(), true, true);
+
+               return null;
+
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/ShowRemotingLoginWindowHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/ShowRemotingLoginWindowHandler.java
new file mode 100644 (file)
index 0000000..25b8d84
--- /dev/null
@@ -0,0 +1,44 @@
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.swt.SWT;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.taxeditor.ui.dialog.RemotingLoginDialog;
+
+/**
+ *
+ *
+ * @author c.mathew
+ */
+public class ShowRemotingLoginWindowHandler extends AbstractHandler implements IHandler{
+
+       /* (non-Javadoc)
+        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+        */
+       /** {@inheritDoc} */
+       @Override
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+
+           RemotingLoginDialog loginDialog = new RemotingLoginDialog(HandlerUtil.getActiveShell(event),
+                   SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+           loginDialog.open();
+
+
+               return null;
+
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/SwitchUserHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/SwitchUserHandler.java
new file mode 100644 (file)
index 0000000..93e12bd
--- /dev/null
@@ -0,0 +1,47 @@
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.swt.SWT;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSource;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.dialog.RemotingLoginDialog;
+
+/**
+ *
+ *
+ * @author c.mathew
+ */
+public class SwitchUserHandler extends AbstractHandler implements IHandler {
+
+       /* (non-Javadoc)
+        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+        */
+       /** {@inheritDoc} */
+       @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+
+               RemotingLoginDialog loginDialog = new RemotingLoginDialog(HandlerUtil.getActiveShell(event),
+                       SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+
+               loginDialog.open((CdmRemoteSource) CdmStore.getActiveCdmSource(), false, false);
+
+               return null;
+
+       }
+}
+
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/UuidsParameterTypeConverter.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/UuidsParameterTypeConverter.java
new file mode 100644 (file)
index 0000000..dc8009b
--- /dev/null
@@ -0,0 +1,58 @@
+package eu.etaxonomy.taxeditor.handler;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+import org.eclipse.core.commands.AbstractParameterValueConverter;
+import org.eclipse.core.commands.ParameterValueConversionException;
+
+/**
+ * Converts either a single {@link UUID} or a list of UUIDSs to a string representation
+ * and vica versa.
+ *
+ * @author pplitzner
+ * @date Sep 15, 2015
+ *
+ */
+public class UuidsParameterTypeConverter extends AbstractParameterValueConverter {
+
+    private static final String SEPARATOR = ",";
+
+    public UuidsParameterTypeConverter() {
+    }
+
+    @Override
+    public Object convertToObject(String parameterValue) throws ParameterValueConversionException {
+        if(parameterValue.endsWith(SEPARATOR)){
+            List<UUID> uuids = new ArrayList<UUID>();
+            String[] split = parameterValue.split(SEPARATOR);
+            for (String string : split) {
+                uuids.add(UUID.fromString(string));
+            }
+            return uuids;
+        }
+        else{
+            return UUID.fromString(parameterValue);
+        }
+    }
+
+    @Override
+    public String convertToString(Object parameterValue) throws ParameterValueConversionException {
+        if(parameterValue instanceof List){
+            List list = (List)parameterValue;
+            String stringList = "";
+            for (Object object : list) {
+                stringList += parameterValue.toString()+SEPARATOR;
+            }
+        }
+        else if(parameterValue instanceof UUID){
+            return parameterValue.toString();
+        }
+        else{
+            throw new ParameterValueConversionException("Parameter is of wrong type: "+parameterValue.getClass().toString());
+        }
+        return null;
+    }
+
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/DefaultOpenClassificationWizardHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/DefaultOpenClassificationWizardHandler.java
new file mode 100644 (file)
index 0000000..879be20
--- /dev/null
@@ -0,0 +1,31 @@
+package eu.etaxonomy.taxeditor.handler.defaultHandler;
+
+import java.util.UUID;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.PlatformUI;
+
+import eu.etaxonomy.cdm.api.service.IClassificationService;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.taxeditor.newWizard.NewClassificationWizard;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+public class DefaultOpenClassificationWizardHandler extends DefaultOpenHandlerBase<Classification> {
+
+    @Override
+    protected Classification getEntity(UUID uuid) {
+        return CdmStore.getService(IClassificationService.class).load(uuid);
+    }
+
+    @Override
+    protected void open(ExecutionEvent event, Classification entity) {
+        NewClassificationWizard classificationWizard = new NewClassificationWizard();
+        classificationWizard.init(null, null);
+        classificationWizard.setEntity(entity);
+        WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), classificationWizard);
+        dialog.open();
+    }
+
+
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/DefaultOpenHandlerBase.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/DefaultOpenHandlerBase.java
new file mode 100644 (file)
index 0000000..91f4343
--- /dev/null
@@ -0,0 +1,51 @@
+package eu.etaxonomy.taxeditor.handler.defaultHandler;
+
+import java.util.UUID;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.ParameterType;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+
+public abstract class DefaultOpenHandlerBase <T> extends AbstractHandler {
+
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        String commandId = event.getCommand().getId();
+        String uuidParameterId = commandId+".uuid";
+        //check if uuid parameter is set
+        if(event.getParameter(uuidParameterId)!=null){
+            Object object = event.getObjectParameterForExecution(uuidParameterId);
+            ParameterType parameterType;
+            try {
+                parameterType = event.getCommand().getParameterType(uuidParameterId);
+                if(parameterType.isCompatible(object)){
+                    T entity = getEntity((UUID) object);
+                    open(event, entity);
+                }
+            } catch (NotDefinedException e) {
+                MessagingUtils.error(DefaultOpenHandlerBase.class, "Error while opening entity!", e);
+            }
+        }
+        //if not try current selection
+        else{
+            ISelection selection = HandlerUtil.getCurrentSelection(event);
+            if(selection instanceof IStructuredSelection){
+                open(event, (T) ((IStructuredSelection) selection).getFirstElement());
+            }
+        }
+        return null;
+    }
+
+
+    protected abstract T getEntity(UUID uuid);
+
+    protected abstract void open(ExecutionEvent event, T entity);
+
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/DefaultOpenTaxonNodeWizardHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/DefaultOpenTaxonNodeWizardHandler.java
new file mode 100644 (file)
index 0000000..0ac105f
--- /dev/null
@@ -0,0 +1,42 @@
+// $Id$
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.handler.defaultHandler;
+
+import java.util.UUID;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.PlatformUI;
+
+import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.section.classification.EditTaxonNodeWizard;
+
+/**
+ * @author k.luther
+ * @date 22.03.2016
+ *
+ */
+public class DefaultOpenTaxonNodeWizardHandler extends DefaultOpenHandlerBase<TaxonNode> {
+    @Override
+    protected TaxonNode getEntity(UUID uuid) {
+        return CdmStore.getService(ITaxonNodeService.class).load(uuid);
+    }
+
+    @Override
+    protected void open(ExecutionEvent event, TaxonNode entity) {
+        EditTaxonNodeWizard taxonNodeWizard = new EditTaxonNodeWizard();
+        taxonNodeWizard.init(null, null);
+        taxonNodeWizard.setEntity(entity);
+        WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), taxonNodeWizard);
+        dialog.open();
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/OpenReferencingObjectsView.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/OpenReferencingObjectsView.java
new file mode 100644 (file)
index 0000000..88514b9
--- /dev/null
@@ -0,0 +1,16 @@
+package eu.etaxonomy.taxeditor.handler.defaultHandler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+
+public class OpenReferencingObjectsView extends AbstractHandler {
+
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        return AbstractUtility.showView("eu.etaxonomy.taxeditor.bulkeditor.view.referencingobjects");
+    }
+
+}
index 2504f4a1746edbacbacd88e041137d6cc4ba2462..7de630396a76541a5b6bd435c2b8af505280fbc6 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -20,7 +20,7 @@ import eu.etaxonomy.cdm.io.common.IIoConfigurator;
  * <p>
  * Abstract AbstractIOHandler class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Sep 11, 2009
  * @version 1.0
@@ -30,14 +30,14 @@ public abstract class AbstractIOManager<CONFIGURATOR extends IIoConfigurator> {
        protected ICdmApplicationConfiguration applicationConfiguration;
 
        public static enum TYPE {
-               Jaxb, Tcs, Excel_Taxa, Endnote, Sdd, Abcd, SpecimenCdmExcel, Excel_Name
+               Jaxb, Tcs, Excel_Taxa, Endnote, Sdd, Abcd, SpecimenCdmExcel, Excel_Name, SpecimenSearch
        }
 
        /**
         * <p>
         * Constructor for AbstractIOHandler.
         * </p>
-        * 
+        *
         * @param applicationController
         *            a
         *            {@link eu.etaxonomy.cdm.api.application.CdmApplicationController}
@@ -52,29 +52,33 @@ public abstract class AbstractIOManager<CONFIGURATOR extends IIoConfigurator> {
 
        /**
         * Starts the IO process
-        * 
+        *
         * @param configurator
         *            a CONFIGURATOR object.
         */
        public void run(final CONFIGURATOR configurator) {
-               // create job
-               Job job = createIOJob(configurator);
-               // configure the job
-               job.setProperty(IProgressConstants.KEEP_PROPERTY, true);
-               job.setUser(true);
-               // schedule job
-               job.schedule();
+           // create job
+           Job job = createIOJob(configurator);
+           run(job);
+       }
 
+       public void run(Job job) {
+           // configure the job
+           job.setProperty(IProgressConstants.KEEP_PROPERTY, true);
+           job.setUser(true);
+           // schedule job
+           job.schedule();
        }
 
        /**
         * <p>
         * createIOJob
         * </p>
-        * 
+        *
         * @param configurator
         *            a CONFIGURATOR object.
         * @return a {@link org.eclipse.core.runtime.jobs.Job} object.
         */
        protected abstract Job createIOJob(CONFIGURATOR configurator);
+
 }
index e3fbfe9ab2862d0159f4d3fd7577bf3a40b31c06..9afd3ceea5d92e8b84353d98306c24afc790efb1 100644 (file)
 
 package eu.etaxonomy.taxeditor.io;
 
+import java.io.File;
+import java.io.FileOutputStream;
+import java.util.List;
+
 import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
@@ -18,16 +22,20 @@ import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IWorkbenchPart;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.io.common.CdmDefaultExport;
+import eu.etaxonomy.cdm.io.common.ExportResult;
 import eu.etaxonomy.cdm.io.common.IExportConfigurator;
 import eu.etaxonomy.cdm.io.common.IIoConfigurator;
 import eu.etaxonomy.cdm.io.jaxb.JaxbExportConfigurator;
 import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
+import eu.etaxonomy.cdm.io.service.IIOService;
 import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
 /**
  * <p>
@@ -157,6 +165,42 @@ public class ExportManager extends AbstractIOManager<IExportConfigurator> {
                return job;
        }
 
+       public Job createIOServiceJob(final IExportConfigurator configurator, final File exportFile) {
+           Assert.isNotNull(configurator, "Configuration may not be null");
+
+           final Display display = Display.getCurrent();
+
+           Job job = new Job("Export: " + configurator.getClass().getSimpleName()) {
+               @Override
+               protected IStatus run(IProgressMonitor monitor) {
+                   monitor.beginTask("Exporting database. This will take some time.", IProgressMonitor.UNKNOWN);
+                   try {
+                       IIOService ioService = CdmApplicationState.getIOService();
+
+                       ExportResult result = ioService.export(configurator);
+                       List<byte[]> dataList = result.getExportData();
+                       byte[] exportData = dataList.get(0);
+
+                       FileOutputStream stream = new FileOutputStream(exportFile);
+                       try {
+                           stream.write(exportData);
+                       } finally {
+                           stream.close();
+                       }
+
+                   } catch (Exception e) {
+                       MessagingUtils.errorDialog("Error exporting data",
+                               this,
+                               e.getMessage(),
+                               TaxeditorStorePlugin.PLUGIN_ID,
+                               e,
+                               true);
+                   }
+                   return Status.OK_STATUS;
+               }
+           };
+           return job;
+       }
        /**
         * @param jaxb
         * @return
@@ -198,4 +242,6 @@ public class ExportManager extends AbstractIOManager<IExportConfigurator> {
                return (SDDExportConfigurator) getConfigurator(TYPE.Sdd);
        }
 
+
+
 }
index a607e3f0f43c686cdb0e9e1e346144f1f8ba700d..809e19efa068a89ddf1c4d3f5d74ccfa71f1711d 100644 (file)
@@ -1,47 +1,65 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
 
 package eu.etaxonomy.taxeditor.io;
 
+import java.io.File;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.commons.io.IOUtils;
 import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PlatformUI;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
-import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
+import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
 import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
 import eu.etaxonomy.cdm.io.common.IImportConfigurator;
+import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
+import eu.etaxonomy.cdm.io.common.ImportResult;
 import eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitImportConfigurator;
 import eu.etaxonomy.cdm.io.jaxb.JaxbImportConfigurator;
 import eu.etaxonomy.cdm.io.reference.endnote.in.EndnoteImportConfigurator;
 import eu.etaxonomy.cdm.io.sdd.in.SDDImportConfigurator;
+import eu.etaxonomy.cdm.io.service.IIOService;
 import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
 import eu.etaxonomy.cdm.io.specimen.excel.in.SpecimenCdmExcelImportConfigurator;
 import eu.etaxonomy.cdm.io.tcsxml.in.TcsXmlImportConfigurator;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.operation.IPostMoniteredOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
+import eu.etaxonomy.taxeditor.ui.dialog.ReportTextDialog;
 
 /**
  * <p>
  * ImportHandler class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Sep 11, 2009
  * @version 1.0
  */
-public class ImportManager extends AbstractIOManager<IImportConfigurator> {
+public class ImportManager extends AbstractIOManager<IImportConfigurator> implements IPostMoniteredOperationEnabled {
 
        /**
         * @param applicationConfiguration
@@ -54,7 +72,7 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
         * <p>
         * NewInstance
         * </p>
-        * 
+        *
         * @param applicationConfiguration
         *            a
         *            {@link eu.etaxonomy.cdm.api.application.CdmApplicationController}
@@ -68,7 +86,7 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
 
        /**
         * Use when importing data into the current application context
-        * 
+        *
         * @param configurator
         *            a {@link eu.etaxonomy.cdm.io.common.IImportConfigurator}
         *            object.
@@ -91,11 +109,12 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
                                monitor.worked(5);
 
                                CdmDefaultImport<IImportConfigurator> importer = new CdmDefaultImport<IImportConfigurator>();
-                               importer.setCdmAppController((ICdmApplicationConfiguration) applicationConfiguration);
+                               importer.setCdmAppController(applicationConfiguration);
                                monitor.worked(5);
-
+                               ImportResult importResult = null;
                                try {
-                                       importer.invoke(configurator);
+                                       importResult = importer.invoke(configurator);
+
                                        monitor.worked(80);
                                } catch (RuntimeException e) {
                                        MessagingUtils.messageDialog(
@@ -111,10 +130,23 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
                                monitor.worked(5);
                                monitor.done();
 
+
+                               final StringBuilder reportText = new StringBuilder();
+                               if(importResult!=null){
+                                   List<byte[]> reports = importResult.getReports();
+                                   for (byte[] bs : reports) {
+                        reportText.append(new String(bs));
+                    }
+                               }
                                display.asyncExec(new Runnable() {
 
                                        @Override
                                        public void run() {
+                        // display reports with possibility to save
+                        ReportTextDialog dialog = new ReportTextDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+                        dialog.setTitle(configurator.getClass().getSimpleName()+" Report");
+                        dialog.setReportText(reportText.toString());
+                        dialog.open();
                                                CdmStore.getContextManager().notifyContextRefresh();
                                        }
                                });
@@ -127,6 +159,128 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
 
        }
 
+       public Job createIOServiceJob(IImportConfigurator configurator, InputStream is, SOURCE_TYPE type) {
+
+           try {
+               return createIOServiceJob(configurator, IOUtils.toByteArray(is), type);
+           } catch (Exception e) {
+               MessagingUtils.errorDialog("Error importing input stream",
+                       this,
+                       e.getMessage(),
+                       TaxeditorStorePlugin.PLUGIN_ID,
+                       e,
+                       true);
+           }
+           return null;
+       }
+
+       public Job createIOServiceJob(IImportConfigurator configurator, File importFile, SOURCE_TYPE type) {
+           Path path = Paths.get(importFile.toURI());
+           try {
+               return createIOServiceJob(configurator, Files.readAllBytes(path), type);
+           } catch (Exception e) {
+               MessagingUtils.errorDialog("Error importing file",
+                       this,
+                       e.getMessage(),
+                       TaxeditorStorePlugin.PLUGIN_ID,
+                       e,
+                       true);
+           }
+           return null;
+       }
+
+    public Job createIOServiceJob(final IImportConfigurator configurator, final byte[] data, final SOURCE_TYPE type) {
+        Assert.isNotNull(configurator, "Configuration may not be null");
+        final Display display = Display.getDefault();
+        Job job = new Job("Import: " + configurator.getClass().getSimpleName()) {
+
+            @Override
+            protected IStatus run(IProgressMonitor monitor) {
+                monitor.beginTask("Importing data", IProgressMonitor.UNKNOWN);
+                IIOService ioService = CdmApplicationState.getIOService();
+
+                ioService.importData(configurator, data, type);
+
+                monitor.done();
+
+                display.asyncExec(new Runnable() {
+
+                    @Override
+                    public void run() {
+                        CdmStore.getContextManager().notifyContextRefresh();
+                    }
+                });
+
+                return Status.OK_STATUS;
+            }
+        };
+
+        return job;
+
+    }
+
+    public void runMoniteredOperation(IImportConfigurator configurator, InputStream is, SOURCE_TYPE type) {
+
+        try {
+            runMoniteredOperation(configurator, IOUtils.toByteArray(is), type);
+        } catch (Exception e) {
+            MessagingUtils.errorDialog("Error importing input stream",
+                    this,
+                    e.getMessage(),
+                    TaxeditorStorePlugin.PLUGIN_ID,
+                    e,
+                    true);
+        }
+
+    }
+
+    public void runMoniteredOperation(IImportConfigurator configurator, SOURCE_TYPE type) {
+        byte[] data = new byte[1];
+        try {
+            runMoniteredOperation(configurator, data, type);
+        } catch (Exception e) {
+            MessagingUtils.errorDialog("Error importing input stream",
+                    this,
+                    e.getMessage(),
+                    TaxeditorStorePlugin.PLUGIN_ID,
+                    e,
+                    true);
+        }
+
+    }
+
+    public void runMoniteredOperation(IImportConfigurator configurator, File importFile, SOURCE_TYPE type) {
+        Path path = Paths.get(importFile.toURI());
+        try {
+            runMoniteredOperation(configurator, Files.readAllBytes(path), type);
+        } catch (Exception e) {
+            MessagingUtils.errorDialog("Error importing input stream",
+                    this,
+                    e.getMessage(),
+                    TaxeditorStorePlugin.PLUGIN_ID,
+                    e,
+                    true);
+        }
+
+    }
+
+    public void runMoniteredOperation(final IImportConfigurator configurator, final byte[] data, final SOURCE_TYPE type) {
+        IIOService ioService = CdmApplicationState.getIOService();
+        final UUID uuid = ioService.monitImportData(configurator, data, type);
+        Display.getDefault().asyncExec(new Runnable() {
+            @Override
+            public void run() {
+                AbstractUtility.executeMoniteredOperation("Import: " + configurator.getClass().getSimpleName(),
+                        uuid,
+                        1000,
+                        false,
+                        ImportManager.this,
+                        null);
+            }
+        });
+
+    }
+
        private IImportConfigurator getConfigurator(TYPE type) {
                Assert.isNotNull(type, "Type should not be null");
 
@@ -146,6 +300,8 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
                        return SDDImportConfigurator.NewInstance(null, null);
                case SpecimenCdmExcel:
                        return SpecimenCdmExcelImportConfigurator.NewInstance(null, null);
+               case SpecimenSearch:
+                   return Abcd206ImportConfigurator.NewInstance(null, null);
                default:
                        MessagingUtils.notImplementedMessage(this);
                        throw new IllegalArgumentException("Import not supported yet");
@@ -157,7 +313,7 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
         * <p>
         * JaxbConfigurator
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.cdm.io.jaxb.JaxbImportConfigurator} object.
         */
        public final JaxbImportConfigurator JaxbConfigurator() {
@@ -168,7 +324,7 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
         * <p>
         * TcsConfigurator
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.cdm.io.tcsxml.in.TcsXmlImportConfigurator}
         *         object.
         */
@@ -180,7 +336,7 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
         * <p>
         * EndnoteConfigurator
         * </p>
-        * 
+        *
         * @return a
         *         {@link eu.etaxonomy.cdm.io.reference.endnote.in.EndnoteImportConfigurator}
         *         object.
@@ -193,7 +349,7 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
         * <p>
         * NormalExplicitConfigurator
         * </p>
-        * 
+        *
         * @return a
         *         {@link eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitImportConfigurator}
         *         object.
@@ -206,7 +362,7 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
         * <p>
         * SddConfigurator
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.cdm.io.sdd.in.SDDImportConfigurator}
         *         object.
         */
@@ -218,7 +374,7 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
         * <p>
         * AbcdConfigurator
         * </p>
-        * 
+        *
         * @return a
         *         {@link eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator}
         *         object.
@@ -231,4 +387,20 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
                return (SpecimenCdmExcelImportConfigurator) getConfigurator(TYPE.SpecimenCdmExcel);
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void postOperation(IRemotingProgressMonitor monitor) {
+        Display.getDefault().asyncExec(new Runnable() {
+
+            @Override
+            public void run() {
+                CdmStore.getContextManager().notifyContextRefresh();
+            }
+        });
+
+    }
+
+
 }
index 19eb4604d84c79aa0919c8bc74c5664ab84ae361..d6f3236ea638ddb1463fbdb70c4b48a185008dfc 100644 (file)
@@ -20,13 +20,13 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IWorkbench;
 
 import eu.etaxonomy.cdm.database.DbSchemaValidation;
+import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
 import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
 /**
- * <p>AbcdImportWizard class.</p>
  *
  * @author n.hoffmann
  * @created Jun 16, 2010
@@ -37,47 +37,43 @@ public class AbcdImportWizard extends AbstractImportWizard<Abcd206ImportConfigur
     private static final Logger logger = Logger.getLogger(AbcdImportWizard.class);
 
        private Abcd206ImportConfigurator configurator;
-       private ImportFromFileDataSourceWizardPage dataSourcePage;
+       private AbcdSourceSelectionPage dataSourcePage;
        private ClassificationChooserWizardPage classificationChooserWizardPage;
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.io.wizard.AbstractImportWizard#getConfigurator()
-        */
        /** {@inheritDoc} */
        @Override
        public Abcd206ImportConfigurator getConfigurator() {
                return configurator;
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.wizard.Wizard#performFinish()
-        */
        /** {@inheritDoc} */
        @Override
        public boolean performFinish() {
-               URI source = dataSourcePage.getUri();
-               try {
-            configurator.setSource(new FileInputStream(new File(source)));
-        } catch (FileNotFoundException e) {
-            MessagingUtils.errorDialog("File not found.", this, "Import file was not found.", TaxeditorStorePlugin.PLUGIN_ID, e, false);
-            logger.error("File not found!", e);
-            return false;
-        }
-               configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
-
-               if(classificationChooserWizardPage.getClassification()!=null){
-                   configurator.setClassificationUuid(classificationChooserWizardPage.getClassification().getUuid());
-               }
-               configurator.setReportUri(classificationChooserWizardPage.getReportUri());
-
-               CdmStore.getImportManager().run(configurator);
-               return true;
+           URI source = dataSourcePage.getUri();
+           configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
+
+           if(classificationChooserWizardPage.getClassification()!=null){
+               configurator.setClassificationUuid(classificationChooserWizardPage.getClassification().getUuid());
+           }
+
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               //Job job = CdmStore.getImportManager().createIOServiceJob(configurator, new File(source), SOURCE_TYPE.INPUTSTREAM);
+               //CdmStore.getImportManager().run(job);
+               CdmStore.getImportManager().runMoniteredOperation(configurator, new File(source), SOURCE_TYPE.INPUTSTREAM);
+           } else {
+               try {
+                   configurator.setSource(new FileInputStream(new File(source)));
+               } catch (FileNotFoundException e) {
+                   MessagingUtils.errorDialog("File not found.", this, "Import file was not found.", TaxeditorStorePlugin.PLUGIN_ID, e, false);
+                   logger.error("File not found!", e);
+                   return false;
+               }
+               CdmStore.getImportManager().run(configurator);
+           }
+           return true;
 
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
-        */
        /** {@inheritDoc} */
        @Override
     public void init(IWorkbench workbench, IStructuredSelection selection) {
@@ -85,16 +81,15 @@ public class AbcdImportWizard extends AbstractImportWizard<Abcd206ImportConfigur
                configurator =  CdmStore.getImportManager().AbcdConfigurator();
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.io.AbstractImportWizard#addPages()
-        */
        /** {@inheritDoc} */
        @Override
        public void addPages() {
                super.addPages();
 
                classificationChooserWizardPage = ClassificationChooserWizardPage.createPage();
+
                dataSourcePage = ImportFromFileDataSourceWizardPage.XML();
+
                addPage(classificationChooserWizardPage);
                addPage(dataSourcePage);
        }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdSourceSelectionPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdSourceSelectionPage.java
new file mode 100644 (file)
index 0000000..e8de3be
--- /dev/null
@@ -0,0 +1,42 @@
+// $Id$
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.io.wizard;
+
+import java.net.URI;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * @author k.luther
+ * @date 29.03.2016
+ *
+ */
+public abstract class AbcdSourceSelectionPage extends WizardPage {
+
+    protected Text text_source;
+
+    /**
+     * @param pageName
+     */
+    protected AbcdSourceSelectionPage(String pageName) {
+        super(pageName);
+
+    }
+
+    public abstract URI getUri();
+
+
+
+
+
+
+
+}
index 4c946a9a53b2541f01ca7ef3267303f6bb945179..d84ad8dda92273a4827ca595b0c3d847fdae438a 100644 (file)
@@ -25,8 +25,6 @@ import eu.etaxonomy.cdm.io.common.IImportConfigurator;
 import eu.etaxonomy.cdm.io.common.IIoConfigurator;
 
 /**
- * <p>Abstract AbstractImportWizard class.</p>
- *
  * @author n.hoffmann
  * @created 24.06.2009
  * @version 1.0
@@ -42,10 +40,6 @@ public abstract class AbstractImportWizard<CONFIG extends IIoConfigurator> exten
 
        private IStructuredSelection selection;
 
-
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.wizard.Wizard#addPages()
-        */
        /** {@inheritDoc} */
        @Override
        public void addPages() {
@@ -60,9 +54,6 @@ public abstract class AbstractImportWizard<CONFIG extends IIoConfigurator> exten
 
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.wizard.Wizard#setContainer(org.eclipse.jface.wizard.IWizardContainer)
-        */
        @Override
        public void setContainer(IWizardContainer wizardContainer) {
                if(existUnsavedEditors()){
@@ -74,9 +65,6 @@ public abstract class AbstractImportWizard<CONFIG extends IIoConfigurator> exten
                }
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
-        */
        @Override
        public void init(IWorkbench workbench, IStructuredSelection selection) {
                this.setWorkbench(workbench);
@@ -96,45 +84,25 @@ public abstract class AbstractImportWizard<CONFIG extends IIoConfigurator> exten
                return false;
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.wizard.Wizard#canFinish()
-        */
        @Override
        public boolean canFinish() {
-           return !existUnsavedEditors();
+           return !existUnsavedEditors() && super.canFinish();
        }
 
-       /**
-        * <p>getConfigurator</p>
-        *
-        * @return a CONFIG object.
-        */
        public abstract CONFIG getConfigurator();
 
-       /**
-        * @param selection the selection to set
-        */
        public void setSelection(IStructuredSelection selection) {
                this.selection = selection;
        }
 
-       /**
-        * @return the selection
-        */
        public IStructuredSelection getSelection() {
                return selection;
        }
 
-       /**
-        * @param workbench the workbench to set
-        */
        public void setWorkbench(IWorkbench workbench) {
                this.workbench = workbench;
        }
 
-       /**
-        * @return the workbench
-        */
        public IWorkbench getWorkbench() {
                return workbench;
        }
index da353112490a5cfc8acd5051a5ac75e3cb8437b7..377ccc84ca04ddff8c37b828424d7fd389f8c892 100644 (file)
 
 package eu.etaxonomy.taxeditor.io.wizard;
 
-import java.io.File;
-import java.net.URI;
-
 import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Text;
@@ -49,17 +43,6 @@ public class ClassificationChooserWizardPage extends WizardPage implements Liste
 
     private Button btnClear;
 
-    //report
-    private FileDialog fileDialogReport;
-    private Text textFileReport;
-
-       /**
-        * <p>Constructor for ImportFromFileDataSourceWizardPage.</p>
-        *
-        * @param title a {@link java.lang.String} object.
-        * @param description a {@link java.lang.String} object.
-        * @param extensions an array of {@link java.lang.String} objects.
-        */
        protected ClassificationChooserWizardPage(String title, String description) {
                super(PAGE_NAME);
 
@@ -69,20 +52,12 @@ public class ClassificationChooserWizardPage extends WizardPage implements Liste
 
        }
 
-       /**
-        * <p>XML</p>
-        *
-        * @return a {@link eu.etaxonomy.taxeditor.io.wizard.ClassificationChooserWizardPage} object.
-        */
        protected static ClassificationChooserWizardPage createPage(){
                return new ClassificationChooserWizardPage("Configure import destinations", "Note: Selecting no classification will create a default one.");
        }
 
 
 
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
-        */
        /** {@inheritDoc} */
        @Override
     public void createControl(Composite parent) {
@@ -105,44 +80,9 @@ public class ClassificationChooserWizardPage extends WizardPage implements Liste
                btnClear.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/trash.gif"));
                btnClear.addListener(SWT.Selection, this);
 
-               //report
-               Label labelReportFile = new Label(composite, SWT.NONE);
-        labelReportFile.setText("Report File");
-
-        fileDialogReport = new FileDialog(parent.getShell());
-
-        fileDialogReport.setFilterExtensions(new String[]{"*.*"});
-
-        textFileReport = new Text(composite, SWT.BORDER);
-        textFileReport.setEditable(false);
-        textFileReport.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
-
-
-        Button buttonReport = new Button(composite, SWT.PUSH);
-        buttonReport.setText("Browse...");
-
-        buttonReport.addSelectionListener(new SelectionAdapter(){
-
-            /* (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-             */
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                String path = fileDialogReport.open();
-                if(path!=null){
-                    textFileReport.setText(path);
-                    setPageComplete(true);
-                }
-            }
-
-        });
-
                setControl(composite);
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
-        */
        @Override
        public void handleEvent(Event event) {
            if(event.widget==btnBrowseClassification){
@@ -164,11 +104,4 @@ public class ClassificationChooserWizardPage extends WizardPage implements Liste
         return classification;
     }
 
-    public URI getReportUri(){
-        String text = textFileReport.getText();
-        if(text==null || text.isEmpty()){
-            return null;
-        }
-        return new File(text).toURI();
-    }
 }
index 744876e944ccf966a07e23717543669f933f6b2d..e703c2d3dbc74f7f2807088a9d866f8889f9c152 100644 (file)
@@ -15,9 +15,11 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.UUID;
 
+import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.progress.IProgressConstants;
 
 import eu.etaxonomy.cdm.io.csv.redlist.demo.CsvDemoExportConfigurator;
 import eu.etaxonomy.cdm.model.taxon.Classification;
@@ -91,10 +93,19 @@ public class CsvExportWizard extends AbstractExportWizard<CsvDemoExportConfigura
                        configurator.setLastChange(true);
                    }
                }
-               configurator.setDestination(new File(urlString));
-
-               CdmStore.getExportManager().run(configurator);
-
+               if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                   // create job
+                   Job job = CdmStore.getExportManager().createIOServiceJob(configurator, new File(urlString));
+                   // configure the job
+                   job.setProperty(IProgressConstants.KEEP_PROPERTY, true);
+                   job.setUser(true);
+                   // schedule job
+                   job.schedule();
+               } else {
+
+                   configurator.setDestination(new File(urlString));
+                   CdmStore.getExportManager().run(configurator);
+               }
                return true;
        }
 
index 24d0db49c9c428db666476dff16b2e3fe51f4d05..bd6ac4a480e3e1e27e1af7ce4ae794325ec52ecc 100644 (file)
@@ -12,9 +12,11 @@ package eu.etaxonomy.taxeditor.io.wizard;
 \r
 import java.io.File;\r
 \r
+import org.eclipse.core.runtime.jobs.Job;\r
 import org.eclipse.jface.viewers.IStructuredSelection;\r
 import org.eclipse.swt.widgets.Combo;\r
 import org.eclipse.ui.IWorkbench;\r
+import org.eclipse.ui.progress.IProgressConstants;\r
 \r
 import eu.etaxonomy.cdm.io.csv.caryophyllales.out.CsvNameExportConfigurator;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
@@ -39,6 +41,7 @@ public class CsvNameExportWizard extends AbstractExportWizard<CsvNameExportConfi
        @Override\r
        public void init(IWorkbench workbench, IStructuredSelection selection) {\r
                configurator = CsvNameExportConfigurator.NewInstance(null,null);\r
+               configurator.setNamesOnly(true);\r
        }\r
 \r
        /*\r
@@ -59,15 +62,23 @@ public class CsvNameExportWizard extends AbstractExportWizard<CsvNameExportConfi
         */\r
        @Override\r
        public boolean performFinish() {\r
-               String urlString = page.getFolderText() + File.separator\r
-                               + page.getExportFileName();\r
-\r
-               final Combo combo = page.getCombo();\r
-               \r
-               configurator.setDestination(new File(urlString));\r
-\r
-               CdmStore.getExportManager().run(configurator);\r
-\r
+           String urlString = page.getFolderText() + File.separator\r
+                   + page.getExportFileName();\r
+\r
+           final Combo combo = page.getCombo();\r
+\r
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {\r
+               // create job\r
+               Job job = CdmStore.getExportManager().createIOServiceJob(configurator, new File(urlString));\r
+               // configure the job\r
+               job.setProperty(IProgressConstants.KEEP_PROPERTY, true);\r
+               job.setUser(true);\r
+               // schedule job\r
+               job.schedule();\r
+           } else {\r
+               configurator.setDestination(new File(urlString));\r
+               CdmStore.getExportManager().run(configurator);\r
+           }\r
                return true;\r
        }\r
 \r
index 81e8105821b0fa8d2c726dedf8bf8dde62e583c2..61905f31f057bfb22947f96fbb3b96f045bbccce 100644 (file)
@@ -5,17 +5,19 @@ import java.util.HashSet;
 import java.util.List;\r
 import java.util.UUID;\r
 \r
+import org.eclipse.core.runtime.jobs.Job;\r
 import org.eclipse.jface.viewers.IStructuredSelection;\r
 import org.eclipse.swt.widgets.Combo;\r
 import org.eclipse.ui.IWorkbench;\r
+import org.eclipse.ui.progress.IProgressConstants;\r
 \r
 import eu.etaxonomy.cdm.io.csv.caryophyllales.out.CsvNameExportConfigurator;\r
 import eu.etaxonomy.cdm.model.taxon.Classification;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 \r
 public class CsvPrintExportWizard extends CsvNameExportWizard{\r
-       \r
-       \r
+\r
+\r
        private final String description = "Export the contents of the currently selected database into Semicolon Separated Value format.";\r
        @Override\r
        public void init(IWorkbench workbench, IStructuredSelection selection) {\r
@@ -25,11 +27,11 @@ public class CsvPrintExportWizard extends CsvNameExportWizard{
 \r
        @Override\r
        public CsvNameExportConfigurator getConfigurator() {\r
-               \r
+\r
                return configurator;\r
        }\r
 \r
-       \r
+\r
 \r
        /*\r
         * (non-Javadoc)\r
@@ -72,17 +74,26 @@ public class CsvPrintExportWizard extends CsvNameExportWizard{
                                set.add(c.getUuid());\r
                            }\r
                        }\r
-                      \r
+\r
                        configurator.setHasHeaderLines(true);\r
-                       \r
+\r
                    }\r
-               } else{         \r
+               } else{\r
                        configurator.setClassificationUUID(listClassifications.get(0).getUuid());\r
                }\r
-               configurator.setDestination(new File(urlString));\r
-\r
-               CdmStore.getExportManager().run(configurator);\r
 \r
+               if(CdmStore.getCurrentSessionManager().isRemoting()) {\r
+                   // create job\r
+                   Job job = CdmStore.getExportManager().createIOServiceJob(configurator, new File(urlString));\r
+                   // configure the job\r
+                   job.setProperty(IProgressConstants.KEEP_PROPERTY, true);\r
+                   job.setUser(true);\r
+                   // schedule job\r
+                   job.schedule();\r
+               } else {\r
+                   configurator.setDestination(new File(urlString));\r
+                   CdmStore.getExportManager().run(configurator);\r
+               }\r
                return true;\r
        }\r
 \r
index 744044a2b4efeaa97acf39a7f06121d62e10a2d7..f6d43baf8a87ad54781bc3133d77849036a302b3 100644 (file)
 
 package eu.etaxonomy.taxeditor.io.wizard;
 
+import java.io.File;
 import java.net.URI;
 
+import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IWorkbench;
 
 import eu.etaxonomy.cdm.database.DbSchemaValidation;
+import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
 import eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitImportConfigurator;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -52,7 +55,13 @@ public class ExcelNormalExplicitTaxaImportWizard extends AbstractImportWizard<No
                configurator.setSource(source);
                configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
 
-               CdmStore.getImportManager().run(configurator);
+               if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                   Job job = CdmStore.getImportManager().createIOServiceJob(configurator, new File(source), SOURCE_TYPE.URI);
+                   CdmStore.getImportManager().run(job);
+               } else {
+                   CdmStore.getImportManager().run(configurator);
+               }
+
 
                return true;
        }
index 6d63fbd675122e32ac450352a3266913668b9487..a35e64490f9a9f6d3c6879b9d90a08572fc013a8 100644 (file)
@@ -28,8 +28,8 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 
 import eu.etaxonomy.cdm.model.taxon.Classification;
-import eu.etaxonomy.cdm.remote.CdmRemoteSourceException;
 import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
+import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSourceException;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
index 2d2415d96cc18e0e627bfef250e48c1bd33c6322..0a48a2a6fc58fe35ceb004511bee9924ec81b614 100644 (file)
@@ -13,7 +13,6 @@ package eu.etaxonomy.taxeditor.io.wizard;
 import java.io.File;
 import java.net.URI;
 
-import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
@@ -25,14 +24,15 @@ import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 
+import eu.etaxonomy.cdm.common.CdmUtils;
+
 /**
- * <p>ImportFromFileDataSourceWizardPage class.</p>
  *
  * @author n.hoffmann
  * @created 04.08.2009
  * @version 1.0
  */
-public class ImportFromFileDataSourceWizardPage extends WizardPage {
+public class ImportFromFileDataSourceWizardPage extends AbcdSourceSelectionPage {
 
        /** Constant <code>PAGE_NAME="CdmXmlDataSourceWizardPage"</code> */
        public static final String PAGE_NAME = "CdmXmlDataSourceWizardPage";
@@ -41,16 +41,8 @@ public class ImportFromFileDataSourceWizardPage extends WizardPage {
 
        private FileDialog fileDialog;
 
-       private Text text_file;
 
 
-       /**
-        * <p>Constructor for ImportFromFileDataSourceWizardPage.</p>
-        *
-        * @param title a {@link java.lang.String} object.
-        * @param description a {@link java.lang.String} object.
-        * @param extensions an array of {@link java.lang.String} objects.
-        */
        protected ImportFromFileDataSourceWizardPage(String title, String description, String[] extensions) {
                super(PAGE_NAME);
 
@@ -61,20 +53,10 @@ public class ImportFromFileDataSourceWizardPage extends WizardPage {
                this.extensions = extensions;
        }
 
-       /**
-        * <p>XML</p>
-        *
-        * @return a {@link eu.etaxonomy.taxeditor.io.wizard.ImportFromFileDataSourceWizardPage} object.
-        */
        protected static ImportFromFileDataSourceWizardPage XML(){
                return new ImportFromFileDataSourceWizardPage("Xml File", "Select XML file.", new String[]{"*.xml","*.*"});
        }
 
-
-
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
-        */
        /** {@inheritDoc} */
        @Override
     public void createControl(Composite parent) {
@@ -93,9 +75,9 @@ public class ImportFromFileDataSourceWizardPage extends WizardPage {
 
                fileDialog.setFilterExtensions(extensions);
 
-               text_file = new Text(composite, SWT.BORDER);
-               text_file.setEditable(false);
-               text_file.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+               text_source = new Text(composite, SWT.BORDER);
+               text_source.setEditable(false);
+               text_source.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
 
 
                Button button = new Button(composite, SWT.PUSH);
@@ -103,14 +85,11 @@ public class ImportFromFileDataSourceWizardPage extends WizardPage {
 
                button.addSelectionListener(new SelectionAdapter(){
 
-                       /* (non-Javadoc)
-                        * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-                        */
                        @Override
                        public void widgetSelected(SelectionEvent e) {
                                String path = fileDialog.open();
                                if(path!=null){
-                                   text_file.setText(path);
+                                   text_source.setText(path);
                                    setPageComplete(true);
                                }
                        }
@@ -121,23 +100,18 @@ public class ImportFromFileDataSourceWizardPage extends WizardPage {
                setControl(composite);
        }
 
-       /**
-        * <p>getFile</p>
-        *
-        * @return a {@link java.io.File} object.
-        */
        public File getFile() {
-               return new File(text_file.getText());
+               return new File(text_source.getText());
        }
 
-       /**
-        * <p>getUri</p>
-        *
-        * @return a {@link java.net.URI} object.
-        */
-       public URI getUri() {
+       @Override
+    public URI getUri() {
                return getFile().toURI();
        }
 
+       @Override
+       public boolean isPageComplete() {
+               return CdmUtils.isNotBlank(text_source.getText());
+       }
 
 }
index 3ca24a788f303bd812c5455e5a1f10bbb2a75de7..00a9c1bc6f2623c14c784c577c827770318e25c5 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -13,8 +13,10 @@ package eu.etaxonomy.taxeditor.io.wizard;
 import java.io.File;
 import java.net.URI;
 
+import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.progress.IProgressConstants;
 
 import eu.etaxonomy.cdm.io.jaxb.JaxbExportConfigurator;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -36,11 +38,12 @@ public class JaxbExportWizard extends AbstractExportWizard<JaxbExportConfigurato
         * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
         */
        /** {@inheritDoc} */
-       public void init(IWorkbench workbench, IStructuredSelection selection) {
+       @Override
+    public void init(IWorkbench workbench, IStructuredSelection selection) {
                this.setWindowTitle("JAXB Export");
                this.configurator = CdmStore.getExportManager().JaxbConfigurator();
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.jface.wizard.Wizard#performFinish()
         */
@@ -48,12 +51,21 @@ public class JaxbExportWizard extends AbstractExportWizard<JaxbExportConfigurato
        @Override
        public boolean performFinish() {
                boolean performFinish = false;
-               URI urlString;
-               File savePath = new File(page.getFolderText() + File.separator + page.getExportFileName());
-               urlString = savePath.toURI();
-               //orig: urlString = new URI(page.getFolderText() + File.separator + page.getExportFileName());
+
+               File exportFile = new File(page.getFolderText() + File.separator + page.getExportFileName());
+               URI urlString = exportFile.toURI();
                configurator.setDestination(urlString);
-               CdmStore.getExportManager().run(configurator);
+               if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                   // create job
+                   Job job = CdmStore.getExportManager().createIOServiceJob(configurator, exportFile);
+                   // configure the job
+                   job.setProperty(IProgressConstants.KEEP_PROPERTY, true);
+                   job.setUser(true);
+                   // schedule job
+                   job.schedule();
+               } else {
+               CdmStore.getExportManager().run(configurator);
+               }
                performFinish = true;
                return performFinish;
        }
@@ -65,7 +77,7 @@ public class JaxbExportWizard extends AbstractExportWizard<JaxbExportConfigurato
        @Override
        public void addPages() {
                super.addPages();
-                               
+
                page = ExportToFileDestinationWizardPage.Jaxb();
                addPage(page);
        }
@@ -78,6 +90,6 @@ public class JaxbExportWizard extends AbstractExportWizard<JaxbExportConfigurato
        public JaxbExportConfigurator getConfigurator() {
                return configurator;
        }
-       
+
 
 }
index c6eb0787ba710544d51b349a2461fead6ecb7e9b..379a59f1ae1b89ea1fc0fbe421e67091f629fcc5 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -12,8 +12,10 @@ package eu.etaxonomy.taxeditor.io.wizard;
 
 import java.io.File;
 
+import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.progress.IProgressConstants;
 
 import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -28,9 +30,9 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class SddExportWizard extends AbstractExportWizard<SDDExportConfigurator> {
 
        private ExportToFileDestinationWizardPage page;
-       
+
        private SDDExportConfigurator configurator;
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#getConfigurator()
         */
@@ -46,13 +48,21 @@ public class SddExportWizard extends AbstractExportWizard<SDDExportConfigurator>
        /** {@inheritDoc} */
        @Override
        public boolean performFinish() {
-               File file = new File(page.getFolderText() + File.separator + page.getExportFileName());
-               
-               configurator.setDestination(file);
-               
-               CdmStore.getExportManager().run(configurator);
-               
-               return true;
+           File file = new File(page.getFolderText() + File.separator + page.getExportFileName());
+
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               // create job
+               Job job = CdmStore.getExportManager().createIOServiceJob(configurator, file);
+               // configure the job
+               job.setProperty(IProgressConstants.KEEP_PROPERTY, true);
+               job.setUser(true);
+               // schedule job
+               job.schedule();
+           } else {
+               configurator.setDestination(file);
+               CdmStore.getExportManager().run(configurator);
+           }
+           return true;
        }
 
        /*
@@ -63,16 +73,17 @@ public class SddExportWizard extends AbstractExportWizard<SDDExportConfigurator>
        @Override
        public void addPages() {
                super.addPages();
-               
+
                page = ExportToFileDestinationWizardPage.Sdd();
                addPage(page);
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
         */
        /** {@inheritDoc} */
-       public void init(IWorkbench workbench, IStructuredSelection selection) {                
+       @Override
+    public void init(IWorkbench workbench, IStructuredSelection selection) {
                this.setWindowTitle("SDD Export");
                this.configurator = CdmStore.getExportManager().SddConfigurator();
        }
index 294c68481528788a7eb0a915d19fb9405a64a247..8f4d382fe447410f271f066467f0656caa06a8d0 100644 (file)
@@ -1,21 +1,24 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.io.wizard;
 
+import java.io.File;
 import java.net.URI;
 
+import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IWorkbench;
 
 import eu.etaxonomy.cdm.database.DbSchemaValidation;
+import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
 import eu.etaxonomy.cdm.io.sdd.in.SDDImportConfigurator;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -29,9 +32,9 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class SddImportWizard extends AbstractImportWizard<SDDImportConfigurator> {
 
        private SDDImportConfigurator configurator;
-       
+
        private ImportFromFileDataSourceWizardPage dataSourcePage;
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.io.wizard.AbstractImportWizard#getConfigurator()
         */
@@ -40,7 +43,7 @@ public class SddImportWizard extends AbstractImportWizard<SDDImportConfigurator>
        public SDDImportConfigurator getConfigurator() {
                return configurator;
        }
-       
+
        /*
         * (non-Javadoc)
         * @see org.eclipse.jface.wizard.Wizard#addPage(org.eclipse.jface.wizard.IWizardPage)
@@ -49,12 +52,12 @@ public class SddImportWizard extends AbstractImportWizard<SDDImportConfigurator>
        @Override
        public void addPages() {
                super.addPages();
-               
-               dataSourcePage = new ImportFromFileDataSourceWizardPage("Choose File", 
+
+               dataSourcePage = new ImportFromFileDataSourceWizardPage("Choose File",
                                "Please choose an XML file in the SDD format.", new String[]{"*.xml", "*.sdd"});
                addPage(dataSourcePage);
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.jface.wizard.Wizard#performFinish()
         */
@@ -64,9 +67,14 @@ public class SddImportWizard extends AbstractImportWizard<SDDImportConfigurator>
                URI source = dataSourcePage.getUri();
                configurator.setSource(source);
                configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
-               
-               CdmStore.getImportManager().run(configurator);
-               
+
+               if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                   Job job = CdmStore.getImportManager().createIOServiceJob(configurator, new File(source), SOURCE_TYPE.URI);
+                   CdmStore.getImportManager().run(job);
+               } else {
+                   CdmStore.getImportManager().run(configurator);
+               }
+
                return true;
        }
 
@@ -74,7 +82,8 @@ public class SddImportWizard extends AbstractImportWizard<SDDImportConfigurator>
         * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
         */
        /** {@inheritDoc} */
-       public void init(IWorkbench workbench, IStructuredSelection selection) {
+       @Override
+    public void init(IWorkbench workbench, IStructuredSelection selection) {
                super.init(workbench, selection);
                configurator =  CdmStore.getImportManager().SddConfigurator();
        }
index 96a95ae554bd9a61476a7baa8a46362a1c330731..13113c2e49a6bf93ee1058b30955bb69d58d2396 100644 (file)
@@ -1,21 +1,24 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.io.wizard;
 
+import java.io.File;
 import java.net.URI;
 
+import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IWorkbench;
 
 import eu.etaxonomy.cdm.database.DbSchemaValidation;
+import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
 import eu.etaxonomy.cdm.io.tcsxml.in.TcsXmlImportConfigurator;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -26,8 +29,8 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @created 15.06.2009
  * @version 1.0
  */
-public class TcsImportWizard extends AbstractImportWizard<TcsXmlImportConfigurator>{
-       
+public class TcsImportWizard extends AbstractImportWizard<TcsXmlImportConfigurator> {
+
        private TcsXmlImportConfigurator configurator;
 
        private ImportFromFileDataSourceWizardPage dataSourcePage;
@@ -38,20 +41,26 @@ public class TcsImportWizard extends AbstractImportWizard<TcsXmlImportConfigurat
        /** {@inheritDoc} */
        @Override
        public boolean performFinish() {
-               URI source = dataSourcePage.getUri();
-               configurator.setSource(source);
-               configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
-               
-               CdmStore.getImportManager().run(configurator);
-               
-               return true;
+           URI source = dataSourcePage.getUri();
+           configurator.setSource(source);
+           configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
+
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               Job job = CdmStore.getImportManager().createIOServiceJob(configurator, new File(source), SOURCE_TYPE.URI);
+               CdmStore.getImportManager().run(job);
+           } else {
+               CdmStore.getImportManager().run(configurator);
+           }
+
+           return true;
        }
 
        /* (non-Javadoc)
         * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
         */
        /** {@inheritDoc} */
-       public void init(IWorkbench workbench, IStructuredSelection selection) {
+       @Override
+    public void init(IWorkbench workbench, IStructuredSelection selection) {
                super.init(workbench, selection);
                configurator = CdmStore.getImportManager().TcsConfigurator();
        }
@@ -72,7 +81,7 @@ public class TcsImportWizard extends AbstractImportWizard<TcsXmlImportConfigurat
        @Override
        public void addPages() {
                super.addPages();
-               
+
                dataSourcePage = ImportFromFileDataSourceWizardPage.XML();
                addPage(dataSourcePage);
        }
index 2d21f05c071faad720ffdee9321fe36bda723f15..e700d2e3563aab8333e265b65131eb35c793d774 100644 (file)
@@ -16,8 +16,15 @@ import java.util.Collection;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.TreeSet;
+import java.util.UUID;
 
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
 import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.NotEnabledException;
+import org.eclipse.core.commands.NotHandledException;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.core.commands.operations.AbstractOperation;
 import org.eclipse.core.commands.operations.IOperationHistory;
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -27,6 +34,7 @@ import org.eclipse.core.runtime.OperationCanceledException;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.action.IStatusLineManager;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.resource.ColorRegistry;
@@ -44,17 +52,27 @@ import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.handlers.IHandlerService;
 import org.eclipse.ui.ide.undo.WorkspaceUndoUtil;
 import org.eclipse.ui.part.EditorPart;
+import org.eclipse.ui.progress.IProgressConstants;
 import org.eclipse.ui.progress.IProgressService;
 import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
 import org.eclipse.ui.themes.ITheme;
 import org.eclipse.ui.themes.IThemeManager;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.service.IProgressMonitorService;
+import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
 import eu.etaxonomy.cdm.model.common.IEnumTerm;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
+import eu.etaxonomy.taxeditor.operation.IFeedbackGenerator;
+import eu.etaxonomy.taxeditor.operation.IPostMoniteredOperationEnabled;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmHandler;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
+import eu.etaxonomy.taxeditor.ui.dialog.ReportTextDialog;
 import eu.etaxonomy.taxeditor.view.AbstractCdmDataViewer;
 import eu.etaxonomy.taxeditor.view.detail.DetailsViewPart;
 import eu.etaxonomy.taxeditor.view.supplementaldata.SupplementalDataViewPart;
@@ -70,542 +88,678 @@ import eu.etaxonomy.taxeditor.view.supplementaldata.SupplementalDataViewPart;
  */
 public abstract class AbstractUtility {
 
+    private static final Logger logger = Logger.getLogger(AbstractUtility.class);
+
     /** Constant <code>statusLineManager</code> */
     protected static IStatusLineManager statusLineManager;
 
 
-       /**
-        * <p>
-        * closeAll
-        * </p>
-        *
-        * @return a boolean.
-        */
-       public static boolean closeAll() {
-               return getActivePage().closeAllEditors(true);
-       }
-
-       /**
-        * Close the given editor.
-        *
-        * @param editor
-        *            The <tt>MultipageTaxonEditor</tt> to close.
-        * @return <tt>true</tt> on success
-        */
-       public static boolean close(EditorPart editor) {
-               return getActivePage().closeEditor(editor, true);
-       }
-
-       /**
-        * <p>
-        * getShell
-        * </p>
-        *
-        * @return a {@link org.eclipse.swt.widgets.Shell} object.
-        */
-       public static Shell getShell() {
-
-               return TaxeditorStorePlugin.getDefault().getWorkbench()
-                               .getActiveWorkbenchWindow().getShell();
-       }
-
-       /**
-        * <p>
-        * getActivePage
-        * </p>
-        *
-        * @return a {@link org.eclipse.ui.IWorkbenchPage} object.
-        */
-       public static IWorkbenchPage getActivePage() {
-
-               return TaxeditorStorePlugin.getDefault().getWorkbench()
-                               .getActiveWorkbenchWindow().getActivePage();
-       }
-
-       /**
-        * <p>
-        * getActivePart
-        * </p>
-        *
-        * @return a {@link org.eclipse.ui.IWorkbenchPart} object.
-        */
-       public static IWorkbenchPart getActivePart() {
-               return getActivePage() != null ? getActivePage().getActivePart() : null;
-       }
-
-       public static IWorkbench getWorkbench() {
-               return TaxeditorStorePlugin.getDefault().getWorkbench();
-       }
-
-       /**
-        * <p>
-        * getWorkbenchWindow
-        * </p>
-        *
-        * @return a {@link org.eclipse.jface.window.ApplicationWindow} object.
-        */
-       public static ApplicationWindow getWorkbenchWindow() {
-               if (getWorkbench().getWorkbenchWindowCount() > 1) {
-                       throw new IllegalStateException("More than one workbench window");
-               }
-               return (ApplicationWindow) getWorkbench().getWorkbenchWindows()[0];
-       }
-
-       /**
-        * <p>
-        * showView
-        * </p>
-        *
-        * @param id
-        *            a {@link java.lang.String} object.
-        * @return a {@link org.eclipse.ui.IViewPart} object.
-        */
-       public static IViewPart showView(String id) {
-               try {
-                       return PlatformUI.getWorkbench().getActiveWorkbenchWindow()
-                                       .getActivePage()
-                                       .showView(id, null, IWorkbenchPage.VIEW_VISIBLE);
-               } catch (PartInitException e) {
-                       MessagingUtils.messageDialog("Error opening view", AbstractUtility.class, "Could not open view: " + id, e);
-                       return null;
-               }
-       }
-
-       /**
-        * <p>
-        * hideView
-        * </p>
-        *
-        * @param view
-        *            a {@link org.eclipse.ui.IViewPart} object.
-        */
-       public static void hideView(IViewPart view) {
-               PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
-                               .hideView(view);
-       }
-
-       /**
-        * <p>
-        * getView
-        * </p>
-        *
-        * @param id
-        *            a {@link java.lang.String} object.
-        * @param restore
-        *            a boolean.
-        * @return a {@link org.eclipse.ui.IViewPart} object.
-        */
-       public static IViewPart getView(String id, boolean restore) {
-               IViewReference[] references = PlatformUI.getWorkbench()
-                               .getActiveWorkbenchWindow().getActivePage().getViewReferences();
-               for (IViewReference reference : references) {
-                       if (reference.getId().equals(id)) {
-                               return reference.getView(restore);
-                       }
-               }
-               return null;
-       }
-
-       /**
-        * <p>
-        * getService
-        * </p>
-        *
-        * @param api
-        *            a {@link java.lang.Class} object.
-        * @return a {@link java.lang.Object} object.
-        */
-       public static Object getService(Class api) {
-               return TaxeditorStorePlugin.getDefault().getWorkbench().getService(api);
-       }
-
-       /**
-        * <p>
-        * getCurrentTheme
-        * </p>
-        *
-        * @return a {@link org.eclipse.ui.themes.ITheme} object.
-        */
-       public static ITheme getCurrentTheme() {
-               IThemeManager themeManager = TaxeditorStorePlugin.getDefault()
-                               .getWorkbench().getThemeManager();
-               return themeManager.getCurrentTheme();
-       }
-
-       /**
-        * Fonts registered to the plugin may be obtained with the Eclipse themeing
-        * functionality. Thus fonts are chooseable by the user via
-        * Preferences->General->Appearance->Colors and Fonts
-        *
-        * @return the FontRegistry for the current theme
-        */
-       public static FontRegistry getFontRegistry() {
-               return getCurrentTheme().getFontRegistry();
-       }
-
-       /**
-        * <p>
-        * getFont
-        * </p>
-        *
-        * @param symbolicName
-        *            a {@link java.lang.String} object.
-        * @return a {@link org.eclipse.swt.graphics.Font} object.
-        */
-       public static Font getFont(String symbolicName) {
-               return getFontRegistry().get(symbolicName);
-       }
-
-       /**
-        * Color registered to the plugin may be obtained with the Eclipse themeing
-        * functionality. Thus colors are editable by the user via
-        * Preferences->General->Appearance->Colors and Fonts
-        *
-        * @return the ColorRegistry for the current theme
-        */
-       public static ColorRegistry getColorRegistry() {
-               return getCurrentTheme().getColorRegistry();
-       }
-
-       /**
-        * <p>
-        * getColor
-        * </p>
-        *
-        * @param symbolicName
-        *            a {@link java.lang.String} object.
-        * @return a {@link org.eclipse.swt.graphics.Color} object.
-        */
-       public static Color getColor(String symbolicName) {
-               return getColorRegistry().get(symbolicName);
-       }
-
-       /**
-        * <p>
-        * executeOperation
-        * </p>
-        *
-        * @param operation
-        *            a
-        *            {@link eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation}
-        *            object.
-        * @return a {@link org.eclipse.core.runtime.IStatus} object.
-        */
-       public static IStatus executeOperation(final AbstractPostOperation operation) {
-               if (getOperationHistory() == null) {
-                       throw new IllegalArgumentException(
-                                       "There is no operation history for this context");
-               }
-
-               final IAdaptable uiInfoAdapter = WorkspaceUndoUtil
-                               .getUIInfoAdapter(getShell());
-
-               IRunnableWithProgress runnable = new IRunnableWithProgress() {
-
-                       @Override
+    /**
+     * <p>
+     * closeAll
+     * </p>
+     *
+     * @return a boolean.
+     */
+    public static boolean closeAll() {
+        return getActivePage().closeAllEditors(true);
+    }
+
+    /**
+     * Close the given editor.
+     *
+     * @param editor
+     *            The <tt>MultipageTaxonEditor</tt> to close.
+     * @return <tt>true</tt> on success
+     */
+    public static boolean close(EditorPart editor) {
+        return getActivePage().closeEditor(editor, true);
+    }
+
+    /**
+     * <p>
+     * getShell
+     * </p>
+     *
+     * @return a {@link org.eclipse.swt.widgets.Shell} object.
+     */
+    public static Shell getShell() {
+
+        return TaxeditorStorePlugin.getDefault().getWorkbench()
+                .getActiveWorkbenchWindow().getShell();
+    }
+
+    /**
+     * <p>
+     * getActivePage
+     * </p>
+     *
+     * @return a {@link org.eclipse.ui.IWorkbenchPage} object.
+     */
+    public static IWorkbenchPage getActivePage() {
+
+        return TaxeditorStorePlugin.getDefault().getWorkbench()
+                .getActiveWorkbenchWindow().getActivePage();
+    }
+
+    /**
+     * <p>
+     * getActivePart
+     * </p>
+     *
+     * @return a {@link org.eclipse.ui.IWorkbenchPart} object.
+     */
+    public static IWorkbenchPart getActivePart() {
+        return getActivePage() != null ? getActivePage().getActivePart() : null;
+    }
+
+    public static IWorkbench getWorkbench() {
+        return TaxeditorStorePlugin.getDefault().getWorkbench();
+    }
+
+    /**
+     * <p>
+     * getWorkbenchWindow
+     * </p>
+     *
+     * @return a {@link org.eclipse.jface.window.ApplicationWindow} object.
+     */
+    public static ApplicationWindow getWorkbenchWindow() {
+        if (getWorkbench().getWorkbenchWindowCount() > 1) {
+            throw new IllegalStateException("More than one workbench window");
+        }
+        return (ApplicationWindow) getWorkbench().getWorkbenchWindows()[0];
+    }
+
+    /**
+     * <p>
+     * showView
+     * </p>
+     *
+     * @param id
+     *            a {@link java.lang.String} object.
+     * @return a {@link org.eclipse.ui.IViewPart} object.
+     */
+    public static IViewPart showView(String id) {
+        try {
+            return PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+                    .getActivePage()
+                    .showView(id, null, IWorkbenchPage.VIEW_VISIBLE);
+        } catch (PartInitException e) {
+            MessagingUtils.messageDialog("Error opening view", AbstractUtility.class, "Could not open view: " + id, e);
+            return null;
+        }
+    }
+
+    /**
+     * <p>
+     * hideView
+     * </p>
+     *
+     * @param view
+     *            a {@link org.eclipse.ui.IViewPart} object.
+     */
+    public static void hideView(IViewPart view) {
+        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+        .hideView(view);
+    }
+
+    /**
+     * <p>
+     * getView
+     * </p>
+     *
+     * @param id
+     *            a {@link java.lang.String} object.
+     * @param restore
+     *            a boolean.
+     * @return a {@link org.eclipse.ui.IViewPart} object.
+     */
+    public static IViewPart getView(String id, boolean restore) {
+        IViewReference[] references = PlatformUI.getWorkbench()
+                .getActiveWorkbenchWindow().getActivePage().getViewReferences();
+        for (IViewReference reference : references) {
+            if (reference.getId().equals(id)) {
+                return reference.getView(restore);
+            }
+        }
+        return null;
+    }
+
+    /**
+     * <p>
+     * getService
+     * </p>
+     *
+     * @param api
+     *            a {@link java.lang.Class} object.
+     * @return a {@link java.lang.Object} object.
+     */
+    public static Object getService(Class api) {
+        return TaxeditorStorePlugin.getDefault().getWorkbench().getService(api);
+    }
+
+    /**
+     * <p>
+     * getCurrentTheme
+     * </p>
+     *
+     * @return a {@link org.eclipse.ui.themes.ITheme} object.
+     */
+    public static ITheme getCurrentTheme() {
+        IThemeManager themeManager = TaxeditorStorePlugin.getDefault()
+                .getWorkbench().getThemeManager();
+        return themeManager.getCurrentTheme();
+    }
+
+    /**
+     * Fonts registered to the plugin may be obtained with the Eclipse themeing
+     * functionality. Thus fonts are chooseable by the user via
+     * Preferences->General->Appearance->Colors and Fonts
+     *
+     * @return the FontRegistry for the current theme
+     */
+    public static FontRegistry getFontRegistry() {
+        return getCurrentTheme().getFontRegistry();
+    }
+
+    /**
+     * <p>
+     * getFont
+     * </p>
+     *
+     * @param symbolicName
+     *            a {@link java.lang.String} object.
+     * @return a {@link org.eclipse.swt.graphics.Font} object.
+     */
+    public static Font getFont(String symbolicName) {
+        return getFontRegistry().get(symbolicName);
+    }
+
+    /**
+     * Color registered to the plugin may be obtained with the Eclipse themeing
+     * functionality. Thus colors are editable by the user via
+     * Preferences->General->Appearance->Colors and Fonts
+     *
+     * @return the ColorRegistry for the current theme
+     */
+    public static ColorRegistry getColorRegistry() {
+        return getCurrentTheme().getColorRegistry();
+    }
+
+    /**
+     * <p>
+     * getColor
+     * </p>
+     *
+     * @param symbolicName
+     *            a {@link java.lang.String} object.
+     * @return a {@link org.eclipse.swt.graphics.Color} object.
+     */
+    public static Color getColor(String symbolicName) {
+        return getColorRegistry().get(symbolicName);
+    }
+
+    /**
+     * <p>
+     * executeOperation
+     * </p>
+     *
+     * @param operation
+     *            a
+     *            {@link eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation}
+     *            object.
+     * @return a {@link org.eclipse.core.runtime.IStatus} object.
+     */
+    public static IStatus executeOperation(final AbstractPostOperation operation) {
+        if (getOperationHistory() == null) {
+            throw new IllegalArgumentException(
+                    "There is no operation history for this context");
+        }
+
+        final IAdaptable uiInfoAdapter = WorkspaceUndoUtil
+                .getUIInfoAdapter(getShell());
+
+        IRunnableWithProgress runnable = new IRunnableWithProgress() {
+
+            @Override
             public void run(IProgressMonitor monitor)
-                                       throws InvocationTargetException, InterruptedException {
-                               String operationlabel = operation.getLabel();
+                    throws InvocationTargetException, InterruptedException {
+                String operationlabel = operation.getLabel();
                 monitor.beginTask(operationlabel, 100);
-                               IStatus status = Status.CANCEL_STATUS;
-                               try {
-                                       operation.addContext(IOperationHistory.GLOBAL_UNDO_CONTEXT);
-                                       status = getOperationHistory().execute(operation, monitor,
-                                                       uiInfoAdapter);
-                               } catch (ExecutionException e) {
-
-                                       MessagingUtils.operationDialog(this, e, TaxeditorStorePlugin.PLUGIN_ID, operationlabel, null);
-
-                               } finally {
-                                       monitor.done();
-                               }
-
-                               String statusString = status.equals(Status.OK_STATUS) ? "completed"
-                                               : "cancelled";
-                               setStatusLine(operationlabel + " " + statusString + ".");
-
-                       }
-               };
-
-               try {
-                       runInUI(runnable, null);
-               } catch (Exception e) {
-                       MessagingUtils.messageDialog("Error executing operation", AbstractUtility.class, "An error occured while executing " + operation.getLabel(), e);
-               }
-
-               IPostOperationEnabled postOperationEnabled = operation
-                               .getPostOperationEnabled();
-               if (postOperationEnabled != null) {
-                       postOperationEnabled.onComplete();
-               }
-               return Status.OK_STATUS;
-       }
-
-       /**
-        * <p>
-        * getOperationHistory
-        * </p>
-        *
-        * @return a {@link org.eclipse.core.commands.operations.IOperationHistory}
-        *         object.
-        */
-       public static IOperationHistory getOperationHistory() {
-               return getWorkbench().getOperationSupport().getOperationHistory();
-       }
-
-       /**
-        * <p>
-        * setStatusLine
-        * </p>
-        *
-        * @param message
-        *            a {@link java.lang.String} object.
-        */
-       public static void setStatusLine(final String message) {
-               Display.getDefault().asyncExec(new Runnable() {
-
-                       @Override
+                IStatus status = Status.CANCEL_STATUS;
+                try {
+                    operation.addContext(IOperationHistory.GLOBAL_UNDO_CONTEXT);
+                    status = getOperationHistory().execute(operation, monitor,
+                            uiInfoAdapter);
+                } catch (ExecutionException e) {
+
+                    MessagingUtils.operationDialog(this, e, TaxeditorStorePlugin.PLUGIN_ID, operationlabel, null);
+
+                } finally {
+                    monitor.done();
+                }
+
+                String statusString = status.equals(Status.OK_STATUS) ? "completed"
+                        : "cancelled";
+                setStatusLine(operationlabel + " " + statusString + ".");
+
+            }
+        };
+
+        try {
+            runInUI(runnable, null);
+        } catch (Exception e) {
+            MessagingUtils.messageDialog("Error executing operation", AbstractUtility.class, "An error occured while executing " + operation.getLabel(), e);
+        }
+
+        IPostOperationEnabled postOperationEnabled = operation
+                .getPostOperationEnabled();
+        if (postOperationEnabled != null) {
+            postOperationEnabled.onComplete();
+        }
+        return Status.OK_STATUS;
+    }
+
+    public static IStatus executeOperation(final AbstractOperation operation, final RemotingCdmHandler handler) {
+        if (getOperationHistory() == null) {
+            throw new IllegalArgumentException(
+                    "There is no operation history for this context");
+        }
+
+        final IAdaptable uiInfoAdapter = WorkspaceUndoUtil
+                .getUIInfoAdapter(getShell());
+
+        IRunnableWithProgress runnable = new IRunnableWithProgress() {
+
+            @Override
+            public void run(IProgressMonitor monitor)
+                    throws InvocationTargetException, InterruptedException {
+                String operationlabel = operation.getLabel();
+                monitor.beginTask(operationlabel, 100);
+                IStatus status = Status.CANCEL_STATUS;
+                try {
+                    operation.addContext(IOperationHistory.GLOBAL_UNDO_CONTEXT);
+                    status = getOperationHistory().execute(operation, monitor,
+                            uiInfoAdapter);
+                    if(handler != null) {
+                        handler.postOperation(status);
+                    }
+                } catch (ExecutionException e) {
+                    MessagingUtils.operationDialog(this, e, TaxeditorStorePlugin.PLUGIN_ID, operationlabel, null);
+                } finally {
+                    monitor.done();
+                }
+
+                String statusString = status.equals(Status.OK_STATUS) ? "completed"
+                        : "cancelled";
+                setStatusLine(operationlabel + " " + statusString + ".");
+
+            }
+        };
+
+        try {
+            runInUI(runnable, null);
+        } catch (Exception e) {
+            MessagingUtils.messageDialog("Error executing operation", AbstractUtility.class, "An error occured while executing " + operation.getLabel(), e);
+        }
+
+        return Status.OK_STATUS;
+    }
+
+    /**
+     * Executes a remoting monitored operation
+     *
+     * @param label for the operation
+     * @param uuid of the remoting monitor already started on the server
+     * @param pollInterval in milliseconds
+     * @param cancelable flag which determines whether the operation can be cancelled
+     * @param postOp callback for running post operation logic
+     * @return
+     */
+    public static IStatus executeMoniteredOperation(final String label,
+            final UUID uuid,
+            final int pollInterval,
+            final boolean cancelable,
+            final IPostMoniteredOperationEnabled postOp,
+            final IFeedbackGenerator feedbackGenerator) {
+
+        try {
+            // get the remoting monitor the first time to make sure that the
+            // operation is valid
+            final IProgressMonitorService progressMonitorService = CdmApplicationState.getCurrentAppConfig().getProgressMonitorService();
+            final IRemotingProgressMonitor firstRemotingMonitor = progressMonitorService.getRemotingMonitor(uuid);
+            if(firstRemotingMonitor == null) {
+                throw new IllegalStateException("Remoting progress monitor is null");
+            }
+
+            Job job = new Job(label) {
+
+
+                @Override
+                public IStatus run(IProgressMonitor monitor) {
+                    // run the monitor until the operation is finished
+                    IRemotingProgressMonitor remotingMonitor;
+                    try {
+                        remotingMonitor = CdmStore.getProgressMonitorClientManager().pollMonitor(label,
+                                uuid,
+                                pollInterval,
+                                postOp,
+                                feedbackGenerator,
+                                monitor);
+                    } catch (Exception ex) {
+                        return new Status(Status.ERROR, TaxeditorStorePlugin.PLUGIN_ID, "Operation Interrupted", ex);
+                    }
+                    final StringBuilder reportSb = new StringBuilder();
+                    // collect reports
+                    for(String report : remotingMonitor.getReports()) {
+                        reportSb.append(report);
+                    }
+                    if(!StringUtils.isBlank(reportSb.toString())) {
+                        Display.getDefault().asyncExec(new Runnable() {
+                            @Override
+                            public void run() {
+                                // display reports with possibility to save
+                                ReportTextDialog dialog = new ReportTextDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+                                dialog.setTitle(label + " Report");
+                                dialog.setReportText(reportSb.toString());
+                                dialog.open();
+                            }
+                        });
+                    }
+                    return Status.OK_STATUS;
+                }
+
+                @Override
+                protected void canceling() {
+                    CdmStore.getCurrentApplicationConfiguration().getProgressMonitorService().cancel(uuid);
+                }
+            };
+
+            // configure the job
+            job.setProperty(IProgressConstants.KEEP_PROPERTY, true);
+            job.setUser(true);
+            // schedule job
+            job.schedule();
+
+        } catch (Exception e) {
+            MessagingUtils.errorDialog("Error executing operation",
+                    AbstractUtility.class,
+                    "An error occured while executing " + label,
+                    TaxeditorStorePlugin.PLUGIN_ID,
+                    e,
+                    true);
+        }
+
+        return Status.OK_STATUS;
+    }
+
+
+    /**
+     * <p>
+     * getOperationHistory
+     * </p>
+     *
+     * @return a {@link org.eclipse.core.commands.operations.IOperationHistory}
+     *         object.
+     */
+    public static IOperationHistory getOperationHistory() {
+        return getWorkbench().getOperationSupport().getOperationHistory();
+    }
+
+    /**
+     * <p>
+     * setStatusLine
+     * </p>
+     *
+     * @param message
+     *            a {@link java.lang.String} object.
+     */
+    public static void setStatusLine(final String message) {
+        Display.getDefault().asyncExec(new Runnable() {
+
+            @Override
             public void run() {
-                               statusLineManager.setMessage(message);
-                       }
-
-               });
-
-       }
-
-       /**
-        * <p>
-        * getMonitor
-        * </p>
-        *
-        * @return a {@link org.eclipse.core.runtime.IProgressMonitor} object.
-        */
-       public static IProgressMonitor getMonitor() {
-               statusLineManager.setCancelEnabled(false);
-               return statusLineManager.getProgressMonitor();
-       }
-
-       /**
-        * Starts either the given {@link IProgressMonitor} if it's not
-        * <code>null</code> or a new {@link NullProgressMonitor}.
-        *
-        * @param progressMonitor
-        *            The {@link IProgressMonitor} or <code>null</code> if no
-        *            progress should be reported.
-        * @param taskName
-        *            The name of the main task.
-        * @param steps
-        *            The number of steps this task is subdivided into.
-        * @return The {@link IProgressMonitor}.
-        */
-       public static IProgressMonitor startMainMonitor(
-                       IProgressMonitor progressMonitor, String taskName, int steps) {
-               IProgressMonitor newMonitor = progressMonitor;
-               if (newMonitor == null) {
-                       newMonitor = new NullProgressMonitor();
-               }
-               newMonitor.beginTask(taskName == null ? "" : taskName, steps);
-               newMonitor.subTask(" ");
-               return newMonitor;
-       }
-
-       /**
-        * Creates a {@link SubProgressMonitor} if the given
-        * {@link IProgressMonitor} is not <code>null</code> and not a
-        * {@link NullProgressMonitor}.
-        *
-        * @param progressMonitor
-        *            The parent {@link IProgressMonitor} of the
-        *            {@link SubProgressMonitor} to be created.
-        * @param ticks
-        *            The number of steps this subtask is subdivided into. Must be a
-        *            positive number and must not be
-        *            {@link IProgressMonitor#UNKNOWN}.
-        * @return The {@link IProgressMonitor}.
-        */
-       public static IProgressMonitor getSubProgressMonitor(
-                       IProgressMonitor progressMonitor, int ticks) {
-               if (progressMonitor == null) {
-                       return new NullProgressMonitor();
-               }
-               if (progressMonitor instanceof NullProgressMonitor) {
-                       return progressMonitor;
-               }
-
-               return new SubProgressMonitor(progressMonitor, ticks);
-       }
-
-       /**
-        * Checks whether the user canceled this operation. If not canceled, the
-        * given number of steps are declared as done.
-        *
-        * @param newMonitor
-        *            a {@link org.eclipse.core.runtime.IProgressMonitor} object.
-        * @param steps
-        *            a int.
-        */
-       public static void workedChecked(IProgressMonitor newMonitor, int steps) {
-               // In case the progress monitor was canceled throw an exception.
-               if (newMonitor.isCanceled()) {
-                       throw new OperationCanceledException();
-               }
-               // Otherwise declare this step as done.
-               newMonitor.worked(steps);
-       }
-
-       /**
-        * Present a progress dialog to the user. This dialog will block the UI
-        *
-        * @param runnable
-        *            an implementation of {@link IRunnableWithProgress}
-        * @throws java.lang.InterruptedException
-        *             if any.
-        * @throws java.lang.reflect.InvocationTargetException
-        *             if any.
-        */
-       public static void busyCursorWhile(IRunnableWithProgress runnable)
-                       throws InvocationTargetException, InterruptedException {
-               getProgressService().busyCursorWhile(runnable);
-       }
-
-       /**
-        * <p>
-        * runInUI
-        * </p>
-        *
-        * @see {@link IProgressService#runInUI(org.eclipse.jface.operation.IRunnableContext, IRunnableWithProgress, ISchedulingRule)}
-        * @param runnable
-        *            a {@link org.eclipse.jface.operation.IRunnableWithProgress}
-        *            object.
-        * @param rule
-        *            a {@link org.eclipse.core.runtime.jobs.ISchedulingRule}
-        *            object.
-        * @throws java.lang.reflect.InvocationTargetException
-        *             if any.
-        * @throws java.lang.InterruptedException
-        *             if any.
-        */
-       public static void runInUI(IRunnableWithProgress runnable,
-                       ISchedulingRule rule) throws InvocationTargetException,
-                       InterruptedException {
-               getProgressService().runInUI(getWorkbenchWindow(), runnable, rule);
-       }
-
-       /**
-        * <p>
-        * run
-        * </p>
-        *
-        * @param fork
-        *            a boolean.
-        * @param cancelable
-        *            a boolean.
-        * @param runnable
-        *            a {@link org.eclipse.jface.operation.IRunnableWithProgress}
-        *            object.
-        * @throws java.lang.reflect.InvocationTargetException
-        *             if any.
-        * @throws java.lang.InterruptedException
-        *             if any.
-        */
-       public static void run(boolean fork, boolean cancelable,
-                       IRunnableWithProgress runnable) throws InvocationTargetException,
-                       InterruptedException {
-               getProgressService().run(fork, cancelable, runnable);
-       }
-
-       /**
-        * <p>
-        * getProgressService
-        * </p>
-        *
-        * @return a {@link org.eclipse.ui.progress.IProgressService} object.
-        */
-       public static IProgressService getProgressService() {
-               IWorkbench workbench = PlatformUI.getWorkbench();
-               return workbench.getProgressService();
-       }
-
-       /**
-        * <p>
-        * getProgressService2
-        * </p>
-        *
-        * @return a {@link org.eclipse.ui.progress.IWorkbenchSiteProgressService}
-        *         object.
-        */
-       public static IWorkbenchSiteProgressService getProgressService2() {
-               return (IWorkbenchSiteProgressService) getService(IWorkbenchSiteProgressService.class);
-       }
-
-       /**
-        * <p>
-        * getPluginId
-        * </p>
-        *
-        * @return a {@link java.lang.String} object.
-        */
-       public static String getPluginId() {
-               return "eu.taxeditor";
-       }
-
-       /**
-        * <p>
-        * getActiveEditor
-        * </p>
-        *
-        * @return a {@link org.eclipse.ui.IEditorPart} object.
-        */
-       public static IEditorPart getActiveEditor() {
-               return getActivePage() != null ? getActivePage().getActiveEditor()
-                               : null;
-       }
-
-       /**
-        * <p>
-        * getDetailsView
-        * </p>
-        *
-        * @return a {@link eu.etaxonomy.taxeditor.view.detail.DetailsViewPart}
-        *         object.
-        */
-       public static DetailsViewPart getDetailsView() {
-               return (DetailsViewPart) getView(DetailsViewPart.ID, false);
-       }
-
-       /**
-        * <p>
-        * refreshDetailsViewer
-        * </p>
-        */
-       public static void refreshDetailsViewer() {
-               if (getDetailsView() != null) {
-                       ((AbstractCdmDataViewer) getDetailsView().getViewer()).refresh();
-               }
-       }
-
-       /**
-        * <p>
-        * reflowDetailsViewer
-        * </p>
-        */
-       public static void reflowDetailsViewer() {
-               if (getDetailsView() != null) {
-                       ((AbstractCdmDataViewer) getDetailsView().getViewer()).reflow();
-               }
-       }
-
-       public static SupplementalDataViewPart getSupplementalDataView() {
-               return (SupplementalDataViewPart) getView(SupplementalDataViewPart.ID,
-                               false);
-       }
-
-       public static void reflowSupplementalViewer() {
-               if (getSupplementalDataView() != null) {
-                       ((AbstractCdmDataViewer) getSupplementalDataView().getViewer())
-                                       .reflow();
-               }
-       }
+                statusLineManager.setMessage(message);
+            }
+
+        });
+
+    }
+
+    /**
+     * <p>
+     * getMonitor
+     * </p>
+     *
+     * @return a {@link org.eclipse.core.runtime.IProgressMonitor} object.
+     */
+    public static IProgressMonitor getMonitor() {
+        statusLineManager.setCancelEnabled(false);
+        return statusLineManager.getProgressMonitor();
+    }
+
+    /**
+     * Starts either the given {@link IProgressMonitor} if it's not
+     * <code>null</code> or a new {@link NullProgressMonitor}.
+     *
+     * @param progressMonitor
+     *            The {@link IProgressMonitor} or <code>null</code> if no
+     *            progress should be reported.
+     * @param taskName
+     *            The name of the main task.
+     * @param steps
+     *            The number of steps this task is subdivided into.
+     * @return The {@link IProgressMonitor}.
+     */
+    public static IProgressMonitor startMainMonitor(
+            IProgressMonitor progressMonitor, String taskName, int steps) {
+        IProgressMonitor newMonitor = progressMonitor;
+        if (newMonitor == null) {
+            newMonitor = new NullProgressMonitor();
+        }
+        newMonitor.beginTask(taskName == null ? "" : taskName, steps);
+        newMonitor.subTask(" ");
+        return newMonitor;
+    }
+
+    /**
+     * Creates a {@link SubProgressMonitor} if the given
+     * {@link IProgressMonitor} is not <code>null</code> and not a
+     * {@link NullProgressMonitor}.
+     *
+     * @param progressMonitor
+     *            The parent {@link IProgressMonitor} of the
+     *            {@link SubProgressMonitor} to be created.
+     * @param ticks
+     *            The number of steps this subtask is subdivided into. Must be a
+     *            positive number and must not be
+     *            {@link IProgressMonitor#UNKNOWN}.
+     * @return The {@link IProgressMonitor}.
+     */
+    public static IProgressMonitor getSubProgressMonitor(
+            IProgressMonitor progressMonitor, int ticks) {
+        if (progressMonitor == null) {
+            return new NullProgressMonitor();
+        }
+        if (progressMonitor instanceof NullProgressMonitor) {
+            return progressMonitor;
+        }
+
+        return new SubProgressMonitor(progressMonitor, ticks);
+    }
+
+    /**
+     * Checks whether the user canceled this operation. If not canceled, the
+     * given number of steps are declared as done.
+     *
+     * @param newMonitor
+     *            a {@link org.eclipse.core.runtime.IProgressMonitor} object.
+     * @param steps
+     *            a int.
+     */
+    public static void workedChecked(IProgressMonitor newMonitor, int steps) {
+        // In case the progress monitor was canceled throw an exception.
+        if (newMonitor.isCanceled()) {
+            throw new OperationCanceledException();
+        }
+        // Otherwise declare this step as done.
+        newMonitor.worked(steps);
+    }
+
+    /**
+     * Present a progress dialog to the user. This dialog will block the UI
+     *
+     * @param runnable
+     *            an implementation of {@link IRunnableWithProgress}
+     * @throws java.lang.InterruptedException
+     *             if any.
+     * @throws java.lang.reflect.InvocationTargetException
+     *             if any.
+     */
+    public static void busyCursorWhile(IRunnableWithProgress runnable)
+            throws InvocationTargetException, InterruptedException {
+        getProgressService().busyCursorWhile(runnable);
+    }
+
+    /**
+     * <p>
+     * runInUI
+     * </p>
+     *
+     * @see {@link IProgressService#runInUI(org.eclipse.jface.operation.IRunnableContext, IRunnableWithProgress, ISchedulingRule)}
+     * @param runnable
+     *            a {@link org.eclipse.jface.operation.IRunnableWithProgress}
+     *            object.
+     * @param rule
+     *            a {@link org.eclipse.core.runtime.jobs.ISchedulingRule}
+     *            object.
+     * @throws java.lang.reflect.InvocationTargetException
+     *             if any.
+     * @throws java.lang.InterruptedException
+     *             if any.
+     */
+    public static void runInUI(IRunnableWithProgress runnable,
+            ISchedulingRule rule) throws InvocationTargetException,
+            InterruptedException {
+        getProgressService().runInUI(getWorkbenchWindow(), runnable, rule);
+    }
+
+    /**
+     * <p>
+     * run
+     * </p>
+     *
+     * @param fork
+     *            a boolean.
+     * @param cancelable
+     *            a boolean.
+     * @param runnable
+     *            a {@link org.eclipse.jface.operation.IRunnableWithProgress}
+     *            object.
+     * @throws java.lang.reflect.InvocationTargetException
+     *             if any.
+     * @throws java.lang.InterruptedException
+     *             if any.
+     */
+    public static void run(boolean fork, boolean cancelable,
+            IRunnableWithProgress runnable) throws InvocationTargetException,
+            InterruptedException {
+        getProgressService().run(fork, cancelable, runnable);
+    }
+
+    /**
+     * <p>
+     * getProgressService
+     * </p>
+     *
+     * @return a {@link org.eclipse.ui.progress.IProgressService} object.
+     */
+    public static IProgressService getProgressService() {
+        IWorkbench workbench = PlatformUI.getWorkbench();
+        return workbench.getProgressService();
+    }
+
+    /**
+     * <p>
+     * getProgressService2
+     * </p>
+     *
+     * @return a {@link org.eclipse.ui.progress.IWorkbenchSiteProgressService}
+     *         object.
+     */
+    public static IWorkbenchSiteProgressService getProgressService2() {
+        return (IWorkbenchSiteProgressService) getService(IWorkbenchSiteProgressService.class);
+    }
+
+    /**
+     * <p>
+     * getPluginId
+     * </p>
+     *
+     * @return a {@link java.lang.String} object.
+     */
+    public static String getPluginId() {
+        return "eu.taxeditor";
+    }
+
+    /**
+     * <p>
+     * getActiveEditor
+     * </p>
+     *
+     * @return a {@link org.eclipse.ui.IEditorPart} object.
+     */
+    public static IEditorPart getActiveEditor() {
+        return getActivePage() != null ? getActivePage().getActiveEditor()
+                : null;
+    }
+
+    /**
+     * <p>
+     * getDetailsView
+     * </p>
+     *
+     * @return a {@link eu.etaxonomy.taxeditor.view.detail.DetailsViewPart}
+     *         object.
+     */
+    public static DetailsViewPart getDetailsView() {
+        return (DetailsViewPart) getView(DetailsViewPart.ID, false);
+    }
+
+    /**
+     * <p>
+     * refreshDetailsViewer
+     * </p>
+     */
+    public static void refreshDetailsViewer() {
+        if (getDetailsView() != null) {
+            ((AbstractCdmDataViewer) getDetailsView().getViewer()).refresh();
+        }
+    }
+
+    /**
+     * <p>
+     * reflowDetailsViewer
+     * </p>
+     */
+    public static void reflowDetailsViewer() {
+        if (getDetailsView() != null) {
+            ((AbstractCdmDataViewer) getDetailsView().getViewer()).reflow();
+        }
+    }
+
+    public static SupplementalDataViewPart getSupplementalDataView() {
+        return (SupplementalDataViewPart) getView(SupplementalDataViewPart.ID,
+                false);
+    }
+
+    public static void reflowSupplementalViewer() {
+        if (getSupplementalDataView() != null) {
+            ((AbstractCdmDataViewer) getSupplementalDataView().getViewer())
+            .reflow();
+        }
+    }
 
 
     /**
@@ -776,4 +930,28 @@ public abstract class AbstractUtility {
     }
 
 
+    public static void executeCommand(String commandId, Object source, String pluginId) {
+        IHandlerService handlerService = (IHandlerService) AbstractUtility.getService(IHandlerService.class);
+        Exception exception = null;
+        try {
+            handlerService.executeCommand(commandId, null);
+        } catch (ExecutionException e) {
+            exception = e;
+        } catch (NotDefinedException e) {
+            exception = e;
+        } catch (NotEnabledException e) {
+            exception = e;
+        } catch (NotHandledException e) {
+            exception = e;
+        } finally {
+            if(exception != null) {
+                MessagingUtils.errorDialog("Error executing command",
+                        source,
+                        "Could not execute command with id " + commandId ,
+                        pluginId,
+                        exception,
+                        true);
+            }
+        }
+    }
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AuthorHelper.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AuthorHelper.java
deleted file mode 100644 (file)
index 6884ba8..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.model;
-
-import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.model.agent.Person;
-import eu.etaxonomy.cdm.model.agent.Team;
-import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
-
-/**
- * Utility class for handling of authorship related elements.
- *
- * @author n.hoffmann
- * @created Sep 8, 2010
- * @version 1.0
- */
-public class AuthorHelper {
-
-    /**
-     * If the given {@link TeamOrPersonBase} is a {@link Person} this methods
-     * creates a new {@link Team} with this person. If it already a team the
-     * team is returned.
-     * 
-     * @param teamOrPerson
-     *            a team or a person
-     * @return the given team or a newly created team with the given person
-     */
-       public static Team getAuthor(TeamOrPersonBase<?> teamOrPerson){
-               if(teamOrPerson == null){
-                       return null;
-               }
-               Object deproxiedObject = HibernateProxyHelper.deproxy(teamOrPerson);
-               if(deproxiedObject instanceof Person){
-                       Person person = (Person) deproxiedObject;
-                       Team team = Team.NewInstance();
-                       team.addTeamMember(person);
-                       return team;
-               }
-               else if(deproxiedObject instanceof Team){
-                       return (Team) deproxiedObject;
-               }else{
-                       throw new IllegalArgumentException("Given object os of the wrong type");
-               }
-       }
-}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmDeleteErrorDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmDeleteErrorDialog.java
new file mode 100644 (file)
index 0000000..d3a5b52
--- /dev/null
@@ -0,0 +1,84 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.model;
+
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Shell;
+
+
+/**
+ * @author k.luther
+ * @date Oct 7, 2015
+ *
+ */
+public class CdmDeleteErrorDialog extends ErrorDialog {
+
+
+        private static final int DIALOG_MAX_HEIGHT = 500;
+
+        private final String stackTrace;
+
+
+
+        /**
+         * @param parentShell
+         * @param dialogTitle
+         * @param message
+         * @param status
+         * @param stackTrace
+         */
+        public CdmDeleteErrorDialog(Shell parentShell,
+                String dialogTitle,
+                String message,
+                IStatus status,
+                String stackTrace,
+                Object[] updatedObjects) {
+            super(parentShell,
+                    dialogTitle,
+                    message, status,
+                    IStatus.OK| IStatus.INFO | IStatus.WARNING | IStatus.ERROR);
+            this.stackTrace = stackTrace;
+            this.message = message == null ? status.getMessage()
+                    : message + "\n " + status.getMessage(); //$NON-NLS-1$
+        }
+
+
+        /* (non-Javadoc)
+         * @see org.eclipse.jface.dialogs.ErrorDialog#buttonPressed(int)
+         */
+        @Override
+        protected void buttonPressed(int id) {
+            super.buttonPressed(id);
+            if (id == IDialogConstants.DETAILS_ID) {
+                Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
+                // set height to max allowed
+                if(getShell().getSize().y > DIALOG_MAX_HEIGHT) {
+                    getShell().setSize(getShell().getSize().x, 500);
+                } else {
+                    getShell().setSize(getShell().getSize().x, oldSize.y);
+                }
+            }
+
+        }
+
+
+
+
+
+
+
+
+
+}
index 9d33e2a124d598eae1deb25ccde3a9571b38e96b..8e39946ecd94d5e2ef9b35b8907a82e32766c52a 100644 (file)
@@ -47,14 +47,21 @@ public      class CdmErrorDialog extends ErrorDialog {
             String dialogTitle,
             String message,
             IStatus status,
-            String stackTrace) {
+            String stackTrace,
+            boolean showStatusMessage) {
         super(parentShell,
                 dialogTitle,
                 message, status,
                 IStatus.OK| IStatus.INFO | IStatus.WARNING | IStatus.ERROR);
         this.stackTrace = stackTrace;
+        String statusMessage = "";
+        if(showStatusMessage) {
+            statusMessage = status.getMessage();
+        }
+        this.message = message == null ? statusMessage : message + "\n " + statusMessage;
     }
 
+
     /**
      * @param parentShell
      * @param dialogTitle
@@ -65,7 +72,7 @@ public        class CdmErrorDialog extends ErrorDialog {
             String dialogTitle,
             String message,
             IStatus status) {
-        this(parentShell, dialogTitle, message, status, "");
+        this(parentShell, dialogTitle, message, status, "", true);
     }
 
        /* (non-Javadoc)
@@ -136,4 +143,6 @@ public      class CdmErrorDialog extends ErrorDialog {
                        new Transfer[] { TextTransfer.getInstance() });
            }
        }
+
+
 }
index 40d8e197ba1f42e0d0756b389b36f4a3d67c2403..3506523e34240a3a42642dda0fed1e8f95f99e0d 100644 (file)
@@ -37,9 +37,11 @@ public abstract class CdmObjectTransfer<T extends ICdmBase> extends ByteArrayTra
         */
        @Override
        protected void javaToNative(Object object, TransferData transferData) {
-               byte[] bytes = toByteArray((T[]) object);
-               if (bytes != null)
-                       super.javaToNative(bytes, transferData);
+               if (object != null){
+                       byte[] bytes = toByteArray((T[]) object);
+                       if (bytes != null)
+                               super.javaToNative(bytes, transferData);
+               }
        }
        
        /* (non-Javadoc)
@@ -48,8 +50,12 @@ public abstract class CdmObjectTransfer<T extends ICdmBase> extends ByteArrayTra
        @Override
        protected Object nativeToJava(TransferData transferData) {
                byte[] bytes = (byte[]) super.nativeToJava(transferData);
-               return fromByteArray(bytes);
+               if (bytes != null){
+                       return fromByteArray(bytes);
+               }
+               return null;
        }
+               
        
        protected byte[] toByteArray(T[] elements) {
                ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
index f9e994006d61a6d298335a404928169a2eaa9d8a..70a7130dbcadccd960bf964632c5bd1bea5ae0a4 100644 (file)
@@ -1,8 +1,10 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.model;
 
+import java.io.Serializable;
+
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.NullProgressMonitor;
 
@@ -16,17 +18,17 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  * @version 1.0
  */
 public class CdmProgressMonitorAdapter implements eu.etaxonomy.cdm.common.monitor.IProgressMonitor {
-       
+
        private IProgressMonitor progressMonitor;
 
        private CdmProgressMonitorAdapter (IProgressMonitor monitor){
                if(monitor == null){
                        monitor = new NullProgressMonitor();
                }
-               
+
                this.progressMonitor = monitor;
        }
-       
+
        /**
         * <p>CreateMonitor</p>
         *
@@ -36,7 +38,7 @@ public class CdmProgressMonitorAdapter implements eu.etaxonomy.cdm.common.monito
        public static CdmProgressMonitorAdapter CreateMonitor (IProgressMonitor monitor){
                return new CdmProgressMonitorAdapter(monitor);
        }
-       
+
        /**
         * <p>CreateSubMonitor</p>
         *
@@ -48,7 +50,7 @@ public class CdmProgressMonitorAdapter implements eu.etaxonomy.cdm.common.monito
                IProgressMonitor subMonitor = StoreUtil.getSubProgressMonitor(monitor, ticks);
                return new CdmProgressMonitorAdapter(subMonitor);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public void beginTask(String name, int totalWork) {
@@ -107,4 +109,79 @@ public class CdmProgressMonitorAdapter implements eu.etaxonomy.cdm.common.monito
        public void internalWorked(double arg0) {
                progressMonitor.internalWorked(arg0);
        }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Serializable getFeedback() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean getIsWaitingForFeedback() {
+        return false;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void setFeedback(Serializable arg0) {
+
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void waitForFeedback() {
+
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getOwner() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean hasFeedbackWaitTimedOut() {
+        return false;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void interrupt() {
+
+
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void setOwner(String arg0) {
+
+
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void waitForFeedback(long arg0) {
+
+    }
+
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/DeleteResultMessagingUtils.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/DeleteResultMessagingUtils.java
new file mode 100644 (file)
index 0000000..55854c6
--- /dev/null
@@ -0,0 +1,83 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.model;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+
+import eu.etaxonomy.cdm.api.service.DeleteResult;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+
+/**
+ * @author k.luther
+ * @date Oct 5, 2015
+ *
+ */
+public class DeleteResultMessagingUtils extends MessagingUtils {
+    /**
+     * Displays a message {@link org.eclipse.jface.dialogs.MessageDialog}.
+     *
+     * @param title
+     * @param source
+     * @param message
+     */
+    public static void messageDialogWithDetails(DeleteResult result, String message, String pluginId) {
+        if (result.isOk() && result.getExceptions().isEmpty()){
+            return;
+        }
+        List<String> details = new ArrayList<String>();
+        String title= "";
+
+        if (result.getExceptions().size() > 0){
+            for (Exception e:result.getExceptions()){
+                details.add(e.getMessage());
+            }
+            if (result.isOk()){
+                title = "Delete was successfull.";
+            } else {
+                title = "Delete was aborted.";
+            }
+        }
+        StringBuffer relatedObjectsString = new StringBuffer();
+        List<String> relatedObjects = new ArrayList<String>();
+        if (result.getUpdatedObjects().size() > 0){
+            Iterator<CdmBase> objects = result.getRelatedObjects().iterator();
+            while (objects.hasNext()){
+                CdmBase object = objects.next();
+                if (object instanceof IdentifiableEntity){
+
+                    relatedObjects.add(((IdentifiableEntity)object).getTitleCache() );
+                } else{
+                    relatedObjects.add(object.getUserFriendlyTypeName());
+                }
+
+            }
+
+            for (String relatedObject: relatedObjects){
+
+                relatedObjectsString.append(relatedObject);
+                relatedObjectsString.append(System.lineSeparator());
+            }
+        }
+        message = message + "\n" ;
+        String stackTraceWithContext = getContextInfo(details);
+        CdmDeleteErrorDialog ced = new CdmDeleteErrorDialog(AbstractUtility.getShell(), title, message,new Status(IStatus.INFO, pluginId, relatedObjectsString.toString(), result.getExceptions().iterator().next()), stackTraceWithContext, result.getUpdatedObjects().toArray());
+
+        ced.open();
+
+
+
+    }
+}
index dd393a39dbbf7776a4c9b8dddf8f78fc8d24f16d..8f92e1a177c83aa6d1b36110080c98ede24829fd 100644 (file)
@@ -389,7 +389,7 @@ public class DescriptionHelper {
                        text = "No label provided";
                }
 
-               return "Description: " + text;
+               return text;
        }
 
        /**
@@ -403,7 +403,7 @@ public class DescriptionHelper {
                if(derivedUnit != null){
                        return derivedUnit.getTitleCache();
                }
-               return "No text provided";
+               return "No unit chosen";
        }
 
        /**
index 66f714a87147fcdd77112130eec42e3f64b3cf35..8aab0e7ee1cedace88cf1d8478d8bceb6b4f838c 100644 (file)
@@ -118,6 +118,8 @@ public class ImageResources {
        /** Constant <code>LOCK_ICON="locked"</code> */
        public static final String LOCK_ICON = "lock";
 
+       public static final String SYNCED = "synced";
+
        /** Constant <code>LOCK_OPEN_ICON="lock_open"</code> */
        public static final String LOCK_OPEN_ICON = "lock_open";
 
@@ -144,6 +146,7 @@ public class ImageResources {
        public static final String FIELD_UNIT = "field_unit";
        public static final String FIELD_UNIT_CHARACTER_DATA = "field_unit_character_data";
        public static final String SPECIMEN_DERIVATE = "specimen_derivate";
+       public static final String SPECIMEN_DERIVATE_TYPE = "specimen_derivate_type";
        public static final String SPECIMEN_DERIVATE_CHARACTER_DATA = "specimen_derivate_character_data";
     public static final String ARTWORK_DERIVATE = "artwork_derivate";
     public static final String ARTWORK_DERIVATE_CHARACTER_DATA = "artwork_derivate_character_data";
@@ -335,6 +338,8 @@ public class ImageResources {
                                "prj_obj.gif");
                registerImage(registry, LOCK_ICON,
                        "lock.png");
+               registerImage(registry, SYNCED,
+                       "synced.gif");
                registerImage(registry, LOCK_OPEN_ICON,
                        "lock_open.png");
                registerImage(registry, SWITCH_VIEW_TYPE,
@@ -349,6 +354,8 @@ public class ImageResources {
                        "fieldunit_data-16x16-32.png");
                registerImage(registry, SPECIMEN_DERIVATE,
                        "specimen_derivate-16x16-32.png");
+               registerImage(registry, SPECIMEN_DERIVATE_TYPE,
+                       "specimen_derivate_type-16x16-32.png");
                registerImage(registry, SPECIMEN_DERIVATE_CHARACTER_DATA,
                        "specimen_derivate_data-16x16-32.png");
                registerImage(registry, ARTWORK_DERIVATE,
index b316c2a0692e06056eb5f368d5a5206dbb07c898..563b8a8a923cb0aa00f5a04e57c2657ead140708 100644 (file)
@@ -14,7 +14,7 @@ import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.widgets.Display;
 
-import eu.etaxonomy.cdm.persistence.hibernate.permission.SecurityExceptionUtils;
+import eu.etaxonomy.cdm.test.integration.SecurityExceptionUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
@@ -31,6 +31,9 @@ public class MessagingUtils {
     public final static String UNEXPECTED_ERROR_MESSAGE = "This is an unexpected error.";
     public final static String CONTACT_MESSAGE = System.getProperty("line.separator") +  "Please contact EDIT Support (EditSupport@bgbm.org) with the error trace below (click on the 'Details' button).";
     public final static String DEFAULT_MESSAGE = "Error thrown but no associated message";
+    public final static String CONNECTION_FAILURE_MESSAGE = "The connection to the remote server has been broken";
+    public final static String REMOTE_ACCESS_FAILURE_MESSAGE = "Problem accessing remote server";
+    public static final String WIDGET_IS_DISPOSED_MESSAGE = "A widget was called, which was already disposed";
 
     /**
      * Gets the Log4J logger for a given class
@@ -219,6 +222,19 @@ public class MessagingUtils {
         return stackTraceAndContextInfo.toString();
     }
 
+    public static String getContextInfo(List<String> contextInfo)  {
+        StringBuffer scontextInfoStringBuffer = new StringBuffer();
+
+
+        for(String infoItem : contextInfo) {
+            scontextInfoStringBuffer.append(infoItem + System.getProperty("line.separator"));
+        }
+
+
+
+        return scontextInfoStringBuffer.toString();
+    }
+
     private static Throwable getDefaultThrowable() {
         return new Throwable("Error thrown but no associated exception");
     }
@@ -240,14 +256,15 @@ public class MessagingUtils {
             final Throwable t,
             final List<String> contextInfo,
             final String message,
-            final MultiStatus status) {
+            final MultiStatus status,
+            final boolean showReason) {
 
         Display.getDefault().asyncExec(new Runnable() {
 
             @Override
             public void run() {
                 String stackTraceWithContext = getStackTraceAndContextInfo(t, contextInfo);
-                CdmErrorDialog ced = new CdmErrorDialog(AbstractUtility.getShell(), title, message, status, stackTraceWithContext);
+                CdmErrorDialog ced = new CdmErrorDialog(AbstractUtility.getShell(), title, message, status, stackTraceWithContext, showReason);
                 ced.open();
                 Class<? extends Object> clazz = source != null ? source.getClass() : this.getClass();
 
@@ -262,6 +279,15 @@ public class MessagingUtils {
         });
     }
 
+    public static void errorDialog(final String title,
+            final Object source,
+            final String message,
+            final String pluginId,
+            final Throwable t,
+            boolean addContactMesg) {
+        errorDialog(title, source, message, pluginId, t, addContactMesg, true);
+
+    }
     /**
      * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
      *
@@ -276,7 +302,8 @@ public class MessagingUtils {
             final String message,
             final String pluginId,
             final Throwable t,
-            boolean addContactMesg) {
+            boolean addContactMesg,
+            boolean showReason) {
 
         Throwable throwable = t;
         StringBuffer sbStackTrace = new StringBuffer();
@@ -343,7 +370,7 @@ public class MessagingUtils {
                 throwable.toString(),
                 throwable);
 
-        errorDialog(title, source, throwable, contextInfo, finalMessage, ms);
+        errorDialog(title, source, throwable, contextInfo, finalMessage, ms, showReason);
     }
 
     /**
index e9f2eef6a52108b91be1330c83c9d92e2de35e4a..69fc04ed2b324d6ad69b5d93f8589af99796bff6 100644 (file)
@@ -38,7 +38,11 @@ public class NewAmplificationWizard  extends AbstractNewEntityWizard<Amplificati
     /** {@inheritDoc} */
     @Override
     protected void saveEntity() {
-        CdmStore.getService(IAmplificationService.class).saveOrUpdate(getEntity());
+        if(CdmStore.getCurrentSessionManager().isRemoting()) {
+            CdmStore.getService(IAmplificationService.class).merge(getEntity(), true);
+        } else {
+            CdmStore.getService(IAmplificationService.class).save(getEntity());
+        }
     }
 
     /** {@inheritDoc} */
index 6b23b4bc04b8974d7f04b79dae779a71fa605be5..4586b9275e2329e4580b97a9361e51ec122c32d3 100644 (file)
@@ -1,15 +1,18 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.newWizard;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -36,16 +39,25 @@ public class NewClassificationWizard extends AbstractNewEntityWizard<Classificat
                entity = CdmStore.getService(IClassificationService.class).load(entity.getUuid());
                super.setEntity(entity);
        }
-       
+
        @Override
        public void addPages() {
                classificationWizardPage = new ClassificationWizardPage(formFactory, getConversationHolder(), getEntity());
                addPage(classificationWizardPage);
        }
-       
+
        @Override
        protected void saveEntity() {
-               CdmStore.getService(IClassificationService.class).saveOrUpdate(getEntity());
+               //CdmStore.getService(IClassificationService.class).saveOrUpdate(getEntity());
+           Classification classification = getEntity();
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               CdmStore.getService(IClassificationService.class).merge(getEntity(), true);
+               CdmApplicationState.getCurrentDataChangeService()
+               .fireChangeEvent(new CdmChangeEvent(Action.Create, classification, NewTaxonNodeWizard.class), true);
+           } else {
+               CdmStore.getService(IClassificationService.class).save(getEntity());
+           }
+
        }
 
        @Override
index d28f0ec5d6ddf22aebde5d18e77193ed517b6ba5..8efc02f8cfa1f4db1f0fad5c2ea5e4b80353e2b3 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -29,14 +29,18 @@ public class NewCollectionWizard extends AbstractNewEntityWizard<Collection> {
        public void addPages() {
                addPage(new CollectionWizardPage(formFactory, getConversationHolder(), getEntity()));
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#saveEntity()
         */
        /** {@inheritDoc} */
        @Override
        protected void saveEntity() {
-               CdmStore.getService(ICollectionService.class).saveOrUpdate(getEntity());
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               CdmStore.getService(ICollectionService.class).merge(getEntity(), true);
+           } else {
+               CdmStore.getService(ICollectionService.class).save(getEntity());
+           }
        }
 
        /* (non-Javadoc)
@@ -52,5 +56,5 @@ public class NewCollectionWizard extends AbstractNewEntityWizard<Collection> {
        protected String getEntityName() {
                return "Collection";
        }
-       
+
 }
index 6849014316f3ee9d65d1590c5769ca6c7eacdb61..9f382d431c04d2f2d14db62e6f4df8eb1c237209 100644 (file)
@@ -1,12 +1,12 @@
 // $Id$
 /**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
 
 package eu.etaxonomy.taxeditor.newWizard;
 
@@ -29,53 +29,46 @@ import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitWizardPage;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventWizardPage;
 
 /**
- * <p>NewDerivedUnitBaseWizard class.</p>
- *
  * @author n.hoffmann
  * @created Jun 16, 2010
  * @version 1.0
  */
 public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard<SpecimenOrObservationBase> implements IDerivedUnitFacadePart{
-       private SpecimenOrObservationType specOrObsType = null;
+    private SpecimenOrObservationType specOrObsType = null;
 
-       public NewDerivedUnitBaseWizard() {
-               super();
-       }
+    public NewDerivedUnitBaseWizard() {
+        super();
+        CdmStore.getCurrentSessionManager().bindNullSession();
+    }
 
-       public NewDerivedUnitBaseWizard(SpecimenOrObservationType specOrObsType) {
-               super();
-               this.specOrObsType = specOrObsType;
-       }
-       /** {@inheritDoc} */
-       @Override
-       public void addPages() {
-           DerivedUnitFacade facade = null;
-           try {
-               if(getEntity() instanceof DerivedUnit) {
-                   facade = DerivedUnitFacade.NewInstance((DerivedUnit)getEntity(), PreferencesUtil.getDerivedUnitConfigurator());
-                   addPage(new DerivedUnitGeneralWizardPage(formFactory, getConversationHolder(), facade));
-                   addPage(new GatheringEventWizardPage(formFactory, getConversationHolder(), facade));
-                   addPage(new FieldUnitWizardPage(formFactory, getConversationHolder(), facade));
-                   addPage(new DerivedUnitBaseWizardPage(formFactory, getConversationHolder(), facade));
-               }
-               else if(getEntity() instanceof FieldUnit){
-                   facade = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.FieldUnit, (FieldUnit)getEntity(), PreferencesUtil.getDerivedUnitConfigurator());
-                   addPage(new FieldUnitGeneralWizardPage(formFactory, getConversationHolder(), facade));
-                   addPage(new GatheringEventWizardPage(formFactory, getConversationHolder(), facade));
-                   addPage(new FieldUnitWizardPage(formFactory, getConversationHolder(), facade));
-               }
-           } catch (DerivedUnitFacadeNotSupportedException e) {
-               // we should never get here
-               throw new IllegalStateException();
-           }
-       }
+    public NewDerivedUnitBaseWizard(SpecimenOrObservationType specOrObsType) {
+        super();
+        this.specOrObsType = specOrObsType;
+    }
+    /** {@inheritDoc} */
+    @Override
+    public void addPages() {
+        DerivedUnitFacade facade = null;
+        try {
+            if(getEntity() instanceof DerivedUnit) {
+                facade = DerivedUnitFacade.NewInstance((DerivedUnit)getEntity(), PreferencesUtil.getDerivedUnitConfigurator());
+                addPage(new DerivedUnitGeneralWizardPage(formFactory, getConversationHolder(), facade));
+                addPage(new GatheringEventWizardPage(formFactory, getConversationHolder(), facade));
+                addPage(new FieldUnitWizardPage(formFactory, getConversationHolder(), facade));
+                addPage(new DerivedUnitBaseWizardPage(formFactory, getConversationHolder(), facade));
+            }
+            else if(getEntity() instanceof FieldUnit){
+                facade = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.FieldUnit, (FieldUnit)getEntity(), PreferencesUtil.getDerivedUnitConfigurator());
+                addPage(new FieldUnitGeneralWizardPage(formFactory, getConversationHolder(), facade));
+                addPage(new GatheringEventWizardPage(formFactory, getConversationHolder(), facade));
+                addPage(new FieldUnitWizardPage(formFactory, getConversationHolder(), facade));
+            }
+        } catch (DerivedUnitFacadeNotSupportedException e) {
+            // we should never get here
+            throw new IllegalStateException();
+        }
+    }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#
-     * createNewEntity()
-     */
     /** {@inheritDoc} */
     @Override
     protected SpecimenOrObservationBase createNewEntity() {
@@ -84,8 +77,8 @@ public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard<SpecimenOr
         } else {
             if (SpecimenOrObservationType.Media.equals(specOrObsType)
                     || ((specOrObsType.getKindOf() != null) && specOrObsType.getKindOf().equals(SpecimenOrObservationType.Media))) {
-                   MediaSpecimen mediaSpecimen = MediaSpecimen.NewInstance(specOrObsType);
-                   //a MediaSpecimen with no media attached does not make sense. Hence, we add one
+                MediaSpecimen mediaSpecimen = MediaSpecimen.NewInstance(specOrObsType);
+                //a MediaSpecimen with no media attached does not make sense. Hence, we add one
                 mediaSpecimen.setMediaSpecimen(Media.NewInstance());
                 return mediaSpecimen;
             } else if (specOrObsType.equals(SpecimenOrObservationType.FieldUnit)) {
@@ -96,19 +89,21 @@ public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard<SpecimenOr
         }
     }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#saveEntity()
-        */
+
        /** {@inheritDoc} */
        @Override
        protected void saveEntity() {
-               CdmStore.getService(IOccurrenceService.class).saveOrUpdate(getEntity());
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               CdmStore.getService(IOccurrenceService.class).merge(getEntity(), true);
+           } else {
+               CdmStore.getService(IOccurrenceService.class).save(getEntity());
+           }
        }
 
-       @Override
-       protected String getEntityName() {
-               return "Specimen";
-       }
 
+    @Override
+    protected String getEntityName() {
+        return "Specimen";
+    }
 
 }
index a93e8f18541aa099c634f4d0492858ca5375eef6..59086434ccdf25bb50bd22367971a78dfbb995f9 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -38,7 +38,11 @@ public class NewFieldUnitWizard extends AbstractNewEntityWizard<FieldUnit> {
        /** {@inheritDoc} */
        @Override
        protected void saveEntity() {
-               CdmStore.getService(IOccurrenceService.class).saveOrUpdate(getEntity());
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               CdmStore.getService(IOccurrenceService.class).merge(getEntity(), true);
+           } else {
+               CdmStore.getService(IOccurrenceService.class).save(getEntity());
+           }
        }
 
        @Override
index d14e60819095bb07201120674d8c3be2daae0fe1..c3342795473dbd318516f80f6dea016b12186660 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -20,9 +20,9 @@ import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetail
  * @created Sept 13 2012
  */
 public class NewGrantedAuthorityWizard extends AbstractNewEntityWizard<GrantedAuthorityImpl> {
-       
+
        private GrantedAuthorityDetailWizardPage authorityPage;
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.jface.wizard.Wizard#addPages()
         */
@@ -38,7 +38,11 @@ public class NewGrantedAuthorityWizard extends AbstractNewEntityWizard<GrantedAu
         */
        @Override
        protected void saveEntity() {
-               CdmStore.getService(IGrantedAuthorityService.class).saveOrUpdate(getEntity());
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               CdmStore.getService(IGrantedAuthorityService.class).merge(getEntity(), true);
+           } else {
+               CdmStore.getService(IGrantedAuthorityService.class).save(getEntity());
+           }
        }
 
        /* (non-Javadoc)
index ad6c3ac255de9a5d835726ce5b3b8ef04734a295..6f6b52236b12ff50c4d513070ad4cd05b43318a6 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -23,7 +23,7 @@ import eu.etaxonomy.taxeditor.ui.section.group.GroupDetailWizardPage;
 public class NewGroupWizard extends AbstractNewEntityWizard<Group> {
 
        private GroupDetailWizardPage groupPage;
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.jface.wizard.Wizard#addPages()
         */
@@ -32,13 +32,17 @@ public class NewGroupWizard extends AbstractNewEntityWizard<Group> {
                groupPage = new GroupDetailWizardPage(formFactory, getConversationHolder(), getEntity());
                super.addPage(groupPage);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#saveEntity()
         */
        @Override
        protected void saveEntity() {
-               CdmStore.getService(IGroupService.class).saveOrUpdate(getEntity());
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               CdmStore.getService(IGroupService.class).merge(getEntity(), true);
+           } else {
+               CdmStore.getService(IGroupService.class).save(getEntity());
+           }
        }
 
        /* (non-Javadoc)
index 1eba0be640dbf9de4c056c80c32d23bdedc40e47..6ac2d44407d5d86204df615c1bf8493c72aef7f4 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -29,13 +29,17 @@ public class NewInstitutionWizard extends AbstractNewEntityWizard<Institution> {
        public void addPages() {
                addPage(new InstitutionWizardPage(formFactory, getConversationHolder(), getEntity()));
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#saveEntity()
         */
        @Override
        protected void saveEntity() {
-               CdmStore.getService(IAgentService.class).saveOrUpdate(getEntity());
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               CdmStore.getService(IAgentService.class).merge(getEntity(), true);
+           } else {
+               CdmStore.getService(IAgentService.class).save(getEntity());
+           }
        }
 
        /* (non-Javadoc)
index 6e6ec088643f8ea272f1983d83a6d03f7ecac373..cfdd27d18fb41f4559b99ca07567dcf9baecd50e 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -33,7 +33,7 @@ public class NewNonViralNameWizard extends AbstractNewEntityWizard<NonViralName>
        public void addPages() {
                addPage(new NonViralNameWizardPage(formFactory, getConversationHolder(), getEntity()));
        }
-       
+
        /** {@inheritDoc} */
        @Override
        protected NonViralName createNewEntity() {
@@ -49,7 +49,11 @@ public class NewNonViralNameWizard extends AbstractNewEntityWizard<NonViralName>
        /** {@inheritDoc} */
        @Override
        protected void saveEntity() {
-               CdmStore.getService(INameService.class).saveOrUpdate(getEntity());
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               CdmStore.getService(INameService.class).merge(getEntity(), true);
+           } else {
+               CdmStore.getService(INameService.class).save(getEntity());
+           }
        }
 
        @Override
index da18787665f6b06ea4ce61095da79e6055b150b8..ab5f7038d644a9df499ff241b833b0d777147968 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -29,7 +29,7 @@ public class NewPersonWizard extends AbstractNewEntityWizard<Person> {
        public void addPages() {
                addPage(new PersonWizardPage(formFactory, getConversationHolder(), getEntity()));
        }
-       
+
        /** {@inheritDoc} */
        @Override
        protected Person createNewEntity() {
@@ -39,7 +39,11 @@ public class NewPersonWizard extends AbstractNewEntityWizard<Person> {
        /** {@inheritDoc} */
        @Override
        protected void saveEntity() {
-               CdmStore.getService(IAgentService.class).saveOrUpdate(getEntity());
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               CdmStore.getService(IAgentService.class).merge(getEntity(), true);
+           } else {
+               CdmStore.getService(IAgentService.class).save(getEntity());
+           }
        }
 
        @Override
index 8a9d17db502c78cf2855e2d135dcd6602f9abd05..daade68014f9bb41c4229a9533f89d58c70cf284 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.newWizard;
 
@@ -14,24 +14,28 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class NewPolytomousKeyWizard extends AbstractNewEntityWizard<PolytomousKey> {
 
     private PolytomousKeyWizardPage polytomousKeyPage;
-    
+
        @Override
        public void addPages() {
                polytomousKeyPage = new PolytomousKeyWizardPage(formFactory, getConversationHolder(), getEntity());
                super.addPage(polytomousKeyPage);
        }
-       
+
        public String getPolytomousKeyName() {
            return polytomousKeyPage.getPolytomousKeyName();
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#saveEntity()
         */
        @Override
        protected void saveEntity() {
            if(!polytomousKeyPage.getPolytomousKeyName().equals("")) {
-               CdmStore.getService(IPolytomousKeyService.class).saveOrUpdate(getEntity());
+               if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                   CdmStore.getService(IPolytomousKeyService.class).merge(getEntity(), true);
+               } else {
+                   CdmStore.getService(IPolytomousKeyService.class).save(getEntity());
+               }
            }
        }
 
index dbe73be468f3f4702022d9291b67347bc3286f61..de52e18d14f64ec84e2786057f8796a511366066 100644 (file)
@@ -38,7 +38,11 @@ public class NewPrimerWizard  extends AbstractNewEntityWizard<Primer> {
     /** {@inheritDoc} */
     @Override
     protected void saveEntity() {
-        CdmStore.getService(IPrimerService.class).saveOrUpdate(getEntity());
+        if(CdmStore.getCurrentSessionManager().isRemoting()) {
+            CdmStore.getService(IPrimerService.class).merge(getEntity(),true);
+        } else {
+            CdmStore.getService(IPrimerService.class).save(getEntity());
+        }
     }
 
     /** {@inheritDoc} */
index f1b19c94a5dac2417fac4d26252401f63d027f98..f89d0458e18d054efac1cf7cf3b4a140a5b775ca 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -24,9 +24,9 @@ import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceWizardPage;
  * @version 1.0
  */
 public class NewReferenceWizard extends AbstractNewEntityWizard<Reference> {
-       
+
        private ReferenceWizardPage referencePage;
-       
+
        /** {@inheritDoc} */
        @Override
        public void addPages() {
@@ -45,7 +45,7 @@ public class NewReferenceWizard extends AbstractNewEntityWizard<Reference> {
        /** {@inheritDoc} */
        @Override
        protected void saveEntity() {
-               CdmStore.getService(IReferenceService.class).saveOrUpdate(getEntity());
+           CdmStore.getService(IReferenceService.class).save(getEntity());
        }
 
        /** {@inheritDoc} */
index 82550414bc3fae12207efa57711d0140b5bf86a0..0586c53f074be26348bfa04cbb772f66e1e6ccfd 100644 (file)
@@ -3,12 +3,20 @@
  */
 package eu.etaxonomy.taxeditor.newWizard;
 
+import java.util.HashSet;
+import java.util.Set;
 import java.util.UUID;
 
 import org.apache.commons.lang.StringUtils;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
@@ -26,94 +34,137 @@ import eu.etaxonomy.taxeditor.ui.section.classification.TaxonNodeWizardPage;
  */
 public class NewTaxonNodeWizard extends AbstractNewEntityWizard<ITaxonTreeNode>{
 
-       private TaxonNodeWizardPage taxonNodePage;
-       private boolean openEmptyEditor;
-       private UUID generatedTaxonNodeUuid;
+    private TaxonNodeWizardPage taxonNodePage;
+    private boolean openEmptyEditor;
+    private UUID generatedTaxonNodeUuid;
     private IWizardPageListener wizardPageListener;
 
-       @Override
-       public void addPages() {
-               taxonNodePage = new TaxonNodeWizardPage(formFactory, getConversationHolder(), getEntity(), wizardPageListener);
-               addPage(taxonNodePage);
-       }
-
-       @Override
-       protected void saveEntity() {
-               if(taxonNodePage.getTaxon() == null || StringUtils.isEmpty(taxonNodePage.getTaxon().getName().getFullTitleCache())){
-                       openEmptyEditor = true;
-               }else{
-                       getConversationHolder().bind();
-                       ITaxonTreeNode parent = getParentTreeNode();
-                       Taxon taxon = taxonNodePage.getTaxon();
-                       try{
-                               TaxonNode taxonNode = parent.addChildTaxon(taxon, parent.getReference(), parent.getMicroReference());
-                               generatedTaxonNodeUuid = CdmStore.getService(ITaxonNodeService.class).saveOrUpdate(taxonNode);
-                       }catch(IllegalArgumentException e){
-                               MessagingUtils.warningDialog("Taxon already exists in classfication", getClass(), e.getMessage());
-                       }
-               }
-       }
-
-       @Override
-       protected ITaxonTreeNode createNewEntity() {
-               if(getSelection() != null){
-                       Object selectedObject = getSelection().getFirstElement();
-                       if(selectedObject instanceof ITaxonTreeNode){
-                           ITaxonTreeNode treeNode = (ITaxonTreeNode) selectedObject;
-
-                               if(treeNode instanceof Classification){
-                                       return CdmStore.getService(IClassificationService.class).load(treeNode.getUuid());
-                               }
-                               else if(treeNode instanceof TaxonNode){
-                                       return CdmStore.getService(ITaxonNodeService.class).load(treeNode.getUuid());
-                               }
-                       }
-               }
-
-               return null;
-       }
-
-       /**
-        * <p>openInEditor</p>
-        *
-        * @return a boolean.
-        */
-       public boolean openInEditor(){
-               return taxonNodePage.openInEditor();
-       }
-
-       /**
-        * <p>openEmpty</p>
-        *
-        * @return a boolean.
-        */
-       public boolean openEmpty(){
-               return openInEditor() && openEmptyEditor;
-       }
-
-       /**
-        * <p>getTaxonNode</p>
-        *
-        * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonNode} object.
-        */
-       public TaxonNode getTaxonNode(){
-               if(generatedTaxonNodeUuid != null){
-                       return CdmStore.getService(ITaxonNodeService.class).load(generatedTaxonNodeUuid);
-               }
-               return null;
-       }
-
-       public ITaxonTreeNode getParentTreeNode(){
-               return taxonNodePage.getParentTreeNode();
-       }
-
-       @Override
-       protected String getEntityName() {
-               return "Taxon";
-       }
-
-       public void addWizardPageListener(IWizardPageListener wizardPageListener){
-           this.wizardPageListener = wizardPageListener;
-       }
+    @Override
+    public void addPages() {
+        taxonNodePage = new TaxonNodeWizardPage(formFactory, getConversationHolder(), getEntity(), wizardPageListener, true);
+
+        addPage(taxonNodePage);
+    }
+
+    @Override
+    protected void saveEntity() {
+        if(taxonNodePage.getTaxon() == null || StringUtils.isEmpty(taxonNodePage.getTaxon().getName().getFullTitleCache())){
+            openEmptyEditor = true;
+        }else{
+            getConversationHolder().bind();
+            ITaxonTreeNode parent = getParentTreeNode();
+            Taxon taxon = taxonNodePage.getTaxon();
+            Reference sec = taxon.getSec();
+            taxon.setSec(null);
+            try{
+               UUID parentNodeUuid;
+               if(parent instanceof Classification){
+                   parentNodeUuid = ((Classification) parent).getRootNode().getUuid();
+               }
+               else{
+                   parentNodeUuid = parent.getUuid();
+               }
+                UpdateResult result = CdmStore.getService(ITaxonNodeService.class).createNewTaxonNode(parentNodeUuid, taxon, parent.getReference(), parent.getMicroReference());
+
+                //TaxonNode taxonNode = parent.addChildTaxon(taxon, parent.getReference(), parent.getMicroReference());
+
+              /*  if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                    taxonNode = CdmStore.getService(ITaxonNodeService.class).merge(taxonNode);
+                } else {
+                    taxonNode = CdmStore.getService(ITaxonNodeService.class).save(taxonNode);
+                }*/
+                if (result.isOk()){
+                       generatedTaxonNodeUuid = result.getCdmEntity().getUuid();
+                       TaxonNode taxonNode = CdmStore.getService(ITaxonNodeService.class).load(generatedTaxonNodeUuid);
+                       taxonNode.getTaxon().setSec(sec);
+                       CdmStore.getService(ITaxonNodeService.class).merge(taxonNode, true);
+                    Set<CdmBase> affectedObjects = new HashSet<CdmBase>();
+                    if (result.getUpdatedObjects().iterator().hasNext()){
+                       TaxonNode parentNode = (TaxonNode)result.getUpdatedObjects().iterator().next();
+                       if(parentNode.getParent() == null) {
+                            affectedObjects.add(taxonNode.getClassification());
+                        }
+                       affectedObjects.add(parentNode);
+                    }
+                    if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                        CdmApplicationState.getCurrentDataChangeService()
+                            .fireChangeEvent(new CdmChangeEvent(Action.Create, affectedObjects, NewTaxonNodeWizard.class), true);
+                    }
+                }else{
+                    if (!result.isOk()){
+                        if (!result.getExceptions().isEmpty()){
+                            MessagingUtils.error(getClass(), "Taxon could not be created", result.getExceptions().iterator().next());
+                        }else{
+                            MessagingUtils.warn(getClass(), "Taxon could not be created");
+                        }
+                    }
+                }
+            }catch(IllegalArgumentException e){
+                MessagingUtils.warningDialog("Taxon already exists in classfication", getClass(), e.getMessage());
+            }
+        }
+    }
+
+    @Override
+    protected ITaxonTreeNode createNewEntity() {
+        if(getSelection() != null){
+            Object selectedObject = getSelection().getFirstElement();
+            if(selectedObject instanceof ITaxonTreeNode){
+                ITaxonTreeNode treeNode = (ITaxonTreeNode) selectedObject;
+
+                if(treeNode instanceof Classification){
+                    return CdmStore.getService(IClassificationService.class).load(treeNode.getUuid());
+                }
+                else if(treeNode instanceof TaxonNode){
+                    return CdmStore.getService(ITaxonNodeService.class).load(treeNode.getUuid());
+                }
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * <p>openInEditor</p>
+     *
+     * @return a boolean.
+     */
+    public boolean openInEditor(){
+        return taxonNodePage.openInEditor();
+    }
+
+    /**
+     * <p>openEmpty</p>
+     *
+     * @return a boolean.
+     */
+    public boolean openEmpty(){
+        return openInEditor() && openEmptyEditor;
+    }
+
+    /**
+     * <p>getTaxonNode</p>
+     *
+     * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonNode} object.
+     */
+    public TaxonNode getTaxonNode(){
+        if(generatedTaxonNodeUuid != null){
+            return CdmStore.getService(ITaxonNodeService.class).load(generatedTaxonNodeUuid);
+        }
+        return null;
+    }
+
+    public ITaxonTreeNode getParentTreeNode(){
+        return taxonNodePage.getParentTreeNode();
+    }
+
+    @Override
+    protected String getEntityName() {
+        return "Taxon";
+    }
+
+    public void addWizardPageListener(IWizardPageListener wizardPageListener){
+        this.wizardPageListener = wizardPageListener;
+    }
 
 }
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonWizard.java
new file mode 100644 (file)
index 0000000..1947c45
--- /dev/null
@@ -0,0 +1,60 @@
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.newWizard;
+
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.model.name.NonViralName;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameWizardPage;
+import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonWizardPage;
+
+/**
+ *
+ * @author pplitzner
+ * @date Jan 18, 2016
+ *
+ */
+public class NewTaxonWizard extends AbstractNewEntityWizard<Taxon> {
+
+       private TaxonWizardPage taxonWizardPage;
+
+       /** {@inheritDoc} */
+       @Override
+       public void addPages() {
+           addPage(new NonViralNameWizardPage(formFactory, getConversationHolder(), (NonViralName) getEntity().getName()));
+               taxonWizardPage = new TaxonWizardPage(formFactory, getConversationHolder(), getEntity());
+               addPage(taxonWizardPage);
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       protected Taxon createNewEntity() {
+               return Taxon.NewInstance(NonViralName.NewInstance(null), null);
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       protected void saveEntity() {
+           CdmStore.getService(ITaxonService.class).save(getEntity());
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       public void setEntity(Taxon entity) {
+               super.setEntity(entity);
+       }
+
+       @Override
+       protected String getEntityName() {
+               return "Taxon";
+       }
+}
index 050b5984334b77d838c98d2b54b95715fcd87b6c..74c82db1a9064ed36573da6b2efda2e088190184 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -29,7 +29,7 @@ public class NewTeamWizard extends AbstractNewEntityWizard<Team> {
        public void addPages() {
                addPage(new TeamWizardPage(formFactory, getConversationHolder(), getEntity()));
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#createNewEntity()
         */
@@ -42,7 +42,11 @@ public class NewTeamWizard extends AbstractNewEntityWizard<Team> {
        /** {@inheritDoc} */
        @Override
        protected void saveEntity() {
-               CdmStore.getService(IAgentService.class).saveOrUpdate(getEntity());
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               CdmStore.getService(IAgentService.class).merge(getEntity(), true);
+           } else {
+               CdmStore.getService(IAgentService.class).save(getEntity());
+           }
        }
 
        @Override
index aa3cd19dd733d2ae274bbc270091134c2b05eb6c..d14363c33c899f83f9c2fcf07c8c9faeee52b8cc 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.newWizard;
 
@@ -15,16 +15,20 @@ import eu.etaxonomy.taxeditor.ui.section.user.UserDetailWizardPage;
 public class NewUserWizard extends AbstractNewEntityWizard<User> {
 
        private UserDetailWizardPage userPage;
-       
+
        @Override
        public void addPages() {
                userPage = new UserDetailWizardPage(formFactory, getConversationHolder(), getEntity());
                addPage(userPage);
        }
-       
+
        @Override
        protected void saveEntity() {
-               CdmStore.getService(IUserService.class).saveOrUpdate(getEntity());
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               CdmStore.getService(IUserService.class).merge(getEntity(), true);
+           } else {
+               CdmStore.getService(IUserService.class).save(getEntity());
+           }
        }
 
        @Override
index e42030d986305da803da9b07c1ffa30f1af89181..66e29b8a985164f989e30cc513a17d96ed8c7d00 100644 (file)
@@ -18,6 +18,7 @@ import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 
 /**
  * Superclass for all operation that have to be committed imediately after execution.
@@ -31,10 +32,24 @@ import eu.etaxonomy.cdm.model.taxon.TaxonNode;
  * @version 1.0
  */
 public abstract class AbstractPersistentPostOperation extends AbstractPostTaxonOperation {
-       private IConversationEnabled conversationEnabled;
+       private final IConversationEnabled conversationEnabled;
 
        protected ITaxonTreeNode parentNode;
 
+          /**
+     * <p>Constructor for AbstractPersistentPostOperation.</p>
+     *
+     * @param label a {@link java.lang.String} object.
+     * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
+     * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
+     * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
+     */
+    protected AbstractPersistentPostOperation(String label, IUndoContext undoContext,
+            IPostOperationEnabled postOperationEnabled,
+            IConversationEnabled conversationEnabled) {
+        this(label, undoContext, postOperationEnabled, conversationEnabled, null);
+    }
+
        /**
         * <p>Constructor for AbstractPersistentPostOperation.</p>
         *
@@ -45,8 +60,9 @@ public abstract class AbstractPersistentPostOperation extends AbstractPostTaxonO
         */
        protected AbstractPersistentPostOperation(String label, IUndoContext undoContext,
                        IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled) {
-               super(label, undoContext, postOperationEnabled);
+                       IConversationEnabled conversationEnabled,
+                       ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, postOperationEnabled, cdmEntitySessionEnabled);
                this.conversationEnabled = conversationEnabled;
        }
 
@@ -62,9 +78,11 @@ public abstract class AbstractPersistentPostOperation extends AbstractPostTaxonO
        public AbstractPersistentPostOperation(String label,
                        IUndoContext undoContext, TaxonNode taxonNode,
                        IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled) {
-               super(label, undoContext, taxonNode, postOperationEnabled);
+                       IConversationEnabled conversationEnabled,
+                       ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, taxonNode, postOperationEnabled, cdmEntitySessionEnabled);
                this.conversationEnabled = conversationEnabled;
+
        }
 
        /**
@@ -79,10 +97,12 @@ public abstract class AbstractPersistentPostOperation extends AbstractPostTaxonO
        public AbstractPersistentPostOperation(String label,
                        IUndoContext undoContext, ITaxonTreeNode parentNode,
                        IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled) {
-               super(label, undoContext, postOperationEnabled);
+                       IConversationEnabled conversationEnabled,
+            ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, postOperationEnabled, cdmEntitySessionEnabled);
                this.parentNode = parentNode;
                this.conversationEnabled = conversationEnabled;
+
        }
 
        /* (non-Javadoc)
@@ -93,7 +113,7 @@ public abstract class AbstractPersistentPostOperation extends AbstractPostTaxonO
     protected IStatus postExecute(CdmBase objectAffectedByOperation) {
                Assert.isNotNull(conversationEnabled, "Operation has to have a valid conversation attached.");
 
-               
+
                if (!conversationEnabled.getConversationHolder().isClosed()){
                        conversationEnabled.getConversationHolder().bind();
                        conversationEnabled.getConversationHolder().commit(true);
@@ -108,6 +128,9 @@ public abstract class AbstractPersistentPostOperation extends AbstractPostTaxonO
         */
        public void bind(){
                conversationEnabled.getConversationHolder().bind();
+               if(getCdmEntitySessionEnabled() != null) {
+                   getCdmEntitySessionEnabled().getCdmEntitySession().bind();
+        }
        }
 
 }
index 5b7c68ec8230074a7de6ef72c0fd5ae812bb3636..c313d1f0f9f236ea48bcc8c0e558ad82a5e8a84a 100644 (file)
@@ -16,6 +16,7 @@ import org.eclipse.core.runtime.Status;
 
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.ICdmBase;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 
 /**
  * @author pplitzner
@@ -35,6 +36,8 @@ public abstract class AbstractPostOperation<T extends ICdmBase> extends Abstract
      */
     protected IPostOperationEnabled postOperationEnabled;
 
+    private ICdmEntitySessionEnabled cdmEntitySessionEnabled;
+
 
     /**
      * <p>Constructor for AbstractPostOperation.</p>
@@ -71,6 +74,15 @@ public abstract class AbstractPostOperation<T extends ICdmBase> extends Abstract
         this.postOperationEnabled = postOperationEnabled;
     }
 
+    public AbstractPostOperation(String label, IUndoContext undoContext,
+            T element, IPostOperationEnabled postOperationEnabled,
+            ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+        this(label, undoContext);
+        this.element = element;
+        this.postOperationEnabled = postOperationEnabled;
+        this.cdmEntitySessionEnabled = cdmEntitySessionEnabled;
+    }
+
     /**
      * This method will try to call the post operation on a possibly registered
      * IPostOperationEnabled implementor. Objects that were affected by the operation
@@ -80,10 +92,11 @@ public abstract class AbstractPostOperation<T extends ICdmBase> extends Abstract
      * @return a {@link org.eclipse.core.runtime.IStatus} object.
      */
     protected IStatus postExecute(CdmBase objectAffectedByOperation) {
-       if(postOperationEnabled != null){
-               return postOperationEnabled.postOperation(objectAffectedByOperation) ? Status.OK_STATUS : Status.CANCEL_STATUS;
-       }
-       return Status.OK_STATUS;
+
+        if(postOperationEnabled != null){
+            return postOperationEnabled.postOperation(objectAffectedByOperation) ? Status.OK_STATUS : Status.CANCEL_STATUS;
+        }
+        return Status.OK_STATUS;
     }
 
     /**
@@ -92,7 +105,34 @@ public abstract class AbstractPostOperation<T extends ICdmBase> extends Abstract
      * @return a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
      */
     public IPostOperationEnabled getPostOperationEnabled() {
-       return postOperationEnabled;
+        return postOperationEnabled;
+    }
+
+//    protected IStatus updateSession(CdmBase clientObjectAffectedByOperation, UpdateResult updateResult) {
+//        Set<CdmBase> affectedObjects;
+//        if(updateResult == null) {
+//            affectedObjects = new HashSet<CdmBase>();
+//        } else {
+//            affectedObjects = updateResult.getUpdatedObjects();
+//        }
+//
+//        if(cdmEntitySessionEnabled != null) {
+//            cdmEntitySessionEnabled.getCdmEntitySession().update(clientObjectAffectedByOperation, affectedObjects);
+//        }
+//        return Status.OK_STATUS;
+//    }
+//
+//    protected IStatus updateSession(UUID uuid) {
+//
+//        if(cdmEntitySessionEnabled != null) {
+//            CdmBase cdmBase = cdmEntitySessionEnabled.getCdmEntitySession().remoteLoad(CdmStore.getService(IService.class),uuid);
+//            cdmEntitySessionEnabled.getCdmEntitySession().update(null, cdmBase);
+//        }
+//        return Status.OK_STATUS;
+//    }
+
+    public ICdmEntitySessionEnabled getCdmEntitySessionEnabled() {
+        return cdmEntitySessionEnabled;
     }
 
 }
\ No newline at end of file
index b37c5401060a7b0dc3825b3e1210422ba01ac992..6604f27bb22cd09fda681b1fd62231c5182e681d 100644 (file)
@@ -1,11 +1,11 @@
 /**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
 
 package eu.etaxonomy.taxeditor.operation;
 
@@ -16,6 +16,7 @@ import org.eclipse.core.commands.operations.IUndoContext;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 
 /**
  * <p>Abstract AbstractPostOperation class.</p>
@@ -27,64 +28,78 @@ import eu.etaxonomy.cdm.model.taxon.TaxonNode;
  */
 public abstract class AbstractPostTaxonOperation extends AbstractPostOperation<Taxon> {
 
-       /**
-        * A reference to the taxons TaxonNode
-        */
-       protected ITaxonTreeNode taxonNode;
-
-       protected UUID parentNodeUuid;
-
-
-       /**
-        * <p>Constructor for AbstractPostOperation.</p>
-        *
-        * @param label a {@link java.lang.String} object.
-        * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
-        * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
-        * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
-        */
-       public AbstractPostTaxonOperation(String label, IUndoContext undoContext,
-                       Taxon taxon, IPostOperationEnabled postOperationEnabled) {
-               super(label, undoContext, taxon, postOperationEnabled);
-       }
-
-       /**
-        * <p>Constructor for AbstractPostOperation.</p>
-        *
-        * @param label a {@link java.lang.String} object.
-        * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
-        * @param taxonNode a {@link eu.etaxonomy.cdm.model.taxon.TaxonNode} object.
-        * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
-        */
-       public AbstractPostTaxonOperation(String label, IUndoContext undoContext, TaxonNode taxonNode, IPostOperationEnabled postOperationEnabled){
-               this(label, undoContext, taxonNode.getTaxon(), postOperationEnabled);
-               this.taxonNode = taxonNode;
-       }
-
-       /**
-        * <p>Constructor for AbstractPostOperation.</p>
-        *
-        * @param label a {@link java.lang.String} object.
-        * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
-        * @param parentNodeUuid a {@link java.util.UUID} object.
-        * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
-        */
-       public AbstractPostTaxonOperation(String label, IUndoContext undoContext, UUID parentNodeUuid, IPostOperationEnabled postOperationEnabled){
-               super(label, undoContext, null, postOperationEnabled);
-               this.parentNodeUuid = parentNodeUuid;
-       }
-
-       /**
-        * <p>Constructor for AbstractPostOperation.</p>
-        *
-        * @param label a {@link java.lang.String} object.
-        * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
-        * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
-        */
-       public AbstractPostTaxonOperation(String label, IUndoContext undoContext,
-                       IPostOperationEnabled postOperationEnabled) {
-               super(label, undoContext, null, postOperationEnabled);
-       }
+    /**
+     * A reference to the taxons TaxonNode
+     */
+    protected ITaxonTreeNode taxonNode;
+
+    protected UUID parentNodeUuid;
+
+
+    /**
+     * <p>Constructor for AbstractPostOperation.</p>
+     *
+     * @param label a {@link java.lang.String} object.
+     * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
+     * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
+     * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
+     */
+    public AbstractPostTaxonOperation(String label, IUndoContext undoContext,
+            Taxon taxon, IPostOperationEnabled postOperationEnabled) {
+        super(label, undoContext, taxon, postOperationEnabled, null);
+    }
+
+    public AbstractPostTaxonOperation(String label, IUndoContext undoContext,
+            Taxon taxon, IPostOperationEnabled postOperationEnabled, ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+        super(label, undoContext, taxon, postOperationEnabled, cdmEntitySessionEnabled);
+    }
+
+    /**
+     * <p>Constructor for AbstractPostOperation.</p>
+     *
+     * @param label a {@link java.lang.String} object.
+     * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
+     * @param taxonNode a {@link eu.etaxonomy.cdm.model.taxon.TaxonNode} object.
+     * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
+     */
+    public AbstractPostTaxonOperation(String label, IUndoContext undoContext, TaxonNode taxonNode, IPostOperationEnabled postOperationEnabled){
+        this(label, undoContext, taxonNode, postOperationEnabled, null);
+    }
+
+    public AbstractPostTaxonOperation(String label, IUndoContext undoContext, TaxonNode taxonNode, IPostOperationEnabled postOperationEnabled, ICdmEntitySessionEnabled cdmEntitySessionEnabled){
+        this(label, undoContext, taxonNode.getTaxon(), postOperationEnabled, cdmEntitySessionEnabled);
+        this.taxonNode = taxonNode;
+    }
+
+    /**
+     * <p>Constructor for AbstractPostOperation.</p>
+     *
+     * @param label a {@link java.lang.String} object.
+     * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
+     * @param parentNodeUuid a {@link java.util.UUID} object.
+     * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
+     */
+    public AbstractPostTaxonOperation(String label, IUndoContext undoContext, UUID parentNodeUuid, IPostOperationEnabled postOperationEnabled){
+        super(label, undoContext, null, postOperationEnabled, null);
+        this.parentNodeUuid = parentNodeUuid;
+    }
+
+    /**
+     * <p>Constructor for AbstractPostOperation.</p>
+     *
+     * @param label a {@link java.lang.String} object.
+     * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
+     * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
+     */
+    public AbstractPostTaxonOperation(String label, IUndoContext undoContext,
+            IPostOperationEnabled postOperationEnabled) {
+        super(label, undoContext, null, postOperationEnabled, null);
+    }
+
+    public AbstractPostTaxonOperation(String label, IUndoContext undoContext,
+            IPostOperationEnabled postOperationEnabled, ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+        super(label, undoContext, null, postOperationEnabled, cdmEntitySessionEnabled);
+    }
 
     /**
      * @param text
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/FeedbackGenerator.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/FeedbackGenerator.java
new file mode 100644 (file)
index 0000000..5b084f5
--- /dev/null
@@ -0,0 +1,49 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.operation;
+
+import java.io.Serializable;
+import java.util.UUID;
+
+import org.eclipse.swt.widgets.Display;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+
+/**
+ * Default implementation of the {@link IFeedbackGenerator} interface.
+ *
+ * @author cmathew
+ * @date 29 Oct 2015
+ *
+ */
+public abstract class FeedbackGenerator implements IFeedbackGenerator {
+
+
+    /**
+     * Generates feedback for a waiting remoting progress monitor
+     *
+     * @return feedback object
+     */
+    public abstract Serializable generateFeedback();
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void setFeedbackForMonitor(final UUID uuid) {
+        Display.getDefault().syncExec(new Runnable() {
+            @Override
+            public void run() {
+                CdmApplicationState.getCurrentAppConfig().getProgressMonitorService().setFeedback(uuid, generateFeedback());
+            }
+        });
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/IFeedbackGenerator.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/IFeedbackGenerator.java
new file mode 100644 (file)
index 0000000..36a6af1
--- /dev/null
@@ -0,0 +1,32 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.operation;
+
+import java.util.UUID;
+
+/**
+ * Generates feeback for waiting remoting progress monitors.
+ * The default implementation of this interface is {@link FeedbackGenerator}
+ *
+ * @author cmathew
+ * @date 28 Oct 2015
+ *
+ */
+public interface IFeedbackGenerator {
+
+    /**
+     * Generates and sets feedback for a waiting remoting progress
+     * monitor corresponding to the given uuid.
+     *
+     * @param uuid of target waiting remoting progress monitor
+     */
+    public void setFeedbackForMonitor(UUID uuid);
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/IPostMoniteredOperationEnabled.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/IPostMoniteredOperationEnabled.java
new file mode 100644 (file)
index 0000000..1c15d42
--- /dev/null
@@ -0,0 +1,24 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.operation;
+
+import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
+
+/**
+ * @author cmathew
+ * @date 22 Oct 2015
+ *
+ */
+public interface IPostMoniteredOperationEnabled {
+
+
+    public void postOperation(IRemotingProgressMonitor monitor);
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/RemotingCdmDefaultOperation.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/RemotingCdmDefaultOperation.java
new file mode 100644 (file)
index 0000000..4ac9dc3
--- /dev/null
@@ -0,0 +1,62 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.operation;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+
+/**
+ * @author cmathew
+ * @date 21 Jul 2015
+ *
+ */
+public abstract class RemotingCdmDefaultOperation extends RemotingCdmOperation {
+
+    private CdmBase cdmEntity;
+
+    public RemotingCdmDefaultOperation(String label, Action action, Object source, boolean async) {
+        super(label, action, source, async);
+    }
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmOperation#doExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+     */
+    @Override
+    protected boolean doExecute(IProgressMonitor monitor, IAdaptable info) {
+        try {
+            cdmEntity = doSimpleExecute(monitor, info);
+        } catch (Exception e) {
+             throw new RuntimeException(e);
+        }
+        return true;
+    }
+
+    protected abstract CdmBase doSimpleExecute(IProgressMonitor monitor, IAdaptable info) throws Exception;
+
+    @Override
+    protected void postExecute(boolean success) {
+        if(success && cdmEntity != null) {
+            fireDataChangeEvent(cdmEntity);
+        }
+
+    }
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmOperation#onComplete(boolean)
+     */
+    @Override
+    protected IStatus onComplete(boolean success) {
+        return Status.OK_STATUS;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/RemotingCdmHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/RemotingCdmHandler.java
new file mode 100644 (file)
index 0000000..1ce4165
--- /dev/null
@@ -0,0 +1,75 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.operation;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.operations.AbstractOperation;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.dialogs.ErrorDialog;
+
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+
+/**
+ * @author cmathew
+ * @date 16 Jun 2015
+ *
+ */
+public abstract class RemotingCdmHandler extends AbstractHandler {
+
+    private final String label;
+
+    public RemotingCdmHandler(String label) {
+        this.label = label;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        IStatus allowStatus = allowOperations(event);
+        if(allowStatus.isOK()) {
+            AbstractOperation op = prepareOperation(event);
+            if(op != null) {
+                AbstractUtility.executeOperation(op, this);
+            }
+        } else if(allowStatus.getSeverity() == IStatus.ERROR ||
+                allowStatus.getSeverity() == IStatus.WARNING ||
+                allowStatus.getSeverity() == IStatus.INFO) {
+            MessagingUtils.warningDialog("Can not perform " + label, event.getTrigger(), allowStatus);
+        }
+        return null;
+    }
+
+    public void postOperation(IStatus status) {
+
+        switch(status.getSeverity()) {
+        case IStatus.WARNING:
+            ErrorDialog.openError(null, "Operation successful but with warnings", null, status);
+            break;
+        case IStatus.ERROR:
+            ErrorDialog.openError(null, "Error executing operation", null, status);
+            break;
+        default:
+        }
+
+        onComplete();
+    }
+
+    public abstract IStatus allowOperations(ExecutionEvent event);
+
+    public abstract AbstractOperation prepareOperation(ExecutionEvent event);
+
+    public abstract void onComplete();
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/RemotingCdmOperation.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/RemotingCdmOperation.java
new file mode 100644 (file)
index 0000000..129b96c
--- /dev/null
@@ -0,0 +1,98 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.operation;
+
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.operations.AbstractOperation;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+
+/**
+ * @author cmathew
+ * @date 16 Jun 2015
+ *
+ */
+public abstract class RemotingCdmOperation extends AbstractOperation {
+
+    private final Object source;
+    private final Action action;
+    private final boolean async;
+    protected Class entityType;
+
+    public RemotingCdmOperation(String label, Action action, Object source, boolean async) {
+        super(label);
+        this.source = source;
+        this.action = action;
+        this.async = async;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+     */
+    @Override
+    public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+       boolean success = doExecute(monitor, info);
+       postExecute(success);
+       return onComplete(success);
+    }
+
+    protected abstract boolean doExecute(IProgressMonitor monitor, IAdaptable info);
+
+    protected void postExecute(boolean success) {}
+
+    protected abstract IStatus onComplete(boolean success);
+
+    protected void fireDataChangeEvent(Set<CdmBase> changedObjects) {
+        if(changedObjects != null && !changedObjects.isEmpty()) {
+            CdmApplicationState.getCurrentDataChangeService().fireChangeEvent(new CdmChangeEvent(action, changedObjects, source.getClass()), async);
+        }
+    }
+
+    protected void fireDataChangeEvent(UpdateResult updateResult) {
+        Set<CdmBase> updatedObjects = updateResult.getUpdatedObjects();
+        CdmApplicationState.getCurrentDataChangeService()
+            .fireChangeEvent(new CdmChangeEvent(action, updatedObjects, source.getClass(), entityType), async);
+    }
+
+    protected void fireDataChangeEvent(CdmBase cdmBase) {
+        if(cdmBase != null) {
+            CdmApplicationState.getCurrentDataChangeService().fireChangeEvent(new CdmChangeEvent(action, cdmBase, source.getClass()), async);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+     */
+    @Override
+    public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+     */
+    @Override
+    public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/RemotingCdmUpdateOperation.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/RemotingCdmUpdateOperation.java
new file mode 100644 (file)
index 0000000..f06fb2e
--- /dev/null
@@ -0,0 +1,123 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.operation;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
+
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+
+/**
+ * @author cmathew
+ * @date 16 Jun 2015
+ *
+ */
+public abstract class RemotingCdmUpdateOperation extends RemotingCdmOperation {
+
+    private UpdateResult updateResult;
+    public static boolean throwExceptions = false;
+
+    /**
+     * @param label
+     */
+    public RemotingCdmUpdateOperation(String label, Action action, Object source, boolean async) {
+        super(label, action, source, async);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmOperation#doExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+     */
+    @Override
+    protected boolean doExecute(IProgressMonitor monitor, IAdaptable info) {
+        try {
+            updateResult = doUpdateExecute(monitor, info);
+        } catch (Exception e) {
+            if(throwExceptions) {
+                throw new RuntimeException(e);
+            } else {
+                UpdateResult exceptionResult = new UpdateResult();
+                exceptionResult.addException(e);
+                exceptionResult.setAbort();
+                updateResult = exceptionResult;
+            }
+        }
+        return updateResult.isOk();
+    }
+
+    protected abstract UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception;
+
+    @Override
+    protected void postExecute(boolean success) {
+        if(success && updateResult != null) {
+            fireDataChangeEvent(updateResult);
+        }
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmOperation#onComplete(boolean)
+     */
+    @Override
+    protected IStatus onComplete(boolean success) {
+
+        if(updateResult != null) {
+            int statusFlag = IStatus.OK;
+
+            Collection<Exception> exceptions = updateResult.getExceptions();
+            StringBuffer statusMsg = new StringBuffer();
+            if(success && updateResult.isOk()) {
+                if(exceptions.isEmpty()) {
+                    return Status.OK_STATUS;
+                } else {
+                    statusFlag = IStatus.WARNING;
+                    statusMsg.append(getLabel() + " executed sucessfully but with warnings." + System.lineSeparator());
+                }
+            } else if (updateResult.isError()) {
+                statusFlag = IStatus.ERROR;
+                statusMsg.append(getLabel() + " failed." + System.lineSeparator());
+            } else if (updateResult.isAbort()) {
+                statusFlag = IStatus.ERROR;
+                statusMsg.append(getLabel() + " aborted." + System.lineSeparator());
+            }
+
+            Status[] childStatus = new Status[exceptions.size()];
+            int count = 0;
+            Set<String> messages = new HashSet<String>();
+            for(Exception ex : exceptions) {
+                Status status = new Status(statusFlag,
+                        "unknown",
+                        statusFlag,
+                        ex.getLocalizedMessage(),
+                        ex);
+                messages.add(ex.getLocalizedMessage());
+                childStatus[count] = status;
+                count++;
+            }
+
+            statusMsg.append("Please click on the 'Details' button to see all the errors / warnings");
+
+            MultiStatus multiStatus = new MultiStatus("unknown",
+                    statusFlag,
+                    childStatus,
+                    statusMsg.toString(),
+                    null);
+            return multiStatus;
+        }
+        return null;
+    }
+}
index 48a56f518ae00f2d6e96d95e8d6cbaba7fd8a303..31eda3f375d09ec1285c94ec48fab148e1bcc516 100644 (file)
@@ -14,6 +14,7 @@ import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.strategy.match.MatchException;
+import eu.etaxonomy.cdm.strategy.match.MatchStrategyConfigurator.MatchStrategy;
 import eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
@@ -87,8 +88,8 @@ public class ParseHandler{
         * @param unparsedNameString a {@link java.lang.String} object.
         * @return a {@link eu.etaxonomy.cdm.model.name.TaxonNameBase} object.
         */
-       public static TaxonNameBase parseReferencedName(String unparsedNameString, Rank rank){
-               TaxonNameBase name = nonViralNameParser.parseReferencedName(unparsedNameString,
+       public static NonViralName parseReferencedName(String unparsedNameString, Rank rank){
+           NonViralName name = nonViralNameParser.parseReferencedName(unparsedNameString,
                                PreferencesUtil.getPreferredNomenclaturalCode(), rank);
 
 //             if (name.hasProblem()) {
@@ -98,8 +99,8 @@ public class ParseHandler{
                return name;
        }
 
-       public static TaxonNameBase parseName(String unparsedNameString, Rank rank){
-               TaxonNameBase name = nonViralNameParser.parseFullName(unparsedNameString,
+       public static NonViralName parseName(String unparsedNameString, Rank rank){
+               NonViralName name = nonViralNameParser.parseFullName(unparsedNameString,
                                PreferencesUtil.getPreferredNomenclaturalCode(), rank);
 
                return name;
@@ -111,7 +112,7 @@ public class ParseHandler{
         *
         * @return a {@link eu.etaxonomy.cdm.model.name.TaxonNameBase} object.
         */
-       public static TaxonNameBase createEmptyName(){
+       public static NonViralName createEmptyName(){
                return nonViralNameParser.getNonViralNameInstance("", PreferencesUtil.getPreferredNomenclaturalCode());
        }
 
@@ -301,7 +302,9 @@ public class ParseHandler{
             return new ArrayList<INomenclaturalReference>();
         }
                try{
-                       return CdmStore.getCommonService().findMatching(nomenclaturalReference, MatchStrategyConfigurator.ReferenceMatchStrategy());
+
+                       return CdmStore.getCommonService().findMatching(nomenclaturalReference, MatchStrategy.Reference);
+
                }catch (MatchException e) {
                        MessagingUtils.error(this.getClass(), "Error finding matching references", e);
                }
@@ -319,7 +322,9 @@ public class ParseHandler{
                }
 
                try{
-                       return CdmStore.getCommonService().findMatching(authorTeam, MatchStrategyConfigurator.TeamOrPersonMatchStrategy());
+
+                       return CdmStore.getCommonService().findMatching(authorTeam, MatchStrategy.TeamOrPerson);
+
                }catch (MatchException e) {
                        MessagingUtils.error(this.getClass(), "Error finding matching authors", e);
                }
@@ -333,7 +338,9 @@ public class ParseHandler{
        private List<TaxonNameBase> findMatchingLatinNames(TaxonNameBase taxonNameBase) {
 
                try {
-                       return CdmStore.getCommonService().findMatching(taxonNameBase, MatchStrategyConfigurator.NonViralNameMatchStrategy());
+
+                       return CdmStore.getCommonService().findMatching(taxonNameBase, MatchStrategy.NonViralName);
+
 
                } catch (MatchException e) {
                        MessagingUtils.error(this.getClass(), "Error finding matching names", e);
index b28e46d6117141fb66e3c2da57b476b5cdf031d8..26877a9e3d6638a75959b0378fdd8dc2d8f5ba01 100644 (file)
@@ -1,12 +1,12 @@
 // $Id$
 /**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
 
 package eu.etaxonomy.taxeditor.preference;
 
@@ -21,20 +21,45 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class CdmStorePropertyTester extends PropertyTester {
 
-       private static final String EDITOR_IS_CONNECTED_TO_DB = "isCdmStoreConnected";
+    private static final String EDITOR_IS_CONNECTED_TO_DB = "isCdmStoreConnected";
+    private static final String IS_REMOTING = "isRemoting";
+    private static final String IS_STANDALONE = "isStandAlone";
+
+    @Override
+    public boolean test(Object receiver, String property, Object[] args,
+            Object expectedValue) {
+
+        if(EDITOR_IS_CONNECTED_TO_DB.equals(property)){
+            return isCdmStoreConnected();
+        }
+
+        if(IS_REMOTING.equals(property)){
+            if(!isCdmStoreConnected()) {
+                return false;
+            } else {
+                return isRemoting();
+            }
+        }
+
+        if(IS_STANDALONE.equals(property)){
+            if(!isCdmStoreConnected()) {
+                return false;
+            } else {
+                return !isRemoting();
+            }
+        }
+        return false;
+    }
+
+    private boolean isCdmStoreConnected(){
+        boolean active = CdmStore.isActive();
+        return active;
+    }
+
+    private boolean isRemoting() {
+        return CdmStore.getCurrentSessionManager().isRemoting();
 
-       @Override
-       public boolean test(Object receiver, String property, Object[] args,
-                       Object expectedValue) {
+    }
 
-           if(EDITOR_IS_CONNECTED_TO_DB.equals(property)){
-               return isCdmStoreConnected();
-           }
-               return false;
-       }
 
-       private boolean isCdmStoreConnected(){
-           boolean active = CdmStore.isActive();
-           return active;
-       }
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/DebugPreferences.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/DebugPreferences.java
new file mode 100644 (file)
index 0000000..f1fee19
--- /dev/null
@@ -0,0 +1,47 @@
+// $Id$
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.preference;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * @author k.luther
+ * @date 01.04.2016
+ *
+ */
+public class DebugPreferences extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+     */
+    @Override
+    public void init(IWorkbench workbench) {
+        setPreferenceStore(PreferencesUtil.getPreferenceStore());
+
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+     */
+    @Override
+    protected void createFieldEditors() {
+        addField(new BooleanFieldEditor(IPreferenceKeys.IS_SHOW_UP_WIDGET_IS_DISPOSED,
+                "Show up widget is disposed error messages.",
+                getFieldEditorParent()));
+        addField(new BooleanFieldEditor(IPreferenceKeys.DISABLE_SERVICES_API_TIMESTAMP_CHECK,
+                "Disable services api timestamp check",
+                getFieldEditorParent()));
+
+    }
+
+}
index c5363d6e3212107a389f16d9dea51a08a1b5ca60..c957ef1d370adc2cee5237f25eca5b92c1237cec 100644 (file)
@@ -12,7 +12,6 @@ package eu.etaxonomy.taxeditor.preference;
 
 import java.util.List;
 
-import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.ListViewer;
@@ -32,6 +31,7 @@ import eu.etaxonomy.cdm.model.description.FeatureTree;
 import eu.etaxonomy.taxeditor.featuretree.FeatureTreeContentProvider;
 import eu.etaxonomy.taxeditor.featuretree.FeatureTreeLabelProvider;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -41,7 +41,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @created Sep 16, 2010
  * @version 1.0
  */
-public class DefaultFeatureTreePreferenecs extends PreferencePage implements IWorkbenchPreferencePage {
+public class DefaultFeatureTreePreferenecs extends CdmPreferencePage implements IWorkbenchPreferencePage {
 
        private FeatureTree defaultFeatureTreeForTextualDescription;
        private FeatureTree defaultFeatureTreeForStructuredDescription;
index 769e24a1368e322063fee17e45c0a196541291c2..88d5d3a34073027c168b4735fd51e25c22fff060 100644 (file)
@@ -10,7 +10,6 @@
 
 package eu.etaxonomy.taxeditor.preference;
 
-import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridLayout;
@@ -19,6 +18,7 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 
+import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.CommandHandlerButton;
 
@@ -31,7 +31,7 @@ import eu.etaxonomy.taxeditor.ui.element.CommandHandlerButton;
  * @created Aug 5, 2010
  * @version 1.0
  */
-public class FeatureTreePreferences extends PreferencePage implements
+public class FeatureTreePreferences extends CdmPreferencePage implements
                IWorkbenchPreferencePage {
 
        /**
index fc2422da97852185043d89dd3254ebce88d9377f..884cb678f6eabfd993999ac8e6a22b8af63008f4 100644 (file)
@@ -101,7 +101,10 @@ public interface IPreferenceKeys {
        public static final String SORT_RANKS_HIERARCHICHALLY = "eu.etaxonomy.taxeditor.menus.sortRanksHierarchichally";
        /** Constant <code>SORT_NODES_NATURALL="eu.etaxonomy.taxeditor.menus.sortNodesN"{trunked}</code> */
        public static final String SORT_NODES_NATURALLY = "eu.etaxonomy.taxeditor.menus.sortNodesNaturally";
-
+       /** Constant <code>SORT_NODES_NATURALL="eu.etaxonomy.taxeditor.menus.sortNodesN"{trunked}</code> */
+       public static final String SORT_NODES_ALPHABETICALLY = "eu.etaxonomy.taxeditor.menus.sortNodesAlphabetically";
+       /** Constant <code>RESTORE_NAVIGATOR_STATE="eu.etaxonomy.taxeditor.taxonnavigator.restoreState"{trunked}</code> */
+       public static final String RESTORE_NAVIGATOR_STATE = "eu.etaxonomy.taxeditor.taxonnavigator.restoreState";
        /**
         * Whether multilanguage text fields should be editable in multiple languages.
         */
@@ -127,6 +130,8 @@ public interface IPreferenceKeys {
 
        public static final String SEARCH_OPEN_RESULTS_IN_SEPARATE_WINDOWS = "eu.etaxonomy.taxeditor.navigation.search.openResultInSeparateWindows";
 
+       public static final String DISABLE_SERVICES_API_TIMESTAMP_CHECK = "eu.etaxonomy.taxeditor.cdmlib.remoting.disableServicesApiTimestampCheck";
+
        public static final String ADD_TYPES_TO_ALL_NAMES = "eu.etaxonomy.taxeditor.store.addTypeToAllNames";
 
     public static final String DETERMINATION_ONLY_FOR_FIELD_UNITS = "eu.etaxonomy.taxeditor.specimen.determinationOnlyOnFieldUnitLevel";
@@ -143,11 +148,15 @@ public interface IPreferenceKeys {
 
     public static final String SHOW_ADVANCED_MEDIA_SECTION = "eu.etaxonomy.taxeditor.media.showAdvancedMedia";
 
+    public static final String PROMPT_FOR_OPEN_SPECIMEN_IN_EDITOR = "eu.etaxonomy.taxeditor.specimen.promptForOpenSpecimenInEditor";
+
     // TODO RL
     public static final String IS_RL = "eu.etaxonomy.taxeditor.isRL";
 
     public static final String DEFAULT_LANGUAGE_EDITOR = "eu.etaxonomy.taxeditor.default.language";
 
+    public static final String IS_SHOW_UP_WIDGET_IS_DISPOSED = "eu.etaxonomy.taxeditor.isShowUpWidgetIsDisposed";
+
     /**
      * Key for the saved P2 repositories
      */
index 901a5b91f01cc02d650e8755f00086126abc6102..d15037da2018708b498b91c25109a4e8d8ded848 100644 (file)
@@ -104,7 +104,7 @@ public class LanguageRepresentationPreferencePage extends PreferencePage impleme
                        @Override
                        public void widgetSelected(SelectionEvent e) {
                                int selectionIndex = combo_globalLanguage.getSelectionIndex();
-                               globalLanguage = Language.getLanguageByLabel(combo_globalLanguage.getItem(selectionIndex));
+                               globalLanguage = CdmStore.getCurrentApplicationConfiguration().getTermService().getLanguageByLabel(combo_globalLanguage.getItem(selectionIndex));
                        }
                });
        }
index 8679d677e2085a5b284a3badd90519dfa28ab269..0e953be686a7ec469e07958c8b830186ec5c8ea6 100644 (file)
@@ -1,25 +1,18 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
 
 package eu.etaxonomy.taxeditor.preference;
 
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.jface.preference.StringFieldEditor;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 
@@ -28,120 +21,28 @@ import org.eclipse.ui.IWorkbenchPreferencePage;
  * @created Feb 4, 2011
  * @version 1.0
  */
-public class MobotOpenUrlPreferences extends PreferencePage implements
+public class MobotOpenUrlPreferences extends FieldEditorPreferencePage implements
                IWorkbenchPreferencePage {
 
-       private String openUrlServiceAccessPoint;
-       private String openUrlImageMaxWidth;
-       private String openUrlImageMaxHeight;
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
-        */
-       @Override
-       public void init(IWorkbench workbench) {
-               setPreferenceStore(PreferencesUtil.getPreferenceStore());
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse
-        * .swt.widgets.Composite)
-        */
-       @Override
-       protected Control createContents(Composite parent) {
-               Composite container = new Composite(parent, SWT.NULL);
-               final GridLayout gridLayout = new GridLayout();
-               container.setLayout(gridLayout);
-
-               creatOpenUrlServiceAccessPoint(container);
-
-               createOpenUrlImageSize(container);
-
-               return container;
-       }
-
-       /**
-        * @param container
-        */
-       private void createOpenUrlImageSize(Composite container) {
-               openUrlImageMaxWidth = getPreferenceStore().getString(
-                               IPreferenceKeys.OPENURL_IMAGE_MAX_WIDTH);
-               openUrlImageMaxHeight = getPreferenceStore().getString(
-                               IPreferenceKeys.OPENURL_IMAGE_MAX_HEIGHT);
-
-               Composite composite = new Composite(container, SWT.NULL);
-               final GridLayout gridLayout = new GridLayout(2, false);
-               composite.setLayout(gridLayout);
-
-               final CLabel labelWidth = new CLabel(composite, SWT.NULL);
-               labelWidth.setText("Image Maximum Width: ");
-
-               final Text textWidth = new Text(composite, SWT.BORDER);
-               textWidth.setText(openUrlImageMaxWidth);
-               textWidth.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-
-               textWidth.addModifyListener(new ModifyListener() {
-
-                       public void modifyText(ModifyEvent e) {
-                               openUrlImageMaxWidth = textWidth.getText();
-                       }
-               });
-
-               final CLabel labelHeight = new CLabel(composite, SWT.NULL);
-               labelHeight.setText("Image Maximum Height: ");
-
-               final Text textHeight = new Text(composite, SWT.BORDER);
-               textHeight.setText(openUrlImageMaxHeight);
-               textHeight.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-
-               textHeight.addModifyListener(new ModifyListener() {
-
-                       public void modifyText(ModifyEvent e) {
-                               openUrlImageMaxHeight = textHeight.getText();
-                       }
-               });
-       }
-
-       private void creatOpenUrlServiceAccessPoint(Composite composite) {
-               openUrlServiceAccessPoint = getPreferenceStore().getString(
-                               IPreferenceKeys.OPENURL_ACCESS_POINT);
-
-               final CLabel label = new CLabel(composite, SWT.NULL);
-               label.setText("Mobot Open Url Service Access Point:");
-
-               final Text text = new Text(composite, SWT.BORDER);
-               text.setText(openUrlServiceAccessPoint);
-               text.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-
-               text.addModifyListener(new ModifyListener() {
-
-                       public void modifyText(ModifyEvent e) {
-                               openUrlServiceAccessPoint = text.getText();
-                       }
-               });
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.eclipse.jface.preference.PreferencePage#performOk()
-        */
-       @Override
-       public boolean performOk() {
-               getPreferenceStore().setValue(IPreferenceKeys.OPENURL_ACCESS_POINT,
-                               openUrlServiceAccessPoint);
-               getPreferenceStore().setValue(IPreferenceKeys.OPENURL_IMAGE_MAX_WIDTH,
-                               openUrlImageMaxWidth);
-               getPreferenceStore().setValue(IPreferenceKeys.OPENURL_IMAGE_MAX_HEIGHT,
-                               openUrlImageMaxHeight);
-
-               return super.performOk();
-       }
 
+    @Override
+    protected void createFieldEditors() {
+        addField(new StringFieldEditor(
+                IPreferenceKeys.OPENURL_ACCESS_POINT,
+                "Mobot Open Url Service Access Point:", getFieldEditorParent()));
+        addField(new IntegerFieldEditor(
+                IPreferenceKeys.OPENURL_IMAGE_MAX_WIDTH,
+                "Image Maximum Width:",
+                getFieldEditorParent()));
+        addField(new IntegerFieldEditor(
+                IPreferenceKeys.OPENURL_IMAGE_MAX_HEIGHT,
+                "Image Maximum Height:",
+                getFieldEditorParent()));
+
+    }
+
+    @Override
+    public void init(IWorkbench workbench) {
+        setPreferenceStore(PreferencesUtil.getPreferenceStore());
+    }
 }
index 3e434a9d56a6f1c89cd3ee3682c57aab529c6d75..756cfbc7fb774e98e8e03c07aa097cd6bd6f452a 100644 (file)
@@ -1,15 +1,10 @@
 package eu.etaxonomy.taxeditor.preference;\r
 \r
-import java.io.IOException;\r
-\r
 import org.eclipse.jface.dialogs.MessageDialog;\r
 import org.eclipse.jface.preference.PreferencePage;\r
-import org.eclipse.jface.resource.ImageDescriptor;\r
 import org.eclipse.swt.SWT;\r
 import org.eclipse.swt.events.SelectionAdapter;\r
 import org.eclipse.swt.events.SelectionEvent;\r
-import org.eclipse.swt.graphics.Image;\r
-import org.eclipse.swt.graphics.Point;\r
 import org.eclipse.swt.layout.GridLayout;\r
 import org.eclipse.swt.widgets.Button;\r
 import org.eclipse.swt.widgets.Composite;\r
@@ -17,15 +12,18 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Label;\r
 import org.eclipse.ui.IWorkbench;\r
 import org.eclipse.ui.IWorkbenchPreferencePage;\r
-import org.eclipse.ui.PlatformUI;\r
 \r
 import eu.etaxonomy.taxeditor.Messages;\r
 \r
 public class OrderPreferences extends PreferencePage implements IWorkbenchPreferencePage {\r
-       \r
+\r
 \r
            boolean isNaturalOrderActivated;\r
+           boolean isAlphabeticalOrderActivated;\r
+           boolean isRankAndNameOrderActivated;\r
+           boolean isRestoreTaxonNavigator;\r
            boolean isSelectionChanged = false;\r
+           boolean isStrictlyAlphabeticallyOrdered;\r
            /*\r
             * (non-Javadoc)\r
             *\r
@@ -36,20 +34,77 @@ public class OrderPreferences extends PreferencePage implements IWorkbenchPrefer
            @Override\r
            protected Control createContents(Composite parent) {\r
 \r
-               Composite composite = new Composite(parent, SWT.NULL);\r
+               isRestoreTaxonNavigator = PreferencesUtil.isStoreNavigatorState();\r
+\r
+            Composite secondComposite = new Composite(parent, SWT.NULL);\r
+            secondComposite.setLayout(new GridLayout());\r
+\r
+            final Button activateRestoreNavigatorButton = new Button(secondComposite, SWT.CHECK | SWT.LEFT);\r
+            activateRestoreNavigatorButton.setText("Restore the last Taxon Navigator state.");\r
+            activateRestoreNavigatorButton.setSelection(isRestoreTaxonNavigator);\r
+            activateRestoreNavigatorButton.addSelectionListener(new SelectionAdapter(){\r
+                @Override\r
+                public void widgetSelected(SelectionEvent e) {\r
+                    if(isRestoreTaxonNavigator != activateRestoreNavigatorButton.getSelection()) {\r
+                        isRestoreTaxonNavigator = activateRestoreNavigatorButton.getSelection();\r
+                        PreferencesUtil.setStoreNavigatorState(isRestoreTaxonNavigator);\r
+                    }\r
+                }\r
+\r
+            });\r
+\r
+\r
+            Composite composite = new Composite(parent, SWT.NULL);\r
                composite.setLayout(new GridLayout());\r
-               final Label description = new Label(parent, SWT.NONE);\r
-               description.setText(Messages.OrderPreferencePage_NewNavigatorWindowRequired);\r
-               isNaturalOrderActivated = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SORT_NODES_NATURALLY);\r
-               final Button activateCheckButton = new Button(composite, SWT.CHECK);\r
-               activateCheckButton.setText("Enable Natural Order");\r
-               activateCheckButton.setSelection(isNaturalOrderActivated);\r
-               activateCheckButton.addSelectionListener(new SelectionAdapter(){\r
+\r
+               isNaturalOrderActivated = PreferencesUtil.getSortNodesNaturally();\r
+               final Button activateNaturalOrderCheckButton = new Button(composite, SWT.RADIO);\r
+               activateNaturalOrderCheckButton.setText("Enable Natural Order");\r
+               activateNaturalOrderCheckButton.setSelection(isNaturalOrderActivated);\r
+\r
+               isRankAndNameOrderActivated = !PreferencesUtil.getSortNodesStrictlyAlphabetically() && !PreferencesUtil.getSortNodesNaturally();\r
+               final Button activateRankAndNameOrderActivatedCheckButton = new Button(composite, SWT.RADIO);\r
+               activateRankAndNameOrderActivatedCheckButton.setText("Enable Rank and Aplhabetical Order");\r
+               activateRankAndNameOrderActivatedCheckButton.setSelection(isRankAndNameOrderActivated);\r
+\r
+               isAlphabeticalOrderActivated = PreferencesUtil.getSortNodesStrictlyAlphabetically();\r
+               final Button activateAlphabeticallyOrderedCheckButton = new Button(composite, SWT.RADIO);\r
+               activateAlphabeticallyOrderedCheckButton.setText("Enable Alphabetical Order");\r
+               activateAlphabeticallyOrderedCheckButton.setSelection(isAlphabeticalOrderActivated);\r
+\r
+               activateNaturalOrderCheckButton.addSelectionListener(new SelectionAdapter(){\r
+                   @Override\r
+                   public void widgetSelected(SelectionEvent e) {\r
+                       if(isNaturalOrderActivated != activateNaturalOrderCheckButton.getSelection()) {\r
+                               isNaturalOrderActivated = activateNaturalOrderCheckButton.getSelection();\r
+                               if (isAlphabeticalOrderActivated && isNaturalOrderActivated){\r
+                                       isAlphabeticalOrderActivated = false;\r
+                                       PreferencesUtil.setSortNodesStrictlyAlphabetically(isAlphabeticalOrderActivated);\r
+                               }\r
+                               if (isRankAndNameOrderActivated && isNaturalOrderActivated){\r
+                                       isRankAndNameOrderActivated = false;\r
+                               }\r
+                               PreferencesUtil.setSortNodesNaturally(isNaturalOrderActivated);\r
+                        isSelectionChanged = true;\r
+                    }else{\r
+                        isSelectionChanged = false;\r
+                    }\r
+\r
+                   }\r
+               });\r
+               activateAlphabeticallyOrderedCheckButton.addSelectionListener(new SelectionAdapter(){\r
                    @Override\r
                    public void widgetSelected(SelectionEvent e) {\r
-                       if(isNaturalOrderActivated != activateCheckButton.getSelection()) {\r
-                               isNaturalOrderActivated = activateCheckButton.getSelection();\r
-                               PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SORT_NODES_NATURALLY, isNaturalOrderActivated);\r
+                       if(isAlphabeticalOrderActivated != activateAlphabeticallyOrderedCheckButton.getSelection()) {\r
+                               isAlphabeticalOrderActivated = activateAlphabeticallyOrderedCheckButton.getSelection();\r
+                               if (isNaturalOrderActivated && isAlphabeticalOrderActivated){\r
+                                       isNaturalOrderActivated = false;\r
+                                       PreferencesUtil.setSortNodesNaturally(isNaturalOrderActivated);\r
+                               }\r
+                               if (isRankAndNameOrderActivated && isAlphabeticalOrderActivated){\r
+                                       isRankAndNameOrderActivated = false;\r
+                               }\r
+                               PreferencesUtil.setSortNodesStrictlyAlphabetically(isAlphabeticalOrderActivated);\r
                         isSelectionChanged = true;\r
                     }else{\r
                         isSelectionChanged = false;\r
@@ -58,16 +113,45 @@ public class OrderPreferences extends PreferencePage implements IWorkbenchPrefer
                    }\r
                });\r
 \r
-              \r
+               activateRankAndNameOrderActivatedCheckButton.addSelectionListener(new SelectionAdapter(){\r
+                   @Override\r
+                   public void widgetSelected(SelectionEvent e) {\r
+                       if(isRankAndNameOrderActivated != activateRankAndNameOrderActivatedCheckButton.getSelection()) {\r
+                               isRankAndNameOrderActivated = activateRankAndNameOrderActivatedCheckButton.getSelection();\r
+                               if (isAlphabeticalOrderActivated && isRankAndNameOrderActivated){\r
+                                        isAlphabeticalOrderActivated = false;\r
+                               }\r
+                               if (isNaturalOrderActivated && isRankAndNameOrderActivated){\r
+                                       isNaturalOrderActivated = false;\r
+                               }\r
+\r
+                               if (isRankAndNameOrderActivated ||(!isNaturalOrderActivated && !isAlphabeticalOrderActivated)){\r
+                                       PreferencesUtil.setSortNodesStrictlyAlphabetically(false);\r
+                                       PreferencesUtil.setSortNodesNaturally(false);\r
+                               }\r
+                        isSelectionChanged = true;\r
+                    }else{\r
+                        isSelectionChanged = false;\r
+                    }\r
+\r
+                   }\r
+               });\r
+\r
+\r
+\r
+\r
+\r
+            final Label description = new Label(parent, SWT.NONE);\r
+            description.setText(Messages.OrderPreferencePage_NewNavigatorWindowRequired);\r
 \r
                return composite;\r
            }\r
 \r
-         \r
+\r
                @Override\r
                public void init(IWorkbench workbench) {\r
                        // TODO Auto-generated method stub\r
-                       \r
+\r
                }\r
 \r
                /* (non-Javadoc)\r
@@ -76,7 +160,8 @@ public class OrderPreferences extends PreferencePage implements IWorkbenchPrefer
                @Override\r
                public boolean performOk() {\r
               if(isSelectionChanged){\r
-                 MessageDialog.openInformation(getShell(), null, Messages.OrderPreferencePage_PleaseReopenNavigator);            \r
+                 MessageDialog.openInformation(getShell(), null, Messages.OrderPreferencePage_PleaseReopenNavigator);\r
+                 isSelectionChanged = false;\r
                        return super.performOk();\r
               }\r
               return true;\r
index 83e6756fc4caf2d40451b9b1ed628662057fc2e4..dbaec0027e96500d82ef5b56b6a8715107e2f67e 100644 (file)
@@ -247,7 +247,7 @@ public class PreferencesUtil implements IPreferenceKeys {
         * @return
         */
        private static String getPreferenceKey(ICdmBase cdmBase) {
-               cdmBase = (ICdmBase) HibernateProxyHelper.deproxy(cdmBase);
+               cdmBase = HibernateProxyHelper.deproxy(cdmBase);
 
                String key = cdmBase.getClass().getName().concat(".")
                                .concat(cdmBase.getUuid().toString());
@@ -264,7 +264,7 @@ public class PreferencesUtil implements IPreferenceKeys {
         * @return
         */
        public static String getPreferenceKey(ISimpleTerm simpleTerm) {
-               simpleTerm = (ISimpleTerm) HibernateProxyHelper.deproxy(simpleTerm);
+               simpleTerm = HibernateProxyHelper.deproxy(simpleTerm);
                String key = simpleTerm.getClass().getName().concat(".")
                                .concat(simpleTerm.getUuid().toString());
                if (key.contains("javassist")) {
@@ -283,7 +283,7 @@ public class PreferencesUtil implements IPreferenceKeys {
         * @return
         */
        public static String getPreferenceKey(IDefinedTerm definedTerm) {
-               definedTerm = (IDefinedTerm) HibernateProxyHelper.deproxy(definedTerm);
+               definedTerm = HibernateProxyHelper.deproxy(definedTerm);
                String key = definedTerm.getClass().getName().concat(".")
                                .concat(definedTerm.getUuid().toString());
                if (key.contains("javassist")) {
@@ -588,7 +588,7 @@ public class PreferencesUtil implements IPreferenceKeys {
 
        private static String getMarkerTypeEditingPreferenceKey(
                        MarkerType markerType) {
-               markerType = (MarkerType) HibernateProxyHelper.deproxy(markerType);
+               markerType = HibernateProxyHelper.deproxy(markerType);
                return markerType.getClass().getName() + EDIT_MARKER_TYPE_PREFIX;
        }
 
@@ -751,7 +751,7 @@ public class PreferencesUtil implements IPreferenceKeys {
             ctrl.setEnabled(enabled);
         }
     }
-    
+
     /**
         * <p>
         * getSortRanksNaturally
@@ -762,7 +762,7 @@ public class PreferencesUtil implements IPreferenceKeys {
        public static boolean getSortNodesNaturally() {
                return getPreferenceStore().getBoolean(SORT_NODES_NATURALLY);
        }
-       
+
        /**
         * <p>
         * setSortRanksNaturally
@@ -774,4 +774,67 @@ public class PreferencesUtil implements IPreferenceKeys {
        public static void setSortNodesNaturally(boolean selection) {
                getPreferenceStore().setValue(SORT_NODES_NATURALLY, selection);
        }
+
+
+       /**
+        * <p>
+        * getSortRanksNaturally
+        * </p>
+        *
+        * @return a boolean.
+        */
+       public static boolean getSortNodesStrictlyAlphabetically() {
+               return getPreferenceStore().getBoolean(SORT_NODES_ALPHABETICALLY);
+       }
+
+       /**
+        * <p>
+        * setSortRanksNaturally
+        * </p>
+        *
+        * @param selection
+        *            a boolean.
+        */
+       public static void setSortNodesStrictlyAlphabetically(boolean selection) {
+               getPreferenceStore().setValue(SORT_NODES_ALPHABETICALLY, selection);
+       }
+
+       /**
+        * <p>
+        * setStoreNavigatorState
+        * </p>
+        *
+        * @param selection
+        *            a boolean.
+        */
+       public static boolean isStoreNavigatorState() {
+               return getPreferenceStore().getBoolean(RESTORE_NAVIGATOR_STATE);
+
+       }
+
+       /**
+        * <p>
+        * setStoreNavigatorState
+        * </p>
+        *
+        * @param selection
+        *            a boolean.
+        */
+       public static void setStoreNavigatorState(boolean selection) {
+               getPreferenceStore().setValue(RESTORE_NAVIGATOR_STATE, selection);
+
+       }
+
+    /**
+     * @return
+     */
+    public static boolean isShowUpWidgetIsDisposedMessages() {
+       return getPreferenceStore().getBoolean(IS_SHOW_UP_WIDGET_IS_DISPOSED);
+    }
+    public static void setShowUpWidgetIsDisposedMessages(boolean selection) {
+        getPreferenceStore().setValue(IS_SHOW_UP_WIDGET_IS_DISPOSED, selection);
+    }
+
+
+
 }
index 9c9bd5aee17d34aaf503280f48c7394b1a51b4bd..b0f25bddb25af39febf855f8a4b6b6b86c14199e 100644 (file)
@@ -21,17 +21,11 @@ import org.eclipse.ui.IWorkbenchPreferencePage;
  */
 public class SpecimenOrObservationPreferences extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
-     */
     @Override
     public void init(IWorkbench workbench) {
         setPreferenceStore(PreferencesUtil.getPreferenceStore());
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
-     */
     @Override
     protected void createFieldEditors() {
         addField(new BooleanFieldEditor(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS,
@@ -43,7 +37,6 @@ public class SpecimenOrObservationPreferences extends FieldEditorPreferencePage
         addField(new BooleanFieldEditor(IPreferenceKeys.SHOW_TAXON_ASSOCIATIONS,
                 "Show taxon associations of a specimen in the details view",
                 getFieldEditorParent()));
-
     }
 
 
index cae829782409e61fa6bb5b1322e280d6342512a8..df1f5128cea951bdbc6d2ca62b2b6b5d5f002e90 100644 (file)
@@ -60,6 +60,8 @@ public class TaxonomicEditorGeneralPreferences extends
                addField(new BooleanFieldEditor(IPreferenceKeys.SEARCH_OPEN_RESULTS_IN_SEPARATE_WINDOWS,
                        "Open search results in separate windows",
                        getFieldEditorParent()));
+
+
        }
 
        /*
index e09625ccecdfd2c3703a481ef9be111123a26838..be84b00cfff03c850b7222227c69cf3bd5c2fad4 100644 (file)
@@ -17,15 +17,10 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.jface.preference.ComboFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
 import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
@@ -33,17 +28,15 @@ import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
 import eu.etaxonomy.cdm.strategy.match.MatchException;
 import eu.etaxonomy.cdm.strategy.match.MatchMode;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>Abstract AbstractMatchingPreferences class.</p>
- *
  * @author n.hoffmann
  * @created Jan 22, 2010
  * @version 1.0
  */
-public abstract class AbstractMatchingPreferences<T extends IdentifiableEntity> extends PreferencePage implements
+public abstract class AbstractMatchingPreferences<T extends IdentifiableEntity> extends FieldEditorPreferencePage implements
                IWorkbenchPreferencePage {
 
        /**
@@ -60,96 +53,30 @@ public abstract class AbstractMatchingPreferences<T extends IdentifiableEntity>
 
        protected Map<String, Combo> matchModeCombos = new HashMap<String, Combo>();
 
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+    @Override
+    public void init(IWorkbench workbench) {
+        setPreferenceStore(PreferencesUtil.getPreferenceStore());
+    }
+
+       /**
+        * {@inheritDoc}
         */
-       /** {@inheritDoc} */
        @Override
-       protected Control createContents(Composite parent) {
-               final Composite composite = new Composite(parent, SWT.NULL);
-               GridLayout gridLayout = new GridLayout();
-               gridLayout.numColumns = 2;
-               composite.setLayout(gridLayout);
-
-               if(!CdmStore.isActive()) {
+       protected void createFieldEditors() {
+           if(!CdmStore.isActive()) {
             MessagingUtils.noDataSourceWarningDialog(null);
         }else{
             for(String fieldName : getFieldNames()){
-                createFieldWidget(composite, fieldName);
+                String[][] comboValues = new String[getMatchModeList().size()][2];
+                for (int i=0;i<getMatchModeList().size();i++) {
+                    comboValues[i][0] = getMatchModeList().get(i).name();
+                    comboValues[i][1] = getMatchModeList().get(i).name();
+                }
+                addField(new ComboFieldEditor(this.getClass().getCanonicalName()+fieldName,
+                        fieldName, comboValues,
+                        getFieldEditorParent()));
             }
         }
-
-               return composite;
-       }
-
-       /**
-        * Creates a widget for a field consisting of the label and a combo
-        *
-        * @see {@link #createMatchModeCombo(Composite, String, MatchMode)}
-        * @param composite
-        * @param fieldName
-        */
-       private void createFieldWidget(Composite parent, String fieldName) {
-           CLabel label = new CLabel(parent, SWT.NONE);
-           label.setText(fieldName);
-           MatchMode matchMode = matchStrategy.getMatchMode(fieldName);
-
-           createMatchModeCombo(parent, fieldName, matchMode);
-       }
-
-       /**
-        * Creates a combo for a field with the currently selected match mode for that field preselected
-        *
-        * @param parent
-        * @param matchMode
-        */
-       private void createMatchModeCombo(Composite parent, String fieldName, MatchMode selectedMatchMode) {
-               Combo matchModeCombo = new Combo(parent, SWT.NULL);
-
-               for (MatchMode matchMode : getMatchModeList()) {
-                       matchModeCombo.add(matchMode.name());
-               }
-
-               int index = getMatchModeList().indexOf(selectedMatchMode);
-
-               matchModeCombo.select(index);
-
-               matchModeCombo.addSelectionListener(new MatchModeComboSelectionListener(matchModeCombo, fieldName));
-
-               matchModeCombos.put(fieldName, matchModeCombo);
-       }
-
-       /**
-        * This listener updates the cache strategy when a value was changed in one of the combos
-        *
-        * @author n.hoffmann
-        * @created Jan 28, 2010
-        * @version 1.0
-        */
-       private class MatchModeComboSelectionListener extends SelectionAdapter{
-
-               private final Combo matchModeCombo;
-               private final String fieldName;
-
-               MatchModeComboSelectionListener(Combo matchModeCombo, String fieldName){
-                       this.matchModeCombo = matchModeCombo;
-                       this.fieldName = fieldName;
-               }
-
-               /* (non-Javadoc)
-                * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-                */
-               @Override
-               public void widgetSelected(SelectionEvent event) {
-                       super.widgetSelected(event);
-                       MatchMode matchMode = getMatchModeList().get(matchModeCombo.getSelectionIndex());
-                       try {
-                               matchStrategy.setMatchMode(fieldName, matchMode);
-                       } catch (MatchException e) {
-                               MessagingUtils.error(this.getClass(), e);
-                               throw new RuntimeException(e);
-                       }
-               }
        }
 
        /**
@@ -202,40 +129,6 @@ public abstract class AbstractMatchingPreferences<T extends IdentifiableEntity>
            return fields;
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.preference.PreferencePage#performApply()
-        */
-       /** {@inheritDoc} */
-       @Override
-       protected void performApply() {
-               MatchStrategyConfigurator.setMatchStrategy(matchStrategy);
-               super.performApply();
-       }
-
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
-        */
-       /** {@inheritDoc} */
-       @Override
-       protected void performDefaults() {
-               try {
-                       // set match strategy to default
-                       matchStrategy = getDefaultMatchStrategy();
-
-                       // set combos to their default values
-                       for(String fieldName : matchModeCombos.keySet()){
-                               Combo combo = matchModeCombos.get(fieldName);
-                               MatchMode matchMode = matchStrategy.getMatchMode(fieldName);
-                               combo.select(matchModeList.indexOf(matchMode));
-                       }
-
-               } catch (MatchException e) {
-                       MessagingUtils.error(this.getClass(), e);
-                       throw new RuntimeException(e);
-               }
-               super.performDefaults();
-       }
-
        /**
         * Returns the default match strategy for the respective class
         *
index 72acd566669b98c4b4ce9b457b67dfe03ed6c871..b048e2d13a6906fce33e878c225ac691a4392c37 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -15,8 +15,8 @@ import org.eclipse.ui.IWorkbench;
 import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
 import eu.etaxonomy.cdm.strategy.match.MatchException;
+import eu.etaxonomy.cdm.strategy.match.MatchStrategyConfigurator;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
 
 /**
  * <p>NonViralNameMatchingPreference class.</p>
@@ -27,13 +27,12 @@ import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
  */
 public class NonViralNameMatchingPreference extends AbstractMatchingPreferences<NonViralName>{
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
-        */
        /** {@inheritDoc} */
-       public void init(IWorkbench workbench) {
+       @Override
+    public void init(IWorkbench workbench) {
+           super.init(workbench);
                clazz = NonViralName.class;
-               
+
                try {
                        matchStrategy = MatchStrategyConfigurator.NonViralNameMatchStrategy();
                } catch (MatchException e) {
@@ -41,10 +40,7 @@ public class NonViralNameMatchingPreference extends AbstractMatchingPreferences<
                        throw new RuntimeException(e);
                }
        }
-       
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.preference.matching.AbstractMatchingPreferences#getDefaultMatchStrategy()
-        */
+
        /** {@inheritDoc} */
        @Override
        protected IMatchStrategy getDefaultMatchStrategy() throws MatchException {
index fd3fbdd32b24422a08f29d27e8996f0d9b10e46f..f28e61fc68cf2a315a0ff11e31345335f294ddc0 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -15,25 +15,22 @@ import org.eclipse.ui.IWorkbench;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
 import eu.etaxonomy.cdm.strategy.match.MatchException;
+import eu.etaxonomy.cdm.strategy.match.MatchStrategyConfigurator;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
 
 /**
- * <p>ReferenceMatchingPreference class.</p>
- *
  * @author n.hoffmann
  * @created Jan 22, 2010
  * @version 1.0
  */
 public class ReferenceMatchingPreference extends AbstractMatchingPreferences<Reference> {
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
-        */
        /** {@inheritDoc} */
-       public void init(IWorkbench workbench) {
+       @Override
+    public void init(IWorkbench workbench) {
+           super.init(workbench);
                clazz = Reference.class;
-               
+
                try {
                        matchStrategy = MatchStrategyConfigurator.ReferenceMatchStrategy();
                } catch (MatchException e) {
@@ -42,9 +39,6 @@ public class ReferenceMatchingPreference extends AbstractMatchingPreferences<Ref
                }
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.preference.matching.AbstractMatchingPreferences#getDefaultMatchStrategy()
-        */
        /** {@inheritDoc} */
        @Override
        protected IMatchStrategy getDefaultMatchStrategy() throws MatchException {
index 4cce0cf6d817a637996a5c037c71046b476d07be..a9774b346f7b2d12af6c69388e19118fbc301c03 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -15,12 +15,10 @@ import org.eclipse.ui.IWorkbench;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
 import eu.etaxonomy.cdm.strategy.match.MatchException;
+import eu.etaxonomy.cdm.strategy.match.MatchStrategyConfigurator;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
 
 /**
- * <p>TeamOrPersonMatchingPreference class.</p>
- *
  * @author n.hoffmann
  * @created Jan 22, 2010
  * @version 1.0
@@ -28,25 +26,20 @@ import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
 public class TeamOrPersonMatchingPreference extends
                AbstractMatchingPreferences<TeamOrPersonBase> {
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
-        */
        /** {@inheritDoc} */
-       public void init(IWorkbench workbench) {
-
+       @Override
+    public void init(IWorkbench workbench) {
+           super.init(workbench);
                clazz = TeamOrPersonBase.class;
-               
+
                try {
                        matchStrategy = MatchStrategyConfigurator.TeamOrPersonMatchStrategy();
                } catch (MatchException e) {
                        MessagingUtils.error(this.getClass(), e);
                        throw new RuntimeException(e);
                }
-       }       
+       }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.preference.matching.AbstractMatchingPreferences#getDefaultMatchStrategy()
-        */
        /** {@inheritDoc} */
        @Override
        protected IMatchStrategy getDefaultMatchStrategy() throws MatchException {
index e98123ac9d339b34739187da3747f00aaf9c963a..105bbd38bf270ad97cf5b5672fa61822abfea4c1 100644 (file)
@@ -20,7 +20,6 @@ import org.eclipse.core.commands.Parameterization;
 import org.eclipse.core.commands.ParameterizedCommand;
 import org.eclipse.core.commands.common.NotDefinedException;
 import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.jface.viewers.CheckStateChangedEvent;
 import org.eclipse.jface.viewers.CheckboxTableViewer;
 import org.eclipse.jface.viewers.ICheckStateListener;
@@ -52,13 +51,11 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.TermStore;
 
 /**
- * <p>Abstract AbstractMenuPreferences class.</p>
- *
  * @author n.hoffmann
  * @created 12.06.2009
  * @version 1.0
  */
-public abstract class AbstractMenuPreferences<T extends DefinedTermBase> extends PreferencePage implements
+public abstract class AbstractMenuPreferences<T extends DefinedTermBase> extends CdmPreferencePage implements
                IWorkbenchPreferencePage, IConversationEnabled{
 
        private Button toggleButton;
@@ -146,9 +143,6 @@ public abstract class AbstractMenuPreferences<T extends DefinedTermBase> extends
                toggleButton = new Button(buttonContainer, SWT.PUSH);
                toggleButton.setText("Toggle");
                toggleButton.addSelectionListener(new SelectionAdapter(){
-                       /* (non-Javadoc)
-                        * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-                        */
                        @Override
                        public void widgetSelected(SelectionEvent e) {
                                state = state ? false : true;
@@ -162,12 +156,6 @@ public abstract class AbstractMenuPreferences<T extends DefinedTermBase> extends
                return container;
        }
 
-
-       /**
-        * <p>refresh</p>
-        *
-        * @param definedTerms a {@link java.util.List} object.
-        */
        protected void refresh(List<T> definedTerms) {
                tableViewer.setInput(definedTerms);
 
@@ -175,23 +163,10 @@ public abstract class AbstractMenuPreferences<T extends DefinedTermBase> extends
                tableViewer.setCheckedElements(preferedTerms.toArray());
        }
 
-       /**
-        * <p>createAdditionalContent</p>
-        *
-        * @param container a {@link org.eclipse.swt.widgets.Composite} object.
-        */
        protected void createAdditionalContent(Composite container) {
                // implement where needed
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.preference.AbstractMenuPreferences#createButtons(org.eclipse.swt.widgets.Composite)
-        */
-       /**
-        * <p>createEditButtons</p>
-        *
-        * @param buttonContainer a {@link org.eclipse.swt.widgets.Composite} object.
-        */
        protected void createEditButtons(Composite buttonContainer) {
 
                editButton = new Button(buttonContainer, SWT.PUSH);
@@ -207,9 +182,6 @@ public abstract class AbstractMenuPreferences<T extends DefinedTermBase> extends
         */
        protected void addNewButtonListeners() {
                newButton.addSelectionListener(new SelectionAdapter(){
-                       /* (non-Javadoc)
-                        * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-                        */
                        @Override
                        public void widgetSelected(SelectionEvent e) {
                                VocabularyTermWizard<T> wizard = new VocabularyTermWizard<T>(getTermClass(), getConversationHolder());
@@ -220,7 +192,6 @@ public abstract class AbstractMenuPreferences<T extends DefinedTermBase> extends
                            }
                        }
 
-
                });
        }
 
@@ -230,9 +201,6 @@ public abstract class AbstractMenuPreferences<T extends DefinedTermBase> extends
         */
        protected void addEditButtonListeners() {
                editButton.addSelectionListener(new SelectionAdapter(){
-                       /* (non-Javadoc)
-                        * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-                        */
                        @Override
                        public void widgetSelected(SelectionEvent event) {
 
@@ -287,10 +255,6 @@ public abstract class AbstractMenuPreferences<T extends DefinedTermBase> extends
            }
        }
 
-       /*
-        * (non-Javadoc)
-        * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
-        */
        /**
         * <p>performDefaults</p>
         */
@@ -299,18 +263,10 @@ public abstract class AbstractMenuPreferences<T extends DefinedTermBase> extends
                tableViewer.setAllChecked(true);
        }
 
-       /**
-        * <p>Getter for the field <code>tableViewer</code>.</p>
-        *
-        * @return the tableViewer
-        */
        public CheckboxTableViewer getTableViewer() {
                return tableViewer;
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.preference.PreferencePage#performOk()
-        */
        /** {@inheritDoc} */
        @Override
        public boolean performOk() {
@@ -333,7 +289,8 @@ public abstract class AbstractMenuPreferences<T extends DefinedTermBase> extends
 
                PreferencesUtil.firePreferencesChanged(this.getClass());
 
-               return true;
+
+               return super.performOk();
        }
 
        private boolean checkNoneChecked(){
@@ -347,16 +304,8 @@ public abstract class AbstractMenuPreferences<T extends DefinedTermBase> extends
                }
        }
 
-       /**
-        * <p>getTermClass</p>
-        *
-        * @return a {@link java.lang.Class} object.
-        */
        protected abstract Class<T> getTermClass();
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
-        */
        @Override
        public ConversationHolder getConversationHolder() {
                if(conversation == null){
@@ -365,9 +314,6 @@ public abstract class AbstractMenuPreferences<T extends DefinedTermBase> extends
                return conversation;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
-        */
        @Override
        public void update(CdmDataChangeMap changeEvents) {
                // implement where needed
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/CdmPreferencePage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/CdmPreferencePage.java
new file mode 100644 (file)
index 0000000..02ff53a
--- /dev/null
@@ -0,0 +1,106 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.preference.menu;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.resource.ImageDescriptor;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author cmathew
+ * @date 30 Jul 2015
+ *
+ */
+public abstract class CdmPreferencePage extends PreferencePage implements ICdmEntitySessionEnabled {
+
+    private ICdmEntitySession previousCdmEntitySession;
+    private boolean isApply;
+
+    public CdmPreferencePage() {
+        initSession();
+    }
+
+    public CdmPreferencePage(String title) {
+        super(title);
+        initSession();
+    }
+
+    public CdmPreferencePage(String title, ImageDescriptor image) {
+        super(title, image);
+        initSession();
+    }
+
+    private void initSession() {
+        previousCdmEntitySession = CdmStore.getCurrentSessionManager().getActiveSession();
+        bindNullSession();
+    }
+
+    private void bindNullSession() {
+        if(CdmStore.isActive()) {
+            CdmStore.getCurrentSessionManager().bindNullSession();
+        }
+    }
+
+    @Override
+    public boolean performOk() {
+        if(previousCdmEntitySession != null && !isApply) {
+            previousCdmEntitySession.bind();
+        }
+        return super.performOk();
+    }
+
+    @Override
+    public boolean performCancel() {
+        if(previousCdmEntitySession != null) {
+            previousCdmEntitySession.bind();
+        }
+        return super.performCancel();
+    }
+
+    @Override
+    public void performApply() {
+        isApply = true;
+        super.performApply();
+        isApply = false;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getCdmEntitySession()
+     */
+    @Override
+    public ICdmEntitySession getCdmEntitySession() {
+        return CdmStore.getCurrentSessionManager().getNullSession();
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getRootEntities()
+     */
+    @Override
+    public <T extends CdmBase> Collection<T> getRootEntities() {
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+     */
+    @Override
+    public Map<Object, List<String>> getPropertyPathsMap() {
+        return null;
+    }
+
+}
index cc3ec2fdcb139e730e0b5ab885541bef452c6d8c..b53b064e53d61cdab87f79c7912b08fa4083b318 100644 (file)
@@ -11,7 +11,10 @@ package eu.etaxonomy.taxeditor.preference.wizard;
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 
@@ -32,12 +35,15 @@ import org.eclipse.swt.widgets.Display;
 
 import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.api.service.IVocabularyService;
+import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
 import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.cdm.model.common.TermVocabulary;
 import eu.etaxonomy.taxeditor.editor.definedterm.TermContentProvider;
 import eu.etaxonomy.taxeditor.editor.definedterm.TermLabelProvider;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -45,7 +51,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @date 21.07.2014
  *
  */
-public class AvailableDistributionPage extends WizardPage {
+public class AvailableDistributionPage extends WizardPage implements ICdmEntitySessionEnabled {
 
     private CheckboxTreeViewer viewer;
 
@@ -57,6 +63,7 @@ public class AvailableDistributionPage extends WizardPage {
     protected AvailableDistributionPage(String pageName) {
         super(pageName);
         // TODO check if configuration exists
+        CdmStore.getCurrentSessionManager().bindNullSession();
     }
 
     /*
@@ -245,4 +252,39 @@ public class AvailableDistributionPage extends WizardPage {
         }
     }
 
+    @Override
+    public void dispose() {
+        CdmStore.getCurrentSessionManager().dispose(this);
+        super.dispose();
+    }
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getCdmEntitySession()
+     */
+    @Override
+    public ICdmEntitySession getCdmEntitySession() {
+        return CdmStore.getCurrentSessionManager().getNullSession();
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getRootEntities()
+     */
+    @Override
+    public <T extends CdmBase> Collection<T> getRootEntities() {
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+     */
+    @Override
+    public Map<Object, List<String>> getPropertyPathsMap() {
+        Map<Object, List<String>> propertyPathsMap = new HashMap<Object, List<String>>();
+        List<String> termsPropertyPaths = Arrays.asList(new String[] {
+                "includes"
+        });
+        propertyPathsMap.put("includes", termsPropertyPaths);
+        propertyPathsMap.put("terms", termsPropertyPaths);
+        return propertyPathsMap;
+    }
+
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmAuthenticationException.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmAuthenticationException.java
new file mode 100644 (file)
index 0000000..8e58a09
--- /dev/null
@@ -0,0 +1,23 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.store;
+
+/**
+ * @author cmathew
+ * @date 24 Jul 2015
+ *
+ */
+public class CdmAuthenticationException extends RuntimeException {
+
+    public CdmAuthenticationException(String message, Throwable t) {
+        super(message,t);
+    }
+
+}
index 39e46a4fa366291775432879d4198448a756f71f..7439f00a21633027af67d624bc48246ec9399870 100644 (file)
@@ -9,9 +9,6 @@
 
 package eu.etaxonomy.taxeditor.store;
 
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
 import java.util.EnumSet;
 
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -20,32 +17,56 @@ import org.eclipse.swt.widgets.Display;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.Resource;
 import org.springframework.security.access.PermissionEvaluator;
-import org.springframework.security.authentication.ProviderManager;
+import org.springframework.security.authentication.AuthenticationManager;
 import org.springframework.security.core.Authentication;
 import org.springframework.security.core.context.SecurityContext;
 import org.springframework.security.core.context.SecurityContextHolder;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationException;
+import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
+import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.service.IAgentService;
+import eu.etaxonomy.cdm.api.service.ICollectionService;
 import eu.etaxonomy.cdm.api.service.ICommonService;
+import eu.etaxonomy.cdm.api.service.INameService;
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.api.service.IReferenceService;
 import eu.etaxonomy.cdm.api.service.IService;
+import eu.etaxonomy.cdm.api.service.IUserService;
+import eu.etaxonomy.cdm.api.service.molecular.IAmplificationService;
+import eu.etaxonomy.cdm.api.service.molecular.IPrimerService;
 import eu.etaxonomy.cdm.config.ICdmSource;
 import eu.etaxonomy.cdm.database.DbSchemaValidation;
-import eu.etaxonomy.cdm.ext.geo.IEditGeoService;
+import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.cdm.model.molecular.Amplification;
+import eu.etaxonomy.cdm.model.molecular.Primer;
+import eu.etaxonomy.cdm.model.name.NonViralName;
+import eu.etaxonomy.cdm.model.occurrence.Collection;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
 import eu.etaxonomy.cdm.persistence.hibernate.permission.ICdmPermissionEvaluator;
 import eu.etaxonomy.cdm.persistence.hibernate.permission.Role;
-import eu.etaxonomy.cdm.remote.CdmRemoteSourceException;
 import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
 import eu.etaxonomy.taxeditor.io.ExportManager;
 import eu.etaxonomy.taxeditor.io.ImportManager;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.remoting.cache.CdmRemoteCacheManager;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
+import eu.etaxonomy.taxeditor.session.mock.MockCdmEntitySessionManager;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
+import eu.etaxonomy.taxeditor.ui.dialog.RemotingLoginDialog;
+import eu.etaxonomy.taxeditor.util.ProgressMonitorClientManager;
 import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart;
+import eu.etaxonomy.taxeditor.webapp.CDMServer;
 
 /**
  * This implementation of ICdmDataRepository depends on hibernate sessions to
@@ -61,482 +82,576 @@ import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart;
  */
 public class CdmStore {
 
-       private static final Resource DEFAULT_APPLICATION_CONTEXT = new ClassPathResource(
-                       "/eu/etaxonomy/cdm/editorApplicationContext.xml",
-                       TaxeditorStorePlugin.class);
-       private static final DbSchemaValidation DEFAULT_DB_SCHEMA_VALIDATION = DbSchemaValidation.VALIDATE;
-
-       private static CdmStore instance;
-
-       private final ICdmApplicationConfiguration applicationConfiguration;
-
-       private static ContextManager contextManager = new ContextManager();
-
-       private static LoginManager loginManager = new LoginManager();
-
-       private static TermManager termManager = new TermManager();
-
-       private static SearchManager searchManager = new SearchManager();
-
-       private static EditorManager editorManager = new EditorManager();
-       
-       private static UseObjectStore useObjectInitializer = new UseObjectStore(); 
-
-       private static CdmStoreConnector job;
-
-       private Language language;
-
-       private ICdmSource cdmSource;
-
-       private boolean isConnected;
-
-       /**
-        * <p>
-        * getDefault
-        * </p>
-        *
-        * @return a {@link eu.etaxonomy.taxeditor.store.CdmStore} object.
-        */
-       protected static CdmStore getDefault() {
-               if (instance != null && instance.isConnected) {
-                       return instance;
-               } else{// if (instance == null || !instance.isConnected) {
-
-                       MessagingUtils.noDataSourceWarningDialog(instance);
-
-                       AbstractUtility.showView(CdmDataSourceViewPart.ID);
-                       return null;
-               }
-       }
-
-       /**
-        * Initialize the with the last edited datasource
-        */
-       public static void connect() {
-
-               ICdmSource cdmSource;
-               try {
-                       cdmSource = CdmDataSourceRepository.getCurrentCdmSource();
-                       connect(cdmSource);
-               } catch (CdmRemoteSourceException e) {
-                       MessagingUtils.messageDialog("Connection to CDM Source Failed", CdmStore.class, "Could not connect to target CDM Source", e);
-               }
-
-
-       }
-
-       /**
-        * Initialize with a specific datasource
-        *
-        * @param datasource
-        *            a {@link eu.etaxonomy.cdm.database.ICdmDataSource} object.
-        */
-       public static void connect(ICdmSource cdmSource) {
-               connect(cdmSource, DEFAULT_DB_SCHEMA_VALIDATION,
-                               DEFAULT_APPLICATION_CONTEXT);
-       }
-
-       /**
-        * Initialize and provide
-        *
-        * @param datasource
-        * @param dbSchemaValidation
-        * @param applicationContextBean
-        */
-       private static void connect(final ICdmSource cdmSource,
-                       final DbSchemaValidation dbSchemaValidation,
-                       final Resource applicationContextBean) {
-               MessagingUtils.info("Connecting to datasource: " + cdmSource);
-
-               job = new CdmStoreConnector(Display.getDefault(), cdmSource,
-                               dbSchemaValidation, applicationContextBean);
-               job.setUser(true);
-               job.setPriority(Job.BUILD);
-               job.schedule();
-
-       }
-
-       public static boolean isConnecting() {
-               return job != null && job.getState() == Job.RUNNING;
-       }
-
-       /**
-        * Closes the current application context
-        *
-        * @param monitor
-        *            a {@link org.eclipse.core.runtime.IProgressMonitor} object.
-        */
-       public static void close(final IProgressMonitor monitor) {
-               Display.getDefault().asyncExec(new Runnable() {
-                       /*
-                        * (non-Javadoc)
-                        *
-                        * @see java.lang.Runnable#run()
-                        */
-                       @Override
-                       public void run() {
-                               getContextManager().notifyContextAboutToStop(monitor);
-                               if ((monitor == null || (!monitor.isCanceled()) && isActive())) {
-                                       getContextManager().notifyContextStop(monitor);
-                                       instance.close();
-                               }
-                       }
-               });
-       }
-
-       private void close() {
-               isConnected = false;
-               cdmSource = null;
-       }
-
-       static void setInstance(ICdmApplicationConfiguration applicationController,
-                       ICdmSource cdmSource) {
-               instance = new CdmStore(applicationController, cdmSource);
-       }
-
-       private CdmStore(ICdmApplicationConfiguration applicationController,
-                       ICdmSource cdmSource) {
-               this.applicationConfiguration = applicationController;
-               this.cdmSource = cdmSource;
-               isConnected = true;
-       }
-
-       /**
-        * All calls to the datastore require
-        *
-        * @return
-        */
-       private ICdmApplicationConfiguration getApplicationConfiguration() {
-               try {
-                       return applicationConfiguration;
-               } catch (Exception e) {
-                       MessagingUtils.error(CdmStore.class, e);
-               }
-               return null;
-       }
-
-       /**
-        * <p>
-        * getCurrentApplicationController
-        * </p>
-        *
-        * @return a
-        *         {@link eu.etaxonomy.cdm.remote.api.application.CdmApplicationController}
-        *         object.
-        */
-       public static ICdmApplicationConfiguration getCurrentApplicationConfiguration() {
-               if (getDefault() != null) {
-                       return getDefault().getApplicationConfiguration();
-               }
-               return null;
-       }
-
-       /*
-        * CONVERSATIONS
-        */
-
-       /**
-        * Creates a new conversation, binds resources to the conversation and start
-        * a transaction for this conversation.
-        *
-        * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
-        *         object.
-        */
-       public static ConversationHolder createConversation() {
-               ConversationHolder conversation = getCurrentApplicationConfiguration()
-                               .NewConversation();
-               try{
-                       conversation.startTransaction();
-               }catch(Exception e){
-                       MessagingUtils.messageDialog("No database connection", CdmStore.class, "No database connection available", e);
-               }
-               return conversation;
-       }
-
-       /**
-        * Generic method that will scan the getters of {@link ICdmApplicationConfiguration} for the given service
-        * interface. If a matching getter is found the according service implementation is returned by
-        * invoking the getter otherwise the method returns <code>null</code>.
-        *
-        * @param <T>
-        * @param serviceClass
-        * @return the configured implementation of <code>serviceClass</code> or <code>null</code>
-        */
-       public static <T extends IService> T getService(Class<T> serviceClass) {
-               ICdmApplicationConfiguration configuration = getCurrentApplicationConfiguration();
-
-               Method[] methods = ICdmApplicationConfiguration.class.getDeclaredMethods();
-
-               T service = null;
-
-               for (Method method : methods) {
-                       Type type = method.getGenericReturnType();
-
-                       if (type.equals(serviceClass)) {
-                               try {
-                                       service = (T) method.invoke(configuration, null);
-                                       break;
-                               } catch (IllegalArgumentException e) {
-                                       MessagingUtils.error(CdmStore.class, e);
-                               } catch (IllegalAccessException e) {
-                                       MessagingUtils.error(CdmStore.class, e);
-                               } catch (InvocationTargetException e) {
-                                       MessagingUtils.error(CdmStore.class, e);
-                               }
-                       }
-               }
-
-               return service;
-       }
-       
-       /**
-        * @see #getService(Class)
-        * As ICommonService is not extending IService we need a specific request here
-        */
-       public static ICommonService getCommonService() {
-               ICdmApplicationConfiguration configuration = getCurrentApplicationConfiguration();
-
-               return configuration.getCommonService();
-
-       }
-
-       /**
-        * <p>
-        * getAuthenticationManager
-        * </p>
-        *
-        * @return a
-        *         {@link org.springframework.security.authentication.ProviderManager}
-        *         object.
-        */
-       public static ProviderManager getAuthenticationManager() {
-               return getCurrentApplicationConfiguration().getAuthenticationManager();
-       }
-
-       /**
-        * <p>
-        * getAuthenticationManager
-        * </p>
-        *
-        * @return a
-        *         {@link ICdmPermissionEvaluator} object.
-        */
-       public static ICdmPermissionEvaluator getPermissionEvaluator() {
-               return getCurrentApplicationConfiguration().getPermissionEvaluator();
-       }
-
-       /**
-        * <p>
-        * getGeoService
-        * </p>
-        *
-        * @return a {@link eu.etaxonomy.cdm.ext.geo.IEditGeoService} object.
-        */
-       public static IEditGeoService getGeoService() {
-               return (IEditGeoService) getCurrentApplicationConfiguration().getBean(
-                               "editGeoService");
-       }
-
-       /*
-        * SECURITY RELATED CONVENIENCE METHODS
-        */
-
-       /**
-        * @see org.springframework.security.access.PermissionEvaluator#hasPermission(org.springframework.security.core.Authentication, java.lang.Object, java.lang.Object)
+    private static final Resource DEFAULT_APPLICATION_CONTEXT = new ClassPathResource(
+            "/eu/etaxonomy/cdm/editorApplicationContext.xml",
+            TaxeditorStorePlugin.class);
+    private static final DbSchemaValidation DEFAULT_DB_SCHEMA_VALIDATION = DbSchemaValidation.VALIDATE;
+
+    private static CdmStore instance;
+
+    //private final ICdmApplicationConfiguration applicationConfiguration;
+
+    private static ContextManager contextManager = new ContextManager();
+
+    private static LoginManager loginManager = new LoginManager();
+
+    private static TermManager termManager = new TermManager();
+
+    private static SearchManager searchManager = new SearchManager();
+
+    private static EditorManager editorManager = new EditorManager();
+
+    private static UseObjectStore useObjectInitializer = new UseObjectStore();
+
+    private static ProgressMonitorClientManager progressMonitorClientManager = new ProgressMonitorClientManager();
+
+    private static CdmStoreConnector job;
+
+    private static CDMServer managedServer;
+
+    private Language language;
+
+    private ICdmSource cdmSource;
+
+    private boolean isConnected;
+
+
+
+    /**
+     * <p>
+     * getDefault
+     * </p>
+     *
+     * @return a {@link eu.etaxonomy.taxeditor.store.CdmStore} object.
+     */
+    protected static CdmStore getDefault() {
+        if (instance != null && instance.isConnected) {
+            return instance;
+        } else{// if (instance == null || !instance.isConnected) {
+
+            MessagingUtils.noDataSourceWarningDialog(instance);
+
+            AbstractUtility.showView(CdmDataSourceViewPart.ID);
+            return null;
+        }
+    }
+
+    /**
+     * Initialize the with the last edited datasource
+     */
+    public static void connect() {
+
+        ICdmSource cdmSource;
+        try {
+
+            cdmSource = CdmDataSourceRepository.getCurrentCdmSource();
+            connect(cdmSource);
+        } catch (Exception e) {
+            MessagingUtils.messageDialog("Connection to CDM Source Failed", CdmStore.class, "Could not connect to target CDM Source", e);
+        }
+
+
+    }
+
+    /**
+     * Initialize with a specific datasource
+     *
+     * @param datasource
+     *            a {@link eu.etaxonomy.cdm.database.ICdmDataSource} object.
+     */
+    public static void connect(ICdmSource cdmSource) {
+        connect(cdmSource, DEFAULT_DB_SCHEMA_VALIDATION,
+                DEFAULT_APPLICATION_CONTEXT);
+    }
+
+    public static void connect(ICdmSource cdmSource, RemotingLoginDialog loginDialog) {
+        connect(cdmSource,
+                DEFAULT_DB_SCHEMA_VALIDATION,
+                DEFAULT_APPLICATION_CONTEXT,
+                loginDialog);
+    }
+
+    /**
+     * Initialize and provide
+     *
+     * @param datasource
+     * @param dbSchemaValidation
+     * @param applicationContextBean
+     */
+    private static void connect(final ICdmSource cdmSource,
+            final DbSchemaValidation dbSchemaValidation,
+            final Resource applicationContextBean) {
+
+        MessagingUtils.info("Connecting to datasource: " + cdmSource);
+
+        job = new CdmStoreConnector(Display.getDefault(), cdmSource,
+                dbSchemaValidation, applicationContextBean);
+        job.setUser(true);
+        job.setPriority(Job.BUILD);
+        job.schedule();
+
+    }
+
+    private static void connect(final ICdmSource cdmSource,
+            final DbSchemaValidation dbSchemaValidation,
+            final Resource applicationContextBean,
+            RemotingLoginDialog remotingLoginDialog) {
+        RemotingLoginDialog loginDialog = remotingLoginDialog;
+        if(isActive()) {
+            // before we connect we clear the entity caches and the sessions
+            CdmRemoteCacheManager.removeEntityCaches();
+            if(getCurrentSessionManager() != null) {
+                getCurrentSessionManager().disposeAll();
+            }
+        }
+        MessagingUtils.info("Connecting to datasource: " + cdmSource);
+
+        job = new CdmStoreConnector(Display.getDefault(),
+                cdmSource,
+                dbSchemaValidation,
+                applicationContextBean);
+        job.start(loginDialog);
+
+    }
+
+    public static boolean isConnecting() {
+        return job != null && job.getState() == Job.RUNNING;
+    }
+
+    /**
+     * Closes the current application context
+     *
+     * @param monitor
+     *            a {@link org.eclipse.core.runtime.IProgressMonitor} object.
+     */
+    public static void close(final IProgressMonitor monitor) {
+        Display.getDefault().asyncExec(new Runnable() {
+            /*
+             * (non-Javadoc)
+             *
+             * @see java.lang.Runnable#run()
+             */
+            @Override
+            public void run() {
+                getContextManager().notifyContextAboutToStop(monitor);
+                if ((monitor == null || (!monitor.isCanceled()) && isActive())) {
+                    getContextManager().notifyContextStop(monitor);
+                    instance.close();
+                }
+            }
+        });
+    }
+
+    public static void close(IProgressMonitor monitor, boolean async) {
+        if(async) {
+            close(monitor);
+        } else {
+            getContextManager().notifyContextAboutToStop(monitor);
+            if ((monitor == null || (!monitor.isCanceled()) && isActive())) {
+                getContextManager().notifyContextStop(monitor);
+                instance.close();
+            }
+        }
+
+    }
+    private void close() {
+        isConnected = false;
+        cdmSource = null;
+        CdmApplicationState.dispose();
+    }
+
+    static void setInstance(ICdmApplicationConfiguration applicationController,
+            ICdmSource cdmSource) {
+        instance = new CdmStore(applicationController, cdmSource);
+        if(getCurrentSessionManager().isRemoting()) {
+            CdmApplicationState.setCdmServiceCacher(new CdmServiceCacher());
+        }
+    }
+
+    private CdmStore(ICdmApplicationConfiguration applicationController,
+            ICdmSource cdmSource) {
+        CdmApplicationState.setCurrentAppConfig(applicationController);
+        CdmApplicationState.setCurrentDataChangeService(new CdmUIDataChangeService());
+        this.cdmSource = cdmSource;
+        isConnected = true;
+    }
+
+    /**
+     * All calls to the datastore require
+     *
+     * @return
+     */
+    private ICdmApplicationConfiguration getApplicationConfiguration() {
+        try {
+            return CdmApplicationState.getCurrentAppConfig();
+        } catch (Exception e) {
+            MessagingUtils.error(CdmStore.class, e);
+        }
+        return null;
+    }
+
+    /**
+     * <p>
+     * getCurrentApplicationController
+     * </p>
      *
-        * @param targetDomainObject
-        * @param permission
-        * @return
-        */
-       public static boolean currentAuthentiationHasPermission(CdmBase targetDomainObject, EnumSet<CRUD> permission){
-               //TODO use getCurrentApplicationConfiguration().currentAuthentiationHasPermission(CdmBase targetDomainObject, Operation permission) instead
-               SecurityContext context = SecurityContextHolder.getContext();
-               PermissionEvaluator pe = getPermissionEvaluator();
-               boolean hasPermission = false;
-               try {
+     * @return a
+     *         {@link eu.etaxonomy.cdm.remote.api.application.CdmApplicationController}
+     *         object.
+     */
+    public static ICdmApplicationConfiguration getCurrentApplicationConfiguration() {
+        if (getDefault() != null) {
+            return getDefault().getApplicationConfiguration();
+        }
+        return null;
+    }
+
+    /*
+     * CONVERSATIONS
+     */
+
+    /**
+     * Creates a new conversation, binds resources to the conversation and start
+     * a transaction for this conversation.
+     *
+     * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
+     *         object.
+     */
+    public static ConversationHolder createConversation() {
+        ConversationHolder conversation = getCurrentApplicationConfiguration()
+                .NewConversation();
+        try {
+            conversation.startTransaction();
+        }catch(Exception e){
+            MessagingUtils.messageDialog("No database connection", CdmStore.class, "No database connection available", e);
+        }
+        return conversation;
+    }
+
+    //FIXME:Remoting should be removed after moving completely to remoting
+    private MockCdmEntitySessionManager mockCdmEntitySessionManager;
+
+    private ICdmEntitySessionManager getSessionManager() {
+        //FIXME:Remoting we should only have CdmApplicationRemoteConfiguration after move to remoting
+        //               bad hack which should be finally removed
+        if(getCurrentApplicationConfiguration() instanceof CdmApplicationRemoteController) {
+            return ((CdmApplicationRemoteController)getCurrentApplicationConfiguration()).getCdmEntitySessionManager();
+        } else {
+            if(mockCdmEntitySessionManager == null) {
+                mockCdmEntitySessionManager = new MockCdmEntitySessionManager();
+            }
+            return mockCdmEntitySessionManager;
+        }
+    }
+
+    public static  ICdmEntitySessionManager getCurrentSessionManager() {
+        if (getDefault() != null) {
+            return getDefault().getSessionManager();
+        }
+        return null;
+
+    }
+
+    /**
+     * Generic method that will scan the getters of {@link ICdmApplicationConfiguration} for the given service
+     * interface. If a matching getter is found the according service implementation is returned by
+     * invoking the getter otherwise the method returns <code>null</code>.
+     *
+     * @param <T>
+     * @param serviceClass
+     * @return the configured implementation of <code>serviceClass</code> or <code>null</code>
+     */
+    public static <T extends IService> T getService(Class<T> serviceClass) {
+        T service = null;
+        try {
+            service = CdmApplicationState.getService(serviceClass);
+        } catch (CdmApplicationException cae) {
+            MessagingUtils.error(CdmStore.class, cae);
+        }
+
+        return service;
+    }
+
+    /**
+     * @see #getService(Class)
+     * As ICommonService is not extending IService we need a specific request here
+     */
+    public static ICommonService getCommonService() {
+        return CdmApplicationState.getCommonService();
+
+    }
+
+    /**
+     * <p>
+     * getAuthenticationManager
+     * </p>
+     *
+     * @return a
+     *         {@link org.springframework.security.authentication.ProviderManager}
+     *         object.
+     */
+    public static AuthenticationManager getAuthenticationManager() {
+        return getCurrentApplicationConfiguration().getAuthenticationManager();
+    }
+
+    /**
+     * <p>
+     * getAuthenticationManager
+     * </p>
+     *
+     * @return a
+     *         {@link ICdmPermissionEvaluator} object.
+     */
+    public static ICdmPermissionEvaluator getPermissionEvaluator() {
+        return getCurrentApplicationConfiguration().getPermissionEvaluator();
+    }
+
+
+    /*
+     * SECURITY RELATED CONVENIENCE METHODS
+     */
+
+    /**
+     * @see org.springframework.security.access.PermissionEvaluator#hasPermission(org.springframework.security.core.Authentication, java.lang.Object, java.lang.Object)
+     *
+     * @param targetDomainObject
+     * @param permission
+     * @return
+     */
+    public static boolean currentAuthentiationHasPermission(CdmBase targetDomainObject, EnumSet<CRUD> permission){
+        //TODO use getCurrentApplicationConfiguration().currentAuthentiationHasPermission(CdmBase targetDomainObject, Operation permission) instead
+        SecurityContext context = SecurityContextHolder.getContext();
+        PermissionEvaluator pe = getPermissionEvaluator();
+        boolean hasPermission = false;
+        try {
             hasPermission = getPermissionEvaluator().hasPermission(context.getAuthentication(), targetDomainObject,
                     permission);
         } catch (org.springframework.security.access.AccessDeniedException e) {
             /* IGNORE */
         }
         return hasPermission;
-       }
+    }
 
-       /**
-        * @see org.springframework.security.access.PermissionEvaluator#hasPermission(org.springframework.security.core.Authentication, java.lang.Object, java.lang.Object)
+    /**
+     * @see org.springframework.security.access.PermissionEvaluator#hasPermission(org.springframework.security.core.Authentication, java.lang.Object, java.lang.Object)
      *
-        * @param targetDomainObject
-        * @param permission
-        * @return
-        */
-       public static boolean currentAuthentiationHasPermission(Class<? extends CdmBase> targetType, EnumSet<CRUD> permission){
-           boolean hasPermission = false;
+     * @param targetDomainObject
+     * @param permission
+     * @return
+     */
+    public static boolean currentAuthentiationHasPermission(Class<? extends CdmBase> targetType, EnumSet<CRUD> permission){
+        boolean hasPermission = false;
         try {
             hasPermission = getPermissionEvaluator().hasPermission(getCurrentAuthentiation(), null, targetType.getName(), permission);
         } catch (org.springframework.security.access.AccessDeniedException e) {
             /* IGNORE */
         }
         return hasPermission;
-       }
+    }
 
-       public static boolean currentAuthentiationHasOneOfRoles(Role ... roles){
-           boolean hasPermission = false;
+    public static boolean currentAuthentiationHasOneOfRoles(Role ... roles){
+        boolean hasPermission = false;
         try {
             hasPermission =  getPermissionEvaluator().hasOneOfRoles(getCurrentAuthentiation(), roles);
         } catch (org.springframework.security.access.AccessDeniedException e) {
             /* IGNORE */
         }
         return hasPermission;
-       }
-
-       public static Authentication getCurrentAuthentiation() {
-               SecurityContext context = SecurityContextHolder.getContext();
-               return context.getAuthentication();
-       }
-
-       /*
-        * LANGUAGE
-        */
-
-       /**
-        * Provides access to the global default language set in the application preferences.
-        *
-        * @return a {@link eu.etaxonomy.cdm.model.common.Language} object.
-        */
-       public static Language getDefaultLanguage() {
-               if (getDefault().getLanguage() == null) {
-                       getDefault().setLanguage(PreferencesUtil.getGlobalLanguage());
-               }
-               return getDefault().getLanguage();
-       }
-
-       /**
-        * <p>
-        * setDefaultLanguage
-        * </p>
-        *
-        * @param language
-        *            a {@link eu.etaxonomy.cdm.model.common.Language} object.
-        */
-       public static void setDefaultLanguage(Language language) {
-               getDefault().setLanguage(language);
-       }
-
-       /**
-        * @return the language
-        */
-       private Language getLanguage() {
-               return language;
-       }
-
-       /**
-        * @param language
-        *            the language to set
-        */
-       private void setLanguage(Language language) {
-               this.language = language;
-       }
-
-       /*
-        * LOGIN
-        */
-
-       /**
-        * <p>
-        * Getter for the field <code>loginManager</code>.
-        * </p>
-        *
-        * @return a {@link eu.etaxonomy.taxeditor.store.LoginManager} object.
-        */
-       public static LoginManager getLoginManager() {
-               return loginManager;
-       }
-
-       /**
-        * <p>
-        * Getter for the field <code>contextManager</code>.
-        * </p>
-        *
-        * @return a {@link eu.etaxonomy.taxeditor.store.ContextManager} object.
-        */
-       public static ContextManager getContextManager() {
-               return contextManager;
-       }
-
-       public static TermManager getTermManager() {
-               return termManager;
-       }
-
-       public static SearchManager getSearchManager() {
-               return searchManager;
-       }
-
-       public static EditorManager getEditorManager() {
-               return editorManager;
-       }
-
-       /*
-        * IMPORT/EXPORT FACTORIES
-        */
-
-       /**
-        * <p>
-        * Getter for the field <code>importHandler</code>.
-        * </p>
-        *
-        * @return a {@link eu.etaxonomy.taxeditor.io.ImportManager} object.
-        */
-       public static ImportManager getImportManager() {
-               return ImportManager.NewInstance(getCurrentApplicationConfiguration());
-       }
-
-       /**
-        * <p>
-        * Getter for the field <code>exportHandler</code>.
-        * </p>
-        *
-        * @return a {@link eu.etaxonomy.taxeditor.io.ExportManager} object.
-        */
-       public static ExportManager getExportManager() {
-               return ExportManager.NewInstance(getCurrentApplicationConfiguration());
-       }
-
-       /**
-        * Whether this CdmStore is currently connected to a datasource
-        *
-        * @return a boolean.
-        */
-       public static boolean isActive() {
-               return instance != null && instance.isConnected;
-       }
-
-       public static ICdmSource getActiveCdmSource() {
-               if (isActive()) {
-                       return instance.getCdmSource();
-               }
-               return null;
-       }
-
-       /**
-        * <p>
-        * getDataSource
-        * </p>
-        *
-        * @return a {@link eu.etaxonomy.cdm.database.ICdmDataSource} object.
-        * @deprecated currently retained for backward compatibility - use {@link getActiveCdmSource()} instead
-        */
-//     public static ICdmDataSource getDataSource() {
-//             if (isActive()) {
-//                     return (ICdmDataSource)instance.getCdmSource();
-//             }
-//             return null;
-//     }
-
-       /**
-        * @return
-        */
-       private ICdmSource getCdmSource() {
-               return cdmSource;
-       }
+    }
+
+    public static Authentication getCurrentAuthentiation() {
+        SecurityContext context = SecurityContextHolder.getContext();
+        return context.getAuthentication();
+    }
+
+    /*
+     * LANGUAGE
+     */
+
+    /**
+     * Provides access to the global default language set in the application preferences.
+     *
+     * @return a {@link eu.etaxonomy.cdm.model.common.Language} object.
+     */
+    public static Language getDefaultLanguage() {
+        if (getDefault().getLanguage() == null) {
+            getDefault().setLanguage(PreferencesUtil.getGlobalLanguage());
+        }
+        return getDefault().getLanguage();
+    }
+
+    /**
+     * <p>
+     * setDefaultLanguage
+     * </p>
+     *
+     * @param language
+     *            a {@link eu.etaxonomy.cdm.model.common.Language} object.
+     */
+    public static void setDefaultLanguage(Language language) {
+        getDefault().setLanguage(language);
+    }
+
+    /**
+     * @return the language
+     */
+    private Language getLanguage() {
+        return language;
+    }
+
+    /**
+     * @param language
+     *            the language to set
+     */
+    private void setLanguage(Language language) {
+        this.language = language;
+    }
+
+    /*
+     * LOGIN
+     */
+
+    /**
+     * <p>
+     * Getter for the field <code>loginManager</code>.
+     * </p>
+     *
+     * @return a {@link eu.etaxonomy.taxeditor.store.LoginManager} object.
+     */
+    public static LoginManager getLoginManager() {
+        return loginManager;
+    }
+
+    /**
+     * <p>
+     * Getter for the field <code>contextManager</code>.
+     * </p>
+     *
+     * @return a {@link eu.etaxonomy.taxeditor.store.ContextManager} object.
+     */
+    public static ContextManager getContextManager() {
+        return contextManager;
+    }
+
+    public static TermManager getTermManager() {
+        return termManager;
+    }
+
+    public static SearchManager getSearchManager() {
+        return searchManager;
+    }
+
+    public static EditorManager getEditorManager() {
+        return editorManager;
+    }
+
+    public static ProgressMonitorClientManager getProgressMonitorClientManager() {
+        return progressMonitorClientManager;
+    }
+
+    /*
+     * IMPORT/EXPORT FACTORIES
+     */
+
+    /**
+     * <p>
+     * Getter for the field <code>importHandler</code>.
+     * </p>
+     *
+     * @return a {@link eu.etaxonomy.taxeditor.io.ImportManager} object.
+     */
+    public static ImportManager getImportManager() {
+        return ImportManager.NewInstance(getCurrentApplicationConfiguration());
+    }
+
+    /**
+     * <p>
+     * Getter for the field <code>exportHandler</code>.
+     * </p>
+     *
+     * @return a {@link eu.etaxonomy.taxeditor.io.ExportManager} object.
+     */
+    public static ExportManager getExportManager() {
+        return ExportManager.NewInstance(getCurrentApplicationConfiguration());
+    }
+
+    /**
+     * Whether this CdmStore is currently connected to a datasource
+     *
+     * @return a boolean.
+     */
+    public static boolean isActive() {
+        return instance != null && instance.isConnected;
+    }
+
+    public static ICdmSource getActiveCdmSource() {
+        if (isActive()) {
+            return instance.getCdmSource();
+        }
+        return null;
+    }
+
+    /**
+     * <p>
+     * getDataSource
+     * </p>
+     *
+     * @return a {@link eu.etaxonomy.cdm.database.ICdmDataSource} object.
+     * @deprecated currently retained for backward compatibility - use {@link getActiveCdmSource()} instead
+     */
+    // public static ICdmDataSource getDataSource() {
+    //         if (isActive()) {
+    //                 return (ICdmDataSource)instance.getCdmSource();
+    //         }
+    //         return null;
+    // }
+
+    /**
+     * @return
+     */
+    private ICdmSource getCdmSource() {
+        return cdmSource;
+    }
+
+
+    public static <T extends CdmBase> IService<T> getService(T cdmBase){
+        IService<T> service = null;
+        if(cdmBase!=null){
+            //get corresponding service
+            if(cdmBase.isInstanceOf(Reference.class)){
+                service = (IService<T>) getService(IReferenceService.class);
+            }
+            else if (cdmBase.isInstanceOf(AgentBase.class)){
+                service = (IService<T>) getService(IAgentService.class);
+            }
+            else if (cdmBase instanceof NonViralName) {
+                service = (IService<T>) getService(INameService.class);
+            }
+            else if (cdmBase instanceof SpecimenOrObservationBase) {
+                service = (IService<T>) getService(IOccurrenceService.class);
+            }
+            else if (cdmBase instanceof Collection) {
+                service = (IService<T>) getService(ICollectionService.class);
+            }
+            else if (cdmBase instanceof User) {
+                service = (IService<T>) getService(IUserService.class);
+            }
+            else if (cdmBase instanceof Primer) {
+                service = (IService<T>) getService(IPrimerService.class);
+            }
+            else if (cdmBase instanceof Amplification) {
+                service = (IService<T>) getService(IAmplificationService.class);
+            }
+        }
+        return service;
+    }
+
+    public static void setManagedServer(CDMServer server) {
+        managedServer = server;
+    }
+
+    public static CDMServer getManagedServer() {
+        return managedServer;
+    }
 
 }
index f174f86773252b951c855dcd41951a105f44c0a9..4a9d7e1d1be5d0f3ee3b7c5eb234aae8ed19358e 100644 (file)
@@ -10,6 +10,7 @@
 
 package eu.etaxonomy.taxeditor.store;
 
+import java.lang.reflect.InvocationTargetException;
 import java.sql.SQLException;
 import java.util.concurrent.CancellationException;
 
@@ -17,6 +18,8 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.swt.widgets.Display;
 import org.springframework.core.io.Resource;
 
@@ -28,235 +31,340 @@ import eu.etaxonomy.cdm.config.ICdmSource;
 import eu.etaxonomy.cdm.database.DbSchemaValidation;
 import eu.etaxonomy.cdm.database.ICdmDataSource;
 import eu.etaxonomy.cdm.model.metadata.CdmMetaData;
-import eu.etaxonomy.cdm.remote.ICdmRemoteSource;
+import eu.etaxonomy.cdm.model.name.Rank;
 import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.remoting.source.ICdmRemoteSource;
 import eu.etaxonomy.taxeditor.ui.dialog.LoginDialog;
+import eu.etaxonomy.taxeditor.ui.dialog.RemotingLoginDialog;
 import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart;
 
+
 /**
  * @author n.hoffmann
  * @created Dec 8, 2010
  * @version 1.0
  */
 class CdmStoreConnector extends Job {
-       private final Display display;
-       private final ICdmSource cdmSource;
-       private DbSchemaValidation dbSchemaValidation;
-       private final Resource applicationContextBean;
-
-       /**
-        * @param datasource
-        * @param dbSchemaValidation
-        * @param applicationContextBean
-        */
-       public CdmStoreConnector(Display display, ICdmSource cdmSource,
-                       DbSchemaValidation dbSchemaValidation,
-                       Resource applicationContextBean) {
-               super("Connecting to datasource: " + cdmSource);
-               this.display = display;
-               this.cdmSource = cdmSource;
-               this.dbSchemaValidation = dbSchemaValidation;
-               this.applicationContextBean = applicationContextBean;
-       }
-
-       @Override
-       public IStatus run(final IProgressMonitor monitor) {
-
-               monitor.beginTask(getConnectionMessage(), 10);
-
-               // check if database is up and running
-               checkDatabaseReachable(monitor);
-
-               if (!monitor.isCanceled()) {
-                       // check if the datasource actually holds data
-                       checkIsNonEmptyCdmDatabase(monitor);
-               }
-
-               if (dbSchemaValidation != DbSchemaValidation.CREATE
-                               && !monitor.isCanceled()) {
-                       // if we do not create the datasource, we want to check if the
-                       // datasource is compatible with this editor
-                       checkDbSchemaVersionCompatibility(monitor);
-               }
-
-               // we are done with our low level checking and will free resources now
-               cdmSource.closeOpenConnections();
-
-               if (!monitor.isCanceled()) {
-                       CdmStore.close(monitor);
-               }
-
-               ICdmApplicationConfiguration applicationController = null;
-
-               if (!monitor.isCanceled()) {
-                       CdmProgressMonitorAdapter subprogressMonitor = CdmProgressMonitorAdapter
-                                       .CreateSubMonitor(monitor, 7);
-                       // This is where we instantiate the application controller
-                       int oldPriority = Thread.currentThread().getPriority();
-                       try {
-                               Thread.currentThread().setPriority(10);
-                               applicationController = getApplicationController(cdmSource,subprogressMonitor);
-                       } catch (Exception e) {
-                               if(! causeIsCancelationExceptionRecursive(e)){
-                                       return new Status(IStatus.ERROR, "Could not connect to CDM Store", "An error occurred while trying to connect to datasource: " + cdmSource.getName(), e);
-                               }
-                       } finally {
-                               monitor.done();
-                               Thread.currentThread().setPriority(oldPriority);
-                       }
-               }
-
-
-
-               if (!monitor.isCanceled()) {
-                       CdmStore.setInstance(applicationController, cdmSource);
-
-                       display.asyncExec(new Runnable() {
-                               /*
-                                * (non-Javadoc)
-                                *
-                                * @see java.lang.Runnable#run()
-                                */
-                               @Override
-                               public void run() {
-                                       authenticate();
-
-                                       startContext();
-                               }
-                       });
-
-                       MessagingUtils.info("Application context initialized.");
-                       return Status.OK_STATUS;
-               } else {
-                       // Show datasource view if not shown yet
-                       display.asyncExec(new Runnable() {
-                               /*
-                                * (non-Javadoc)
-                                *
-                                * @see java.lang.Runnable#run()
-                                */
-                               @Override
-                               public void run() {
-                                       StoreUtil.showView(CdmDataSourceViewPart.ID);
-                               }
-                       });
-                       return Status.CANCEL_STATUS;
-               }
-
-       }
-
-       private ICdmApplicationConfiguration getApplicationController(ICdmSource cdmSource, CdmProgressMonitorAdapter subprogressMonitor) {
-               if(cdmSource instanceof ICdmDataSource) {
-                       return  CdmApplicationController.NewInstance(applicationContextBean,
-                                       (ICdmDataSource)cdmSource,
-                                       dbSchemaValidation,
-                                       false,
-                                       subprogressMonitor);
-               } else if(cdmSource instanceof ICdmRemoteSource) {
-                       return CdmApplicationRemoteController.NewInstance((ICdmRemoteSource)cdmSource,
-                                                       false,
-                                                       subprogressMonitor,
-                                                       null);
-               } else {
-                       throw new UnsupportedOperationException("Cannot create application controller for " + cdmSource.getName());
-               }
-       }
-       private void authenticate() {
-               LoginDialog loginDialog = new LoginDialog(StoreUtil.getShell());
-               loginDialog.open();
-       }
-
-       private void startContext() {
-               CdmStore.getContextManager().notifyContextStart();
-       }
-
-       /**
-        * @return
-        */
-       private String getConnectionMessage() {
-               return cdmSource.getConnectionMessage();
-       }
-
-       /**
-        * @return
-        * @throws SQLException
-        */
-       private void checkDbSchemaVersionCompatibility(IProgressMonitor monitor) {
-               monitor.subTask("Checking if datasource is compatible with this editor.");
-               String dbSchemaVersion;
-
-               String message = null;
-               try {
-                       dbSchemaVersion = cdmSource.getDbSchemaVersion();
-                       // we assume that empty dbSchemaVersion means an empty database and
-                       // skip version checking
-
-                       if(dbSchemaVersion != null) {
-                           int compareVersion = CdmMetaData.compareVersion(dbSchemaVersion, CdmMetaData.getDbSchemaVersion(), 3, null);
-                           // if the datasource version is greater than the taxeditor compatible version then the taxeditor needs to
-                           // be updated else the datasource needs to be updated
-                           if(compareVersion > 0) {
-                               message = "Please update the Taxonomic Editor (Help->Check for Updates) or choose a compatible datasource";
-                           } else if (compareVersion < 0) {
-                               message = "Please update the chosen datasource or choose a new data source to connect to in the Datasource View.";
-                           }
-                       }
-                       monitor.worked(1);
-               } catch (CdmSourceException e) {
-                       //
-               }
-
-               if (message != null) {
-                       // Show an error message
-                       MessagingUtils
-                                       .messageDialog(
-                                                       "Datasource Compatibility Check failed",
-                                                       this,
-                                                       "The database schema for the chosen "
-                                                                       + "datasource '"
-                                                                       + cdmSource
-                                                                       + "' \n is not compatible for this version of the taxonomic editor. \n\n"
-                                                                       + message,
-                                                       null);
-
-                       monitor.setCanceled(true);
-               }
-
-       }
-
-       private void checkIsNonEmptyCdmDatabase(IProgressMonitor monitor) {
-               monitor.subTask("Checking if datasource is a non empty CDM database.");
-               boolean isDbEmpty = false;
-               try {
-                       isDbEmpty = cdmSource.isDbEmpty();
-               } catch (CdmSourceException e) {
-                       isDbEmpty = true;
-               }
-               if(isDbEmpty) {
-                       dbSchemaValidation = DbSchemaValidation.CREATE;
-               }
-       }
-
-       private boolean causeIsCancelationExceptionRecursive(Throwable throwable){
-               if(throwable == null){
-                       return false;
-               }else if(throwable instanceof CancellationException){
-                       return true;
-               }else{
-                       return causeIsCancelationExceptionRecursive(throwable.getCause());
-               }
-       }
-
-       private void checkDatabaseReachable(IProgressMonitor monitor) {
-               try {
-                       monitor.subTask("Checking if datasource is reachable.");
-                       cdmSource.checkConnection();
-                       monitor.worked(1);
-               } catch (CdmSourceException e) {
-                       MessagingUtils.messageDialog("Could not connect to chosen datasource",
-                                       this, "Reason: " + e.getMessage(), e);
-                       monitor.setCanceled(true);
-               }
-       }
+    private final Display display;
+    private final ICdmSource cdmSource;
+    private DbSchemaValidation dbSchemaValidation;
+    private final Resource applicationContextBean;
+
+
+    /**
+     * @param datasource
+     * @param dbSchemaValidation
+     * @param applicationContextBean
+     */
+    public CdmStoreConnector(Display display,
+            ICdmSource cdmSource,
+            DbSchemaValidation dbSchemaValidation,
+            Resource applicationContextBean) {
+        super("Connecting to datasource: " + cdmSource);
+        this.display = display;
+        this.cdmSource = cdmSource;
+        this.dbSchemaValidation = dbSchemaValidation;
+        this.applicationContextBean = applicationContextBean;
+    }
+
+
+
+    @Override
+    public IStatus run(final IProgressMonitor monitor) {
+
+        monitor.beginTask(getConnectionMessage(), 10);
+
+        // check if database is up and running
+        checkDatabaseReachable(monitor);
+
+        if (!monitor.isCanceled()) {
+            // check if the datasource actually holds data
+            checkIsNonEmptyCdmDatabase(monitor);
+        }
+
+        if (dbSchemaValidation != DbSchemaValidation.CREATE
+                && !monitor.isCanceled()) {
+            // if we do not create the datasource, we want to check if the
+            // datasource is compatible with this editor
+            checkDbSchemaVersionCompatibility(monitor);
+        }
+
+        // we are done with our low level checking and will free resources now
+        cdmSource.closeOpenConnections();
+
+        if (!monitor.isCanceled()) {
+            CdmStore.close(monitor);
+        }
+
+        ICdmApplicationConfiguration applicationController = null;
+
+        if (!monitor.isCanceled()) {
+            CdmProgressMonitorAdapter subprogressMonitor = CdmProgressMonitorAdapter
+                    .CreateSubMonitor(monitor, 7);
+            // This is where we instantiate the application controller
+            int oldPriority = Thread.currentThread().getPriority();
+            try {
+                Thread.currentThread().setPriority(10);
+                applicationController = getApplicationController(cdmSource,subprogressMonitor);
+            } catch (Exception e) {
+                if(! causeIsCancelationExceptionRecursive(e)){
+                    return new Status(IStatus.ERROR, "Could not connect to CDM Store", "An error occurred while trying to connect to datasource: " + cdmSource.getName(), e);
+                }
+            } finally {
+                monitor.done();
+                Thread.currentThread().setPriority(oldPriority);
+            }
+        }
+
+
+
+        if (!monitor.isCanceled()) {
+            CdmStore.setInstance(applicationController, cdmSource);
+
+            display.asyncExec(new Runnable() {
+                /*
+                 * (non-Javadoc)
+                 *
+                 * @see java.lang.Runnable#run()
+                 */
+                @Override
+                public void run() {
+                    authenticate();
+
+                    startContext();
+                }
+            });
+
+            MessagingUtils.info("Application context initialized.");
+            return Status.OK_STATUS;
+        } else {
+            // Show datasource view if not shown yet
+            display.asyncExec(new Runnable() {
+                /*
+                 * (non-Javadoc)
+                 *
+                 * @see java.lang.Runnable#run()
+                 */
+                @Override
+                public void run() {
+                    StoreUtil.showView(CdmDataSourceViewPart.ID);
+                }
+            });
+            return Status.CANCEL_STATUS;
+        }
+
+    }
+
+    public void start(final RemotingLoginDialog loginDialog) {
+        // hide login dialog and start connection dialog
+        loginDialog.setMessage(null);
+        loginDialog.hide(true);
+
+
+        ProgressMonitorDialog dialog = new ProgressMonitorDialog(StoreUtil.getShell());
+
+        try {
+            dialog.run(true, true, new IRunnableWithProgress() {
+                @Override
+                public void run(final IProgressMonitor monitor) {
+                    try {
+                        monitor.beginTask(getConnectionMessage(), 7);
+
+                        // check if database is up and running
+                        checkDatabaseReachable(monitor);
+
+                        // check if the datasource actually holds data
+                        checkIsNonEmptyCdmDatabase(monitor);
+
+                        if (dbSchemaValidation != DbSchemaValidation.CREATE) {
+                            // if we do not create the datasource, we want to check if the
+                            // datasource is compatible with this editor
+                            checkDbSchemaVersionCompatibility(monitor);
+                        }
+
+                        // we are done with our low level checking and will free resources now
+                        cdmSource.closeOpenConnections();
+
+                        display.syncExec(new Runnable() {
+                            /*
+                             * (non-Javadoc)
+                             *
+                             * @see java.lang.Runnable#run()
+                             */
+                            @Override
+                            public void run() {
+                                // close the current context
+                                CdmStore.close(monitor, false);
+                            }
+                        });
+
+                        ICdmApplicationConfiguration applicationController = null;
+
+                        if (!monitor.isCanceled()) {
+                            CdmProgressMonitorAdapter subprogressMonitor = CdmProgressMonitorAdapter
+                                    .CreateSubMonitor(monitor, 3);
+                            // genrerate new application controller
+                            applicationController = getApplicationController(cdmSource,subprogressMonitor);
+                        }
+
+
+                        if (!monitor.isCanceled()) {
+                            CdmStore.setInstance(applicationController, cdmSource);
+                            monitor.subTask("Authenticating user");
+                            display.syncExec(new Runnable() {
+                                /*
+                                 * (non-Javadoc)
+                                 *
+                                 * @see java.lang.Runnable#run()
+                                 */
+                                @Override
+                                public void run() {
+
+                                    try {
+                                        // create new security context
+                                        CdmStore.getLoginManager().doAuthenticate(loginDialog.getUsername(), loginDialog.getPassword());
+                                        loginDialog.onComplete();
+                                        CdmStore.getContextManager().notifyContextStart();
+                                        Rank.initDefaultTerms();
+                                    } catch(CdmAuthenticationException cae) {
+                                        loginDialog.hide(false);
+                                        loginDialog.setMessage(cae.getMessage());
+                                    }
+
+                                }
+                            });
+                        } else {
+                            throw new RuntimeException("Login cancelled");
+                        }
+                    } finally {
+                        monitor.done();
+                    }
+                }
+            });
+        } catch (InvocationTargetException e) {
+            loginDialog.hide(false);
+            loginDialog.setMessage(e.getMessage());
+        } catch (InterruptedException e) {
+            loginDialog.hide(false);
+            loginDialog.setMessage(e.getMessage());
+        }
+    }
+
+
+    private ICdmApplicationConfiguration getApplicationController(ICdmSource cdmSource, CdmProgressMonitorAdapter subprogressMonitor) {
+        if(cdmSource instanceof ICdmDataSource) {
+            return  CdmApplicationController.NewInstance(applicationContextBean,
+                    (ICdmDataSource)cdmSource,
+                    dbSchemaValidation,
+                    false,
+                    subprogressMonitor);
+        } else if(cdmSource instanceof ICdmRemoteSource) {
+            return CdmApplicationRemoteController.NewInstance((ICdmRemoteSource)cdmSource,
+                    subprogressMonitor,
+                    null);
+        } else {
+            throw new UnsupportedOperationException("Cannot create application controller for " + cdmSource.getName());
+        }
+    }
+
+    private void authenticate() {
+        LoginDialog saloginDialog = new LoginDialog(StoreUtil.getShell());
+        saloginDialog.open();
+    }
+
+    private void startContext() {
+        CdmStore.getContextManager().notifyContextStart();
+    }
+
+    /**
+     * @return
+     */
+    private String getConnectionMessage() {
+        return cdmSource.getConnectionMessage();
+    }
+
+    /**
+     * @return
+     * @throws SQLException
+     */
+    private void checkDbSchemaVersionCompatibility(IProgressMonitor monitor) {
+        monitor.subTask("Checking if datasource is compatible with this editor.");
+        String dbSchemaVersion;
+
+        String message = null;
+        try {
+            dbSchemaVersion = cdmSource.getDbSchemaVersion();
+            // we assume that empty dbSchemaVersion means an empty database and
+            // skip version checking
+
+            if(dbSchemaVersion != null) {
+                int compareVersion = CdmMetaData.compareVersion(dbSchemaVersion, CdmMetaData.getDbSchemaVersion(), 3, null);
+                // if the datasource version is greater than the taxeditor compatible version then the taxeditor needs to
+                // be updated else the datasource needs to be updated
+                if(compareVersion > 0) {
+                    message = "Please update the Taxonomic Editor (Help->Check for Updates) or choose a compatible datasource";
+                } else if (compareVersion < 0) {
+                    message = "Please update the chosen datasource or choose a new data source to connect to in the Datasource View.";
+                }
+            }
+            monitor.worked(1);
+        } catch (CdmSourceException e) {
+            //
+        }
+
+        if (message != null) {
+            // Show an error message
+            MessagingUtils
+            .messageDialog(
+                    "Datasource Compatibility Check failed",
+                    this,
+                    "The database schema for the chosen "
+                            + "datasource '"
+                            + cdmSource
+                            + "' \n is not compatible for this version of the taxonomic editor. \n\n"
+                            + message,
+                            null);
+
+            monitor.setCanceled(true);
+        }
+
+    }
+
+    private void checkIsNonEmptyCdmDatabase(IProgressMonitor monitor) {
+        monitor.subTask("Checking if datasource is a non empty CDM database.");
+        boolean isDbEmpty = false;
+        try {
+            isDbEmpty = cdmSource.isDbEmpty();
+        } catch (CdmSourceException e) {
+            isDbEmpty = true;
+        }
+        if(isDbEmpty) {
+            dbSchemaValidation = DbSchemaValidation.CREATE;
+        }
+    }
+
+    private boolean causeIsCancelationExceptionRecursive(Throwable throwable){
+        if(throwable == null){
+            return false;
+        }else if(throwable instanceof CancellationException){
+            return true;
+        }else{
+            return causeIsCancelationExceptionRecursive(throwable.getCause());
+        }
+    }
+
+    private void checkDatabaseReachable(IProgressMonitor monitor) {
+        try {
+            monitor.subTask("Checking if datasource is reachable.");
+            cdmSource.checkConnection();
+            monitor.worked(1);
+        } catch (CdmSourceException e) {
+            MessagingUtils.messageDialog("Could not connect to chosen datasource",
+                    this, "Reason: " + e.getMessage(), e);
+            monitor.setCanceled(true);
+        }
+    }
+
+
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmUIDataChangeService.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmUIDataChangeService.java
new file mode 100644 (file)
index 0000000..6757ad9
--- /dev/null
@@ -0,0 +1,52 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.store;
+
+import org.eclipse.swt.widgets.Display;
+
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
+import eu.etaxonomy.cdm.api.application.CdmDataChangeService;
+import eu.etaxonomy.cdm.api.application.ICdmChangeListener;
+
+/**
+ * @author cmathew
+ * @date 18 Jun 2015
+ *
+ */
+public class CdmUIDataChangeService extends CdmDataChangeService {
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.store.ICdmDataChangeService#fireChangeEvent(eu.etaxonomy.cdm.api.application.CdmChangeEvent, boolean)
+     */
+    @Override
+    public void fireChangeEvent(final CdmChangeEvent event, boolean async) {
+
+        for(final ICdmChangeListener listener : listeners) {
+            // Update the user interface asynchronously
+            if(async) {
+                Display.getDefault().asyncExec(new Runnable() {
+                    @Override
+                    public void run() {
+                        listener.onChange(event);
+                    }
+                });
+            } else {
+                // Update the user interface synchronously
+                Display.getDefault().syncExec(new Runnable() {
+                    @Override
+                    public void run() {
+                        listener.onChange(event);
+                    }
+                });
+            }
+        }
+    }
+
+}
index d7ca5a0d06d1916e81d7a0eaa801f7ea9874e362..822f4e8108e7760eac00e56756b64bf937ae8a32 100644 (file)
@@ -1,12 +1,12 @@
 // $Id$
 /**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
-* http://www.e-taxonomy.eu
-* 
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
 
 package eu.etaxonomy.taxeditor.store;
 
@@ -24,6 +24,7 @@ import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchListener;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.XMLMemento;
+import org.eclipse.ui.internal.Workbench;
 
 import eu.etaxonomy.taxeditor.model.IContextListener;
 import eu.etaxonomy.taxeditor.model.MementoHelper;
@@ -38,226 +39,237 @@ import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
  * @version 1.0
  */
 public class ContextManager implements IWorkbenchListener{
-       
-       private ListenerList contextListeners = new ListenerList();
-
-       private IMemento memento;
-               
-       /**
-        * <p>Constructor for ContextManager.</p>
-        */
-       protected ContextManager() {
-               PlatformUI.getWorkbench().addWorkbenchListener(this);
-       }
-       
-       /**
-        * <p>addContextListener</p>
-        *
-        * @param listener a {@link eu.etaxonomy.taxeditor.model.IContextListener} object.
-        */
-       public void addContextListener(IContextListener listener){
-               contextListeners.add(listener);
-       }
-       
-       /**
-        * <p>removeContextListener</p>
-        *
-        * @param listener a {@link eu.etaxonomy.taxeditor.model.IContextListener} object.
-        */
-       public void removeContextListener(IContextListener listener) {
-               contextListeners.remove(listener);
-       }
-       
-       /**
-        * <p>notifyContextStart</p>
-        */
-       public void notifyContextStart() {
-               MessagingUtils.info("Notifying context listeners, that the context has started.");
-               ProgressMonitorDialog dialog = new ProgressMonitorDialog(StoreUtil.getShell());
-               
-               try {
-                       dialog.run(false, false, new IRunnableWithProgress() {
-                               /* (non-Javadoc)
-                                * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
-                                */
-                               @Override
-                               public void run(IProgressMonitor monitor)
-                                               throws InvocationTargetException, InterruptedException {
-                                       monitor.beginTask("Starting context", contextListeners.size());
-                                       
-                                       
-                                       readMemento();                          
-                                       
-                                       for(final Object listener : contextListeners.getListeners()){
-                                               ((IContextListener) listener).contextStart(memento, monitor);
-                                               monitor.worked(1);
-                                       }
-                                       monitor.done();
-                               }
-                       });
-               } catch (InvocationTargetException e) {
-                       MessagingUtils.error(getClass(), e);
-               } catch (InterruptedException e) {
-                       MessagingUtils.error(getClass(), e);
-               }
-       }
-       
-
-       /**
-        * 
-        */
-       public void notifyContextRefresh() {
-               MessagingUtils.info("Notifying context listeners, that the context needs to be refreshed.");
-               ProgressMonitorDialog dialog = new ProgressMonitorDialog(StoreUtil.getShell());
-               
-               try {
-                       dialog.run(false, false, new IRunnableWithProgress() {
-                               /* (non-Javadoc)
-                                * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
-                                */
-                               @Override
-                               public void run(IProgressMonitor monitor)
-                                               throws InvocationTargetException, InterruptedException {
-                                       monitor.beginTask("Refreshing context", contextListeners.size());                       
-                                       
-                                       for(final Object listener : contextListeners.getListeners()){
-                                               ((IContextListener) listener).contextRefresh(monitor);
-                                               monitor.worked(1);
-                                       }
-                                       monitor.done();
-                               }
-                       });
-               } catch (InvocationTargetException e) {
-                       MessagingUtils.error(getClass(), e);
-               } catch (InterruptedException e) {
-                       MessagingUtils.error(getClass(), e);
-               }
-       }
-       
-       /**
-        * <p>notifyContextAboutToStop</p>
-        *
-        * @param monitor a {@link org.eclipse.core.runtime.IProgressMonitor} object.
-        */
-       public void notifyContextAboutToStop(final IProgressMonitor monitor){
-
-               IProgressMonitor subMonitor = StoreUtil.getSubProgressMonitor(monitor, 1);
-
-               subMonitor.beginTask("Stoping context", contextListeners.size());
-               // we are creating the memento here; even if the context is not stopped
-               createMemento();
-               
-               for(final Object listener : contextListeners.getListeners()){
-                       ((IContextListener) listener).contextAboutToStop(memento, subMonitor);
-                       subMonitor.worked(1);
-               }       
-               
-               subMonitor.done();
-       }
-       
-       /**
-        * <p>notifyContextStop</p>
-        *
-        * @param monitor a {@link org.eclipse.core.runtime.IProgressMonitor} object.
-        */
-       public void notifyContextStop(IProgressMonitor monitor) {
-               
-               IProgressMonitor subMonitor = StoreUtil.getSubProgressMonitor(monitor, 1);
-
-               subMonitor.beginTask("Stoping context", contextListeners.size());
-               MessagingUtils.info("Notifying context listeners, that the context has stopped.");
-                               
-               for(Object listener : contextListeners.getListeners()){
-                       ((IContextListener) listener).contextStop(memento, subMonitor);
-                       subMonitor.worked(1);
-               }       
-
-               saveMemento();
-               subMonitor.done();
-       }
-       
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IWorkbenchListener#preShutdown(org.eclipse.ui.IWorkbench, boolean)
-        */
-       /** {@inheritDoc} */
-       @Override
-       public boolean preShutdown(IWorkbench workbench, boolean forced) {
-
-               createMemento();
-               
-               IProgressMonitor monitor = null;
-               
-               for(Object listener : contextListeners.getListeners()){
-                       ((IContextListener) listener).workbenchShutdown(memento, monitor);
-               }       
-               
-               saveMemento();
-               
-               // return true in any case, otherwise the application will not stop
-               return true;
-       }
-
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IWorkbenchListener#postShutdown(org.eclipse.ui.IWorkbench)
-        */
-       /** {@inheritDoc} */
-       @Override
-       public void postShutdown(IWorkbench workbench) {
-               
-               
-       }
-       
-       
-       private void readMemento(){
-               try {
-                       memento = MementoHelper.readMementoFromFile(getStateFileForCurrentDatabase());
-               } catch (FileNotFoundException e) {
-                       // no memento -> no previous state
-                       MessagingUtils.info("No state file for datasource");
-               }
-       }
-       
-       private void createMemento(){
-               
-               if (CdmStore.getActiveCdmSource() != null) {
-                       
-                       try {
-                               String name = CdmStore.getActiveCdmSource().getName();
-                               name = name.trim();
-                               name = name.replace(" ", "_");
-                               memento = XMLMemento.createWriteRoot(name);
-                       
-                               MessagingUtils.info("DataSource found. Memento created.");
-                       } catch (Exception e) {
-                               // The memento could not be created, but a not closable editor is avoided for this case.
-                               MessagingUtils.error(this.getClass(), "The memento could not be created", e);
-                       }
-               } else {
-                       MessagingUtils.info("Not storing state data, because no DataSource present.");
-               }
-               
-       }
-       
-       private boolean saveMemento(){
-               return MementoHelper.saveMementoToFile(memento, getStateFileForCurrentDatabase()) != null;
-       }
-       
-       /**
-        * <p>getStateFileForCurrentDatabase</p>
-        *
-        * @return a {@link java.io.File} object.
-        */
-       protected File getStateFileForCurrentDatabase() {
-               if(CdmStore.getActiveCdmSource() == null){
-                       return null;
-               }
-               
-               IPath path = TaxeditorStorePlugin.getDefault().getStateLocation();
-               if (path == null) {
-                       return null;
-               }
-               path = path.append("editor_state_" + CdmStore.getActiveCdmSource().getName() + ".xml");
-               return path.toFile();
-       }
+
+    private final ListenerList contextListeners = new ListenerList();
+
+    private IMemento memento;
+
+    /**
+     * <p>Constructor for ContextManager.</p>
+     */
+    protected ContextManager() {
+        if(Workbench.getInstance() != null) {
+            PlatformUI.getWorkbench().addWorkbenchListener(this);
+        }
+    }
+
+    /**
+     * <p>addContextListener</p>
+     *
+     * @param listener a {@link eu.etaxonomy.taxeditor.model.IContextListener} object.
+     */
+    public void addContextListener(IContextListener listener){
+        contextListeners.add(listener);
+    }
+
+    /**
+     * <p>removeContextListener</p>
+     *
+     * @param listener a {@link eu.etaxonomy.taxeditor.model.IContextListener} object.
+     */
+    public void removeContextListener(IContextListener listener) {
+        contextListeners.remove(listener);
+    }
+
+    public void notifyContextStartWithoutDialog(IProgressMonitor monitor) {
+        MessagingUtils.info("Notifying context listeners, that the context has started.");
+
+        readMemento();
+
+        for(final Object listener : contextListeners.getListeners()){
+            ((IContextListener) listener).contextStart(memento, monitor);
+        }
+    }
+    /**
+     * <p>notifyContextStart</p>
+     */
+    public void notifyContextStart() {
+        MessagingUtils.info("Notifying context listeners, that the context has started.");
+        ProgressMonitorDialog dialog = new ProgressMonitorDialog(StoreUtil.getShell());
+
+        try {
+            dialog.run(false, false, new IRunnableWithProgress() {
+                /* (non-Javadoc)
+                 * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
+                 */
+                @Override
+                public void run(IProgressMonitor monitor)
+                        throws InvocationTargetException, InterruptedException {
+                    monitor.beginTask("Starting context", contextListeners.size());
+
+
+                    readMemento();
+
+                    for(final Object listener : contextListeners.getListeners()){
+                        ((IContextListener) listener).contextStart(memento, monitor);
+                        monitor.worked(1);
+                    }
+                    monitor.done();
+                }
+            });
+        } catch (InvocationTargetException e) {
+            MessagingUtils.error(getClass(), e);
+        } catch (InterruptedException e) {
+            MessagingUtils.error(getClass(), e);
+        }
+    }
+
+
+    /**
+     *
+     */
+    public void notifyContextRefresh() {
+        MessagingUtils.info("Notifying context listeners, that the context needs to be refreshed.");
+        ProgressMonitorDialog dialog = new ProgressMonitorDialog(StoreUtil.getShell());
+
+        try {
+            dialog.run(false, false, new IRunnableWithProgress() {
+                /* (non-Javadoc)
+                 * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
+                 */
+                @Override
+                public void run(IProgressMonitor monitor)
+                        throws InvocationTargetException, InterruptedException {
+                    monitor.beginTask("Refreshing context", contextListeners.size());
+
+                    for(final Object listener : contextListeners.getListeners()){
+                        ((IContextListener) listener).contextRefresh(monitor);
+                        monitor.worked(1);
+                    }
+                    monitor.done();
+                }
+            });
+        } catch (InvocationTargetException e) {
+            MessagingUtils.error(getClass(), e);
+        } catch (InterruptedException e) {
+            MessagingUtils.error(getClass(), e);
+        }
+    }
+
+    /**
+     * <p>notifyContextAboutToStop</p>
+     *
+     * @param monitor a {@link org.eclipse.core.runtime.IProgressMonitor} object.
+     */
+    public void notifyContextAboutToStop(final IProgressMonitor monitor){
+
+        IProgressMonitor subMonitor = StoreUtil.getSubProgressMonitor(monitor, 1);
+
+        subMonitor.beginTask("Stoping context", contextListeners.size());
+        // we are creating the memento here; even if the context is not stopped
+        createMemento();
+
+        for(final Object listener : contextListeners.getListeners()){
+            ((IContextListener) listener).contextAboutToStop(memento, subMonitor);
+            subMonitor.worked(1);
+        }
+
+        subMonitor.done();
+    }
+
+    /**
+     * <p>notifyContextStop</p>
+     *
+     * @param monitor a {@link org.eclipse.core.runtime.IProgressMonitor} object.
+     */
+    public void notifyContextStop(IProgressMonitor monitor) {
+
+        IProgressMonitor subMonitor = StoreUtil.getSubProgressMonitor(monitor, 1);
+
+        subMonitor.beginTask("Stoping context", contextListeners.size());
+        MessagingUtils.info("Notifying context listeners, that the context has stopped.");
+
+        for(Object listener : contextListeners.getListeners()){
+            ((IContextListener) listener).contextStop(memento, subMonitor);
+            subMonitor.worked(1);
+        }
+
+        saveMemento();
+        subMonitor.done();
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IWorkbenchListener#preShutdown(org.eclipse.ui.IWorkbench, boolean)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public boolean preShutdown(IWorkbench workbench, boolean forced) {
+
+        createMemento();
+
+        IProgressMonitor monitor = null;
+
+        for(Object listener : contextListeners.getListeners()){
+            ((IContextListener) listener).workbenchShutdown(memento, monitor);
+        }
+
+        saveMemento();
+
+        // return true in any case, otherwise the application will not stop
+        return true;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IWorkbenchListener#postShutdown(org.eclipse.ui.IWorkbench)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public void postShutdown(IWorkbench workbench) {
+
+
+    }
+
+
+    private void readMemento(){
+        try {
+            memento = MementoHelper.readMementoFromFile(getStateFileForCurrentDatabase());
+        } catch (FileNotFoundException e) {
+            // no memento -> no previous state
+            MessagingUtils.info("No state file for datasource");
+        }
+    }
+
+    private void createMemento(){
+
+        if (CdmStore.getActiveCdmSource() != null) {
+
+            try {
+                String name = CdmStore.getActiveCdmSource().getName();
+                name = name.trim();
+                name = name.replace(" ", "_");
+                memento = XMLMemento.createWriteRoot(name);
+
+                MessagingUtils.info("DataSource found. Memento created.");
+            } catch (Exception e) {
+                // The memento could not be created, but a not closable editor is avoided for this case.
+                MessagingUtils.error(this.getClass(), "The memento could not be created", e);
+            }
+        } else {
+            MessagingUtils.info("Not storing state data, because no DataSource present.");
+        }
+
+    }
+
+    private boolean saveMemento(){
+        return MementoHelper.saveMementoToFile(memento, getStateFileForCurrentDatabase()) != null;
+    }
+
+    /**
+     * <p>getStateFileForCurrentDatabase</p>
+     *
+     * @return a {@link java.io.File} object.
+     */
+    protected File getStateFileForCurrentDatabase() {
+        if(CdmStore.getActiveCdmSource() == null){
+            return null;
+        }
+
+        IPath path = TaxeditorStorePlugin.getDefault().getStateLocation();
+        if (path == null) {
+            return null;
+        }
+        path = path.append("editor_state_" + CdmStore.getActiveCdmSource().getName() + ".xml");
+        return path.toFile();
+    }
 
 }
index b01cd9a978f456ed467e020e79a3a4f890d9391e..f56a8293dc6d98e76f4f024b9abc8e668cfe4874 100644 (file)
@@ -23,6 +23,7 @@ import org.springframework.security.core.Authentication;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.context.SecurityContextHolder;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.common.Group;
@@ -45,8 +46,12 @@ public class LoginManager extends Observable implements IConversationEnabled, IC
 
        private ConversationHolder conversation;
 
+       public static final String INCORRECT_CREDENTIALS_MESSAGE = "Login and/or Password incorrect";
+       public static final String ACCOUNT_LOCKED_MESSAGE = "Account is locked";
+       public static final String EMPTY_CREDENTIALS_MESSAGE = "Login and/or Password empty";
+
        public LoginManager(){
-               CdmStore.getContextManager().addContextListener(this);
+           CdmStore.getContextManager().addContextListener(this);
        }
 
        /**
@@ -57,57 +62,65 @@ public class LoginManager extends Observable implements IConversationEnabled, IC
         */
        public boolean authenticate(String username, String password){
 
-               // close all open editors
-               if(!AbstractUtility.closeAll()){
-                       return false;
-               }
-
-
-               try{
-                       SecurityContextHolder.clearContext();
-
-                       Authentication lastAuthentication = CdmStore.getCurrentAuthentiation();
-
-                       UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(username, password);
-                       Authentication authentication = CdmStore.getAuthenticationManager().authenticate(token);
+           // close all open editors
+           if(!AbstractUtility.closeAll()){
+               return false;
+           }
 
-                       User user = (User) authentication.getPrincipal();
-                       /* circumventing problem with hibernate not refreshing the transient collection authorities in this case,
-                        * see http://dev.e-taxonomy.eu/trac/ticket/4053 */
-                       user.initAuthorities();
 
-                       if(logger.isDebugEnabled()){
-                               StringBuilder gaText = new StringBuilder();
-                               String indent = "    ";
-                               Set<GrantedAuthority> gaSet = user.getGrantedAuthorities();
-                               _logGrantedAuthotities(gaText, indent, gaSet);
-                               for(Group gr : user.getGroups()){
-                                       gaText.append(indent).append("gr[").append(gr.hashCode()).append("] \"").append(gr.getName()).append("\" ").append(gr.toString()).append("\n");
-                                       _logGrantedAuthotities(gaText, indent + indent, gr.getGrantedAuthorities());
-                               }
-                               logger.debug("User authenticated: " + user.getUsername() + "\n" + gaText.toString());
-                       }
+           try{
+               doAuthenticate(username, password);
+           } catch (CdmAuthenticationException e) {
+               MessagingUtils.warningDialog("Could not authenticate", this, e.getMessage());
+               return false;
+        }
+           return true;
+       }
 
-                       SecurityContextHolder.getContext().setAuthentication(authentication);
+       public void doAuthenticate(String username, String password) throws CdmAuthenticationException {
+           try {
+               SecurityContextHolder.clearContext();
+               Authentication lastAuthentication = CdmStore.getCurrentAuthentiation();
+
+               UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(username, password);
+               Authentication authentication = CdmStore.getAuthenticationManager().authenticate(token);
+
+               User user = (User) authentication.getPrincipal();
+               /* circumventing problem with hibernate not refreshing the transient collection authorities in this case,
+                * see http://dev.e-taxonomy.eu/trac/ticket/4053 */
+               user.initAuthorities();
+
+               if(logger.isDebugEnabled()){
+                   StringBuilder gaText = new StringBuilder();
+                   String indent = "    ";
+                   Set<GrantedAuthority> gaSet = user.getGrantedAuthorities();
+                   _logGrantedAuthotities(gaText, indent, gaSet);
+                   for(Group gr : user.getGroups()){
+                       gaText.append(indent).append("gr[").append(gr.hashCode()).append("] \"").append(gr.getName()).append("\" ").append(gr.toString()).append("\n");
+                       _logGrantedAuthotities(gaText, indent + indent, gr.getGrantedAuthorities());
+                   }
+                   logger.debug("User authenticated: " + user.getUsername() + "\n" + gaText.toString());
+               }
+
+               authentication = new UsernamePasswordAuthenticationToken(user,password, authentication.getAuthorities());
+               SecurityContextHolder.getContext().setAuthentication(authentication);
+               CdmApplicationState.setCurrentSecurityContext(SecurityContextHolder.getContext());
+
+               if(!authentication.equals(lastAuthentication)){
+                   this.setChanged();
+                   this.notifyObservers();
+               }
+           } catch(BadCredentialsException e){
+               throw new CdmAuthenticationException(INCORRECT_CREDENTIALS_MESSAGE, e);
+           } catch(LockedException e){
+               throw new CdmAuthenticationException(ACCOUNT_LOCKED_MESSAGE, e);
+           } catch(IllegalArgumentException e){
+               throw new CdmAuthenticationException(EMPTY_CREDENTIALS_MESSAGE, e);
+           }
 
-                       if(!authentication.equals(lastAuthentication)){
-                               this.setChanged();
-                               this.notifyObservers();
-                       }
-                       return true;
-               }
-               catch(BadCredentialsException e){
-                       MessagingUtils.warningDialog("Could not authenticate", this, "Could not authenticate. Reason: Bad Credentials.");
-               }
-               catch(LockedException e){
-                       MessagingUtils.warningDialog("Could not authenticate", this, "Could not authenticate. Reason: Account is locked.");
-               }
-               catch(IllegalArgumentException e){
-                       MessagingUtils.warningDialog("Could not authenticate", this, "Could not authenticate. Reason: Username and/or Password empty.");
-               }
-               return false;
        }
 
+
        private void _logGrantedAuthotities(StringBuilder gaText, String indent,
                        Set<GrantedAuthority> gaSet) {
                for(GrantedAuthority ga : gaSet){
@@ -121,7 +134,7 @@ public class LoginManager extends Observable implements IConversationEnabled, IC
         * @return a {@link eu.etaxonomy.cdm.model.common.User} object.
         */
        public User getAuthenticatedUser(){
-               Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
+               Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
 
                if(authentication != null
                                && authentication.getPrincipal() != null
index 4025e4197ad193603deba7e8dc1218506301b9f6..e4dab75eb03d872b5ea8c8efe57cb9b3bf3c3fb5 100644 (file)
@@ -20,6 +20,7 @@ import org.eclipse.swt.widgets.Display;
 
 import eu.etaxonomy.cdm.api.service.IAgentService;
 import eu.etaxonomy.cdm.api.service.IGroupService;
+import eu.etaxonomy.cdm.api.service.IMediaService;
 import eu.etaxonomy.cdm.api.service.INameService;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.IReferenceService;
@@ -35,10 +36,9 @@ import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.RelationshipBase;
 import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.name.NameRelationship;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
@@ -65,10 +65,7 @@ public class SearchManager {
        public List<TaxonNameBase> findNames(IIdentifiableEntityServiceConfigurator configurator){
                if(checkLargeResult(CdmStore.getService(INameService.class).countByTitle(configurator))){
                        List<TaxonNameBase> records = CdmStore.getService(INameService.class).findByTitle(configurator).getRecords();
-                       TaxonNameBase uuidSearchResult = addUuidSearchResults(configurator, INameService.class);
-            if(uuidSearchResult!=null){
-                records.add(uuidSearchResult);
-            }
+                       addUuidSearchResults(records, configurator, INameService.class);
             return records;
                }
                return NO_RESULTS;
@@ -99,10 +96,7 @@ public class SearchManager {
        public List<Reference> findReferences(IIdentifiableEntityServiceConfigurator configurator){
                if(checkLargeResult(CdmStore.getService(IReferenceService.class).countByTitle(configurator))){
                        List<Reference> records = CdmStore.getService(IReferenceService.class).findByTitle(configurator).getRecords();
-                       Reference uuidSearchResult = addUuidSearchResults(configurator, IReferenceService.class);
-            if(uuidSearchResult!=null){
-                records.add(uuidSearchResult);
-            }
+                       addUuidSearchResults(records, configurator, IReferenceService.class);
             return records;
                }
                return NO_RESULTS;
@@ -111,10 +105,7 @@ public class SearchManager {
        public List<AgentBase> findAgents(IIdentifiableEntityServiceConfigurator configurator){
                if(checkLargeResult(CdmStore.getService(IAgentService.class).countByTitle(configurator))){
                        List<AgentBase> records = CdmStore.getService(IAgentService.class).findByTitle(configurator).getRecords();
-                       AgentBase uuidSearchResult = addUuidSearchResults(configurator, IAgentService.class);
-                       if(uuidSearchResult!=null){
-                           records.add(uuidSearchResult);
-                       }
+                       addUuidSearchResults(records, configurator, IAgentService.class);
             return records;
                }
                return NO_RESULTS;
@@ -122,18 +113,21 @@ public class SearchManager {
 
     /**
      * Check search string if it is a {@link UUID} and, if <code>true</code>, search for the corresponding entity.
+     * @param records the list to which the search results are added
      * @param configurator the configurator holding the search string
      * @param service the service to use for searching
      */
-    private <T extends ICdmBase> T addUuidSearchResults(IIdentifiableEntityServiceConfigurator configurator, Class<? extends IService<T>> service) {
+    private <T extends ICdmBase> void addUuidSearchResults(List<T> records, IIdentifiableEntityServiceConfigurator configurator, Class<? extends IService<T>> service) {
         String titleSearchString = configurator.getTitleSearchString();
                try {
                    UUID uuid = UUID.fromString(titleSearchString);
-                   return CdmStore.getService(service).find(uuid);
+                   T foundRecord = CdmStore.getService(service).find(uuid);
+                   if(foundRecord!=null){
+                       records.add(foundRecord);
+                   }
                } catch (IllegalArgumentException e) {
                    //search string was no UUID
                }
-               return null;
     }
 
        @SuppressWarnings("unchecked")
@@ -168,36 +162,33 @@ public class SearchManager {
         */
        public List<SpecimenOrObservationBase> findOccurrences(IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase> configurator, boolean showFieldUnits){
            List<SpecimenOrObservationBase> records = new ArrayList<SpecimenOrObservationBase>();
-               if(configurator.getClazz()==null){
-                   if(showFieldUnits){
-                       configurator.setClazz(SpecimenOrObservationBase.class);
-                   }
-                   else{
-                       configurator.setClazz(DerivedUnit.class);
-                   }
+               final List<String> BASE_OCCURRENCE_INIT_STRATEGY = Arrays.asList(new String[] {
+                       "collection",
+                       "descriptions",
+                       "identifiers",
+                       "derivationEvents.originals",
+                       "derivedFrom.originals",
+                       "gatheringEvent.country.representations",
+                       "gatheringEvent.collector",
+                       "gatheringEvent.locality",
+                       "descriptions.descriptionElements",
+                       "kindOfUnit",
+                       "amplificationResults",
+                       "sequences.singleReadAlignments",
+                       "mediaSpecimen"
+               });
+
+               List<String> occurrencePropertyPaths = new ArrayList<String>();
+               occurrencePropertyPaths.addAll(BASE_OCCURRENCE_INIT_STRATEGY);
+               for(String propertyPath:BASE_OCCURRENCE_INIT_STRATEGY) {
+                   occurrencePropertyPaths.add("derivationEvents.derivatives." + propertyPath);
                }
-               if(configurator.getClazz().equals(SpecimenOrObservationBase.class)){
-                   //get FieldUnits + DerivedUnits
-                   configurator.setClazz(DerivedUnit.class);
-                   int derivedUnitCount = CdmStore.getService(IOccurrenceService.class).countOccurrences(configurator);
-                   configurator.setClazz(FieldUnit.class);
-                   int fieldUnitCount = CdmStore.getService(IOccurrenceService.class).countOccurrences(configurator);
-
-                   if(checkLargeResult(derivedUnitCount+fieldUnitCount)){
-                       configurator.setClazz(DerivedUnit.class);
-                       records.addAll(CdmStore.getService(IOccurrenceService.class).findByTitle(configurator).getRecords());
-                       configurator.setClazz(FieldUnit.class);
-                       records.addAll(CdmStore.getService(IOccurrenceService.class).findByTitle(configurator).getRecords());
-                   }
+               configurator.setPropertyPaths(occurrencePropertyPaths);
 
-               }
-               else if(checkLargeResult(CdmStore.getService(IOccurrenceService.class).countOccurrences(configurator))){
+               if(checkLargeResult(CdmStore.getService(IOccurrenceService.class).countOccurrences(configurator))){
                        records = CdmStore.getService(IOccurrenceService.class).findByTitle(configurator).getRecords();
                }
-               SpecimenOrObservationBase uuidSearchResult = addUuidSearchResults(configurator, IOccurrenceService.class);
-        if(uuidSearchResult!=null){
-            records.add(uuidSearchResult);
-        }
+               addUuidSearchResults(records, configurator, IOccurrenceService.class);
                return records;
        }
 
@@ -205,10 +196,7 @@ public class SearchManager {
                String userNameSearchString = sqlizeTitleSearchString(configurator);
                // TODO why are users not identifiable entities?
                List<User> records = CdmStore.getService(IUserService.class).listByUsername(userNameSearchString, null, null, null, null, null, null);
-               User uuidSearchResult = addUuidSearchResults(configurator, IUserService.class);
-               if(uuidSearchResult!=null){
-                   records.add(uuidSearchResult);
-               }
+               addUuidSearchResults(records, configurator, IUserService.class);
         return records;
        }
 
@@ -217,16 +205,17 @@ public class SearchManager {
                String groupNameSearchString = sqlizeTitleSearchString(configurator);
                // TODO why are groups not identifiable entities?
                List<Group> records = CdmStore.getService(IGroupService.class).listByName(groupNameSearchString, null, null, null, null, null, null);
-               Group uuidSearchResult = addUuidSearchResults(configurator, IGroupService.class);
-               if(uuidSearchResult!=null){
-                   records.add(uuidSearchResult);
-               }
+               addUuidSearchResults(records, configurator, IGroupService.class);
         return records;
        }
 
 
        private boolean checkLargeResult(int count) {
-               if(count > MAX_RESULTS_BEFORE_WARNING){
+           return checkLargeResult(count, MAX_RESULTS_BEFORE_WARNING);
+       }
+
+       private boolean checkLargeResult(int count, int maxBeforWarning) {
+               if(count > maxBeforWarning){
                        return MessageDialog.openConfirm(Display.getDefault().getActiveShell(), "Large result expected",
                                        String.format("The current search will return %s objects. This will " +
                                                        "take a long time and/or might render the editor unusable. Please consider refining your search.", count));
@@ -242,14 +231,20 @@ public class SearchManager {
        public List findTaxa(IIdentifiableEntityServiceConfigurator configurator) {
                if(checkLargeResult(CdmStore.getService(ITaxonService.class).countByTitle(configurator))){
                        List<TaxonBase> records = CdmStore.getService(ITaxonService.class).findByTitle(configurator).getRecords();
-                       TaxonBase uuidSearchResult = addUuidSearchResults(configurator, ITaxonService.class);
-                       if(uuidSearchResult!=null){
-                           records.add(uuidSearchResult);
-                       }
+                       addUuidSearchResults(records, configurator, ITaxonService.class);
             return records;
                }
                return NO_RESULTS;
        }
 
+       public List findMedia(IIdentifiableEntityServiceConfigurator configurator) {
+        if(checkLargeResult(CdmStore.getService(IMediaService.class).countByTitle(configurator))){
+            List<Media> records = CdmStore.getService(IMediaService.class).findByTitle(configurator).getRecords();
+            addUuidSearchResults(records, configurator, IMediaService.class);
+            return records;
+        }
+        return NO_RESULTS;
+    }
+
 
 }
index 47650d4e1103c934781539764713f91a62437cf3..822e562b7569b7119441b6ecf0801e9e6b74f1b0 100644 (file)
@@ -52,8 +52,8 @@ public class TermManager extends ContextListenerAdapter{
         * @param clazz
         * @return
         */
-       public List<DefinedTermBase<?>> getPreferredTerms(TermType termType){
-           return getFilteredTerms(TermStore.getTerms(termType, null));
+       public <T extends DefinedTermBase> List<T> getPreferredTerms(TermType termType){
+           return getFilteredTerms(TermStore.<T>getTerms(termType, null));
        }
 
        /**
index 5896718b8b4f260715c4d45729ded9fdb301784a..60cd92d7eccf2858a1c0187195fd867b7947f7a7 100644 (file)
@@ -60,7 +60,7 @@ public class TermStore {
         * @param termType the term type
         * @return an alphabetically sorted list of terms
         */
-       public static List<DefinedTermBase<?>> getTerms(TermType termType, Comparator<DefinedTermBase<?>> comparator){
+       public static <TERM extends DefinedTermBase> List<TERM> getTerms(TermType termType, Comparator<TERM> comparator){
         return getTermsFromService(termType, comparator);
        }
 
@@ -105,12 +105,12 @@ public class TermStore {
         * @param comparator
         * @return
         */
-       private static List<DefinedTermBase<?>> getTermsFromService(TermType termType, Comparator<DefinedTermBase<?>> comparator){
+       private static <T extends DefinedTermBase> List<T> getTermsFromService(TermType termType, Comparator<T> comparator){
            if (comparator == null){
-               comparator = new DefaultTermComparator<DefinedTermBase<?>>();
+               comparator = new DefaultTermComparator<T>();
            }
 
-           List<DefinedTermBase<?>> terms = CdmStore.getService(ITermService.class).listByTermType(termType, null, null, null, null);
+           List<T> terms = CdmStore.getService(ITermService.class).listByTermType(termType, null, null, null, null);
            Collections.sort(terms, comparator);
            return terms;
        }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/AbstractEntityCollectionElementWizardPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/AbstractEntityCollectionElementWizardPage.java
new file mode 100644 (file)
index 0000000..4e78d2c
--- /dev/null
@@ -0,0 +1,65 @@
+// $Id$
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui;
+
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.element.RootElement;
+
+/**
+ * @author pplitzner
+ * @date Mar 30, 2016
+ *
+ */
+public abstract class AbstractEntityCollectionElementWizardPage extends WizardPage implements
+IPropertyChangeListener {
+
+    protected CdmFormFactory formFactory;
+
+    protected RootElement rootElement;
+
+    protected AbstractEntityCollectionElementWizardPage(String pageName) {
+        super(pageName);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void createControl(Composite parent) {
+        this.setPageComplete(false);
+
+        Composite control = formFactory.createComposite(parent);
+
+        TableWrapLayout layout = LayoutConstants.LAYOUT(2, false);
+        layout.horizontalSpacing = 5;
+        control.setLayout(layout);
+
+        rootElement = new RootElement(formFactory, control);
+
+
+        setControl(control);
+
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void dispose() {
+        rootElement.removeElements();
+        formFactory.removePropertyChangeListener(this);
+        super.dispose();
+    }
+
+}
index dea82de48dabc61da01391b69959dad169b16287..38ae7193bb78ca5a632f2c114595fbd2d8e132e2 100644 (file)
@@ -1,12 +1,12 @@
 // $Id$
 /**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
-* http://www.e-taxonomy.eu
-* 
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
 
 package eu.etaxonomy.taxeditor.ui.bar;
 
@@ -14,14 +14,16 @@ import java.util.Observable;
 import java.util.Observer;
 
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.menus.WorkbenchWindowControlContribution;
 
 import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSource;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.util.ApplicationUtil;
 
 /**
  * Shows the currently logged in user in status bar
@@ -32,54 +34,61 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class AuthenticatedUserBar extends WorkbenchWindowControlContribution implements Observer{
 
-       private Label label_authenticatedUser;
-
-       /**
-        * <p>Constructor for AuthenticatedUserBar.</p>
-        */
-       public AuthenticatedUserBar(){
-               CdmStore.getLoginManager().addObserver(this);
-       }
-       
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.action.ControlContribution#createControl(org.eclipse.swt.widgets.Composite)
-        */
-       /** {@inheritDoc} */
-       @Override
-       protected Control createControl(Composite parent) {
-               final Composite composite = new Composite(parent, SWT.NONE);
-               final GridLayout layout = new GridLayout();
-               composite.setLayout(layout);
-               
-               label_authenticatedUser = new Label(composite, SWT.NULL);
-
-               update(null, null);
-                       
-               return composite;
-       }
-
-       /* (non-Javadoc)
-        * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
-        */
-       /** {@inheritDoc} */
-       public void update(Observable o, Object arg) {
-               User authenticatedUser = CdmStore.getLoginManager().getAuthenticatedUser();
-               // TODO find a method to recompute width for parental toolbar item
-               String text = authenticatedUser == null ? "Not logged in              " : 
-                                                                                                 "Logged in as: " + authenticatedUser.getUsername() + "         ";     
-               label_authenticatedUser.setText(text);
-       }
-
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.action.ContributionItem#dispose()
-        */
-       /** {@inheritDoc} */
-       @Override
-       public void dispose() {
-               super.dispose();
-               
-               CdmStore.getLoginManager().deleteObserver(this);
-       }
-       
+    private Label label_authenticatedUser;
+
+    /**
+     * <p>Constructor for AuthenticatedUserBar.</p>
+     */
+    public AuthenticatedUserBar(){
+        CdmStore.getLoginManager().addObserver(this);
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.action.ControlContribution#createControl(org.eclipse.swt.widgets.Composite)
+     */
+    /** {@inheritDoc} */
+    @Override
+    protected Control createControl(Composite parent) {
+
+        label_authenticatedUser = new Label(parent,  SWT.NULL);
+
+        update(null, null);
+
+        return label_authenticatedUser;
+    }
+
+    /* (non-Javadoc)
+     * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public void update(Observable o, Object arg) {
+        User authenticatedUser = CdmStore.getLoginManager().getAuthenticatedUser();
+        // TODO find a method to recompute width for parental toolbar item
+        String text = "";
+        if(authenticatedUser == null) {
+            text = "Not logged in              " ;
+        } else {
+            if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                CdmRemoteSource source = (CdmRemoteSource) CdmStore.getActiveCdmSource();
+                String loginInfo = authenticatedUser.getUsername() + "@" + source.getName() + ":" + source.getContextPath();
+                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setText(ApplicationUtil.getTitle() + " " + loginInfo);
+            }
+            text = "Logged in as: " + authenticatedUser.getUsername() + "         ";
+        }
+
+        label_authenticatedUser.setText(text);
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.action.ContributionItem#dispose()
+     */
+    /** {@inheritDoc} */
+    @Override
+    public void dispose() {
+        super.dispose();
+        CdmStore.getLoginManager().deleteObserver(this);
+    }
+
 
 }
index 39993d70ae5ac5f48f296bf4ce127131f73e28c1..02243a6cbad7f7be6c1f6005b2ab0911b4b69261 100644 (file)
@@ -20,7 +20,6 @@ import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Listener;
 
-import eu.etaxonomy.cdm.model.common.DefinedTerm;
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
 import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.cdm.model.common.TermVocabulary;
@@ -67,6 +66,8 @@ public class TermComboElement<T extends DefinedTermBase>
 
        private Comparator<T> termComparator;
 
+       private final TermType termType;
+       private final TermVocabulary termVocabulary;
        private final Class<T> termClass;
 
        private List<T> customPreferredTerms;
@@ -96,12 +97,9 @@ public class TermComboElement<T extends DefinedTermBase>
                int style) {
         super(formFactory, parentElement);
 
-        if(termClass!=null){
-            this.termClass = termClass;
-        }
-        else{
-            this.termClass =  (Class<T>) DefinedTerm.class;
-        }
+        this.termType = termType;
+        this.termVocabulary = termVocabulary;
+        this.termClass = termClass;
         this.addEmptyElement = addEmptyElement;
 
         if (labelString != null) {
@@ -265,10 +263,20 @@ public class TermComboElement<T extends DefinedTermBase>
         * @return a {@link java.util.List} object.
         */
        protected List<T> getPreferredTerms(){
+           List<T> preferredTerms = new ArrayList<T>();
                if (customPreferredTerms != null){
                        return customPreferredTerms;
                }
-               return getTermManager().getPreferredTerms(termClass);
+               else if(termType!=null){
+                   preferredTerms = getTermManager().getPreferredTerms(termType);
+               }
+               else if(termVocabulary!=null){
+                   preferredTerms = getTermManager().getPreferredTerms(termVocabulary);
+               }
+               if(termClass!=null){
+                   preferredTerms = getTermManager().getPreferredTerms(termClass);
+               }
+               return preferredTerms;
        }
 
        /**
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/FeedbackMessageBox.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/FeedbackMessageBox.java
new file mode 100644 (file)
index 0000000..50b1568
--- /dev/null
@@ -0,0 +1,52 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui.dialog;
+
+import java.io.Serializable;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+
+import eu.etaxonomy.taxeditor.operation.FeedbackGenerator;
+
+/**
+ * Feedback Generator corresponding to a {@link MessageBox}
+ *
+ * @author cmathew
+ * @date 29 Oct 2015
+ *
+ */
+public class FeedbackMessageBox extends FeedbackGenerator {
+
+    private Shell shell;
+    /**
+     * @param parent
+     */
+    public FeedbackMessageBox(Shell parent) {
+        this.shell = parent;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Serializable generateFeedback() {
+
+     // create a dialog with ok and cancel buttons and a question icon
+        MessageBox dialog =
+          new MessageBox(shell, SWT.ICON_QUESTION | SWT.OK| SWT.CANCEL);
+        dialog.setText("Monitor Feedback");
+        dialog.setMessage("Do you really want to continue?");
+
+        // open dialog and await user selection
+        return dialog.open();
+    }
+}
index eaa7ae53c079ff48517a30a108048d208c1471dd..324befb64f65085338f965225c058e76f48db585 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -20,8 +20,9 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
 
+import eu.etaxonomy.taxeditor.Messages;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * TODO wrap in a LoginModule
@@ -32,40 +33,32 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  * @version 1.0
  */
 public class LoginDialog extends Dialog {
-       
+
        private static Text text_password;
        private static Text text_username;
 
-       private String title;
+       private final String title;
 
-       /**
-        * <p>Constructor for LoginDialog.</p>
-        *
-        * @param parentShell a {@link org.eclipse.swt.widgets.Shell} object.
-        */
        public LoginDialog(Shell parentShell) {
                super(parentShell);
-               title = "Login";
+               title = Messages.LoginDialog_LOGIN;
        }
-               
 
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
-        */
+
        /** {@inheritDoc} */
        @Override
        protected Control createDialogArea(Composite parent) {
                Composite composite = (Composite) super.createDialogArea(parent);
                //add controls to composite as necessary
-               
+
 
                // Label for the heading
                final CLabel titleLabel = new CLabel(composite, SWT.NONE);
-               titleLabel.setText("User Login");
+               titleLabel.setText(Messages.LoginDialog_USER_LOGIN);
 
                // Label for the username
                final CLabel userNameLabel = new CLabel(composite, SWT.NONE);
-               userNameLabel.setText("Username");
+               userNameLabel.setText(Messages.LoginDialog_USER_NAME);
 
                // Textfield for the username
                text_username = new Text(composite, SWT.BORDER);
@@ -73,22 +66,18 @@ public class LoginDialog extends Dialog {
 
                // Label for the password
                final CLabel passwordLabel = new CLabel(composite, SWT.NONE);
-               passwordLabel.setText("Password");
+               passwordLabel.setText(Messages.LoginDialog_PASSWORD);
 
                // Textfield for the password
                text_password = new Text(composite, SWT.PASSWORD | SWT.BORDER);
                text_password.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-               
-               
+
+
                return composite;
        }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
-     */
     /** {@inheritDoc} */
+    @Override
     protected void configureShell(Shell shell) {
         super.configureShell(shell);
         if (title != null) {
@@ -96,33 +85,30 @@ public class LoginDialog extends Dialog {
                }
     }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.dialogs.Dialog#okPressed()
-        */
        /** {@inheritDoc} */
        @Override
        protected void okPressed() {
                String username = text_username.getText();
                String password = text_password.getText();
-               
+
                boolean result = CdmStore.getLoginManager().authenticate(username, password);
-               
+
                if(result){
                        super.okPressed();
                }
-               
-       }       
-       
+
+       }
+
        @Override
-       protected void cancelPressed() {                
+       protected void cancelPressed() {
                if(CdmStore.getLoginManager().getAuthenticatedUser() != null){
                        super.cancelPressed();
                }else{
                        // if there is no active user and the current user chooses to cancel, we close the connection
-                       boolean result = MessageDialog.openConfirm(getShell(), "Do you really want to cancel", "Aborting the login procedure will close the database.");
-                       
+                       boolean result = MessageDialog.openConfirm(getShell(), Messages.LoginDialog_REALLY_CANCEL, Messages.LoginDialog_CANCEL_MESSAGE);
+
                        if(result){
-                               CdmStore.close(StoreUtil.getMonitor());
+                               CdmStore.close(AbstractUtility.getMonitor());
                                super.cancelPressed();
                        }
                }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/RemotingLoginDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/RemotingLoginDialog.java
new file mode 100644 (file)
index 0000000..92824fc
--- /dev/null
@@ -0,0 +1,1097 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.ui.dialog;
+
+import java.io.File;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang.StringUtils;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.preferences.ConfigurationScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.events.ExpansionEvent;
+import org.eclipse.ui.forms.events.IExpansionListener;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.progress.IProgressConstants;
+import org.eclipse.wb.swt.SWTResourceManager;
+import org.osgi.service.prefs.BackingStoreException;
+import org.osgi.service.prefs.Preferences;
+import org.springframework.security.authentication.BadCredentialsException;
+import org.springframework.security.authentication.LockedException;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteConfiguration;
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.service.IUserService;
+import eu.etaxonomy.cdm.model.metadata.CdmMetaData;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.remoting.server.CDMServerException;
+import eu.etaxonomy.taxeditor.remoting.server.CDMServerUtils;
+import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSource;
+import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfo;
+import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfo.CdmInstanceInfo;
+import eu.etaxonomy.taxeditor.remoting.source.ICdmRemoteSource;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.LoginManager;
+import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
+import eu.etaxonomy.taxeditor.webapp.CDMEmbeddedServerException;
+import eu.etaxonomy.taxeditor.webapp.CDMServer;
+import eu.etaxonomy.taxeditor.webapp.ICDMServerError;
+
+
+/**
+ * @author cmathew
+ * @date 20 Jan 2015
+ *
+ */
+public class RemotingLoginDialog extends Dialog implements ICDMServerError {
+
+    protected Object result;
+    protected Shell shlConnect;
+    private Text txtCdmServerStatus;
+    private Text txtCdmInstanceStatus;
+    private Combo comboCdmServer;
+    private Combo comboCdmInstance;
+    private Button btnConnect;
+
+    private final Map<String, CdmServerInfo> csiiMap = new HashMap<String, CdmServerInfo>();
+
+    private final static String STATUS_AVAILABLE = "Available";
+    private final static String STATUS_NOT_AVAILABLE = "Not Available";
+    private final static String STATUS_STARTED = "Started";
+    private final static String STATUS_NOT_STARTED = "Not Started";
+    private final static String STATUS_RETRIEVING = "Retrieving ...";
+    private final static String STATUS_CHECKING_AVAILABILITY = "Checking ...";
+    private final static String STATUS_NO_INSTANCES = "No Instances Found";
+    private final static String STATUS_ERROR = "Error";
+    private final static String STATUS_REMOTING_NOT_ACTIVATED = "Remoting not activated";
+    private final static String STATUS_NOT_COMPATIBLE = "Not Compatible";
+
+    private final static String MESG_COMPATIBLE_EDITOR_OLD = "Please update the Taxonomic Editor (Help->Check for Updates) or choose a compatible cdm-server";
+    private final static String MESG_COMPATIBLE_SERVER_OLD = "Please choose a compatible cdm-server or update the chosen cdm-server";
+
+    private final static String STORE_PREFERENCES_NODE = "eu.etaxonomy.taxeditor.store";
+
+    private final static String LOGIN_NODE = "login";
+    private final static String USERNAME_SUFFIX = "_username";
+    private final static String PASSWORD_SUFFIX = "_password";
+
+    private final static String LAST_SERVER_INSTANCE_NODE = "lastServerInstance";
+    private final static String LAST_SERVER_KEY = "lastServerKey";
+    private final static String LAST_INSTANCE_KEY = "lastInstanceKey";
+
+    private final static String REFRESH_LABEL = "Refresh";
+
+    private Composite remotingComposite;
+    private CdmServerInfo selectedCsii;
+    private CdmInstanceInfo selectedCdmInstance;
+    private Button btnCdmServerRefresh;
+    private Button btnCdmInstanceRefresh;
+    private Button btnStopServer;
+    private Composite loginComposite;
+    private Label lblLogin;
+    private Text txtLogin;
+    private Label lblPassword;
+    private Text txtPassword;
+    private Button btnRememberMe;
+    private Composite compAdvanced;
+    private Label lblPort;
+    private Text txtPort;
+    private Label lblServerVersion;
+    private Text txtServerVersion;
+    private ExpandableComposite xpndblcmpstAdvanced;
+    private StyledText styledTxtMessage;
+
+
+    private final int MIN_WIDTH = 530;
+    private final int MIN_HEIGHT = 220;
+    private final int MIN_EXP_HEIGHT = 380;
+    private final int MESSAGE_HEIGHT = 25;
+    private Label lblEditorVersion;
+    private Text txtEditorVersion;
+    private Label lblServerCDMVersion;
+    private Text txtServerCDMVersion;
+    private Label lblEditorCDMVersion;
+    private Text txtEditorCDMVersion;
+
+    private String serverName, instanceName;
+    private boolean autoConnect = false;
+    private boolean loadLoginPrefs = true;
+    private boolean isDevRemoteSource = false;
+    private Job serverJob;
+    /**
+     * Create the dialog.
+     * @param parent
+     * @param style
+     */
+    public RemotingLoginDialog(Shell parent, int style) {
+        super(parent, style);
+        setText("Login");
+    }
+
+    public Object open(CdmRemoteSource source, boolean loadLoginPrefs, boolean autoConnect) {
+        this.loadLoginPrefs = loadLoginPrefs;
+        this.serverName = source.getName();
+        String contextPath = source.getContextPath();
+        this.instanceName = contextPath.substring(contextPath.lastIndexOf("/") + 1);
+        return open(serverName, instanceName, loadLoginPrefs, autoConnect);
+    }
+
+
+    public Object open(String serverName, String instanceName, boolean loadLoginPrefs, boolean autoConnect) {
+        this.serverName = serverName;
+        this.instanceName = instanceName;
+        this.loadLoginPrefs = loadLoginPrefs;
+        this.autoConnect = autoConnect;
+        return open();
+    }
+
+    /**
+     * Open the dialog.
+     * @return the result
+     */
+    public Object open() {
+
+        createContents();
+        if(serverName == null && instanceName == null) {
+            readPrefLastServerInstance();
+        }
+
+        setEditorInfo();
+        populateCdmServerCombo();
+        shlConnect.open();
+        shlConnect.layout();
+
+        xpndblcmpstAdvanced.setExpanded(false);
+
+        Display display = getParent().getDisplay();
+
+        while (!shlConnect.isDisposed()) {
+            if (!display.readAndDispatch()) {
+                display.sleep();
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * Create contents of the dialog.
+     */
+    private void createContents() {
+        shlConnect = new Shell(getParent(), SWT.DIALOG_TRIM);
+        shlConnect.setMinimumSize(new Point(MIN_WIDTH, MIN_HEIGHT));
+        shlConnect.setSize(MIN_WIDTH, MIN_HEIGHT);
+        shlConnect.setText("Connect");
+        shlConnect.setLayout(new FillLayout(SWT.HORIZONTAL));
+
+        remotingComposite = new Composite(shlConnect, SWT.NONE);
+        remotingComposite.setLayout(new GridLayout(1, false));
+
+        Composite cdmServerComposite = new Composite(remotingComposite, SWT.NONE);
+        GridData gd_cdmServerComposite = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+        gd_cdmServerComposite.heightHint = 68;
+        cdmServerComposite.setLayoutData(gd_cdmServerComposite);
+        cdmServerComposite.setLayout(new GridLayout(4, false));
+
+        Label lblCdmServer = new Label(cdmServerComposite, SWT.NONE);
+        lblCdmServer.setText("CDM Server : ");
+        lblCdmServer.setFont(SWTResourceManager.getFont("Ubuntu", 9, SWT.NORMAL));
+        lblCdmServer.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+
+        comboCdmServer = new Combo(cdmServerComposite, SWT.READ_ONLY);
+        comboCdmServer.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                refreshCdmServer();
+
+            }
+        });
+        GridData gd_comboCdmServer = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
+        gd_comboCdmServer.widthHint = 150;
+        comboCdmServer.setLayoutData(gd_comboCdmServer);
+        comboCdmServer.select(0);
+
+        txtCdmServerStatus = new Text(cdmServerComposite, SWT.BORDER);
+        txtCdmServerStatus.setBackground(SWTResourceManager.getColor(SWT.COLOR_INFO_BACKGROUND));
+        txtCdmServerStatus.setEditable(false);
+        GridData gd_txtCdmServerStatus = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
+        gd_txtCdmServerStatus.widthHint = 100;
+        txtCdmServerStatus.setLayoutData(gd_txtCdmServerStatus);
+
+        btnCdmServerRefresh = new Button(cdmServerComposite, SWT.NONE);
+        btnCdmServerRefresh.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                refreshCdmServer();
+            }
+        });
+        btnCdmServerRefresh.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
+        btnCdmServerRefresh.setText("Refresh");
+
+        Label lblCdmInstance = new Label(cdmServerComposite, SWT.NONE);
+        GridData gd_lblCdmInstance = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
+        gd_lblCdmInstance.heightHint = 30;
+        lblCdmInstance.setLayoutData(gd_lblCdmInstance);
+        lblCdmInstance.setText("CDM Instance : ");
+        lblCdmInstance.setFont(SWTResourceManager.getFont("Ubuntu", 9, SWT.NORMAL));
+
+        comboCdmInstance = new Combo(cdmServerComposite, SWT.READ_ONLY);
+        comboCdmInstance.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                refreshCdmInstance();
+            }
+        });
+        GridData gd_comboCdmInstance = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
+        gd_comboCdmInstance.widthHint = 150;
+        comboCdmInstance.setLayoutData(gd_comboCdmInstance);
+        comboCdmInstance.select(0);
+
+        txtCdmInstanceStatus = new Text(cdmServerComposite, SWT.BORDER);
+        txtCdmInstanceStatus.setBackground(SWTResourceManager.getColor(SWT.COLOR_INFO_BACKGROUND));
+        txtCdmInstanceStatus.setEditable(false);
+        GridData gd_txtCdmInstanceStatus = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
+        gd_txtCdmInstanceStatus.widthHint = 100;
+        txtCdmInstanceStatus.setLayoutData(gd_txtCdmInstanceStatus);
+
+        btnCdmInstanceRefresh = new Button(cdmServerComposite, SWT.FLAT);
+        btnCdmInstanceRefresh.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                refreshCdmInstance();
+            }
+        });
+        GridData gd_btnCdmInstanceRefresh = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
+        gd_btnCdmInstanceRefresh.widthHint = 110;
+        gd_btnCdmInstanceRefresh.heightHint = 30;
+        btnCdmInstanceRefresh.setLayoutData(gd_btnCdmInstanceRefresh);
+        btnCdmInstanceRefresh.setText("Refresh");
+
+        loginComposite = new Composite(remotingComposite, SWT.NONE);
+        GridData gd_loginComposite = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+        gd_loginComposite.widthHint = 487;
+        gd_loginComposite.heightHint = 70;
+        loginComposite.setLayoutData(gd_loginComposite);
+        GridLayout gl_loginComposite = new GridLayout(6, false);
+        gl_loginComposite.marginTop = 5;
+        loginComposite.setLayout(gl_loginComposite);
+
+        lblLogin = new Label(loginComposite, SWT.CENTER);
+        GridData gd_lblLogin = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
+        gd_lblLogin.widthHint = 50;
+        lblLogin.setLayoutData(gd_lblLogin);
+        lblLogin.setText("Login : ");
+        lblLogin.setFont(SWTResourceManager.getFont("Ubuntu", 9, SWT.NORMAL));
+
+        txtLogin = new Text(loginComposite, SWT.BORDER);
+        GridData gd_txtLogin = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
+        gd_txtLogin.minimumWidth = 80;
+        gd_txtLogin.widthHint = 80;
+        gd_txtLogin.heightHint = 15;
+        txtLogin.setLayoutData(gd_txtLogin);
+
+        lblPassword = new Label(loginComposite, SWT.CENTER);
+        lblPassword.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        lblPassword.setText("Password : ");
+        lblPassword.setFont(SWTResourceManager.getFont("Ubuntu", 9, SWT.NORMAL));
+
+        txtPassword = new Text(loginComposite, SWT.BORDER | SWT.PASSWORD);
+        GridData gd_txtPassword = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
+        gd_txtPassword.minimumWidth = 80;
+        gd_txtPassword.widthHint = 80;
+        gd_txtPassword.heightHint = 15;
+        txtPassword.setLayoutData(gd_txtPassword);
+        new Label(loginComposite, SWT.NONE);
+
+        btnConnect = new Button(loginComposite, SWT.FLAT);
+        btnConnect.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
+        btnConnect.addMouseListener(new MouseAdapter() {
+            @Override
+            public void mouseUp(MouseEvent e) {
+                if(selectedCsii.isLocalhostMgd() && !isSelectedCdmInstanceRunningInManagedServer()) {
+                    startManagedServer();
+                } else {
+                    connect();
+                }
+            }
+        });
+        btnConnect.setText("Connect");
+
+        btnRememberMe = new Button(loginComposite, SWT.CHECK);
+        btnRememberMe.setSelection(true);
+        GridData gd_btnRememberMe = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
+        gd_btnRememberMe.widthHint = 107;
+        btnRememberMe.setLayoutData(gd_btnRememberMe);
+        btnRememberMe.setText("Remember Me");
+        new Label(loginComposite, SWT.NONE);
+        new Label(loginComposite, SWT.NONE);
+        new Label(loginComposite, SWT.NONE);
+        new Label(loginComposite, SWT.NONE);
+
+        styledTxtMessage = new StyledText(remotingComposite, SWT.NONE);
+        styledTxtMessage.setBackground(SWTResourceManager.getColor(SWT.COLOR_INFO_BACKGROUND));
+        styledTxtMessage.setForeground(SWTResourceManager.getColor(SWT.COLOR_DARK_RED));
+        styledTxtMessage.setFont(SWTResourceManager.getFont("Ubuntu", 12, SWT.BOLD));
+        styledTxtMessage.setSelectionBackground(SWTResourceManager.getColor(SWT.COLOR_LIST_SELECTION_TEXT));
+        styledTxtMessage.setSelectionForeground(SWTResourceManager.getColor(SWT.COLOR_DARK_RED));
+        styledTxtMessage.setDoubleClickEnabled(false);
+        styledTxtMessage.setEditable(false);
+        GridData gd_styledTxtMessage = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
+        gd_styledTxtMessage.exclude = true;
+        gd_styledTxtMessage.minimumHeight = MESSAGE_HEIGHT;
+        gd_styledTxtMessage.heightHint = MESSAGE_HEIGHT;
+        styledTxtMessage.setLayoutData(gd_styledTxtMessage);
+
+        xpndblcmpstAdvanced = new ExpandableComposite(remotingComposite, SWT.NONE, ExpandableComposite.TWISTIE);
+        GridData gd_xpndblcmpstAdvanced = new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1);
+        gd_xpndblcmpstAdvanced.heightHint = 19;
+        xpndblcmpstAdvanced.setLayoutData(gd_xpndblcmpstAdvanced);
+        xpndblcmpstAdvanced.addExpansionListener(new IExpansionListener() {
+            @Override
+            public void expansionStateChanged(ExpansionEvent e) {
+                GridData gridData = (GridData) xpndblcmpstAdvanced.getLayoutData();
+                if(e.getState()) {
+                    shlConnect.setSize(MIN_WIDTH, MIN_EXP_HEIGHT);
+                } else {
+                    shlConnect.setSize(MIN_WIDTH, MIN_HEIGHT);
+                }
+
+            }
+            @Override
+            public void expansionStateChanging(ExpansionEvent e) {
+            }
+        });
+        xpndblcmpstAdvanced.setText("advanced");
+        xpndblcmpstAdvanced.setExpanded(true);
+
+        compAdvanced = new Composite(xpndblcmpstAdvanced, SWT.NONE);
+        xpndblcmpstAdvanced.setClient(compAdvanced);
+        compAdvanced.setLayout(new GridLayout(4, false));
+
+        lblPort = new Label(compAdvanced, SWT.CENTER);
+        lblPort.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        lblPort.setSize(0, 0);
+        lblPort.setText("Port : ");
+        lblPort.setFont(SWTResourceManager.getFont("Ubuntu", 9, SWT.NORMAL));
+
+        txtPort = new Text(compAdvanced, SWT.BORDER);
+        GridData gd_txtPort = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
+        gd_txtPort.minimumWidth = 50;
+        gd_txtPort.widthHint = 50;
+        txtPort.setLayoutData(gd_txtPort);
+
+        lblServerVersion = new Label(compAdvanced, SWT.CENTER);
+        lblServerVersion.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        lblServerVersion.setText("Server Cdmlib Version :");
+        lblServerVersion.setFont(SWTResourceManager.getFont("Ubuntu", 9, SWT.NORMAL));
+
+        txtServerVersion = new Text(compAdvanced, SWT.BORDER);
+        txtServerVersion.setEditable(false);
+        txtServerVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
+        btnStopServer = new Button(compAdvanced, SWT.FLAT);
+        btnStopServer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
+        btnStopServer.addMouseListener(new MouseAdapter() {
+            @Override
+            public void mouseUp(MouseEvent e) {
+                stopManagedServer();
+            }
+        });
+        btnStopServer.setText("Stop Managed Server");
+
+        lblEditorVersion = new Label(compAdvanced, SWT.CENTER);
+        lblEditorVersion.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        lblEditorVersion.setText("Editor Cdmlib Version :");
+        lblEditorVersion.setFont(SWTResourceManager.getFont("Ubuntu", 9, SWT.NORMAL));
+
+        txtEditorVersion = new Text(compAdvanced, SWT.BORDER);
+        txtEditorVersion.setEditable(false);
+        txtEditorVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+        new Label(compAdvanced, SWT.NONE);
+        new Label(compAdvanced, SWT.NONE);
+
+        lblServerCDMVersion = new Label(compAdvanced, SWT.CENTER);
+        lblServerCDMVersion.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        lblServerCDMVersion.setText("Server CDM Version :");
+        lblServerCDMVersion.setFont(SWTResourceManager.getFont("Ubuntu", 9, SWT.NORMAL));
+
+        txtServerCDMVersion = new Text(compAdvanced, SWT.BORDER);
+        txtServerCDMVersion.setEditable(false);
+        txtServerCDMVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+        new Label(compAdvanced, SWT.NONE);
+        new Label(compAdvanced, SWT.NONE);
+
+        lblEditorCDMVersion = new Label(compAdvanced, SWT.CENTER);
+        lblEditorCDMVersion.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        lblEditorCDMVersion.setText("Editor CDM Version :");
+        lblEditorCDMVersion.setFont(SWTResourceManager.getFont("Ubuntu", 9, SWT.NORMAL));
+
+        txtEditorCDMVersion = new Text(compAdvanced, SWT.BORDER);
+        txtEditorCDMVersion.setEditable(false);
+        txtEditorCDMVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+
+    }
+
+
+
+    private void populateCdmServerCombo() {
+        Job job = new Job("Retrieve Server Instances") {
+            @Override
+            protected IStatus run(IProgressMonitor monitor) {
+                Display.getDefault().syncExec(new Runnable() {
+                    @Override
+                    public void run() {
+                        for(CdmServerInfo csii : CdmServerInfo.getCdmServers()) {
+                            csiiMap.put(csii.getName(), csii);
+                            comboCdmServer.add(csii.getName());
+                        }
+                        int serverIndex = -1;
+                        if(serverName != null) {
+                            serverIndex = comboCdmServer.indexOf(serverName);
+                        }
+                        if(serverIndex == -1) {
+                            comboCdmServer.select(0);
+                            autoConnect = false;
+                        } else {
+                            comboCdmServer.select(serverIndex);
+                        }
+                        CdmRemoteSource devRemoteSource = CdmServerInfo.getDevServerRemoteSource();
+                        if(devRemoteSource != null) {
+                            isDevRemoteSource = true;
+                            String username = System.getProperty("cdm.server.dev.username");
+                            String password = System.getProperty("cdm.server.dev.password");
+                            if(username != null && !username.isEmpty() && password != null && !password.isEmpty()) {
+                                txtLogin.setText(username);
+                                txtPassword.setText(password);
+                                CdmStore.connect(devRemoteSource, RemotingLoginDialog.this);
+                            }
+                        } else {
+                            refreshCdmServer();
+                        }
+                    }
+                });
+                return Status.OK_STATUS;
+            }
+        };
+        job.schedule();
+    }
+
+
+    private void refreshCdmServer() {
+        txtCdmServerStatus.setText(STATUS_CHECKING_AVAILABILITY);
+        clearOnServerChange();
+        emptyCredentials();
+        updateSelectedCdmServer();
+        Display.getDefault().asyncExec(new Runnable() {
+            @Override
+            public void run() {
+                checkSelectedCdmServer();
+            }
+        });
+
+    }
+
+    private void updateSelectedCdmServer() {
+        int selIndex = comboCdmServer.getSelectionIndex();
+        if(selIndex != -1) {
+            selectedCsii = csiiMap.get(comboCdmServer.getItem(selIndex));
+        }
+    }
+
+    private void updatePort() {
+        txtPort.setText("");
+        if(selectedCsii != null) {
+            int port = selectedCsii.getPort();
+            if(port == CdmServerInfo.NULL_PORT) {
+                txtPort.setText(CdmServerInfo.NULL_PORT_STRING);
+            } else {
+                txtPort.setText(String.valueOf(port));
+            }
+        }
+    }
+
+    private int getPort() {
+        int port = CdmServerInfo.NULL_PORT;
+        try {
+            port = Integer.valueOf(txtPort.getText());
+        } catch (NumberFormatException nfe) {
+            if(!CdmServerInfo.NULL_PORT_STRING.equals(txtPort.getText())) {
+                setMessage("Port should be an integer");
+            }
+        }
+        return port;
+    }
+
+    private void checkSelectedCdmServer() {
+        if(selectedCsii != null) {
+            if(selectedCsii.isLocalhost()) {
+                txtPort.setEditable(true);
+                txtPort.setEnabled(true);
+            }
+            if(selectedCsii.pingServer()) {
+                txtCdmServerStatus.setText(STATUS_AVAILABLE);
+                populateCdmInstanceCombo(true);
+                String serverVersionTimestamp = generateLastModifiedTooltip(selectedCsii.getCdmlibLastModified());
+                txtServerVersion.setText(selectedCsii.getCdmlibServicesVersion() + ":" + serverVersionTimestamp);
+            } else {
+                txtCdmServerStatus.setText(STATUS_NOT_AVAILABLE);
+                comboCdmInstance.removeAll();
+                disableCdmInstanceControls("", "");
+            }
+        }
+        updatePort();
+    }
+
+
+    private void populateCdmInstanceCombo(final boolean forceRefresh) {
+        comboCdmInstance.removeAll();
+        comboCdmInstance.setEnabled(false);
+        btnConnect.setEnabled(false);
+        txtCdmInstanceStatus.setText(STATUS_RETRIEVING);
+        txtCdmInstanceStatus.setToolTipText("");
+
+        serverJob = new Job("Retrieve Server Instances") {
+            @Override
+            protected IStatus run(IProgressMonitor monitor) {
+                try {
+                    if(selectedCsii != null) {
+                        if(forceRefresh) {
+                            selectedCsii.refreshInstances();
+                        }
+                        final List<CdmInstanceInfo> instances = selectedCsii.getInstances();
+                        Display.getDefault().asyncExec(new Runnable() {
+                            @Override
+                            public void run() {
+                                if(!instances.isEmpty()) {
+                                    for(CdmInstanceInfo cdmInstance : instances) {
+                                        comboCdmInstance.add(cdmInstance.getName());
+                                    }
+                                    int instanceIndex = -1;
+                                    if(instanceName != null) {
+                                        instanceIndex = comboCdmInstance.indexOf(instanceName);
+                                    }
+                                    if(instanceIndex == -1) {
+                                        comboCdmInstance.select(0);
+                                        autoConnect = false;
+                                    } else {
+                                        comboCdmInstance.select(instanceIndex);
+                                    }
+                                    refreshCdmInstance();
+                                    comboCdmInstance.setEnabled(true);
+                                    if(autoConnect) {
+                                        connect();
+                                    }
+
+                                } else {
+                                    txtCdmInstanceStatus.setText(STATUS_NO_INSTANCES);
+                                    btnConnect.setEnabled(false);
+                                }
+                            }
+                        });
+                    }
+                } catch (final CDMServerException e) {
+                    MessagingUtils.warn(getClass(), e);
+                    Display.getDefault().asyncExec(new Runnable() {
+                        @Override
+                        public void run() {
+                            disableCdmInstanceControls(STATUS_NOT_AVAILABLE, e.getMessage());
+                        }
+                    });
+                }
+                return Status.OK_STATUS;
+            }
+        };
+
+        if(txtCdmServerStatus.getText().equals(STATUS_AVAILABLE) && !isDevRemoteSource) {
+            // Start the Job
+            serverJob.schedule();
+        }
+    }
+
+    private void disableCdmInstanceControls(String cdmInstanceStatus, String tooltip) {
+        txtCdmInstanceStatus.setText(cdmInstanceStatus);
+        txtCdmInstanceStatus.setToolTipText(tooltip);
+        comboCdmInstance.setEnabled(false);
+        btnConnect.setEnabled(false);
+
+    }
+    private void refreshCdmInstance() {
+        txtCdmInstanceStatus.setText(STATUS_CHECKING_AVAILABILITY);
+        clearOnInstanceChange();
+        updateSelectedCdmInstance();
+        checkSelectedCdmInstance();
+        updateManagedServerControls();
+    }
+
+    private void updateSelectedCdmInstance() {
+        int selIndex = comboCdmInstance.getSelectionIndex();
+        if(selIndex != -1) {
+            selectedCdmInstance = selectedCsii.getInstanceFromName(comboCdmInstance.getItem(selIndex));
+
+            if(loadLoginPrefs && !isDevRemoteSource) {
+                readPrefCredentials();
+            }
+        }
+    }
+
+    private void updateManagedServerControls() {
+        if(selectedCsii.isLocalhostMgd()) {
+            if(isSelectedCdmInstanceRunningInManagedServer()) {
+                txtCdmInstanceStatus.setText(STATUS_STARTED);
+            } else {
+                txtCdmInstanceStatus.setText(STATUS_NOT_STARTED);
+            }
+            btnConnect.setEnabled(true);
+            selectedCsii.setPort(getManagedServerPort());
+            updatePort();
+        }
+
+
+        if(isManagedServerRunning()) {
+            btnStopServer.setEnabled(true);
+        } else {
+            btnStopServer.setEnabled(false);
+        }
+    }
+
+    private boolean isManagedServerRunning() {
+        return CdmStore.getManagedServer() != null && CdmStore.getManagedServer().isAlive();
+    }
+
+    private boolean isSelectedCdmInstanceRunningInManagedServer() {
+        return CdmStore.getManagedServer() != null &&
+                CdmStore.getManagedServer().isAlive() &&
+                selectedCsii.isLocalhostMgd() &&
+                CdmStore.getManagedServer().getDataSourceName().equals(selectedCdmInstance.getName());
+    }
+
+    private void startManagedServer() {
+        if(isManagedServerRunning()) {
+            if(CdmStore.getManagedServer().getDataSourceName().equals(selectedCdmInstance.getName())) {
+                return;
+            } else {
+                Display.getDefault().syncExec(new Runnable() {
+                    @Override
+                    public void run() {
+                        stopManagedServer();
+                    }
+                });
+            }
+        }
+
+
+        Job job = new Job("Managed CDM Server Launch") {
+
+            @Override
+            public IStatus run(IProgressMonitor monitor) {
+                String mgdServerConfigFileName = "mgd.datasources.xml";
+                String config = CDMServerUtils.convertEditorToServerConfig();
+                File managedServerConfigFile;
+                int maxUnits = 50;
+                monitor.beginTask("Launching Managed CDM Server", maxUnits);
+                try {
+                    monitor.subTask("Generating datasources config file for " + selectedCdmInstance.getName());
+                    managedServerConfigFile = CDMServerUtils.writeManagedServerConfig(config, mgdServerConfigFileName);
+                    monitor.worked(1);
+                    CdmStore.setManagedServer(new CDMServer(selectedCdmInstance.getName(), managedServerConfigFile));
+                    monitor.subTask("Starting Managed CDM Server. This may take a while.");
+                    CdmStore.getManagedServer().start(false, RemotingLoginDialog.this);
+                    int serverUnits = 0;
+
+                    // the following loop is a 'fake' progress monitoring where the progress
+                    // bar is advanced by one unit every second until maxUnits -2
+                    while(!CdmStore.getManagedServer().isStarted()) {
+                        if(serverUnits < maxUnits - 2) {
+                            try {
+                                Thread.sleep(1000);
+                            } catch (InterruptedException e) {
+                            }
+                            monitor.worked(1);
+                            serverUnits++;
+                        }
+                    }
+                    Display.getDefault().asyncExec(new Runnable() {
+                        @Override
+                        public void run() {
+                            hide(false);
+                            updateManagedServerControls();
+                            connect();
+                        }
+                    });
+                } catch (IOException ioe) {
+                    MessagingUtils.errorDialog("Error generating server config file",
+                            this,
+                            ioe.getMessage(),
+                            TaxeditorStorePlugin.PLUGIN_ID,
+                            ioe,
+                            true);
+                } catch (CDMEmbeddedServerException cse) {
+                    MessagingUtils.errorDialog("Error starting managed server",
+                            this,
+                            cse.getMessage(),
+                            TaxeditorStorePlugin.PLUGIN_ID,
+                            cse,
+                            true);
+                } finally {
+                    monitor.done();
+                }
+                return Status.OK_STATUS;
+            }
+        };
+
+        // configure the job
+        job.setProperty(IProgressConstants.KEEP_PROPERTY, true);
+        job.setUser(true);
+        // schedule job
+        hide(true);
+        job.schedule();
+    }
+
+    private void stopManagedServer() {
+        try {
+            CdmStore.getManagedServer().stop();
+        } catch (Exception e) {
+            MessagingUtils.errorDialog("Error stopping managed server",
+                    this,
+                    "Could not stop managed server running at port " + CdmStore.getManagedServer().getPort() + ". Please stop it manually",
+                    TaxeditorStorePlugin.PLUGIN_ID,
+                    e,
+                    true);
+        }
+        CdmStore.setManagedServer(null);
+        updateManagedServerControls();
+    }
+
+    private int getManagedServerPort() {
+        return CdmStore.getManagedServer() == null ? CdmServerInfo.NULL_PORT : CdmStore.getManagedServer().getPort();
+    }
+
+    private void checkSelectedCdmInstance() {
+        boolean available = false;
+        String status = STATUS_NOT_AVAILABLE;
+        String message = null;
+
+        if(txtCdmServerStatus.getText().equals(STATUS_AVAILABLE)) {
+            try {
+                if(selectedCsii.pingInstance(selectedCdmInstance, getPort())) {
+                    status = STATUS_AVAILABLE;
+                    available = true;
+                } else {
+                    status = STATUS_NOT_AVAILABLE;
+                    available = false;
+                }
+
+                if(available) {
+                    txtServerCDMVersion.setText(selectedCsii.getCdmRemoteSource(selectedCdmInstance, getPort()).getDbSchemaVersion());
+                    int compareDbSchemaVersion = selectedCsii.compareDbSchemaVersion(selectedCdmInstance, getPort());
+                    int compareCdmlibServicesVersion = 0;
+                    boolean disableServicesApiTimestampCheck =
+                            PreferencesUtil.getPreferenceStore().getBoolean((IPreferenceKeys.DISABLE_SERVICES_API_TIMESTAMP_CHECK));
+                    if(!disableServicesApiTimestampCheck) {
+                        compareCdmlibServicesVersion = selectedCsii.compareCdmlibServicesVersion();
+                    }
+                    if(compareDbSchemaVersion > 0 || compareCdmlibServicesVersion > 0) {
+                        status =  STATUS_NOT_COMPATIBLE;
+                        available = false;
+                        message = MESG_COMPATIBLE_EDITOR_OLD;
+                    } else if(compareDbSchemaVersion < 0 || compareCdmlibServicesVersion < 0) {
+                        status = STATUS_NOT_COMPATIBLE;
+                        available = false;
+                        message = MESG_COMPATIBLE_SERVER_OLD;
+                    } else {
+                        status =  STATUS_AVAILABLE;
+                        available = true;
+                        message = "";
+                    }
+                }
+            } catch (Exception e) {
+                txtCdmInstanceStatus.setToolTipText(e.getMessage());
+            } finally {
+                btnConnect.setEnabled(available);
+                txtCdmInstanceStatus.setText(status);
+                if(!StringUtils.isBlank(message)) {
+                    setMessage(message);
+                }
+            }
+        }
+    }
+
+    private void connect() {
+        checkSelectedCdmInstance();
+
+        if(!txtCdmInstanceStatus.getText().equals(STATUS_AVAILABLE)) {
+            return;
+        }
+
+        ICdmRemoteSource source = selectedCsii.getCdmRemoteSource(selectedCdmInstance, getPort());
+
+        if(!validateLogin(source)) {
+            return;
+        }
+
+        try {
+            CdmStore.connect(source, this);
+        } catch (Exception e) {
+            // Do not expect anything to go wrong at this point, so we throw a runtime exception
+            // if any problems
+            throw new RuntimeException(e);
+        }
+
+    }
+
+
+    public boolean isRememberMe() {
+        return btnRememberMe.getSelection();
+    }
+
+    private void persistPrefLastServerInstance() {
+        IEclipsePreferences preferences = ConfigurationScope.INSTANCE.getNode(STORE_PREFERENCES_NODE);
+        Preferences lastServerInstancePrefs = preferences.node(LAST_SERVER_INSTANCE_NODE);
+
+        lastServerInstancePrefs.put(LAST_SERVER_KEY, selectedCsii.getName());
+        lastServerInstancePrefs.put(LAST_INSTANCE_KEY, selectedCdmInstance.getName());
+
+        flushPreferences(lastServerInstancePrefs);
+    }
+
+    private void persistPrefCredentials() {
+         IEclipsePreferences preferences = ConfigurationScope.INSTANCE.getNode(STORE_PREFERENCES_NODE);
+         Preferences credentialsPrefs = preferences.node(LOGIN_NODE);
+         credentialsPrefs.put(getUsernamePrefKey(), txtLogin.getText());
+         credentialsPrefs.put(getPasswordPrefKey(), txtPassword.getText());
+         flushPreferences(credentialsPrefs);
+    }
+
+    private void flushPreferences(Preferences prefs) {
+        try {
+            prefs.flush();
+        } catch (BackingStoreException bse) {
+            setMessage(bse.getMessage());
+        }
+    }
+
+    private void readPrefCredentials() {
+        String username, password;
+        IEclipsePreferences preferences = ConfigurationScope.INSTANCE.getNode(STORE_PREFERENCES_NODE);
+        Preferences credentialsPrefs = preferences.node(LOGIN_NODE);
+        username = credentialsPrefs.get(getUsernamePrefKey(), "");
+        txtLogin.setText(username);
+        password = credentialsPrefs.get(getPasswordPrefKey(),"");
+        txtPassword.setText(password);
+        if(username.isEmpty() || password.isEmpty()) {
+            autoConnect = false;
+        }
+    }
+
+    private void readPrefLastServerInstance() {
+        IEclipsePreferences preferences = ConfigurationScope.INSTANCE.getNode(STORE_PREFERENCES_NODE);
+        Preferences lastServerInstancePrefs = preferences.node(LAST_SERVER_INSTANCE_NODE);
+
+        serverName = lastServerInstancePrefs.get(LAST_SERVER_KEY, null);
+        instanceName = lastServerInstancePrefs.get(LAST_INSTANCE_KEY, null);
+    }
+
+    private void emptyCredentials() {
+        txtLogin.setText("");
+        txtPassword.setText("");
+    }
+
+    private String getUsernamePrefKey() {
+        return selectedCsii.toString(selectedCdmInstance.getName(), getPort()) + USERNAME_SUFFIX;
+    }
+
+    private String getPasswordPrefKey() {
+        return selectedCsii.toString(selectedCdmInstance.getName(), getPort()) + PASSWORD_SUFFIX;
+    }
+
+    private boolean validateLogin(ICdmRemoteSource remoteSource) {
+        if(getUsername() == null || getUsername().isEmpty()) {
+            setMessage("User login cannot be empty");
+            return false;
+        }
+        if(getPassword() == null || getPassword().isEmpty()) {
+            setMessage("Password cannot be empty");
+            return false;
+        }
+
+
+        try {
+            IUserService userService = CdmApplicationRemoteConfiguration.getUserService(remoteSource);
+            UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(getUsername(), getPassword());
+            CdmApplicationRemoteConfiguration.getAuthenticationManager(userService).authenticate(token);
+        } catch(BadCredentialsException e){
+            setMessage(LoginManager.INCORRECT_CREDENTIALS_MESSAGE);
+            return false;
+        } catch(LockedException e){
+            setMessage(LoginManager.ACCOUNT_LOCKED_MESSAGE);
+            return false;
+        } catch(IllegalArgumentException e){
+            setMessage(LoginManager.INCORRECT_CREDENTIALS_MESSAGE);
+            return false;
+        }
+        return true;
+    }
+
+    public String getUsername() {
+        return txtLogin.getText();
+    }
+
+    public String getPassword() {
+        return txtPassword.getText();
+    }
+
+    public void setMessage(String message) {
+        if(message != null && !message.isEmpty()) {
+            if(message.length() > 60) {
+                styledTxtMessage.setToolTipText(message);
+                message = message.substring(0, 60) + "...";
+            }
+            styledTxtMessage.setText(message);
+            styledTxtMessage.setVisible(true);
+            ((GridData)styledTxtMessage.getLayoutData()).exclude = false;
+            shlConnect.setSize(MIN_WIDTH, getHeightWithoutMessage() + MESSAGE_HEIGHT);
+            shlConnect.setMinimumSize(MIN_WIDTH, getHeightWithoutMessage() + MESSAGE_HEIGHT);
+        } else {
+            styledTxtMessage.setText("");
+            styledTxtMessage.setVisible(false);
+            ((GridData)styledTxtMessage.getLayoutData()).exclude = true;
+            shlConnect.setSize(MIN_WIDTH, getHeightWithoutMessage());
+            shlConnect.setMinimumSize(MIN_WIDTH, getHeightWithoutMessage());
+        }
+        remotingComposite.layout();
+    }
+
+    private int getHeightWithoutMessage() {
+        if(xpndblcmpstAdvanced.isExpanded()) {
+            return MIN_EXP_HEIGHT;
+        } else {
+            return MIN_HEIGHT;
+        }
+    }
+
+
+    public void hide(boolean isHidden) {
+        if(shlConnect != null && shlConnect.getDisplay() != null) {
+            shlConnect.setVisible(!isHidden);
+        }
+    }
+    public void dispose() {
+        if(shlConnect != null && shlConnect.getDisplay() != null) {
+            shlConnect.dispose();
+        }
+    }
+
+    public void onComplete() {
+        Display.getDefault().asyncExec(new Runnable() {
+            @Override
+            public void run() {
+                if(!isDevRemoteSource) {
+                    if(isRememberMe()) {
+                        persistPrefCredentials();
+                    }
+                    persistPrefLastServerInstance();
+                }
+                dispose();
+            }
+        });
+    }
+
+    private String generateLastModifiedTooltip(String cdmlibLastModified) {
+        if(StringUtils.isBlank(cdmlibLastModified)) {
+            return "";
+        }
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd.HH.mm.z");
+        Date cdmlibLastModifiedDate;
+        String cdmlibLastModifiedTimestamp = "";
+
+        cdmlibLastModifiedDate = new Date(Long.valueOf(cdmlibLastModified));
+        cdmlibLastModifiedTimestamp = sdf.format(cdmlibLastModifiedDate);
+
+        return cdmlibLastModifiedTimestamp;
+    }
+
+    private void setEditorInfo() {
+        txtEditorCDMVersion.setText(CdmMetaData.getDbSchemaVersion());
+        String editorVersionTimestamp = generateLastModifiedTooltip(CdmApplicationState.getCdmlibLastModified());
+        txtEditorVersion.setText(CdmApplicationState.getCdmlibVersion() + ":" + editorVersionTimestamp);
+    }
+
+    private void clearOnServerChange() {
+        setMessage("");
+        txtServerCDMVersion.setText("");
+        txtServerVersion.setText("");
+        txtServerVersion.setToolTipText("");
+        txtServerCDMVersion.setText("");
+        comboCdmInstance.removeAll();
+        txtCdmInstanceStatus.setText("");
+        txtPort.setEditable(false);
+        txtPort.setEnabled(false);
+    }
+
+    private void clearOnInstanceChange() {
+        setMessage("");
+        txtServerCDMVersion.setText("");
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void handleError(final Throwable t) {
+
+        Display.getDefault().syncExec(new Runnable() {
+            @Override
+            public void run() {
+                serverJob.cancel();
+
+                String title = "CDM Server launch error";
+                String  message = t.getMessage();
+
+
+                MessagingUtils.errorDialog(title,
+                        this,
+                        message,
+                        TaxeditorStorePlugin.PLUGIN_ID,
+                        t,
+                        true);
+            }
+        });
+    }
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/ReportTextDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/ReportTextDialog.java
new file mode 100644 (file)
index 0000000..edd320e
--- /dev/null
@@ -0,0 +1,133 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.ui.dialog;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * @author cmathew
+ * @date 22 Oct 2015
+ *
+ */
+public class ReportTextDialog extends Dialog {
+
+    private String reportText = "";
+    private String title = "";
+    /**
+     * Create the dialog.
+     * @param parentShell
+     */
+    public ReportTextDialog(Shell parentShell) {
+        super(parentShell);
+    }
+
+    /**
+     * Create contents of the dialog.
+     * @param parent
+     */
+    @Override
+    protected Control createDialogArea(final Composite parent) {
+        Composite container = (Composite) super.createDialogArea(parent);
+        GridLayout gridLayout = (GridLayout) container.getLayout();
+        gridLayout.numColumns = 2;
+
+        StyledText styledText = new StyledText(container, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.BORDER);
+        styledText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+        styledText.setText(reportText);
+
+        Button btnSave = new Button(container, SWT.NONE);
+        btnSave.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                FileDialog fileDialog = new FileDialog(parent.getShell(), SWT.SAVE);
+                // Set filter on .txt files
+                fileDialog.setFilterExtensions(new String[] { "*.txt" });
+                // Put in a readable name for the filter
+                fileDialog.setFilterNames(new String[] { "Textfiles(*.txt)" });
+                String fileName = fileDialog.open();
+                if(fileName != null) {
+                    File file = new File(fileName);
+                    if (file.exists()) {
+                        MessageBox mb = new MessageBox(fileDialog.getParent(), SWT.ICON_WARNING
+                                | SWT.YES | SWT.NO);
+                        mb.setMessage(fileName + " already exists. Do you want to replace it?");
+                        boolean override = mb.open() == SWT.YES;
+                        if(!override) {
+                            return;
+                        }
+                    }
+                    try {
+                        FileWriter fileWriter = new FileWriter(fileName, false);
+                        fileWriter.write(getReportText());
+                        fileWriter.close();
+                    } catch (IOException ioe) {
+                        throw new IllegalStateException(ioe);
+                    }
+                }
+            }
+        });
+        btnSave.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
+        btnSave.setText("save");
+
+        return container;
+    }
+
+    /**
+     * Create contents of the button bar.
+     * @param parent
+     */
+    @Override
+    protected void createButtonsForButtonBar(Composite parent) {
+        createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
+    }
+
+    @Override
+    protected void configureShell(Shell shell) {
+        super.configureShell(shell);
+        shell.setText(title);
+     }
+    /**
+     * Return the initial size of the dialog.
+     */
+    @Override
+    protected Point getInitialSize() {
+        return new Point(669, 501);
+    }
+
+    public void setReportText(String text) {
+        this.reportText = text;
+    }
+
+    public String getReportText() {
+        return reportText;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+}
index 647addd10ccaea42b89725ac4b201456b51c25e5..eb1b62d6ce804753ca8d322d580f95d7b4dc0269 100644 (file)
@@ -18,8 +18,10 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Shell;
 
 import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
+import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator;
 import eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator;
 import eu.etaxonomy.cdm.api.service.config.TaxonBaseDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
 import eu.etaxonomy.cdm.api.service.config.TaxonNodeDeletionConfigurator;
 
 /**
@@ -45,13 +47,15 @@ public class DeleteConfiguratorDialog extends MessageDialog{
     @Override
     protected Control createCustomArea(Composite parent) {
         DeleteConfiguratorComposite composite = new DeleteConfiguratorComposite(parent, NONE);
-        if(configurator instanceof TaxonBaseDeletionConfigurator){
-            composite.addConfiguratorComposite(new DeleteTaxonConfiguratorComposite((TaxonBaseDeletionConfigurator) configurator, composite.getSectionConfigure(), SWT.NONE));
+        if(configurator instanceof TaxonDeletionConfigurator){
+            composite.addConfiguratorComposite(new DeleteTaxonConfiguratorComposite((TaxonDeletionConfigurator) configurator, composite.getSectionConfigure(), SWT.NONE));
         }
         else if(configurator instanceof SpecimenDeleteConfigurator){
             composite.addConfiguratorComposite(new DeleteSpecimenConfiguratorComposite((SpecimenDeleteConfigurator) configurator, composite.getSectionConfigure(), SWT.NONE));
         } else if(configurator instanceof TaxonNodeDeletionConfigurator){
             composite.addConfiguratorComposite(new DeleteNodeConfiguratorComposite((TaxonNodeDeletionConfigurator) configurator, composite.getSectionConfigure(), SWT.NONE));
+        }  else if(configurator instanceof NameDeletionConfigurator){
+            composite.addConfiguratorComposite(new DeleteNameConfiguratorComposite((NameDeletionConfigurator) configurator, composite.getSectionConfigure(), SWT.NONE));
         }
         
         return composite;
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/deleteConfigurator/DeleteNameConfiguratorComposite.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/deleteConfigurator/DeleteNameConfiguratorComposite.java
new file mode 100644 (file)
index 0000000..ed1fd4d
--- /dev/null
@@ -0,0 +1,127 @@
+package eu.etaxonomy.taxeditor.ui.dialog.deleteConfigurator;
+
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.beans.PojoProperties;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
+/**
+ * @author kluther
+ * @date Nov 2, 2015
+ *
+ */
+public class DeleteNameConfiguratorComposite extends Composite {
+       private final DataBindingContext m_bindingContext;
+
+    private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
+    private final NameDeletionConfigurator configurator;
+    private final Button btnRemoveAllNameRelationships;
+    private final Button btnIgnoreIsBasionym;
+    private final Button btnIgnoreIsReplacedSynonymFor;
+    private final Button btnIgnoreHasBasionym;
+    private final Button btnIgnoreHasReplacedSynonym;
+    private final Button btnRemoveAllTypeDesignations;
+  
+    /*
+     * private boolean removeAllNameRelationships = false;
+       
+       private boolean ignoreIsBasionymFor = false;
+       
+       private boolean ignoreIsReplacedSynonymFor = false;
+
+       private boolean ignoreHasBasionym = true;
+       
+       private boolean ignoreHasReplacedSynonym = true;
+       
+       private boolean removeAllNameTypeDesignations = true;
+     */
+    
+
+    /**
+     * Create the composite.
+     * @param parent
+     * @param style
+     */
+    public DeleteNameConfiguratorComposite(NameDeletionConfigurator configurator, Composite parent, int style) {
+        super(parent, style);
+        this.configurator = configurator;
+        addDisposeListener(new DisposeListener() {
+            @Override
+            public void widgetDisposed(DisposeEvent e) {
+                toolkit.dispose();
+            }
+        });
+        toolkit.paintBordersFor(this);
+        setLayout(new RowLayout(SWT.VERTICAL));
+        setBackground(getBackground());
+
+        btnRemoveAllNameRelationships = new Button(this, SWT.CHECK);
+        btnRemoveAllNameRelationships.setText("Remove all Name Relationships");
+        btnRemoveAllNameRelationships.setSelection(true);
+        
+        btnIgnoreIsBasionym = new Button(this, SWT.CHECK);
+        btnIgnoreIsBasionym.setText("Ignore is Basionym");
+        btnIgnoreIsBasionym.setSelection(true);
+        
+        btnIgnoreIsReplacedSynonymFor = new Button(this, SWT.CHECK);
+        btnIgnoreIsReplacedSynonymFor.setText("Ignore is Replaced Synonym");
+        btnIgnoreIsReplacedSynonymFor.setSelection(true);
+        
+        btnIgnoreHasBasionym = new Button(this, SWT.CHECK);
+        btnIgnoreHasBasionym.setText("Ignore has Basionym");
+        btnIgnoreHasBasionym.setSelection(true);
+        
+        btnIgnoreHasReplacedSynonym = new Button(this, SWT.CHECK);
+        btnIgnoreHasReplacedSynonym.setText("Ignore has Replaced Synonym");
+        btnIgnoreHasReplacedSynonym.setSelection(true);
+        
+        btnRemoveAllTypeDesignations = new Button(this, SWT.CHECK);
+        btnRemoveAllTypeDesignations.setText("Remove all Type Designations");
+        btnRemoveAllTypeDesignations.setSelection(true);
+        
+        m_bindingContext = initDataBindings();
+
+    }
+
+    protected DataBindingContext initDataBindings() {
+        DataBindingContext bindingContext = new DataBindingContext();
+        //
+        IObservableValue observeSelectionBtnRemoveAllNameRelationshipsWidget = WidgetProperties.selection().observe(btnRemoveAllNameRelationships);
+        IObservableValue removeAllNameRelationshipsConfiguratorObserveValue = PojoProperties.value("removeAllNameRelationships").observe(configurator);
+        bindingContext.bindValue(observeSelectionBtnRemoveAllNameRelationshipsWidget, removeAllNameRelationshipsConfiguratorObserveValue, null, null);
+        
+        IObservableValue observeSelectionBtnbtnIgnoreIsBasionymObserveWidget = WidgetProperties.selection().observe(btnIgnoreIsBasionym);
+        IObservableValue ignoreIsBasionymConfiguratorObserveValue = PojoProperties.value("ignoreIsBasionymFor").observe(configurator);
+        bindingContext.bindValue(observeSelectionBtnbtnIgnoreIsBasionymObserveWidget, ignoreIsBasionymConfiguratorObserveValue, null, null);
+      
+        IObservableValue observeSelectionBtnIgnoreIsReplacedSynonymForWidget = WidgetProperties.selection().observe(btnIgnoreIsReplacedSynonymFor);
+        IObservableValue ignoreIsReplacedSynonymForConfiguratorObserveValue = PojoProperties.value("ignoreIsReplacedSynonymFor").observe(configurator);
+        bindingContext.bindValue(observeSelectionBtnIgnoreIsReplacedSynonymForWidget, ignoreIsReplacedSynonymForConfiguratorObserveValue, null, null);
+        
+        IObservableValue observeSelectionBtnIgnoreHasBasionymWidget = WidgetProperties.selection().observe(btnIgnoreHasBasionym);
+        IObservableValue ignoreHasBasionymConfiguratorObserveValue = PojoProperties.value("ignoreHasBasionym").observe(configurator);
+        bindingContext.bindValue(observeSelectionBtnIgnoreHasBasionymWidget, ignoreHasBasionymConfiguratorObserveValue, null, null);
+        
+        IObservableValue observeSelectionBtnIgnoreHasReplacedSynonymWidget = WidgetProperties.selection().observe(btnIgnoreHasReplacedSynonym);
+        IObservableValue ignoreHasReplacedSynonymConfiguratorObserveValue = PojoProperties.value("ignoreHasReplacedSynonym").observe(configurator);
+        bindingContext.bindValue(observeSelectionBtnIgnoreHasReplacedSynonymWidget, ignoreHasReplacedSynonymConfiguratorObserveValue, null, null);
+
+        IObservableValue observeSelectionBtnRemoveAllTypeDesignationsWidget = WidgetProperties.selection().observe(btnRemoveAllTypeDesignations);
+        IObservableValue removeAllNameTypeDesignationsConfiguratorObserveValue = PojoProperties.value("removeAllNameTypeDesignations").observe(configurator);
+        bindingContext.bindValue(observeSelectionBtnRemoveAllTypeDesignationsWidget, removeAllNameTypeDesignationsConfiguratorObserveValue, null, null);
+
+        //
+        return bindingContext;
+    }
+}
index 2715c99878e530c69b0651d46f45424f2e44bdbb..8147913df02b4df66fa15e89667e79920485386f 100644 (file)
@@ -37,7 +37,6 @@ public class DeleteSpecimenConfiguratorComposite extends Composite {
     private final SpecimenDeleteConfigurator configurator;
     private final Button btnDeleteChildren;
     private final Button btnDeleteFromTypeDesignation;
-    private final Button btnDeleteMolecularData;
     private final Button btnDeleteIndividualsassociationsfactual;
     private final Button btnDeleteSpecimenDescription;
 
@@ -62,16 +61,13 @@ public class DeleteSpecimenConfiguratorComposite extends Composite {
         btnDeleteChildren.setText("Delete Children");
 
         btnDeleteFromTypeDesignation = new Button(this, SWT.CHECK);
-        btnDeleteFromTypeDesignation.setText("Delete from type designation");
-
-        btnDeleteMolecularData = new Button(this, SWT.CHECK);
-        btnDeleteMolecularData.setText("Delete molecular data");
+        btnDeleteFromTypeDesignation.setText("Delete from type designations");
 
         btnDeleteIndividualsassociationsfactual = new Button(this, SWT.CHECK);
         btnDeleteIndividualsassociationsfactual.setText("Delete from factual data");
 
         btnDeleteSpecimenDescription = new Button(this, SWT.CHECK);
-        btnDeleteSpecimenDescription.setText("Delete specimen description");
+        btnDeleteSpecimenDescription.setText("Delete from \"Described specimen\" in taxon descriptions");
         m_bindingContext = initDataBindings();
 
     }
@@ -86,10 +82,6 @@ public class DeleteSpecimenConfiguratorComposite extends Composite {
         IObservableValue deleteFromTypeDesignationConfiguratorObserveValue = PojoProperties.value("deleteFromTypeDesignation").observe(configurator);
         bindingContext.bindValue(observeSelectionBtnDeleteFromTypeDesignationObserveWidget, deleteFromTypeDesignationConfiguratorObserveValue, null, null);
         //
-        IObservableValue observeSelectionBtnDeleteMolecularDataObserveWidget = WidgetProperties.selection().observe(btnDeleteMolecularData);
-        IObservableValue deleteMolecularDataConfiguratorObserveValue = PojoProperties.value("deleteMolecularData").observe(configurator);
-        bindingContext.bindValue(observeSelectionBtnDeleteMolecularDataObserveWidget, deleteMolecularDataConfiguratorObserveValue, null, null);
-        //
         IObservableValue observeSelectionBtnDeleteIndividualsassociationsfactualObserveWidget = WidgetProperties.selection().observe(btnDeleteIndividualsassociationsfactual);
         IObservableValue deleteFromIndividualsAssociationConfiguratorObserveValue = PojoProperties.value("deleteFromIndividualsAssociation").observe(configurator);
         bindingContext.bindValue(observeSelectionBtnDeleteIndividualsassociationsfactualObserveWidget, deleteFromIndividualsAssociationConfiguratorObserveValue, null, null);
index cd481441dd679b667ca8b041e669bf77ed29101b..158752aa248d7f1b52742086829a7f7f4ca1a99a 100644 (file)
@@ -9,6 +9,8 @@
 */
 package eu.etaxonomy.taxeditor.ui.dialog.deleteConfigurator;
 
+import java.util.List;
+
 import org.eclipse.core.databinding.DataBindingContext;
 import org.eclipse.core.databinding.beans.PojoProperties;
 import org.eclipse.core.databinding.observable.value.IObservableValue;
@@ -16,32 +18,52 @@ import org.eclipse.jface.databinding.swt.WidgetProperties;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.DisposeEvent;
 import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+
 import org.eclipse.swt.layout.RowLayout;
 import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 
-import eu.etaxonomy.cdm.api.service.config.TaxonBaseDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.IClassificationService;
+import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
+
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
 
 /**
  * @author pplitzner
  * @date Feb 18, 2015
  *
  */
-public class DeleteTaxonConfiguratorComposite extends Composite {
+public class DeleteTaxonConfiguratorComposite extends Composite implements SelectionListener{
     private final DataBindingContext m_bindingContext;
 
     private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
-    private final TaxonBaseDeletionConfigurator configurator;
+    private final TaxonDeletionConfigurator configurator;
     private final Button btnDeleteTaxonName;
+    private final Button btnDeleteInAllClassifications;
+    private Combo classificationSelectionCombo;
+    private 
+    
+    Classification selectedClassification;
+    private List<Classification> classifications;
+    
 
     /**
      * Create the composite.
      * @param parent
      * @param style
      */
-    public DeleteTaxonConfiguratorComposite(TaxonBaseDeletionConfigurator configurator, Composite parent, int style) {
+    public DeleteTaxonConfiguratorComposite(TaxonDeletionConfigurator configurator, Composite parent, int style) {
         super(parent, style);
         this.configurator = configurator;
         addDisposeListener(new DisposeListener() {
@@ -51,11 +73,19 @@ public class DeleteTaxonConfiguratorComposite extends Composite {
             }
         });
         toolkit.paintBordersFor(this);
-        setLayout(new RowLayout(SWT.VERTICAL));
+        setLayout(new GridLayout());
         setBackground(getBackground());
 
         btnDeleteTaxonName = new Button(this, SWT.CHECK);
         btnDeleteTaxonName.setText("Delete taxon name if possible");
+        btnDeleteTaxonName.setSelection(true);
+        
+        btnDeleteInAllClassifications = new Button(this, SWT.CHECK);
+        btnDeleteInAllClassifications.setText("Delete taxon in all classifications");
+        btnDeleteInAllClassifications.setSelection(true);
+        
+       // createClassificationSelectionCombo(this);
+        
         m_bindingContext = initDataBindings();
 
     }
@@ -65,8 +95,53 @@ public class DeleteTaxonConfiguratorComposite extends Composite {
         //
         IObservableValue observeSelectionBtnDeleteTaxonNameObserveWidget = WidgetProperties.selection().observe(btnDeleteTaxonName);
         IObservableValue deleteNameIfPossibleConfiguratorObserveValue = PojoProperties.value("deleteNameIfPossible").observe(configurator);
+        
+        IObservableValue observeSelectionBtnDeleteInAllClassificationObserveWidget = WidgetProperties.selection().observe(btnDeleteInAllClassifications);
+        IObservableValue deleteInAllClassificationsConfiguratorObserveValue = PojoProperties.value("deleteInAllClassifications").observe(configurator);
         bindingContext.bindValue(observeSelectionBtnDeleteTaxonNameObserveWidget, deleteNameIfPossibleConfiguratorObserveValue, null, null);
+        bindingContext.bindValue(observeSelectionBtnDeleteInAllClassificationObserveWidget, deleteInAllClassificationsConfiguratorObserveValue, null, null);
+        
+        
+        
         //
         return bindingContext;
     }
+    
+  /* private Control createClassificationSelectionCombo(Composite parent){
+//             classifications = CdmStore.getTaxonTreeService().list(null, null, null, null, null);
+
+               Composite classificationSelection = new Composite(parent, SWT.NULL);
+               classificationSelection.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
+
+               GridLayout layout = new GridLayout();
+               classificationSelection.setLayout(layout);
+
+               Label label = new Label(classificationSelection, SWT.NULL);
+               // TODO not working is not really true but leave it here to remind everyone that this is under construction
+               label.setText("Select Classification");
+               classificationSelectionCombo = new Combo(classificationSelection, SWT.BORDER | SWT.READ_ONLY);
+               classificationSelectionCombo.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
+               classifications = CdmStore.getService(IClassificationService.class).list(null, null, null, null, null);
+
+               for(Classification tree : classifications){
+                       classificationSelectionCombo.add(tree.getName().getText(), classifications.indexOf(tree));
+
+               }
+
+               classificationSelectionCombo.select(0);
+               classificationSelectionCombo.addSelectionListener(this);
+               
+               return classificationSelection;
+       }*/
+
+@Override
+public void widgetSelected(SelectionEvent e) {
+       selectedClassification = classifications.get(classificationSelectionCombo.getSelectionIndex());
+}
+
+@Override
+public void widgetDefaultSelected(SelectionEvent e) {
+       // TODO Auto-generated method stub
+       
+}
 }
index e714485232cb72cfaf0f9f6cc858ffd1a5f90929..a22f14454b57b8fe06cad6624edb8ee1e1ce9153 100644 (file)
@@ -32,6 +32,7 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Cursor;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Link;
@@ -71,6 +72,7 @@ public abstract class AbstractFilteredCdmResourceSelectionDialog<T extends ICdmB
 
        protected T cdmBaseToBeFiltered;
 
+
        /**
         * <p>Constructor for AbstractFilteredCdmResourceSelectionDialog.</p>
         *
@@ -89,11 +91,12 @@ public abstract class AbstractFilteredCdmResourceSelectionDialog<T extends ICdmB
                this.settings = settings;
 
                this.conversation = conversation;
-
+               this.cdmBaseToBeFiltered = cdmObject;
+               Cursor cursor = shell.getCursor();
+               shell.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
                init();
-
                initModel();
-
+               shell.setCursor(cursor);
                String objectTitle = getTitle(cdmObject);
                if (objectTitle != null) {
                        setInitialPattern(objectTitle);
@@ -474,23 +477,27 @@ public abstract class AbstractFilteredCdmResourceSelectionDialog<T extends ICdmB
                        @Override
                        public void widgetSelected(SelectionEvent e) {
 
-                               AbstractNewEntityWizard wizard = getNewEntityWizard(e.text);
-
-                               wizard.init(null, null);
-                               if(wizard.getEntity() != null) {
-                                       WizardDialog dialog = new WizardDialog(getShell(), wizard);
-                                       int status = dialog.open();
-
-                                       if (status == IStatus.OK) {
-
-                                               T entity = (T) wizard.getEntity();
-                                               refresh();
-                                               setPattern(entity);
-                                               getConversationHolder().bind();
-                                       }
-                                       //FIXME : Need to make sure this is a stable fix (ticket 3822)
-                                       getConversationHolder().commit();
-                               }
+                           AbstractNewEntityWizard wizard = getNewEntityWizard(e.text);
+                           if(wizard!=null){
+                               wizard.init(null, null);
+                               if(wizard.getEntity() != null) {
+                                   WizardDialog dialog = new WizardDialog(getShell(), wizard);
+                                   int status = dialog.open();
+
+                                   if (status == IStatus.OK) {
+
+                                       T entity = (T) wizard.getEntity();
+                                       model.add(new UuidAndTitleCache<T>(entity.getUuid(),
+                                               entity.getId(),
+                                               getTitle(entity)));
+                                       refresh();
+                                       setPattern(entity);
+                                       getConversationHolder().bind();
+                                   }
+                                   //FIXME : Need to make sure this is a stable fix (ticket 3822)
+                                   getConversationHolder().commit();
+                               }
+                           }
                        }
                };
        }
index 18555cafa5d44631d12cb85d420f58080dc62186..a3e52d6d9108d41ca618bb74722d44f604613891 100644 (file)
@@ -22,55 +22,28 @@ import eu.etaxonomy.taxeditor.newWizard.NewNonViralNameWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>FilteredNameSelectionDialog class.</p>
- *
  * @author n.hoffmann
  * @created 04.06.2009
  * @version 1.0
  */
 public class NameSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<TaxonNameBase> {
 
-       /**
-        * Creates a filtered selection dialog to select a name.
-        *
-        * @param shell
-        *                              The shell for displaying this widget
-        * @param name
-        *                              A name that should be selected when the dialog opens
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @return a {@link eu.etaxonomy.cdm.model.name.TaxonNameBase} object.
-        */
        public static TaxonNameBase select(Shell shell, ConversationHolder conversation, TaxonNameBase name) {
                NameSelectionDialog dialog = new NameSelectionDialog(shell, conversation,
                                "Choose a name", false, name);
                return getSelectionFromDialog(dialog);
        }
 
-       /**
-        * <p>Constructor for FilteredNameSelectionDialog.</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param title a {@link java.lang.String} object.
-        * @param name a {@link eu.etaxonomy.cdm.model.name.TaxonNameBase} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param multi a boolean.
-        */
        protected NameSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, TaxonNameBase name) {
                super(shell, conversation, title, multi, NameSelectionDialog.class.getCanonicalName(), name);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
-        */
        /** {@inheritDoc} */
        @Override
        protected TaxonNameBase getPersistentObject(UUID cdmUuid) {
                return CdmStore.getService(INameService.class).load(cdmUuid);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#initModel()
-        */
        /** {@inheritDoc} */
        @Override
        protected void initModel() {
index b9c1b5c078706fe7163a898c2115659ec29756cf..b671c35be679b75423e0aa11b4db97336683a9fc 100644 (file)
@@ -28,16 +28,15 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.IVocabularyService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.cdm.model.common.TermVocabulary;
-import eu.etaxonomy.cdm.model.location.Country;
 import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>FilteredNamedAreaSelectionDialog class.</p>
- *
  * @author n.hoffmann
  * @created May 11, 2010
  * @version 1.0
@@ -63,12 +62,12 @@ public class NamedAreaSelectionDialog extends
                        }else{
                                selectedVocabularies.remove(vocabulary);
                        }
-
                        initModel();
                }
        }
 
-       private Collection<TermVocabulary<NamedArea>> selectedVocabularies;
+       private Collection<TermVocabulary> selectedVocabularies;
+    private ArrayList<TermVocabulary> preselectedVocabularies;
 
 
        /**
@@ -79,25 +78,26 @@ public class NamedAreaSelectionDialog extends
         * @param namedArea
         *                              A namedArea that should be selected when the dialog opens
         * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
+        * @param preselectedVocabularyUuids the {@link UUID}s of the pre-selected vocabularies
         * @return a {@link eu.etaxonomy.cdm.model.location.NamedArea} object.
         */
-       public static NamedArea select(Shell shell, ConversationHolder conversation, NamedArea namedArea) {
+       public static NamedArea select(Shell shell, ConversationHolder conversation, NamedArea namedArea, UUID... preselectedVocabularyUuids) {
                NamedAreaSelectionDialog dialog = new NamedAreaSelectionDialog(shell, conversation,
-                               "Choose an area", false, namedArea);
+                               "Choose an area", false, namedArea, preselectedVocabularyUuids);
                return getSelectionFromDialog(dialog);
        }
 
-       /**
-        * <p>Constructor for FilteredNamedAreaSelectionDialog.</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param title a {@link java.lang.String} object.
-        * @param multi a boolean.
-        * @param namedArea a {@link eu.etaxonomy.cdm.model.location.NamedArea} object.
-        */
-       protected NamedAreaSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, NamedArea namedArea) {
+       protected NamedAreaSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, NamedArea namedArea, UUID... preselectedVocabularyUuids) {
                super(shell, conversation, title, multi, NamedAreaSelectionDialog.class.getCanonicalName(), namedArea);
+               if(preselectedVocabularyUuids.length>0){
+                   preselectedVocabularies = new ArrayList<TermVocabulary>();
+                   for(int i=0;i<preselectedVocabularyUuids.length;i++){
+                       TermVocabulary preselectedVocabulary = CdmStore.getService(IVocabularyService.class).find(preselectedVocabularyUuids[i]);
+                       preselectedVocabularies.add(preselectedVocabulary);
+                   }
+                   selectedVocabularies.retainAll(preselectedVocabularies);
+                   initModel();//re-init to consider pre-selected vocabularies
+               }
        }
 
        /** {@inheritDoc} */
@@ -106,10 +106,12 @@ public class NamedAreaSelectionDialog extends
 
                super.fillViewMenu(menuManager);
 
-               for(TermVocabulary<NamedArea> vocabulary : getVocabularies()){
+               for(TermVocabulary<NamedArea> vocabulary : getAvailableVocabularies()){
                        IncludeNamedAreaVocabulary action = new IncludeNamedAreaVocabulary(vocabulary);
                        menuManager.add(action);
-                       action.setChecked(true);
+                       if(preselectedVocabularies==null || preselectedVocabularies.isEmpty() || preselectedVocabularies.contains(vocabulary)) {
+                           action.setChecked(true);
+                       }
                }
        }
 
@@ -130,12 +132,11 @@ public class NamedAreaSelectionDialog extends
        /** {@inheritDoc} */
        @Override
        protected void init() {
-               selectedVocabularies = getVocabularies();
+               selectedVocabularies = getAvailableVocabularies();
        }
 
-       private List<TermVocabulary<NamedArea>> getVocabularies(){
-               List<TermVocabulary<NamedArea>> vocabularies = CdmStore.getService(IVocabularyService.class).listByTermClass(NamedArea.class, null, null, null, null);
-               vocabularies.add(CdmStore.getService(IVocabularyService.class).find(Country.uuidCountryVocabulary));
+       private List<TermVocabulary> getAvailableVocabularies(){
+               List<TermVocabulary> vocabularies = CdmStore.getService(IVocabularyService.class).listByTermType(TermType.NamedArea, true, null, null, null, null);
                return vocabularies;
        }
 
@@ -172,8 +173,7 @@ public class NamedAreaSelectionDialog extends
                        String result = NamedArea.labelWithLevel(namedArea, CdmStore.getDefaultLanguage());
                        return result;
                } catch (Exception e) {
-                       //TODO still need to learn how errors are handled in the Tax Editor
-                       System.out.println("Error occurred when trying retrieve title for Named Area: " + namedArea.getUuid());
+                       MessagingUtils.error(NamedAreaSelectionDialog.class, "Error occurred when trying retrieve title for Named Area: " + namedArea.getUuid(), e);
                        return namedArea.getTitleCache();
                }
        }
index 54a28eb90e8da393a1672ef28cd52aa29d2a9c58..a90ce1c9bca1c861a41b1d44c3dcd2411259cd3b 100644 (file)
@@ -12,6 +12,7 @@ package eu.etaxonomy.taxeditor.ui.dialog.selection;
 import org.eclipse.swt.widgets.Shell;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.agent.Institution;
 import eu.etaxonomy.cdm.model.agent.Person;
@@ -25,6 +26,7 @@ import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.FeatureTree;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
+import eu.etaxonomy.cdm.model.location.Country;
 import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.model.molecular.Amplification;
 import eu.etaxonomy.cdm.model.molecular.Primer;
@@ -32,6 +34,7 @@ import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.occurrence.Collection;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
@@ -39,6 +42,8 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
 
 /**
  * @author n.hoffmann
@@ -47,7 +52,11 @@ import eu.etaxonomy.taxeditor.model.MessagingUtils;
  */
 public class SelectionDialogFactory {
 
-       public static <T extends ICdmBase> T getSelectionFromDialog(Class<T> clazz, Shell shell, ConversationHolder conversation, T currentSelection){
+    public static <T extends ICdmBase> T getSelectionFromDialog(Class<T> clazz, Shell shell, ConversationHolder conversation, T currentSelection){
+        return getSelectionFromDialog(clazz, shell, conversation, currentSelection, null);
+    }
+
+       public static <T extends ICdmBase> T getSelectionFromDialog(Class<T> clazz, Shell shell, ConversationHolder conversation, T currentSelection, ICdmFormElement parentElement){
 
                if(clazz.equals(Taxon.class)){
                        return (T) TaxonBaseSelectionDialog.selectTaxon(shell, conversation, (Taxon) currentSelection);
@@ -62,7 +71,7 @@ public class SelectionDialogFactory {
                        return (T) ClassificationSelectionDialog.select(shell, conversation, (Classification) currentSelection);
                }
                if(clazz.equals(TaxonNode.class)){
-                       return (T) TaxonNodeSelectionDialog.select(shell, conversation, null, null, (TaxonNode) currentSelection, null);
+                       return (T) TaxonNodeSelectionDialog.select(shell, conversation, null, null, (TaxonNode) currentSelection, ((TaxonNode) currentSelection).getClassification());
                }
                if(clazz.equals(Reference.class)){
                        return (T) ReferenceSelectionDialog.select(shell, conversation, (Reference) currentSelection);
@@ -95,13 +104,21 @@ public class SelectionDialogFactory {
                        return null;
                }
                if(clazz.equals(DerivedUnit.class)){
-                       return (T) DerivedUnitSelectionDialog.select(shell, conversation, (DerivedUnit) currentSelection);
+                   return (T) DerivedUnitSelectionDialog.select(shell, conversation, (DerivedUnit) currentSelection);
                }
                if(clazz.equals(FieldUnit.class)){
-                       return (T) FieldUnitSelectionDialog.select(shell, conversation, (FieldUnit) currentSelection);
+                   return (T) FieldUnitSelectionDialog.select(shell, conversation, (FieldUnit) currentSelection);
+               }
+               if(clazz.equals(SpecimenOrObservationBase.class)){
+                   return (T) SpecimenOrObservationBaseSelectionDialog.select(shell, conversation, (SpecimenOrObservationBase) currentSelection);
                }
                if(clazz.equals(NamedArea.class)){
-                       return (T) NamedAreaSelectionDialog.select(shell, conversation, (NamedArea) currentSelection);
+                   if(parentElement instanceof IEntityElement && ((IEntityElement) parentElement).getEntity() instanceof DerivedUnitFacade){
+                       return (T) NamedAreaSelectionDialog.select(shell, conversation, (NamedArea) currentSelection, Country.uuidCountryVocabulary);
+                   }
+                   else{
+                       return (T) NamedAreaSelectionDialog.select(shell, conversation, (NamedArea) currentSelection);
+                   }
                }
                if(clazz.equals(Collection.class)){
                        return (T) CollectionSelectionDialog.select(shell, conversation, (Collection) currentSelection);
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SpecimenOrObservationBaseSelectionDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SpecimenOrObservationBaseSelectionDialog.java
new file mode 100644 (file)
index 0000000..589b084
--- /dev/null
@@ -0,0 +1,67 @@
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.ui.dialog.selection;
+
+import java.util.UUID;
+
+import org.eclipse.swt.widgets.Shell;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
+import eu.etaxonomy.taxeditor.newWizard.NewDerivedUnitBaseWizard;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author pplitzner
+ */
+public class SpecimenOrObservationBaseSelectionDialog extends
+               AbstractFilteredCdmResourceSelectionDialog<SpecimenOrObservationBase> {
+
+       public static SpecimenOrObservationBase select(Shell shell, ConversationHolder conversation, SpecimenOrObservationBase observation){
+               SpecimenOrObservationBaseSelectionDialog dialog = new SpecimenOrObservationBaseSelectionDialog(shell, conversation,
+                               "Choose field unit or derived unit", false, SpecimenOrObservationBaseSelectionDialog.class.getCanonicalName(), observation);
+               return getSelectionFromDialog(dialog);
+       }
+
+       protected SpecimenOrObservationBaseSelectionDialog(Shell shell, ConversationHolder conversation,
+                       String title, boolean multi, String settings,
+                       SpecimenOrObservationBase cdmObject) {
+               super(shell, conversation, title, multi, settings, cdmObject);
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       protected SpecimenOrObservationBase getPersistentObject(UUID uuid) {
+               Object object = CdmStore.getService(IOccurrenceService.class).load(uuid);
+               return HibernateProxyHelper.deproxy(object, SpecimenOrObservationBase.class);
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       protected void initModel() {
+               model = CdmStore.getService(IOccurrenceService.class).getUuidAndTitleCache();
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
+               return new NewDerivedUnitBaseWizard();
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       protected String getNewWizardLinkText() {
+               return String.format("Create a new <a>%1s</a>", "field unit/derived unit");
+       }
+}
index 99e5890e83e29da2616fd2f3863ebce081685680..a02f2c0e1d963681d507511e387ea2fe97dfd1d8 100644 (file)
-// $Id$\r
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.taxeditor.ui.dialog.selection;\r
-\r
-import java.util.UUID;\r
-\r
-import org.eclipse.swt.widgets.Composite;\r
-import org.eclipse.swt.widgets.Control;\r
-import org.eclipse.swt.widgets.Shell;\r
-\r
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
-import eu.etaxonomy.cdm.api.service.ITaxonService;\r
-import eu.etaxonomy.cdm.model.taxon.Synonym;\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-import eu.etaxonomy.cdm.model.taxon.TaxonBase;\r
-import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;\r
-import eu.etaxonomy.taxeditor.store.CdmStore;\r
-\r
-/**\r
- * <p>FilteredTaxonBaseSelectionDialog class.</p>\r
- *\r
- * @author n.hoffmann\r
- * @created Sep 21, 2009\r
- * @version 1.0\r
- */\r
-public class TaxonBaseSelectionDialog extends\r
-               AbstractFilteredCdmResourceSelectionDialog<TaxonBase> {\r
-       \r
-               \r
-       /**\r
-        * <p>select</p>\r
-        *\r
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.\r
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.\r
-        * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.\r
-        */\r
-       public static TaxonBase selectTaxonBase(Shell shell, ConversationHolder conversation) {\r
-               AbstractFilteredCdmResourceSelectionDialog<TaxonBase> dialog = new TaxonBaseSelectionDialog(TaxonBase.class, shell, conversation,\r
-                               "Choose a taxon", false, null, null);\r
-               return getSelectionFromDialog(dialog);\r
-       }\r
-       \r
-       /**\r
-        * <p>select</p>\r
-        *\r
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.\r
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.\r
-        * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.\r
-        */\r
-       public static Taxon selectTaxon(Shell shell, ConversationHolder conversation, Taxon taxonToBeFiltered) {\r
-               \r
-\r
-               AbstractFilteredCdmResourceSelectionDialog<TaxonBase> dialog = new TaxonBaseSelectionDialog(Taxon.class, shell, conversation,\r
-                               "Choose a taxon", false, null, taxonToBeFiltered);\r
-               return (Taxon) getSelectionFromDialog(dialog);\r
-       }\r
-       \r
-       /**\r
-        * <p>select</p>\r
-        *\r
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.\r
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.\r
-        * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.\r
-        */\r
-       public static Synonym selectSynonym(Shell shell, ConversationHolder conversation) {\r
-               AbstractFilteredCdmResourceSelectionDialog<TaxonBase> dialog = new TaxonBaseSelectionDialog(Synonym.class, shell, conversation,\r
-                               "Choose a taxon", false, null, null);\r
-               return (Synonym) getSelectionFromDialog(dialog);\r
-       }\r
-\r
-       private final Class<? extends TaxonBase> clazz;\r
-       \r
-       /**\r
-        * <p>Constructor for FilteredTaxonBaseSelectionDialog.</p>\r
-        *\r
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.\r
-        * @param title a {@link java.lang.String} object.\r
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.\r
-        * @param multi a boolean.\r
-        * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.\r
-        */\r
-       protected TaxonBaseSelectionDialog(Class<? extends TaxonBase> clazz, Shell shell, ConversationHolder conversation, String title, boolean multi, TaxonBase taxon, TaxonBase taxonToBeFiltered) {\r
-               super(shell, conversation, title, multi, ReferenceSelectionDialog.class.getCanonicalName(), taxon);\r
-               this.cdmBaseToBeFiltered = taxonToBeFiltered;\r
-\r
-               \r
-               \r
-               this.clazz = clazz;\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createExtendedContentArea(org.eclipse.swt.widgets.Composite)\r
-        */\r
-       /** {@inheritDoc} */\r
-       @Override\r
-       protected Control createExtendedContentArea(Composite parent) {\r
-               return null;\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)\r
-        */\r
-       /** {@inheritDoc} */\r
-       @Override\r
-       protected TaxonBase getPersistentObject(UUID uuid) {\r
-               return CdmStore.getService(ITaxonService.class).load(uuid);\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#initModel()\r
-        */\r
-       /** {@inheritDoc} */\r
-       @Override\r
-       protected void initModel() {\r
-               if(clazz == TaxonBase.class){\r
-                       model = CdmStore.getService(ITaxonService.class).getUuidAndTitleCache();\r
-               }\r
-               else if(clazz == Taxon.class){\r
-                                               \r
-                       model = CdmStore.getService(ITaxonService.class).getUuidAndTitleCacheTaxon();\r
-                       \r
-               }\r
-               else if(clazz == Synonym.class){\r
-                       model = CdmStore.getService(ITaxonService.class).getUuidAndTitleCacheSynonym();\r
-               }\r
-       }\r
-\r
-       /** {@inheritDoc} */\r
-       @Override\r
-       protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {\r
-               return null;\r
-       }\r
-\r
-       /** {@inheritDoc} */\r
-       @Override\r
-       protected String getNewWizardLinkText() {\r
-               return null;\r
-       }\r
-}\r
+// $Id$
+/**
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+
+package eu.etaxonomy.taxeditor.ui.dialog.selection;
+
+import java.util.UUID;
+
+import org.eclipse.swt.widgets.Shell;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.model.taxon.Synonym;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
+import eu.etaxonomy.taxeditor.newWizard.NewTaxonWizard;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author n.hoffmann
+ * @created Sep 21, 2009
+ * @version 1.0
+ */
+public class TaxonBaseSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<TaxonBase> {
+
+
+    public static TaxonBase selectTaxonBase(Shell shell, ConversationHolder conversation) {
+        AbstractFilteredCdmResourceSelectionDialog<TaxonBase> dialog = new TaxonBaseSelectionDialog(TaxonBase.class, shell, conversation,
+                "Choose a taxon/synonym", false, null, null);
+        return getSelectionFromDialog(dialog);
+    }
+
+    public static Taxon selectTaxon(Shell shell, ConversationHolder conversation, Taxon taxonToBeFiltered) {
+
+
+        AbstractFilteredCdmResourceSelectionDialog<TaxonBase> dialog = new TaxonBaseSelectionDialog(Taxon.class, shell, conversation,
+                "Choose a taxon", false, null, taxonToBeFiltered);
+        return (Taxon) getSelectionFromDialog(dialog);
+    }
+
+    public static Synonym selectSynonym(Shell shell, ConversationHolder conversation) {
+        AbstractFilteredCdmResourceSelectionDialog<TaxonBase> dialog = new TaxonBaseSelectionDialog(Synonym.class, shell, conversation,
+                "Choose a synonym", false, null, null);
+        return (Synonym) getSelectionFromDialog(dialog);
+    }
+
+    private final Class<? extends TaxonBase> clazz;
+
+    protected TaxonBaseSelectionDialog(Class<? extends TaxonBase> clazz, Shell shell, ConversationHolder conversation, String title, boolean multi, TaxonBase taxon, TaxonBase taxonToBeFiltered) {
+        super(shell, conversation, title, multi, TaxonBaseSelectionDialog.class.getCanonicalName(), taxon);
+        this.cdmBaseToBeFiltered = taxonToBeFiltered;
+        this.clazz = clazz;
+        initModel();
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    protected TaxonBase getPersistentObject(UUID uuid) {
+        return CdmStore.getService(ITaxonService.class).load(uuid);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    protected void initModel() {
+        if(clazz == TaxonBase.class){
+            model = CdmStore.getService(ITaxonService.class).getUuidAndTitleCache();
+        }
+        else if(clazz == Taxon.class){
+            model = CdmStore.getService(ITaxonService.class).getUuidAndTitleCacheTaxon();
+        }
+        else if(clazz == Synonym.class){
+            model = CdmStore.getService(ITaxonService.class).getUuidAndTitleCacheSynonym();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
+        return new NewTaxonWizard();
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    protected String getNewWizardLinkText() {
+        return String.format("Create a new <a>%1s</a>", "Taxon ");
+    }
+}
index a5a3ba167148fc74c4b2b8f07fdfc31fc3fcba42..35239371ca5ab3ccaa73602f62ed12fe85a1c447 100644 (file)
@@ -3,6 +3,8 @@
  */
 package eu.etaxonomy.taxeditor.ui.dialog.selection;
 
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.List;
 import java.util.UUID;
 
@@ -26,23 +28,11 @@ import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>FilteredTaxonNodeSelectionDialog class.</p>
- *
  * @author p.ciardelli
  * @version $Id: $
  */
 public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<TaxonNode> implements SelectionListener{
 
-       /**
-        * <p>select</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param title a {@link java.lang.String} object.
-        * @param excludeTaxa a {@link java.util.List} object.
-        * @param node a {@link eu.etaxonomy.cdm.model.taxon.TaxonNode} object.
-        * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonNode} object.
-        */
        public static TaxonNode select(Shell shell, ConversationHolder conversation, String title, List<UUID> excludeTaxa, TaxonNode node, Classification classification) {
                TaxonNodeSelectionDialog dialog = new TaxonNodeSelectionDialog(shell,
                                conversation,
@@ -59,17 +49,8 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
        private List<Classification> classifications;
 
        private Classification selectedClassification;
+       private final List<UUID> excludeTaxa;
 
-       /**
-        * <p>Constructor for FilteredTaxonNodeSelectionDialog.</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param title a {@link java.lang.String} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param excludeTaxa a {@link java.util.List} object.
-        * @param multi a boolean.
-        * @param node a {@link eu.etaxonomy.cdm.model.taxon.TaxonNode} object.
-        */
        protected TaxonNodeSelectionDialog(Shell shell, ConversationHolder conversation, String title, List<UUID> excludeTaxa, boolean multi, TaxonNode node, Classification classification) {
                super(shell, conversation, title, multi, TaxonNodeSelectionDialog.class.getCanonicalName(), node);
 
@@ -77,16 +58,13 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
 
                setListLabelProvider(labelProvider);
                setDetailsLabelProvider(labelProvider);
-
+               this.excludeTaxa = excludeTaxa;
                if(classification != null){
                        selectedClassification = classification;
                }
+               initModel();
        }
 
-
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createExtendedContentArea(org.eclipse.swt.widgets.Composite)
-        */
        /** {@inheritDoc} */
        @Override
        protected Control createExtendedContentArea(Composite parent) {
@@ -136,18 +114,12 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
                return "";
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
-        */
        /** {@inheritDoc} */
        @Override
        protected TaxonNode getPersistentObject(UUID uuid) {
                return CdmStore.getService(IClassificationService.class).getTaxonNodeByUuid(uuid);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#initModel()
-        */
        /** {@inheritDoc} */
        @Override
        protected void initModel() {
@@ -157,10 +129,21 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
 
                if(classifications == null){
                        classifications = CdmStore.getService(IClassificationService.class).list(null, null, null, null, null);
-                       selectedClassification = classifications.iterator().next();
+                       Collections.sort(classifications, new Comparator<Classification>() {
+
+                @Override
+                public int compare(Classification o1, Classification o2) {
+                    return o1.getTitleCache().compareTo(o2.getTitleCache());
+                }
+            });
+                       if (this.cdmBaseToBeFiltered == null){
+                           selectedClassification = classifications.iterator().next();
+                       } else {
+                           selectedClassification = this.cdmBaseToBeFiltered.getClassification();
+                       }
                }
 
-               model = CdmStore.getService(IClassificationService.class).getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(selectedClassification);
+               model = CdmStore.getService(IClassificationService.class).getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(selectedClassification.getUuid(), excludeTaxa);
        }
 
        /** {@inheritDoc} */
index e04928fa8f31ed0575a4354fd6857df368c54c65..b017125b6e62fcf8d31136e42676c0328b81c98e 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -17,6 +17,7 @@ import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
@@ -28,7 +29,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
  * <p>
  * Abstract AbstractCdmEntityWizardPage class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Jun 1, 2010
  * @version 1.0
@@ -46,7 +47,7 @@ public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage
         * <p>
         * Constructor for AbstractCdmEntityWizardPage.
         * </p>
-        * 
+        *
         * @param formFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
@@ -82,7 +83,7 @@ public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
         * .Composite)
@@ -96,7 +97,9 @@ public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage
                Composite control = formFactory.createComposite(scrolledForm.getBody());
                control.setLayoutData(LayoutConstants.FILL());
 
-               control.setLayout(LayoutConstants.LAYOUT(2, false));
+               TableWrapLayout layout = LayoutConstants.LAYOUT(2, false);
+               layout.horizontalSpacing = 5;
+        control.setLayout(layout);
                WizardPageRootElement rootElement = new WizardPageRootElement(
                                formFactory, control, getConversationHolder());
 
@@ -115,7 +118,7 @@ public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage
         * <p>
         * Getter for the field <code>entity</code>.
         * </p>
-        * 
+        *
         * @return a T object.
         */
        public T getEntity() {
@@ -124,7 +127,7 @@ public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage
 
        /**
         * Creates the detail element for this wizard page
-        * 
+        *
         * @param rootElement
         *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
         *            object.
@@ -169,6 +172,17 @@ public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage
                if (event.getSource() == getDetailElement()) {
                        checkComplete();
                }
+               else if(event.getSource() instanceof AbstractCdmDetailElement){
+                   //check if parent element is set as detail element
+                   ICdmFormElement formElement = (ICdmFormElement) event.getSource();
+            while(formElement.getParentElement()!=null){
+                if(formElement.getParentElement() == getDetailElement()){
+                    checkComplete();
+                    return;
+                }
+                formElement = formElement.getParentElement();
+            }
+               }
        }
 
        /**
@@ -191,7 +205,7 @@ public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage
         * <p>
         * getConversationHolder
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
         *         object.
         */
@@ -214,7 +228,7 @@ public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage
         * <p>
         * Getter for the field <code>detailElement</code>.
         * </p>
-        * 
+        *
         * @return a
         *         {@link eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement}
         *         object.
index a50561e501a82bb5de8d37b8de0b2fb76dfdcc85..1ef071eac9e2459747c492f0427ad7c43b04acee 100644 (file)
@@ -104,6 +104,7 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements ISe
                TableWrapLayout layout = LayoutConstants.LAYOUT();
                layout.bottomMargin = 10;
                layout.rightMargin = 5;
+               layout.horizontalSpacing = 5;
 
                client.setLayout(layout);
 
@@ -569,16 +570,19 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements ISe
         */
        @Override
     public ConversationHolder getConversationHolder() {
-               if(getParentElement() instanceof RootElement || getParentElement() == null){
-
-                       IEditorPart activeEditor = AbstractUtility.getActiveEditor();
-                       if(activeEditor instanceof IConversationEnabled){
-                               ConversationHolder conversation = ((IConversationEnabled) AbstractUtility.getActiveEditor()).getConversationHolder();
-                               return conversation;
-                       }
-               }else if(getParentElement() instanceof IConversationEnabled){
-                       return ((IConversationEnabled) getParentElement()).getConversationHolder();
-               }
+           if(AbstractUtility.getActivePart() instanceof IConversationEnabled){
+            return ((IConversationEnabled) AbstractUtility.getActivePart()).getConversationHolder();
+        }
+           if(getParentElement() instanceof RootElement || getParentElement() == null){
+
+               IEditorPart activeEditor = AbstractUtility.getActiveEditor();
+               if(activeEditor instanceof IConversationEnabled){
+                   ConversationHolder conversation = ((IConversationEnabled) AbstractUtility.getActiveEditor()).getConversationHolder();
+                   return conversation;
+               }
+           }else if(getParentElement() instanceof IConversationEnabled){
+               return ((IConversationEnabled) getParentElement()).getConversationHolder();
+           }
                MessagingUtils.messageDialog("Could not get conversation for AbstractFormSection",
                                getClass(), "There is an error in the implementation. There should have been an active editor but it wasn't",
                                new IllegalArgumentException());
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/AbstractUriWithExceptionLabelElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/AbstractUriWithExceptionLabelElement.java
new file mode 100644 (file)
index 0000000..78ca149
--- /dev/null
@@ -0,0 +1,81 @@
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.ui.element;
+
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+import eu.etaxonomy.taxeditor.Messages;
+
+/**
+ *
+ * @author pplitzner
+ * @date Sep 21, 2015
+ *
+ */
+public abstract class AbstractUriWithExceptionLabelElement <T> extends TextWithLabelElement {
+
+    protected Label labelException;
+
+       protected AbstractUriWithExceptionLabelElement(CdmFormFactory formFactory,
+                       ICdmFormElement parentElement, String labelString,
+                       T initialObject, Integer textHeight, int style) {
+               super(formFactory, parentElement, false);
+
+        init(formFactory, labelString, initialObject, textHeight, style);
+    }
+
+    protected void init(CdmFormFactory formFactory, String labelString, T initialObject, Integer textHeight, int style) {
+        //label
+        initLabel(formFactory, labelString, false, getLayoutComposite());
+
+        //uri text
+        initText(formFactory, null, textHeight, null, false, style, getLayoutComposite());
+
+        //exceptionLabel
+        initExceptionLabel(getLayoutComposite(), formFactory, initialObject);
+    }
+
+    protected void initExceptionLabel(Composite parent, CdmFormFactory formFactory, T initialObject) {
+        labelException = formFactory.createLabel(parent, "", SWT.WRAP); //$NON-NLS-1$
+               int numColumns = AbstractFormSection.DEFAULT_NUM_COLUMNS;
+               if(parent.getLayout() instanceof TableWrapLayout){
+                   numColumns = ((TableWrapLayout)parent.getLayout()).numColumns;
+               }
+        labelException.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(numColumns, 1));
+               addControl(labelException);
+               setParsedText(initialObject);
+    }
+
+
+    public abstract void setParsedText(T object);
+
+    protected abstract T getParsedText() throws Exception;
+
+    public T parseText(){
+        try {
+            labelException.setFont(JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT));
+            labelException.setForeground(getPersistentBackground());
+            labelException.setText(""); //$NON-NLS-1$
+            return getParsedText();
+        } catch (Exception e) {
+            labelException.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
+            labelException.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+            labelException.setText(Messages.UriWithLabelElement_URL_NOT_SAVED+e.getLocalizedMessage());
+            return null;
+        }
+    }
+
+}
index f44a4373b407d2b2a28714ee2ea585313e60e27a..8052c82f410c67ed1d40c7a2ca290f10e7e8f5bf 100644 (file)
@@ -58,6 +58,7 @@ import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.common.IEnumTerm;
 import eu.etaxonomy.cdm.model.common.IdentifiableSource;
 import eu.etaxonomy.cdm.model.common.Identifier;
+import eu.etaxonomy.cdm.model.common.LSID;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.common.LanguageString;
 import eu.etaxonomy.cdm.model.common.Marker;
@@ -101,6 +102,7 @@ import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.model.taxon.TaxonNodeAgentRelation;
 import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
@@ -126,6 +128,8 @@ import eu.etaxonomy.taxeditor.ui.section.agent.TeamMemberSection;
 import eu.etaxonomy.taxeditor.ui.section.agent.TeamOrPersonBaseDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.classification.ClassificationDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.classification.ClassificationDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.classification.TaxonNodeAgentRelationCollectionElement;
+import eu.etaxonomy.taxeditor.ui.section.classification.TaxonNodeAgentRelationCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.classification.TaxonNodeDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.classification.TaxonNodeDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.common.ReferenceEntityDetailElement;
@@ -223,6 +227,7 @@ import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitGeneralDetailSectio
 import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.GeoScopeDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.GeoScopePolyKeyDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.NamedAreaDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.OriginalLabelDataSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.SourceCollectionDetailSection;
@@ -230,14 +235,13 @@ import eu.etaxonomy.taxeditor.ui.section.occurrence.SpecimenCollectionDetailElem
 import eu.etaxonomy.taxeditor.ui.section.occurrence.SpecimenCollectionDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.SpecimenHierarchyDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.SpecimenHierarchyDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.association.DerivedUnitTypeDesignationElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.association.DerivedUnitTypeDesignationSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.association.TaxonAssociationDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.association.TaxonAssociationDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenCurrentDeterminationDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenDeterminationDetailElement;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenDeterminationDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenDeterminationHistoryDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenGeneralDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenGeneralDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenSourceCollectionDetailSection;
@@ -669,6 +673,14 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
+    public LsidWithExceptionLabelElement createLsidWithExceptionLabelElement(ICdmFormElement parentElement, String labelString,
+            LSID initialLsid, int style) {
+        LsidWithExceptionLabelElement element = new LsidWithExceptionLabelElement(this, parentElement, labelString, initialLsid, null, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
     public UriWithLabelElement createUriWithLabelElement(ICdmFormElement parentElement, String labelString,
             URI initialUri, int style) {
         UriWithLabelElement element = new UriWithLabelElement(this, parentElement, labelString, initialUri, null, style);
@@ -1543,8 +1555,8 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
-    public NonViralNameDetailSection createNonViralNameDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        NonViralNameDetailSection section = new NonViralNameDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public NonViralNameDetailSection createNonViralNameDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, boolean nameChoosable, int style){
+        NonViralNameDetailSection section = new NonViralNameDetailSection(this, conversation, parentElement, selectionProvider, nameChoosable, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
@@ -1579,6 +1591,12 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
+    public DerivedUnitTypeDesignationSection createDerivedUnitTypeDesignationSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DerivedUnitTypeDesignationSection section = new DerivedUnitTypeDesignationSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
     public TaxonAssociationDetailSection createTaxonAssociationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
         TaxonAssociationDetailSection section = new TaxonAssociationDetailSection(this, conversation, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
@@ -1765,12 +1783,6 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
-    public PreservedSpecimenDeterminationDetailSection createPreservedSpecimenDeterminationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        PreservedSpecimenDeterminationDetailSection section = new PreservedSpecimenDeterminationDetailSection(this, conversation, parentElement, selectionProvider, style);
-        addAndAdaptSection(parentElement, section);
-        return section;
-    }
-
     public TaxonRelationshipDetailSection createTaxonRelationshipDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
         TaxonRelationshipDetailSection section = new TaxonRelationshipDetailSection(this, conversation, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
@@ -1898,8 +1910,16 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-    public TaxonNodeDetailElement createTaxonNodeDetailElement(ICdmFormElement parentElement){
-        TaxonNodeDetailElement element = new TaxonNodeDetailElement(this, parentElement);
+    public TaxonNodeAgentRelationCollectionSection createTaxonNodeAgentRelationCollectionElement(ICdmFormElement parentElement, ConversationHolder conversation, int style){
+        TaxonNodeAgentRelationCollectionSection element = new TaxonNodeAgentRelationCollectionSection(this, conversation, parentElement, style);
+        adapt(element);
+        parentElement.addElement(element);
+
+        return element;
+    }
+
+    public TaxonNodeDetailElement createTaxonNodeDetailElement(ICdmFormElement parentElement, boolean createNew){
+        TaxonNodeDetailElement element = new TaxonNodeDetailElement(this, parentElement, createNew);
         addAndAdaptElement(parentElement, element);
         return element;
     }
@@ -2121,12 +2141,6 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-    public PreservedSpecimenDeterminationDetailElement createPreservedSpecimenDeterminationDetailElement(ICdmFormElement parentElement) {
-        PreservedSpecimenDeterminationDetailElement element = new PreservedSpecimenDeterminationDetailElement(this, parentElement);
-        addAndAdaptElement(parentElement, element);
-        return element;
-    }
-
     public DeterminationDetailElement createDeterminationDetailElement(ICdmFormElement parentElement) {
         DeterminationDetailElement element = new DeterminationDetailElement(this, parentElement);
         addAndAdaptElement(parentElement, element);
@@ -2323,6 +2337,12 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
+    public GeoScopePolyKeyDetailSection createGeoScopePolyKeyDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        GeoScopePolyKeyDetailSection section = new GeoScopePolyKeyDetailSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
     public IdentifierDetailSection createIdentifierDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
         IdentifierDetailSection section = new IdentifierDetailSection(this, conversation, parentElement, style);
         addAndAdaptSection(parentElement, section);
@@ -2359,12 +2379,6 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
-    public PreservedSpecimenDeterminationHistoryDetailSection createPreservedSpecimenDeterminationHistoryDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        PreservedSpecimenDeterminationHistoryDetailSection section = new PreservedSpecimenDeterminationHistoryDetailSection(this, conversation, parentElement, style);
-        addAndAdaptSection(parentElement, section);
-        return section;
-    }
-
     public SpecimenCollectionDetailSection createSpecimenCollectionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
         SpecimenCollectionDetailSection section = new SpecimenCollectionDetailSection(this, conversation, parentElement, style);
         addAndAdaptSection(parentElement, section);
@@ -2413,6 +2427,7 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
+
     public AbstractEntityCollectionElement createEntityCollectionElement(AbstractFormSection parentElement,
             Object versionableEntity, SelectionListener removeListener, Color backgroundColor, int style) {
         AbstractEntityCollectionElement element = null;
@@ -2421,7 +2436,7 @@ public class CdmFormFactory extends FormToolkit {
 
         if (entity instanceof Annotation) {
             element = new AnnotationElement(this, parentElement, (Annotation) entity, removeListener, style);
-        } else if (entity instanceof Person) {
+        }else if (entity instanceof Person) {
             element = new TeamMemberElement(this, parentElement, (Person) entity, removeListener, style);
         } else if (entity instanceof Credit) {
             element = new CreditElement(this, parentElement, (Credit) entity, removeListener, style);
@@ -2429,7 +2444,9 @@ public class CdmFormFactory extends FormToolkit {
             element = new ExtensionElement(this, parentElement, (Extension) entity, removeListener, style);
         } else if (entity instanceof Marker) {
             element = new MarkerElement(this, parentElement, (Marker) entity, removeListener, style);
-        } else if (entity instanceof Media) {
+        } else if (entity instanceof TaxonNodeAgentRelation) {
+            element = new TaxonNodeAgentRelationCollectionElement(this, parentElement, (TaxonNodeAgentRelation) entity, removeListener, backgroundColor, style);
+        }else if (entity instanceof Media) {
             element = new MediaMetaElement(this, parentElement, (Media) entity, removeListener, true, style);
         } else if (entity instanceof MediaRepresentation) {
             element = new MediaRepresentationElement(this, parentElement, (MediaRepresentation) entity, removeListener,
@@ -2447,7 +2464,11 @@ public class CdmFormFactory extends FormToolkit {
         } else if (entity instanceof DescriptionElementSource) {
             element = new DescriptionElementSourceElement(this, parentElement, (DescriptionElementSource) entity,
                     removeListener, style);
-        } else if (entity instanceof IdentifiableSource) {
+        } else if (entity instanceof TaxonNodeAgentRelation) {
+            element = new TaxonNodeAgentRelationCollectionElement(this, parentElement, (TaxonNodeAgentRelation) entity,
+                    removeListener,backgroundColor, style);
+        }
+        else if (entity instanceof IdentifiableSource) {
             element = new IdentifiableSourceElement(this, parentElement, (IdentifiableSource) entity, removeListener,
                     style);
         } else if (entity instanceof DefinedTerm) {
@@ -2487,8 +2508,14 @@ public class CdmFormFactory extends FormToolkit {
             element = new SynonymRelationshipDetailElement(this, parentElement, (SynonymRelationship) entity, removeListener,
                     style);
         } else if (entity instanceof SpecimenTypeDesignation) {
-            element = new SpecimenTypeDesignationElement(this, parentElement, (SpecimenTypeDesignation) entity,
-                    removeListener, style);
+            if(parentElement instanceof DerivedUnitTypeDesignationSection){
+                element = new DerivedUnitTypeDesignationElement(this, parentElement, (SpecimenTypeDesignation) entity,
+                        removeListener, style);
+            }
+            else{
+                element = new SpecimenTypeDesignationElement(this, parentElement, (SpecimenTypeDesignation) entity,
+                        removeListener, style);
+            }
         } else if (entity instanceof StateData) {
             element = new StateDataElement(this, parentElement, (StateData) entity, removeListener, style);
         } else if (entity instanceof StatisticalMeasurementValue) {
@@ -2558,6 +2585,7 @@ public class CdmFormFactory extends FormToolkit {
             element = new StatisticalMeasureCollectionElement(this, parentElement, (StatisticalMeasure) entity, removeListener, backgroundColor, style);
         }
 
+
         if (element == null) {
             MessagingUtils.messageDialog("No element for entity", this,
                     "Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
@@ -2607,7 +2635,7 @@ public class CdmFormFactory extends FormToolkit {
      *            a {@link ConversationHolder} object.
      * @return a {@link EntitySelectionElement} object.
      */
-    public <T extends ICdmBase> EntitySelectionElement<T> createSelectionElement(Class<T> clazz,
+    public <T extends CdmBase> EntitySelectionElement<T> createSelectionElement(Class<T> clazz,
             ConversationHolder conversation, ICdmFormElement parentElement, String labelString, T selection, int mode,
             int style) {
         EntitySelectionElement<T> element = new EntitySelectionElement<T>(this, conversation, parentElement, clazz,
@@ -2649,7 +2677,7 @@ public class CdmFormFactory extends FormToolkit {
      *            a {@link ConversationHolder} object.
      * @return a {@link EntitySelectionElement} object.
      */
-    public <T extends ICdmBase> EntitySelectionElementWithAbbreviatedTitle<T> createSelectionElementWithAbbreviatedTitle(
+    public <T extends CdmBase> EntitySelectionElementWithAbbreviatedTitle<T> createSelectionElementWithAbbreviatedTitle(
             Class<T> clazz, ConversationHolder conversation, ICdmFormElement parentElement, String labelString,
             T selection, int mode, int style) {
         EntitySelectionElementWithAbbreviatedTitle<T> element = new EntitySelectionElementWithAbbreviatedTitle<T>(this, conversation, parentElement, clazz,
@@ -2784,4 +2812,17 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
+    /**
+     * @param formElement
+     * @param conversationHolder
+     * @param style
+     * @return
+     */
+    public TaxonNodeAgentRelationCollectionSection createTaxonNodeAgentRelationCollectionSection(
+            ICdmFormElement formElement, ConversationHolder conversationHolder, int style) {
+        TaxonNodeAgentRelationCollectionSection section = new TaxonNodeAgentRelationCollectionSection(this, conversationHolder, formElement, style);
+        addAndAdaptSection(formElement, section);
+        return section;
+    }
+
 }
index 992c3127d2bce41a5e5ac1333000dd3c5fad827c..35e10d082e3c369200d2a3b015a25d052de48138 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -22,7 +22,7 @@ import eu.etaxonomy.cdm.strategy.parser.TimePeriodParser;
  * <p>
  * DateDetailSection class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Mar 31, 2010
  * @version 1.0
@@ -39,7 +39,7 @@ public class DateDetailSection extends AbstractFormSection<TimePeriod> {
         * <p>
         * Constructor for DateDetailSection.
         * </p>
-        * 
+        *
         * @param formFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
@@ -54,8 +54,8 @@ public class DateDetailSection extends AbstractFormSection<TimePeriod> {
                super(formFactory, parentElement, style);
 
                partialElement_start = formFactory.createPartialElement(this,
-                               "Start: ", null, style);
-               partialElement_end = formFactory.createPartialElement(this, "End: ",
+                               "Start ", null, style);
+               partialElement_end = formFactory.createPartialElement(this, "End ",
                                null, style);
 
                text_parseText = formFactory.createTextWithLabelElement(this, "Parse",
@@ -78,12 +78,12 @@ public class DateDetailSection extends AbstractFormSection<TimePeriod> {
                }
                return super.getEntity();
        }
-       
+
        /**
         * <p>
         * Setter for the field <code>timePeriod</code>.
         * </p>
-        * 
+        *
         * @param timePeriod
         *            a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
         */
@@ -93,7 +93,7 @@ public class DateDetailSection extends AbstractFormSection<TimePeriod> {
                updateTitle();
                text_parseText.setText(timePeriod.toString());
        }
-       
+
        /**
         * When setting the entity through parsing we do not want to alter the parse field
         * @param timePeriod
@@ -147,7 +147,7 @@ public class DateDetailSection extends AbstractFormSection<TimePeriod> {
                } else if (eventSource == text_parseText) {
                        cursorPosition = ((Text) text_parseText.getMainControl())
                                        .getCaretPosition();
-                       setEntityInternally(TimePeriodParser.parseString(text_parseText.getText()));                    
+                       setEntityInternally(TimePeriodParser.parseString(text_parseText.getText()));
                } else if (eventSource == text_freeText) {
                        getEntity().setFreeText(text_freeText.getText());
                }
@@ -160,10 +160,10 @@ public class DateDetailSection extends AbstractFormSection<TimePeriod> {
                this.setText(title);
                layout();
        }
-       
+
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.forms.AbstractFormSection#dispose()
         */
        /** {@inheritDoc} */
index 608206b020b307da3a07b916cb486e63a8862623..4eadc9c096656f4d409ccb14f51247f91a86352c 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -13,7 +13,18 @@ package eu.etaxonomy.taxeditor.ui.element;
 
 
 /**
- * <p>ISelectableElement interface.</p>
+ * Implementors of this interface provide a {@link SelectionArbitrator}.<br>
+ * The arbitrator allows the element to be selected to show e.g.
+ * supplemental data.<br>
+ * An arbitrator can be added like in the following code example:
+ * <br>
+ * <br>
+ * <pre>
+ * //make element selectable
+ *  if(cdmFormFactory.getSelectionProvider() != null){
+ *     selectionArbitrator = cdmFormFactory.createSelectionArbitrator(this);
+ *  }
+ *  </pre>
  *
  * @author n.hoffmann
  * @created Mar 5, 2010
index 090413bb9fe20aea585212bfe59d5cfc7b5bce54..c041c7a236f72e651d1fa530b4921cde33c7375e 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -32,11 +32,10 @@ import org.eclipse.swt.widgets.Event;
 import org.eclipse.ui.forms.widgets.TableWrapData;
 
 import eu.etaxonomy.cdm.common.UriUtils;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
- * <p>ImageElement class.</p>
- *
  * @author n.hoffmann
  * @created Sep 24, 2010
  * @version 1.0
@@ -45,59 +44,41 @@ public class ImageElement extends AbstractCdmFormElement implements PaintListene
 
        private URI imageUri;
        private Image image;
-       
+
        private Composite container;
 
-       /**
-        * <p>Constructor for ImageElement.</p>
-        *
-        * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
-        * @param imageUri a {@link java.net.URI} object.
-        * @param style a int.
-        */
+       private final Runnable postRunnable = new Runnable(){
+        @Override
+        public void run() {
+            AbstractUtility.reflowDetailsViewer();
+            AbstractUtility.reflowSupplementalViewer();
+        }
+    };
+
        protected ImageElement(CdmFormFactory formFactory, ICdmFormElement parentElement, URI imageUri, int style) {
                super(formFactory, parentElement);
-                               
+
                container = new Composite(getLayoutComposite(), style);
                container.setLayoutData(LayoutConstants.FILL(2, 1));
-               
+
                container.addPaintListener(this);
        }
 
-       /**
-        * <p>Setter for the field <code>imageUri</code>.</p>
-        *
-        * @param uri a {@link java.net.URI} object.
-        * @throws HttpException 
-        * @throws IOException 
-        */
        public void initImageUri(URI uri) throws IOException, HttpException {
                this.imageUri = uri;
                InputStream imageStream = UriUtils.getInputStream(imageUri);
                image = new Image(Display.getCurrent(), imageStream);
        }
-       
-       
-       /**
-        * <p>Getter for the field <code>imageUri</code>.</p>
-        *
-        * @return the imageUri
-        */
+
+
        public URI getImageUri() {
                return imageUri;
        }
-       
+
        public void loadImage(){
-               loadImage(null);
-       }
-       
-       
-       
-       public void loadImage(final Runnable postRunnable){
                if(getImageUri() != null){
                        Job job = new Job("Loading image") {
-                               
+
                                @Override
                                protected IStatus run(IProgressMonitor monitor) {
                                        IRunnableWithProgress runnable = getLoadImageRunnable(postRunnable);
@@ -106,19 +87,17 @@ public class ImageElement extends AbstractCdmFormElement implements PaintListene
                                        } catch (Exception e) {
                                                MessagingUtils.messageDialog("Could not load image", getClass(), e.getMessage()  + ": " +  getImageUri(), e);
                                        }
-                                       
+
                                        return Status.OK_STATUS;
                                }
                        };
                        job.schedule();
                }
        }
-       
 
-
-       public void unloadImage(final Runnable postRunnable) {
+       public void unloadImage() {
                Job job = new Job("Unloading image") {
-                       
+
                        @Override
                        protected IStatus run(IProgressMonitor monitor) {
                                IRunnableWithProgress runnable = getLoadImageRunnable(postRunnable);
@@ -127,29 +106,29 @@ public class ImageElement extends AbstractCdmFormElement implements PaintListene
                                } catch (Exception e) {
                                        MessagingUtils.messageDialog("Could not unload image", getClass(), e.getMessage()  + ": " +  getImageUri(), e);
                                }
-                               
+
                                return Status.OK_STATUS;
                        }
                };
                job.schedule();
-               
+
        }
-       
+
        public IRunnableWithProgress getLoadImageRunnable(final Runnable postRunnable){
-                       
-               final Display display = getLayoutComposite().getDisplay(); 
-               
+
+               final Display display = getLayoutComposite().getDisplay();
+
                IRunnableWithProgress runnable = new IRunnableWithProgress(){
-                       
+
                        @Override
                        public void run(IProgressMonitor monitor) {
                                monitor.beginTask("Loading: " + getImageUri(), IProgressMonitor.UNKNOWN);
-                                                               
+
                                // redraw the image container
                                display.asyncExec(new Runnable(){
                                        @Override
                                        public void run() {
-                                               if(! getLayoutComposite().isDisposed()){
+                                               if(! getLayoutComposite().isDisposed() && container!=null){
                                                        Event untypedEvent = new Event();
                                                        untypedEvent.widget = container;
                                                        PaintEvent event = new PaintEvent(untypedEvent);
@@ -159,37 +138,45 @@ public class ImageElement extends AbstractCdmFormElement implements PaintListene
                                                }
                                        }
                                });
-                               
+
                                // execute the external runnable
                                if(postRunnable != null){
                                        display.asyncExec(postRunnable);
                                }
-                               monitor.done();         
+                               monitor.done();
                        }
 
                };
-               
+
                return runnable;
        }
-       
+
        private Rectangle calculateImageBounds(Image image, Control control){
                Rectangle imageBounds = image.getBounds();
                Rectangle containerBounds = control.getBounds();
-               
+
                Integer imgWidth = imageBounds.width;
                Integer imgHeight = imageBounds.height;
-               
+
                Float ratio = imgHeight.floatValue()/imgWidth.floatValue();
                Integer width = containerBounds.width;
                Integer height = ((Float) (width * ratio)).intValue();
-               
+
                return new Rectangle(containerBounds.x, containerBounds.y, width, height);
        }
 
+       public void dispose(){
+           if(image!=null){
+               image.dispose();
+               image = null;
+           }
+           imageUri = null;
+           if(container!=null){
+               container.dispose();
+               container = null;
+           }
+       }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.swt.events.PaintListener#paintControl(org.eclipse.swt.events.PaintEvent)
-        */
        /** {@inheritDoc} */
        @Override
        public void paintControl(PaintEvent e) {
index 8ea5822190de05d2174eeb1792d35b19ab9a96f0..b03b243b6af71c02525135c3f7e717c5c737cbb8 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -12,6 +12,7 @@ package eu.etaxonomy.taxeditor.ui.element;
 
 import org.eclipse.jface.util.PropertyChangeEvent;
 
+import eu.etaxonomy.cdm.model.common.LanguageString;
 import eu.etaxonomy.cdm.model.description.KeyStatement;
 
 /**
@@ -48,13 +49,28 @@ public class KeyStatementElement extends MultilanguageTextElement {
        /**
         * @return the keyStatement
         */
-       public KeyStatement getKeyStatement() {
-               return keyStatement;
+       public KeyStatement updateKeyStatement(KeyStatement ks) {
+           keyStatement = ks;
+           if(keyStatement == null) {
+               keyStatement = KeyStatement.NewInstance(element_languageString.getLanguageString().getLanguage(),
+                       element_languageString.getLanguageString().getText());
+
+           } else {
+               LanguageString languageString = keyStatement.getLabel().get(element_languageString.getLanguageString().getLanguage());
+               if(languageString != null) {
+                   languageString.setText(element_languageString.getText());
+               } else {
+                   keyStatement.getLabel().put(element_languageString.getLanguageString().getLanguage(),
+                           element_languageString.getLanguageString());
+               }
+           }
+           return keyStatement;
        }
 
+
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.ui.forms.MultilanguageTextElement#propertyChange
         * (org.eclipse.jface.util.PropertyChangeEvent)
@@ -64,24 +80,24 @@ public class KeyStatementElement extends MultilanguageTextElement {
                if (event == null) {
                        return;
                }
-                                               
+
                if (keyStatement == null) {
                        Object eventSource = event.getSource();
                        if (eventSource == element_languageString) {
-                               
+
                                if(element_languageString.getLanguageString() != null) {
-                                       // for the case when the user copy / pastes text into the 
+                                       // for the case when the user copy / pastes text into the
                                        // (LanguageStringWithLabelElement) element_languageString text field
                                        setKeyStatement(KeyStatement.NewInstance(element_languageString.getLanguageString().getLanguage(),
                                                        element_languageString.getLanguageString().getText()));
                                } else {
-                                       setKeyStatement(KeyStatement.NewInstance());
+                                       //setKeyStatement(KeyStatement.NewInstance());
                                }
                        }
                }
-               
+
                super.propertyChange(event);
-               
+
        }
 
 }
index 084e57634898a1c62b232015b441ad2413d5b0d7..8c3993f4357b2f06ada76761dcbb605a663d6353 100644 (file)
@@ -75,6 +75,14 @@ public class LanguageStringWithLabelElement extends TextWithLabelElement {
                return languageString;
        }
 
+       public LanguageString updateLanguageString(LanguageString ls) {
+           if(ls == null){
+            ls = LanguageString.NewInstance("", CdmStore.getDefaultLanguage());
+        }
+           ls.setText(text.getText());
+           return ls;
+       }
+
        /** {@inheritDoc} */
        @Override
        public void modifyText(ModifyEvent e) {
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/LsidWithExceptionLabelElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/LsidWithExceptionLabelElement.java
new file mode 100644 (file)
index 0000000..1bea734
--- /dev/null
@@ -0,0 +1,46 @@
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.ui.element;
+
+import eu.etaxonomy.cdm.model.common.LSID;
+
+/**
+ *
+ * @author pplitzner
+ * @date Sep 21, 2015
+ *
+ */
+public class LsidWithExceptionLabelElement extends AbstractUriWithExceptionLabelElement<LSID> {
+
+    protected LsidWithExceptionLabelElement(CdmFormFactory formFactory, ICdmFormElement parentElement,
+            String labelString, LSID initialObject, Integer textHeight, int style) {
+        super(formFactory, parentElement, labelString, initialObject, textHeight, style);
+    }
+
+       /**
+        * {@inheritDoc}
+        */
+       @Override
+       public void setParsedText(LSID object) {
+               if(object != null){
+                       super.setText(object.toString());
+               }
+       }
+
+       /**
+        * {@inheritDoc}
+        */
+       @Override
+       public LSID getParsedText() throws Exception {
+            return new LSID(super.getText());
+       }
+
+}
index be80e262f9e9745bf89ddb62e4e573a9064fac3a..7f040a8680ade1770d7d2e0efcbd235db569e885 100644 (file)
@@ -196,12 +196,6 @@ public class MultilanguageTextElement extends AbstractCdmFormElement implements
                this.multilanguageText = multilanguageText;
 
                if (multilanguageText != null) {
-                       if (multilanguageText.isEmpty()) {
-                               multilanguageText.put(
-                                               CdmStore.getDefaultLanguage(),
-                                               LanguageString.NewInstance("",
-                                                               CdmStore.getDefaultLanguage()));
-                       }
                        if (PreferencesUtil.isMultilanguageTextEditingCapability()) {
                                combo_language.setTerms(getLanguages());
                                button.setEnabled(false);
@@ -220,8 +214,9 @@ public class MultilanguageTextElement extends AbstractCdmFormElement implements
                                                                .getDefaultLanguage() }));
 
                element_languageString.setLanguageString(preferredLanguageString);
+
                if (PreferencesUtil.isMultilanguageTextEditingCapability()) {
-                       combo_language.setSelection(preferredLanguageString.getLanguage());
+                       combo_language.setSelection(preferredLanguageString == null?CdmStore.getDefaultLanguage():preferredLanguageString.getLanguage());
                        button.setEnabled(true);
                }
        }
index 8149f3aad97c705becace2e52791c88f5976f531..0bc4ddb1f16c0c480909b6e51853deb58b7a29ba 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -13,6 +13,7 @@ package eu.etaxonomy.taxeditor.ui.element;
 import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
 import org.joda.time.Partial;
 
 import eu.etaxonomy.cdm.model.common.TimePeriod;
@@ -31,7 +32,7 @@ public class PartialElement extends AbstractCdmFormElement implements ISelectabl
        private NumberWithLabelElement number_month;
        private NumberWithLabelElement number_year;
        private Partial partial;
-       
+
        /**
         * <p>Constructor for PartialElement.</p>
         *
@@ -43,25 +44,27 @@ public class PartialElement extends AbstractCdmFormElement implements ISelectabl
        public PartialElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement, String labelString, int style) {
                super(formFactory, formElement);
-               
-               formElement.getLayoutComposite().setLayout(LayoutConstants.LAYOUT(7, false));
-               
+
+               TableWrapLayout layout = LayoutConstants.LAYOUT(7, false);
+               layout.horizontalSpacing = 5;
+        formElement.getLayoutComposite().setLayout(layout);
+
                label = formFactory.createLabel(getLayoutComposite(), labelString);
                addControl(label);
-               
+
                number_year = formFactory.createNumberTextWithLabelElement(this, "Year", null, style);
                number_year.setLimits(4, -9999, 9999);
-               
-               number_month = formFactory.createNumberTextWithLabelElement(this, "Month", null, style);                
+
+               number_month = formFactory.createNumberTextWithLabelElement(this, "Month", null, style);
                number_month.setLimits(2, 1, 12);
-               
+
                number_day = formFactory.createNumberTextWithLabelElement(this, "Day", null, style);
                number_day.setLimits(2, 1, 31);
-               
-               
-               formFactory.addPropertyChangeListener(this);            
+
+
+               formFactory.addPropertyChangeListener(this);
        }
-       
+
        /**
         * <p>Setter for the field <code>partial</code>.</p>
         *
@@ -69,7 +72,7 @@ public class PartialElement extends AbstractCdmFormElement implements ISelectabl
         */
        public void setPartial(Partial partial){
                this.partial = partial;
-               
+
                if(partial != null){
                        number_day.setNumber(TimePeriod.getPartialValue(partial, TimePeriod.DAY_TYPE));
                        number_month.setNumber(TimePeriod.getPartialValue(partial, TimePeriod.MONTH_TYPE));
@@ -95,9 +98,9 @@ public class PartialElement extends AbstractCdmFormElement implements ISelectabl
                if(event == null){
                        return;
                }
-               
+
                Object eventSource = event.getSource();
-               
+
                if(getElements().contains(eventSource)){
                        if(event instanceof CdmPropertyChangeEvent){
                                if(((CdmPropertyChangeEvent) event).hasException()){
@@ -106,9 +109,9 @@ public class PartialElement extends AbstractCdmFormElement implements ISelectabl
                                }
                        }
                        handleEvent(eventSource);
-               }               
+               }
        }
-       
+
        /**
         * @param event
         */
@@ -118,15 +121,31 @@ public class PartialElement extends AbstractCdmFormElement implements ISelectabl
 
        private void handleEvent(Object eventSource){
                if(eventSource == number_month){
-                       partial = TimePeriod.setPartialField(partial, number_month.getInteger(), TimePeriod.MONTH_TYPE);
+                       if (number_month.getInteger() == 0){
+                               partial = TimePeriod.setPartialField(partial, null, TimePeriod.MONTH_TYPE);
+                       } else{
+                               partial = TimePeriod.setPartialField(partial, number_month.getInteger(), TimePeriod.MONTH_TYPE);
+                       }
+
                }else if(eventSource == number_day){
-                       partial = TimePeriod.setPartialField(partial, number_day.getInteger(), TimePeriod.DAY_TYPE);
+                       if (number_day.getInteger() == 0){
+                               partial = TimePeriod.setPartialField(partial, null, TimePeriod.DAY_TYPE);
+                       } else{
+                               partial = TimePeriod.setPartialField(partial, number_day.getInteger(), TimePeriod.DAY_TYPE);
+                       }
+
+
                }else if(eventSource == number_year){
-                       partial = TimePeriod.setPartialField(partial, number_year.getInteger(), TimePeriod.YEAR_TYPE);
+                       if (number_year.getInteger() == 0){
+                               partial = TimePeriod.setPartialField(partial, null, TimePeriod.YEAR_TYPE);
+                       } else{
+                               partial = TimePeriod.setPartialField(partial, number_year.getInteger(), TimePeriod.YEAR_TYPE);
+                       }
+
                }
                firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public void setBackground(Color color) {
index 1c39870fe93ccd9d53970220541f63d7eb6e4267..f9e8788c101ce1ab5f8950b2994f7866c62e1a7f 100644 (file)
@@ -15,17 +15,13 @@ import java.net.URI;
 
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
 import eu.etaxonomy.taxeditor.Messages;
 import eu.etaxonomy.taxeditor.model.ImageResources;
@@ -37,17 +33,23 @@ import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
  * @created Dec 20, 2010
  * @version 1.0
  */
-public class UriWithLabelElement extends TextWithLabelElement {
+public class UriWithLabelElement extends AbstractUriWithExceptionLabelElement<URI> {
 
-    private final Label labelException;
-    private final Button btnOpenBrowser;
+    private Button btnOpenBrowser;
 
-       protected UriWithLabelElement(CdmFormFactory formFactory,
-                       ICdmFormElement parentElement, String labelString,
-                       URI initialUri, Integer textHeight, int style) {
-               super(formFactory, parentElement, false);
+    protected UriWithLabelElement(CdmFormFactory formFactory, ICdmFormElement parentElement, String labelString,
+            URI initialObject, Integer textHeight, int style) {
+        super(formFactory, parentElement, labelString, initialObject, textHeight, style);
 
-               //label
+       }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected void init(CdmFormFactory formFactory, String labelString, URI initialObject, Integer textHeight, int style) {
+
+        //label
         initLabel(formFactory, labelString, false, getLayoutComposite());
 
         //composite(uri + button)
@@ -60,18 +62,18 @@ public class UriWithLabelElement extends TextWithLabelElement {
         initText(formFactory, null, textHeight, null, false, style, textAndButton);
 
         //button
-               btnOpenBrowser = formFactory.createButton(textAndButton, "", SWT.NONE); //$NON-NLS-1$
-               btnOpenBrowser.setImage(ImageResources.getImage(ImageResources.WEB));
-               btnOpenBrowser.setToolTipText(Messages.UriWithLabelElement_OPEN_EXTERNAL_BROWSER);
-               btnOpenBrowser.addSelectionListener(new SelectionAdapter() {
-                   @Override
-                   public void widgetSelected(SelectionEvent e) {
-                       String errorTitle = Messages.UriWithLabelElement_INVALID_URL;
-                       String errorText = Messages.UriWithLabelElement_COULD_NOT_OPEN_BROWSER;
-
-                       URI uri = getUri();
-                       if(uri!=null){
-                           try {
+        btnOpenBrowser = formFactory.createButton(textAndButton, "", SWT.NONE); //$NON-NLS-1$
+        btnOpenBrowser.setImage(ImageResources.getImage(ImageResources.WEB));
+        btnOpenBrowser.setToolTipText(Messages.UriWithLabelElement_OPEN_EXTERNAL_BROWSER);
+        btnOpenBrowser.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                String errorTitle = Messages.UriWithLabelElement_INVALID_URL;
+                String errorText = Messages.UriWithLabelElement_COULD_NOT_OPEN_BROWSER;
+
+                URI uri = parseText();
+                if(uri!=null){
+                    try {
                         PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(uri.toURL());
                     } catch (PartInitException pie) {
                         MessagingUtils.informationDialog(errorTitle, new Status(IStatus.WARNING, TaxeditorStorePlugin.PLUGIN_ID, errorText, pie));
@@ -80,42 +82,35 @@ public class UriWithLabelElement extends TextWithLabelElement {
                     } catch (IllegalArgumentException iae) {
                         MessagingUtils.informationDialog(errorTitle, new Status(IStatus.WARNING, TaxeditorStorePlugin.PLUGIN_ID, errorText, iae));
                     }
-                       }
-                       else{
-                           MessagingUtils.informationDialog(errorTitle, new Status(IStatus.WARNING, TaxeditorStorePlugin.PLUGIN_ID, errorText, null));
-                       }
-                   }
+                }
+                else{
+                    MessagingUtils.informationDialog(errorTitle, new Status(IStatus.WARNING, TaxeditorStorePlugin.PLUGIN_ID, errorText, null));
+                }
+            }
         });
-               btnOpenBrowser.setLayoutData(LayoutConstants.RIGHT());
-
-               labelException = formFactory.createLabel(getLayoutComposite(), "", SWT.WRAP); //$NON-NLS-1$
-               int numColumns = AbstractFormSection.DEFAULT_NUM_COLUMNS;
-               if(getLayoutComposite().getLayout() instanceof TableWrapLayout){
-                   numColumns = ((TableWrapLayout)getLayoutComposite().getLayout()).numColumns;
-               }
-        labelException.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(numColumns, 1));
-               addControl(labelException);
-               setUri(initialUri);
-       }
+        btnOpenBrowser.setLayoutData(LayoutConstants.RIGHT());
+
+        initExceptionLabel(getLayoutComposite(), formFactory, initialObject);
+    }
 
-       public void setUri(URI uri) {
-               if(uri != null){
-                       super.setText(uri.toString());
-               }
-       }
 
-       public URI getUri(){
-        try {
-            labelException.setFont(JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT));
-            labelException.setForeground(getPersistentBackground());
-            labelException.setText(""); //$NON-NLS-1$
-            return new URI(super.getText());
-        } catch (Exception e) {
-            labelException.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
-            labelException.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
-            labelException.setText(Messages.UriWithLabelElement_URL_NOT_SAVED+e.getMessage());
-            return null;
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void setParsedText(URI object) {
+        if(object != null){
+            super.setText(object.toString());
         }
-       }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected URI getParsedText() throws Exception {
+        return new URI(super.getText());
+    }
 
 }
index 3dbe100ef6134198a5933bbfcbff633414377f34..177a16a917db82ccab6e70126f11b7a7f0c3679b 100644 (file)
@@ -73,6 +73,7 @@ public class PasswordWizard extends Wizard implements IConversationEnabled{
                            // change others passwords
                            CdmStore.getService(IUserService.class).changePasswordForUser(user.getUsername(), passwordPage.getNewPassword());
                        }
+                       CdmStore.getService(IUserService.class).loadWithUpdate(user.getUuid());
                    internalConversation.commit(false);
                    internalConversation.unbind();
                    internalConversation.close();
@@ -82,7 +83,7 @@ public class PasswordWizard extends Wizard implements IConversationEnabled{
                        return false;
                }catch (AuthenticationException e){
                        MessagingUtils.warningDialog("Could not change password", this, "The old password is not correct.");
-               
+
                        return false;
                }catch(Exception e){
                        MessagingUtils.warningDialog("Problem with changing password", this, "The password could not be changed. " + e.getMessage());
index 328b085939599c0a98963507aef0aa64a08d35e2..efffb130dc13f4bb7df42b263d9d8e919a9f2b36 100644 (file)
@@ -18,7 +18,6 @@ import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Layout;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
@@ -58,7 +57,7 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
        private final Composite box;
 
        private Button btnRemove;
-    private Button btnChooseEntity;
+    protected Button btnChooseEntity;
 
        private Color backgroundColor;
 
@@ -93,7 +92,8 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
                setLayoutComposite(container);
 
                addControl(container);
-               Layout containerLayout = LayoutConstants.LAYOUT(2, false);
+               TableWrapLayout containerLayout = LayoutConstants.LAYOUT(2, false);
+               containerLayout.horizontalSpacing = 5;
 
                container.setLayout(containerLayout);
                container.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
@@ -101,6 +101,7 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
                if(isChoosableEntity){
                    btnChooseEntity = formFactory.createButton(box, null, SWT.PUSH);
                    addControl(btnChooseEntity);
+
                    btnChooseEntity.setLayoutData(LayoutConstants.RIGHT());
                    btnChooseEntity.setImage(ImageResources.getImage(ImageResources.BROWSE_ICON));
                    btnChooseEntity.setToolTipText("Browse");
@@ -116,6 +117,7 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
                                    ((AbstractEntityCollectionSection)getParentElement()).addElement(entity);
                                    ((AbstractEntityCollectionSection)getParentElement()).firePropertyChangeEvent(getParentElement());
                                }
+
                            }
                        }
                    });
@@ -187,7 +189,7 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
                        return;
                }
                Object eventSource = event.getSource();
-               if (getElements().contains(eventSource)) {
+               if (getElements().contains(eventSource) || getControls().contains(eventSource)) {
                        handleEvent(eventSource);
                }
        }
@@ -197,6 +199,9 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
        /** {@inheritDoc} */
        @Override
     public void setBackground(Color color) {
+           if(box.isDisposed() || container.isDisposed()){
+               return;
+           }
                backgroundColor = color;
                super.setBackground(color);
                box.setBackground(color);
index 5199df5fce2e6f8abe1e0cf8fd48cbc11457ec8c..ba51d800cd0f2976ca68e4b3e2c721bf12499b00 100644 (file)
@@ -120,4 +120,13 @@ public class PersonDetailElement extends AbstractIdentifiableEntityDetailElement
 
                firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
        }
+       
+       @Override
+       protected void handleToggleableCacheField() {
+        boolean pushedState = toggleable_cache.getState();
+
+        getEntity().setTitleCache(toggleable_cache.getText(), pushedState);
+        setIrrelevant(pushedState, Arrays.asList(new Object[] { toggleable_cache, text_nomenclaturalTitle }));
+        updateToggleableCacheField();
+    }
 }
index f223d8c896aa5b33c40c5538391dac8f6bf4f236..84222634f1d281aa083e249ca9fe300782a64836 100644 (file)
@@ -10,7 +10,6 @@
 
 package eu.etaxonomy.taxeditor.ui.section.agent;
 
-import java.awt.Checkbox;
 import java.util.Arrays;
 
 import org.eclipse.ui.forms.widgets.ExpandableComposite;
@@ -65,7 +64,7 @@ public class TeamDetailElement extends AbstractIdentifiableEntityDetailElement<T
 
         toggleable_cache = formFactory.createToggleableTextField(formElement, "Title Cache", entity.getTitleCache(), entity.isProtectedTitleCache(), style);
         toggleable_nomenclaturalTitleCache = formFactory.createToggleableTextField(formElement, "Abbrev. Title", entity.getNomenclaturalTitle(), entity.isProtectedNomenclaturalTitleCache(), style);
-        hasAdditionalMembers = formFactory.createCheckbox(formElement, "Additional Members", false, style);
+        hasAdditionalMembers = formFactory.createCheckbox(formElement, "Additional Members", entity.isHasMoreMembers(), style);
         section_teamMembers = formFactory.createTeamMemberSection(getConversationHolder(), formElement, ExpandableComposite.EXPANDED);
         section_teamMembers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
     }
@@ -74,7 +73,7 @@ public class TeamDetailElement extends AbstractIdentifiableEntityDetailElement<T
        @Override
        protected void updateContent() {
                super.updateContent();
-               
+
                toggleable_cache.setEnabled(getEntity().isProtectedTitleCache());
                toggleable_nomenclaturalTitleCache.setEnabled(getEntity()
                                .isProtectedNomenclaturalTitleCache());
@@ -82,7 +81,7 @@ public class TeamDetailElement extends AbstractIdentifiableEntityDetailElement<T
                                toggleable_cache.getState(),
                                Arrays.asList(new Object[] { toggleable_cache,
                                                toggleable_nomenclaturalTitleCache , hasAdditionalMembers}));
-               
+
                section_teamMembers.setEntity(getEntity());
 
        }
@@ -92,11 +91,9 @@ public class TeamDetailElement extends AbstractIdentifiableEntityDetailElement<T
        public void handleEvent(Object eventSource) {
                if (eventSource == toggleable_cache) {
                        handleToggleableCacheField();
-                       
+
                } else if (eventSource == toggleable_nomenclaturalTitleCache) {
-                       getEntity().setNomenclaturalTitle(
-                                       toggleable_nomenclaturalTitleCache.getText(),
-                                       toggleable_nomenclaturalTitleCache.getState());
+                       updateToggleable_nomanclaturalTitleCacheField();
                        setIrrelevant(
                                        toggleable_nomenclaturalTitleCache.getState(),
                                        Arrays.asList(new Object[] { toggleable_nomenclaturalTitleCache, hasAdditionalMembers }));
@@ -113,4 +110,15 @@ public class TeamDetailElement extends AbstractIdentifiableEntityDetailElement<T
 
                firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
        }
+
+       public void updateToggleable_nomanclaturalTitleCacheField() {
+                boolean pushedState = toggleable_nomenclaturalTitleCache.getState();
+
+               getEntity().setNomenclaturalTitle(toggleable_nomenclaturalTitleCache.getText(), pushedState);
+               setIrrelevant(pushedState, Arrays.asList(new Object[] { toggleable_cache }));
+               
+        if (!getEntity().isProtectedNomenclaturalTitleCache()) {
+            toggleable_nomenclaturalTitleCache.setText(getEntity().getNomenclaturalTitle());
+        }
+    }
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/AbstractEditWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/AbstractEditWizard.java
new file mode 100644 (file)
index 0000000..e5a42f6
--- /dev/null
@@ -0,0 +1,135 @@
+// $Id$
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui.section.classification;
+
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+/**
+ * @author k.luther
+ * @date 23.03.2016
+ *
+ */
+public abstract class AbstractEditWizard<T> extends Wizard implements
+INewWizard, IConversationEnabled{
+
+    private ConversationHolder conversation;
+
+    protected CdmFormFactory formFactory;
+
+    private T entity;
+
+    private IWorkbench workbench;
+
+
+
+        /**
+         * <p>Constructor for AbstractNewEntityWizard.</p>
+         *
+         * @param <T> a T object.
+         */
+        public AbstractEditWizard(){
+            setWindowTitle(String.format("New %s", getEntityName()));
+        }
+
+        /**
+         * FIXME there might be a smarter way to do this,
+         *
+         * @return
+         */
+        protected abstract String getEntityName();
+
+        /* (non-Javadoc)
+         * @see org.eclipse.jface.wizard.Wizard#performFinish()
+         */
+        /** {@inheritDoc} */
+        @Override
+        public boolean performFinish() {
+            saveEntity();
+
+            conversation.commit();
+            conversation.close();
+            return true;
+        }
+
+        /**
+         * <p>Getter for the field <code>entity</code>.</p>
+         *
+         * @return a T object.
+         */
+        public T getEntity() {
+            return entity;
+        }
+
+        /**
+         * <p>Setter for the field <code>entity</code>.</p>
+         *
+         * @param entity a T object.
+         */
+        public void setEntity(T entity){
+            this.entity = entity;
+        }
+
+        /**
+         * Adds the entity to the current persistence context
+         */
+        protected abstract void saveEntity();
+
+        /* (non-Javadoc)
+         * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
+         */
+        /** {@inheritDoc} */
+        @Override
+        public void init(IWorkbench workbench, IStructuredSelection selection) {
+            this.workbench = workbench != null ? workbench : AbstractUtility.getWorkbench();
+
+
+            formFactory = new CdmFormFactory(Display.getCurrent(), null);
+            conversation = CdmStore.createConversation();
+
+
+        }
+
+
+
+        /**
+         * <p>getConversationHolder</p>
+         *
+         * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
+         */
+        @Override
+        public ConversationHolder getConversationHolder() {
+            return conversation;
+        }
+
+        /** {@inheritDoc} */
+        @Override
+        public void update(CdmDataChangeMap changeEvents) {}
+
+        /**
+         * @return the workbench
+         */
+        public IWorkbench getWorkbench() {
+            return workbench;
+        }
+
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/EditTaxonNodeWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/EditTaxonNodeWizard.java
new file mode 100644 (file)
index 0000000..68bd471
--- /dev/null
@@ -0,0 +1,67 @@
+// $Id$
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui.section.classification;
+
+import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.newWizard.IWizardPageListener;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author k.luther
+ * @date 23.03.2016
+ *
+ */
+public class EditTaxonNodeWizard extends AbstractEditWizard<ITaxonTreeNode> {
+
+    private TaxonNodeWizardPage taxonNodePage;
+    private IWizardPageListener wizardPageListener;
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.ui.section.classification.AbstractEditWizard#getEntityName()
+     */
+    @Override
+    protected String getEntityName() {
+        return "TaxonNode";
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.ui.section.classification.AbstractEditWizard#saveEntity()
+     */
+    @Override
+    protected void saveEntity() {
+        getConversationHolder().bind();
+        TaxonNode node = (TaxonNode)getEntity();
+
+        CdmStore.getService(ITaxonNodeService.class).merge(node, true);
+    }
+    @Override
+    public void addPages() {
+        taxonNodePage = new TaxonNodeWizardPage(formFactory, getConversationHolder(), getEntity(), wizardPageListener, false);
+
+        addPage(taxonNodePage);
+    }
+
+    public void addWizardPageListener(IWizardPageListener wizardPageListener){
+        this.wizardPageListener = wizardPageListener;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#setEntity(java.lang.Object)
+     */
+    @Override
+    public void setEntity(ITaxonTreeNode entity) {
+        setWindowTitle(String.format("Edit %s", getEntityName()));
+        entity = CdmStore.getService(ITaxonNodeService.class).load(entity.getUuid());
+        super.setEntity(entity);
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeAgentRelationCollectionElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeAgentRelationCollectionElement.java
new file mode 100644 (file)
index 0000000..a2443df
--- /dev/null
@@ -0,0 +1,116 @@
+// $Id$
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui.section.classification;
+
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+
+import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
+import eu.etaxonomy.cdm.model.common.DefinedTerm;
+import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.taxon.TaxonNodeAgentRelation;
+import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
+import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.LabelElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
+import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
+
+/**
+ * @author k.luther
+ * @date 22.03.2016
+ *
+ */
+public class TaxonNodeAgentRelationCollectionElement extends AbstractEntityCollectionElement<TaxonNodeAgentRelation> {
+
+
+
+
+    /**
+     * @param formFactory
+     * @param section
+     * @param entity
+     * @param removeListener
+     * @param backgroundColor
+     * @param style
+     */
+    public TaxonNodeAgentRelationCollectionElement(CdmFormFactory formFactory, AbstractFormSection section,
+            TaxonNodeAgentRelation entity, SelectionListener removeListener, Color backgroundColor, int style) {
+        super(formFactory, section, entity, removeListener, backgroundColor, style);
+
+        // TODO Auto-generated constructor stub
+    }
+
+
+
+
+    private EntitySelectionElement<TeamOrPersonBase> selection_toPerson;
+    private TermComboElement<DefinedTerm> combo_relationshipType;
+    private LabelElement label;
+
+
+
+
+
+
+
+    @Override
+    public void setEntity(TaxonNodeAgentRelation entity) {
+
+        if(entity.getId()!=0){
+            combo_relationshipType.setSelection(entity.getType());
+            selection_toPerson.setEntity(entity.getAgent());
+        }
+        this.entity = entity;
+    }
+
+    @Override
+    public void handleEvent(Object eventSource) {
+        if(eventSource==combo_relationshipType){
+
+            entity.setType(combo_relationshipType.getSelection());
+
+        }else if (eventSource == selection_toPerson){
+            entity.setAgent(selection_toPerson.getEntity());
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#createControls(eu.etaxonomy.taxeditor.ui.element.ICdmFormElement, int)
+     */
+    @Override
+    public void createControls(ICdmFormElement element, int style) {
+        combo_relationshipType = formFactory.createDefinedTermComboElement(TermType.TaxonNodeAgentRelationType, element, "Taxonnode Agent Relationtype", null, style);
+        if (entity != null){
+            selection_toPerson = formFactory
+                    .createSelectionElement(TeamOrPersonBase.class,
+                            getConversationHolder(), element, "Agent", entity.getAgent(),
+                            EntitySelectionElement.ALL, style);
+        } else{
+            selection_toPerson = formFactory
+                    .createSelectionElement(TeamOrPersonBase.class,
+                            getConversationHolder(), element, "Agent", null,
+                            EntitySelectionElement.ALL, style);
+        }
+        label = formFactory.createLabel(element, null);
+
+    }
+
+    public boolean isComplete(){
+        if (selection_toPerson.getSelection()!= null && combo_relationshipType.getSelection() != null){
+            return true;
+        }
+        return false;
+
+    }
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeAgentRelationCollectionSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeAgentRelationCollectionSection.java
new file mode 100644 (file)
index 0000000..c161aec
--- /dev/null
@@ -0,0 +1,103 @@
+// $Id$
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui.section.classification;
+
+import java.util.Collection;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.model.taxon.TaxonNodeAgentRelation;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
+
+/**
+ * @author k.luther
+ * @date 22.03.2016
+ *
+ */
+public class TaxonNodeAgentRelationCollectionSection extends AbstractEntityCollectionSection<TaxonNode, TaxonNodeAgentRelation> {
+
+
+
+    /**
+     * @param formFactory
+     * @param conversation
+     * @param parentElement
+
+     * @param style
+     */
+    public TaxonNodeAgentRelationCollectionSection (CdmFormFactory formFactory, ConversationHolder conversation,
+            ICdmFormElement parentElement, int style) {
+        super(formFactory, conversation, parentElement,  "TaxonNode Agent Relation", style);
+
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getEmptyString()
+     */
+    @Override
+    public String getEmptyString() {
+        return "No taxon node agent relations yet.";
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getTooltipString()
+     */
+    @Override
+    protected String getTooltipString() {
+        return "Add a new agent relation to this taxon node.";
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
+     */
+    @Override
+    public Collection<TaxonNodeAgentRelation> getCollection(TaxonNode entity) {
+        //why Do I have to give the method an entity???
+       Collection<TaxonNodeAgentRelation> allAgentRelationships = getEntity().getAgentRelations();
+       return allAgentRelationships;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement(java.lang.Object)
+     */
+    @Override
+    public void addElement(TaxonNodeAgentRelation element) {
+
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#removeElement(java.lang.Object)
+     */
+    @Override
+    public void removeElement(TaxonNodeAgentRelation element) {
+        getEntity().removeNodeAgent(element);
+      //  CdmStore.getService(ITaxonNodeService.class).deleteAgentrelation(element);
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
+     */
+    @Override
+    public TaxonNodeAgentRelation createNewElement() {
+        TaxonNodeAgentRelation rel = getEntity().addAgentRelation(null, null);
+        return rel;
+    }
+
+    public boolean isComplete(){
+
+        return false;
+    }
+
+}
index cce5f0c6eccfe395abb85cddb5c3c46a383e345f..5ac40f536071de654a8df5356bf562f4269081a4 100644 (file)
@@ -26,15 +26,13 @@ import eu.etaxonomy.taxeditor.parser.ParseHandler;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 import eu.etaxonomy.taxeditor.ui.selection.TaxonNodeSelectionElement;
 
 /**
- * <p>
- * TaxonNodeDetailElement class.
- * </p>
  *
  * @author n.hoffmann
  * @created Sep 27, 2010
@@ -42,6 +40,8 @@ import eu.etaxonomy.taxeditor.ui.selection.TaxonNodeSelectionElement;
  */
 public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeNode> {
 
+    private boolean createNew = false;
+
        private EntitySelectionElement<Classification> selection_classification;
 
        private Classification classification;
@@ -59,6 +59,9 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
 
        private TextWithLabelElement textNewTaxonName;
 
+       private TaxonNodeAgentRelationCollectionSection selectionNodeAgentRelation;
+
+
        private CheckboxElement checkbox_openInEditor;
 
        private boolean openInEditor;
@@ -67,21 +70,10 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
 
        private EntitySelectionElement<TaxonNameBase> selection_reuseExistingName;
 
-       /**
-        * <p>
-        * Constructor for TaxonNodeDetailElement.
-        * </p>
-        *
-        * @param formFactory
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-        *            object.
-        * @param formElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        */
        public TaxonNodeDetailElement(CdmFormFactory formFactory,
-                       ICdmFormElement formElement) {
+                       ICdmFormElement formElement, boolean isCreateNew) {
                super(formFactory, formElement);
+               createNew = isCreateNew;
        }
 
        /** {@inheritDoc} */
@@ -95,9 +87,7 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
                selection_parentTaxonNode = formFactory
                                .createTaxonNodeSelectionElement(getConversationHolder(), formElement, "Parent", null,
                                                EntitySelectionElement.DELETABLE, style);
-               selection_SecRef = formFactory
-                               .createSelectionElement(Reference.class,getConversationHolder(), formElement, "Secundum Reference", null,
-                                               EntitySelectionElement.DELETABLE, style);
+
                selection_reuseExistingTaxon = formFactory
                                .createSelectionElement(Taxon.class,
                                                getConversationHolder(), formElement,
@@ -109,26 +99,47 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
                                                getConversationHolder(), formElement,
                                                "Reuse existing name", null,
                                                EntitySelectionElement.DELETABLE, style);
+               selection_SecRef = formFactory
+                .createSelectionElement(Reference.class,getConversationHolder(), formElement, "Secundum Reference", null,
+                        EntitySelectionElement.DELETABLE, style);
+               if (isCreateNew()){
+                   textNewTaxonName = formFactory.createTextWithLabelElement(formElement,"New Taxon", "", style);
+                   textNewTaxonName.setFocus();
+               } else{
+                   textNewTaxonName = formFactory.createTextWithLabelElement(formElement,"Taxon", "", style);
 
-               textNewTaxonName = formFactory.createTextWithLabelElement(formElement,
-                               "New Taxon", "", style);
-               textNewTaxonName.setFocus();
-               preFillParentTaxonName();
+               }
 
+
+               if (isCreateNew()){
+            setParentTreeNode(entity);
+
+        } else{
+            setTreeNode(entity);
+            complete = true;
+        }
+               if (!isCreateNew()){
+            selectionNodeAgentRelation = formFactory.createTaxonNodeAgentRelationCollectionSection(formElement, getConversationHolder(), style);
+            selectionNodeAgentRelation.setEntity((TaxonNode)entity);
+            selectionNodeAgentRelation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        }
+               preFillTaxonName();
                checkbox_openInEditor = formFactory.createCheckbox(formElement,
                                "Open in Editor", true, style);
                setOpenInEditor(true);
-               setParentTreeNode(entity);
+
        }
 
-       private void preFillParentTaxonName() {
-        if(getEntity() instanceof TaxonNode){
+       private void preFillTaxonName() {
+        if(getEntity() instanceof TaxonNode ){
             TaxonNode node = (TaxonNode)getEntity();
             if(node.getTaxon()!=null){
                 Taxon taxon = HibernateProxyHelper.deproxy(node.getTaxon(), Taxon.class);
                 if(taxon.getName()!=null && taxon.getName().isInstanceOf(NonViralName.class)){
                     NonViralName<?> name = HibernateProxyHelper.deproxy(node.getTaxon().getName(), NonViralName.class);
-                    if( ! name.isSupraGeneric() && name.getRank() != null){
+                    if (!isCreateNew()){
+                        textNewTaxonName.setText(name.getNameCache());
+                    } else if( ! name.isSupraGeneric() && name.getRank() != null){
                         String taxonName = "";
                         if(name.isGenus() || name.isInfraGeneric()|| name.isSpeciesAggregate() ){
                             taxonName = name.getGenusOrUninomial();
@@ -144,8 +155,11 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
                                }
                         }
                     }
+
                 }
+
             }
+
         }
     }
 
@@ -161,19 +175,28 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
                } else if (eventSource == selection_reuseExistingTaxon) {
                                boolean enabled = selection_reuseExistingTaxon.getEntity() == null;
                                selection_reuseExistingName.setEnabled(enabled);
-                               textNewTaxonName.setEnabled(enabled);
                                if (!enabled){
-                                       setTaxon(selection_reuseExistingTaxon.getEntity());
+                    setTaxon(selection_reuseExistingTaxon.getEntity());
+                }
+                               if (isCreateNew()){
+                                   textNewTaxonName.setEnabled(enabled);
+                                   if (!enabled){
+                                       setTaxon(selection_reuseExistingTaxon.getEntity());
+                                   } else{
+                                       textNewTaxonName.setText(null);
+                                   }
+
+                                   complete = !textNewTaxonName.getText().isEmpty();
                                }
-                               complete = !textNewTaxonName.getText().isEmpty();
-
 
                } else if (eventSource == selection_reuseExistingName) {
-                       boolean enabled = selection_reuseExistingName.getEntity() == null;
+                   boolean enabled = selection_reuseExistingName.getEntity() == null;
+                       setTaxon(selection_reuseExistingName.getEntity());
                        selection_reuseExistingTaxon.setEnabled(enabled);
                        textNewTaxonName.setEnabled(enabled);
 
                        setTaxon(selection_reuseExistingName.getEntity());
+
                        complete = !textNewTaxonName.getText().isEmpty();
                } else if (eventSource == textNewTaxonName) {
                        boolean enabled = CdmUtils.isBlank(textNewTaxonName.getText());
@@ -184,16 +207,16 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
                        complete = !textNewTaxonName.getText().isEmpty();
                } else if (eventSource == checkbox_openInEditor) {
                        setOpenInEditor(checkbox_openInEditor.getSelection());
+               } else if (eventSource == selectionNodeAgentRelation){
+                  boolean allComplete = true;
+                  for (ICdmFormElement element : selectionNodeAgentRelation.getElements()){
+                      allComplete &=((TaxonNodeAgentRelationCollectionElement)element).isComplete();
+                  }
+
+                   complete = !isCreateNew() && allComplete;
                }
        }
 
-       /**
-        * <p>
-        * Getter for the field <code>classification</code>.
-        * </p>
-        *
-        * @return the classification
-        */
        public Classification getClassification() {
                return classification;
        }
@@ -202,24 +225,10 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
                return openInEditor;
        }
 
-       /**
-        * <p>
-        * Getter for the field <code>parentTreeNode</code>.
-        * </p>
-        *
-        * @return a {@link eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode} object.
-        */
        public ITaxonTreeNode getParentTreeNode() {
                return parentTreeNode;
        }
 
-       /**
-        * <p>
-        * Getter for the field <code>taxon</code>.
-        * </p>
-        *
-        * @return the taxon
-        */
        public Taxon getTaxon() {
                return taxon;
        }
@@ -237,17 +246,28 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
                        selection_classification.setEntity(classification);
                        selection_parentTaxonNode.setEntity(null);
                        selection_parentTaxonNode.setClassification(classification);
+                       selection_SecRef.setEntity(classification.getReference());
                } else if (parentTreeNode instanceof TaxonNode) {
-                       classification = (Classification) HibernateProxyHelper
+                       classification = HibernateProxyHelper
                                        .deproxy(((TaxonNode) parentTreeNode).getClassification());
                        selection_classification.setEntity(classification);
                        selection_parentTaxonNode.setEntity((TaxonNode) parentTreeNode);
                        selection_parentTaxonNode.setClassification(classification);
+                       selection_SecRef.setEntity(((TaxonNode)parentTreeNode).getTaxon().getSec());
                } else if(parentTreeNode == null){
                        this.parentTreeNode = selection_classification.getEntity();
                }
        }
 
+       private void setTreeNode(ITaxonTreeNode treeNode) {
+        classification = HibernateProxyHelper
+                    .deproxy(((TaxonNode) treeNode).getClassification());
+        selection_classification.setEntity(classification);
+        selection_parentTaxonNode.setEntity(((TaxonNode) treeNode).getParent());
+        selection_parentTaxonNode.setClassification(((TaxonNode) treeNode).getParent().getClassification());
+        selection_SecRef.setEntity(((TaxonNode)treeNode).getTaxon().getSec());
+       }
+
        private void setSecReference(Reference secRef){
                this.secReference = secRef;
                setTaxon(textNewTaxonName.getText());
@@ -255,8 +275,10 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
 
        private void setTaxon(Taxon taxon) {
                this.taxon = taxon;
-               textNewTaxonName.setText(taxon.getName().getTitleCache());
-               this.secReference = taxon.getSec();
+               if (isCreateNew()){
+                   textNewTaxonName.setText(taxon.getName().getTitleCache());
+               }
+               selection_SecRef.setEntity(taxon.getSec());
        }
 
        private void setTaxon(String taxonNameString) {
@@ -268,17 +290,24 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
        private void setTaxon(TaxonNameBase taxonName) {
                Reference secundum = null;
                if (getParentTreeNode() != null) {
-                       if (this.secReference != null){
-                               secundum = this.secReference;
-                       } else if (getParentTreeNode() instanceof Classification) {
+                       if (this.selection_SecRef.getEntity() != null){
+                               secundum = this.selection_SecRef.getEntity();
+                       } /*else if (getParentTreeNode() instanceof Classification) {
                                secundum = ((Classification) getParentTreeNode())
                                                .getReference();
                        } else if (getParentTreeNode() instanceof TaxonNode) {
                                secundum = ((TaxonNode) getParentTreeNode()).getTaxon()
                                                .getSec();
-                       }
+                       }*/
+               }
+               if (taxonName != null){
+                   taxon = Taxon.NewInstance(taxonName, secundum);
+                   if (!taxonName.getTitleCache().trim().equals(textNewTaxonName.getText().trim())){
+                       textNewTaxonName.setText(taxonName.getTitleCache());
+                   }
+               } else {
+                   textNewTaxonName.setText(null);
                }
-               taxon = Taxon.NewInstance(taxonName, secundum);
        }
 
        private void setOpenInEditor(boolean openInEditor) {
@@ -290,7 +319,23 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
     }
 
        public boolean isComplete() {
+           boolean allComplete = true;
+           if (!isCreateNew()){
+               for (ICdmFormElement element : selectionNodeAgentRelation.getElements()){
+                   allComplete &=((TaxonNodeAgentRelationCollectionElement)element).isComplete();
+               }
+               complete = allComplete;
+           }
+
+
                return complete;
        }
 
+    /**
+     * @return the createNew
+     */
+    public boolean isCreateNew() {
+        return createNew;
+    }
+
 }
index 0508372da8f9116d5969f55247edc163ecfced5b..e108c85dc9e973c34106fe713ece923a10551f2b 100644 (file)
@@ -58,6 +58,6 @@ public class TaxonNodeDetailSection extends AbstractCdmDetailSection<TaxonNode>
        @Override
        protected AbstractCdmDetailElement createCdmDetailElement(AbstractCdmDetailSection<TaxonNode> parentElement, int style) {
            //FIXME generic
-           return formFactory.createTaxonNodeDetailElement(parentElement);
+           return formFactory.createTaxonNodeDetailElement(parentElement, false);
        }
 }
index df24d7c6c3fb97633b1c61a574f927b3f9709100..62d95788b0a643f6d1e38aca7021ce9a95b52bd1 100644 (file)
@@ -35,6 +35,7 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITaxonTreeNode> implements Listener{
 
     private final IWizardPageListener wizardPageListener;
+    private final boolean isCreateNew;
 
     /**
         * <p>
@@ -52,10 +53,12 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITaxonTreeN
      * @param closeOnEnterListener
         */
        public TaxonNodeWizardPage(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ITaxonTreeNode entity, IWizardPageListener closeOnEnterListener) {
+                       ConversationHolder conversation, ITaxonTreeNode entity, IWizardPageListener closeOnEnterListener, boolean isCreateNew) {
                super(formFactory, conversation, entity);
                this.wizardPageListener = closeOnEnterListener;
-               setTitle("Create a new Taxon");
+               setTitle("TaxonNode");
+               this.isCreateNew = isCreateNew;
+
        }
 
        /*
@@ -68,10 +71,12 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITaxonTreeN
        /** {@inheritDoc} */
        @Override
        public TaxonNodeDetailElement createElement(ICdmFormElement rootElement) {
-           TaxonNodeDetailElement detailElement = formFactory.createTaxonNodeDetailElement(rootElement);
+           TaxonNodeDetailElement detailElement = formFactory.createTaxonNodeDetailElement(rootElement, this.isCreateNew);
                detailElement.setEntity(entity);
                formFactory.addPropertyChangeListener(this);
-               detailElement.getTextNewTaxonName().getMainControl().addListener(SWT.KeyDown, this);
+               if (isCreateNew){
+                   detailElement.getTextNewTaxonName().getMainControl().addListener(SWT.KeyDown, this);
+               }
                return detailElement;
        }
 
@@ -96,9 +101,7 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITaxonTreeN
        /** {@inheritDoc} */
        @Override
        public void propertyChange(PropertyChangeEvent event) {
-               if (event.getSource() == getDetailElement()) {
-                       checkComplete();
-               }
+               checkComplete();
        }
 
        @Override
@@ -108,8 +111,14 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITaxonTreeN
                if (detailElement.getClassification() == null) {
                        setMessage("No classification set.", WARNING);
                }
-               else if(detailElement.getTextNewTaxonName().getText().isEmpty()){
-                   setMessage("No taxon name set.", ERROR);
+               else if(isCreateNew ){
+                   if(detailElement.getTextNewTaxonName().getText().isEmpty()){
+                       setMessage("No taxon name set.", ERROR);
+                   } else{
+                       setMessage(null);
+                   setPageComplete(true);
+                   return;
+                   }
                }
                else if(!detailElement.isComplete()){
                    setMessage("Not all required fields are filled.", ERROR);
index 48131bf00dcccf6103067e67d16490a530ac1696..c66e67a93d16bdbd1e485cfb80d823509ff83bbf 100644 (file)
@@ -18,6 +18,7 @@ import org.eclipse.swt.widgets.Control;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.TextData;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -55,13 +56,10 @@ public class DescriptionElementDetailSection extends
 
        @Override
     protected Control createToolbar() {
-               if(! hasSpecificElement()){
-                       return null;
-               }
 
                ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
 
-               final String destinationString = (getEntity() instanceof TextData) ? "the specific element" : "free text";
+               final String destinationString = (getEntity().isInstanceOf(TextData.class)) ? "the specific element" : "free text";
 
                final String label = "Change to " + destinationString;
 
@@ -107,16 +105,23 @@ public class DescriptionElementDetailSection extends
        @Override
        protected void setSectionTitle() {
                this.setText(getHeading() + ": " + getEntity().getFeature().getLabel(CdmStore.getDefaultLanguage()));
-               setTextClient(createToolbar());
+
+        if(IsMoreThanOneTypeSupported()){
+            setTextClient(createToolbar());
+        }
        }
 
-       private boolean hasSpecificElement(){
-               return  getEntity().getFeature().isSupportsCategoricalData()
-                               || getEntity().getFeature().isSupportsCommonTaxonName()
-                               || getEntity().getFeature().isSupportsDistribution()
-                               || getEntity().getFeature().isSupportsIndividualAssociation()
-                               || getEntity().getFeature().isSupportsQuantitativeData()
-                               || getEntity().getFeature().isSupportsTaxonInteraction();
+       private boolean IsMoreThanOneTypeSupported(){
+           int count = 0;
+           Feature feature = getEntity().getFeature();
+           if(feature.isSupportsCategoricalData()){count++;}
+           if(feature.isSupportsCommonTaxonName()){count++;}
+           if(feature.isSupportsDistribution()){count++;}
+           if(feature.isSupportsIndividualAssociation()){count++;}
+           if(feature.isSupportsQuantitativeData()){count++;}
+           if(feature.isSupportsTaxonInteraction()){count++;}
+           if(feature.isSupportsTextData()){count++;}
+           return count > 1;
        }
 
        /* (non-Javadoc)
index aff1fbea835495ffde973dd6c9cd5b5761e9d2bd..bc8656531fdb3ee3236e818e762e925333355f2f 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -23,14 +23,10 @@ import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractOriginalSourceElem
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
- * <p>
- * DescriptionElementSourceElement class.
- * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Nov 16, 2009
  * @version 1.0
- * @param <T>
  */
 public class DescriptionElementSourceElement extends
                AbstractOriginalSourceElement<DescriptionElementSource> implements
@@ -38,26 +34,6 @@ public class DescriptionElementSourceElement extends
 
        private EntitySelectionElement<TaxonNameBase> selection_name;
 
-       /**
-        * <p>
-        * Constructor for DescriptionElementSourceElement.
-        * </p>
-        * 
-        * @param formElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
-        *            object.
-        * @param element
-        *            a
-        *            {@link eu.etaxonomy.cdm.model.common.DescriptionElementSource}
-        *            object.
-        * @param removeListener
-        *            a {@link org.eclipse.swt.events.SelectionListener} object.
-        * @param style
-        *            a int.
-        * @param cdmFormFactory
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-        *            object.
-        */
        public DescriptionElementSourceElement(CdmFormFactory cdmFormFactory,
                        AbstractFormSection formElement, DescriptionElementSource element,
                        SelectionListener removeListener, int style) {
@@ -65,12 +41,6 @@ public class DescriptionElementSourceElement extends
                formFactory.createSelectionArbitrator(this);
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see eu.etaxonomy.taxeditor.forms.entitysections.OriginalSourceComposite#
-        * createControls(org.eclipse.swt.widgets.Composite, int)
-        */
        /** {@inheritDoc} */
        @Override
        public void createControls(ICdmFormElement formElement, int style) {
@@ -81,13 +51,6 @@ public class DescriptionElementSourceElement extends
                                                null, EntitySelectionElement.ALL, SWT.NULL);
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * eu.etaxonomy.taxeditor.forms.section.cdmdetail.AbstractOriginalSourceElement
-        * #setElement(eu.etaxonomy.cdm.model.common.OriginalSourceBase)
-        */
        /** {@inheritDoc} */
        @Override
        public void setEntity(DescriptionElementSource entity) {
@@ -108,13 +71,6 @@ public class DescriptionElementSourceElement extends
 
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent
-        * (java.lang.Object)
-        */
        /** {@inheritDoc} */
        @Override
        public void handleEvent(Object eventSource) {
@@ -133,6 +89,10 @@ public class DescriptionElementSourceElement extends
                } else if (eventSource == selection_name) {
                        getEntity().setNameUsedInSource(selection_name.getSelection());
                }
+               else if(eventSource == combo_origsourcetype){
+                   getEntity().setType(combo_origsourcetype.getSelection());
+               }
+
        }
 
 }
index 69ffb03cb04f8b97e2fa22eb54e9b5606b25f0f0..314810d764fc78cee73a9f21975338442d1f958c 100644 (file)
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section.description;
 
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.OriginalSourceType;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 
 /**
- * <p>DescriptionElementSourceSection class.</p>
+ * <p>
+ * DescriptionElementSourceSection class.
+ * </p>
  *
  * @author n.hoffmann
  * @created Nov 17, 2009
  * @version 1.0
  */
-public class DescriptionElementSourceSection extends AbstractEntityCollectionSection<DescriptionElementBase, DescriptionElementSource>{
+public class DescriptionElementSourceSection extends
+        AbstractEntityCollectionSection<DescriptionElementBase, DescriptionElementSource> {
+
+    /**
+     * <p>
+     * Constructor for DescriptionElementSourceSection.
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param style
+     *            a int.
+     * @param cdmFormFactory
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
+     *            object.
+     * @param conversation
+     *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
+     *            object.
+     */
+    public DescriptionElementSourceSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
+            ICdmFormElement parentElement, int style) {
+        super(cdmFormFactory, conversation, parentElement, "References", style);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public DescriptionElementSource createNewElement() {
+        return DescriptionElementSource.NewInstance(OriginalSourceType.PrimaryTaxonomicSource);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public Collection<DescriptionElementSource> getCollection(DescriptionElementBase entity) {
+        List<DescriptionElementSource> sources = new ArrayList<DescriptionElementSource>(entity.getSources());
+        Collections.sort(sources, new Comparator<DescriptionElementSource>() {
+
+            @Override
+            public int compare(DescriptionElementSource o1, DescriptionElementSource o2) {
+                int id1 = o1.getId();
+                int id2 = o2.getId();
+                OriginalSourceType type1 = o1.getType();
+                OriginalSourceType type2 = o2.getType();
+                Reference citation1 = o1.getCitation();
+                Reference citation2 = o2.getCitation();
 
-       /**
-        * <p>Constructor for DescriptionElementSourceSection.</p>
-        *
-        * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
-        * @param style a int.
-        * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        */
-       public DescriptionElementSourceSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, int style){
-               super(cdmFormFactory, conversation, parentElement, "References", style);
-       }
+                // the newly created should always be on top
+                if (id1 == 0 && id2!=0) {
+                    return -1;
+                }
+                if (id1 != 0 && id2==0) {
+                    return 1;
+                }
 
-       /** {@inheritDoc} */
-       @Override
-       public DescriptionElementSource createNewElement() {
-               return DescriptionElementSource.NewInstance(OriginalSourceType.PrimaryTaxonomicSource);
-       }
+                // sort by type (Primary taxonomic > Primary Media > others
+                // alphabetically by reference title cache)
+                if (type1 != null && type1.equals(OriginalSourceType.PrimaryTaxonomicSource)
+                               && type2 != null && !type2.equals(OriginalSourceType.PrimaryTaxonomicSource)) {
+                       return -1;
+                }
+                if (type1 != null && !type1.equals(OriginalSourceType.PrimaryTaxonomicSource)
+                               && type2 != null && type2.equals(OriginalSourceType.PrimaryTaxonomicSource)) {
+                       return 1;
+                }
+                if (type1 != null && type1.equals(OriginalSourceType.PrimaryMediaSource)
+                        && type2!=null && !type2.equals(OriginalSourceType.PrimaryTaxonomicSource)) {
+                    return -1;
+                }
+                if (type2 != null && type2.equals(OriginalSourceType.PrimaryMediaSource)
+                        && type1!=null && !type1.equals(OriginalSourceType.PrimaryTaxonomicSource)) {
+                    return 1;
+                }
 
-       /** {@inheritDoc} */
-       @Override
-       public Collection<DescriptionElementSource> getCollection(
-                       DescriptionElementBase entity) {
-               return entity.getSources();
-       }
+                //sort by citation title cache
+                if(citation1!=null && citation2!=null){
+                    return citation1.getTitleCache().compareTo(citation2.getTitleCache());
+                }
+                return o2.getCreated().compareTo(o1.getCreated());
+            }
+        });
+        return sources;
+    }
 
-       /** {@inheritDoc} */
-       @Override
-       public String getEmptyString() {
-               return "No references yet.";
-       }
+    /** {@inheritDoc} */
+    @Override
+    public String getEmptyString() {
+        return "No references yet.";
+    }
 
-       /** {@inheritDoc} */
-       @Override
-       protected String getTooltipString() {
-               return "Create a new reference";
-       }
+    /** {@inheritDoc} */
+    @Override
+    protected String getTooltipString() {
+        return "Create a new reference";
+    }
 
-       /** {@inheritDoc} */
-       @Override
-       public void addElement(DescriptionElementSource element) {
-               getEntity().addSource(element);
-       }
+    /** {@inheritDoc} */
+    @Override
+    public void addElement(DescriptionElementSource element) {
+        getEntity().addSource(element);
+    }
 
-       /** {@inheritDoc} */
-       @Override
-       public void removeElement(DescriptionElementSource element) {
-               getEntity().removeSource(element);
-       }
+    /** {@inheritDoc} */
+    @Override
+    public void removeElement(DescriptionElementSource element) {
+        getEntity().removeSource(element);
+    }
 }
index acfbf7c6dda406f8ac26826c8b90e1e1699e6064..b91fc58b7bc037b84d94919a443388e633e10669 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.common.LanguageString;
 import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -24,10 +24,6 @@ import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
- * <p>
- * IndividualsAssociationDetailElement class.
- * </p>
- * 
  * @author n.hoffmann
  * @created Jun 10, 2010
  * @version 1.0
@@ -36,26 +32,8 @@ public class IndividualsAssociationDetailElement extends
                AbstractDetailedDescriptionDetailElement<IndividualsAssociation> {
 
        private TextWithLabelElement text_description;
-       private EntitySelectionElement<DerivedUnit> selection_derivedUnit;
+       private EntitySelectionElement<SpecimenOrObservationBase> selection_derivedUnit;
 
-       /**
-        * <p>
-        * Constructor for IndividualsAssociationDetailElement.
-        * </p>
-        * 
-        * @param formFactory
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-        *            object.
-        * @param formElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param entity
-        *            a
-        *            {@link eu.etaxonomy.cdm.model.description.IndividualsAssociation}
-        *            object.
-        * @param style
-        *            a int.
-        */
        public IndividualsAssociationDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement, IndividualsAssociation entity,
                        int style) {
@@ -67,9 +45,9 @@ public class IndividualsAssociationDetailElement extends
        protected void createControls(ICdmFormElement formElement,
                        IndividualsAssociation entity, int style) {
                selection_derivedUnit = formFactory
-                               .createSelectionElement(DerivedUnit.class,
-                                               getConversationHolder(), formElement, "Unit",
-                                               CdmBase.deproxy(entity.getAssociatedSpecimenOrObservation(),DerivedUnit.class),
+                               .createSelectionElement(SpecimenOrObservationBase.class,
+                                               getConversationHolder(), formElement, "Occurrence/Unit",
+                                               CdmBase.deproxy(entity.getAssociatedSpecimenOrObservation(),SpecimenOrObservationBase.class),
                                                EntitySelectionElement.ALL, style);
 
                text_description = formFactory.createMultiLineTextWithLabel(
index df7a426c6627e591f788ffd0c439138354f5ffa5..6b8dd63bf73e72e06447708925556dcdb7fff44f 100644 (file)
@@ -14,6 +14,9 @@ import org.eclipse.core.commands.operations.IUndoContext;
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
 
 import eu.etaxonomy.cdm.model.description.CategoricalData;
 import eu.etaxonomy.cdm.model.description.CommonTaxonName;
@@ -91,7 +94,10 @@ public class ChangeDescriptionElementType extends AbstractPostTaxonOperation {
                                destinationElement = TextData.NewInstance();
                        }
                }
-               
+               if(destinationElement==null){
+                       MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Change not possible", "Feature does not have another type");
+                       return Status.CANCEL_STATUS;
+               }
                destinationElement.setFeature(feature);
                inDescription.addElement(destinationElement);
                inDescription.removeElement(sourceElement);
index 8e4dcea681aa717b96cf72ccf715eb49efc4d571..07a3d89d9462f441264b014df546d341dc746636 100644 (file)
@@ -19,8 +19,11 @@ import java.util.Map;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Label;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
 import eu.etaxonomy.cdm.common.UriUtils;
+import eu.etaxonomy.cdm.ext.geo.IEditGeoService;
 import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
@@ -69,10 +72,15 @@ public class FeatureDistributionDetailElement extends AbstractCdmDetailElement<F
                        URI serviceUri = new URI(serviceUriString);
                        if(UriUtils.isServiceAvailable(serviceUri, 500)){
                                image = formFactory.createBrowserElement(formElement, null, style);
-                               String mapUriString = getMapUriString(getEntity());
-                               image.setImageUriString(mapUriString);
+                               // FIXME : This is a temporary workaround which ic
+                               //         waiting for #5357 to be fixed
+                               if(!isUnsavedDistribution(getEntity())) {
+                                   String mapUriString = getMapUriString(getEntity());
+                                   image.setImageUriString(mapUriString);
+                                   message = mapUriString;
+                               }
                                formElement.getLayoutComposite().layout();
-                               message = mapUriString;
+
                                return;
                        } else {
                                message = String.format("The service is not available: %s", serviceUriString);
@@ -106,16 +114,21 @@ public class FeatureDistributionDetailElement extends AbstractCdmDetailElement<F
                // FIXME due to a bug in the rest map service we have to ensure that width will always be an even number
                // image.calculateWidth() % 2 == 1 ? image.calculateWidth() + 1 :
                int width = image.calculateWidth();
-
+                IEditGeoService editGeoService;
                List<Language> languages = Arrays.asList(new Language[]{CdmStore.getDefaultLanguage()});
+               if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                   editGeoService = ((CdmApplicationRemoteController)CdmStore.getCurrentApplicationConfiguration()).getEditGeoService();
+               }else{
+                   editGeoService =(IEditGeoService) CdmStore.getCurrentApplicationConfiguration().getBean(
+                       "editGeoService");
+               }
 
-               String parameter = CdmStore.getGeoService().getDistributionServiceRequestParameterString(
+               String parameter = editGeoService.getDistributionServiceRequestParameterString(
                                getTaxonDescriptions(),
-                false, 
-                false, 
-               
+                false,
+                false,
                 null,
-                presenceAbsenceTermColors, 
+                presenceAbsenceTermColors,
                 languages);
 
                String mapUriString = String.format("%s?%s&ms=1000&bbox=-180,-90,180,90&l=earth", accessPoint, parameter);
@@ -129,4 +142,13 @@ public class FeatureDistributionDetailElement extends AbstractCdmDetailElement<F
                return Arrays.asList(((TaxonDescription) getEntity().getDescription()).getTaxon().getDescriptions().toArray(new TaxonDescription[0]));
        }
 
+       private boolean isUnsavedDistribution(FeatureNodeContainer container) {
+           for(DescriptionElementBase dist : container.getDescriptionElements()) {
+               if(dist.getId() == 0) {
+                   return true;
+               }
+           }
+           return false;
+       }
+
 }
index 03e13f8302471fca11d73c06dd7c14048deabd62..147f7d4950e41efb5ffa78d6b171663eccf6834d 100644 (file)
@@ -120,7 +120,6 @@ public class IdentifierDetailSection extends AbstractEntityCollectionSection<Der
        public void removeElement(Identifier element) {
            getEntity().removeIdentifier(getEntity().getIdentifiers().get(0));
            getConversationHolder().commit();
-           System.out.println();
        }
 
        /* (non-Javadoc)
index e5c8c9fb0b2719bf655f85a6771d2c639177aeac..d6b4286ed10a960c0fc8da0b8d7503b60fdde2eb 100644 (file)
@@ -3,13 +3,17 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.key;
 
+import org.eclipse.swt.SWT;
+
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.GeoScopePolyKeyDetailSection;
 
 /**
  * @author n.hoffmann
@@ -20,6 +24,9 @@ public class PolytomousKeyDetailElement extends
 
     private TextWithLabelElement textLabel;
     private NumberWithLabelElement numberStartNumber;
+    private TaxonomicScopeSection sectionTaxonomicScope;
+    private GeoScopePolyKeyDetailSection sectionGeoScopes;
+    private ScopeRestrictionSection sectionScopeRestriction;
 
        public PolytomousKeyDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
@@ -30,20 +37,26 @@ public class PolytomousKeyDetailElement extends
        protected void createControls(ICdmFormElement formElement,
                        PolytomousKey entity, int style) {
            textLabel = formFactory.createTextWithLabelElement(formElement, "Title", entity.getTitleCache(), style);
-            numberStartNumber = formFactory.createNumberTextWithLabelElement(formElement, "Start Number", entity.getStartNumber(), style);
+
+           numberStartNumber = formFactory.createNumberTextWithLabelElement(formElement, "Start Number", entity.getStartNumber(), style);
+
+           sectionTaxonomicScope = formFactory.createTaxonomicScopeSection(getConversationHolder(), formElement, style);
+           sectionTaxonomicScope.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+           sectionTaxonomicScope.setEntity(entity);
+
+           sectionGeoScopes = formFactory.createGeoScopePolyKeyDetailSection(getConversationHolder(), formElement, SWT.NULL);
+           sectionGeoScopes.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+           sectionGeoScopes.setEntity(entity);
+
+           sectionScopeRestriction = formFactory.createScopeRestrictionSection(getConversationHolder(), formElement, SWT.NULL);
+           sectionScopeRestriction.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+           sectionScopeRestriction.setEntity(entity);
        }
 
        public String getText() {
            return textLabel.getText();
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
-        * .lang.Object)
-        */
        @Override
        public void handleEvent(Object eventSource) {
                if(eventSource==textLabel){
index 46c95c83d6c2a41313356e78855b29ded5eeaa1a..6981bc6617d6a0abdd90340f6582446c194f74d9 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section.key;
 
@@ -16,7 +16,7 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
  * @author n.hoffmann
- * 
+ *
  */
 public class PolytomousKeyNodeDetailElement extends
                AbstractCdmDetailElement<PolytomousKeyNode> {
@@ -97,7 +97,7 @@ public class PolytomousKeyNodeDetailElement extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
         * .lang.Object)
@@ -105,10 +105,9 @@ public class PolytomousKeyNodeDetailElement extends
        @Override
        public void handleEvent(Object eventSource) {
                if (eventSource == element_question) {
-                       getEntity().getParent().setQuestion(
-                                       element_question.getKeyStatement());
+                       getEntity().getParent().setQuestion(element_question.updateKeyStatement(getEntity().getQuestion()));
                } else if (eventSource == element_statement) {
-                       getEntity().setStatement(element_statement.getKeyStatement());
+                   getEntity().setStatement(element_statement.updateKeyStatement(getEntity().getStatement()));
                } else if (eventSource == selection_feature) {
                        getEntity().getParent().setFeature(selection_feature.getEntity());
                } else if (eventSource == selection_taxon) {
index 9d016cb3175be5d881d8eb238c4c495ff5b1410d..a189aa869de71d0393011e79770889ad4bb78115 100644 (file)
@@ -19,7 +19,6 @@ import org.eclipse.swt.events.SelectionListener;
 
 import eu.etaxonomy.cdm.common.media.ImageInfo;
 import eu.etaxonomy.cdm.model.media.ImageFile;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
@@ -40,16 +39,6 @@ public class ImageFileElement extends MediaRepresentationPartElement<ImageFile>
        private KeyValueViewerElement element_keyValue;
        private ImageElement element_image;
 
-
-       private final Runnable postRunnable = new Runnable(){
-               @Override
-        public void run() {
-                       AbstractUtility.reflowDetailsViewer();
-                       AbstractUtility.reflowSupplementalViewer();
-               }
-       };
-
-
        public ImageFileElement(CdmFormFactory cdmFormFactory,
                        AbstractFormSection section, ImageFile element,
                        SelectionListener removeListener, int style) {
@@ -85,7 +74,7 @@ public class ImageFileElement extends MediaRepresentationPartElement<ImageFile>
        private void loadImage(URI uri, boolean updateDimensions) throws IOException, HttpException{
                element_image.initImageUri(uri);
 
-               element_image.loadImage(postRunnable );
+               element_image.loadImage();
 
 
                if(uri == null){
@@ -117,7 +106,7 @@ public class ImageFileElement extends MediaRepresentationPartElement<ImageFile>
        public void handleEvent(Object eventSource) {
                if(eventSource == text_uri){
                        try {
-                           URI uri = text_uri.getUri();
+                           URI uri = text_uri.parseText();
                                getEntity().setUri(uri);
                                if(uri==null){
                                    //buffer URI if parsing error occurred
@@ -139,16 +128,11 @@ public class ImageFileElement extends MediaRepresentationPartElement<ImageFile>
        }
 
        protected void handleException(Exception e) {
-               element_image.unloadImage(postRunnable);
+               element_image.unloadImage();
                text_height.setNumber(0);
                text_width.setNumber(0);
+               text_size.setNumber(0);
 
-               element_image.loadImage(new Runnable(){
-                       @Override
-            public void run() {
-                               AbstractUtility.reflowDetailsViewer();
-                               AbstractUtility.reflowSupplementalViewer();
-                       }
-               });
+               element_image.loadImage();
        }
 }
index 1c27665647713fdd53c267767588114f683fb708..5e033d7802e7907b29282bc2092e1849d8f3e1fd 100644 (file)
@@ -13,6 +13,13 @@ import java.net.URI;
 import java.util.List;
 import java.util.Set;
 
+import org.apache.sanselan.ImageReadException;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Label;
+
+import eu.etaxonomy.cdm.common.UriUtils;
+import eu.etaxonomy.cdm.common.media.ImageInfo;
+import eu.etaxonomy.cdm.model.media.ImageFile;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.media.MediaRepresentation;
 import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
@@ -22,6 +29,7 @@ import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.ImageElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.element.UriWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
@@ -45,6 +53,8 @@ public class MediaDetailElement extends AbstractCdmDetailElement<Media>{
      * Used to store the URI even if it is invalid and thus cannot be stored in CDM
      */
     private String uriBuffer;
+    private ImageElement element_image;
+    private Label lblNoImage;
 
     public MediaDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
         super(formFactory, formElement);
@@ -70,14 +80,56 @@ public class MediaDetailElement extends AbstractCdmDetailElement<Media>{
     public void handleEvent(Object eventSource){
         if(eventSource==textUri){
             textUri.setBackground(getPersistentBackground());
-            URI uri = textUri.getUri();
+            URI uri = textUri.parseText();
             singleMediaRepresentationPart.setUri(uri);
             if(uri==null){
                 uriBuffer=textUri.getText();
             }
+            else{
+                createImageElement(uri);
+            }
+        }
+    }
+
+    private void createImageElement(URI uri) {
+        ImageInfo imageInfo;
+        try {
+            if(uri == null){
+                return;
+            }
+            //first check if uri refers to an actual (non-image) file
+            UriUtils.getInputStream(uri);// will fail with a FileNotFoundException if not
+            imageInfo = ImageInfo.NewInstance(uri, 10000);//will fail when it is no image file
+            singleMediaRepresentationPart.setSize((int) imageInfo.getLength());
+            if(singleMediaRepresentationPart instanceof ImageFile){
+                ((ImageFile) singleMediaRepresentationPart).setHeight(imageInfo.getHeight());
+                ((ImageFile) singleMediaRepresentationPart).setWidth(imageInfo.getWidth());
+            }
+            singleMediaRepresentationPart.getMediaRepresentation().setMimeType(imageInfo.getMimeType());
+            singleMediaRepresentationPart.getMediaRepresentation().setSuffix(imageInfo.getSuffix());
+            element_image = formFactory.createImageElement(parentFormElement, uri, style);
+            element_image.initImageUri(uri);
+            element_image.loadImage();
+               disposeErrorLabel();
+        } catch (Exception e){
+               if(e.getCause()!=null && e.getCause().getClass().equals(ImageReadException.class)){
+                       disposeErrorLabel();
+                       handleException(uri, "No preview available for this file type");
+               }
+               else{
+                       disposeErrorLabel();
+                       handleException(uri, "No file found");
+               }
         }
     }
 
+       private void disposeErrorLabel() {
+               if(lblNoImage!=null){
+                   lblNoImage.dispose();
+               }
+               lblNoImage = null;
+       }
+
     public void toggleAdvancedMediaView() {
         if (getEntity().getRepresentations() != null
                 && (getEntity().getRepresentations().size() > 1 ||
@@ -99,6 +151,10 @@ public class MediaDetailElement extends AbstractCdmDetailElement<Media>{
             if(textUri!=null){
                 removeElementsAndControls(textUri);
             }
+            if(element_image!=null){
+                element_image.dispose();
+                element_image = null;
+            }
             section_mediaRepresentation = formFactory.createMediaRepresentationSection(getConversationHolder(), parentFormElement, style);
             section_mediaRepresentation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             section_mediaRepresentation.setEntity(getEntity());
@@ -113,13 +169,15 @@ public class MediaDetailElement extends AbstractCdmDetailElement<Media>{
             }
             textUri = formFactory.createUriWithLabelElement(parentFormElement, "Media URI", null, style);
             URI uri = singleMediaRepresentationPart.getUri();
-            textUri.setUri(uri);
+            textUri.setParsedText(uri);
             //set buffered uri as text if uri had parsing problems in advanced view
             if(uri==null && uriBuffer!=null){
                 textUri.setText(uriBuffer);
-                textUri.getUri();
+                textUri.parseText();
             }
             textUri.getLayoutComposite().layout();
+
+            createImageElement(singleMediaRepresentationPart.getUri());
         }
     }
 
@@ -143,6 +201,19 @@ public class MediaDetailElement extends AbstractCdmDetailElement<Media>{
         isAdvancedMediaView =  false;
     }
 
+    private void handleException(URI uri, String labelText) {
+        if(element_image!=null){
+            element_image.unloadImage();
+            element_image.loadImage();
+            element_image.dispose();
+        }
+        if(lblNoImage==null){
+                       lblNoImage = formFactory.createLabel(getLayoutComposite(), labelText);
+            lblNoImage.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+            lblNoImage.setAlignment(SWT.CENTER);
+        }
+    }
+
     public boolean isAdvancedMediaView() {
         return isAdvancedMediaView;
     }
index 517e9cfd36504917d02a711a9d1e9535d3a1b8fb..706ceb4bcf76cf61b70674f352e7e86f992acd17 100644 (file)
@@ -3,11 +3,15 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.media;
 
+import org.apache.commons.lang.StringUtils;
 import org.eclipse.jface.action.IAction;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
 
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
@@ -20,9 +24,12 @@ import eu.etaxonomy.taxeditor.ui.dialog.selection.MediaSelectionDialog;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.ISelectableElement;
 import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
@@ -30,17 +37,24 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
  * @created Nov 17, 2009
  * @version 1.0
  */
-public class MediaMetaElement extends AbstractEntityCollectionElement<Media> implements ITogglableMediaElement{
+public class MediaMetaElement extends AbstractEntityCollectionElement<Media> implements ISelectableElement, ITogglableMediaElement{
 
     private EntitySelectionElement<AgentBase> selection_artist;
     private LanguageStringWithLabelElement text_description;
     private LanguageStringWithLabelElement text_title;
     private MediaDetailElement mediaDetailElement;
+    private SelectionArbitrator selectionArbitrator;
 
     public MediaMetaElement(CdmFormFactory cdmFormFactory,
             AbstractFormSection<?> formElement, Media element,
             SelectionListener removeListener, boolean isChoosableEntity, int style) {
         super(cdmFormFactory, formElement, element, removeListener, isChoosableEntity, null, style);
+        //make element selectable
+        if(cdmFormFactory.getSelectionProvider() != null){
+            selectionArbitrator = cdmFormFactory.createSelectionArbitrator(this);
+        }
+       
+       
     }
 
     /** {@inheritDoc} */
@@ -58,8 +72,10 @@ public class MediaMetaElement extends AbstractEntityCollectionElement<Media> imp
         });
         text_title = formFactory.createLanguageStringWithLabelElement(element, "Title", null, style);
         selection_artist = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), element, "Artist", null, EntitySelectionElement.ALL, style);
+        addElement(selection_artist);
         text_description = formFactory.createLanguageStringWithLabelElement(element, "Description", null, 100, true, style);
         mediaDetailElement = formFactory.createMediaDetailElement(element);
+        addElement(mediaDetailElement);
     }
 
     /** {@inheritDoc} */
@@ -77,15 +93,18 @@ public class MediaMetaElement extends AbstractEntityCollectionElement<Media> imp
         LanguageString title = element.getTitle(CdmStore.getDefaultLanguage());
 
         if (title == null) {
-            title = LanguageString.NewInstance("", CdmStore.getDefaultLanguage());
+            title = LanguageString.NewInstance(element.getTitleCache(), CdmStore.getDefaultLanguage());
         }
 
         text_title.setLanguageString(title);
+        
     }
 
     @Override
     protected Media selectFromDialog() {
-        return MediaSelectionDialog.select(AbstractUtility.getShell(), null, null);
+       
+       setEntity(MediaSelectionDialog.select(AbstractUtility.getShell(), null, null));
+        return entity;
     }
 
     @Override
@@ -94,7 +113,7 @@ public class MediaMetaElement extends AbstractEntityCollectionElement<Media> imp
     }
 
     /** {@inheritDoc} */
-    @Override
+   @Override
     public void handleEvent(Object eventSource) {
         if (eventSource == selection_artist) {
             getEntity().setArtist(selection_artist.getSelection());
@@ -108,4 +127,9 @@ public class MediaMetaElement extends AbstractEntityCollectionElement<Media> imp
         }
     }
 
+    @Override
+    public SelectionArbitrator getSelectionArbitrator() {
+        return selectionArbitrator;
+    }
+
 }
index 663848da419d2bef3ba02e2b78c73f4c0911f147..e89b514bd6c54e6bdc43d83f43ff368ae6a2a16c 100644 (file)
@@ -58,12 +58,12 @@ public class MediaRepresentationPartElement<T extends MediaRepresentationPart> e
                        text_size.setText(FileUtils.byteCountToDisplaySize(entity.getSize()));
                }
                if(entity.getUri() != null){
-                       text_uri.setUri(entity.getUri());
+                       text_uri.setParsedText(entity.getUri());
                } else {
             String uriBuffer = getParentMediaDetailElement().getUriBuffer();
             if(uriBuffer!=null){
                 text_uri.setText(uriBuffer);
-                text_uri.getUri();//just to update the error label
+                text_uri.parseText();//just to update the error label
             }
         }
        }
@@ -71,7 +71,7 @@ public class MediaRepresentationPartElement<T extends MediaRepresentationPart> e
        @Override
        public void handleEvent(Object eventSource) {
                if(eventSource == text_uri){
-                   URI uri = text_uri.getUri();
+                   URI uri = text_uri.parseText();
                    getEntity().setUri(uri);
                    if(uri==null){
                 //buffer URI if parsing error occurred
index e5e0857823c916ad7703f69d202921fab74e5a06..d80937e970d00992a2342e2fa6423b6af1305530 100644 (file)
@@ -69,7 +69,7 @@ public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<N
        public NameDetailElement(CdmFormFactory cdmFormFactory, ICdmFormElement formElement,
                        int style) {
                super(cdmFormFactory, formElement);
-               // register as selection listener
+               // make this element selectable
                if(cdmFormFactory.getSelectionProvider() != null){
                        selectionArbitrator = cdmFormFactory.createSelectionArbitrator(this);
                }
@@ -250,4 +250,15 @@ public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<N
                        toggleable_cache.setText(getEntity().getNameCache());
                }
        }
+       
+       @Override
+       protected void handleToggleableCacheField() {
+        boolean pushedState = toggleable_cache.getState();
+
+        getEntity().setTitleCache(toggleable_cache.getText(), pushedState);
+        setIrrelevant(pushedState, Arrays.asList(new Object[] { toggleable_cache, text_appendedPhrase, checkbox_anamorphic }));
+        updateToggleableCacheField();
+    }  
+
+
 }
index 203141ac659bfb6153a6db23302fa7bd0898c861..e96d14cfff812f7182176d489e316fd3d9fd09b4 100644 (file)
@@ -12,7 +12,6 @@ package eu.etaxonomy.taxeditor.ui.section.name;
 
 import org.eclipse.jface.util.IPropertyChangeListener;
 import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
 
@@ -20,10 +19,8 @@ import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.cdm.model.name.NameRelationship;
 import eu.etaxonomy.cdm.model.name.NameRelationshipType;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.taxeditor.ui.AbstractEntityCollectionElementWizardPage;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
-import eu.etaxonomy.taxeditor.ui.element.RootElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
@@ -35,11 +32,9 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
  * @created Jun 1, 2010
  * @version 1.0
  */
-public class NameRelationshipWizardPage extends WizardPage implements
+public class NameRelationshipWizardPage extends AbstractEntityCollectionElementWizardPage implements
                IPropertyChangeListener {
 
-       private final CdmFormFactory formFactory;
-
        private EntitySelectionElement<TaxonNameBase> selection_relatedTo;
 
        private TermComboElement<NameRelationshipType> combo_relationshipType;
@@ -50,8 +45,6 @@ public class NameRelationshipWizardPage extends WizardPage implements
 
        private TaxonNameBase toName;
 
-       private RootElement rootElement;
-
        /**
         * <p>
         * Constructor for NameRelationshipWizardPage.
@@ -83,13 +76,7 @@ public class NameRelationshipWizardPage extends WizardPage implements
        /** {@inheritDoc} */
        @Override
        public void createControl(Composite parent) {
-               this.setPageComplete(false);
-
-               Composite control = formFactory.createComposite(parent);
-
-               control.setLayout(LayoutConstants.LAYOUT(2, false));
-
-               rootElement = new RootElement(formFactory, control);
+           super.createControl(parent);
 
                combo_relationshipType = formFactory.createDefinedTermComboElement(TermType.NameRelationshipType,
                                                rootElement, "Name Relationship Type", null, SWT.NULL);
@@ -101,7 +88,6 @@ public class NameRelationshipWizardPage extends WizardPage implements
                                                "Related to", null, EntitySelectionElement.ALL,
                                                SWT.NULL);
 
-               setControl(control);
        }
 
        /**
@@ -132,11 +118,4 @@ public class NameRelationshipWizardPage extends WizardPage implements
                setPageComplete(complete);
        }
 
-       /** {@inheritDoc} */
-       @Override
-       public void dispose() {
-               rootElement.removeElements();
-               formFactory.removePropertyChangeListener(this);
-               super.dispose();
-       }
 }
index bacf0fd933146bfb7bd5c13a91d57ac6fc8dc075..291694aae6920ff9f6584ae48dbe4f4cd3eff82a 100644 (file)
@@ -25,9 +25,6 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
- * <p>
- * NameTypeDesignationElement class.
- * </p>
  *
  * @author n.hoffmann
  * @created May 17, 2010
@@ -41,25 +38,6 @@ public class NameTypeDesignationElement extends
        private EntitySelectionElement<TaxonNameBase> selection_typeName;
        private TermComboElement<NameTypeDesignationStatus> combo_typeStatus;
 
-       /**
-        * <p>
-        * Constructor for NameTypeDesignationElement.
-        * </p>
-        *
-        * @param formFactory
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-        *            object.
-        * @param section
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
-        *            object.
-        * @param entity
-        *            a {@link eu.etaxonomy.cdm.model.name.NameTypeDesignation}
-        *            object.
-        * @param removeListener
-        *            a {@link org.eclipse.swt.events.SelectionListener} object.
-        * @param style
-        *            a int.
-        */
        public NameTypeDesignationElement(CdmFormFactory formFactory,
                        AbstractFormSection section, NameTypeDesignation entity,
                        SelectionListener removeListener, int style) {
@@ -116,9 +94,6 @@ public class NameTypeDesignationElement extends
                } else if (eventSource == text_referenceDetail) {
                        getEntity().setCitationMicroReference(
                                        text_referenceDetail.getText());
-               } else if (eventSource == text_originaleNameString) {
-                       getEntity().setOriginalNameString(
-                                       text_originaleNameString.getText());
                }
        }
 }
index a3ce82144d9449614dd6f8dc09dede3e0d14bf52..37ade07a042cf480027e466b601cb53bd18a76e4 100644 (file)
@@ -26,8 +26,6 @@ import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractReferencedEntityElement;
 
 /**
- * <p>NomenclaturalStatusElement class.</p>
- *
  * @author n.hoffmann
  * @created Nov 5, 2009
  * @version 1.0
@@ -40,24 +38,12 @@ public class NomenclaturalStatusElement extends AbstractReferencedEntityElement<
 
        private final SelectionArbitrator selectionArbitrator;
 
-       /**
-        * <p>Constructor for NomenclaturalStatusElement.</p>
-        *
-        * @param formElement a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} object.
-        * @param element a {@link eu.etaxonomy.cdm.model.name.NomenclaturalStatus} object.
-        * @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object.
-        * @param style a int.
-        * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        */
        public NomenclaturalStatusElement(CdmFormFactory cdmFormFactory, AbstractFormSection formElement,
                        NomenclaturalStatus element, SelectionListener removeListener, int style) {
                super(cdmFormFactory, formElement, element, removeListener, style);
                selectionArbitrator = cdmFormFactory.createSelectionArbitrator(this);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite#createControls(org.eclipse.swt.widgets.Composite, int)
-        */
        /** {@inheritDoc} */
        @Override
        public void createControls(ICdmFormElement element, int style) {
@@ -67,9 +53,6 @@ public class NomenclaturalStatusElement extends AbstractReferencedEntityElement<
                super.createControls(element, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite#setElement(eu.etaxonomy.cdm.model.common.VersionableEntity)
-        */
        /** {@inheritDoc} */
        @Override
        public void setEntity(NomenclaturalStatus entity) {
@@ -88,10 +71,6 @@ public class NomenclaturalStatusElement extends AbstractReferencedEntityElement<
                return selectionArbitrator;
        }
 
-       /*
-        * (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent(java.lang.Object)
-        */
        /** {@inheritDoc} */
        @Override
        public void handleEvent(Object eventSource) {
@@ -107,8 +86,5 @@ public class NomenclaturalStatusElement extends AbstractReferencedEntityElement<
                else if(eventSource == text_referenceDetail){
                        getEntity().setCitationMicroReference(text_referenceDetail.getText());
                }
-               else if(eventSource == text_originaleNameString){
-                       getEntity().setOriginalNameString(text_originaleNameString.getText());
-               }
        }
 }
index 1213418a592094bbbe9977831a7c19553513e8a0..6b82772415c8f007691f004b3215731a67af233d 100644 (file)
@@ -22,6 +22,7 @@ import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.element.LsidWithExceptionLabelElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
 
@@ -37,6 +38,7 @@ public class NonViralNameDetailElement extends
        private AuthorshipDetailSection section_author;
        private EnumComboElement<NomenclaturalCode> combo_nomenclaturalCode;
        private HybridDetailSection section_hybrid;
+       private LsidWithExceptionLabelElement textLsid;
 
        public NonViralNameDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
@@ -56,7 +58,7 @@ public class NonViralNameDetailElement extends
                toggleable_cache.setVisible(false);
                combo_nomenclaturalCode.setVisible(false);
            }
-
+           textLsid = formFactory.createLsidWithExceptionLabelElement(formElement, "Lsid", entity.getLsid(), style);
            section_name = formFactory.createNameDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
            section_name.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            addControl(section_name);
@@ -73,6 +75,8 @@ public class NonViralNameDetailElement extends
                addControl(section_hybrid);
                addElement(section_hybrid);
            }
+
+
     }
 
        /** {@inheritDoc} */
@@ -146,5 +150,16 @@ public class NonViralNameDetailElement extends
                        section_name.setEntity(getEntity());
                        getLayoutComposite().layout();
                }
+               else if(eventSource==textLsid){
+                   getEntity().setLsid(textLsid.parseText());
+               }
        }
+       @Override
+       protected void handleToggleableCacheField() {
+        boolean pushedState = toggleable_cache.getState();
+
+        getEntity().setTitleCache(toggleable_cache.getText(), pushedState);
+        setIrrelevant(pushedState, Arrays.asList(new Object[] { toggleable_cache, textLsid }));
+        updateToggleableCacheField();
+    }
 }
index 4f4c09e06ef72de7927395d69682a0d90195c6d6..9a02d8f98d514b01315b30a4767b272ca9265ea9 100644 (file)
@@ -44,6 +44,7 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<NonViral
                implements ITaxonBaseDetailSection {
 
        private TaxonBase taxonBase;
+       boolean nameChoosable = false;
 
        /**
         * <p>Constructor for NonViralNameDetailSection.</p>
@@ -52,41 +53,45 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<NonViral
         * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
         * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
         * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
+        * @param nameChoosable if <code>true</code> adds a button to choose the displayed name
         * @param style a int.
         */
        public NonViralNameDetailSection(CdmFormFactory formFactory, ConversationHolder conversation,
-                       ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+                       ICdmFormElement parentElement, ISelectionProvider selectionProvider, boolean nameChoosable, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
+               this.nameChoosable = nameChoosable;
        }
 
        @Override
        protected Control createToolbar() {
-               ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
-
-               //choose name
-               Action chooseNameAction = new Action("Choose Name", IAction.AS_PUSH_BUTTON){
-                   @Override
-                   public void run() {
-                       TaxonNameBase taxonName = NameSelectionDialog.select(getShell(), getConversationHolder(), null);
-                       if(taxonName!=null){
-                           if(taxonName.isInstanceOf(NonViralName.class)){
-                               CdmStore.getService(ITaxonNodeService.class).list(TaxonNode.class, null, null, null, null);
-                               NonViralName nonViralName = HibernateProxyHelper.deproxy(taxonName, NonViralName.class);
-                               taxonBase.setName(nonViralName);
-                               //                                      taxonBase.getTitleCache();
-                               setEntity(nonViralName);
-                               firePropertyChangeEvent(NonViralNameDetailSection.this);
-                           }
-                           else{
-                               MessagingUtils.warningDialog("Invalid name", this, "The selected name can not be used for this taxon.");
-                           }
-                       }
-                   }
-               };
-               chooseNameAction.setToolTipText("Choose name for this taxon");
-               chooseNameAction.setImageDescriptor(ImageResources.getImageDescriptor(ImageResources.BROWSE_ICON));
-
-               toolBarManager.add(chooseNameAction);
+               ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+
+               if(nameChoosable){
+                   //choose name
+                   Action chooseNameAction = new Action("Choose Name", IAction.AS_PUSH_BUTTON){
+                       @Override
+                       public void run() {
+                           TaxonNameBase taxonName = NameSelectionDialog.select(getShell(), getConversationHolder(), null);
+                           if(taxonName!=null){
+                               if(taxonName.isInstanceOf(NonViralName.class)){
+                                   CdmStore.getService(ITaxonNodeService.class).list(TaxonNode.class, null, null, null, null);
+                                   NonViralName nonViralName = HibernateProxyHelper.deproxy(taxonName, NonViralName.class);
+                                   taxonBase.setName(nonViralName);
+                                   //                                  taxonBase.getTitleCache();
+                                   setEntity(nonViralName);
+                                   firePropertyChangeEvent(NonViralNameDetailSection.this);
+                               }
+                               else{
+                                   MessagingUtils.warningDialog("Invalid name", this, "The selected name can not be used for this taxon.");
+                               }
+                           }
+                       }
+                   };
+                   chooseNameAction.setToolTipText("Choose name for this taxon");
+                   chooseNameAction.setImageDescriptor(ImageResources.getImageDescriptor(ImageResources.BROWSE_ICON));
+
+                   toolBarManager.add(chooseNameAction);
+           }
 
                //clone
                if(getEntity() != null && checkForMultipleNameUsages(getEntity())){
index aa7a3ef6b84a3e12599efb74d08028327ac6d30d..8b38c76dec048e084da08b0e691cae2b97033754 100644 (file)
@@ -110,7 +110,7 @@ public class ProtologueElement extends AbstractEntityCollectionElement<Descripti
        @Override
        public void handleEvent(Object eventSource) {
                if(eventSource == protologueUriText && protologueUriText.getText()!=null){
-                   mediaRepresentationPart.setUri(protologueUriText.getUri());
+                   mediaRepresentationPart.setUri(protologueUriText.parseText());
                }
        }
 
index 8a6a13fdc7915f430784fa0157957e2e92781b54..a7cc8010170345968144b529f846e4992353f915 100644 (file)
@@ -26,10 +26,6 @@ import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
- * <p>
- * SpecimenTypeDesignationElement class.
- * </p>
- *
  * @author n.hoffmann
  * @created May 17, 2010
  * @version 1.0
@@ -41,25 +37,6 @@ public class SpecimenTypeDesignationElement extends
        private EntitySelectionElement<DerivedUnit> selection_typeSpecimen;
        private TextWithLabelElement text_specimenTypeText;
 
-       /**
-        * <p>
-        * Constructor for SpecimenTypeDesignationElement.
-        * </p>
-        *
-        * @param formFactory
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-        *            object.
-        * @param section
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
-        *            object.
-        * @param entity
-        *            a {@link eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation}
-        *            object.
-        * @param removeListener
-        *            a {@link org.eclipse.swt.events.SelectionListener} object.
-        * @param style
-        *            a int.
-        */
        public SpecimenTypeDesignationElement(CdmFormFactory formFactory,
                        AbstractFormSection section, SpecimenTypeDesignation entity,
                        SelectionListener removeListener, int style) {
@@ -85,8 +62,8 @@ public class SpecimenTypeDesignationElement extends
                super.setEntity(entity);
                selection_typeSpecimen.setEntity(entity.getTypeSpecimen());
 
-               SpecimenTypeDesignationStatus typeStatus = (SpecimenTypeDesignationStatus) HibernateProxyHelper
-                               .deproxy(entity.getTypeStatus());
+               SpecimenTypeDesignationStatus typeStatus = HibernateProxyHelper
+                               .deproxy(entity.getTypeStatus(), SpecimenTypeDesignationStatus.class);
                combo_typeStatus.setSelection(typeStatus);
                checkbox_notDesignated.setSelection(entity.isNotDesignated());
        }
@@ -116,9 +93,6 @@ public class SpecimenTypeDesignationElement extends
                } else if (eventSource == text_referenceDetail) {
                        getEntity().setCitationMicroReference(
                                        text_referenceDetail.getText());
-               } else if (eventSource == text_originaleNameString) {
-                       getEntity().setOriginalNameString(
-                                       text_originaleNameString.getText());
                }
        }
 }
index 84f8f47ea48415927391dc3260e37a576940d77f..e71682282562a7a25cee02e4278cf9ddf2610270 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.name;
 
 import org.eclipse.jface.util.IPropertyChangeListener;
 import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
 
@@ -20,11 +19,9 @@ import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.ui.AbstractEntityCollectionElementWizardPage;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
-import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
-import eu.etaxonomy.taxeditor.ui.element.RootElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
@@ -32,9 +29,8 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
  * @date 27.01.2014
  *
  */
-public class SynonymRelationshipWizardPage extends WizardPage implements IPropertyChangeListener {
+public class SynonymRelationshipWizardPage extends AbstractEntityCollectionElementWizardPage implements IPropertyChangeListener {
 
-    private final CdmFormFactory formFactory;
 
     private EntitySelectionElement<Taxon> selection_relatedTo;
 
@@ -54,7 +50,6 @@ public class SynonymRelationshipWizardPage extends WizardPage implements IProper
 
     private Taxon taxon;
 
-    private RootElement rootElement;
 
     /**
      * <p>
@@ -87,13 +82,7 @@ public class SynonymRelationshipWizardPage extends WizardPage implements IProper
     /** {@inheritDoc} */
     @Override
     public void createControl(Composite parent) {
-        this.setPageComplete(false);
-
-        Composite control = formFactory.createComposite(parent);
-
-        control.setLayout(LayoutConstants.LAYOUT(2, false));
-
-        rootElement = new RootElement(formFactory, control);
+        super.createControl(parent);
 
         combo_relationshipType = formFactory.createDefinedTermComboElement(TermType.SynonymRelationshipType,
                 rootElement, "Synonym Relationship Type", null, SWT.NULL);
@@ -109,7 +98,6 @@ public class SynonymRelationshipWizardPage extends WizardPage implements IProper
 
         checkboxPartial = formFactory.createCheckbox(rootElement, "Partial Synonym", null, SWT.NULL);
 
-        setControl(control);
     }
 
     /**
@@ -147,11 +135,4 @@ public class SynonymRelationshipWizardPage extends WizardPage implements IProper
         setPageComplete(complete);
     }
 
-    /** {@inheritDoc} */
-    @Override
-    public void dispose() {
-        rootElement.removeElements();
-        formFactory.removePropertyChangeListener(this);
-        super.dispose();
-    }
 }
index d48891aa44c43070eb1a4ad766829937f3d7695f..11367f963396ab83a3b387eef6f18632ea2d1924 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -53,7 +53,7 @@ public class TypeDesignationSection extends AbstractEntityCollectionSection<Taxo
                        ICdmFormElement parentElement, int style) {
                super(formFactory, conversation, parentElement, "Type Designations", style);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public void addElement(TypeDesignationBase element) {
@@ -104,12 +104,13 @@ public class TypeDesignationSection extends AbstractEntityCollectionSection<Taxo
         * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#setTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
         */
        /** {@inheritDoc} */
-       public void setTaxonBase(TaxonBase entity) {
+       @Override
+    public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
                NonViralName name = (NonViralName) HibernateProxyHelper.deproxy(entity.getName());
                setEntity(name);
        }
-       
+
        private boolean isSpecimenType(){
                Rank rank = getEntity().getRank();
                return rank.isSpecies() || rank.isInfraSpecific();
index 69b53eb65dd7dca0e769676ad0a0a94edf4415a4..e7fcb52192ed3d660f88f344e90ba3cf17c5880d 100644 (file)
@@ -24,11 +24,6 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
  */
 public class DerivedUnitBaseWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
 
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param entity
-        */
        public DerivedUnitBaseWizardPage(CdmFormFactory formFactory,
                        ConversationHolder conversation, DerivedUnitFacade entity) {
                super(formFactory, conversation, entity);
@@ -36,17 +31,11 @@ public class DerivedUnitBaseWizardPage extends AbstractCdmEntityWizardPage<Deriv
                setPageComplete(true);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.forms.AbstractCdmEntityWizardPage#checkComplete()
-        */
        @Override
        protected void checkComplete() {
                setPageComplete(true);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
-        */
        @Override
        public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
                DerivedUnitBaseDetailElement detailElement = formFactory.createDerivedUnitBaseDetailElement(rootElement);
index 1ac5b58dea93b3758db25b287f039bbc055e2c58..e8d77391b6f73202cde719a80bec9820573d98f6 100644 (file)
@@ -45,6 +45,8 @@ public class DerivedUnitGeneralDetailElement extends
                AbstractCdmDetailElement<DerivedUnitFacade> {
 
     boolean showOnlyDerivedUnitData = false;
+    //TODO: flag to disable specimen type dropdown (#5244)
+    boolean showSpecimenType = true;
 
        private ToggleableTextElement toggleableText_titleCache;
        private EnumComboElement<SpecimenOrObservationType> combo_specorobstype;
@@ -71,13 +73,6 @@ public class DerivedUnitGeneralDetailElement extends
            super(formFactory, formElement);
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
-        * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
-        */
        @Override
        protected void createControls(ICdmFormElement formElement,
                        DerivedUnitFacade entity, int style) {
@@ -91,6 +86,7 @@ public class DerivedUnitGeneralDetailElement extends
                else{
                    combo_specorobstype = formFactory.createEnumComboElement(SpecimenOrObservationType.class, formElement, style);
                    combo_specorobstype.setSelection(entity.getType());
+                   combo_specorobstype.setEnabled(showSpecimenType);
                    selection_country = formFactory.createSelectionElement(NamedArea.class, getConversationHolder(),
                            formElement, "Country",
                            entity.getCountry(), EntitySelectionElement.NOTHING, style);
@@ -130,13 +126,6 @@ public class DerivedUnitGeneralDetailElement extends
 
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
-        * .lang.Object)
-        */
        @Override
        public void handleEvent(Object eventSource) {
                if (eventSource == toggleableText_titleCache) {
@@ -177,4 +166,8 @@ public class DerivedUnitGeneralDetailElement extends
         this.showOnlyDerivedUnitData = showOnlyDerivedUnitData;
     }
 
+    public void setShowSpecimenType(boolean showSpecimenType) {
+        this.showSpecimenType = showSpecimenType;
+    }
+
 }
index 88a722ca4f72a562db97e5b5771c9760c09b78e2..8db53cebc21711e2530cfb045da61c3885cd4240 100644 (file)
@@ -24,31 +24,21 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
  */
 public class DerivedUnitGeneralWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
 
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param entity
-        */
        public DerivedUnitGeneralWizardPage(CdmFormFactory formFactory,
                        ConversationHolder conversation, DerivedUnitFacade entity) {
                super(formFactory, conversation, entity);
                setTitle("General Specimen Data");
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.forms.AbstractCdmEntityWizardPage#checkComplete()
-        */
        @Override
        protected void checkComplete() {
                setPageComplete(true);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
-        */
        @Override
        public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
                DerivedUnitGeneralDetailElement detailElement = formFactory.createDerivedUnitGeneralDetailElement(rootElement);
+               detailElement.setShowSpecimenType(false);
                detailElement.setEntity(getEntity());
                checkComplete();
                return detailElement;
index 9d9c4ab5e0b1aaefcfd4b0f85a3c34dc51cba340..adff089110e40520abe8b1e5a494834575c2494b 100644 (file)
@@ -133,6 +133,12 @@ public class DeterminationEventDetailElement extends
                        getEntity().setPreferredFlag(checkbox_preferredFlag.getSelection());
                } else if (eventSource == selectionTaxonNameBase) {
                    getEntity().setTaxonName(selectionTaxonNameBase.getSelection());
+                   //empty taxon field if name does not belong the taxon
+                   TaxonBase taxonBase = selection_taxonBase.getEntity();
+                       if(taxonBase!=null && taxonBase.getName()!=null 
+                                       && !taxonBase.getName().equals(selectionTaxonNameBase.getSelection())){
+                               selection_taxonBase.setEntity(null);
+                       }
                } else if (eventSource == selection_taxonBase) {
                        TaxonBase taxon = selection_taxonBase.getSelection();
             getEntity().setTaxon(taxon);
index e511bf6eb6af14dead8e3e255d3fbf3685a16c34..b26451ff9268ef6d64e29a66bd3fdf02a9cc1dd6 100644 (file)
@@ -112,7 +112,7 @@ public class FieldUnitGeneralDetailElement extends AbstractCdmDetailElement<Deri
         } else if (eventSource == selection_country) {
             getEntity().setCountry(selection_country.getSelection());
         } else if (eventSource == languageText_locality) {
-            LanguageString locality = languageText_locality.getLanguageString();
+            LanguageString locality = languageText_locality.updateLanguageString(getEntity().getLocality());
             getEntity().setLocality(locality);
         } else if (eventSource == element_point) {
             getEntity().setExactLocation(element_point.getPoint());
index 5d2624b7a1dcd82cb6dd201ff6033200ee001e8b..2eac4598dd2777d96e21419a8c2848069773f51a 100644 (file)
@@ -24,11 +24,6 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
  */
 public class FieldUnitWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
 
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param entity
-        */
        public FieldUnitWizardPage(CdmFormFactory formFactory,
                        ConversationHolder conversation, DerivedUnitFacade entity) {
                super(formFactory, conversation, entity);
@@ -36,17 +31,11 @@ public class FieldUnitWizardPage extends AbstractCdmEntityWizardPage<DerivedUnit
                setPageComplete(true);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.forms.AbstractCdmEntityWizardPage#checkComplete()
-        */
        @Override
        protected void checkComplete() {
                setPageComplete(true);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
-        */
        @Override
        public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
                FieldUnitDetailElement detailElement = formFactory.createFieldUnitDetailElement(rootElement);
index bcfd178d4cc87a5e45145517faa9731f304a8efd..3343ce7d658cfbd936907525808958fd998bcdaa 100644 (file)
@@ -24,11 +24,6 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
  */
 public class GatheringEventWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
 
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param entity
-        */
        public GatheringEventWizardPage(CdmFormFactory formFactory,
                        ConversationHolder conversation, DerivedUnitFacade entity) {
                super(formFactory, conversation, entity);
@@ -36,17 +31,11 @@ public class GatheringEventWizardPage extends AbstractCdmEntityWizardPage<Derive
                setPageComplete(true);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.forms.AbstractCdmEntityWizardPage#checkComplete()
-        */
        @Override
        protected void checkComplete() {
                setPageComplete(true);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
-        */
        @Override
        public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
                GatheringEventDetailElement detailElement = formFactory.createGatheringEventDetailElement(rootElement);
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeoScopePolyKeyDetailSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeoScopePolyKeyDetailSection.java
new file mode 100644 (file)
index 0000000..2c5cdc6
--- /dev/null
@@ -0,0 +1,74 @@
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.ui.section.occurrence;
+
+import java.util.Collection;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.NamedAreaSelectionDialog;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
+
+/**
+ *
+ * @author pplitzner
+ * @date Sep 21, 2015
+ *
+ */
+public class GeoScopePolyKeyDetailSection extends AbstractEntityCollectionSection<PolytomousKey, NamedArea> {
+
+    public GeoScopePolyKeyDetailSection(CdmFormFactory formFactory,
+                       ConversationHolder conversation, ICdmFormElement parentElement, int style) {
+               super(formFactory, conversation, parentElement, "Geo Scopes", style);
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       public Collection<NamedArea> getCollection(PolytomousKey entity) {
+               return entity.getGeographicalScope();
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       public NamedArea createNewElement() {
+               NamedArea selection = NamedAreaSelectionDialog.select(getLayoutComposite().getShell(), getConversationHolder(), null);
+
+               return selection;
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       public void addElement(NamedArea element) {
+               getEntity().addGeographicalScope(element);
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       public void removeElement(NamedArea element) {
+               getEntity().removeGeographicalScope(element);
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       public String getEmptyString() {
+               return "No geo scopes yet.";
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       protected String getTooltipString() {
+               return "Add a geo scope";
+       }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/DerivedUnitTypeDesignationElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/DerivedUnitTypeDesignationElement.java
new file mode 100644 (file)
index 0000000..d9b695a
--- /dev/null
@@ -0,0 +1,110 @@
+// $Id$
+/**
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+
+package eu.etaxonomy.taxeditor.ui.section.occurrence.association;
+
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.swt.events.SelectionListener;
+
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
+import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
+import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.name.AbstractTypeDesignationElement;
+import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
+
+/**
+ * @author n.hoffmann
+ * @created May 17, 2010
+ * @version 1.0
+ */
+public class DerivedUnitTypeDesignationElement extends AbstractTypeDesignationElement<SpecimenTypeDesignation> {
+
+    private TermComboElement<SpecimenTypeDesignationStatus> combo_typeStatus;
+
+    private List<EntitySelectionElement<TaxonNameBase>> selectionTaxonNames;
+    private ICdmFormElement parentFormElement;
+    private int style;
+
+    private EntitySelectionElement<TaxonNameBase> selectionTaxonName;
+
+    public DerivedUnitTypeDesignationElement(CdmFormFactory formFactory,
+            AbstractFormSection section, SpecimenTypeDesignation entity,
+            SelectionListener removeListener, int style) {
+        super(formFactory, section, entity, removeListener, style);
+    }
+
+    @Override
+    public void setEntity(SpecimenTypeDesignation entity) {
+        super.setEntity(entity);
+        Set<TaxonNameBase> typifiedNames = entity.getTypifiedNames();
+        if(typifiedNames.size()==1){
+            selectionTaxonName.setEntity(typifiedNames.iterator().next());
+        }
+        else if(typifiedNames.size()>1){
+            formFactory.createLabel(getLayoutComposite(), "!!!!!!!!");
+        }
+
+        SpecimenTypeDesignationStatus typeStatus = (SpecimenTypeDesignationStatus) HibernateProxyHelper
+                .deproxy(entity.getTypeStatus());
+        combo_typeStatus.setSelection(typeStatus);
+        checkbox_notDesignated.setSelection(entity.isNotDesignated());
+
+//        for (TaxonNameBase taxonNameBase : typifiedNames) {
+//            EntitySelectionElement<TaxonNameBase> selectionElement = formFactory.createSelectionElement(
+//                    TaxonNameBase.class, getConversationHolder(), parentFormElement, "Scientific Name", null,
+//                    EntitySelectionElement.EDITABLE | EntitySelectionElement.SELECTABLE, style);
+//            selectionElement.setEntity(taxonNameBase);
+//        }
+
+
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void createControls(ICdmFormElement element, int style) {
+        this.parentFormElement = element;
+        this.style = style;
+
+        selectionTaxonName = formFactory.createSelectionElement(
+                TaxonNameBase.class, getConversationHolder(), parentFormElement, "Scientific Name", null,
+                EntitySelectionElement.EDITABLE | EntitySelectionElement.SELECTABLE, style);
+
+        combo_typeStatus = formFactory.createDefinedTermComboElement(TermType.SpecimenTypeDesignationStatus,
+                parentFormElement, "Designation Status", null, style);
+
+        super.createControls(element, style);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void handleEvent(Object eventSource) {
+        if (eventSource == selectionTaxonName) {
+            selectionTaxonName.getSelection().addTypeDesignation(getEntity(), false);
+        } else if (eventSource == combo_typeStatus) {
+            getEntity().setTypeStatus(combo_typeStatus.getSelection());
+        } else if (eventSource == checkbox_notDesignated) {
+            getEntity().setNotDesignated(checkbox_notDesignated.getSelection());
+        } else if (eventSource == selection_reference) {
+            getEntity().setCitation(selection_reference.getSelection());
+        } else if (eventSource == text_referenceDetail) {
+            getEntity().setCitationMicroReference(
+                    text_referenceDetail.getText());
+        }
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/DerivedUnitTypeDesignationSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/DerivedUnitTypeDesignationSection.java
new file mode 100644 (file)
index 0000000..e63f84b
--- /dev/null
@@ -0,0 +1,91 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui.section.occurrence.association;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
+
+/**
+ * @author pplitzner
+ * @date Oct 29, 2015
+ *
+ */
+public class DerivedUnitTypeDesignationSection extends AbstractEntityCollectionSection<DerivedUnitFacade, SpecimenTypeDesignation> {
+
+    private Collection<SpecimenTypeDesignation> typeDesignations;
+
+    public DerivedUnitTypeDesignationSection(CdmFormFactory formFactory,
+            ConversationHolder conversation, ICdmFormElement parentElement, int style) {
+        super(formFactory, conversation, parentElement, "Type Designations", style);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public Collection<SpecimenTypeDesignation> getCollection(DerivedUnitFacade entity) {
+        typeDesignations = entity.innerDerivedUnit().getSpecimenTypeDesignations();
+        return typeDesignations;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public SpecimenTypeDesignation createNewElement() {
+        return SpecimenTypeDesignation.NewInstance();
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void addElement(SpecimenTypeDesignation element) {
+        element.setTypeSpecimen(getEntity().innerDerivedUnit());
+        typeDesignations.add(element);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void removeElement(SpecimenTypeDesignation element) {
+        List<SpecimenTypeDesignation> toRemove = new ArrayList<SpecimenTypeDesignation>();
+        for (SpecimenTypeDesignation specimenTypeDesignation : typeDesignations) {
+            if(element.equals(specimenTypeDesignation)){
+                toRemove.add(specimenTypeDesignation);
+            }
+        }
+        for (SpecimenTypeDesignation specimenTypeDesignation : toRemove) {
+            specimenTypeDesignation.removeType();
+            Set<TaxonNameBase> names = specimenTypeDesignation.getTypifiedNames();
+            for (TaxonNameBase taxonNameBase : names) {
+                taxonNameBase.removeTypeDesignation(specimenTypeDesignation);
+            }
+        }
+        typeDesignations.removeAll(toRemove);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public String getEmptyString() {
+        return "No type designation yet.";
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    protected String getTooltipString() {
+        return "Add a type designation";
+    }
+
+
+}
\ No newline at end of file
index 90c462a4f2e72f5fd610591cf82611ffcbbd9dda..697565e07800dcf182fc2e883cfb2aa549dbfd88 100644 (file)
@@ -11,8 +11,8 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence.association;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.Set;
+import java.util.UUID;
 
 import org.eclipse.core.commands.Command;
 import org.eclipse.core.commands.ExecutionException;
@@ -26,6 +26,7 @@ import org.eclipse.jface.viewers.ArrayContentProvider;
 import org.eclipse.jface.viewers.DoubleClickEvent;
 import org.eclipse.jface.viewers.IDoubleClickListener;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Label;
@@ -36,12 +37,9 @@ import org.eclipse.ui.handlers.IHandlerService;
 
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
-import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
-import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -57,10 +55,6 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
  */
 public class TaxonAssociationDetailElement extends AbstractCdmDetailElement<DerivedUnitFacade> implements IDoubleClickListener{
 
-
-    private TableViewer associationsViewer;
-    private TableViewer typeDesignationViewer;
-
     public TaxonAssociationDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
         super(formFactory, formElement);
     }
@@ -71,45 +65,70 @@ public class TaxonAssociationDetailElement extends AbstractCdmDetailElement<Deri
 
         //TODO add context menu for deleting associations
 
-        Label associationsLabel = formFactory.createLabel(getLayoutComposite(), "Individuals Associations");
-        associationsLabel.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-
-        associationsViewer = new TableViewer(getLayoutComposite(), SWT.FULL_SELECTION);
-        associationsViewer.getTable().setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-        associationsViewer.setContentProvider(new ArrayContentProvider());
-        Collection<IndividualsAssociation> individualsAssociations = CdmStore.getService(IOccurrenceService.class).listIndividualsAssociations(entity.innerDerivedUnit(), null, null, null, null);
-        //TODO implement service method for this which is just used in the label provider
-        Collection<TaxonBase<?>> associatedTaxa = new HashSet<TaxonBase<?>>();
-        for (IndividualsAssociation individualsAssociation : individualsAssociations) {
-            if(individualsAssociation.getInDescription().isInstanceOf(TaxonDescription.class)){
-                TaxonDescription taxonDescription = HibernateProxyHelper.deproxy(individualsAssociation.getInDescription(), TaxonDescription.class);
-                associatedTaxa.add(taxonDescription.getTaxon());
-            }
-        }
-        associationsViewer.setInput(associatedTaxa);
-        associationsViewer.addDoubleClickListener(this);
-
-        Label typeLabel = formFactory.createLabel(getLayoutComposite(), "Type Designations");
-        typeLabel.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-
-        typeDesignationViewer = new TableViewer(getLayoutComposite(), SWT.FULL_SELECTION);
-        typeDesignationViewer.getTable().setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-        typeDesignationViewer.setContentProvider(new ArrayContentProvider());
+        Collection<TaxonBase<?>> associatedTaxa = CdmStore.getService(IOccurrenceService.class).listIndividualsAssociationTaxa(entity.innerDerivedUnit(), null, null, null, null);
         Collection<SpecimenTypeDesignation> typeDesignations = CdmStore.getService(IOccurrenceService.class).listTypeDesignations(entity.innerDerivedUnit(), null, null, null, null);
-        //TODO implement service method for this which is just used in the label provider
-        Collection<TaxonBase<?>> typedTaxa = new HashSet<TaxonBase<?>>();
-        for (SpecimenTypeDesignation specimenTypeDesignation : typeDesignations) {
-            for (TaxonNameBase taxonNameBase : specimenTypeDesignation.getTypifiedNames()) {
-                Set taxa = taxonNameBase.getTaxa();
-                for (Object taxon : taxa) {
-                    if(taxon instanceof CdmBase && ((CdmBase)taxon).isInstanceOf(TaxonBase.class)){
-                        typedTaxa.add(HibernateProxyHelper.deproxy(taxon, TaxonBase.class));
+        Collection<DeterminationEvent> determinationEvents = CdmStore.getService(IOccurrenceService.class).listDeterminationEvents(entity.innerDerivedUnit(), null, null, null, null);
+
+        if(associatedTaxa.isEmpty() && typeDesignations.isEmpty() && determinationEvents.isEmpty()){
+            Label label = formFactory.createLabel(getLayoutComposite(), "No associations");
+            label.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+            return;
+        }
+        if(!associatedTaxa.isEmpty()){
+            TableViewer viewer = new TableViewer(getLayoutComposite(), SWT.FULL_SELECTION);
+            viewer.getTable().setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+            viewer.setContentProvider(new ArrayContentProvider());
+            viewer.setLabelProvider(new LabelProvider(){
+                @Override
+                public String getText(Object element) {
+                    return "Associated with "+element.toString();
+                }
+            });
+            viewer.setInput(associatedTaxa);
+            viewer.addDoubleClickListener(this);
+        }
+        if(!typeDesignations.isEmpty()){
+            TableViewer viewer = new TableViewer(getLayoutComposite(), SWT.FULL_SELECTION);
+            viewer.getTable().setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+            viewer.setContentProvider(new ArrayContentProvider());
+            viewer.setLabelProvider(new LabelProvider(){
+                @Override
+                public String getText(Object element) {
+                    SpecimenTypeDesignation typeDesignation = (SpecimenTypeDesignation)element;
+                    String label = typeDesignation.getTypeStatus()!=null?typeDesignation.getTypeStatus().getLabel()+" of ":"Type of ";
+                    Set<TaxonNameBase> typifiedNames = typeDesignation.getTypifiedNames();
+                    for (TaxonNameBase taxonNameBase : typifiedNames) {
+                        label += taxonNameBase+", ";
+                    }
+                    if(label.endsWith(", ")){
+                        label = label.substring(0, label.length()-2);
                     }
+                    return label;
                 }
-            }
+            });
+            viewer.setInput(typeDesignations);
+            viewer.addDoubleClickListener(this);
+        }
+        if(!determinationEvents.isEmpty()){
+            TableViewer viewer = new TableViewer(getLayoutComposite(), SWT.FULL_SELECTION);
+            viewer.getTable().setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+            viewer.setContentProvider(new ArrayContentProvider());
+            viewer.setLabelProvider(new LabelProvider(){
+                @Override
+                public String getText(Object element) {
+                    DeterminationEvent determinationEvent = (DeterminationEvent)element;
+                    if(determinationEvent.getTaxon()!=null){
+                        return "Determined as taxon "+determinationEvent.getTaxon();
+                    }
+                    if(determinationEvent.getTaxonName()!=null){
+                        return "Determined as name "+determinationEvent.getTaxonName();
+                    }
+                    return element.toString();
+                }
+            });
+            viewer.setInput(determinationEvents);
+            viewer.addDoubleClickListener(this);
         }
-        typeDesignationViewer.setInput(typedTaxa);
-        typeDesignationViewer.addDoubleClickListener(this);
     }
 
     /** {@inheritDoc} */
@@ -118,15 +137,26 @@ public class TaxonAssociationDetailElement extends AbstractCdmDetailElement<Deri
         //empty
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
-     */
     @Override
     public void doubleClick(DoubleClickEvent event) {
         if(event.getSelection() instanceof IStructuredSelection){
             Object firstElement = ((IStructuredSelection) event.getSelection()).getFirstElement();
+            UUID taxonToOpenUuid = null;
             if(firstElement instanceof TaxonBase<?>){
-                TaxonBase<?> taxonBase = (TaxonBase<?>)firstElement;
+                taxonToOpenUuid = ((TaxonBase<?>)firstElement).getUuid();
+            }
+            else if(firstElement instanceof SpecimenTypeDesignation){
+                //TODO how to open an editor for all typed names?
+            }
+            else if(firstElement instanceof DeterminationEvent){
+                if(((DeterminationEvent) firstElement).getTaxon()!=null){
+                    taxonToOpenUuid = ((DeterminationEvent) firstElement).getTaxon().getUuid();
+                }
+                else if(((DeterminationEvent) firstElement).getTaxonName()!=null){
+                    //TODO how to open editor for taxon name
+                }
+            }
+            if(taxonToOpenUuid!=null){
                 String commandId = "eu.etaxonomy.taxeditor.editor.openTaxonEditor";
 
 
@@ -144,7 +174,7 @@ public class TaxonAssociationDetailElement extends AbstractCdmDetailElement<Deri
                 } catch (NotDefinedException e1) {
                     MessagingUtils.error(this.getClass(), "Command not defined", e1);
                 }
-                Parameterization params = new Parameterization(iparam, (taxonBase).getUuid().toString());
+                Parameterization params = new Parameterization(iparam, taxonToOpenUuid.toString());
                 parameters.add(params);
 
                 //build the parameterized command
@@ -166,5 +196,4 @@ public class TaxonAssociationDetailElement extends AbstractCdmDetailElement<Deri
             }
         }
     }
-
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenDeterminationDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenDeterminationDetailElement.java
deleted file mode 100644 (file)
index 13cbdfd..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit;
-
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
-import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
-
-/**
- * @author n.hoffmann
- * @created May 11, 2011
- * @version 1.0
- */
-public class PreservedSpecimenDeterminationDetailElement extends AbstractCdmDetailElement<DerivedUnit> {
-
-       private PreservedSpecimenCurrentDeterminationDetailSection section_currentDetermination;
-
-       private PreservedSpecimenDeterminationHistoryDetailSection section_determinationHistory;
-
-       /**
-        * @param formFactory
-        * @param formElement
-        */
-       public PreservedSpecimenDeterminationDetailElement(CdmFormFactory formFactory,
-                       ICdmFormElement formElement) {
-               super(formFactory, formElement);
-       }
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#createControls(eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement, java.lang.Object, int)
-        */
-       @Override
-       protected void createControls(ICdmFormElement formElement,
-               DerivedUnit entity, int style) {
-
-        section_currentDetermination = formFactory.createPreservedSpecimenCurrentDeterminationDetailSection(getConversationHolder(), formElement, ExpandableComposite.EXPANDED);
-        section_currentDetermination.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-        section_currentDetermination.setEntity(entity);
-
-        section_determinationHistory = formFactory.createPreservedSpecimenDeterminationHistoryDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
-        section_determinationHistory.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-        section_determinationHistory.setEntity(entity);
-
-       }
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
-        */
-       @Override
-       public void handleEvent(Object eventSource) {
-               if(eventSource == section_currentDetermination){
-                       section_determinationHistory.refresh();
-               }
-       }
-
-}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenDeterminationDetailSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenDeterminationDetailSection.java
deleted file mode 100644 (file)
index 3c42524..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit;
-
-import org.eclipse.jface.viewers.ISelectionProvider;
-
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
-import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
-
-/**
- * @author n.hoffmann
- * @created May 11, 2011
- * @version 1.0
- */
-public class PreservedSpecimenDeterminationDetailSection extends AbstractCdmDetailSection<DerivedUnit> {
-
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param parentElement
-        * @param selectionProvider
-        * @param style
-        */
-       public PreservedSpecimenDeterminationDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
-                       ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
-       }
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
-        */
-       @Override
-       public String getHeading() {
-               return "Determinations";
-       }
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-        */
-       @Override
-       protected AbstractCdmDetailElement<DerivedUnit> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnit> parentElement, int style) {
-           return formFactory.createPreservedSpecimenDeterminationDetailElement(parentElement);
-       }
-
-}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenDeterminationHistoryDetailSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenDeterminationHistoryDetailSection.java
deleted file mode 100644 (file)
index f6ce0fc..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-
-/**
- * @author n.hoffmann
- * @created May 11, 2011
- * @version 1.0
- */
-public class PreservedSpecimenDeterminationHistoryDetailSection extends
-PreservedSpecimenAbstractDeterminationEventDetailSection {
-
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param parentElement
-        * @param style
-        */
-       public PreservedSpecimenDeterminationHistoryDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
-                       int style) {
-               super(formFactory, conversation, parentElement, "Determination History", style);
-       }
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
-        */
-       @Override
-       public Collection<DeterminationEvent> getCollection(DerivedUnit entity) {
-           if(entity!=null){
-               Set<DeterminationEvent> events = entity.getDeterminations();
-               Set<DeterminationEvent> result = new HashSet<DeterminationEvent>();
-               for (DeterminationEvent event : events){
-                   if (event.getPreferredFlag() != true){
-                       result.add(event);
-                   }
-               }
-               return result;
-           }
-               return null;
-       }
-
-       @Override
-       public void refresh() {
-               internalUpdateSection(false);
-       }
-
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
-        */
-       /** {@inheritDoc} */
-       @Override
-       protected String getTooltipString() {
-               return "Add a determination event to the history";
-       }
-
-}
index b6d5775dbeb533802fe582525aab5252d08a2099..ad27ecee85c49cef357128213384d198b08287b1 100644 (file)
@@ -113,9 +113,9 @@ public class SequenceGeneralDetailElement extends AbstractCdmDetailElement<Seque
             getEntity().setGeneticAccessionNumber(textGeneticAccessNo.getText());
             if(textGeneticAccessNo.getText()!=null && !textGeneticAccessNo.getText().isEmpty()){
                 try {
-                    textNCBIUri.setUri(getEntity().getGenBankUri());
-                    textENAUri.setUri(getEntity().getEmblUri());
-                    textDDBJUri.setUri(getEntity().getDdbjUri());
+                    textNCBIUri.setParsedText(getEntity().getGenBankUri());
+                    textENAUri.setParsedText(getEntity().getEmblUri());
+                    textDDBJUri.setParsedText(getEntity().getDdbjUri());
                 } catch (URISyntaxException e) {
                     textGeneticAccessNo.setBackground(getColor(Resources.COLOR_PARSE_ERROR));
                 }
@@ -131,7 +131,7 @@ public class SequenceGeneralDetailElement extends AbstractCdmDetailElement<Seque
             getEntity().setBoldProcessId(textBoldProcessID.getText());
             if(textBoldProcessID.getText()!=null && !textBoldProcessID.getText().isEmpty()){
                 try {
-                    textBoldUri.setUri(getEntity().getBoldUri());
+                    textBoldUri.setParsedText(getEntity().getBoldUri());
                 } catch (URISyntaxException e) {
                     textBoldProcessID.setBackground(getColor(Resources.COLOR_PARSE_ERROR));
                 }
index bdbab1697900c68af8eed7c30ee18368aee0f574..1f26a8bc26669896b9bce47aafa18710e3edc8d8 100644 (file)
@@ -22,7 +22,6 @@ import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
 import eu.etaxonomy.cdm.model.reference.ReferenceType;
-import eu.etaxonomy.taxeditor.model.AuthorHelper;
 import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
@@ -60,7 +59,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
        private TextWithLabelElement text_publisher;
        private TextWithLabelElement text_referenceAbstract;
        private TextWithLabelElement text_series;
-       private TextWithLabelElement text_seriesPart;
+//     private TextWithLabelElement text_seriesPart;
        private TextWithLabelElement text_volume;
        private TextWithLabelElement text_abbrevTitle;
        private TextWithLabelElement text_title;
@@ -127,7 +126,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                selection_authorTeam = formFactory
                                .createSelectionElement(AgentBase.class,
                                                getConversationHolder(), formElement, "Author",
-                                               AuthorHelper.getAuthor(entity.getAuthorship()),
+                                               entity.getAuthorship(),
                                                EntitySelectionElement.ALL, style);
 
                ReferenceType referenceType = entity.getType();
@@ -162,6 +161,8 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                                "Date Published", entity.getDatePublished(), style);
 
                createUriAndAbstract(this, entity, SWT.NULL);
+               handleToggleableAbbrevTitleField();
+               handleToggleableCacheField();
        }
 
        /*
@@ -185,8 +186,8 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                // Object[]{text_cache}));
                toggleable_cache.setEnabled(getEntity().isProtectedTitleCache());
                toggleableAbbrevCache.setEnabled(getEntity().isProtectedAbbrevTitleCache());
-        setIrrelevant(toggleable_cache.getState(), Arrays.asList(new Object[] { toggleable_cache }));
-        setIrrelevant(toggleableAbbrevCache.getState(), Arrays.asList(new Object[] { toggleableAbbrevCache}));
+               setIrrelevantReferenceDetail(false);
+               setIrrelevantReferenceDetail(true);
        }
 
        /**
@@ -360,10 +361,10 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                text_editor = formFactory.createTextWithLabelElement(element, "Editor",
                                reference.getEditor(), style);
 
-               // series part
+               /* series part
                text_seriesPart = formFactory.createTextWithLabelElement(element,
                                "Series", reference.getSeriesPart(), style);
-
+*/
                if (referenceType.equals(ReferenceType.Book)) {
                        // edition
                        text_edition = formFactory.createTextWithLabelElement(element,
@@ -432,8 +433,8 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                        getEntity().setPublisher(text_publisher.getText());
                } else if (eventSource == text_referenceAbstract) {
                        getEntity().setReferenceAbstract(text_referenceAbstract.getText());
-               } else if (eventSource == text_seriesPart) {
-                       getEntity().setSeriesPart(text_seriesPart.getText());
+               } else if (eventSource == text_series) {
+                       getEntity().setSeriesPart(text_series.getText());
                } else if (eventSource == text_title) {
                        getEntity().setTitle(text_title.getText());
                        toggleable_cache.setText(text_title.getText());
@@ -441,7 +442,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                    getEntity().setAbbrevTitle(text_abbrevTitle.getText());
                    toggleableAbbrevCache.setText(text_abbrevTitle.getText());
                } else if (eventSource == text_uri) {
-                       getEntity().setUri(text_uri.getUri());
+                       getEntity().setUri(text_uri.parseText());
                } else if (eventSource == text_volume) {
                        getEntity().setVolume(text_volume.getText());
                }
@@ -474,7 +475,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
     protected void handleToggleableAbbrevTitleField() {
         boolean pushedAbbrevState = toggleableAbbrevCache.getState();
         getEntity().setAbbrevTitleCache(toggleableAbbrevCache.getText(), pushedAbbrevState);
-        setIrrelevant(pushedAbbrevState, Arrays.asList(new Object[] { toggleableAbbrevCache, toggleable_cache, text_title }));
+        setIrrelevantReferenceDetail(true);
         updateToggleableCacheField();
     }
 
@@ -548,4 +549,39 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                        }
                }
        }
+
+       @Override
+       protected void handleToggleableCacheField() {
+
+               boolean pushedState = toggleable_cache.getState();
+        getEntity().setTitleCache(toggleable_cache.getText(), pushedState);
+        setIrrelevantReferenceDetail(false);
+        updateToggleableCacheField();
+    }
+
+       protected void setIrrelevantReferenceDetail(boolean abbrev){
+
+               List<Object> except = new ArrayList();
+           except.addAll( Arrays.asList(new Object[] { toggleable_cache, toggleableAbbrevCache, text_editor, text_isbn, text_issn, text_organisation, text_pages, text_placePublished, text_publisher, text_referenceAbstract,  text_uri, selection_institution}));
+           boolean pushedState;
+           if (abbrev){
+             except.add(text_title);
+             pushedState = toggleableAbbrevCache.getState();
+           } else{
+               except.add(text_abbrevTitle);
+               pushedState = toggleable_cache.getState();
+           }
+           switch( getEntity().getType()){
+           case Journal:
+               except.add(element_timePeriod);
+               break;
+           case Book:
+               except.remove(text_series);
+               except.remove(text_edition);
+               break;
+           default:
+               break;
+           }
+           setIrrelevant(pushedState, except);
+       }
 }
index 390529754a93ec98ebc8005071317ae6c814a555..d9187ccdd07671540650ea57fb7233aca7ce0cf3 100644 (file)
@@ -10,6 +10,7 @@
 
 package eu.etaxonomy.taxeditor.ui.section.supplemental;
 
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionListener;
 
 import eu.etaxonomy.cdm.model.common.OriginalSourceBase;
@@ -21,8 +22,6 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
 
 /**
- * <p>Abstract AbstractOriginalSourceElement class.</p>
- *
  * @author n.hoffmann
  * @created Mar 16, 2010
  * @version 1.0
@@ -31,17 +30,8 @@ public abstract class AbstractOriginalSourceElement<T extends OriginalSourceBase
        protected EnumComboElement<OriginalSourceType> combo_origsourcetype;
        protected TextWithLabelElement text_idInSource;
        protected TextWithLabelElement text_idNamespace;
+    protected TextWithLabelElement text_originaleNameString;
 
-       /**
-        * <p>Constructor for AbstractOriginalSourceElement.</p>
-        *
-        * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param section a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} object.
-        * @param element a T object.
-        * @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object.
-        * @param style a int.
-        * @param <T> a T object.
-        */
        public AbstractOriginalSourceElement(CdmFormFactory formFactory,
                        AbstractFormSection section,
                        T element, SelectionListener removeListener,
@@ -49,11 +39,13 @@ public abstract class AbstractOriginalSourceElement<T extends OriginalSourceBase
                super(formFactory, section, element, removeListener, style);
        }
 
-       /** {@inheritDoc} */
+       /**
+        * {@inheritDoc}
+        */
        @Override
-       public void init() {
-               super.init();
-               setHasOriginalNameString(true);
+       public void setEntity(T entity) {
+           super.setEntity(entity);
+        text_originaleNameString.setText(entity.getOriginalNameString());
        }
 
        /** {@inheritDoc} */
@@ -63,7 +55,9 @@ public abstract class AbstractOriginalSourceElement<T extends OriginalSourceBase
                                .createEnumComboElement(OriginalSourceType.class,
                                                formElement, style);
                super.createControls(formElement, style);
-               text_idInSource = formFactory.createTextWithLabelElement(formElement, "Id In Source", null, style);
+               text_idInSource = formFactory.createTextWithLabelElement(formElement, "ID in Source", null, style);
                text_idNamespace = formFactory.createTextWithLabelElement(formElement, "ID Namespace", null, style);
+               text_originaleNameString = formFactory.createTextWithLabelElement(
+                       formElement, "Original Name", null, SWT.NULL);
        }
 }
index c77b5379e1ee2abed1c92d242b0a76eb25bc2a72..c5871759f960d4c0564788d04f29d19bb3e5cfc0 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -18,62 +18,35 @@ import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.ISelectableElement;
+import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator;
 import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
- * <p>
- * Abstract AbstractReferencedEntityElement class.
- * </p>
- * 
  * @author n.hoffmann
  * @created Mar 25, 2010
  * @version 1.0
  */
 public abstract class AbstractReferencedEntityElement<T extends ReferencedEntityBase>
-               extends AbstractEntityCollectionElement<T> {
+               extends AbstractEntityCollectionElement<T> implements ISelectableElement {
 
+       private SelectionArbitrator selectionArbitrator;
+       
        protected EntitySelectionElement<Reference> selection_reference;
        protected TextWithLabelElement text_referenceDetail;
 
-       protected TextWithLabelElement text_originaleNameString;
-
-       private boolean hasOriginalNameString = false;
-
-       /**
-        * <p>
-        * Constructor for AbstractReferencedEntityElement.
-        * </p>
-        * 
-        * @param formFactory
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-        *            object.
-        * @param section
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
-        *            object.
-        * @param entity
-        *            a T object.
-        * @param removeListener
-        *            a {@link org.eclipse.swt.events.SelectionListener} object.
-        * @param style
-        *            a int.
-        * @param <T>
-        *            a T object.
-        */
        public AbstractReferencedEntityElement(CdmFormFactory formFactory,
                        AbstractFormSection section, T entity,
                        SelectionListener removeListener, int style) {
                super(formFactory, section, entity, removeListener, null, style);
+               // make this element selectable
+               if(formFactory.getSelectionProvider() != null){
+                       selectionArbitrator = formFactory.createSelectionArbitrator(this);
+               }
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * eu.etaxonomy.taxeditor.forms.section.AbstractEntityCollectionElement#
-        * createControls(eu.etaxonomy.taxeditor.forms.ICdmFormElement, int)
-        */
        /** {@inheritDoc} */
        @Override
        public void createControls(ICdmFormElement formElement, int style) {
@@ -83,69 +56,19 @@ public abstract class AbstractReferencedEntityElement<T extends ReferencedEntity
                                                null, EntitySelectionElement.ALL, style);
                text_referenceDetail = formFactory.createTextWithLabelElement(
                                formElement, "Reference Detail", null, SWT.NULL);
-               if (hasOriginalNameString)
-                       text_originaleNameString = formFactory.createTextWithLabelElement(
-                                       formElement, "Original Name", null, SWT.NULL);
        }
 
-       /**
-        * <p>
-        * setEntity
-        * </p>
-        * 
-        * @param entity
-        *            a T object.
-        */
        @Override
        public void setEntity(T entity) {
                this.entity = entity;
 
                selection_reference.setEntity(entity.getCitation());
                text_referenceDetail.setText(entity.getCitationMicroReference());
-               if (hasOriginalNameString)
-                       text_originaleNameString.setText(entity.getOriginalNameString());
-               // // remove old listeners
-               // clearEditButtonSelectionListener();
-               //
-               // addEditButtonSelectionListener(new
-               // BulkEditorOpeningSelectionListener(entity.getCitation()));
-               //
-       };
-
-       //
-       // public void addEditButtonSelectionListener(SelectionListener listener){
-       // selection_reference.addEditButtonSelectionListener(listener);
-       // }
-       //
-       // public void removeEditButtonSelectionListener(SelectionListener
-       // listener){
-       // selection_reference.removeEditorButtonSelectionListener(listener);
-       // }
-       //
-       // public void clearEditButtonSelectionListener(){
-       // selection_reference.clearEditButtonSelectionListener();
-       // }
-
-       /**
-        * <p>
-        * Setter for the field <code>hasOriginalNameString</code>.
-        * </p>
-        * 
-        * @param hasOriginalNameString
-        *            a boolean.
-        */
-       public void setHasOriginalNameString(boolean hasOriginalNameString) {
-               this.hasOriginalNameString = hasOriginalNameString;
        }
-
-       /**
-        * <p>
-        * hasOriginalNameString
-        * </p>
-        * 
-        * @return a boolean.
-        */
-       public boolean hasOriginalNameString() {
-               return hasOriginalNameString;
+       
+       @Override
+    public SelectionArbitrator getSelectionArbitrator() {
+               return selectionArbitrator;
        }
+
 }
index f28b943e7f48bdbf483976a766934144a48d7a56..a5f50e18a83869b54a2c8273976ff7babfde94c8 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section.supplemental;
 
@@ -11,41 +11,23 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 
 /**
- * <p>IdentifiableSourceElement class.</p>
- *
  * @author n.hoffmann
  * @created Nov 16, 2009
  * @version 1.0
  */
 public class IdentifiableSourceElement extends AbstractOriginalSourceElement<IdentifiableSource>{
-       
-       /**
-        * <p>Constructor for IdentifiableSourceElement.</p>
-        *
-        * @param formElement a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} object.
-        * @param element a {@link eu.etaxonomy.cdm.model.common.IdentifiableSource} object.
-        * @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object.
-        * @param style a int.
-        * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        */
+
        public IdentifiableSourceElement(CdmFormFactory cdmFormFactory, AbstractFormSection formElement, IdentifiableSource element,
                        SelectionListener removeListener, int style) {
                super(cdmFormFactory, formElement, element, removeListener, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite#createControls(org.eclipse.swt.widgets.Composite, int)
-        */
        /** {@inheritDoc} */
        @Override
        public void createControls(ICdmFormElement formElement, int style) {
                super.createControls(formElement, style);
        }
 
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite#setElement(eu.etaxonomy.cdm.model.common.VersionableEntity)
-        */
        /** {@inheritDoc} */
        @Override
        public void setEntity(IdentifiableSource entity) {
@@ -56,9 +38,9 @@ public class IdentifiableSourceElement extends AbstractOriginalSourceElement<Ide
                selection_reference.setEntity(entity.getCitation());
                text_referenceDetail.setText(entity.getCitationMicroReference());
                combo_origsourcetype.setSelection(entity.getType());
-               if(hasOriginalNameString()) text_originaleNameString.setText(entity.getOriginalNameString());
-       }       
-       
+               text_originaleNameString.setText(entity.getOriginalNameString());
+       }
+
        /** {@inheritDoc} */
        @Override
        public void handleEvent(Object eventSource) {
index 8139ecd577b6f229a6252d482e2ea8b18bd50e3b..b086a1857fb276d9609687d457804ceb84db5188 100644 (file)
@@ -180,4 +180,12 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem
                    ((Taxon)getEntity()).setPublish(checkbox_published.getSelection());
                }
        }
+       @Override
+       protected void handleToggleableCacheField() {
+        boolean pushedState = toggleable_cache.getState();
+
+        getEntity().setTitleCache(toggleable_cache.getText(), pushedState);
+        setIrrelevant(pushedState, Arrays.asList(new Object[] { toggleable_cache, text_appendedPhrase, checkbox_published, checkbox_unplaced, checkbox_excluded}));
+        updateToggleableCacheField();
+    }
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonWizardPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonWizardPage.java
new file mode 100644 (file)
index 0000000..fa6d9ec
--- /dev/null
@@ -0,0 +1,49 @@
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.ui.section.taxon;
+
+import org.eclipse.swt.SWT;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+
+/**
+ *
+ * @author pplitzner
+ * @date Jan 18, 2016
+ *
+ */
+public class TaxonWizardPage extends AbstractCdmEntityWizardPage<TaxonBase> {
+
+       public TaxonWizardPage(CdmFormFactory formFactory, ConversationHolder conversation,
+               TaxonBase entity) {
+               super(formFactory, conversation, entity);
+               setTitle("Taxon");
+       }
+
+
+       /** {@inheritDoc} */
+       @Override
+       public AbstractCdmDetailElement<TaxonBase> createElement(ICdmFormElement rootElement) {
+               TaxonBaseDetailElement taxonBaseDetailElement = formFactory.createTaxonBaseDetailElement(rootElement, SWT.NULL);
+               taxonBaseDetailElement.setEntity(entity);
+               return taxonBaseDetailElement;
+       }
+
+       @Override
+       public boolean isPageComplete() {
+           return true;
+       }
+}
index 0a5a6ad37156c72fc0099fe986efc2ba1e0ebb02..f2621ebd217500019e58521035fefab3f9856c2c 100644 (file)
@@ -66,7 +66,7 @@ public class NamedAreaDetailElement extends DefinedTermDetailElement<NamedArea>
                } else if (eventSource == text_description) {\r
                        getEntity().getRepresentation(Language.getDefaultLanguage()).setText(text_description.getText());\r
                } else if (eventSource == uri_uri) {\r
-                       getEntity().setUri(uri_uri.getUri());\r
+                       getEntity().setUri(uri_uri.parseText());\r
                } else if (eventSource == text_abbreviatedLabel) {\r
                        getEntity().getRepresentation(Language.getDefaultLanguage()).setAbbreviatedLabel(text_abbreviatedLabel.getText());\r
                } else if (eventSource == timePeriod_validPeriod) {\r
index 5f62d2417e571a62672f1a149a741c17bd13c39a..281b383e86be43be5d765258aba8012ed6cda478 100644 (file)
@@ -51,9 +51,9 @@ public class TermVocabularyDetailElement extends AbstractTermBaseDetailElement<T
                handleRepresentation(eventSource);\r
 \r
                if (eventSource == uri_uri) {\r
-                       getEntity().setUri(uri_uri.getUri());\r
+                       getEntity().setUri(uri_uri.parseText());\r
                } else if (eventSource == uri_uriTermSource) {\r
-                       getEntity().setTermSourceUri(uri_uriTermSource.getUri());\r
+                       getEntity().setTermSourceUri(uri_uriTermSource.parseText());\r
                }\r
        }\r
 \r
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/ClassificationSelectionElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/ClassificationSelectionElement.java
new file mode 100644 (file)
index 0000000..6650b83
--- /dev/null
@@ -0,0 +1,19 @@
+package eu.etaxonomy.taxeditor.ui.selection;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+
+public class ClassificationSelectionElement extends EntitySelectionElement<Classification> {
+
+       public ClassificationSelectionElement(CdmFormFactory formFactory,
+                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       Class<Classification> clazz, String labelString,
+                       Classification entity, int mode, int style) {
+               super(formFactory, conversation, parentElement, clazz, labelString, entity,
+                               mode, style);
+               
+       }
+
+}
index a9175681804242fd4de0d0f0ebc5b5ffc80ca804..adcbfeccd6afe4583ec11dd29ceb3a88432d5f04 100644 (file)
 
 package eu.etaxonomy.taxeditor.ui.selection;
 
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.ui.IEditorPart;
 
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
+import eu.etaxonomy.cdm.api.service.IService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.agent.Institution;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.model.agent.Team;
-import eu.etaxonomy.cdm.model.common.ICdmBase;
+import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.User;
 import eu.etaxonomy.cdm.model.molecular.Amplification;
 import eu.etaxonomy.cdm.model.molecular.Primer;
 import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.occurrence.Collection;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
 import eu.etaxonomy.cdm.model.reference.Reference;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
-import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.model.TextHelper;
 import eu.etaxonomy.taxeditor.newWizard.AmplificationGeneralWizardPage;
 import eu.etaxonomy.taxeditor.newWizard.PrimerWizardPage;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.section.agent.InstitutionWizardPage;
 import eu.etaxonomy.taxeditor.ui.section.agent.PersonWizardPage;
@@ -52,30 +60,24 @@ import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceWizardPage;
 import eu.etaxonomy.taxeditor.ui.section.user.UserDetailWizardPage;
 
 /**
- * <p>
- * EditFromSelectionWizard class.
- * </p>
- *
  * @author n.hoffmann
  * @created Jun 1, 2010
  * @version 1.0
  */
 public class EditFromSelectionWizard extends Wizard implements
-               SelectionListener {
+               SelectionListener, ICdmEntitySessionEnabled {
 
+    private ICdmEntitySession cdmEntitySession;
+    private ICdmEntitySession previousCdmEntitySession;
        private final EntitySelectionElement selectionElement;
+       private CdmBase rootElement;
 
-       /**
-        * <p>
-        * Constructor for EditFromSelectionWizard.
-        * </p>
-        *
-        * @param selectionElement
-        *            a
-        *            {@link eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement}
-        *            object.
-        */
        public EditFromSelectionWizard(EntitySelectionElement selectionElement) {
+        if (CdmStore.isActive() && CdmStore.getCurrentSessionManager().isRemoting()) {
+            previousCdmEntitySession = CdmStore.getCurrentSessionManager().getActiveSession();
+            cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
+            cdmEntitySession.bind();
+        }
                this.selectionElement = selectionElement;
                this.setWindowTitle(String.format("Edit %s", TextHelper.deproxyClassName(selectionElement.getEntity().getClass())));
        }
@@ -85,30 +87,46 @@ public class EditFromSelectionWizard extends Wizard implements
        public void addPages() {
 
                CdmFormFactory formFactory = selectionElement.getFormFactory();
-               ICdmBase entity = (ICdmBase) HibernateProxyHelper
+               CdmBase entity = HibernateProxyHelper
                                .deproxy(selectionElement.getEntity());
-
-               if (entity instanceof Reference) {
+               //check if entity has already been persisted
+               if(entity.getId()==0){
+                       rootElement = entity;
+                       cdmEntitySession.addNewCdmEntity(rootElement);
+               }
+               else{
+                       IService<CdmBase> service = CdmStore.getService(entity);
+                       rootElement = service.load(entity.getUuid());
+               }
+               if (rootElement.isInstanceOf(Reference.class)) {
                        addPage(new ReferenceWizardPage(formFactory,
                                        selectionElement.getConversationHolder(),
-                                       (Reference) entity));
-               } else if (entity instanceof Team) {
+                                       (HibernateProxyHelper.deproxy(rootElement, Reference.class))));
+               } else if (rootElement.isInstanceOf(Team.class)) {
                        addPage(new TeamWizardPage(formFactory,
-                                       selectionElement.getConversationHolder(), (Team) entity));
-               } else if (entity instanceof Person) {
+                                       selectionElement.getConversationHolder(), HibernateProxyHelper.deproxy(rootElement, Team.class)));
+               } else if (rootElement.isInstanceOf(Person.class)) {
                        addPage(new PersonWizardPage(formFactory,
-                                       selectionElement.getConversationHolder(), (Person) entity));
-               } else if (entity instanceof NonViralName) {
+                                       selectionElement.getConversationHolder(), HibernateProxyHelper.deproxy(rootElement, Person.class)));
+               } else if (rootElement.isInstanceOf(NonViralName.class)) {
                        addPage(new NonViralNameWizardPage(formFactory,
                                        selectionElement.getConversationHolder(),
-                                       (NonViralName) entity));
-               } else if (entity instanceof DerivedUnit) {
+                                       HibernateProxyHelper.deproxy(rootElement, NonViralName.class)));
+               } else if (rootElement.isInstanceOf(SpecimenOrObservationBase.class)) {
 
                        DerivedUnitFacade facade;
                        try {
-                               facade = DerivedUnitFacade.NewInstance(
-                                               (DerivedUnit) entity,
-                                               PreferencesUtil.getDerivedUnitConfigurator());
+                           if(rootElement.isInstanceOf(DerivedUnit.class)){
+                               facade = DerivedUnitFacade.NewInstance(
+                                       HibernateProxyHelper.deproxy(rootElement, DerivedUnit.class),
+                                       PreferencesUtil.getDerivedUnitConfigurator());
+                           }
+                           else {
+                    facade = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.FieldUnit,
+                            HibernateProxyHelper.deproxy(rootElement, FieldUnit.class),
+                            PreferencesUtil.getDerivedUnitConfigurator());
+                           }
+
                        } catch (DerivedUnitFacadeNotSupportedException e) {
                                // we should never get here
                                throw new IllegalStateException();
@@ -120,28 +138,30 @@ public class EditFromSelectionWizard extends Wizard implements
                                        selectionElement.getConversationHolder(), facade));
                        addPage(new FieldUnitWizardPage(formFactory,
                                        selectionElement.getConversationHolder(), facade));
-                       addPage(new DerivedUnitBaseWizardPage(formFactory,
-                                       selectionElement.getConversationHolder(), facade));
-               } else if (entity instanceof Collection) {
+                       if(facade.innerDerivedUnit()!=null){
+                           addPage(new DerivedUnitBaseWizardPage(formFactory,
+                                   selectionElement.getConversationHolder(), facade));
+                       }
+               } else if (rootElement.isInstanceOf(Collection.class)) {
                        addPage(new CollectionWizardPage(formFactory,
                                        selectionElement.getConversationHolder(),
-                                       (Collection) entity));
-               } else if (entity instanceof Institution) {
+                                       HibernateProxyHelper.deproxy(rootElement, Collection.class)));
+               } else if (rootElement instanceof Institution) {
                        addPage(new InstitutionWizardPage(formFactory,
                                        selectionElement.getConversationHolder(),
-                                       (Institution) entity));
-               } else if (entity instanceof User) {
+                                       HibernateProxyHelper.deproxy(rootElement, Institution.class)));
+               } else if (rootElement instanceof User) {
                        addPage(new UserDetailWizardPage(formFactory,
                                        selectionElement.getConversationHolder(),
-                                       (User) entity));
-               } else if (entity instanceof Primer) {
+                                       HibernateProxyHelper.deproxy(rootElement, User.class)));
+               } else if (rootElement instanceof Primer) {
             addPage(new PrimerWizardPage(formFactory,
                     selectionElement.getConversationHolder(),
-                    (Primer) entity));
-        } else if (entity instanceof Amplification) {
+                    HibernateProxyHelper.deproxy(rootElement, Primer.class)));
+        } else if (rootElement instanceof Amplification) {
             addPage(new AmplificationGeneralWizardPage(formFactory,
                     selectionElement.getConversationHolder(),
-                    (Amplification) entity));
+                    HibernateProxyHelper.deproxy(rootElement, Amplification.class)));
         } else {
                        MessagingUtils.warningDialog("Missing interface", this,
                                        "No detail element for current selection");
@@ -149,25 +169,15 @@ public class EditFromSelectionWizard extends Wizard implements
 
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see org.eclipse.jface.wizard.Wizard#performFinish()
-        */
        /** {@inheritDoc} */
        @Override
        public boolean performFinish() {
-           IEditorPart activeEditor = AbstractUtility.getActiveEditor();
-        /*
-         * forceDirty() for cases when one or more EditFromSelectionWizards are
-         * opened cascadingly to trigger the save button. Otherwise the dirty
-         * state would not be set and the user will have no feedback that he/she
-         * actually still has ounsaved changes. This is necessary because
-         * editing in these wizards is done on clones of the CDM entities which
-         * are merged back with the original when pressing "Finish"
-         */
-        if (activeEditor instanceof IDirtyMarkable){
-               ((IDirtyMarkable) activeEditor).forceDirty();
+           IService<CdmBase> service = CdmStore.getService(rootElement);
+           if(rootElement.getId()!=0){
+               service.merge(rootElement, true);
+           }
+           if(previousCdmEntitySession!=null){
+               selectionElement.setEntity(previousCdmEntitySession.load(rootElement, true));
            }
                return true;
        }
@@ -186,4 +196,30 @@ public class EditFromSelectionWizard extends Wizard implements
        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
        }
+
+    @Override
+    public void dispose() {
+        super.dispose();
+        if(cdmEntitySession != null) {
+            cdmEntitySession.dispose();
+        }
+        if(previousCdmEntitySession!=null){
+            previousCdmEntitySession.dispose();
+        }
+    }
+
+    @Override
+    public ICdmEntitySession getCdmEntitySession() {
+        return cdmEntitySession;
+    }
+
+    @Override
+    public java.util.Collection<CdmBase> getRootEntities() {
+        return Collections.singleton(rootElement);
+    }
+
+    @Override
+    public Map<Object, List<String>> getPropertyPathsMap() {
+        return null;
+    }
 }
index 88e9bb723bf99e2b093478774a4c4a2ffb9409f0..b04c73d4d50137a543d024706ac06d20fa39b280 100644 (file)
@@ -8,7 +8,7 @@ import java.util.Observable;
 import java.util.Observer;
 
 import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
@@ -24,35 +24,17 @@ import org.springframework.security.core.GrantedAuthority;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
-import eu.etaxonomy.cdm.api.service.IAgentService;
-import eu.etaxonomy.cdm.api.service.ICollectionService;
-import eu.etaxonomy.cdm.api.service.INameService;
-import eu.etaxonomy.cdm.api.service.IOccurrenceService;
-import eu.etaxonomy.cdm.api.service.IReferenceService;
 import eu.etaxonomy.cdm.api.service.IService;
-import eu.etaxonomy.cdm.api.service.IUserService;
-import eu.etaxonomy.cdm.api.service.molecular.IAmplificationService;
-import eu.etaxonomy.cdm.api.service.molecular.IPrimerService;
 import eu.etaxonomy.cdm.common.CdmUtils;
-import eu.etaxonomy.cdm.model.agent.Institution;
-import eu.etaxonomy.cdm.model.agent.Person;
-import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.Group;
-import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.User;
 import eu.etaxonomy.cdm.model.molecular.Amplification;
 import eu.etaxonomy.cdm.model.molecular.Primer;
-import eu.etaxonomy.cdm.model.name.NonViralName;
-import eu.etaxonomy.cdm.model.occurrence.Collection;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.ImageResources;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.Resources;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.LoginManager;
@@ -80,7 +62,7 @@ import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityLabelT
  * @version 1.0
  * @param <T>
  */
-public class EntitySelectionElement<T extends ICdmBase> extends
+public class EntitySelectionElement<T extends CdmBase> extends
                AbstractCdmFormElement implements  SelectionListener, IEnableableFormElement, ISelectableElement, IEntityElement<T>, ILabeledElement, IConversationEnabled, Observer {
 
        private static final EnumSet<CRUD> UPDATE = EnumSet.of(CRUD.UPDATE);
@@ -156,7 +138,7 @@ public class EntitySelectionElement<T extends ICdmBase> extends
                this.isDeletable = (mode & DELETABLE) == DELETABLE;
                boolean isSelectable = (mode & SELECTABLE) == SELECTABLE;
 
-               this.labelString = (labelString == null || labelString.equals("")) ? "" : labelString + " : ";
+               this.labelString = (labelString == null || labelString.equals("")) ? "" : labelString;
 
                this.conversation = conversation;
 
@@ -238,7 +220,7 @@ public class EntitySelectionElement<T extends ICdmBase> extends
 
        @Override
     public void widgetSelected(SelectionEvent e) {
-               T selection = SelectionDialogFactory.getSelectionFromDialog(clazz, getShell(), getConversationHolder(), getEntity());
+               T selection = SelectionDialogFactory.getSelectionFromDialog(clazz, getShell(), getConversationHolder(), getEntity(), getParentElement());
                setSelectionInternal(selection);
        }
 
@@ -260,10 +242,15 @@ public class EntitySelectionElement<T extends ICdmBase> extends
        /** {@inheritDoc} */
        @Override
        public void setEnabled(boolean enabled) {
+
                button_selection.setEnabled(enabled);
+               if (isDeletable){
+                   button_remove.setEnabled(enabled);
+               }
                if (isEditable) {
                        updateButtonStates();
                }
+
        }
 
        /* (non-Javadoc)
@@ -327,9 +314,7 @@ public class EntitySelectionElement<T extends ICdmBase> extends
         */
        protected String getTitle() {
                if (entity != null){
-                       if(entity instanceof IIdentifiableEntity) {
-                               return ((IIdentifiableEntity) entity).getTitleCache();
-                       } else if(entity instanceof Group){
+                       if(entity instanceof Group){
                                return ((Group) entity).getName();
                        } else if(entity instanceof GrantedAuthority){
                                return GrantedAuthorityLabelTextProvider.getText(((GrantedAuthority) entity));
@@ -340,6 +325,9 @@ public class EntitySelectionElement<T extends ICdmBase> extends
             } else if (entity instanceof Amplification){
                 return ((Amplification) entity).getLabelCache();
             }
+            else if(entity instanceof IIdentifiableEntity) {
+                return ((IIdentifiableEntity) entity).getTitleCache();
+            }
 
                }
                return "";
@@ -424,8 +412,6 @@ public class EntitySelectionElement<T extends ICdmBase> extends
 
        private class EditListener extends SelectionAdapter {
 
-        private static final String TRANSIENT_EDITING_WARNING_TEXT = "Warning: All changes for this element are directly reflected in the data base.\nThe \"Cancel\" button has no effect";
-        private static final String TRANSIENT_EDITING_WARNING_TITLE = "CDM element not yet saved.";
         private final EntitySelectionElement<T> selectionElement;
 
                public EditListener(EntitySelectionElement<T> selectionElement) {
@@ -435,80 +421,21 @@ public class EntitySelectionElement<T extends ICdmBase> extends
                /** {@inheritDoc} */
                @Override
                public void widgetSelected(SelectionEvent e) {
-                   T originalEntity = selectionElement.getEntity();
-                   T clonedEntity = null;
-                   IService<T> service = null;
-                   if(originalEntity instanceof CdmBase){
-                       //get corresponding service
-                       if(entity instanceof Reference<?>){
-                           service = (IService<T>) CdmStore.getService(IReferenceService.class);
-                       }
-                       else if (entity instanceof Team || entity instanceof Person || entity instanceof Institution) {
-                           service = (IService<T>) CdmStore.getService(IAgentService.class);
-                       }
-                       else if (entity instanceof NonViralName) {
-                           service = (IService<T>) CdmStore.getService(INameService.class);
-                       }
-                       else if (entity instanceof SpecimenOrObservationBase) {
-                           service = (IService<T>) CdmStore.getService(IOccurrenceService.class);
-                       }
-                       else if (entity instanceof Collection) {
-                           service = (IService<T>) CdmStore.getService(ICollectionService.class);
-                       }
-                       else if (entity instanceof User) {
-                           service = (IService<T>) CdmStore.getService(IUserService.class);
-                       }
-                       else if (entity instanceof Primer) {
-                           service = (IService<T>) CdmStore.getService(IPrimerService.class);
-                       }
-                       else if (entity instanceof Amplification) {
-                           service = (IService<T>) CdmStore.getService(IAmplificationService.class);
-                       }
-                       //check if original already exists in data base. If not then do not clone and all changes will be persisted directly -> Warning to user.
-                if(service !=null && service.find(originalEntity.getUuid())==null && originalEntity.getId() != 0){
-                    if(MessagingUtils.confirmDialog(TRANSIENT_EDITING_WARNING_TITLE, "["+originalEntity.getClass().getSimpleName()+"]"+originalEntity + " has to be saved before it can be edited. Save now?")){
-                        service.save(originalEntity);
-                        AbstractUtility.getActiveEditor().doSave(new NullProgressMonitor());
-                    }
-                    else{
-                        //transient CDM elements should not be edited to avoid merge conflicts
-                        // when the elements are cascaded
-                        return;
-                    }
-                }
-                else{
-                    //FIXME temporarily disabled cloning re-opening bug #2645 (EditFromSelectionWizard persists data even when canceled)
-//                    try {
-//                        //clone original
-//                        clonedEntity = (T) ((CdmBase) originalEntity).clone();
-//                    } catch (CloneNotSupportedException e1) {
-//                        MessagingUtils.warningDialog(TRANSIENT_EDITING_WARNING_TITLE, this, TRANSIENT_EDITING_WARNING_TEXT);
-//                    }
-                }
-
-                   }
-                   if(clonedEntity!=null){
-                       selectionElement.setEntity(clonedEntity);
-                   }
                        WizardDialog dialog = new WizardDialog(selectionElement.getShell(),
                                        new EditFromSelectionWizard(selectionElement));
                        if (dialog.open() == IStatus.OK) {
-                           if(service!=null && clonedEntity!=null){//check if cloning happened
-                               T editedClonedEntity = selectionElement.getEntity();
-                               editedClonedEntity.setId(originalEntity.getId());
-                               editedClonedEntity.setUuid(originalEntity.getUuid());
-
-                               //merge clone and original
-                               service.merge(editedClonedEntity);
-                               originalEntity = service.load(originalEntity.getUuid());
-
-                           }
-                           selectionElement.setEntity(originalEntity);
                                selectionElement.updateFromWizard();
+                               //if the edited entity has already been persisted
+                               //but the transient entity is still set in this 
+                               //EntitySelectionElement, re-load it and set it
+                               IService<T> service = CdmStore.getService(entity);
+                               if(entity.getId()==0){
+                                       T loadedEntity = service.load(entity.getUuid());
+                                       if(loadedEntity!=null){
+                                               setEntity(loadedEntity);
+                                       }
+                               }
                        }
-                       //be sure to reset to original in all cases
-                       selectionElement.setEntity(originalEntity);
-                       selectionElement.refresh();
                }
        }
 
@@ -586,7 +513,7 @@ public class EntitySelectionElement<T extends ICdmBase> extends
 
        private void updateButtonStates() {
            if(button_edit != null && !button_selection.isDisposed()){
-               button_edit.setEnabled(isEditable && button_selection.isEnabled() && getEntity() != null  && CdmStore.currentAuthentiationHasPermission((CdmBase) getEntity(), UPDATE));
+               button_edit.setEnabled(isEditable && button_selection.isEnabled() && getEntity() != null  && CdmStore.currentAuthentiationHasPermission(getEntity(), UPDATE));
            }
        }
 }
index 5c2a267c1553d06e3287ff7efaa7bffefb9a2a66..ac926a72535dec61c3f82aa393819cde6bbd3c80 100644 (file)
@@ -5,12 +5,12 @@ package eu.etaxonomy.taxeditor.ui.selection;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
-import eu.etaxonomy.cdm.model.common.ICdmBase;
+import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 
-public class EntitySelectionElementWithAbbreviatedTitle<T extends ICdmBase> extends EntitySelectionElement<T> {
+public class EntitySelectionElementWithAbbreviatedTitle<T extends CdmBase> extends EntitySelectionElement<T> {
 
        /**
      * @param formFactory
similarity index 84%
rename from eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationUtil.java
rename to eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/util/ApplicationUtil.java
index e3eacfd685dc6e07503a3821867913c05bc1960e..7282445a85499925805aa44799d933674be9d701 100644 (file)
@@ -8,7 +8,7 @@
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
-package eu.etaxonomy.taxeditor;
+package eu.etaxonomy.taxeditor.util;
 
 import org.eclipse.core.runtime.Platform;
 import org.osgi.framework.Bundle;
@@ -28,8 +28,11 @@ public class ApplicationUtil extends AbstractUtility {
     /**
      * Prefix to declare the version as beta
      */
-    private static final String BETA_PREFIX = "[Beta]";
+    private static final String BETA_PREFIX = "[BETA]";
 
+    public static String getTitle() {
+        return "EDIT Taxonomic Editor " + ApplicationUtil.getVersion();
+    }
     /**
      * @return
      */
@@ -56,15 +59,6 @@ public class ApplicationUtil extends AbstractUtility {
     public static boolean isStable() {
         return !getVersion().startsWith("[");
     }
-       /**
-        * <p>getPluginId</p>
-        *
-        * @return a {@link java.lang.String} object.
-        */
-       public static String getPluginId(){
-               return TaxonomicEditorPlugin.PLUGIN_ID;
-       }
-
 
 
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/util/OperationsUtil.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/util/OperationsUtil.java
new file mode 100644 (file)
index 0000000..6ba148a
--- /dev/null
@@ -0,0 +1,36 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.util;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+
+/**
+ * @author cmathew
+ * @date 29 Jun 2015
+ *
+ */
+public class OperationsUtil {
+
+    public static List<UUID> convertToUuidList(List<CdmBase> cdmBaseList) {
+        List<UUID> uuids = new ArrayList<UUID>();
+        for(CdmBase cdmBase : cdmBaseList) {
+            if(cdmBase == null) {
+                uuids.add(null);
+            } else {
+                uuids.add(cdmBase.getUuid());
+            }
+        }
+        return uuids;
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/util/ProgressMonitorClientManager.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/util/ProgressMonitorClientManager.java
new file mode 100644 (file)
index 0000000..5e7e97a
--- /dev/null
@@ -0,0 +1,151 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.util;
+
+import java.text.DecimalFormat;
+import java.util.Arrays;
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.service.IProgressMonitorService;
+import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
+import eu.etaxonomy.taxeditor.operation.IFeedbackGenerator;
+import eu.etaxonomy.taxeditor.operation.IPostMoniteredOperationEnabled;
+
+/**
+ * Manages client side progress monitors
+ *
+ * @author cmathew
+ * @date 23 Oct 2015
+ *
+ */
+
+public class ProgressMonitorClientManager {
+    private static final Logger logger = Logger.getLogger(ProgressMonitorClientManager.class);
+
+    /**
+     * Polls the progress monitor service for the progress status of a monitor
+     * corresponding to the given uuid.
+     *
+     * @param label for the operation
+     * @param uuid of the remoting monitor already started on the server
+     * @param pollInterval in milliseconds
+     * @param cancelable flag which determines whether the operation can be cancelled
+     * @param postOp callback for running post operation logic
+     * @param feedbackGenerator feedback generator corresponding to the
+     *        'wait on feedback' request made on the remoting monitor
+     * @param monitor to be updated
+     * @return a final progress monitor after the operation is completed
+     * @throws InterruptedException
+     */
+    public IRemotingProgressMonitor pollMonitor(final String label,
+            final UUID uuid,
+            final int pollInterval,
+            final IPostMoniteredOperationEnabled postOp,
+            IFeedbackGenerator feedbackGenerator,
+            IProgressMonitor monitor) throws InterruptedException {
+        return pollMonitor(label, uuid, pollInterval, postOp, Arrays.asList(feedbackGenerator), monitor);
+    }
+    /**
+     * Polls the progress monitor service for the progress status of a monitor
+     * corresponding to the given uuid.
+     *
+     *
+     * @param label for the operation
+     * @param uuid of the remoting monitor already started on the server
+     * @param pollInterval in milliseconds
+     * @param cancelable flag which determines whether the operation can be cancelled
+     * @param postOp callback for running post operation logic
+     * @param feedbackGenerators list of feedback generators corresponding to the
+     *        size and exact order of the 'wait on feedback' requests made on the
+     *        remoting monitor
+     * @param monitor to be updated
+     * @return a final progress monitor after the operation is completed
+     * @throws InterruptedException
+     */
+    public IRemotingProgressMonitor pollMonitor(final String label,
+            final UUID uuid,
+            final int pollInterval,
+            final IPostMoniteredOperationEnabled postOp,
+            List<IFeedbackGenerator> feedbackGenerators,
+            IProgressMonitor monitor) throws InterruptedException {
+        IProgressMonitorService progressMonitorService = CdmApplicationState.getCurrentAppConfig().getProgressMonitorService();
+        IRemotingProgressMonitor remotingMonitor = progressMonitorService.getRemotingMonitor(uuid);
+        try {
+            final int START_DELAY=10;
+            // wait about 10 seconds for the remoting monitor to be initialised
+            // (i.e. for the begin task method to be called ON THE REMOTING MONITOR)
+            for(int i=0;i<START_DELAY;i++) {
+                Thread.sleep(1000);
+                logger.info("Waiting for monitered work to start ..");
+                remotingMonitor = progressMonitorService.getRemotingMonitor(uuid);
+                if(remotingMonitor.getTotalWork() > 0) {
+                    break;
+                }
+            }
+            // if the total work is still not been set then we assume that the
+            // operation has zero work units
+            if(remotingMonitor.getTotalWork() == 0) {
+                throw new InterruptedException("Monitor has zero work units");
+            }
+            // start the client monitor
+            monitor.beginTask(label, remotingMonitor.getTotalWork());
+            logger.info("Work to be done: " + remotingMonitor.getTotalWork());
+            int editorTotalWorkDone = 0;
+            int serverTotalWorkDone = 0;
+            // loop until the operation is done
+            int feedbackCount = 0;
+            while(!(remotingMonitor.isCanceled() || remotingMonitor.isFailed() || remotingMonitor.isDone())) {
+                // wait for pollInterval, then
+                // .... retrieve remoting monitor, then
+                //      .... set client monitor info
+                Thread.sleep(pollInterval);
+                remotingMonitor = progressMonitorService.getRemotingMonitor(uuid);
+                // check if remoting monitor is waiting for feedback
+                if(remotingMonitor.getIsWaitingForFeedback()) {
+                    if(feedbackGenerators != null) {
+                        // if we have run out of feedback generators while
+                        // the remoting monitor is waiting on feedback
+                        // then throw exception
+                        if(feedbackCount + 1 > feedbackGenerators.size()) {
+                            throw new IllegalStateException("Remoting monitor waiting on feedback that does not exist");
+                        }
+                        feedbackGenerators.get(feedbackCount).setFeedbackForMonitor(uuid);
+                        feedbackCount++;
+                    }
+                }
+                serverTotalWorkDone = (int) remotingMonitor.getWorkDone();
+                logger.info("Work done from start: " + serverTotalWorkDone);
+                String percentage = new DecimalFormat("#.##").format(remotingMonitor.getPercentage());
+                // set dialog text
+                monitor.setTaskName(label + " " + percentage + "% done ");
+                monitor.subTask(remotingMonitor.getSubTask());
+                int worked = serverTotalWorkDone - editorTotalWorkDone;
+                if(worked > 0) {
+                    logger.info("Work done since last check: " + worked);
+                    monitor.worked(worked);
+                }
+                editorTotalWorkDone = serverTotalWorkDone;
+            }
+            if(remotingMonitor.getResult() instanceof Exception) {
+                throw new IllegalStateException((Exception)remotingMonitor.getResult());
+            }
+            return remotingMonitor;
+        } finally {
+            if(postOp != null && remotingMonitor.isDone()) {
+                postOp.postOperation(remotingMonitor);
+            }
+        }
+    }
+}
index 57cb798855860ffd4ba5adf4329fbd317353866d..272d4711ee759e1213972d09d714050cee92dbbb 100644 (file)
@@ -113,13 +113,16 @@ public abstract class AbstractCdmDataViewer extends Viewer implements IConversat
        /** {@inheritDoc} */
        @Override
        public Control getControl() {
+               if(body.isDisposed()){
+                       return null;
+               }
                for(Control child : body.getChildren()){
                        return child;
                }
 
                return body;
        }
-
+       
        /* (non-Javadoc)
         * @see org.eclipse.jface.viewers.Viewer#setInput(java.lang.Object)
         */
index 9262e041697a4fc3bb5876c0746318a23f69f0c7..854481faa09dd6aeace3ee90351cf49d075073a9 100644 (file)
@@ -78,7 +78,11 @@ public abstract class AbstractCdmEditorViewPart extends AbstractCdmViewPart {
     /** {@inheritDoc} */
     @Override
     public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-        if(delaySelection==null){
+       /*to avoid widget is disposed exceptions
+        if(getViewer().getControl().isDisposed()){
+            return;
+        }*/
+       if(delaySelection==null){
             delaySelection = new DelaySelection(part, selection);
         }
         delaySelection.setPart(part);
@@ -88,6 +92,8 @@ public abstract class AbstractCdmEditorViewPart extends AbstractCdmViewPart {
             Display.getCurrent().asyncExec(delaySelection);
         }
     }
+    
+    
 
     /** {@inheritDoc} */
     @Override
index 2fbde5c73421208ea61890ec953ca7125ecf693b..4367e2b835c2863bbe8ffcac66720b81c2c1657d 100644 (file)
@@ -1,15 +1,19 @@
 // $Id$
 /**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
 
 package eu.etaxonomy.taxeditor.view;
 
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.StructuredSelection;
@@ -31,6 +35,8 @@ import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 
 /**
  * <p>Abstract AbstractCdmViewPart class.</p>
@@ -39,59 +45,59 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
  * @created Jun 15, 2010
  * @version 1.0
  */
-public abstract class AbstractCdmViewPart extends ViewPart implements ISelectionListener, IPostOperationEnabled, IConversationEnabled, IDirtyMarkable{
+public abstract class AbstractCdmViewPart extends ViewPart implements ISelectionListener, IPostOperationEnabled, IConversationEnabled, ICdmEntitySessionEnabled, IDirtyMarkable{
 
-       protected ISelectionService selectionService;
+    protected ISelectionService selectionService;
 
-       public static IStructuredSelection EMPTY_SELECTION = new StructuredSelection();
+    public static IStructuredSelection EMPTY_SELECTION = new StructuredSelection();
 
-       protected IWorkbenchPart part;
+    protected IWorkbenchPart part;
 
     private PageBook pageBook;
 
-       private Label emptySelectionLabel;
+    private Label emptySelectionLabel;
 
-       private Composite viewerComposite;
+    private Composite viewerComposite;
 
-       /** {@inheritDoc} */
-       @Override
-       public void createPartControl(Composite parent) {
-               selectionService = getSite().getWorkbenchWindow().getSelectionService();
-               selectionService.addSelectionListener(this);
+    /** {@inheritDoc} */
+    @Override
+    public void createPartControl(Composite parent) {
+        selectionService = getSite().getWorkbenchWindow().getSelectionService();
+        selectionService.addSelectionListener(this);
 
-               pageBook = new PageBook(parent, SWT.NULL);
-               //create viewerComposite
-               viewerComposite = new SashForm(pageBook, SWT.HORIZONTAL);
-               createViewer(viewerComposite);
+        pageBook = new PageBook(parent, SWT.NULL);
+        //create viewerComposite
+        viewerComposite = new SashForm(pageBook, SWT.HORIZONTAL);
+        createViewer(viewerComposite);
 
-               // Page 2: Nothing selected
+        // Page 2: Nothing selected
         emptySelectionLabel = new Label(pageBook, SWT.TOP + SWT.LEFT + SWT.WRAP);
 
         setInitialSelection();
-       }
-
-       /**
-        *
-        */
-       private void setInitialSelection() {
-               selectionChanged(AbstractUtility.getActivePart(), getInitialSelection());
-       }
-
-       /**
-        * <p>getInitialSelection</p>
-        *
-        * @return a {@link org.eclipse.jface.viewers.ISelection} object.
-        */
-       protected ISelection getInitialSelection() {
-               return selectionService.getSelection();
-       }
-
-       /**
-        * <p>showEmptyPage</p>
-        */
-       public void showEmptyPage(){
-               pageBook.showPage(emptySelectionLabel);
-       }
+    }
+
+    /**
+     *
+     */
+    private void setInitialSelection() {
+        selectionChanged(AbstractUtility.getActivePart(), getInitialSelection());
+    }
+
+    /**
+     * <p>getInitialSelection</p>
+     *
+     * @return a {@link org.eclipse.jface.viewers.ISelection} object.
+     */
+    protected ISelection getInitialSelection() {
+        return selectionService.getSelection();
+    }
+
+    /**
+     * <p>showEmptyPage</p>
+     */
+    public void showEmptyPage(){
+        pageBook.showPage(emptySelectionLabel);
+    }
 
     /**
      * <p>showViewer</p>
@@ -100,13 +106,15 @@ public abstract class AbstractCdmViewPart extends ViewPart implements ISelection
      * @param selection a {@link org.eclipse.jface.viewers.ISelection} object.
      */
     public void showViewer(IWorkbenchPart part, IStructuredSelection selection){
-       this.part = part;
+        this.part = part;
 
-               Object element = selection.getFirstElement();
-
-               getViewer().setInput(element);
-
-               showViewer();
+        Object element = selection.getFirstElement();
+      //avoid widget is disposed exceptions
+        if (getViewer().getControl()==null || getViewer().getControl().isDisposed()){
+            return;
+        }
+        getViewer().setInput(element);
+        showViewer();
     }
 
     /**
@@ -116,76 +124,102 @@ public abstract class AbstractCdmViewPart extends ViewPart implements ISelection
      */
     public abstract Viewer getViewer();
 
-       /**
-        * <p>showViewer</p>
-        */
-       public void showViewer(){
-               pageBook.showPage(viewerComposite);
-    }
-
-       public void setEnabled(boolean enabled){
-               pageBook.setEnabled(enabled);
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       public void setFocus() {
-               if(getConversationHolder() != null){
-                       getConversationHolder().bind();
-               }
-               getViewer().getControl().setFocus();
-       }
-
-       /**
-        * <p>createViewer</p>
-        *
-        * @param parent a {@link org.eclipse.swt.widgets.Composite} object.
-        */
-       public abstract void createViewer(Composite parent);
-
-       /** {@inheritDoc} */
-       @Override
+    /**
+     * <p>showViewer</p>
+     */
+    public void showViewer(){
+        pageBook.showPage(viewerComposite);
+    }
+
+    public void setEnabled(boolean enabled){
+        pageBook.setEnabled(enabled);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void setFocus() {
+        if(getConversationHolder() != null){
+            getConversationHolder().bind();
+        }
+        if(getCdmEntitySession() != null){
+            getCdmEntitySession().bind();
+        }
+        getViewer().getControl().setFocus();
+    }
+
+    /**
+     * <p>createViewer</p>
+     *
+     * @param parent a {@link org.eclipse.swt.widgets.Composite} object.
+     */
+    public abstract void createViewer(Composite parent);
+
+    /** {@inheritDoc} */
+    @Override
     public boolean postOperation(CdmBase objectAffectedByOperation) {
-               changed(objectAffectedByOperation);
-               return true;
-       }
+        changed(objectAffectedByOperation);
+        return true;
+    }
 
-       /** {@inheritDoc} */
-       @Override
+    /** {@inheritDoc} */
+    @Override
     public abstract void changed(Object object);
 
-       /**
-        * <p>getConversationHolder</p>
-        *
-        * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        */
-       @Override
+    /**
+     * <p>getConversationHolder</p>
+     *
+     * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
+     */
+    @Override
     public ConversationHolder getConversationHolder() {
-               if(part != null && part instanceof IConversationEnabled) {
+        if(part != null && part instanceof IConversationEnabled) {
             return ((IConversationEnabled) part).getConversationHolder();
         }
 
-               return null;
-       }
+        return null;
+    }
+
+    @Override
+    public ICdmEntitySession getCdmEntitySession() {
+        if(part != null && part instanceof ICdmEntitySessionEnabled) {
+            return ((ICdmEntitySessionEnabled) part).getCdmEntitySession();
+        }
+        return null;
+    }
+
+    @Override
+    public  List<? extends CdmBase> getRootEntities() {
+        return Arrays.asList((CdmBase)getViewer().getInput());
+    }
 
-       /** {@inheritDoc} */
-       @Override
+    /** {@inheritDoc} */
+    @Override
     public void update(CdmDataChangeMap changeEvents) {
 
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       public void dispose() {
-               selectionService.removeSelectionListener(this);
-               super.dispose();
-       }
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#forceDirty()
-        */
-       @Override
-       public void forceDirty() {
-           changed(null);
-       }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void dispose() {
+        selectionService.removeSelectionListener(this);
+        super.dispose();
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#forceDirty()
+     */
+    @Override
+    public void forceDirty() {
+        changed(null);
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+     */
+    @Override
+    public Map<Object, List<String>> getPropertyPathsMap() {
+        // TODO Auto-generated method stub
+        return null;
+    }
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractSplitableViewPart.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractSplitableViewPart.java
deleted file mode 100644 (file)
index d1f5293..0000000
+++ /dev/null
@@ -1,321 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
-* http://www.e-taxonomy.eu
-* 
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.view;
-
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.part.ViewPart;
-
-import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
-
-/**
- * <p>Abstract AbstractSplitableViewPart class.</p>
- *
- * @author n.hoffmann
- * @created Feb 12, 2010
- * @version 1.0
- */
-public abstract class AbstractSplitableViewPart extends ViewPart implements ISelectionListener{
-       
-       static final int VIEW_ORIENTATION_VERTICAL = 0;
-       static final int VIEW_ORIENTATION_HORIZONTAL = 1;
-       static final int VIEW_ORIENTATION_SINGLE = 2;
-       static final int VIEW_ORIENTATION_AUTOMATIC = 3;
-
-       private static final int PAGE_EMPTY = 0;
-    private static final int PAGE_VIEWER = 1;
-       
-       private final IDialogSettings dialogSettings;
-       
-       private SashForm detailSplitter;
-
-       private Composite parent;
-
-       private PageBook pagebook;
-
-       private int orientation;
-
-       private int currentOrientation;
-//
-       private boolean showViewer2;
-
-       private Viewer viewer1;
-       
-       private Viewer viewer2;
-       
-       private Label emptySelectionLabel;
-
-       private ISelectionService selectionService;
-
-       
-       /**
-        * <p>Constructor for AbstractSplitableViewPart.</p>
-        */
-       public AbstractSplitableViewPart() {
-               super();
-               
-               dialogSettings = TaxeditorStorePlugin.getDefault().getDialogSettings();
-               
-       }
-       
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
-        */
-       /** {@inheritDoc} */
-       @Override
-       public void createPartControl(Composite parent) {       
-               selectionService = getSite().getWorkbenchWindow().getSelectionService();
-               selectionService.addSelectionListener(this);
-               selectionService.addPostSelectionListener(this);
-               
-               
-               this.parent = parent;
-               addResizeListener(parent);
-               pagebook = new PageBook(parent, SWT.NULL);
-               
-               // Page 1: Viewers
-               createDetailSplitter(pagebook);
-               viewer1 = createViewer1(detailSplitter);
-               viewer2 = createViewer2(detailSplitter);
-               
-               // Page 2: Nothing selected
-        emptySelectionLabel = new Label(pagebook, SWT.TOP + SWT.LEFT + SWT.WRAP);
-        emptySelectionLabel.setText("Current selection does not support this view"); //
-               
-               showPage(PAGE_EMPTY);
-               
-               initOrientation();
-               
-               // FIXME since this class is not used at the moment we will not have to fix this soon
-               // it might also become irrelevant in future uses
-               // set the selection if there is an open editor
-//             if(EditorUtil.getActiveMultiPageTaxonEditor() != null){
-//                     selectionChanged(EditorUtil.getActiveMultiPageTaxonEditor(), EditorUtil.getCurrentSelection());
-//             }
-       }
-       
-    private void initOrientation() {
-
-        try {
-            orientation = dialogSettings.getInt(getDialogstoreVieworientationKey());
-
-            if ((orientation < 0) || (orientation > 3)) {
-               orientation = VIEW_ORIENTATION_AUTOMATIC;
-            }
-        } catch (NumberFormatException e) {
-               orientation = VIEW_ORIENTATION_AUTOMATIC;
-        }
-
-        // force the update
-        currentOrientation = -1;
-        setOrientation(orientation);
-    }
-       
-    /**
-     * <p>getDialogstoreVieworientationKey</p>
-     *
-     * @return a {@link java.lang.String} object.
-     */
-    protected abstract String getDialogstoreVieworientationKey();
-
-    /**
-     * <p>showEmptyPage</p>
-     */
-    public void showEmptyPage(){
-       showPage(PAGE_EMPTY);
-    }
-    
-    /**
-     * <p>showViewer</p>
-     */
-    public void showViewer(){
-       showPage(PAGE_VIEWER);
-    }
-    
-       private void showPage(int page) {
-        if (page == PAGE_EMPTY) {
-            pagebook.showPage(emptySelectionLabel);
-        } else {
-            pagebook.showPage(detailSplitter);
-        }
-    }
-
-       private void addResizeListener(Composite parent) {
-               parent.addControlListener(new ControlListener() {
-                       public void controlMoved(ControlEvent e) {
-                       }
-                       public void controlResized(ControlEvent e) {
-                               computeOrientation();
-                       }
-               });
-       }
-       
-       void computeOrientation() {
-               saveSplitterRatio();
-               dialogSettings.put(getDialogstoreVieworientationKey(), orientation);
-               if (orientation != VIEW_ORIENTATION_AUTOMATIC) {
-                       setOrientation(orientation);
-               }
-               else {
-                       if (orientation == VIEW_ORIENTATION_SINGLE)
-                               return;
-                       Point size= parent.getSize();
-                       if (size.x != 0 && size.y != 0) {
-                               if (size.x > size.y)
-                                       setOrientation(VIEW_ORIENTATION_HORIZONTAL);
-                               else
-                                       setOrientation(VIEW_ORIENTATION_VERTICAL);
-                       }
-               }
-       }
-       
-       private void saveSplitterRatio() {
-               if (detailSplitter != null && ! detailSplitter.isDisposed()) {
-               int[] weigths = detailSplitter.getWeights();
-               int ratio = (weigths[0] * 1000) / (weigths[0] + weigths[1]);
-                       String key= getDialogStoreRatioKey() + currentOrientation;
-               dialogSettings.put(key, ratio);
-               }
-       }
-       
-    /**
-     * <p>getDialogStoreRatioKey</p>
-     *
-     * @return a {@link java.lang.String} object.
-     */
-    protected abstract String getDialogStoreRatioKey();
-
-       void setOrientation(int orientation) {
-        if (currentOrientation != orientation) {
-            if ((getViewer1() != null) 
-               && !getViewer1().getControl().isDisposed() 
-               && (detailSplitter != null) 
-               && !detailSplitter.isDisposed()) {
-                
-               if (orientation == VIEW_ORIENTATION_SINGLE) {
-                    setShowViewer2(false);
-                } else {
-                    if (currentOrientation == VIEW_ORIENTATION_SINGLE) {
-                       setShowViewer2(true);
-                    }
-                    boolean horizontal = orientation == VIEW_ORIENTATION_HORIZONTAL;
-                    detailSplitter.setOrientation(horizontal ? SWT.HORIZONTAL
-                                                                     : SWT.VERTICAL);
-                }
-
-                detailSplitter.layout();
-            }
-
-            updateCheckedState();
-
-            currentOrientation = orientation;
-
-                       restoreSplitterRatio();
-        }
-    }
-    
-       /**
-        * @param show
-        */
-       private void setShowViewer2(boolean show) {
-               showViewer2 = show;
-               showOrHideViewer2();            
-       }
-
-       /**
-        * 
-        */
-       private void showOrHideViewer2() {
-        if (showViewer2) {
-               detailSplitter.setMaximizedControl(null);
-        } else {
-               detailSplitter.setMaximizedControl(getViewer1().getControl());
-        }
-       }
-
-       private void restoreSplitterRatio() {
-               String ratio= dialogSettings.get(getDialogStoreRatioKey() + currentOrientation);
-               if (ratio == null)
-                       return;
-               int intRatio= Integer.parseInt(ratio);
-               detailSplitter.setWeights(new int[] {intRatio, 1000 - intRatio});
-       }
-    
-       private void updateCheckedState() {
-//             for (int i= 0; i < fToggleOrientationActions.length; i++) {
-//                     fToggleOrientationActions[i].setChecked(fOrientation == fToggleOrientationActions[i].getOrientation());
-//             }
-       }
-       
-       /**
-        * <p>createViewer1</p>
-        *
-        * @param parent a {@link org.eclipse.swt.widgets.Composite} object.
-        * @return a {@link org.eclipse.jface.viewers.Viewer} object.
-        */
-       protected abstract Viewer createViewer1(Composite parent);
-       
-
-       /**
-        * <p>createViewer2</p>
-        *
-        * @param parent a {@link org.eclipse.swt.widgets.Composite} object.
-        * @return a {@link org.eclipse.jface.viewers.Viewer} object.
-        */
-       protected abstract Viewer createViewer2(Composite parent);
-       
-
-       /**
-        * @param pagebook2
-        */
-       private void createDetailSplitter(Composite parent) {
-               detailSplitter = new SashForm(parent, SWT.HORIZONTAL);
-       }
-       
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.part.WorkbenchPart#dispose()
-        */
-       /** {@inheritDoc} */
-       @Override
-       public void dispose() {
-               selectionService.removeSelectionListener(this);
-               selectionService.removePostSelectionListener(this);
-               super.dispose();
-       }
-
-       /**
-        * <p>Getter for the field <code>viewer1</code>.</p>
-        *
-        * @return a {@link org.eclipse.jface.viewers.Viewer} object.
-        */
-       protected Viewer getViewer1() {
-               return viewer1;
-       }
-
-       /**
-        * <p>Getter for the field <code>viewer2</code>.</p>
-        *
-        * @return a {@link org.eclipse.jface.viewers.Viewer} object.
-        */
-       protected Viewer getViewer2() {
-               return viewer2;
-       }
-}
index 6efcc81d0e473e68c40a8168cc60a225bd387092..63017075fb5d5dbea3636b5b5378112a1fcc0317 100644 (file)
@@ -9,9 +9,13 @@
  */
 package eu.etaxonomy.taxeditor.view;
 
+import java.util.HashMap;
 import java.util.Map;
-import java.util.Map.Entry;
+import java.util.UUID;
 
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.core.commands.common.NotDefinedException;
 import org.eclipse.jface.dialogs.PopupDialog;
 import org.eclipse.jface.viewers.ArrayContentProvider;
 import org.eclipse.jface.viewers.ILabelProvider;
@@ -27,6 +31,11 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Table;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.handlers.IHandlerService;
+
+import eu.etaxonomy.cdm.model.common.ICdmBase;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * This class opens a popup dialog and provides the possibility to choose from a
@@ -38,8 +47,8 @@ import org.eclipse.swt.widgets.Table;
  */
 public class CdmViewerChooser extends PopupDialog implements ISelectionChangedListener, ILabelProvider{
 
+    private Map<Command, String> nameViewerMap;
     private Object input;
-    private Map<Entry<Class<?>, String>, ICdmViewer> nameViewerMap;
 
     public CdmViewerChooser(Shell parentShell) {
         this(parentShell, SWT.RESIZE | SWT.ON_TOP, true, false, false, false, false, "Open in ...",
@@ -59,13 +68,12 @@ public class CdmViewerChooser extends PopupDialog implements ISelectionChangedLi
      */
     public void chooseViewer(Object input){
         this.input = input;
-        this.nameViewerMap = CdmViewerUtil.getNameViewerMap(input);
+        this.nameViewerMap = CdmViewerUtil.getAvailableViewers(input);
 
         //if only one editor is available then open it
         if(nameViewerMap.size()==1){
-            Entry<Class<?>, String> next = nameViewerMap.keySet().iterator().next();
-            ICdmViewer cdmViewer = nameViewerMap.get(next);
-            cdmViewer.show(input, next.getKey());
+            Command command = nameViewerMap.keySet().iterator().next();
+            executeCommand(command, input);
         }
         else{
             if(nameViewerMap.isEmpty()){
@@ -75,6 +83,35 @@ public class CdmViewerChooser extends PopupDialog implements ISelectionChangedLi
         }
     }
 
+    private void executeCommand(Command command, Object input) {
+        //set uuid parameter
+        if(input instanceof ICdmBase){
+            Map<String, UUID> params = new HashMap<String, UUID>();
+            String commandId = command.getId();
+                       params.put(commandId+".uuid", ((ICdmBase) input).getUuid());
+
+                       if(command.isEnabled()) {
+
+                           //build the parameterized command
+                           ParameterizedCommand pc = ParameterizedCommand.generateCommand(command, params);
+
+                IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
+                try {
+                    if(pc!=null){
+                        handlerService.executeCommand(pc, null);
+                    }
+                    else{
+                        handlerService.executeCommand(commandId, null);
+                    }
+                } catch (NotDefinedException nde) {
+                    throw new RuntimeException("Could not find open command: " + commandId);
+                } catch (Exception exception) {
+                    MessagingUtils.error(getClass(), "An exception occured while trying execute "+commandId, exception);
+                }
+            }
+        }
+    }
+
     @Override
     protected Control createDialogArea(Composite parent) {
         TableViewer viewer = new TableViewer(new Table(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION));
@@ -90,10 +127,8 @@ public class CdmViewerChooser extends PopupDialog implements ISelectionChangedLi
         ISelection selection = event.getSelection();
         if(selection instanceof IStructuredSelection){
             Object firstElement = ((IStructuredSelection) selection).getFirstElement();
-            if(nameViewerMap.containsKey(firstElement)){
-                Entry<Class<?>, String> entry = (Entry<Class<?>, String>)firstElement;
-                ICdmViewer cdmViewer = nameViewerMap.get(entry);
-                cdmViewer.show(input, entry.getKey());
+            if(firstElement instanceof Command && nameViewerMap.containsKey(firstElement)){
+                executeCommand((Command) firstElement, this.input);
                 this.close();
             }
         }
@@ -101,12 +136,7 @@ public class CdmViewerChooser extends PopupDialog implements ISelectionChangedLi
 
     @Override
     public String getText(Object element) {
-        String text = null;
-        if(nameViewerMap.containsKey(element)){
-            Entry<Class<?>, String> entry = (Entry<Class<?>, String>) element;
-            text = entry.getValue();
-        }
-        return text;
+        return nameViewerMap.get(element);
     }
 
     @Override
index 712bec9d8a40c91ee3024b635122163b36d2e5a8..13591957a9a668dfe9d63e7c16aae24fe1843f9f 100644 (file)
@@ -1,8 +1,13 @@
 package eu.etaxonomy.taxeditor.view;
 
+import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.UUID;
 
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.core.commands.common.NotDefinedException;
 import org.eclipse.jface.action.ContributionItem;
 import org.eclipse.jface.action.IContributionItem;
 import org.eclipse.jface.viewers.ISelection;
@@ -15,6 +20,18 @@ import org.eclipse.swt.widgets.MenuItem;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.actions.CompoundContributionItem;
+import org.eclipse.ui.handlers.IHandlerService;
+
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.model.common.ICdmBase;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.taxon.Synonym;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
+import eu.etaxonomy.taxeditor.Messages;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * Generic context menu for opening elements in the taxeditor.
@@ -28,46 +45,86 @@ public class CdmViewerContextMenu extends CompoundContributionItem {
                 new ContributionItem() {
                     @Override
                     public void fill(Menu menu, int index) {
-                        MenuItem addItem = new MenuItem(menu, SWT.CASCADE);
-                        addItem.setText("Open in...");
-                        Menu addMenu = new Menu(menu);
-                        addItem.setMenu(addMenu);
                         final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
                         final ISelection selection = window.getActivePage().getSelection();
                         if(selection instanceof IStructuredSelection){
                             Object firstElement = ((IStructuredSelection) selection).getFirstElement();
-                            Map<Entry<Class<?>, String>, ICdmViewer> nameViewerMap = CdmViewerUtil.getNameViewerMap(firstElement);
-                            for(Entry<Entry<Class<?>, String>, ICdmViewer> entry:nameViewerMap.entrySet()){
-                                Entry<Class<?>, String> viewerClass = entry.getKey();
-                                MenuItem menuItem = new MenuItem(addMenu, SWT.NONE);
-                                menuItem.setText(viewerClass.getValue());
-                                menuItem.addSelectionListener(new OpenInViewerListener(entry.getValue(), firstElement, viewerClass.getKey()));
+                            Map<Command, String> enabledCommands = CdmViewerUtil.getAvailableViewers(firstElement);
+
+                            //check if only one or multiple viewers/commands are available
+                            if(enabledCommands.size()==1){
+                                Entry<Command, String> entry = enabledCommands.entrySet().iterator().next();
+                                final Command command = entry.getKey();
+                                String viewerName = entry.getValue();
+
+                                MenuItem addItem = new MenuItem(menu, SWT.CASCADE);
+                                addItem.setText(String.format(Messages.CdmViewerContextMenu_OPEN, viewerName));
+                                addItem.addSelectionListener(new CommandInvoker(command, firstElement)) ;
+                            }
+                            else if(enabledCommands.size()>1){
+                                MenuItem addItem = new MenuItem(menu, SWT.CASCADE);
+                                addItem.setText(Messages.CdmViewerContextMenu_OPEN_IN);
+                                Menu addMenu = new Menu(menu);
+                                addItem.setMenu(addMenu);
+                                for(Entry<Command, String> entry:enabledCommands.entrySet()){
+                                    final Command command = entry.getKey();
+                                    String viewerName = entry.getValue();
+
+                                    MenuItem menuItem = new MenuItem(addMenu, SWT.NONE);
+                                    menuItem.setText(viewerName);
+                                    menuItem.addSelectionListener(new CommandInvoker(command, firstElement)) ;
+                                }
                             }
                         }
                     }
+
                 }
         };
         return contributionItems;
     }
 
-    private class OpenInViewerListener extends SelectionAdapter {
+    private final class CommandInvoker extends SelectionAdapter {
+        private final Command command;
+        private Object selectedObject;
 
-        private final ICdmViewer cdmViewer;
-        private final Object input;
-        private final Class<?> viewerClass;
-
-        public OpenInViewerListener(ICdmViewer cdmViewer, Object input, Class<?> viewerClass) {
-            super();
-            this.cdmViewer = cdmViewer;
-            this.input = input;
-            this.viewerClass = viewerClass;
+        private CommandInvoker(Command command, Object selectedObject) {
+            this.command = command;
+            this.selectedObject = selectedObject;
         }
 
         @Override
         public void widgetSelected(SelectionEvent e) {
-            cdmViewer.show(input, viewerClass);
+            IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
+            Map<String, UUID> params = new HashMap<String, UUID>();
+            //for generic UuidAndTitleCache objects try to load the object
+            if (selectedObject instanceof UuidAndTitleCache){
+                UuidAndTitleCache uuidAndTitleCache = (UuidAndTitleCache)selectedObject;
+                Class type = uuidAndTitleCache.getType();
+                if(type == Taxon.class || type == Synonym.class){
+                    selectedObject = CdmStore.getService(ITaxonService.class).load(uuidAndTitleCache.getUuid());
+                }
+                else if(SpecimenOrObservationBase.class.isAssignableFrom(type)){
+                    selectedObject = CdmStore.getService(IOccurrenceService.class).load(uuidAndTitleCache.getUuid());
+                }
+            }
+            if(selectedObject instanceof ICdmBase){
+                params.put(command.getId()+".uuid", ((ICdmBase) selectedObject).getUuid()); //$NON-NLS-1$
+            }
+            ParameterizedCommand parameterizedCommand = ParameterizedCommand.generateCommand(command, params);
+            try {
+                if(parameterizedCommand!=null){
+                    handlerService.executeCommand(parameterizedCommand, null);
+                }
+                else{
+                    handlerService.executeCommand(command.getId(), null);
+                }
+            } catch (NotDefinedException nde) {
+                throw new RuntimeException("Could not find open command: " + command.getId()); //$NON-NLS-1$
+            } catch (Exception exception) {
+                MessagingUtils.error(getClass(), "An exception occured while trying execute "+command.getId(), exception); //$NON-NLS-1$
+            }
+            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getSelection();
         }
-
     }
 
 }
index 6f5c6f67ab73666cdc2aec92a0f81f8c881aedca..698f94233e6309f5ca1ac70eebfaaa8b31699df1 100644 (file)
@@ -11,49 +11,81 @@ package eu.etaxonomy.taxeditor.view;
 
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Map.Entry;
 
-import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.commands.Command;
 import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
 
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.taxon.Synonym;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
+ * Scans eu.etaxonomy.taxeditor.store.cdmViewer extension point.
  * @author pplitzner
  * @date Jul 7, 2015
  *
  */
 public class CdmViewerUtil {
 
-    public static  Map<Entry<Class<?>, String>, ICdmViewer> getNameViewerMap(Object input){
-        Map<Entry<Class<?>, String>, ICdmViewer> nameViewerMap = new HashMap<Entry<Class<?>, String>, ICdmViewer>();
-    
-        IExtensionRegistry reg = Platform.getExtensionRegistry();
-        IConfigurationElement[] extensions = reg
-                .getConfigurationElementsFor("eu.etaxonomy.taxeditor.store.cdmViewer");
-        for (IConfigurationElement configElement : extensions) {
-            try {
-                Object object = configElement.createExecutableExtension("class");
-                if(object instanceof ICdmViewer){
-                    ICdmViewer cdmViewer = (ICdmViewer)object;
-                    Map<Class<?>, String> viewerClasses = cdmViewer.getViewerClasses(input);
-                    for (Entry<Class<?>, String> entry : viewerClasses.entrySet()) {
-                        nameViewerMap.put(entry, cdmViewer);
-                    }
+    /**
+     * Returns a map of available commands to open the given input.
+     * Keys are the command IDs and values are their string representations.
+     *
+     * @param input
+     *            the object which should be handled by the available commands
+     * @return a key-value map of available commands and their string
+     *         representation
+     */
+    public static  Map<Command, String> getAvailableViewers(Object input){
+        Map<Command, String> commandViewerNameMap = new HashMap<Command, String>();
+
+        if(input!=null){
+            //for generic UuidAndTitleCache objects try to load the object
+            if (input instanceof UuidAndTitleCache){
+                UuidAndTitleCache uuidAndTitleCache = (UuidAndTitleCache)input;
+                Class type = uuidAndTitleCache.getType();
+                if(type == Taxon.class || type == Synonym.class){
+                    input = CdmStore.getService(ITaxonService.class).load(uuidAndTitleCache.getUuid());
                 }
-                else{
-                    MessagingUtils.error(CdmViewerChooser.class, new Status(IStatus.ERROR, TaxeditorStorePlugin.PLUGIN_ID, "Could not load cdmViewer extension"));
+                else if(SpecimenOrObservationBase.class.isAssignableFrom(type)){
+                    input = CdmStore.getService(IOccurrenceService.class).load(uuidAndTitleCache.getUuid());
+                }
+            }
+
+
+            IExtensionRegistry reg = Platform.getExtensionRegistry();
+            IConfigurationElement[] extensions = reg
+                    .getConfigurationElementsFor("eu.etaxonomy.taxeditor.store.cdmViewer"); //$NON-NLS-1$
+            for (IConfigurationElement configElement : extensions) {
+                if(configElement.getName().equals("viewCommandMapping")){ //$NON-NLS-1$
+                    try {
+                        String commandId = configElement.getAttribute("commandId"); //$NON-NLS-1$
+                        String viewerName = configElement.getAttribute("viewerName"); //$NON-NLS-1$
+                        Class<?> selectionClass = Class.forName(configElement.getAttribute("selection")); //$NON-NLS-1$
+                        if(selectionClass.isAssignableFrom(input.getClass())){
+                            ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
+                            Command command = commandService.getCommand(commandId);
+                            //TODO: maybe pass the command directly instead of just the command id
+                            if(command.isEnabled()){
+                                commandViewerNameMap.put(command, viewerName);
+                            }
+                        }
+                    } catch (ClassNotFoundException e) {
+                        MessagingUtils.error(CdmViewerChooser.class, "Could not initalize selection class element of cdmViewer extension", e); //$NON-NLS-1$
+                    }
                 }
-            } catch (CoreException e) {
-                MessagingUtils.error(CdmViewerChooser.class, "Could not load cdmViewer extension", e);
             }
         }
-        return nameViewerMap;
+        return commandViewerNameMap;
     }
 
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/ICdmViewer.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/ICdmViewer.java
deleted file mode 100644 (file)
index 92063cf..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2015 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.view;
-
-import java.util.Map;
-
-
-/**
- * Implementors of this interface provide a mapping of input elements to views
- * or editors which can display information or provide editing functionality for
- * the input elements.
- *
- * @author pplitzner
- * @date Feb 23, 2015
- *
- */
-public interface ICdmViewer {
-
-    /**
-     * For the given input a map is returned specifying the available viewer
-     * classes as keys and their string representation as values
-     *
-     * @param input
-     *            the input for which the viewer classes should be returned
-     * @return a map holding the viewer classes as keys and their string
-     *         representations as values
-     */
-    public Map<Class<?>, String> getViewerClasses(Object input);
-
-    /**
-     * Opens the viewer defined by the given viewerClass for the given input.
-     * @param input the input for which a viewer should be opened
-     * @param viewerClass the qualified class name of the viewer
-     */
-    public void show(Object input, Class<?> viewerClass);
-
-}
similarity index 94%
rename from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/BioCaseEditorInput.java
rename to eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/BioCaseEditorInput.java
index 60d1302cbbc6bdda9f35f4abeb465885c209c0e4..17b425154a014984a8497b7d0dc74230f97683bf 100644 (file)
@@ -7,7 +7,7 @@
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -23,7 +23,6 @@ import eu.etaxonomy.cdm.ext.occurrence.bioCase.BioCaseQueryServiceWrapper;
 import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
 import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.taxeditor.editor.view.dataimport.transientServices.TransientCdmRepository;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -57,13 +56,13 @@ public class BioCaseEditorInput extends DataImportEditorInput<SpecimenOrObservat
             InputStream resultStream;
             resultStream = new BioCaseQueryServiceWrapper().query(query, endPoint);
             Abcd206ImportConfigurator configurator = Abcd206ImportConfigurator.NewInstance(resultStream, null, false);
-            TransientCdmRepository repo =
+           /* TransientCdmRepository repo =
                     new TransientCdmRepository(CdmStore.getCurrentApplicationConfiguration());
             configurator.setCdmAppController(repo);
-
+*/
             CdmDefaultImport<Abcd206ImportConfigurator> importer = new CdmDefaultImport<Abcd206ImportConfigurator>();
             importer.invoke(configurator);
-            results = repo.getUnits();
+           // results = repo.getUnits();
             setResults(results);
         } catch (ClientProtocolException e) {
             logger.error(errorMessage, e);
similarity index 99%
rename from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/DataImportEditor.java
rename to eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/DataImportEditor.java
index 6a7ce39f37802dc424b490ba56a85b59270a9092..83212c426d99fe5f126c83f31153f16c59203bd0 100644 (file)
@@ -7,7 +7,7 @@
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
 
 import java.util.Collection;
 
@@ -1,4 +1,4 @@
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
 
 import java.io.IOException;
 
@@ -19,7 +19,6 @@ import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.MenuItem;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.actions.CompoundContributionItem;
 
@@ -30,7 +29,6 @@ import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifDataSetProtocol;
 import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifQueryServiceWrapper;
 import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -92,7 +90,7 @@ public class DataImportEditorContextMenu extends CompoundContributionItem {
                                         try{
                                             DataSetResponse response = new GbifQueryServiceWrapper().queryOriginalDataSet(gbifResponse);
                                             final BioCaseEditorInput input = new BioCaseEditorInput(new OccurenceQuery(response.getUnitId()), response.getEndpoint());
-                                            EditorUtil.open(input);
+                                           // EditorUtil.open(input);
                                             Job queryJob = new Job("Querying for original record...") {
 
                                                 @Override
@@ -106,9 +104,10 @@ public class DataImportEditorContextMenu extends CompoundContributionItem {
                                             logger.error("Query for single record failed.", e);
                                         } catch (IOException e) {
                                             logger.error("Query for single record failed.", e);
-                                        } catch (PartInitException e) {
-                                            logger.error("Could not open editor.", e);
                                         }
+//                                        } catch (PartInitException e) {
+//                                            logger.error("Could not open editor.", e);
+//                                        }
                                     }
                                 });
                             }
@@ -7,7 +7,7 @@
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
 
 import java.util.Collection;
 
similarity index 99%
rename from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/DataImportView.java
rename to eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/DataImportView.java
index 66e48500c168808b42b830c91fe020f88bc40c8f..e7746b639730904a2ff1520552018a01acda352f 100644 (file)
@@ -7,7 +7,7 @@
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
 
 import java.util.ArrayList;
 import java.util.Collection;
similarity index 77%
rename from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/GbifImportEditor.java
rename to eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/GbifImportEditor.java
index 881f86386252a5c1e8b2b7ab270b778ebdff8256..9b84f1d07dc9b505cdc693a31547e5f626604ba1 100644 (file)
@@ -7,7 +7,7 @@
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
 
 import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
 
@@ -18,7 +18,7 @@ import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
  */
 public class GbifImportEditor extends DataImportEditor<GbifResponse>{
 
-    public static final String ID = "eu.etaxonomy.taxeditor.editor.view.dataimport.GbifImportEditor";
+    public static final String ID = "eu.etaxonomy.taxeditor.view.dataimport.GbifImportEditor";
 
     /**
      * Required for extension point
@@ -28,7 +28,7 @@ public class GbifImportEditor extends DataImportEditor<GbifResponse>{
     }
 
     /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportEditor#getTextForTableItem(java.lang.Object)
+     * @see eu.etaxonomy.taxeditor.view.dataimport.DataImportEditor#getTextForTableItem(java.lang.Object)
      */
     @Override
     protected String getTextForTableItem(GbifResponse item) {
@@ -7,7 +7,7 @@
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
 
 import java.io.IOException;
 import java.net.URISyntaxException;
@@ -7,7 +7,7 @@
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
 
 import java.io.IOException;
 import java.net.URISyntaxException;
@@ -26,10 +26,10 @@ import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
 public class GbifResponseImportView extends DataImportView<GbifResponse> {
 
 
-    public static final String ID = "eu.etaxonomy.taxeditor.editor.view.dataimport.GbifResponseImportView";
+    public static final String ID = "eu.etaxonomy.taxeditor.view.dataimport.GbifResponseImportView";
 
     /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportView#getTextForTableItem(java.lang.Object)
+     * @see eu.etaxonomy.taxeditor.view.dataimport.DataImportView#getTextForTableItem(java.lang.Object)
      */
     @Override
     protected String getTextForTableItem(GbifResponse item) {
@@ -42,7 +42,7 @@ public class GbifResponseImportView extends DataImportView<GbifResponse> {
     }
 
     /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportView#query()
+     * @see eu.etaxonomy.taxeditor.view.dataimport.DataImportView#query()
      */
     @Override
     public void query() {
similarity index 88%
rename from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/QueryType.java
rename to eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/QueryType.java
index a2edf5d5ac6c34e03d413714c4fdf169249ed286..21a6b5a4ee8da5a2813aeb78b4aab0218c030e9d 100644 (file)
@@ -7,7 +7,7 @@
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
 
 /**
  * Enumeration of possible specimen provider types
similarity index 74%
rename from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/SpecimenImportEditor.java
rename to eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SpecimenImportEditor.java
index 82a847c39ba3eb5c03153da8aa7366dae14eb9de..368c6ae84f3711ae18745c8cb686980f6359b3a1 100644 (file)
@@ -7,7 +7,7 @@
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
 
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 
@@ -19,7 +19,7 @@ import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
  */
 public class SpecimenImportEditor extends DataImportEditor<SpecimenOrObservationBase<?>> {
 
-    public static final String ID = "eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportEditor";
+    public static final String ID = "eu.etaxonomy.taxeditor.view.dataimport.SpecimenImportEditor";
 
     /**
      * Required for extension point
@@ -29,7 +29,7 @@ public class SpecimenImportEditor extends DataImportEditor<SpecimenOrObservation
     }
 
     /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportEditor#getTextForTableItem(eu.etaxonomy.cdm.model.common.IIdentifiableEntity)
+     * @see eu.etaxonomy.taxeditor.view.dataimport.DataImportEditor#getTextForTableItem(eu.etaxonomy.cdm.model.common.IIdentifiableEntity)
      */
     @Override
     protected String getTextForTableItem(SpecimenOrObservationBase<?> item) {
similarity index 63%
rename from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/SpecimenImportView.java
rename to eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SpecimenImportView.java
index d4a254049339ec1297b05fae25dc593e30e4f5b2..1c16a6fc5ad47d8e9969a04d4554d605456e5a5d 100644 (file)
@@ -7,7 +7,7 @@
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -16,12 +16,13 @@ import java.util.ArrayList;
 import java.util.Collection;
 
 import org.apache.http.client.ClientProtocolException;
+import org.eclipse.core.runtime.jobs.Job;
 
 import eu.etaxonomy.cdm.ext.occurrence.bioCase.BioCaseQueryServiceWrapper;
 import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
+import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
 import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.taxeditor.editor.view.dataimport.transientServices.TransientCdmRepository;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -31,7 +32,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class SpecimenImportView extends DataImportView<SpecimenOrObservationBase<?>> {
 
-    public static final String ID = "eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportView"; //$NON-NLS-1$
+    public static final String ID = "eu.etaxonomy.taxeditor.view.dataimport.SpecimenImportView"; //$NON-NLS-1$
 
     private URI endPoint;
 
@@ -46,7 +47,7 @@ public class SpecimenImportView extends DataImportView<SpecimenOrObservationBase
     }
 
     /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportView#getTextForTableItem(java.lang.Object)
+     * @see eu.etaxonomy.taxeditor.view.dataimport.DataImportView#getTextForTableItem(java.lang.Object)
      */
     @Override
     protected String getTextForTableItem(SpecimenOrObservationBase<?> item) {
@@ -54,7 +55,7 @@ public class SpecimenImportView extends DataImportView<SpecimenOrObservationBase
     }
 
     /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportView#query()
+     * @see eu.etaxonomy.taxeditor.view.dataimport.DataImportView#query()
      */
     @Override
     public void query() {
@@ -65,15 +66,20 @@ public class SpecimenImportView extends DataImportView<SpecimenOrObservationBase
             //FIXME move ABCD import to cdmlib -> this will also get rid of the transient services
             InputStream resultStream;
             resultStream = new BioCaseQueryServiceWrapper().query(query, endPoint);
-            Abcd206ImportConfigurator configurator = Abcd206ImportConfigurator.NewInstance(resultStream, null, false);
-            TransientCdmRepository repo =
-                    new TransientCdmRepository(CdmStore.getCurrentApplicationConfiguration());
-            configurator.setCdmAppController(repo);
+            Abcd206ImportConfigurator configurator = Abcd206ImportConfigurator.NewInstance(null, null);
+//            TransientCdmRepository repo =
+//                    new TransientCdmRepository(CdmStore.getCurrentApplicationConfiguration());
+            //configurator.setCdmAppController(repo);
             configurator.setAddMediaAsMediaSpecimen(true);
-
-            CdmDefaultImport<Abcd206ImportConfigurator> importer = new CdmDefaultImport<Abcd206ImportConfigurator>();
-            importer.invoke(configurator);
-            results = repo.getUnits();
+            if(CdmStore.getCurrentSessionManager().isRemoting()) {
+                Job job = CdmStore.getImportManager().createIOServiceJob(configurator, resultStream, SOURCE_TYPE.INPUTSTREAM);
+                CdmStore.getImportManager().run(job);
+            } else {
+                configurator.setSource(resultStream);
+                CdmDefaultImport<Abcd206ImportConfigurator> importer = new CdmDefaultImport<Abcd206ImportConfigurator>();
+                importer.invoke(configurator);
+            }
+           // results = repo.getUnits();
             setResults(results);
         } catch (ClientProtocolException e) {
             logger.error(errorMessage, e);
@@ -7,7 +7,7 @@
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
 
 import java.net.MalformedURLException;
 import java.net.URI;
@@ -31,7 +31,7 @@ public class SpecimenProviderSelectionWizardPage extends WizardPage{
     private SpecimenProviderSelectionController specimenProviderSelectionController;
     private URI endPoint;
 
-    protected SpecimenProviderSelectionWizardPage(String pageName) {
+    public SpecimenProviderSelectionWizardPage(String pageName) {
         super(pageName);
         setTitle("Select Specimen Provider");
         setDescription("Select the provider to query for specimens.\nTo query a BioCASE " +
@@ -98,4 +98,6 @@ public class SpecimenProviderSelectionWizardPage extends WizardPage{
     }
 
 
+
+
 }
similarity index 61%
rename from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/SpecimenSearchWizard.java
rename to eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SpecimenSearchWizard.java
index 239700c74de83cc63afeecfae75aad0ac34e0a09..1e91d6c5e24089be896b8fcae4dc34bab0d20dab 100644 (file)
@@ -7,7 +7,7 @@
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
 
 import org.apache.log4j.Logger;
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -19,11 +19,10 @@ import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IImportWizard;
 import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
 
+import eu.etaxonomy.cdm.database.DbSchemaValidation;
 import eu.etaxonomy.cdm.ext.occurrence.OccurenceQuery;
-import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
+import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -61,35 +60,45 @@ public class SpecimenSearchWizard extends Wizard implements IImportWizard {
 
         DataImportView<?> dataImportView = null;
         query = searchPage.getQuery();
-        try {
-            switch (providerSelectionPage.getQueryType()) {
-            case BIOCASE:
-                SpecimenImportView specimenImportView = (SpecimenImportView) TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
-                        .showView(SpecimenImportView.ID, "query_"+query.toString().replaceAll(",", ""),IWorkbenchPage.VIEW_ACTIVATE);
-                specimenImportView.setEndpoint(providerSelectionPage.getEndPoint());
-                dataImportView = specimenImportView;
-                break;
-            case GBIF:
-                dataImportView = (GbifResponseImportView) TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
-                .showView(GbifResponseImportView.ID, "query_"+query.toString().replaceAll(",", ""),IWorkbenchPage.VIEW_ACTIVATE);
-                break;
-            }
-        } catch ( PartInitException e ) {
-            logger.error("Could not open import view for query: " + query.toString(), e);
+        Abcd206ImportConfigurator configurator =  CdmStore.getImportManager().AbcdConfigurator();
+        configurator.setOccurenceQuery(query);
+        configurator.setSourceUri(providerSelectionPage.getEndPoint());
+        configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
+        if(CdmStore.getCurrentSessionManager().isRemoting()) {
+            //Job job = CdmStore.getImportManager().createIOServiceJob(configurator, new File(source), SOURCE_TYPE.INPUTSTREAM);
+            //CdmStore.getImportManager().run(job);
+
+            CdmStore.getImportManager().run(configurator);
         }
-        if(dataImportView!=null){
-            dataImportView.setQuery(query);
-//            dataImportView.query();
-//            Display.getDefault().asyncExec(new Runnable() {
-//
-//                @Override
-//                public void run() {
-//                    CdmStore.getContextManager().notifyContextRefresh();
-//                }
-//            });
+//        try {
+//            switch (providerSelectionPage.getQueryType()) {
+//            case BIOCASE:
+//                SpecimenImportView specimenImportView = (SpecimenImportView) TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
+//                        .showView(SpecimenImportView.ID, "query_"+query.toString().replaceAll(",", ""),IWorkbenchPage.VIEW_ACTIVATE);
+//                specimenImportView.setEndpoint(providerSelectionPage.getEndPoint());
+//                dataImportView = specimenImportView;
+//                break;
+//            case GBIF:
+//                dataImportView = (GbifResponseImportView) TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
+//                .showView(GbifResponseImportView.ID, "query_"+query.toString().replaceAll(",", ""),IWorkbenchPage.VIEW_ACTIVATE);
+//                break;
+//            }
+//        } catch ( PartInitException e ) {
+//            logger.error("Could not open import view for query: " + query.toString(), e);
+//        }
+//        if(dataImportView!=null){
+//            dataImportView.setQuery(query);
+////            dataImportView.query();
+////            Display.getDefault().asyncExec(new Runnable() {
+////
+////                @Override
+////                public void run() {
+////                    CdmStore.getContextManager().notifyContextRefresh();
+////                }
+////            });
             Job queryJob = new QueryJob("Query specimen provider", dataImportView);
             queryJob.schedule();
-        }
+
         return true;
     }
 
@@ -7,7 +7,7 @@
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
 
 import java.util.Calendar;
 
index 6edcd8fd80db4a7f56c096362b038fd530070596..2c140c247539281f5ec15a13858c295875034c42 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,52 +16,47 @@ import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.handlers.HandlerUtil;
 
+import eu.etaxonomy.taxeditor.Messages;
 import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.view.datasource.CdmMetaDataAwareDataSourceContainer;
 
 /**
- * <p>ChangeConnectionHandler class.</p>
- *
  * @author n.hoffmann
  * @created 15.04.2009
  * @version 1.0
  */
 public class ChangeConnectionHandler extends AbstractHandler {
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.store.datasource.handler.AbstractDataSourceHandler#specificExecute(org.eclipse.core.commands.ExecutionEvent)
-        */
        /** {@inheritDoc} */
-       public Object execute(ExecutionEvent event) {
+       @Override
+    public Object execute(ExecutionEvent event) {
                ISelection selection = HandlerUtil.getCurrentSelection(event);
-               
+
                if(selection != null && selection instanceof IStructuredSelection){
                        CdmMetaDataAwareDataSourceContainer container = (CdmMetaDataAwareDataSourceContainer) ((IStructuredSelection) selection).getFirstElement();
-                       
+
                        if(CdmStore.isConnecting()){
-                               MessagingUtils.warningDialog("Already connecting", this, "You are currently connecting to a different datasource already.");
+                               MessagingUtils.warningDialog(Messages.ChangeConnectionHandler_ALREADY_CONNECTING, this, Messages.ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY);
                                return null;
                        }
-                       
+
                        try {
                                container.getCdmSource().checkConnection();
-                               boolean confirmed = MessagingUtils.confirmDialog("Confirm Datasource Connection", "Do you really want to connect to this datasource?\n\n"
+                               boolean confirmed = MessagingUtils.confirmDialog(Messages.ChangeConnectionHandler_CONFIRM_DATASOURCE, Messages.ChangeConnectionHandler_REALLY_WANT_TO_CONNECT
                                                + container.getCdmSource().getName());
-                               
+
                                if(confirmed){
                                        CdmDataSourceRepository.changeDataSource(container.getCdmSource());
                                }
                        } catch (Exception e) {
-                               MessagingUtils.warningDialog("Chosen datasource is not available", this, "This could mean that either the database server is " +
-                                               "not running or the machine is not reachable.\n\n" +
-                                               "Please also make sure that you are connected to the network when trying to connect to a remote datasource.");
+                               MessagingUtils.warningDialog(Messages.ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE, this, Messages.ChangeConnectionHandler_NOT_AVAILABLE_REASONS);
                                MessagingUtils.warn(getClass(), e);
                                return null;
-                       } 
+                       }
                }
-               
+
                return null;
        }
 }
index 8aa1147e7d7a34ea840032d151a2996ba50506d9..72543d8ed31a266bf3e786ed64f756eb9a21c7a5 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -21,33 +21,28 @@ import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
 import eu.etaxonomy.taxeditor.view.datasource.CdmMetaDataAwareDataSourceContainer;
 
 /**
- * <p>DeleteDataSourceHandler class.</p>
- *
  * @author n.hoffmann
  * @created 15.04.2009
  * @version 1.0
  */
 public class DeleteDataSourceHandler extends AbstractDataSourceHandler {
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.store.datasource.handler.AbstractDataSourceHandler#specificExecute(org.eclipse.core.commands.ExecutionEvent)
-        */
        /** {@inheritDoc} */
        @Override
        public boolean specificExecute(ExecutionEvent event) {
                ISelection selection = HandlerUtil.getActivePart(event).getSite().getSelectionProvider().getSelection();
                if(selection instanceof IStructuredSelection){
                        Object[] selectedObjects = ((IStructuredSelection) selection).toArray();
-               
+
                        if(! MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you want to delete the selected datasources?")){
                                return false;
                        }
-                       // Delete from persistent data sources          
+                       // Delete from persistent data sources
                        for(Object object : selectedObjects){
                                CdmPersistentDataSource dataSource = (CdmPersistentDataSource) ((CdmMetaDataAwareDataSourceContainer) object).getCdmSource();
                                CdmDataSourceRepository.delete(dataSource);
                        }
-                       
+
                        return true;
                }
                return false;
index 7c3c5e282c54d7469f27ebbc3597448b5731d0c8..27b80b47a68ad4948ec1c0ad5a34a2800b121a9d 100644 (file)
@@ -1,16 +1,15 @@
 package eu.etaxonomy.taxeditor.view.derivateSearch;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
-import java.util.UUID;
 
 import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.TreeNode;
 import org.eclipse.jface.viewers.Viewer;
 
-import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.model.molecular.DnaSample;
 import eu.etaxonomy.cdm.model.molecular.Sequence;
 import eu.etaxonomy.cdm.model.molecular.SingleRead;
@@ -18,35 +17,46 @@ import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
-import eu.etaxonomy.taxeditor.store.CdmStore;
 
 public class DerivateContentProvider implements ITreeContentProvider {
 
+    List<TreeNode> rootNodes;
+
        @Override
        public void dispose() {
                // TODO Auto-generated method stub
 
        }
 
+       public List<SpecimenOrObservationBase> getRootElements() {
+           List<SpecimenOrObservationBase> elements = new ArrayList<SpecimenOrObservationBase>();
+
+           if(rootNodes != null) {
+               for(TreeNode node : rootNodes) {
+                   elements.add((SpecimenOrObservationBase)node.getValue());
+               }
+           }
+           return elements;
+       }
+
        @Override
        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
        }
 
        @Override
        public Object[] getElements(Object inputElement) {
-           List<TreeNode> rootElements = new ArrayList<TreeNode>();
-           if(inputElement instanceof Set){
-               for (Object o: (Set)inputElement) {
-                   if(o instanceof UUID){
-                       UUID uuid = (UUID)o;
-                       SpecimenOrObservationBase<?> rootElement = CdmStore.getService(IOccurrenceService.class).load(uuid);
+           rootNodes = new ArrayList<TreeNode>();
+           if(inputElement instanceof Collection){
+               for (Object o: (Collection)inputElement) {
+                   if(o instanceof SpecimenOrObservationBase){
+                       SpecimenOrObservationBase<?> rootElement = (SpecimenOrObservationBase<?>)o;
                        if(rootElement!=null){
-                           rootElements.add(new TreeNode(rootElement));
+                           rootNodes.add(new TreeNode(rootElement));
                        }
                    }
             }
            }
-           return rootElements.toArray();
+           return rootNodes.toArray();
        }
 
        @Override
@@ -66,7 +76,6 @@ public class DerivateContentProvider implements ITreeContentProvider {
                 node.setParent(currentnode);
                 children.add(node);
             }
-            return children.toArray();
         }
         else if(value instanceof Sequence){
             Set<SingleRead> singleReads = ((Sequence) value).getSingleReads();
@@ -77,7 +86,8 @@ public class DerivateContentProvider implements ITreeContentProvider {
             }
             return children.toArray();
         }
-        else if(value instanceof SpecimenOrObservationBase){
+
+        if(value instanceof SpecimenOrObservationBase){
                List<DerivedUnit> derivates = getDerivates((SpecimenOrObservationBase<?>) value);
                for (DerivedUnit derivedUnit:derivates) {
                 TreeNode node = new TreeNode(derivedUnit);
@@ -112,7 +122,8 @@ public class DerivateContentProvider implements ITreeContentProvider {
         else if(element instanceof Sequence){
             return !((Sequence)element).getSingleReads().isEmpty();
         }
-        else if(element instanceof SpecimenOrObservationBase){
+
+        if(element instanceof SpecimenOrObservationBase){
                SpecimenOrObservationBase<?> specimenOrObservation = (SpecimenOrObservationBase<?>)element;
                for(DerivationEvent event:specimenOrObservation.getDerivationEvents()){
                    if(!event.getDerivatives().isEmpty()){
index 1b47155dba9396fce2fbdfb417b72105c024208c..ebe3b81bf3778ab995c7e2a5cb0728aa0c933e97 100644 (file)
@@ -9,7 +9,13 @@
 */
 package eu.etaxonomy.taxeditor.view.derivateSearch;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Set;
 import java.util.UUID;
 
@@ -20,6 +26,10 @@ import org.hibernate.LazyInitializationException;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
+import eu.etaxonomy.cdm.format.CdmFormatterFactory;
+import eu.etaxonomy.cdm.format.ICdmFormatter;
+import eu.etaxonomy.cdm.format.ICdmFormatter.FormatKey;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.DefinedTerm;
@@ -27,6 +37,7 @@ import eu.etaxonomy.cdm.model.common.Identifier;
 import eu.etaxonomy.cdm.model.molecular.DnaSample;
 import eu.etaxonomy.cdm.model.molecular.Sequence;
 import eu.etaxonomy.cdm.model.molecular.SingleRead;
+import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
 import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;
@@ -49,8 +60,10 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
 
     private static final String NO_SAMPLE_DESIGNATION = "[no sample designation]";
 
-    private Set<SingleRead> multiLinkSingleReads;
+    private static Set<SingleRead> multiLinkSingleReads;
 
+    private static Map<DerivedUnit, Collection<SpecimenTypeDesignation>> typeDesignations;
+    
     private ConversationHolder conversation;
 
     private static DefinedTerm photoTerm = null;
@@ -120,7 +133,26 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
     /** {@inheritDoc} */
     @Override
     public String getText(Object element) {
-        return getDerivateText(element);
+        if(element instanceof TreeNode){
+            element = ((TreeNode) element).getValue();
+        }
+        FormatKey[] formatKeys = {
+                FormatKey.GATHERING_COUNTRY, FormatKey.SPACE,
+                FormatKey.GATHERING_LOCALITY_TEXT, FormatKey.SPACE,
+                FormatKey.GATHERING_DATE, FormatKey.SPACE,
+                FormatKey.GATHERING_COLLECTOR, FormatKey.SPACE,
+                FormatKey.FIELD_NUMBER, FormatKey.SPACE,
+                FormatKey.COLLECTION_CODE, FormatKey.SPACE,
+                FormatKey.MOST_SIGNIFICANT_IDENTIFIER, FormatKey.SPACE,
+//                FormatKey.KIND_OF_UNIT, FormatKey.SPACE,
+                FormatKey.SAMPLE_DESIGNATION, FormatKey.SPACE,
+                FormatKey.SINGLE_READ_PRIMER, FormatKey.SPACE,
+                FormatKey.SEQUENCE_DNA_MARKER, FormatKey.SPACE,
+                FormatKey.AMPLIFICATION_LABEL, FormatKey.SPACE,
+                FormatKey.MEDIA_TITLE, FormatKey.SPACE,
+                FormatKey.MEDIA_ARTIST, FormatKey.SPACE
+        };
+        return CdmFormatterFactory.format(element, formatKeys);
     }
 
     /** {@inheritDoc} */
@@ -152,7 +184,9 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
             derivate = node.getValue();
         }
 
-        conversation.bind();
+        if(conversation!=null){
+            conversation.bind();
+        }
 
         final String emptyString = "";
         final String separator = " ";
@@ -164,10 +198,6 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
             FieldUnit fieldUnit = (FieldUnit)derivate;
             if(fieldUnit.getGatheringEvent()!=null){
                 GatheringEvent gatheringEvent = fieldUnit.getGatheringEvent();
-                if(CdmStore.getService(IOccurrenceService.class).exists(fieldUnit.getUuid()) && !conversation.getSession().contains(gatheringEvent)){
-                    fieldUnit = (FieldUnit) CdmStore.getService(IOccurrenceService.class).load(fieldUnit.getUuid());
-                    gatheringEvent = fieldUnit.getGatheringEvent();
-                }
                 label += gatheringEvent.getCountry()!=null?gatheringEvent.getCountry().getLabel()+separator:emptyString;
                 label += gatheringEvent.getLocality()!=null?gatheringEvent.getLocality().getText()+separator:emptyString;
                 label += gatheringEvent.getGatheringDate()!=null?gatheringEvent.getGatheringDate()+separator:emptyString;
@@ -220,21 +250,32 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
         else if(derivate instanceof DerivedUnit){
             DerivedUnit derivedUnit = (DerivedUnit)derivate;
             if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen){
-                java.util.Collection<FieldUnit> fieldUnits = CdmStore.getService(IOccurrenceService.class).getFieldUnits(derivedUnit.getUuid());
-                if(fieldUnits!=null && !fieldUnits.isEmpty()){
-                    FieldUnit fieldUnit = fieldUnits.iterator().next();
-                    GatheringEvent gatheringEvent = fieldUnit.getGatheringEvent();
-//                  gatheringEvent = HibernateProxyHelper.deproxy(gatheringEvent, GatheringEvent.class);
-                    if(gatheringEvent!=null){
-                        label += gatheringEvent.getCollector()!=null?gatheringEvent.getCollector()+separator:emptyString;
+                //check for type designation
+                if(typeDesignations.get(derivedUnit)==null){
+                    for (SpecimenTypeDesignation specimenTypeDesignation : CdmStore.getService(IOccurrenceService.class).listTypeDesignations(derivedUnit, null, null, null, null)) {
+                        addTypeDesignation(derivedUnit, specimenTypeDesignation);
                     }
-                    label += fieldUnit.getFieldNumber()!=null?fieldUnit.getFieldNumber()+separator:emptyString;
                 }
+                //java.util.Collection<FieldUnit> fieldUnits = CdmStore.getService(IOccurrenceService.class).getFieldUnits(derivedUnit.getUuid());
+                //TODO : This is not generic anymore for performance reasons
+                Set<SpecimenOrObservationBase> originals = derivedUnit.getOriginals();
+                if(originals!=null && originals.size() ==1) {
+                    SpecimenOrObservationBase specimen = originals.iterator().next();
+                    if(specimen instanceof FieldUnit) {
+                        FieldUnit fieldUnit = (FieldUnit)specimen;
+                        GatheringEvent gatheringEvent = fieldUnit.getGatheringEvent();
+                        if(gatheringEvent!=null){
+                            label += gatheringEvent.getCollector()!=null?gatheringEvent.getCollector()+separator:emptyString;
+                        }
+                        label += fieldUnit.getFieldNumber()!=null?fieldUnit.getFieldNumber()+separator:emptyString;
+                    }
+                }
+
                 eu.etaxonomy.cdm.model.occurrence.Collection collection = derivedUnit.getCollection();
                 if(collection!=null){
                     label += collection.getCode()!=null?"("+collection.getCode()+")"+separator:emptyString;
                 }
-                String mostSignificantIdentifier = CdmStore.getService(IOccurrenceService.class).getMostSignificantIdentifier(derivedUnit);
+                String mostSignificantIdentifier = derivedUnit.getMostSignificantIdentifier();
                 label += mostSignificantIdentifier!=null?mostSignificantIdentifier+separator:emptyString;
             }
             else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.TissueSample){
@@ -292,9 +333,6 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
         return label;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.ColumnLabelProvider#getImage(java.lang.Object)
-     */
     @Override
     public Image getImage(Object element) {
         if(element instanceof TreeNode){
@@ -305,7 +343,7 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
             boolean hasCharacterData = false;
             if(cdmBase.isInstanceOf(SpecimenOrObservationBase.class)){
                 SpecimenOrObservationBase<?> specimen = HibernateProxyHelper.deproxy(cdmBase, SpecimenOrObservationBase.class);
-                if(!CdmStore.getService(IOccurrenceService.class).getCharacterDataForSpecimen(specimen).isEmpty()){
+                if(specimen.hasCharacterData()){
                     hasCharacterData = true;
                 }
             }
@@ -314,6 +352,7 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
             }
             else if(cdmBase.isInstanceOf(DerivedUnit.class)){
                 DerivedUnit derivedUnit = HibernateProxyHelper.deproxy(element, DerivedUnit.class);
+
                 if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.FieldUnit){
                     return hasCharacterData?ImageResources.getImage(ImageResources.FIELD_UNIT_CHARACTER_DATA):ImageResources.getImage(ImageResources.FIELD_UNIT);
                 }
@@ -324,6 +363,9 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
                     return hasCharacterData?ImageResources.getImage(ImageResources.TISSUE_SAMPLE_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.TISSUE_SAMPLE_DERIVATE);
                 }
                 else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen){
+                    if(typeDesignations.get(derivedUnit)!=null && !typeDesignations.get(derivedUnit).isEmpty()){
+                        return ImageResources.getImage(ImageResources.SPECIMEN_DERIVATE_TYPE);
+                    }
                     return hasCharacterData?ImageResources.getImage(ImageResources.SPECIMEN_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.SPECIMEN_DERIVATE);
                 }
                 else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.Media){
@@ -348,7 +390,7 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
             }
 
             else if(cdmBase.isInstanceOf(SingleRead.class)){
-                if(multiLinkSingleReads.contains(element)){
+                if(multiLinkSingleReads!=null && multiLinkSingleReads.contains(element)){
                     return ImageResources.getImage(ImageResources.SINGLE_READ_DERIVATE_MULTILINK);
                 }
                 else{
@@ -378,11 +420,37 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
         return null;
     }
 
-    /**
-     * @param multiLinkSingleReads2
-     */
-    public void setMultiLinkSingleReads(Set<SingleRead> multiLinkSingleReads) {
-        this.multiLinkSingleReads = multiLinkSingleReads;
+    private static void addTypeDesignation(DerivedUnit derivedUnit, SpecimenTypeDesignation typeDesignation){
+        Collection<SpecimenTypeDesignation> list = typeDesignations.get(derivedUnit);
+        if(list==null){
+            list = new ArrayList<SpecimenTypeDesignation>();
+        }
+        list.add(typeDesignation);
+        typeDesignations.put(derivedUnit, list);
+    }
+
+    public static Set<SingleRead> getMultiLinkSingleReads() {
+        return multiLinkSingleReads;
+    }
+
+    public void updateLabelCache(Collection<SpecimenOrObservationBase<?>> rootElements) {
+        multiLinkSingleReads = new HashSet<SingleRead>();
+        typeDesignations = new HashMap<DerivedUnit, Collection<SpecimenTypeDesignation>>();
+        for(Entry<SingleRead, Collection<Sequence>> entry:CdmStore.getService(ISequenceService.class).getSingleReadSequencesMap().entrySet()){
+            if(entry.getValue().size()>1){
+                multiLinkSingleReads.add(entry.getKey());
+            }
+        }
+        if(rootElements!=null){
+            Collection<DerivedUnit> derivedUnits = new ArrayList<DerivedUnit>();
+            for (SpecimenOrObservationBase specimenOrObservationBase : rootElements) {
+                derivedUnits.addAll(CdmStore.getService(IOccurrenceService.class).getAllChildDerivatives(specimenOrObservationBase.getUuid()));
+                if(specimenOrObservationBase.isInstanceOf(DerivedUnit.class)){
+                    derivedUnits.add(HibernateProxyHelper.deproxy(specimenOrObservationBase, DerivedUnit.class));
+                }
+            }
+            typeDesignations = CdmStore.getService(IOccurrenceService.class).listTypeDesignations(derivedUnits, null, null, null, null);
+        }
     }
 
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateSearchView.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateSearchView.java
deleted file mode 100644 (file)
index 93c229a..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-// $Id$
-/**
- * Copyright (C) 2013 EDIT
- * European Distributed Institute of Taxonomy
- * http://www.e-taxonomy.eu
- *
- * The contents of this file are subject to the Mozilla Public License Version 1.1
- * See LICENSE.TXT at the top of this package for the full license terms.
- */
-package eu.etaxonomy.taxeditor.view.derivateSearch;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.part.ViewPart;
-
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.taxeditor.model.IContextListener;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-/**
- * This view allows to search for and filter {@link SpecimenOrObservationBase}s and display
- * the results in a list. The results can be selected and opened in an editor.
- */
-public class DerivateSearchView extends ViewPart implements IContextListener {
-
-    public static final String ID = "eu.etaxonomy.taxeditor.view.derivateSearch.DerivateSearchView";
-    private DerivateSearchCompositeController derivateSearchCompositeController;
-    private ConversationHolder conversationHolder;
-
-    /**
-     * Constructs a new DerivateSearchView and registers it to listen to context changes
-     */
-    public DerivateSearchView() {
-        CdmStore.getContextManager().addContextListener(this);
-    }
-
-    @Override
-    public void createPartControl(Composite parent) {
-        derivateSearchCompositeController = new DerivateSearchCompositeController(parent, this);
-        getSite().setSelectionProvider(derivateSearchCompositeController.getResultViewer());
-        derivateSearchCompositeController.setEnabled(CdmStore.isActive());
-
-        //create context menu
-        MenuManager menuManager = new MenuManager();
-        getSite().registerContextMenu(menuManager, derivateSearchCompositeController.getResultViewer());
-        Control control = derivateSearchCompositeController.getResultViewer().getControl();
-        Menu menu = menuManager.createContextMenu(control);
-        control.setMenu(menu);
-    }
-
-    @Override
-    public void setFocus() {
-        derivateSearchCompositeController.setFocus();
-        //make sure to bind again if maybe in another view the conversation was unbound
-        if(getConversationHolder()!=null && !getConversationHolder().isClosed() && !getConversationHolder().isBound()){
-            getConversationHolder().bind();
-        }
-    }
-
-    @Override
-    public void contextAboutToStop(IMemento memento, IProgressMonitor monitor) {
-    }
-
-    @Override
-    public void contextStop(IMemento memento, IProgressMonitor monitor) {
-        derivateSearchCompositeController.setEnabled(false);
-        derivateSearchCompositeController.reset();
-    }
-
-    @Override
-    public void contextStart(IMemento memento, IProgressMonitor monitor) {
-        derivateSearchCompositeController.setEnabled(true);
-    }
-
-    @Override
-    public void contextRefresh(IProgressMonitor monitor) {
-        initConversation();
-    }
-
-    private void initConversation(){
-        if(conversationHolder==null){
-            conversationHolder = CdmStore.createConversation();
-            derivateSearchCompositeController.setConversation(conversationHolder);
-        }
-    }
-
-    @Override
-    public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
-    }
-
-    public ConversationHolder getConversationHolder() {
-        if(CdmStore.isActive() && conversationHolder==null){
-            initConversation();
-        }
-        return conversationHolder;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void dispose() {
-        if(conversationHolder!=null){
-            conversationHolder.close();
-        }
-    }
-}
index d3f20092474906c4d04a7895f2f9b15320d32b9c..0f0df4522f04f5a863b8c5b756af12afdf544653 100644 (file)
@@ -18,6 +18,7 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchPart;
 
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.Feature;
@@ -52,7 +53,7 @@ public class DetailsViewPart extends AbstractCdmEditorViewPart implements IPartC
 
        @Override
     protected void selectionChanged_internal(IWorkbenchPart part, ISelection selection){
-           if(AbstractUtility.getActiveEditor() == null){
+           if(AbstractUtility.getActiveEditor() == null && !(AbstractUtility.getActivePart() instanceof IConversationEnabled)){
             showEmptyPage();
             return;
         }
index 4856e3ff7f3ef99b55c64f1914f782c6273d5368..07a59b225d8ac4c4ff9af7ae705e659bfba40a00 100644 (file)
@@ -62,7 +62,6 @@ import eu.etaxonomy.taxeditor.ui.section.agent.PersonDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.agent.TeamDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.agent.TeamOrPersonBaseDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.common.ReferencedEntityDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.description.DescribedSpecimenSection;
 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementMediaSection;
@@ -78,7 +77,6 @@ import eu.etaxonomy.taxeditor.ui.section.group.MemberDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.identifier.IdentifierDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyNodeDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.key.TaxonomicScopeSection;
 import eu.etaxonomy.taxeditor.ui.section.name.NameRelationshipDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.name.NomenclaturalStatusSection;
 import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameDetailSection;
@@ -91,6 +89,7 @@ import eu.etaxonomy.taxeditor.ui.section.occurrence.EmptySection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitGeneralDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.association.DerivedUnitTypeDesignationSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.association.TaxonAssociationDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaQualityDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaSampleGeneralDetailSection;
@@ -131,17 +130,6 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
     private ISelection selection;
 
-    /**
-     * <p>
-     * Constructor for DetailsViewer.
-     * </p>
-     *
-     * @param parent
-     *            a {@link org.eclipse.swt.widgets.Composite} object.
-     * @param viewPart
-     *            a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
-     *            object.
-     */
     public DetailsViewer(Composite parent, AbstractCdmViewPart viewPart) {
         super(parent, viewPart);
     }
@@ -334,9 +322,6 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     }
 
 
-    /**
-     * @param rootElement
-     */
     private void createEmptySection(RootElement parent) {
         destroySections();
 
@@ -345,9 +330,6 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         addPart(emptySection);
     }
 
-    /**
-     * @param rootElement
-     */
     private void createGroupSection(RootElement parent) {
         destroySections();
 
@@ -360,11 +342,6 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         addPart(grantedAuthorityDetailSection);
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see org.eclipse.jface.viewers.Viewer#getSelection()
-     */
     /** {@inheritDoc} */
     @Override
     public ISelection getSelection() {
@@ -381,11 +358,6 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         }
     }
 
-    /**
-     * createTaxonSections(RootElement parent)
-     *
-     * @param parent
-     */
     private void createTaxonSections(RootElement parent) {
         destroySections();
 
@@ -396,8 +368,9 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                        ExpandableComposite.TWISTIE     | ExpandableComposite.EXPANDED);
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this,
-                       ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        NonViralNameDetailSection nonViralNameSection = formFactory
+                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
+                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
         NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
@@ -424,7 +397,6 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                        addPart(nameRelationshipSection);
         }
 
-
         addPart(parsingMessagesSection);
         addPart(taxonBaseDetailSection);
         addPart(nonViralNameSection);
@@ -432,15 +404,11 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         addPart(referenceDetailSection);
     }
 
-    /**
-     * createNameSections
-     *
-     * @param parent
-     */
     private void createNameSections(RootElement parent) {
         destroySections();
-        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this,
-                       ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(
+                getConversationHolder(), parent, this, false, ExpandableComposite.TWISTIE
+                        | ExpandableComposite.EXPANDED);
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
         NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
@@ -470,11 +438,6 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         }
     }
 
-    /**
-     * createReferenceSections
-     *
-     * @param parent
-     */
     private void createReferenceSections(RootElement parent) {
         destroySections();
 
@@ -484,11 +447,6 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         addPart(referenceDetailSection);
     }
 
-    /**
-     * createTeamOrPersonBaseDetailSection
-     *
-     * @param parent
-     */
     private void createTeamOrPersonBaseDetailSection(RootElement parent) {
         destroySections();
         TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = formFactory.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
@@ -496,11 +454,6 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         addPart(teamOrPersonBaseDetailSection);
     }
 
-    /**
-     * createTeamDetailSection
-     *
-     * @param parent
-     */
     private void createTeamDetailSection(RootElement parent) {
         destroySections();
         TeamDetailSection teamDetailSection = formFactory.createTeamDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
@@ -508,22 +461,12 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         addPart(teamDetailSection);
     }
 
-    /**
-     * createPersonDetailSection
-     *
-     * @param parent
-     */
     private void createPersonDetailSection(RootElement parent) {
         destroySections();
         PersonDetailSection personDetailSection = formFactory.createPersonDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         addPart(personDetailSection);
     }
 
-    /**
-     * createDescriptionElementSection
-     *
-     * @param parent
-     */
     private void createDescriptionElementSection(RootElement parent) {
         destroySections();
 
@@ -544,11 +487,6 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         addPart(descriptionElementMediaSection);
     }
 
-    /**
-     * createDescriptionSection
-     *
-     * @param parent
-     */
     private void createDescriptionSection(RootElement parent) {
         destroySections();
         DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
@@ -559,9 +497,9 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DescribedSpecimenSection describedSpecimenSection = formFactory.createDescribedSpecimenSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+//        DescribedSpecimenSection describedSpecimenSection = formFactory.createDescribedSpecimenSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+//
+//        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
         //             DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
         //                             .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
@@ -575,27 +513,17 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
         addPart(descriptionDetailSection);
         addPart(naturalLanguageSection);
-        addPart(describedSpecimenSection);
+//        addPart(describedSpecimenSection);
         //             addPart(descriptionSourceSection);
         addPart(scopeSection);
     }
 
-    /**
-     * createDescriptionSection
-     *
-     * @param parent
-     */
     private void createSpecimenDescriptionSection(RootElement parent) {
         destroySections();
         DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         addPart(descriptionDetailSection);
     }
 
-    /**
-     * Creates the use Description section
-     *
-     * @param parent
-     */
     private void createUseDescriptionSection(RootElement parent) {
         destroySections();
         DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
@@ -611,10 +539,6 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
     }
 
-
-    /**
-     * @param rootElement
-     */
     private void createImageGallerySection(RootElement parent) {
         destroySections();
         DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
@@ -622,12 +546,6 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         addPart(descriptionDetailSection);
     }
 
-    /**
-     * createMediaElementSection
-     *
-     * @param parent
-     */
-
     private void createMediaElementSection(RootElement parent) {
         destroySections();
 
@@ -636,11 +554,6 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         addPart(mediaDetailSection);
     }
 
-    /**
-     * createDerivedUnitBaseElementSection
-     *
-     * @param parent
-     */
     private void createDerivedUnitBaseElementSection(RootElement parent) {
         destroySections();
 
@@ -666,21 +579,26 @@ public class DetailsViewer extends AbstractCdmDataViewer {
             FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
             addPart(fieldUnitDetailSection);
         }
+        else{
 
+            if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_TAXON_ASSOCIATIONS)){
+                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+                TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+                addPart(taxonAssociationDetailSection);
+            }
+            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+            IdentifierDetailSection identifierDetailSection = formFactory.createIdentifierDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+            addPart(identifierDetailSection);
+        }
         if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
             DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
             addPart(determinationDetailSection);
         }
-        if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_TAXON_ASSOCIATIONS)){
-            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-            TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
-            addPart(taxonAssociationDetailSection);
-        }
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-        IdentifierDetailSection identifierDetailSection = formFactory.createIdentifierDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-        addPart(identifierDetailSection);
+        DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection = formFactory.createDerivedUnitTypeDesignationSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+        addPart(derivedUnitTypeDesignationSection);
 
     }
 
@@ -789,11 +707,6 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
     }
 
-
-
-    /**
-     * @param rootElement
-     */
     private void createFeatureDistributionSection(RootElement parent) {
         destroySections();
 
@@ -802,35 +715,20 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         addPart(featureDistributionSection);
     }
 
-    /**
-     * createPolytomousKeyNodeSection
-     *
-     * @param parent
-     */
     private void createPolytomousKeyNodeSection(RootElement parent) {
         destroySections();
 
-        PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.COMPACT);
+        PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
         PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = formFactory.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-        TaxonomicScopeSection taxonomicScopeSection = formFactory.createTaxonomicScopeSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.COMPACT);
-
         addPart(polytomousKeyDetailSection);
         addPart(polytomousKeyNodeDetailSection);
-        addPart(taxonomicScopeSection);
 
     }
 
-    /**
-     * create the UseRecordSection
-     *
-     * @param parent
-     */
     private void createUseRecordSection(RootElement parent) {
         destroySections();
 
@@ -843,11 +741,6 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
     }
 
-    /**
-     * createUserSection
-     *
-     * @param parent
-     */
     private void createUserSection(RootElement parent) {
         destroySections();
 
@@ -859,11 +752,6 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         addPart(groupByUserDetailSection);
     }
 
-    /**
-     * createTaxonRelationshipSection
-     *
-     * @param parent
-     */
     private void createTaxonRelationshipSection(RootElement parent) {
         destroySections();
 
@@ -874,9 +762,6 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         addPart(referencedEntityBaseDetailSection);
     }
 
-    /**
-     * @param rootElement
-     */
     private void createTermVocabularySection(RootElement parent) {
         destroySections();
 
@@ -884,11 +769,6 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         addPart(termVocabularyDetailSection);
     }
 
-    /**
-     * createDefinedTermSection
-     *
-     * @param parent
-     */
     private void createDefinedTermSection(RootElement parent) {
         destroySections();
 
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/sessions/InspectSessionsDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/sessions/InspectSessionsDialog.java
new file mode 100644 (file)
index 0000000..003ecb2
--- /dev/null
@@ -0,0 +1,265 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.view.sessions;
+
+import java.util.List;
+
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.Element;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StyledCellLabelProvider;
+import org.eclipse.jface.viewers.StyledString;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerCell;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.FilteredTree;
+import org.eclipse.ui.dialogs.PatternFilter;
+import org.eclipse.wb.swt.SWTResourceManager;
+
+import eu.etaxonomy.taxeditor.remoting.cache.CdmModelFieldPropertyFromClass;
+import eu.etaxonomy.taxeditor.remoting.cache.CdmRemoteCacheManager;
+import eu.etaxonomy.taxeditor.remoting.cache.EntityCacherDebugResult;
+import eu.etaxonomy.taxeditor.remoting.cache.EntityCacherDebugResult.CdmEntityInfo;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author cmathew
+ * @date 17 Feb 2015
+ *
+ */
+public class InspectSessionsDialog extends Dialog {
+
+    protected Object result;
+    protected Shell shlInspectSessions;
+    private Text txtDebugInfo;
+    private Label lblDebugInformation;
+
+    private final Cache cdmlibModelCache;
+
+    private final ICdmEntitySession activeSession;
+
+    private TreeViewer treeViewer;
+    private Button btnClose;
+    EntityCacherDebugResult ecdr;
+    private SashForm sashForm;
+    private Composite compositeDebug;
+    /**
+     * Create the dialog.
+     * @param parent
+     * @param style
+     */
+    public InspectSessionsDialog(Shell parent, int style) {
+        super(parent, style);
+        setText("Inspect Active Session");
+        cdmlibModelCache = CdmRemoteCacheManager.getInstance().getCdmModelGetMethodsCache();
+        activeSession = CdmStore.getCurrentSessionManager().getActiveSession();
+        ecdr = activeSession.debug();
+    }
+
+    /**
+     * Open the dialog.
+     * @return the result
+     */
+    public Object open() {
+
+        createContents();
+        setDebugInfoText();
+        treeViewer.setContentProvider(new SessionsTreeContentProvider());
+        treeViewer.setLabelProvider(new SessionsTreeLabelProvider());
+        treeViewer.setInput(getRootElements());
+        shlInspectSessions.open();
+        shlInspectSessions.layout();
+        Display display = getParent().getDisplay();
+        while (!shlInspectSessions.isDisposed()) {
+            if (!display.readAndDispatch()) {
+                display.sleep();
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Create contents of the dialog.
+     */
+    private void createContents() {
+        shlInspectSessions = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.RESIZE);
+        shlInspectSessions.setSize(641, 631);
+        shlInspectSessions.setText("Inspect Sessions");
+        shlInspectSessions.setLayout(new GridLayout(1, false));
+
+        sashForm = new SashForm(shlInspectSessions, SWT.VERTICAL);
+        sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+
+        PatternFilter filter = new PatternFilter();
+        FilteredTree tree = new FilteredTree(sashForm, SWT.MULTI | SWT.H_SCROLL | SWT.BORDER
+                | SWT.V_SCROLL, filter, true);
+        treeViewer = tree.getViewer();
+        //treeViewer = new TreeViewer(sashForm, SWT.BORDER);
+        //Tree tree = treeViewer.getTree();
+
+        compositeDebug = new Composite(sashForm, SWT.NONE);
+        compositeDebug.setLayout(new GridLayout(1, false));
+
+        lblDebugInformation = new Label(compositeDebug, SWT.NONE);
+        lblDebugInformation.setAlignment(SWT.CENTER);
+        lblDebugInformation.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false, 1, 1));
+        lblDebugInformation.setFont(SWTResourceManager.getFont("Ubuntu", 10, SWT.NORMAL));
+        lblDebugInformation.setText("Debug Information");
+
+        txtDebugInfo = new Text(compositeDebug, SWT.BORDER | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL | SWT.MULTI);
+        txtDebugInfo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+        sashForm.setWeights(new int[] {338, 184});
+
+        btnClose = new Button(shlInspectSessions, SWT.NONE);
+        btnClose.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                shlInspectSessions.dispose();
+            }
+        });
+        GridData gd_btnClose = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+        gd_btnClose.widthHint = 70;
+        btnClose.setLayoutData(gd_btnClose);
+        btnClose.setText("Close");
+
+    }
+
+    private void setDebugInfoText() {
+        txtDebugInfo.setText(ecdr.toString());
+    }
+    private CdmEntityInfo[] getRootElements() {
+
+        List<CdmEntityInfo> rootElemnts = ecdr.getRootElements();
+        return rootElemnts.toArray(new CdmEntityInfo[rootElemnts.size()]);
+    }
+
+    class SessionsTreeContentProvider implements ITreeContentProvider {
+
+
+
+        /* (non-Javadoc)
+         * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+         */
+        @Override
+        public void dispose() {
+
+        }
+
+        /* (non-Javadoc)
+         * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+         */
+        @Override
+        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+
+        }
+
+        /* (non-Javadoc)
+         * @see org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.Object)
+         */
+        @Override
+        public Object[] getElements(Object inputElement) {
+            return (CdmEntityInfo[])inputElement;
+        }
+
+        /* (non-Javadoc)
+         * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+         */
+        @Override
+        public Object[] getChildren(Object parentElement) {
+            List<CdmEntityInfo> children = ((CdmEntityInfo)parentElement).getChildren();
+            return children.toArray();
+        }
+
+        /* (non-Javadoc)
+         * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
+         */
+        @Override
+        public Object getParent(Object element) {
+            CdmEntityInfo cei = (CdmEntityInfo)element;
+            return cei.getParent();
+        }
+
+        /* (non-Javadoc)
+         * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
+         */
+        @Override
+        public boolean hasChildren(Object element) {
+            List<CdmEntityInfo> children = ((CdmEntityInfo)element).getChildren();
+            if(children != null && !children.isEmpty()) {
+                return true;
+            } else {
+                return false;
+            }
+        }
+
+        public CdmModelFieldPropertyFromClass getFromCdmlibModelCache(String className) {
+            Element e = cdmlibModelCache.get(className);
+            if (e == null) {
+                return null;
+            } else {
+                return (CdmModelFieldPropertyFromClass) e.getObjectValue();
+            }
+        }
+
+    }
+
+    class SessionsTreeLabelProvider extends StyledCellLabelProvider implements ILabelProvider {
+
+        @Override
+        public void update(ViewerCell cell) {
+            CdmEntityInfo cei = (CdmEntityInfo)cell.getElement();
+            StyledString text = new StyledString();
+            if(cei != null) {
+                text.append(cei.getLabel());
+            }
+            cell.setText(text.toString());
+            cell.setStyleRanges(text.getStyleRanges());
+            super.update(cell);
+        }
+
+        /* (non-Javadoc)
+         * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
+         */
+        @Override
+        public Image getImage(Object element) {
+            // TODO Auto-generated method stub
+            return null;
+        }
+
+        /* (non-Javadoc)
+         * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+         */
+        @Override
+        public String getText(Object element) {
+            CdmEntityInfo cei = (CdmEntityInfo)element;
+            return cei.getLabel();
+        }
+    }
+}
+
+
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/sessions/SessionsViewPart.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/sessions/SessionsViewPart.java
new file mode 100644 (file)
index 0000000..9947664
--- /dev/null
@@ -0,0 +1,363 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.view.sessions;
+
+import java.text.DecimalFormat;
+import java.util.Collection;
+
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.CacheManager;
+import net.sf.ehcache.statistics.LiveCacheStatistics;
+
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.part.ViewPart;
+import org.eclipse.wb.swt.SWTResourceManager;
+
+import eu.etaxonomy.cdm.api.cache.CdmCacher;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.remoting.cache.CdmRemoteCacheManager;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManagerObserver;
+import eu.etaxonomy.taxeditor.session.NullSession;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author cmathew
+ * @date 16 Feb 2015
+ *
+ */
+public class SessionsViewPart extends ViewPart implements ICdmEntitySessionManagerObserver {
+
+    public static final String ID = "eu.etaxonomy.taxeditor.view.sessions.SessionsViewPart"; //$NON-NLS-1$
+    public static final String OPEN_INSPECT_SESSIONS_DIALOG_ID =  "eu.etaxonomy.taxeditor.store.open.InspectSessionsDialog";
+    private Table tableSessions;
+
+    private final String[] titles = { "Owner", "In Memory", "On Disk"};
+
+    private final ICdmEntitySessionManager cdmEntitySessionManager;
+    private Text txtNoOfSessions;
+    private Text txtNoOfCaches;
+    private Text txtDefaultInMemory;
+    private Text txtCdmModelInMemory;
+    private Text txtCdmModelOnDisk;
+    private Text txtDefaultOnDisk;
+
+    public SessionsViewPart() {
+        this.cdmEntitySessionManager = CdmStore.getCurrentSessionManager();
+        if(cdmEntitySessionManager != null) {
+            cdmEntitySessionManager.addSessionObserver(this);
+        }
+    }
+
+    /**
+     * Create contents of the view part.
+     * @param parent
+     */
+    @Override
+    public void createPartControl(Composite parent) {
+        Composite container = new Composite(parent, SWT.NONE);
+        container.setLayout(new GridLayout(5, false));
+        {
+            Label lblNoOfSessions = new Label(container, SWT.NONE);
+            lblNoOfSessions.setFont(SWTResourceManager.getFont("Ubuntu", 10, SWT.NORMAL));
+            lblNoOfSessions.setAlignment(SWT.RIGHT);
+            GridData gd_lblNoOfSessions = new GridData(SWT.RIGHT, SWT.FILL, false, false, 1, 1);
+            gd_lblNoOfSessions.widthHint = 115;
+            gd_lblNoOfSessions.minimumHeight = 30;
+            lblNoOfSessions.setLayoutData(gd_lblNoOfSessions);
+            lblNoOfSessions.setText("No. of Sessions : ");
+        }
+        {
+            txtNoOfSessions = new Text(container, SWT.BORDER);
+            txtNoOfSessions.setEditable(false);
+            txtNoOfSessions.setBackground(SWTResourceManager.getColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT));
+            GridData gd_txtNoOfSessions = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+            gd_txtNoOfSessions.widthHint = 50;
+            txtNoOfSessions.setLayoutData(gd_txtNoOfSessions);
+        }
+        new Label(container, SWT.NONE);
+        new Label(container, SWT.NONE);
+        new Label(container, SWT.NONE);
+        {
+            Label lblNoOfCaches = new Label(container, SWT.CENTER);
+            lblNoOfCaches.setAlignment(SWT.RIGHT);
+            lblNoOfCaches.setFont(SWTResourceManager.getFont("Ubuntu", 10, SWT.NORMAL));
+            GridData gd_lblNoOfCaches = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
+            gd_lblNoOfCaches.widthHint = 150;
+            lblNoOfCaches.setLayoutData(gd_lblNoOfCaches);
+            lblNoOfCaches.setText("No. of entity caches : ");
+        }
+        {
+            txtNoOfCaches = new Text(container, SWT.BORDER);
+            txtNoOfCaches.setEditable(false);
+            GridData gd_txtNoOfCaches = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+            gd_txtNoOfCaches.widthHint = 50;
+            txtNoOfCaches.setLayoutData(gd_txtNoOfCaches);
+        }
+        new Label(container, SWT.NONE);
+        new Label(container, SWT.NONE);
+        new Label(container, SWT.NONE);
+
+        {
+            Label lblDefaultCache = new Label(container, SWT.CENTER);
+            lblDefaultCache.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+            lblDefaultCache.setText("Default Cache, ");
+            lblDefaultCache.setFont(SWTResourceManager.getFont("Ubuntu", 10, SWT.NORMAL));
+            lblDefaultCache.setAlignment(SWT.RIGHT);
+        }
+        {
+            Label lblDefaultInMemory = new Label(container, SWT.CENTER);
+            lblDefaultInMemory.setText("in Memory : ");
+            lblDefaultInMemory.setFont(SWTResourceManager.getFont("Ubuntu", 10, SWT.NORMAL));
+            lblDefaultInMemory.setAlignment(SWT.RIGHT);
+            lblDefaultInMemory.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        }
+        {
+            txtDefaultInMemory = new Text(container, SWT.BORDER);
+            txtDefaultInMemory.setEditable(false);
+            GridData gd_txtDefaultInMemory = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+            gd_txtDefaultInMemory.widthHint = 130;
+            txtDefaultInMemory.setLayoutData(gd_txtDefaultInMemory);
+        }
+        {
+            Label lblDefaultOnDisk = new Label(container, SWT.CENTER);
+            lblDefaultOnDisk.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+            lblDefaultOnDisk.setText("on Disk : ");
+            lblDefaultOnDisk.setFont(SWTResourceManager.getFont("Ubuntu", 10, SWT.NORMAL));
+            lblDefaultOnDisk.setAlignment(SWT.RIGHT);
+        }
+        {
+            txtDefaultOnDisk = new Text(container, SWT.BORDER);
+            txtDefaultOnDisk.setEditable(false);
+            txtDefaultOnDisk.setText("");
+            GridData gd_txtDefaultOnDisk = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+            gd_txtDefaultOnDisk.widthHint = 130;
+            txtDefaultOnDisk.setLayoutData(gd_txtDefaultOnDisk);
+        }
+        {
+            Label lblCdmModelCache = new Label(container, SWT.CENTER);
+            lblCdmModelCache.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+            lblCdmModelCache.setText("CDM Model Cache, ");
+            lblCdmModelCache.setFont(SWTResourceManager.getFont("Ubuntu", 10, SWT.NORMAL));
+            lblCdmModelCache.setAlignment(SWT.RIGHT);
+        }
+        {
+            Label lblCdmModelInMemory = new Label(container, SWT.CENTER);
+            lblCdmModelInMemory.setText("in Memory : ");
+            lblCdmModelInMemory.setFont(SWTResourceManager.getFont("Ubuntu", 10, SWT.NORMAL));
+            lblCdmModelInMemory.setAlignment(SWT.RIGHT);
+            GridData gd_lblCdmModelInMemory = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
+            gd_lblCdmModelInMemory.widthHint = 86;
+            lblCdmModelInMemory.setLayoutData(gd_lblCdmModelInMemory);
+        }
+        {
+            txtCdmModelInMemory = new Text(container, SWT.BORDER);
+            txtCdmModelInMemory.setEditable(false);
+            GridData gd_txtCdmModelInMemory = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+            gd_txtCdmModelInMemory.widthHint = 130;
+            txtCdmModelInMemory.setLayoutData(gd_txtCdmModelInMemory);
+        }
+        {
+            Label lblCdmModelOnDisk = new Label(container, SWT.CENTER);
+            lblCdmModelOnDisk.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+            lblCdmModelOnDisk.setText("on Disk : ");
+            lblCdmModelOnDisk.setFont(SWTResourceManager.getFont("Ubuntu", 10, SWT.NORMAL));
+            lblCdmModelOnDisk.setAlignment(SWT.RIGHT);
+        }
+        {
+            txtCdmModelOnDisk = new Text(container, SWT.BORDER);
+            txtCdmModelOnDisk.setEditable(false);
+            txtCdmModelOnDisk.setText("");
+            GridData gd_txtCdmModelOnDisk = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+            gd_txtCdmModelOnDisk.widthHint = 130;
+            txtCdmModelOnDisk.setLayoutData(gd_txtCdmModelOnDisk);
+        }
+        {
+            Button btnRefresh = new Button(container, SWT.NONE);
+            btnRefresh.addSelectionListener(new SelectionAdapter() {
+                @Override
+                public void widgetSelected(SelectionEvent e) {
+                    changed();
+                }
+            });
+            GridData gd_btnRefresh = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
+            gd_btnRefresh.widthHint = 100;
+            btnRefresh.setLayoutData(gd_btnRefresh);
+            btnRefresh.setText("Refresh");
+        }
+        {
+            Button btnInspectActiveSession = new Button(container, SWT.NONE);
+            btnInspectActiveSession.addSelectionListener(new SelectionAdapter() {
+                @Override
+                public void widgetSelected(SelectionEvent e) {
+                    AbstractUtility.executeCommand(OPEN_INSPECT_SESSIONS_DIALOG_ID, this, null);
+                }
+            });
+            btnInspectActiveSession.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 2, 1));
+            btnInspectActiveSession.setText("Inspect Active Session");
+        }
+        new Label(container, SWT.NONE);
+        new Label(container, SWT.NONE);
+
+        {
+            tableSessions = new Table(container, SWT.BORDER | SWT.FULL_SELECTION);
+            GridData gd_tableSessions = new GridData(SWT.FILL, SWT.FILL, true, true, 5, 1);
+            gd_tableSessions.widthHint = 769;
+            tableSessions.setLayoutData(gd_tableSessions);
+            tableSessions.setHeaderVisible(true);
+            tableSessions.setLinesVisible(true);
+        }
+
+        createActions();
+        initializeToolBar();
+        initializeMenu();
+    }
+
+    /**
+     * Create the actions.
+     */
+    private void createActions() {
+
+
+        for (String title : titles) {
+            TableColumn column = new TableColumn(tableSessions, SWT.NULL);
+            column.setWidth(200);
+            column.setText(title);
+        }
+        changed();
+
+    }
+
+
+    @Override
+    public void changed() {
+        if(tableSessions.isDisposed()) {
+            return;
+        }
+        tableSessions.removeAll();
+        if(cdmEntitySessionManager != null) {
+            Collection<ICdmEntitySession> sessions = cdmEntitySessionManager.getSessions();
+            txtNoOfSessions.setText(String.valueOf(sessions.size()));
+            for(ICdmEntitySession session : sessions) {
+                addSession(session);
+            }
+            ICdmEntitySession nullSession = cdmEntitySessionManager.getNullSession();
+            if(nullSession != null) {
+                addSession(nullSession);
+            }
+            for (int i=0; i<titles.length; i++) {
+                tableSessions.getColumn (i).pack ();
+            }
+        }
+
+        CdmRemoteCacheManager instance = CdmRemoteCacheManager.getInstance();
+        int cdmEnityCacheSize = CacheManager.create().getCacheNames().length;
+        txtNoOfCaches.setText(String.valueOf(cdmEnityCacheSize));
+
+        Cache defaultCache = CacheManager.create().getCache(CdmCacher.DEFAULT_CACHE_NAME);
+        txtDefaultInMemory.setText("");
+        txtDefaultOnDisk.setText("");
+        if(defaultCache != null) {
+            LiveCacheStatistics liveCacheStatistics = defaultCache.getLiveCacheStatistics();
+            txtDefaultInMemory.setText(getInMemoryStats(liveCacheStatistics));
+            txtDefaultOnDisk.setText(getOnDiskStats(liveCacheStatistics));
+        }
+
+        Cache cdmModelGetMethodsCache = instance.getCdmModelGetMethodsCache();
+        txtCdmModelInMemory.setText("");
+        txtCdmModelOnDisk.setText("");
+        if(cdmModelGetMethodsCache != null) {
+            LiveCacheStatistics liveCacheStatistics = cdmModelGetMethodsCache.getLiveCacheStatistics();
+            txtCdmModelInMemory.setText(getInMemoryStats(liveCacheStatistics));
+            txtCdmModelOnDisk.setText(getOnDiskStats(liveCacheStatistics));
+        }
+
+    }
+
+    private void addSession(ICdmEntitySession session) {
+
+        TableItem item = new TableItem(tableSessions, SWT.NULL);
+
+        String activePrefix = "";
+        if(session.isActive()) {
+            activePrefix = "*";
+        }
+        String sessionOwnerString = "";
+        if(session instanceof NullSession) {
+            sessionOwnerString = "Null Session";
+        } else {
+            if(session.getOwner() != null) {
+                sessionOwnerString = session.getOwner().toString();
+            }
+        }
+        item.setText(0, activePrefix + sessionOwnerString);
+        LiveCacheStatistics cacheStatistics = session.getCacheStatistics();
+        item.setText(1, getInMemoryStats(cacheStatistics));
+        item.setText(2, getOnDiskStats(cacheStatistics));
+    }
+
+    private String getInMemoryStats(LiveCacheStatistics statistics) {
+        if(statistics != null) {
+            long localHeapSize = statistics.getLocalHeapSize();
+
+            long localHeapSizeInBytes = statistics.getLocalHeapSizeInBytes();
+            String localHeapSizeInBytesStr =
+                    (new DecimalFormat("#.##")).format(localHeapSizeInBytes/1048576.0);
+            return String.valueOf(localHeapSize) + " objects / " + localHeapSizeInBytesStr + " Mb";
+        }
+        return "";
+    }
+
+    private String getOnDiskStats(LiveCacheStatistics statistics) {
+        if(statistics != null) {
+            long localDiskSize = statistics.getLocalDiskSize();
+
+            long localDiskSizeInBytes = statistics.getLocalDiskSizeInBytes();
+            String localDiskSizeInBytesStr =
+                    (new DecimalFormat("#.##")).format(localDiskSizeInBytes/1048576.0);
+            return String.valueOf(localDiskSize) + " objects / " + localDiskSizeInBytesStr + " Mb";
+        }
+        return "";
+    }
+
+    /**
+     * Initialize the toolbar.
+     */
+    private void initializeToolBar() {
+        IToolBarManager toolbarManager = getViewSite().getActionBars().getToolBarManager();
+    }
+
+    /**
+     * Initialize the menu.
+     */
+    private void initializeMenu() {
+        IMenuManager menuManager = getViewSite().getActionBars().getMenuManager();
+    }
+
+    @Override
+    public void setFocus() {
+        // Set the focus
+    }
+
+}
index e11d053243353024fb75d2553ecdf44d767c6193..984c3c6f206199c1cc44e0afb2b28bdc8adff4e4 100644 (file)
@@ -123,6 +123,4 @@ public class SupplementalDataViewPart extends AbstractCdmEditorViewPart {
                // TODO Auto-generated method stub
                return false;
        }
-
-
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/resources/log4j.properties b/eu.etaxonomy.taxeditor.store/src/main/resources/log4j.properties
deleted file mode 100644 (file)
index 0c30678..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-### ************ APPENDER ***********************************###
-
-### direct log messages to stdout ###
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
-
-### direct messages to file hibernate.log ###
-log4j.appender.file=org.apache.log4j.FileAppender
-log4j.appender.file.File=taxeditor.log
-log4j.appender.file.layout=org.apache.log4j.PatternLayout
-log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
-
-### ************* LOG LEVELS *********************************###
-
-### set log levels - for more verbose logging change 'info' to 'debug' ###
-### levels: error, warn, debug, info
-log4j.rootLogger=INFO, stdout
-
-### set directory-specific levels below
-
-### basic level for editor directory
-log4j.logger.eu.etaxonomy.taxeditor = WARN, stdout 
-
-log4j.logger.eu.etaxonomy.taxeditor.store = DEBUG, stdout
-
-### log level for conversation handler
-#log4j.logger.eu.etaxonomy.cdm.api.application = DEBUG, stdout
index 0bef7f3e843bd7ff8e6f4341284f069a8d0523d4..8e6ea37042e3beb3d7c0b50b2eada98879ca17f4 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -17,6 +17,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 
 /**
  * @author n.hoffmann
@@ -24,13 +25,14 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
  * @version 1.0
  */
 public abstract class AbstractTaxeditorOperationTestBase {
-       
+
        public static final IUndoContext undoContext = null;
-       
+
        public static final IProgressMonitor monitor = null;
-       public static final IAdaptable info = null;     
+       public static final IAdaptable info = null;
        public static final IPostOperationEnabled postOperation = null;
-       
+       public static final ICdmEntitySessionEnabled cdmEntitySessionEnabled = null;
+
        protected static AbstractPostOperation operation;
        protected static Taxon taxon;
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/test/java/eu/etaxonomy/taxeditor/store/operations/RemotingTestUpdateOperation.java b/eu.etaxonomy.taxeditor.store/src/test/java/eu/etaxonomy/taxeditor/store/operations/RemotingTestUpdateOperation.java
new file mode 100644 (file)
index 0000000..727460c
--- /dev/null
@@ -0,0 +1,79 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.store.operations;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
+import eu.etaxonomy.cdm.api.service.ITestService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.api.service.dto.CdmEntityIdentifier;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
+
+/**
+ * @author cmathew
+ * @date 26 Jun 2015
+ *
+ */
+public class RemotingTestUpdateOperation extends RemotingCdmUpdateOperation {
+
+    private static String LABEL = "Test Operation";
+
+    private UpdateResult result;
+    private Exception exception;
+    private CdmEntityIdentifier cei;
+
+
+    /**
+     * @param label
+     * @param action
+     * @param source
+     * @param async
+     */
+    public RemotingTestUpdateOperation(UpdateResult result,
+            Object source,
+            boolean async) {
+        super(LABEL, Action.Update, source, async);
+        this.result = result;
+    }
+
+    public RemotingTestUpdateOperation(Exception exception,
+            Object source,
+            boolean async) {
+        super(LABEL, Action.Update, source, async);
+        this.exception = exception;
+    }
+
+    public RemotingTestUpdateOperation(CdmEntityIdentifier cei,
+            Object source,
+            boolean async) {
+        super(LABEL, Action.Update, source, async);
+        this.cei = cei;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+     */
+    @Override
+    protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
+        ITestService testService = CdmApplicationState.getTestService();
+        if(result != null) {
+            return testService.returnResult(result);
+        } else if(exception != null) {
+            return testService.throwException(exception);
+        } else if(cei != null) {
+            return testService.addChild(cei);
+        }
+        return null;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/test/resources/log4j.properties b/eu.etaxonomy.taxeditor.store/src/test/resources/log4j.properties
deleted file mode 100644 (file)
index e083605..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-### ************ APPENDER ***********************************###
-
-### direct log messages to stdout ###
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
-
-### direct messages to file hibernate.log ###
-log4j.appender.file=org.apache.log4j.FileAppender
-log4j.appender.file.File=hibernate.log
-log4j.appender.file.layout=org.apache.log4j.PatternLayout
-log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
-
-
-### ************* LOG LEVELS *********************************###
-
-### set log levels - for more verbose logging change 'info' to 'debug' ###
-
-log4j.rootLogger=info, stdout, file
-
-       ### *** CDM *** ###
-
-log4j.logger.eu.etaxonomy.cdm = info
-log4j.logger.eu.etaxonomy.cdm.database.init = warn
-#
-log4j.logger.eu.etaxonomy.cdm.model.common.init = warn
-#
-log4j.logger.eu.etaxonomy.cdm.test.integration = info
-log4j.logger.eu.etaxonomy.cdm.api.application = warn
-log4j.logger.eu.etaxonomy.cdm.api.service = info
-#log4j.logger.eu.etaxonomy.cdm.database.VocabularyStoreImpl = warn
-#
-log4j.logger.eu.etaxonomy.cdm.database = warn
-log4j.logger.eu.etaxonomy.cdm.persistence.dao.hibernate.common = warn
-               
-
-
-       ### *** SPRING ************ ###
-log4j.logger.org.springframework.transaction = warn
-log4j.logger.org.hibernate.engine.LoadContexts = warn
-log4j.logger.org.springframework.orm.hibernate3.SessionFactoryUtils = warn
-log4j.logger.org.springframework.orm.hibernate3 = warn
-log4j.logger.org.springframework.FileSystemXmlApplicationContext = warn;
-log4j.logger.org.springframework.core.io.support = warn
-
-
-       ### ***HIBERNATE ************ ###
-
-log4j.logger.org.hibernate=warn
-
-### No warnings as thrown by SQLServer
-###log4j.logger.org.hibernate.cfg = warn
-
-### No warnings as thrown by SQLServer
-log4j.logger.org.hibernate.util.JDBCExceptionReporter = error
-
-### log HQL query parser activity
-#log4j.logger.org.hibernate.hql.ast.AST=debug
-
-### log just the SQL
-log4j.logger.org.hibernate.SQL=warn
-
-### log JDBC bind parameters ###
-log4j.logger.org.hibernate.type=warn
-
-### log schema export/update ###
-log4j.logger.org.hibernate.tool.hbm2ddl=warn
-
-### log HQL parse trees
-log4j.logger.org.hibernate.hql=debug
-log4j.logger.org.hibernate.hql.ast=warn
-
-### log cache activity ###
-#log4j.logger.org.hibernate.cache=debug
-
-### log transaction activity
-#log4j.logger.org.hibernate.transaction=debug
-
-### log JDBC resource acquisition
-log4j.logger.org.hibernate.jdbc=info
-
-### enable the following line if you want to track down connection ###
-### leakages when using DriverManagerConnectionProvider ###
-#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace
-
-
-   ### *** Profiling Logger ************ ###
-   
-#log4j.logger.org.springframework.aop.interceptor.PerformanceMonitorInterceptor=TRACE, profiling
-### Profiling output
-#log4j.appender.profiling=org.apache.log4j.RollingFileAppender
-#log4j.appender.profiling.File=profiling.log
-#log4j.appender.profiling.MaxFileSize=1024KB
-#log4j.appender.profiling.MaxBackupIndex=1
-#log4j.appender.profiling.layout=org.apache.log4j.PatternLayout
-#log4j.appender.profiling.layout.conversionPattern=%d,%p,%m%n
-
index 12d3a7cdd6d733338f1e108848d412f566620e95..cc0f994d1617e10c8c17f9f6f645df7094d76a52 100644 (file)
@@ -1,8 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-       <classpathentry kind="src" path="src/test/java"/>
-       <classpathentry kind="src" path="src/main/resources"/>
+       <classpathentry including="**/*.java" kind="src" path="src/test/java"/>
+       <classpathentry excluding="**/*.java" kind="src" path="src/test/resources"/>
+       <classpathentry exported="true" kind="lib" path="lib/byte-buddy-0.5.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.context-3.2.2.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/unitils-core-3.4.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/unitils-database-3.4.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/unitils-dbmaintainer-3.4.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/unitils-dbunit-3.4.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/unitils-spring-3.4.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/dbunit-2.4.9.jar"/>
        <classpathentry kind="output" path="target/classes"/>
 </classpath>
index ef718ade6b0c7f00647ffb2b6e4f424464b39af6..e6a059049f4b543619e656d42155314bdc99824a 100644 (file)
@@ -1,28 +1,14 @@
-<?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-       <name>eu.etaxonomy.taxeditor.test</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.ManifestBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.SchemaBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.pde.PluginNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
+  <name>eu.etaxonomy.taxeditor.test</name>
+  <comment>Holds all UI tests for the Taxonomic Editor. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+    <nature>org.eclipse.pde.PluginNature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file
index e392ea141b999f93e258045433f826bbc6ca0b3b..f42de363afaae68bbd968318f1d331877f5514fc 100644 (file)
@@ -1,8 +1,7 @@
-#Wed Oct 05 13:31:15 CEST 2011
 eclipse.preferences.version=1
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.7
index dd55c822551cf19c70da92cb4b1f3e0c86ff48c9..ee9da7f5ab9f87309256a09b5e4cbb162b142045 100644 (file)
@@ -2,23 +2,34 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: eu.etaxonomy.taxeditor.test
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.test;singleton:=true
-Bundle-Version: 3.6.1.qualifier
+Bundle-Version: 4.0.0.qualifier
 Bundle-ActivationPolicy: lazy
 Bundle-Vendor: EDIT
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Require-Bundle: org.apache.log4j,
- org.eclipse.ui,
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
- org.eclipse.swtbot.eclipse.core,
- org.eclipse.swtbot.eclipse.finder,
- org.eclipse.swtbot.junit4_x,
  org.eclipse.ui.ide,
eu.etaxonomy.taxeditor.application,
- eu.etaxonomy.taxeditor.bulkeditor,
org.junit;bundle-version="4.8.2",
+ eu.etaxonomy.taxeditor.webapp,
  eu.etaxonomy.taxeditor.cdmlib,
+ eu.etaxonomy.taxeditor.bulkeditor,
  eu.etaxonomy.taxeditor.editor,
  eu.etaxonomy.taxeditor.help,
  eu.etaxonomy.taxeditor.navigation,
  eu.etaxonomy.taxeditor.printpublisher,
- eu.etaxonomy.taxeditor.store
-Eclipse-RegisterBuddy: org.apache.log4j
+ eu.etaxonomy.taxeditor.store,
+ org.apache.log4j,
+ org.hamcrest,
+ org.eclipse.swtbot.eclipse.core,
+ org.eclipse.swtbot.eclipse.finder,
+ eu.etaxonomy.taxeditor.webapp;bundle-version="3.13.0"
+Eclipse-RegisterBuddy: org.apache.log4j, org.eclipse.swtbot.swt.finder
+Bundle-ClassPath: .,
+ lib/byte-buddy-0.5.1.jar,
+ lib/org.springframework.context-3.2.2.RELEASE.jar,
+ lib/unitils-core-3.4.2.jar,
+ lib/unitils-database-3.4.2.jar,
+ lib/unitils-dbmaintainer-3.4.2.jar,
+ lib/unitils-dbunit-3.4.2.jar,
+ lib/unitils-spring-3.4.2.jar,
+ lib/dbunit-2.4.9.jar
index 137d6a59ccc7ed4073b31469643cef499bfe3f0a..4c13ab916d9839335483e9c9a32e81deebf28172 100644 (file)
@@ -1,3 +1,14 @@
-source.. = src/test/java/
+source.. = src/test/java/,\
+           src/test/resources/
 bin.includes = META-INF/,\
-               .
+               .,\
+               lib/byte-buddy-0.5.1.jar,\
+               lib/org.springframework.context-3.2.2.RELEASE.jar,\
+               lib/unitils-core-3.4.2.jar,\
+               lib/unitils-database-3.4.2.jar,\
+               lib/unitils-dbmaintainer-3.4.2.jar,\
+               lib/unitils-dbunit-3.4.2.jar,\
+               lib/unitils-spring-3.4.2.jar,\
+               lib/dbunit-2.4.9.jar,\               
+               src/test/resources/
+output.. = target/classes
diff --git a/eu.etaxonomy.taxeditor.test/lib/byte-buddy-0.5.1.jar b/eu.etaxonomy.taxeditor.test/lib/byte-buddy-0.5.1.jar
new file mode 100644 (file)
index 0000000..2b1447a
Binary files /dev/null and b/eu.etaxonomy.taxeditor.test/lib/byte-buddy-0.5.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.test/lib/dbunit-2.4.9.jar b/eu.etaxonomy.taxeditor.test/lib/dbunit-2.4.9.jar
new file mode 100644 (file)
index 0000000..130921b
Binary files /dev/null and b/eu.etaxonomy.taxeditor.test/lib/dbunit-2.4.9.jar differ
diff --git a/eu.etaxonomy.taxeditor.test/lib/unitils-core-3.4.2.jar b/eu.etaxonomy.taxeditor.test/lib/unitils-core-3.4.2.jar
new file mode 100644 (file)
index 0000000..ab4c22e
Binary files /dev/null and b/eu.etaxonomy.taxeditor.test/lib/unitils-core-3.4.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.test/lib/unitils-database-3.4.2.jar b/eu.etaxonomy.taxeditor.test/lib/unitils-database-3.4.2.jar
new file mode 100644 (file)
index 0000000..dfcb6ae
Binary files /dev/null and b/eu.etaxonomy.taxeditor.test/lib/unitils-database-3.4.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.test/lib/unitils-dbmaintainer-3.4.2.jar b/eu.etaxonomy.taxeditor.test/lib/unitils-dbmaintainer-3.4.2.jar
new file mode 100644 (file)
index 0000000..01f8994
Binary files /dev/null and b/eu.etaxonomy.taxeditor.test/lib/unitils-dbmaintainer-3.4.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.test/lib/unitils-dbunit-3.4.2.jar b/eu.etaxonomy.taxeditor.test/lib/unitils-dbunit-3.4.2.jar
new file mode 100644 (file)
index 0000000..778274e
Binary files /dev/null and b/eu.etaxonomy.taxeditor.test/lib/unitils-dbunit-3.4.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.test/lib/unitils-spring-3.4.2.jar b/eu.etaxonomy.taxeditor.test/lib/unitils-spring-3.4.2.jar
new file mode 100644 (file)
index 0000000..f30810b
Binary files /dev/null and b/eu.etaxonomy.taxeditor.test/lib/unitils-spring-3.4.2.jar differ
index 2fdee3be14e73bed09e76914a8c237047b16dcce..bd42c10cb61f76af2809f11e6624cd075814ae99 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project>\r
-\r
-       <parent>\r
-               <groupId>eu.etaxonomy</groupId>\r
-               <artifactId>taxeditor-parent</artifactId>\r
-               <version>3.4.0-SNAPSHOT</version>\r
-       </parent>\r
-       <modelVersion>4.0.0</modelVersion>\r
-       <artifactId>eu.etaxonomy.taxeditor.test</artifactId>\r
-       <packaging>eclipse-test-plugin</packaging>\r
-       <name>UI Test Bundle</name>\r
-       <description>Holds all UI tests for the Taxonomic Editor</description>\r
-       <!-- <repositories> -->\r
-       <!-- <repository> -->\r
-       <!-- <id>ganymede</id> -->\r
-       <!-- <layout>p2</layout> -->\r
-       <!-- <url>http://download.eclipse.org/releases/galileo</url> -->\r
-       <!-- </repository> -->\r
-       <!-- <repository> -->\r
-       <!-- <id>swtbot</id> -->\r
-       <!-- <layout>p2</layout> -->\r
-       <!-- <url>http://download.eclipse.org/technology/swtbot/galileo/dev-build/update-site</url> -->\r
-       <!-- </repository> -->\r
-       <!-- </repositories> -->\r
-\r
-       <build>\r
-               <plugins>\r
-                       <plugin>\r
-                               <groupId>org.eclipse.tycho</groupId>\r
-                               <artifactId>tycho-maven-plugin</artifactId>\r
-                               <version>${tycho.version}</version>\r
-                               <extensions>true</extensions>\r
-                       </plugin>\r
-                       <plugin>\r
-                               <groupId>org.eclipse.tycho</groupId>\r
-                               <artifactId>target-platform-configuration</artifactId>\r
-                               <version>${tycho.version}</version>\r
-                               <configuration>\r
-                                       <resolver>p2</resolver>\r
-                               </configuration>\r
-                       </plugin>\r
-                       <plugin>\r
-                               <groupId>org.eclipse.tycho</groupId>\r
-                               <artifactId>tycho-surefire-plugin</artifactId>\r
-                               <version>${tycho.version}</version>\r
-                               <configuration>\r
-                                       <useUIHarness>true</useUIHarness>\r
-                                       <useUIThread>false</useUIThread>\r
-                                       <includes>\r
-                                               <include>**/*Test.java</include>\r
-                                       </includes>\r
-                                       <product>eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product</product>\r
-                       <application>eu.etaxonomy.taxeditor.application.application</application>\r
-                                       <!-- <dependency>
-                                               <type>p2-installable-unit</type>
-                                               <artifactId>eu.etaxonomy.taxeditor.product</artifactId>
-                                               <version>0.0.0</version>
-                                       </dependency> -->\r
-                               </configuration>\r
-                       </plugin>\r
-                       <!-- <plugin>
-                       <groupId>org.eclipse.tycho</groupId>
-                       <artifactId>maven-osgi-test-plugin</artifactId>
-                       <version>${tycho.version}</version>
-                       <configuration>
-                       <useUIHarness>true</useUIHarness>
-                       <useUIThread>false</useUIThread>
-                       <product>eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product</product>
-                       <application>org.eclipse.ui.ide.workbench</application>
-                       <dependencies>
-                       <dependency>
-                       <type>p2-installable-unit</type>
-                       <artifactId>eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product</artifactId>
-                       <version>0.0.0</version>
-                       </dependency>
-                       </dependencies>
-                       </configuration>
-                       </plugin> -->\r
-               </plugins>\r
-       </build>\r
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>eu.etaxonomy</groupId>
+    <artifactId>taxeditor-parent</artifactId>
+    <version>4.0.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>eu.etaxonomy.taxeditor.test</artifactId>
+  <packaging>eclipse-test-plugin</packaging>
+  <name>UI Test Bundle</name>
+  <description>Holds all Tests for the Taxonomic Editor</description>
+  <build>
+  <resources>
+      <resource>
+        <!-- replace the place holders like ${...} in datasources.xml -->
+        <filtering>true</filtering>
+        <directory>src/test/resources</directory>
+        <targetPath>../test-classes</targetPath>
+        <includes>
+          <include>datasources.xml</include>
+        </includes>
+      </resource>
+      <resource>
+        <!-- all other test resources without filtering -->
+        <directory>src/test/resources</directory>
+        <targetPath>../test-classes</targetPath>
+        <excludes>
+          <exclude>datasources.xml</exclude>
+        </excludes>
+      </resource>
+      <resource>
+        <!-- all main resources without filtering -->
+        <directory>src/main/resources</directory>
+      </resource>
+    </resources>
+    <plugins>
+      <plugin>
+        <groupId>org.eclipse.tycho</groupId>
+        <artifactId>target-platform-configuration</artifactId>
+        <version>${tycho.version}</version>
+        <configuration>
+          <filters>
+            <!-- Work around for https://bugs.eclipse.org/bugs/show_bug.cgi?id=348045 -->
+            <!-- taken from https://wiki.eclipse.org/index.php?title=Tycho/Target_Platform#Filtering -->
+            <filter>
+              <type>p2-installable-unit</type>
+              <id>org.eclipse.equinox.servletbridge.extensionbundle</id>
+              <removeAll />
+            </filter>
+          </filters>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.eclipse.tycho</groupId>
+        <artifactId>tycho-surefire-plugin</artifactId>
+        <version>${tycho.version}</version>
+        <configuration>
+          <!-- currently we run only the non-ui unit tests so we don't the 
+            harness -->
+          <!-- <useUIHarness>true</useUIHarness> -->
+          <dependencies>
+            <!-- This will pull the feature and its dependent plugins into 
+              the classpath for the tests. Note that this requires ALL taxeditor projects 
+              to be installed. -->
+            <dependency>
+              <type>eclipse-feature</type>
+              <artifactId>eu.etaxonomy.taxeditor.feature</artifactId>
+              <!-- This is the minimum required version -->
+              <version>1.0.0</version>
+            </dependency>
+          </dependencies>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.eclipse.jetty</groupId>
+        <artifactId>jetty-maven-plugin</artifactId>
+        <version>9.1.3.v20140225</version><!-- do not update, since later versions are no longer compatible to java 7  -->
+        <!-- 
+            To see the detailed list of parameters that can be configured for a particular goal:
+            mvn jetty:help -Ddetail=true -Dgoal= goal-name
+         -->
+        <configuration>
+          <systemProperties>
+            <force>true</force>
+            <systemProperty>
+              <name>cdm.datasource</name>
+              <value>cdmTest</value>
+            </systemProperty>
+            <systemProperty>
+              <!-- 
+                The lucene index should be placed into the target folder,
+                so user.home needs to be set to this folder.
+                user.home needs to be overridden since it already 
+                exists, thus the force option is turned on above 
+              -->
+              <name>user.home</name>
+              <value>${basedir}/target/</value>
+            </systemProperty> 
+            <systemProperty>
+              <name>spring.profiles.active</name>
+              <value>remoting</value>
+            </systemProperty>
+            <systemProperty>
+              <name>cdm.beanDefinitionFile</name>
+              <value>${basedir}/target/test-classes/datasources.xml</value>
+            </systemProperty>
+          </systemProperties>
+          <stopPort>9191</stopPort>
+          <stopKey>jetty-cdm-server</stopKey>
+          <stopWait>10</stopWait>
+          <httpConnector>
+            <port>9090</port>
+          </httpConnector>
+      <!-- 
+        ${project.parent.basedir} can not be used due to the bug
+        https://issues.apache.org/jira/browse/MNG-5522 
+        as long as this is unfixed we replace it by 
+        ${basedir}/../
+      -->
+          <war>${basedir}/../eu.etaxonomy.taxeditor.cdmlib/src/main/resources/etc/jetty/cdmlib-remote-webapp.war</war>
+          <daemon>true</daemon>
+        </configuration>
+        <dependencies>
+            <dependency>
+            <groupId>com.mchange</groupId>
+            <artifactId>c3p0</artifactId>
+            <!-- 
+              IMPORTANT!!!
+              this must exactly match the version as set in 
+              cdmlib-parent pom.xml
+            -->
+            <version>0.9.5.2</version>
+          </dependency>
+          <!-- DATABASE DRIVER -->
+          <dependency>
+            <groupId>com.h2database</groupId>
+            <artifactId>h2</artifactId>
+            <version>1.4.190</version>
+          </dependency>
+          <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>5.1.38</version>
+          </dependency>
+          <dependency>
+              <groupId>commons-dbcp</groupId>
+              <artifactId>commons-dbcp</artifactId>
+              <version>1.4</version>
+          </dependency>
+<!--           <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>1.2.17</version>
+          </dependency> -->
+          <!--  
+          <dependency>
+            <groupId>eu.etaxonomy</groupId>
+            <artifactId>cdmlib-persistence</artifactId>
+            <version>${project.version}</version>
+            <exclusions>
+            </exclusions>
+          </dependency>
+          -->
+        </dependencies>
+        <executions>
+          <execution>
+            <id>start-jetty</id>
+            <phase>pre-integration-test</phase>
+            <goals>
+              <goal>deploy-war</goal>
+            </goals>
+            <configuration>
+              <scanIntervalSeconds>0</scanIntervalSeconds>
+            </configuration>
+          </execution>
+          <execution>
+            <id>stop-jetty</id>
+            <phase>post-integration-test</phase>
+            <goals>
+              <goal>stop</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
 </project>
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.test/src/main/resources/log4j.xml b/eu.etaxonomy.taxeditor.test/src/main/resources/log4j.xml
deleted file mode 100644 (file)
index ea16d13..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
-       debug="false">
-
-       <appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender">
-               <param name="Target" value="System.out" />
-               <layout class="org.apache.log4j.PatternLayout">
-                       <param name="ConversionPattern"
-                               value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
-               </layout>
-       </appender>
-
-       <appender name="fileAppender" class="org.apache.log4j.FileAppender">
-               <param name="File" value="/tmp/debug.log" />
-               <param name="Append" value="false" />
-               <layout class="org.apache.log4j.PatternLayout">
-                       <param name="ConversionPattern"
-                               value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
-               </layout>
-       </appender>
-
-       <appender name="asyncAppender" class="org.apache.log4j.AsyncAppender">
-               <!-- appender-ref ref="consoleAppender" / -->
-               <appender-ref ref="fileAppender" />
-       </appender>
-
-       <!-- don't log matchers, this is very high amount of chatter -->
-       <category name="org.eclipse.swtbot.swt.finder.matchers">
-               <priority value="OFF" />
-       </category>
-
-       <!--
-               don't log widget notification events, this is moderately high chatter
-       -->
-       <category name="org.eclipse.swtbot.swt.finder.widgets">
-               <priority value="OFF" />
-       </category>
-
-       <!-- don't log finders, this is moderate chatter -->
-       <category name="org.eclipse.swtbot.swt.finder.finders">
-               <priority value="DEBUG" />
-       </category>
-
-       <category name="org.eclipse.swtbot.swt.finder.keyboard">
-               <!-- set to a value higher than debug to turn on. -->
-               <priority value="DEBUG" />
-       </category>
-
-       <category name="org.eclipse.swtbot">
-               <priority value="ALL" />
-       </category>
-
-       <root>
-               <priority value="INFO" />
-               <appender-ref ref="consoleAppender" />
-               <appender-ref ref="fileAppender" />
-       </root>
-
-</log4j:configuration>
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/api/cache/CdmClientCachingTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/api/cache/CdmClientCachingTest.java
new file mode 100644 (file)
index 0000000..db2f094
--- /dev/null
@@ -0,0 +1,415 @@
+// $Id$
+/**
+* Copyright (C) 2014 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.api.cache;
+
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.unitils.dbunit.annotation.DataSet;
+
+import eu.etaxonomy.cdm.api.service.ICommonService;
+import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService;
+import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.LanguageString;
+import eu.etaxonomy.cdm.model.description.KeyStatement;
+import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
+import eu.etaxonomy.taxeditor.httpinvoker.RemotingSessionAwareTest;
+import eu.etaxonomy.taxeditor.remoting.cache.CdmTransientEntityCacher;
+
+/**
+ * @author cmathew
+ * @date 7 Oct 2014
+ *
+ */
+@DataSet
+public class CdmClientCachingTest extends RemotingSessionAwareTest {
+
+    private static final Logger logger = Logger.getLogger(CdmClientCachingTest.class);
+
+    private final UUID polytomousKeyUuid = UUID.fromString("0d53ba20-7de4-4baa-bd8a-401048447d66");
+    private final UUID taxon1Uuid = UUID.fromString("2b336df7-29e8-4f79-985f-66502739d22f");
+    private final UUID polytomousKeyNodeUuid1 = UUID.fromString("75e4c924-ff58-4ee7-a59d-fd9173517d08");
+    private final UUID polytomousKeyNodeUuid2 = UUID.fromString("b775c027-13c0-4b87-8aa9-712faeaafbdc");
+
+
+    private final IPolytomousKeyService polytomousKeyService = getRemoteApplicationController().getPolytomousKeyService();
+    private final IPolytomousKeyNodeService polytomousKeyNodeService = getRemoteApplicationController().getPolytomousKeyNodeService();
+    private final ICommonService commonService = getRemoteApplicationController().getCommonService();
+    private final ITaxonService taxonService = getRemoteApplicationController().getTaxonService();
+
+
+    private static final List<String> PKEY_DEPTH1_INIT_STRATEGY = Arrays.asList(new String[] {
+                       });
+
+    private static final List<String> PKEY_DEPTH2_INIT_STRATEGY = Arrays.asList(new String[] {
+               "root"});
+
+    private static final List<String> PKEY_DEPTH3_INIT_STRATEGY = Arrays.asList(new String[] {
+               "root.statement"});
+
+
+    @BeforeClass
+    public static void initializePolytomousKeyTest() {
+
+    }
+
+
+
+
+    @Test
+    public void recursiveLoadSubGraphDepth1Test() {
+
+       // this call will load into the session cache the graph
+       // polytomous key
+       //      |- root : polytomous key node
+       // in a recursive call
+        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY),PolytomousKey.class);
+
+        // checking to make sure the root object is in the session cache
+        Assert.assertSame(CdmBase.deproxy(pkey1.getRoot(),PolytomousKeyNode.class), cacher.getFromCache(pkey1.getRoot()));
+
+    }
+
+
+    @Test
+    public void recursiveLoadSubGraphDepth2Test() {
+
+       // this call will load into the session cache the graph
+       // polytomous key
+       //      |- root : polytomous key node
+       //              |- question : KeyStatement
+       //              |- statement : KeyStatement
+       // in a recursive call
+        PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+        CdmTransientEntityCacher cacher = getCacher(sessionOwner);
+        // checking to make sure the root object is in the session cache
+        Assert.assertSame(CdmBase.deproxy(pkey.getRoot(),PolytomousKeyNode.class), cacher.getFromCache(pkey.getRoot()));
+        Assert.assertSame(CdmBase.deproxy(pkey.getRoot().getStatement(),KeyStatement.class), cacher.getFromCache(pkey.getRoot().getStatement()));
+        Assert.assertSame(CdmBase.deproxy(pkey.getRoot().getQuestion(),KeyStatement.class), cacher.getFromCache(pkey.getRoot().getQuestion()));
+
+    }
+
+    /**
+     * when : retrieving objects using recursive caching of object graphs with different depths
+     * then : the objects in the sub-graph having the same persistence id should be the same
+     */
+    @Test
+    public void lazyLoadRecursiveTest() {
+
+       // this call will load into the session cache the graph and update the objects in the sub-graph for a
+       // polytomous key
+       //      |- root : polytomous key node
+       //              |- question : KeyStatement
+       //              |- statement : KeyStatement
+        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+
+        CdmTransientEntityCacher cacher = getCacher(sessionOwner);
+
+    }
+
+
+    /**
+     * when : retrieving objects using recursive caching of object graphs with different depths
+     * then : the objects in the sub-graph having the same persistence id should be the same
+     */
+    @Test
+    public void differentSubGraphDepthTest1() {
+
+       // this call will load into the session cache the graph and update the objects in the sub-graph for a
+       // polytomous key
+       //      |- root : polytomous key node
+       // in a recursive call
+        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY),PolytomousKey.class);
+        KeyStatement ks1 = CdmBase.deproxy(pkey1.getRoot().getStatement(), KeyStatement.class);
+
+        CdmTransientEntityCacher cacher = getCacher(sessionOwner);
+
+       // this call will load into the session cache the graph and update the objects in the sub-graph for a
+       // polytomous key
+       //      |- root : polytomous key node
+       //              |- question : KeyStatement
+       //              |- statement : KeyStatement
+        PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH3_INIT_STRATEGY),PolytomousKey.class);
+
+        KeyStatement ks2 = CdmBase.deproxy(pkey2.getRoot().getStatement(), KeyStatement.class);
+
+        Assert.assertSame(ks2, cacher.getFromCache(ks2));
+        Assert.assertSame(cacher.getFromCache(KeyStatement.class, ks1.getId()), cacher.getFromCache(ks2));
+
+    }
+
+    /**
+     * when : retrieving objects using recursive caching of object graphs with different depths
+     * then : the objects in the sub-graph having the same persistence id should be the same
+     */
+    @Test
+    public void differentSubGraphDepthTest2() {
+
+       // this call will load into the session cache the graph and update the objects in the sub-graph for a
+       // polytomous key
+       //      |- root : polytomous key node
+       //              |- question : KeyStatement
+       //              |- statement : KeyStatement
+        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+        KeyStatement ks1 = pkey1.getRoot().getStatement();
+        Assert.assertSame(ks1, pkey1.getRoot().getStatement());
+        CdmTransientEntityCacher cacher = getCacher(sessionOwner);
+
+       // this call will load into the session cache the graph and update the objects in the sub-graph for a
+       // polytomous key
+       //      |- root : polytomous key node
+        PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY),PolytomousKey.class);
+
+        Assert.assertSame(pkey1.getRoot().getStatement(), pkey2.getRoot().getStatement());
+        pkey2.getRoot().getStatement().getCreatedBy();
+        Assert.assertSame(cacher.getFromCache(ks1), cacher.getFromCache(pkey2.getRoot().getStatement()));
+    }
+
+    /**
+     * when : retrieving objects using (first) recursive load directly and (second) lazy loading in the same session
+     * then : the objects in the sub-graph having the same persistence id should be the same
+     */
+    @Test
+    public void recursiveLoadAndLazyLoadTest() {
+
+       // this call will load into the session cache the graph and update the objects in the sub-graph for a
+       // polytomous key
+       //      |- root : polytomous key node
+       //              |- question : KeyStatement
+       //              |- statement : KeyStatement
+        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+
+
+        CdmTransientEntityCacher cacher = getCacher(sessionOwner);
+
+        // checking that the root is not null and
+        // that it exists in the cache and
+        // that both the original object and the
+        // cached object are the same
+        Assert.assertNotNull(CdmBase.deproxy(pkey1.getRoot().getStatement(), KeyStatement.class));
+        Assert.assertNotNull(cacher.getFromCache(pkey1.getRoot().getStatement()));
+
+       // this call will load into the session cache the graph and update the objects in the sub-graph for a
+       // polytomous key
+       //      |- root : polytomous key node
+        PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+
+        KeyStatement ks2 =  CdmBase.deproxy(pkey2.getRoot().getStatement(), KeyStatement.class);
+        Assert.assertSame(ks2, cacher.getFromCache(pkey2.getRoot().getStatement()));
+
+        Assert.assertSame(pkey1.getRoot().getStatement(), pkey2.getRoot().getStatement());
+        Assert.assertSame(cacher.getFromCache(pkey1.getRoot().getStatement()), cacher.getFromCache(pkey2.getRoot().getStatement()));
+    }
+
+    /**
+     * when : retrieving objects using (first) lazy loading  and (second) recursive load directly in the same session
+     * then : the objects in the sub-graph having the same persistence id should be the same
+     */
+    @Test
+    public void lazyLoadAndRecursiveLoadTest() {
+
+
+       // this call will load into the session cache the graph and update the objects in the sub-graph for a
+       // polytomous key
+       //      |- root : polytomous key node
+
+       PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+
+
+        // lazy initialising root.statement
+        KeyStatement st = CdmBase.deproxy(pkey1.getRoot().getStatement(), KeyStatement.class);
+        st.getLabel();
+
+        // checking that the root is not null and
+        // that it exists in the cache and
+        // that both the original object and the
+        // cached object are the same
+       Assert.assertNotNull(pkey1.getRoot().getStatement());
+       Assert.assertSame(CdmBase.deproxy(pkey1.getRoot().getStatement(), KeyStatement.class),
+                       cacher.getFromCache(pkey1.getRoot().getStatement(), KeyStatement.class));
+
+       // this call will load into the session cache the graph and update the objects in the sub-graph for a
+       // polytomous key
+       //      |- root : polytomous key node
+       //              |- question : KeyStatement
+       //              |- statement : KeyStatement
+
+       PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+
+
+       Assert.assertSame(CdmBase.deproxy(pkey2.getRoot().getStatement(), KeyStatement.class), cacher.getFromCache(pkey2.getRoot().getStatement(), KeyStatement.class));
+       Assert.assertSame(st, CdmBase.deproxy(pkey2.getRoot().getStatement(), KeyStatement.class));
+       Assert.assertSame(cacher.getFromCache(st), cacher.getFromCache(pkey2.getRoot().getStatement(), KeyStatement.class));
+    }
+
+
+
+
+
+    /**
+     * when : loading an object (first) and then (second) loading a graph the object is contained in, in the same session
+     * then : the object should be the same
+     */
+    @Test
+    public void subGraphObjectLoadTest1() {
+
+       // this call will load into the session cache a polytomous key node object
+       PolytomousKeyNode rootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid1),PolytomousKeyNode.class);
+
+
+       Assert.assertNotNull(rootPKNode);
+       Assert.assertSame(rootPKNode, cacher.getFromCache(rootPKNode));
+
+       PolytomousKeyNode childOfRootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid2),PolytomousKeyNode.class);
+
+
+       Assert.assertNotNull(childOfRootPKNode);
+       Assert.assertSame(childOfRootPKNode, cacher.getFromCache(childOfRootPKNode));
+
+       // this call will load into the session cache the graph and update the objects in the sub-graph for a
+       // polytomous key
+       //      |- root : polytomous key node
+       //              |- question : KeyStatement
+       //              |- statement : KeyStatement
+
+       PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+
+
+       Assert.assertSame(childOfRootPKNode, cacher.getFromCache(childOfRootPKNode));
+       Assert.assertSame(pkey.getRoot().getChildAt(1), childOfRootPKNode);
+    }
+
+    /**
+     * when : loading a graph (first) and then (second) loading an object contained in in the graph, in the same session
+     * then : the object should be the same
+     */
+    @Test
+    public void subGraphObjectLoadTest2() {
+
+       // this call will load into the session cache the graph and update the objects in the sub-graph for a
+       // polytomous key
+       //      |- root : polytomous key node
+       //              |- question : KeyStatement
+       //              |- statement : KeyStatement
+
+       PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+
+
+       // this call will load into the session cache a polytomous key node object
+       PolytomousKeyNode rootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid1),PolytomousKeyNode.class);
+
+
+       Assert.assertNotNull(rootPKNode);
+       Assert.assertSame(rootPKNode, cacher.getFromCache(rootPKNode));
+
+       PolytomousKeyNode childOfRootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid2),PolytomousKeyNode.class);
+
+
+       Assert.assertNotNull(childOfRootPKNode);
+       Assert.assertSame(childOfRootPKNode, cacher.getFromCache(childOfRootPKNode));
+
+       Assert.assertSame(childOfRootPKNode, cacher.getFromCache(childOfRootPKNode));
+       Assert.assertSame(pkey.getRoot().getChildAt(1), childOfRootPKNode);
+    }
+
+
+    /**
+     * when : loading objects from a collection
+     * then : the object stored in the cache should be the same
+     */
+    @Test
+    public void subGraphCollectionLoadTest() {
+
+       // this call will load into the session cache the graph and update the objects in the sub-graph for a
+       // polytomous key
+       //      |- root : polytomous key node
+       //              |- question : KeyStatement
+       //              |- statement : KeyStatement
+
+       PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+
+
+       PolytomousKeyNode childOfRootPKNode = pkey.getRoot().getChildAt(1);
+
+       Assert.assertSame(childOfRootPKNode, cacher.getFromCache(childOfRootPKNode));
+       Assert.assertSame(pkey.getRoot().getChildAt(1), childOfRootPKNode);
+
+    }
+
+    /**
+     * when : loading a non-lazy collection in a subgraph and loading the collection directly
+     * then : the object stored in the cache should be the same as the object in the sub-graph collection and
+     *        the object in the directly loaded collection
+     */
+    @Test
+    public void nonLazyCollectionLoadTest() {
+       // need to find an example of this
+    }
+
+    /**
+     * when : loading objects from a map
+     * then : the object stored in the cache should be the same
+     */
+    @Test
+    public void subGraphMapLoadTest() {
+
+       Language english = Language.getLanguageFromUuid(Language.uuidEnglish);
+        Language hindi = Language.getLanguageFromUuid(UUID.fromString("0a1d9d1d-135d-4575-b172-669b51673c39"));
+
+
+       // this call will load into the session cache the graph and update the objects in the sub-graph for a
+       // polytomous key
+       //      |- root : polytomous key node
+       //              |- question : KeyStatement
+       //              |- statement : KeyStatement
+
+       PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH3_INIT_STRATEGY),PolytomousKey.class);
+
+
+       Map<Language, LanguageString> labelMap = pkey.getRoot().getStatement().getLabel();
+       Set<Language> languages = labelMap.keySet();
+       Iterator<Language> languagesItr = languages.iterator();
+       while(languagesItr.hasNext()) {
+               Language lang = languagesItr.next();
+               if(lang.equals(english)) {
+                       Assert.assertSame(lang, english);
+               }
+               if(lang.equals(hindi)) {
+                       Assert.assertSame(lang, hindi);
+               }
+               Assert.assertSame(lang, cacher.getFromCache(lang));
+       }
+    }
+
+    /**
+     * when : loading a non-lazy map in a subgraph and loading the map directly
+     * then : the object stored in the cache should be the same as the object in the sub-graph map and
+     *        the object in the directly loaded map
+     */
+    @Test
+    public void nonLazyMapLoadTest() {
+       // need to find an example of this
+    }
+
+
+
+}
index 0dc9065267426971ed1f9a6f79b42a9dd61050a6..982e8cee3ba46fccd7e8aae66cf70deebfb23b62 100644 (file)
@@ -1,16 +1,18 @@
 package eu.etaxonomy.taxeditor.application.menu.general;\r
 \r
 import org.eclipse.swtbot.eclipse.finder.waits.Conditions;\r
+import org.junit.Ignore;\r
 import org.junit.Test;\r
 \r
 import eu.etaxonomy.taxeditor.test.AbstractEditorTest;\r
 \r
 /**\r
  * Open all "General -> New" menus\r
- * \r
+ *\r
  * @author n.hoffmann\r
  *\r
  */\r
+@Ignore\r
 public class NewMenuTest extends AbstractEditorTest {\r
 \r
        @Test\r
@@ -18,42 +20,42 @@ public class NewMenuTest extends AbstractEditorTest {
                openNewWizardFor("Taxon");\r
                utils.cancel();\r
        }\r
-       \r
+\r
 \r
        @Test\r
        public void canOpenNewWizardForReference(){\r
                openNewWizardFor("Reference");\r
                utils.cancel();\r
        }\r
-       \r
-       \r
+\r
+\r
        @Test\r
        public void canOpenNewWizardForName(){\r
                openNewWizardFor("Name");\r
                utils.cancel();\r
        }\r
-       \r
-       \r
+\r
+\r
        @Test\r
        public void canOpenNewWizardForTeam(){\r
                openNewWizardFor("Team");\r
                utils.cancel();\r
        }\r
-       \r
-       \r
+\r
+\r
        @Test\r
        public void canOpenNewWizardForPerson(){\r
                openNewWizardFor("Person");\r
                utils.cancel();\r
        }\r
-       \r
+\r
        @Test\r
        public void canOpenNewWizardForSpecimen(){\r
                openNewWizardFor("Specimen");\r
                utils.cancel();\r
        }\r
-       \r
-       \r
+\r
+\r
        @Test\r
        public void canOpenNewWizardForClassification(){\r
                openNewWizardFor("Classification");\r
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/BaseRemotingTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/BaseRemotingTest.java
new file mode 100644 (file)
index 0000000..99396b4
--- /dev/null
@@ -0,0 +1,184 @@
+/**
+ * Copyright (C) 2014 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.httpinvoker;
+
+import java.lang.reflect.Field;
+import java.util.Map;
+
+import net.sf.ehcache.CacheManager;
+
+import org.apache.log4j.Logger;
+import org.junit.BeforeClass;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.security.core.context.SecurityContextImpl;
+import org.unitils.database.DatabaseUnitils;
+import org.unitils.database.annotations.Transactional;
+import org.unitils.database.util.TransactionMode;
+import org.unitils.spring.annotation.SpringApplicationContext;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmDataChangeService;
+import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
+import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
+import eu.etaxonomy.taxeditor.remoting.cache.CdmRemoteCacheManager;
+import eu.etaxonomy.taxeditor.remoting.cache.CdmTransientEntityCacher;
+import eu.etaxonomy.taxeditor.remoting.source.CdmPersistentRemoteSource;
+import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSource;
+import eu.etaxonomy.taxeditor.remoting.source.ICdmRemoteSource;
+import eu.etaxonomy.taxeditor.session.CdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
+
+
+/**
+ * Base class for remoting tests, responsible for
+ * - starting / stop the cdm server
+ * - running some basic connection tests
+ * - setting up the remote configuration.
+ *
+ */
+@Transactional(TransactionMode.DISABLED)
+@SpringApplicationContext("file:./target/classes/eu/etaxonomy/cdm/testRemotingApplicationContext.xml")
+public abstract class BaseRemotingTest extends ThreadedTest {
+    private static final Logger logger = Logger.getLogger(BaseRemotingTest.class);
+
+    private static ICdmRemoteSource cdmRemoteSource;
+    private static CdmPersistentRemoteSource remotePersistentSource;
+    protected static ICdmEntitySessionManager cdmEntitySessionManager;
+
+    @BeforeClass
+    public static void initializeBaseRemotingTest() {
+
+        DatabaseUnitils.disableConstraints();
+
+        try {
+            initializeController(sourceName,
+                    host,
+                    httpPort,
+                    contextPath,
+                    NomenclaturalCode.ICNAFP,
+                    user,
+                    password);
+        } catch (Exception e) {
+            e.printStackTrace();
+           // Assert.fail("Server failed to start. Reason : " + e.getMessage());
+        }
+
+
+    }
+
+    public static void emptyAllCachesExceptModelCache() {
+        CacheManager cm = CacheManager.create();
+        String[] cacheNames = CacheManager.create().getCacheNames();
+        for(String cacheName : cacheNames) {
+            if(!cacheName.equals(CdmRemoteCacheManager.CDM_MODEL_CACHE_NAME)) {
+                cm.removeCache(cacheName);
+            }
+        }
+    }
+
+
+    public static void initializeController(String sourceName, String host, int port, String contextPath, NomenclaturalCode ncode, String username, String password) {
+
+        if(CdmApplicationState.getCurrentAppConfig() != null) {
+            return;
+        }
+        cdmRemoteSource = CdmRemoteSource.NewInstance(sourceName, host, port, contextPath, ncode);
+        CdmApplicationRemoteController remoteApplicationController =
+                CdmApplicationRemoteController.NewInstance(cdmRemoteSource,
+                        null,
+                        null);
+        CdmApplicationState.setCurrentAppConfig(remoteApplicationController);
+        CdmApplicationState.setCdmServiceCacher(new CdmServiceCacher());
+
+        cdmEntitySessionManager = getRemoteApplicationController().getCdmEntitySessionManager();
+
+        CdmApplicationState.setCurrentDataChangeService(new CdmDataChangeService());
+
+        authenticate(username, password);
+
+    }
+
+    protected static void authenticate(String username, String password) {
+
+        //FIXME:Remoting the authentication code should be replaced by a method call which actually
+        // does the authentication in the editor code so that the 'real' authentication can be tested
+        SecurityContextHolder.clearContext();
+        SecurityContextImpl sc = new SecurityContextImpl();
+        Authentication token = new UsernamePasswordAuthenticationToken(username,password);
+        Authentication authentication = getRemoteApplicationController().getAuthenticationManager().authenticate(token);
+        authentication = new UsernamePasswordAuthenticationToken(username,password, authentication.getAuthorities());
+        sc.setAuthentication(authentication);
+
+        SecurityContextHolder.setContext(sc);
+        CdmApplicationState.setCurrentSecurityContext(SecurityContextHolder.getContext());
+
+    }
+
+
+    protected static CdmApplicationRemoteController getRemoteApplicationController() {
+        return (CdmApplicationRemoteController) CdmApplicationState.getCurrentAppConfig();
+    }
+
+    protected static ICdmRemoteSource getCdmRemoteSource() {
+        return cdmRemoteSource;
+    }
+
+    protected static CdmPersistentRemoteSource getCdmPersistentRemoteSource() {
+        return remotePersistentSource;
+    }
+
+    protected static ICdmEntitySessionManager getCdmEntitySessionManager() {
+        return cdmEntitySessionManager;
+    }
+
+
+    protected static CdmEntitySession getSession(ICdmEntitySessionEnabled sessionOwner) {
+        Map<ICdmEntitySessionEnabled, CdmEntitySession> ownerSessionMap =
+                (Map<ICdmEntitySessionEnabled, CdmEntitySession>) getFieldValueViaReflection(cdmEntitySessionManager, "ownerSessionMap");
+        return ownerSessionMap.get(sessionOwner);
+    }
+
+    protected static CdmEntitySession getActiveSession() {
+        return ((InheritableThreadLocal<CdmEntitySession>) getFieldValueViaReflection(cdmEntitySessionManager, "tlActiveSession")).get();
+    }
+
+    protected static CdmTransientEntityCacher getCacher(ICdmEntitySessionEnabled sessionOwner) {
+        return (CdmTransientEntityCacher) getFieldValueViaReflection(getSession(sessionOwner), "cdmTransientEntityCacher");
+    }
+
+
+    protected static Object getFieldValueViaReflection(Object object, String fieldName) {
+        Class<?> clazz = object.getClass();
+        try {
+            Field field = clazz.getDeclaredField(fieldName);
+            field.setAccessible(true);
+            return field.get(object);
+        } catch (NoSuchFieldException e) {
+            e.printStackTrace();
+        } catch (SecurityException e) {
+            e.printStackTrace();
+        } catch (IllegalArgumentException e) {
+            e.printStackTrace();
+        } catch (IllegalAccessException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+
+    protected static void authenticateDefaultUser() {
+        authenticate(user, password);
+    }
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CdmRemoteSourceTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CdmRemoteSourceTest.java
new file mode 100644 (file)
index 0000000..945d5c6
--- /dev/null
@@ -0,0 +1,99 @@
+/**
+* Copyright (C) 2014 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.httpinvoker;
+
+import org.apache.log4j.Logger;
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.remoting.RemoteAccessException;
+
+import eu.etaxonomy.cdm.config.CdmSourceException;
+import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
+import eu.etaxonomy.taxeditor.lazyloading.RemotePersistentCollectionTest;
+import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSource;
+
+public class CdmRemoteSourceTest extends BaseRemotingTest {
+       private static final Logger logger = Logger.getLogger(RemotePersistentCollectionTest.class);
+
+
+       @Test
+       public void whenConnectingToInactiveServerThenFailToConnect() {
+
+               // check if non-active server throws the right exception
+               CdmRemoteSource inactiveCrs = CdmRemoteSource.NewInstance(sourceName,
+                       host,
+                       808080,
+                       contextPath,
+                       NomenclaturalCode.ICNAFP);
+               try {
+                       String dbSchemaVersion = inactiveCrs.getDbSchemaVersion();
+                       Assert.fail("getDbSchemaVersion() on inactive cdm server should have thrown RemoteAccessException");
+               } catch(CdmSourceException cse) {
+                       Assert.fail("getDbSchemaVersion() on inactive cdm server should have thrown RemoteAccessException and not CdmSourceException");
+               } catch(RemoteAccessException rae){
+
+               }
+
+               try {
+                       inactiveCrs.isDbEmpty();
+                       Assert.fail("isDbEmpty() on inactive cdm server should have thrown RemoteAccessException");
+               } catch(CdmSourceException cse) {
+                       Assert.fail("isDbEmpty() on inactive cdm server should have thrown RemoteAccessException and not CdmSourceException");
+               } catch(RemoteAccessException rae){
+
+               }
+
+               try {
+                       inactiveCrs.checkConnection();
+                       Assert.fail("checkConnection() on inactive cdm server should have thrown RemoteAccessException");
+               } catch(CdmSourceException cse) {
+                       Assert.fail("checkConnection() on inactive cdm server should have thrown RemoteAccessException and not CdmSourceException");
+               } catch(RemoteAccessException rae){
+
+               }
+
+       }
+
+       @Test
+       public void whenConnectingToAnActiveServerThenConnectSuccessfully() {
+               // check if active server throws the right exception
+               CdmRemoteSource activeCrs = CdmRemoteSource.NewInstance(sourceName,
+                       host,
+                       httpPort,
+                       contextPath,
+                NomenclaturalCode.ICNAFP);
+               String dbSchemaVersion = "";
+               try {
+                       dbSchemaVersion = activeCrs.getDbSchemaVersion();
+               } catch (CdmSourceException e) {
+                       Assert.fail("getDbSchemaVersion() on active cdm server should not have thrown CdmSourceException");
+               }
+               logger.info("dbSchemaVersion is " + dbSchemaVersion);
+
+
+               boolean isDbEmpty = false;
+               try {
+                       isDbEmpty = activeCrs.isDbEmpty();
+               } catch (CdmSourceException e) {
+                       Assert.fail("isDbEmpty() on active cdm server should not have thrown CdmSourceException");
+               }
+               Assert.assertFalse(isDbEmpty);
+
+
+               boolean check = true;
+               try {
+                       isDbEmpty = activeCrs.checkConnection();
+               } catch (CdmSourceException e) {
+                       Assert.fail("checkConnection() on active cdm server should not have thrown CdmSourceException");
+               }
+               Assert.assertTrue(check);
+
+       }
+
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CdmServerTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CdmServerTest.java
new file mode 100644 (file)
index 0000000..e78d31d
--- /dev/null
@@ -0,0 +1,66 @@
+// $Id$
+/**
+* Copyright (C) 2014 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.httpinvoker;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+import org.junit.Assert;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+
+import eu.etaxonomy.taxeditor.remoting.server.CDMServerUtils;
+import eu.etaxonomy.taxeditor.webapp.CDMEmbeddedServerException;
+import eu.etaxonomy.taxeditor.webapp.CDMServer;
+import eu.etaxonomy.taxeditor.webapp.ICDMServerError;
+
+
+/**
+ * @author cmathew
+ * @date 6 Oct 2014
+ *
+ */
+public class CdmServerTest extends TestConfig {
+    private static final Logger logger = Logger.getLogger(CdmServerTest.class);
+
+
+
+    @Test
+    public void generateConfigFile() throws IOException {
+        String mgdServerConfigFileName = "test.mgd.datasources.xml";
+        String config = CDMServerUtils.convertEditorToServerConfig();
+        CDMServerUtils.writeManagedServerConfig(config, mgdServerConfigFileName);
+    }
+
+    @Test
+    public void manageCdmServer() throws IOException, URISyntaxException, CDMEmbeddedServerException {
+        Bundle bundle = Platform.getBundle("eu.etaxonomy.taxeditor.test");
+        URL mgdDatasourcesConfigURL = bundle.getEntry("src/test/resources/.cdmLibrary/writableResources/mgd.datasources.xml");
+        File mgdDatasourcesConfigFile = new File(FileLocator.resolve(mgdDatasourcesConfigURL).toURI());
+        CDMServer cdmServer = new CDMServer("cdmTest", mgdDatasourcesConfigFile);
+        cdmServer.start(new ICDMServerError() {
+            @Override
+            public void handleError(Throwable t) {
+                Assert.fail("Error starting server. Reason : " + t.getMessage());
+            }
+        });
+        try {
+            cdmServer.stop();
+        } catch (Exception e) {
+            e.printStackTrace();
+            Assert.fail("Error stopping server. Reason : " + e.getMessage());
+        }
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/HttpInvokerServicesTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/HttpInvokerServicesTest.java
new file mode 100644 (file)
index 0000000..f1a6c57
--- /dev/null
@@ -0,0 +1,78 @@
+/**
+ * Copyright (C) 2014 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.httpinvoker;
+
+import org.apache.log4j.Logger;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.springframework.remoting.RemoteAccessException;
+import org.springframework.security.core.context.SecurityContext;
+import org.springframework.security.core.context.SecurityContextHolder;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.service.ITestService;
+import eu.etaxonomy.cdm.config.CdmSourceException;
+import eu.etaxonomy.cdm.model.description.PolytomousKey;
+
+/**
+ * Class to test the HttpInvoker services exposed by the CDM Sever
+ *
+ */
+public class HttpInvokerServicesTest extends BaseRemotingTest {
+    private static final Logger logger = Logger.getLogger(HttpInvokerServicesTest.class);
+
+    ITestService testService =  getRemoteApplicationController().getTestService();
+
+    @Test
+    public void whenCallingMethodsOnRemoteServicesThenSucceed() {
+        try {
+
+            //getRemoteApplicationController().getDatabaseService();
+            String dbSchemaVersion = getRemoteApplicationController().getDatabaseService().getDbSchemaVersion();
+            logger.info("dbSchemaVersion is " + dbSchemaVersion);
+
+
+        } catch (CdmSourceException e) {
+            Assert.fail("pinging database service on active cdm server should not have thrown CdmSourceException");
+        }
+
+        getRemoteApplicationController().getPolytomousKeyService().list(PolytomousKey.class, null, null, null, null);
+
+    }
+
+    @Ignore
+    @Test
+    public void whenCallingMethodsOnRemoteServicesThenFailIfNotAuthenticated() {
+
+        SecurityContext context = SecurityContextHolder.getContext();
+
+        CdmApplicationState.setCurrentSecurityContext(null);
+        try {
+            getRemoteApplicationController().getPolytomousKeyService().list(PolytomousKey.class, null, null, null, null);
+            Assert.fail("service call should fail as it is not authenticated");
+        }catch (RemoteAccessException rae) {
+
+        }
+
+        CdmApplicationState.setCurrentSecurityContext(context);
+
+    }
+
+    // should be kept at ignore and only used for manual testing
+    // otherwise tests will take too much time
+    @Ignore
+    @Test
+    public void testDisableReadTimeout() throws InterruptedException  {
+        testService.waitFor((long) 120000.0);
+    }
+
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/RemotingSessionAwareTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/RemotingSessionAwareTest.java
new file mode 100644 (file)
index 0000000..1949ce3
--- /dev/null
@@ -0,0 +1,77 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.httpinvoker;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.security.core.userdetails.UsernameNotFoundException;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.service.IUserService;
+import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.taxeditor.remoting.cache.CdmTransientEntityCacher;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.MockSessionOwner;
+
+/**
+ * @author cmathew
+ * @date 12 Jun 2015
+ *
+ */
+public abstract class RemotingSessionAwareTest extends BaseRemotingTest {
+
+    private static final Logger logger = Logger.getLogger(RemotingSessionAwareTest.class);
+
+    protected CdmTransientEntityCacher cacher;
+    protected MockSessionOwner sessionOwner;
+
+    private static String extraUsername = "Someone";
+    private static String extraPassword = "Password";
+
+
+    private IUserService userService = getRemoteApplicationController().getUserService();
+
+    @Before
+    public void initializeSession() {
+
+        sessionOwner = new MockSessionOwner();
+        logger.info("created mock session owner : " + sessionOwner);
+        ICdmEntitySession cdmEntitySession = cdmEntitySessionManager.newSession(sessionOwner, true);
+        CdmApplicationState.getCurrentDataChangeService().register(sessionOwner);
+        sessionOwner.setCdmEntitySession(cdmEntitySession);
+        cacher = getCacher(sessionOwner);
+
+        UserDetails extraUser = null;
+
+        try {
+            extraUser = userService.loadUserByUsername(extraUsername);
+        } catch (UsernameNotFoundException unfe) {
+            User user = User.NewInstance(extraUsername, extraPassword);
+            userService.createUser(user);
+        }
+
+
+    }
+
+    @After
+    public void postSessionAwareTest() {
+        sessionOwner.dispose();
+        CdmApplicationState.getCurrentDataChangeService().unregister(sessionOwner);
+        logger.info("disposed of mock session owner : " + sessionOwner);
+    }
+
+
+    protected static void authenticateExtraUser() {
+        authenticate(extraUsername, extraPassword);
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/TestConfig.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/TestConfig.java
new file mode 100644 (file)
index 0000000..4f6598d
--- /dev/null
@@ -0,0 +1,96 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.httpinvoker;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+import org.junit.BeforeClass;
+import org.osgi.framework.Bundle;
+import org.unitils.UnitilsJUnit4;
+
+/**
+ * @author cmathew
+ * @date 11 Nov 2015
+ *
+ */
+public abstract class TestConfig extends UnitilsJUnit4 {
+
+    private static final Logger logger = Logger.getLogger(TestConfig.class);
+
+    private final static String DEFAULT_USER = "admin";
+    private final static String DEFAULT_PASSWORD = "00000";
+    private final static int DEFAULT_HTTP_PORT = 9090;
+    private final static String DEFAULT_CONTEXT_PATH = "";
+    private final static String DEFAULT_SOURCE_NAME = "default";
+    private final static String DEFAULT_HOST = "localhost";
+
+    private static String userHomeKey = "user.home";
+
+    protected static String user = DEFAULT_USER;
+    protected static String password = DEFAULT_PASSWORD;
+    protected static int httpPort = DEFAULT_HTTP_PORT;
+    protected static String contextPath = DEFAULT_CONTEXT_PATH;
+    protected static String sourceName = DEFAULT_SOURCE_NAME;
+    protected static String host = DEFAULT_HOST;
+
+    @BeforeClass
+    public static void initializeTestConfig() {
+        try {
+            String userHomeDirPath;
+            Bundle bundle = Platform.getBundle("eu.etaxonomy.taxeditor.test");
+
+            URL userHomeDirURL = bundle.getEntry("src/test/resources");
+            File userHomeDir = new File(FileLocator.resolve(userHomeDirURL).toURI());
+            userHomeDirPath = userHomeDir.getAbsolutePath();
+
+            URL serverPropertiesURL = bundle.getEntry("src/test/resources/server.properties");
+            File serverPropertiesFile = new File(FileLocator.resolve(serverPropertiesURL).toURI());
+            InputStream inputStream = new FileInputStream(serverPropertiesFile);
+
+            Properties prop = new Properties();
+
+            prop.load(inputStream);
+            inputStream.close();
+
+
+            logger.warn("Setting user.home to " + userHomeDirPath);
+            System.setProperty(userHomeKey, userHomeDirPath);
+
+
+            if(prop.getProperty("user") != null) {
+                user = prop.getProperty("user");
+            }
+
+            if(prop.getProperty("password") != null) {
+                password = prop.getProperty("password");
+            }
+
+            if(prop.getProperty("httpPort") != null) {
+                httpPort = Integer.valueOf(prop.getProperty("httpPort"));
+            }
+
+            if(prop.getProperty("contextPath") != null) {
+                contextPath = prop.getProperty("contextPath");
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            // Assert.fail("Server failed to start. Reason : " + e.getMessage());
+        }
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/TestThread.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/TestThread.java
new file mode 100644 (file)
index 0000000..b70f802
--- /dev/null
@@ -0,0 +1,60 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.httpinvoker;
+
+/**
+ * @author cmathew
+ * @date 16 Oct 2015
+ *
+ */
+public abstract class TestThread extends Thread {
+    Throwable throwable;
+    boolean isBlocked = false;
+
+    public TestThread() {
+
+    }
+
+    public TestThread(boolean blocking) {
+        isBlocked = blocking;
+    }
+    /**
+     * @return the throwable
+     */
+    public Throwable getThrowable() {
+        return throwable;
+    }
+
+    /**
+     * @param throwable the throwable to set
+     */
+    public void setThrowable(Throwable throwable) {
+        this.throwable = throwable;
+    }
+
+    public void unblock() {
+        isBlocked = false;
+    }
+
+    @Override
+    public final void run() {
+        try {
+            while(isBlocked) {};
+            doRun();
+        } catch(Exception ex) {
+            throwable = ex;
+        } catch(AssertionError ae) {
+            throwable = ae;
+        }
+    }
+
+    public abstract void doRun() throws Exception, AssertionError;
+
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/ThreadedTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/ThreadedTest.java
new file mode 100644 (file)
index 0000000..43e9970
--- /dev/null
@@ -0,0 +1,49 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.httpinvoker;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.junit.After;
+
+/**
+ * @author cmathew
+ * @date 16 Oct 2015
+ *
+ */
+public abstract class ThreadedTest  extends TestConfig {
+
+    private Set<TestThread> threadPool = new HashSet<TestThread>();
+
+    protected void invokeThread(TestThread thread) {
+        threadPool.add(thread);
+        thread.start();
+    }
+
+    @After
+    public void cleanup() throws Throwable {
+        try {
+            for(TestThread thread : threadPool) {
+                if(thread.isAlive()) {
+                    thread.join();
+                }
+            }
+
+            for(TestThread thread : threadPool) {
+                if(thread.getThrowable() != null) {
+                    throw thread.getThrowable();
+                }
+            }
+        } finally {
+            threadPool.clear();
+        }
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/AbstractLazyInitializerTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/AbstractLazyInitializerTest.java
new file mode 100644 (file)
index 0000000..ee948ee
--- /dev/null
@@ -0,0 +1,215 @@
+/**
+ * Copyright (C) 2014 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.lazyloading;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.unitils.dbunit.annotation.DataSet;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
+import eu.etaxonomy.cdm.api.service.IClassificationService;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.model.agent.Person;
+import eu.etaxonomy.cdm.model.agent.Team;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.name.BotanicalName;
+import eu.etaxonomy.cdm.model.name.NonViralName;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.httpinvoker.BaseRemotingTest;
+
+
+
+
+/**
+ * Class to test the {@link CdmApplicationRemoteController}
+ *
+ */
+// FIXME:Remoting need to create a proper dataset for this test
+//       Could be combined with RemotePersistentCollectionTest
+@Ignore
+@DataSet
+public class AbstractLazyInitializerTest extends BaseRemotingTest {
+    private static final Logger logger = Logger.getLogger(AbstractLazyInitializerTest.class);
+
+    private static IClassificationService classificationService;
+    private static ITaxonService taxonService;
+
+    private static List<TaxonNode> taxonNodes;
+
+    private final UUID taxonUuid1 = UUID.fromString("8217ef77-2ab1-4318-bd67-ccd0cdef07c4");
+    private final UUID taxonUuid2 = UUID.fromString("ef96fafa-7750-4141-b31b-1ad1daab3e76");
+
+
+    @BeforeClass
+    public static void initializeRemoteLazyLoading() {
+
+        taxonService = getRemoteApplicationController().getTaxonService();
+        classificationService= getRemoteApplicationController().getClassificationService();
+        List<Classification> classifications = classificationService.listClassifications(1,0,null,null);
+        Assert.assertFalse(classifications.isEmpty());
+
+        Classification classification = classifications.get(0);
+        Assert.assertNotNull(classification);
+        taxonNodes = classificationService.getAllNodes();
+        Assert.assertFalse(taxonNodes.isEmpty());
+
+    }
+
+
+
+    @Test
+    public void testCDMEntityGet() {
+        //ITaxonService taxonService = getRemoteApplicationController().getTaxonService();
+        Iterator<TaxonNode> taxonNodeItr = taxonNodes.iterator();
+        int maxcount = 30;
+        int count = 0;
+        while(taxonNodeItr.hasNext() && count <= maxcount) {
+            TaxonNode taxonNode = taxonNodeItr.next();
+            Assert.assertNotNull(taxonNode);
+
+            Taxon taxon = taxonNode.getTaxon();
+            Assert.assertNotNull(taxon);
+
+            String taxonTitle = taxon.getTitleCache();
+            logger.info("Taxon : " + taxonTitle);
+
+            TaxonNameBase name = taxon.getName();
+            Assert.assertNotNull(name);
+
+            String nameTitle = name.getTitleCache();
+            logger.info("Taxon Name : " + nameTitle);
+
+            count++;
+        }
+    }
+
+    @Test
+    public void taxonReadTest() {
+        Taxon taxon = (Taxon)taxonService.find(taxonUuid1);
+
+    }
+
+
+    @Test
+    public void testCDMEntitySave() {
+        Taxon taxon = (Taxon)taxonService.find(taxonUuid1);
+        String oldTitleCache = taxon.getTitleCache();
+
+        System.out.println("Taxon title : " + oldTitleCache);
+
+        taxon.setTitleCache(oldTitleCache + ":updated", true);
+        taxonService.merge(taxon);
+
+        Taxon taxonNew = (Taxon)taxonService.find(taxonUuid1);
+        System.out.println("New Taxon Title : " + taxonNew.getTitleCache());
+
+        Assert.assertTrue("Title caches should not be equal",oldTitleCache.equals(taxonNew.getTitleCache()));
+
+
+        taxonNew.setTitleCache(oldTitleCache, true);
+        taxonService.merge(taxonNew);
+
+        Taxon taxonOld = (Taxon)taxonService.find(taxonUuid1);
+        System.out.println("Old Taxon Title : " + taxonOld.getTitleCache());
+
+        Assert.assertEquals("Title caches should be equal",oldTitleCache,taxonOld.getTitleCache());
+
+    }
+
+
+        @Test
+        public void testCDMEntitySaveLazyNew() {
+            Team combAuthor = Team.NewInstance();
+            combAuthor.addTeamMember(Person.NewTitledInstance("test member"));
+            BotanicalName name = BotanicalName.NewInstance(null, "Test1", null, null, null, null, null, null, null);
+            name.setCombinationAuthorship(combAuthor);
+            Taxon tax1 = Taxon.NewInstance(name, null);
+            UUID taxonUuid1 = taxonService.save(tax1).getUuid();
+
+            Taxon taxon = (Taxon)taxonService.find(taxonUuid1);
+
+            NonViralName nvn = CdmBase.deproxy(taxon.getName(),NonViralName.class);
+            String oldTitleCache = nvn.getTitleCache();
+            logger.info("Taxon Name Title : " + oldTitleCache);
+            nvn.setTitleCache(oldTitleCache + ":updated",false);
+            taxonService.update(taxon);
+
+            Taxon taxonNew = (Taxon)taxonService.find(taxonUuid1);
+            NonViralName nvnNew = CdmBase.deproxy(taxon.getName(),NonViralName.class);
+            logger.info("New Taxon Name Title : " + nvnNew.getTitleCache());
+
+            Assert.assertTrue("Title caches should not be equal",oldTitleCache.equals(nvnNew.getTitleCache()));
+
+            nvnNew.setTitleCache(oldTitleCache, true);
+            taxonService.update(taxon);
+
+            Taxon taxonOld = (Taxon)taxonService.find(taxonUuid1);
+            NonViralName nvnOld = CdmBase.deproxy(taxon.getName(),NonViralName.class);
+            logger.info("Old Taxon Name Title : " + nvnNew.getTitleCache());
+
+            Assert.assertEquals("Title caches should be equal",oldTitleCache,nvnOld.getTitleCache());
+        }
+
+        @Ignore
+        @Test
+        public void testCDMEntitySaveCollection() {
+            Taxon taxon = (Taxon)taxonService.find(taxonUuid1);
+
+            Set<SynonymRelationship> synRelations = taxon.getSynonymRelations();
+            Set<String> relToTitles = new HashSet<String>();
+            Iterator<SynonymRelationship> srItr = synRelations.iterator();
+            while(srItr.hasNext()) {
+                SynonymRelationship sr = srItr.next();
+                System.out.println("Synonym Title Cache : " + sr.getSynonym().getTitleCache());
+                relToTitles.add(sr.getSynonym().getTitleCache());
+                sr.getSynonym().setTitleCache(sr.getSynonym().getTitleCache() + ":updated");
+
+            }
+            taxonService.merge(taxon);
+
+            Taxon taxonNew = (Taxon)taxonService.find(taxonUuid1);
+            Set<SynonymRelationship> synRelationsNew = taxonNew.getSynonymRelations();
+
+            Iterator<SynonymRelationship> srItrNew = synRelationsNew.iterator();
+            Iterator<String> relToTitlesItr = relToTitles.iterator();
+            while(srItrNew.hasNext() && relToTitlesItr.hasNext()) {
+                SynonymRelationship srNew = srItrNew.next();
+                String relToTitle = relToTitlesItr.next();
+                System.out.println("New Synonym Title Cache: " + srNew.getSynonym().getTitleCache());
+                Assert.assertTrue("Synonym Title caches should not be equal", srNew.getSynonym().getTitleCache().equals(relToTitle));
+                srNew.getSynonym().setTitleCache(relToTitle);
+            }
+
+            Taxon taxonOld = (Taxon)taxonService.find(taxonUuid1);
+
+            Set<SynonymRelationship> synRelationsOld = taxonNew.getSynonymRelations();
+            Iterator<SynonymRelationship> srItrOld = synRelationsOld.iterator();
+            relToTitlesItr = relToTitles.iterator();
+            while(srItrOld.hasNext() && relToTitlesItr.hasNext()) {
+                SynonymRelationship srOld = srItrOld.next();
+                String relToTitle = relToTitlesItr.next();
+                System.out.println("New Synonym Title Cache: " + srOld.getSynonym().getTitleCache());
+                Assert.assertEquals("Synonym Title caches should be equal", srOld.getSynonym().getTitleCache(), relToTitle);
+
+            }
+        }
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/CdmServiceCacherTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/CdmServiceCacherTest.java
new file mode 100644 (file)
index 0000000..b81692e
--- /dev/null
@@ -0,0 +1,32 @@
+package eu.etaxonomy.taxeditor.lazyloading;
+
+import org.apache.log4j.Logger;
+import org.junit.Assert;
+import org.junit.Test;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.taxeditor.httpinvoker.RemotingSessionAwareTest;
+
+
+public class CdmServiceCacherTest extends RemotingSessionAwareTest {
+       private static final Logger logger = Logger.getLogger(CdmServiceCacherTest.class);
+
+
+       private static CdmServiceCacher cdmServiceCacher = CdmApplicationState.getCdmServiceCacher();
+
+       @Test
+       public void testLanguageCache() {
+               Language defaultLanguage = Language.getDefaultLanguage();
+
+               Language defaultLanguageInCache = (Language)cdmServiceCacher.getFromCache(defaultLanguage.getUuid());
+               Assert.assertEquals("Loaded Language Term should match Language Term in Cache",defaultLanguage,defaultLanguageInCache);
+
+               Language language = Language.getLanguageFromUuid(Language.uuidFrench);
+               Language languageInCache = (Language)cdmServiceCacher.getFromCache(language.getUuid());
+               Assert.assertEquals("Loaded Language Term should match Language Term in Cache",language,languageInCache);
+
+       }
+
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/PropertyPathsTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/PropertyPathsTest.java
new file mode 100644 (file)
index 0000000..6cdb5c3
--- /dev/null
@@ -0,0 +1,78 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.lazyloading;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.taxon.Synonym;
+import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.httpinvoker.BaseRemotingTest;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * This test class is primarily for performance testing.
+ * It should be used to make read-only calls to the target cdm-server.
+ *
+ * @author cmathew
+ * @date 26 Aug 2015
+ *
+ */
+//FIXME:Remoting ignoring until we can target integration servers
+@Ignore
+public class PropertyPathsTest extends BaseRemotingTest {
+
+    @Test
+    public void taxonLoadTest() {
+        // load taxon Crepis from cichorieae
+        UUID taxonBaseUuid = UUID.fromString("d0ae2121-1c32-4737-8c49-f871d429fd90");
+        List<String> taxonBasePropertyPaths = Arrays.asList(new String[] {
+                "synonymRelations.synonym.name.status.type",
+                "name.homotypicalGroup.typifiedNames.taxonBases.synonymRelations.relatedFrom.name.status"
+        });
+        TaxonBase taxonBase = CdmStore.getService(ITaxonService.class).load(taxonBaseUuid, taxonBasePropertyPaths);
+        Taxon taxon = CdmBase.deproxy(taxonBase, Taxon.class);
+        Set<SynonymRelationship> synonymRelations = taxon.getSynonymRelations();
+        for(SynonymRelationship rel : synonymRelations) {
+            rel.getSynonym().getName().getStatus().size();
+        }
+        Set<TaxonNameBase> typifiedNames = taxon.getName().getHomotypicalGroup().getTypifiedNames();
+        for(TaxonNameBase name : typifiedNames) {
+            Set<TaxonBase> taxonBases = name.getTaxonBases();
+            for(TaxonBase tb : taxonBases) {
+                if(tb instanceof Synonym) {
+                    Synonym syn = CdmBase.deproxy(tb, Synonym.class);
+                    Set<SynonymRelationship> rels = syn.getSynonymRelations();
+                    for(SynonymRelationship rel : rels) {
+                        rel.getSynonym().getName().getStatus().size();
+                    }
+                }
+                if(tb instanceof Taxon) {
+                    Taxon syn = CdmBase.deproxy(tb, Taxon.class);
+                    Set<SynonymRelationship> rels = syn.getSynonymRelations();
+                    for(SynonymRelationship rel : rels) {
+                        rel.getSynonym().getName().getStatus().size();
+                    }
+                }
+            }
+        }
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/RemoteLazyLoadingTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/RemoteLazyLoadingTest.java
new file mode 100644 (file)
index 0000000..5a63680
--- /dev/null
@@ -0,0 +1,276 @@
+/**
+ * Copyright (C) 2014 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+
+package eu.etaxonomy.taxeditor.lazyloading;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import eu.etaxonomy.cdm.api.service.IClassificationService;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.model.agent.Person;
+import eu.etaxonomy.cdm.model.agent.Team;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.name.BotanicalName;
+import eu.etaxonomy.cdm.model.name.NonViralName;
+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.TaxonNode;
+import eu.etaxonomy.taxeditor.httpinvoker.BaseRemotingTest;
+
+
+
+/**
+ * Test class which tests remoting for persistent cdm entities.
+ *
+ * FIXME:Remoting saving tests are ignored until the merge development is underway
+ * @author c.mathew
+ *
+ */
+//FIXME:Remoting need to create a proper dataset for this test
+//Could be combined with AbstractLazyInitializerTest
+@Ignore
+public class RemoteLazyLoadingTest extends BaseRemotingTest {
+
+    private static final Logger logger = Logger.getLogger(RemoteLazyLoadingTest.class);
+
+    private static IClassificationService classificationService;
+    private static ITaxonService taxonService;
+
+    private static List<TaxonNode> taxonNodes;
+
+    private final UUID taxonUuid1 = UUID.fromString("8217ef77-2ab1-4318-bd67-ccd0cdef07c4");
+    private final UUID taxonUuid2 = UUID.fromString("ef96fafa-7750-4141-b31b-1ad1daab3e76");
+
+
+    @BeforeClass
+    public static void initializeRemoteLazyLoading() {
+        taxonService = getRemoteApplicationController().getTaxonService();
+
+        classificationService= getRemoteApplicationController().getClassificationService();
+        //List<Classification> classifications = classificationService.listClassifications(1,0,null,null);
+//        Assert.assertFalse(classifications.isEmpty());
+//
+//        Classification classification = classifications.get(0);
+//        Assert.assertNotNull(classification);
+        taxonNodes = classificationService.getAllNodes();
+        Assert.assertFalse(taxonNodes.isEmpty());
+
+    }
+
+
+
+    @Test
+    public void testCDMEntityGet() {
+        Iterator<TaxonNode> taxonNodeItr = taxonNodes.iterator();
+        int maxcount = 30;
+        int count = 0;
+        while(taxonNodeItr.hasNext() && count <= maxcount) {
+            TaxonNode taxonNode = taxonNodeItr.next();
+            Assert.assertNotNull(taxonNode);
+
+            Taxon taxon = taxonNode.getTaxon();
+            Assert.assertNotNull(taxon);
+
+            String taxonTitle = taxon.getTitleCache();
+            logger.info("Taxon : " + taxonTitle);
+
+            TaxonNameBase name = taxon.getName();
+            Assert.assertNotNull(name);
+
+            String nameTitle = name.getTitleCache();
+            logger.info("Taxon Name : " + nameTitle);
+
+            count++;
+        }
+
+
+    }
+
+    @Test
+    public void test() {
+
+    }
+
+    @Test
+    public void testCDMEntitySaveEager() {
+        Taxon taxon = (Taxon)taxonService.find(taxonUuid1);
+        String oldTitleCache = taxon.getTitleCache();
+
+        System.out.println("Taxon title : " + oldTitleCache);
+
+        taxon.setTitleCache(oldTitleCache + ":updated");
+        taxonService.merge(taxon);
+
+        Taxon taxonNew = (Taxon)taxonService.find(taxonUuid1);
+        System.out.println("New Taxon Title : " + taxonNew.getTitleCache());
+
+        Assert.assertTrue("Title caches should not be equal",oldTitleCache.equals(taxonNew.getTitleCache()));
+
+        taxonNew.setTitleCache(oldTitleCache);
+        taxonService.merge(taxonNew);
+
+        Taxon taxonOld = (Taxon)taxonService.find(taxonUuid1);
+        System.out.println("Old Taxon Title : " + taxonOld.getTitleCache());
+
+        Assert.assertEquals("Title caches should be equal",oldTitleCache,taxonOld.getTitleCache());
+
+    }
+
+
+    @Test
+    public void testCDMEntityUpdate() {
+
+        Team combAuthor = Team.NewInstance();
+        combAuthor.addTeamMember(Person.NewTitledInstance("test member"));
+        BotanicalName name = BotanicalName.NewInstance(null, "Test1", null, null, null, null, null, null, null);
+        name.setCombinationAuthorship(combAuthor);
+        Taxon taxon = Taxon.NewInstance(name, null);
+        UUID taxonUuid = taxonService.save(taxon).getUuid();
+
+        //        Taxon taxon = (Taxon)taxonService.find(taxonUuid1);
+        //        NonViralName nvn = CdmBase.deproxy(taxon.getName(),NonViralName.class);
+        //        String oldTitleCache = nvn.getTitleCache();
+        //        System.out.println("Taxon Name Title : " + oldTitleCache);
+        //        nvn.setTitleCache(oldTitleCache + ":updated", true);
+        //
+        //        taxon.setTitleCache(oldTitleCache + ":updated",true);
+        //        try {
+        //            taxonService.update(taxon);
+        //        } catch (LazyInitializationException lie) {
+        //            lie.printStackTrace();
+        //        }
+
+        List<String> TAXON_INIT_STRATEGY = Arrays.asList(new String[] {
+                "name"
+        });
+        Taxon taxonNew = (Taxon)taxonService.findTaxonByUuid(taxonUuid,TAXON_INIT_STRATEGY);
+        NonViralName nvn = CdmBase.deproxy(taxonNew.getName(),NonViralName.class);
+        Team team = CdmBase.deproxy(nvn.getCombinationAuthorship(),Team.class);
+        String oldTitleCache = nvn.getTitleCache();
+        System.out.println("Taxon Name Title : " + oldTitleCache);
+        nvn.setTitleCache(oldTitleCache + ":updated", true);
+        taxonService.update(taxonNew);
+
+    }
+
+
+    @Test
+    public void testCDMEntitySaveLazy() {
+        Taxon taxon = (Taxon)taxonService.find(taxonUuid1);
+
+        NonViralName nvn = CdmBase.deproxy(taxon.getName(),NonViralName.class);
+        String oldTitleCache = nvn.getTitleCache();
+        System.out.println("Taxon Name Title : " + oldTitleCache);
+        nvn.setTitleCache(oldTitleCache + ":updated", true);
+        taxonService.update(taxon);
+
+        //             Taxon taxonNew = (Taxon)taxonService.find(taxonUuid1);
+        //             NonViralName nvnNew = CdmBase.deproxy(taxon.getName(),NonViralName.class);
+        //             System.out.println("New Taxon Name Title : " + nvnNew.getTitleCache());
+        //
+        //             Assert.assertNotEquals("Title caches should not be equal",oldTitleCache,nvnNew.getTitleCache());
+        //
+        //             nvnNew.setTitleCache(oldTitleCache, true);
+        //             taxonService.update(taxon);
+        //
+        //             Taxon taxonOld = (Taxon)taxonService.find(taxonUuid1);
+        //             NonViralName nvnOld = CdmBase.deproxy(taxon.getName(),NonViralName.class);
+        //             System.out.println("Old Taxon Name Title : " + nvnNew.getTitleCache());
+        //
+        //             Assert.assertEquals("Title caches should be equal",oldTitleCache,nvnOld.getTitleCache());
+    }
+
+    @Test
+    public void testCDMEntitySaveLazyNew() {
+        Team combAuthor = Team.NewInstance();
+        combAuthor.addTeamMember(Person.NewTitledInstance("test member"));
+        BotanicalName name = BotanicalName.NewInstance(null, "Test1", null, null, null, null, null, null, null);
+        name.setCombinationAuthorship(combAuthor);
+        Taxon tax1 = Taxon.NewInstance(name, null);
+        UUID taxonUuid1 = taxonService.save(tax1).getUuid();
+
+        Taxon taxon = (Taxon)taxonService.find(taxonUuid1);
+
+        NonViralName nvn = CdmBase.deproxy(taxon.getName(),NonViralName.class);
+        String oldTitleCache = nvn.getTitleCache();
+        logger.info("Taxon Name Title : " + oldTitleCache);
+        nvn.setTitleCache(oldTitleCache + ":updated",false);
+        taxonService.update(taxon);
+
+        Taxon taxonNew = (Taxon)taxonService.find(taxonUuid1);
+        NonViralName nvnNew = CdmBase.deproxy(taxon.getName(),NonViralName.class);
+        logger.info("New Taxon Name Title : " + nvnNew.getTitleCache());
+
+        Assert.assertTrue("Title caches should not be equal",oldTitleCache.equals(nvnNew.getTitleCache()));
+
+        nvnNew.setTitleCache(oldTitleCache, true);
+        taxonService.update(taxon);
+
+        Taxon taxonOld = (Taxon)taxonService.find(taxonUuid1);
+        NonViralName nvnOld = CdmBase.deproxy(taxon.getName(),NonViralName.class);
+        logger.info("Old Taxon Name Title : " + nvnNew.getTitleCache());
+
+        Assert.assertEquals("Title caches should be equal",oldTitleCache,nvnOld.getTitleCache());
+    }
+    @Ignore
+    @Test
+    public void testCDMEntitySaveCollection() {
+        Taxon taxon = (Taxon)taxonService.find(taxonUuid1);
+
+        Set<SynonymRelationship> synRelations = taxon.getSynonymRelations();
+        Set<String> relToTitles = new HashSet<String>();
+        Iterator<SynonymRelationship> srItr = synRelations.iterator();
+        while(srItr.hasNext()) {
+            SynonymRelationship sr = srItr.next();
+            System.out.println("Synonym Title Cache : " + sr.getSynonym().getTitleCache());
+            relToTitles.add(sr.getSynonym().getTitleCache());
+            sr.getSynonym().setTitleCache(sr.getSynonym().getTitleCache() + ":updated");
+
+        }
+        taxonService.merge(taxon);
+
+        Taxon taxonNew = (Taxon)taxonService.find(taxonUuid1);
+        Set<SynonymRelationship> synRelationsNew = taxonNew.getSynonymRelations();
+
+        Iterator<SynonymRelationship> srItrNew = synRelationsNew.iterator();
+        Iterator<String> relToTitlesItr = relToTitles.iterator();
+        while(srItrNew.hasNext() && relToTitlesItr.hasNext()) {
+            SynonymRelationship srNew = srItrNew.next();
+            String relToTitle = relToTitlesItr.next();
+            System.out.println("New Synonym Title Cache: " + srNew.getSynonym().getTitleCache());
+            Assert.assertTrue("Synonym Title caches should not be equal", srNew.getSynonym().getTitleCache().equals(relToTitle));
+            srNew.getSynonym().setTitleCache(relToTitle);
+        }
+
+        Taxon taxonOld = (Taxon)taxonService.find(taxonUuid1);
+
+        Set<SynonymRelationship> synRelationsOld = taxonNew.getSynonymRelations();
+        Iterator<SynonymRelationship> srItrOld = synRelationsOld.iterator();
+        relToTitlesItr = relToTitles.iterator();
+        while(srItrOld.hasNext() && relToTitlesItr.hasNext()) {
+            SynonymRelationship srOld = srItrOld.next();
+            String relToTitle = relToTitlesItr.next();
+            System.out.println("New Synonym Title Cache: " + srOld.getSynonym().getTitleCache());
+            Assert.assertEquals("Synonym Title caches should be equal", srOld.getSynonym().getTitleCache(), relToTitle);
+
+        }
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/RemotePersistentCollectionTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/RemotePersistentCollectionTest.java
new file mode 100644 (file)
index 0000000..d1871f0
--- /dev/null
@@ -0,0 +1,224 @@
+/**
+* Copyright (C) 2014 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.lazyloading;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import eu.etaxonomy.cdm.api.service.IClassificationService;
+import eu.etaxonomy.cdm.api.service.ICommonService;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.LanguageString;
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.model.description.TextData;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.httpinvoker.BaseRemotingTest;
+
+/**
+ * Test class which tests remoting for persistent collections.
+ *
+ * @author c.mathew
+ * @created 13.03.2014
+ */
+//FIXME:Remoting need to create a proper dataset for this test
+//Could be combined with AbstractLazyInitializerTest
+@Ignore
+public class RemotePersistentCollectionTest extends BaseRemotingTest {
+       private static final Logger logger = Logger.getLogger(RemotePersistentCollectionTest.class);
+
+       private static IClassificationService classificationService;
+       private static ICommonService commonService;
+
+       @BeforeClass
+       public static void initializeServices() {
+               classificationService = getRemoteApplicationController().getClassificationService();
+               commonService = getRemoteApplicationController().getCommonService();
+       }
+
+       /**
+        * Test method which checks remoting for persistent lists.
+        *
+        */
+       @Test
+       public void persistentListTest() {
+
+               List<TaxonNode> taxonNodes = classificationService.getAllNodes();
+               int size = taxonNodes.size();
+               logger.debug("classificationService.getAllNodes() size : " + size);
+               TaxonNode taxonNode = null;
+               if(size > 0) {
+                       Assert.assertFalse(taxonNodes.isEmpty());
+
+                       taxonNode = taxonNodes.get(0);
+                       Assert.assertNotNull(taxonNode);
+                       Assert.assertTrue(taxonNodes.contains(taxonNode));
+
+                       // get the list of child nodes, which will give a
+                       // proxy list which is not yet initialised
+                       List<TaxonNode> childNodes = taxonNode.getChildNodes();
+                       // this size call will first initialise the list locally by internally
+                       // calling the ICommonService.initializeCollection method and then
+                       // call size on the initialised list
+                       int childCount = childNodes.size();
+
+                       // this size call will initialise the list remotely and only return the
+                       // size of the list
+                       int remoteChildCount = commonService.size(taxonNode.getUuid(), "childNodes");
+                       Assert.assertEquals(childCount, remoteChildCount);
+
+                       String firstNodeTaxonTitle = taxonNode.getTaxon().getTitleCache();
+                       Assert.assertNotNull(firstNodeTaxonTitle);
+
+                       if(childCount > 0) {
+                               Assert.assertFalse(childNodes.isEmpty());
+                               // this get call will use the already initialised list to get the
+                               // 0th element
+                               TaxonNode localTaxonNode = childNodes.get(0);
+
+                               // this get call will initialise the list remotely and only return the
+                               // 0th element from the list
+                               TaxonNode remoteTaxonNode = (TaxonNode)commonService.get(taxonNode.getUuid(), "childNodes",0);
+
+                               // the locally and remotely retrieved taxon node should exist in the
+                               // (local and remote) child nodes list, should be not-null and should be equal to each other
+                               Assert.assertTrue(taxonNode.getChildNodes().contains(localTaxonNode));
+                               Assert.assertTrue(taxonNode.getChildNodes().contains(remoteTaxonNode));
+                               Assert.assertTrue(commonService.contains(taxonNode.getUuid(), "childNodes", localTaxonNode));
+                               Assert.assertTrue(commonService.contains(taxonNode.getUuid(), "childNodes", remoteTaxonNode));
+                               Assert.assertNotNull(remoteTaxonNode);
+                               Assert.assertNotNull(localTaxonNode);
+                               Assert.assertEquals(remoteTaxonNode,localTaxonNode);
+                       }
+               }
+       }
+
+//     @Test
+//     public void persistentSetTest() {
+//             List<Classification> classifications = classificationService.listClassifications(1,0,null,null);
+//             int size = classifications.size();
+//             if(size > 0) {
+//                     Assert.assertFalse(classifications.isEmpty());
+//
+//                     Classification classification = classifications.get(0);
+//                     Assert.assertNotNull(classification);
+//                     Assert.assertTrue(classifications.contains(classification));
+//
+//                     TaxonNode rootTaxonNode = classification.getRootNode();
+//                     // get the list of child nodes, which will give a
+//                     // proxy list which is not yet initialised
+//                     List<TaxonNode> childNodes = rootTaxonNode.getChildNodes();
+//
+//                     // this size call will initialise the list locally by internally
+//                     // calling the ICommonService.initializeCollection method
+//                     int childCount = childNodes.size();
+//
+//                     if(childCount > 0) {
+//                             Assert.assertFalse(childNodes.isEmpty());
+//
+//                             // this get call will use the already initialised list to get the
+//                             // 0th element
+//                             Taxon localTaxon = childNodes.get(0).getTaxon();
+//                             Assert.assertNotNull(localTaxon);
+//
+//                             TaxonNameBase taxonName = localTaxon.getName();
+//                             Assert.assertNotNull(taxonName);
+//
+//                             // get the list of taxa, which will give a
+//                             // proxy set which is not yet initialised
+//                             Set<Taxon> taxa = taxonName.getTaxonBases();
+//
+//                             // this size call will initialise the list locally by internally
+//                             // calling the ICommonService.initializeCollection method
+//                             int taxaCount = taxa.size();
+//                             Assert.assertNotEquals(taxaCount,-1);
+//
+//                             if(taxaCount > 0) {
+//                                     Assert.assertFalse(taxa.isEmpty());
+//                                     // the locally retrieved taxon should exist in the
+//                                     // (local and remote) taxon list and should be not-null
+//                                     Assert.assertTrue(taxa.contains(localTaxon));
+//                                     Assert.assertNotNull(localTaxon);
+//                                     Assert.assertTrue(commonService.contains((PersistentCollection)taxa, localTaxon));
+//                             }
+//                     }
+//             }
+//     }
+
+       @Test
+       public void persistentMapTest() {
+               List<TaxonNode> taxonNodes = classificationService.getAllNodes();
+               // calling iterator will initialise the collection
+               Iterator<TaxonNode> taxonNodesItr = taxonNodes.iterator();
+               while(taxonNodesItr.hasNext()) {
+                       TaxonNode taxonNode = taxonNodesItr.next();
+                       Taxon taxon = taxonNode.getTaxon();
+
+                       if(taxon != null) {
+                               Set<TaxonDescription> descriptions = taxon.getDescriptions();
+                               Iterator<TaxonDescription> descriptionsItr = descriptions.iterator();
+                               while(descriptionsItr.hasNext()) {
+                                       TaxonDescription desc = descriptionsItr.next();
+                                       if(desc != null) {
+                                               for (DescriptionElementBase element : desc.getElements()){
+                                                       if (element.isInstanceOf(TextData.class)){
+                                                               // usually a call to 'get' collections should not initialise the collection,
+                                                               // but the 'getMultilanguageText' call internally calls readSize on the collection
+                                                               // which triggers the initialisation
+                                                               Map<Language, LanguageString> multilanguagetextMap = ((TextData)element).getMultilanguageText();
+                                                               //boolean init = AbstractPersistentCollection.isInitialized(multilanguagetextMap);
+                                                               //Assert.assertTrue(init);
+
+                                                               if(!multilanguagetextMap.isEmpty()) {
+                                                                       // found a map whcih we can test!
+                                                                       logger.info("Found Non-empty multilanguagetextMap");
+                                                                       boolean empty = commonService.isEmpty(element.getUuid(), "multilanguageText");
+                                                                       Assert.assertFalse(empty);
+                                                                       // test retrieval of key set, which should already by initialised
+                                                                       Set<Language> langKeySet = multilanguagetextMap.keySet();
+                                                                       Iterator<Language> langKeySetItr = langKeySet.iterator();
+                                                                       while(langKeySetItr.hasNext()) {
+                                                                               Language key = langKeySetItr.next();
+                                                                               // testing 'containsKey' on locally initialised collection
+                                                                               boolean localContainsKey = multilanguagetextMap.containsKey(key);
+                                                                               Assert.assertTrue(localContainsKey);
+                                                                               // testing 'containsKey' on remotely initialised collection
+                                                                               boolean remoteContainsKey =
+                                                                                               commonService.containsKey(element.getUuid(), "multilanguageText", key);
+                                                                               Assert.assertTrue(remoteContainsKey);
+
+                                                                               LanguageString value = multilanguagetextMap.get(key);
+                                                                               // testing 'containsValue' on locally initialised collection
+                                                                               boolean localContainsValue = multilanguagetextMap.containsValue(value);
+                                                                               Assert.assertTrue(localContainsValue);
+                                                                               // testing 'containsValue' on remotely initialised collection
+                                                                               boolean remoteContainsValue =
+                                                                                               commonService.containsValue(element.getUuid(), "multilanguageText", value);
+                                                                               Assert.assertTrue(remoteContainsValue);
+
+                                                                       }
+                                                                       return;
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+}
index 6d4dac58c945cd11c6a03da2b499e8f444c74bdd..30894688668fbbf03557a7a9c2adc44bc2a75c85 100644 (file)
@@ -1,5 +1,5 @@
 /**\r
- * \r
+ *\r
  */\r
 package eu.etaxonomy.taxeditor.navigation.navigator.contextmenu;\r
 \r
@@ -7,6 +7,7 @@ import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
 import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;\r
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;\r
 import org.junit.Before;\r
+import org.junit.Ignore;\r
 import org.junit.Test;\r
 \r
 import eu.etaxonomy.taxeditor.test.AbstractEditorTest;\r
@@ -16,18 +17,20 @@ import eu.etaxonomy.taxeditor.test.ContextMenuHelper;
  * @author n.hoffmann\r
  *\r
  */\r
+@Ignore\r
 public class ClassificationTest extends AbstractEditorTest {\r
 \r
        private SWTBotView navigatorView;\r
        private SWTBotTree tree;\r
 \r
-       @Before\r
+       @Override\r
+    @Before\r
        public void setup() {\r
                super.setup();\r
                navigatorView = utils.view("Taxon Navigator");\r
                tree = utils.tree(navigatorView.getWidget());\r
        }\r
-       \r
+\r
        @Test\r
        public void canDeleteClassification() throws Exception {\r
                tree.select(0);\r
@@ -35,7 +38,7 @@ public class ClassificationTest extends AbstractEditorTest {
                bot.waitUntil(Conditions.shellIsActive("Confirm Deletion"));\r
                utils.ok();\r
        }\r
-       \r
+\r
        @Test\r
        public void canCreateClassification() throws Exception {\r
                tree.setFocus();\r
index 1c09585e59be2c4430efb79702a1dacb86a46923..a1ac7615f6ef58f582b6190a36fea3275e0a797c 100644 (file)
@@ -1,5 +1,5 @@
 /**\r
- * \r
+ *\r
  */\r
 package eu.etaxonomy.taxeditor.newWizard;\r
 \r
@@ -7,6 +7,7 @@ import junit.framework.Assert;
 \r
 import org.eclipse.swtbot.eclipse.finder.waits.Conditions;\r
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;\r
+import org.junit.Ignore;\r
 import org.junit.Test;\r
 \r
 import eu.etaxonomy.taxeditor.test.AbstractEditorTest;\r
@@ -15,6 +16,7 @@ import eu.etaxonomy.taxeditor.test.AbstractEditorTest;
  * @author n.hoffmann\r
  *\r
  */\r
+@Ignore\r
 public class NewTaxonWizardTest extends AbstractEditorTest {\r
 \r
        @Override\r
@@ -23,14 +25,14 @@ public class NewTaxonWizardTest extends AbstractEditorTest {
                bot.menu("General").menu("New").menu("Taxon").click();\r
                bot.waitUntil(Conditions.shellIsActive("New Entity"));\r
        }\r
-       \r
+\r
        @Test\r
        public void unalteredDialogCanNotBefinished() {\r
                boolean finishIsEnabled = bot.button("Finish").isEnabled();\r
                Assert.assertEquals(false, finishIsEnabled);\r
                utils.cancel();\r
        }\r
-       \r
+\r
        @Test\r
        public void canCreateNewTaxonMinimal(){\r
                utils.openFilteredSelection(0, "Choose a Classification");\r
@@ -44,12 +46,12 @@ public class NewTaxonWizardTest extends AbstractEditorTest {
                bot.textWithLabel("New Taxon").setText(newTaxonName);\r
                bot.waitUntil(Conditions.widgetIsEnabled(bot.button("Finish")));\r
                utils.finish();\r
-               \r
+\r
 //             bot.waitUntil(Conditions.waitForEditor(WithPartId.withPartId(MultiPageTaxonEditor.ID)));\r
 //             Assert.assertEquals(newTaxonName, bot.activeEditor().getTitle());\r
        }\r
-       \r
-       \r
 \r
-       \r
+\r
+\r
+\r
 }\r
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/BaseOperationTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/BaseOperationTest.java
new file mode 100644 (file)
index 0000000..ed284ab
--- /dev/null
@@ -0,0 +1,49 @@
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.operation;
+
+import org.eclipse.core.commands.operations.AbstractOperation;
+import org.eclipse.core.commands.operations.IUndoContext;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.junit.Before;
+
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.taxeditor.httpinvoker.RemotingSessionAwareTest;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
+import eu.etaxonomy.taxeditor.test.MockConversationEnabled;
+
+/**
+ * @author n.hoffmann
+ * @created 15.04.2009
+ * @version 1.0
+ */
+public abstract class BaseOperationTest extends RemotingSessionAwareTest {
+
+       public static final IUndoContext undoContext = null;
+
+       public static final IProgressMonitor monitor = new NullProgressMonitor();
+       public static final IAdaptable info = null;
+       public static final IPostOperationEnabled postOperation = null;
+       public static final IConversationEnabled conversationEnabled = new MockConversationEnabled();
+       public static final ICdmEntitySessionEnabled cdmEntitySessionEnabled = null;
+
+       protected static AbstractOperation operation;
+
+       @Before
+       public void initializeOperations() {
+           RemotingCdmUpdateOperation.throwExceptions = true;
+       }
+
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/PolytomousKeyViewPartTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/PolytomousKeyViewPartTest.java
new file mode 100644 (file)
index 0000000..a44f3ab
--- /dev/null
@@ -0,0 +1,78 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.operation;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.unitils.dbunit.annotation.DataSet;
+
+import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
+import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.taxeditor.navigation.key.polytomous.operation.RemotingDeletePolytomousKeyOperation;
+import eu.etaxonomy.taxeditor.navigation.key.polytomous.operation.RemotingUpdatePolytomousKeyAllNodesOperation;
+
+/**
+ * @author cmathew
+ * @date 25 Jun 2015
+ *
+ */
+@DataSet
+public class PolytomousKeyViewPartTest extends BaseOperationTest {
+
+    IPolytomousKeyService polytomousKeyService = getRemoteApplicationController().getPolytomousKeyService();
+    private static UUID pkey1Uuid = UUID.fromString("f82cef88-5a9e-4917-9938-d08bda40836f");
+    private static UUID pkey2Uuid = UUID.fromString("a00ca7ec-b660-433c-bd14-596826ab2243");
+    private static UUID pkey3Uuid = UUID.fromString("197bc542-bf5b-4a52-aa66-c65df32c196b");
+
+    @Ignore // waiting for #3998 to be fixed
+    @Test
+    public void testDeletePolytomousKey() throws ExecutionException {
+        List<PolytomousKey> pKeysBeforeDelete = polytomousKeyService.list(PolytomousKey.class, null, null, null, null);
+        int initialCount = pKeysBeforeDelete.size();
+
+        List<PolytomousKey> keysToDelete = new ArrayList<PolytomousKey>();
+        keysToDelete.add(polytomousKeyService.load(pkey1Uuid));
+        keysToDelete.add(polytomousKeyService.load(pkey2Uuid));
+        keysToDelete.add(polytomousKeyService.load(pkey3Uuid));
+
+        List<UUID> uuids = new ArrayList<UUID>();
+        uuids.add(pkey1Uuid);
+        uuids.add(pkey2Uuid);
+        uuids.add(pkey3Uuid);
+
+        int keysToDeleteCount = keysToDelete.size();
+        operation = new RemotingDeletePolytomousKeyOperation(sessionOwner,
+                false,
+                uuids);
+        operation.execute(monitor, info);
+
+        List<PolytomousKey> pKeysAfterDelete = polytomousKeyService.list(PolytomousKey.class, null, null, null, null);
+        Assert.assertEquals(initialCount - keysToDeleteCount, pKeysAfterDelete.size());
+        for(PolytomousKey key : keysToDelete) {
+            Assert.assertFalse(pKeysAfterDelete.contains(key));
+        }
+
+    }
+
+    @Test
+    public void testUpdateAllNodes() throws ExecutionException {
+        operation = new RemotingUpdatePolytomousKeyAllNodesOperation(sessionOwner,
+                false,
+                pkey1Uuid);
+        operation.execute(monitor, info);
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/RemotingCdmUpdateOperationTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/RemotingCdmUpdateOperationTest.java
new file mode 100644 (file)
index 0000000..b583aa0
--- /dev/null
@@ -0,0 +1,177 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.operation;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.ExecutionException;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.unitils.dbunit.annotation.DataSet;
+
+import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.api.service.UpdateResult.Status;
+import eu.etaxonomy.cdm.api.service.dto.CdmEntityIdentifier;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.remoting.cache.ProxyUtils;
+import eu.etaxonomy.taxeditor.store.operations.RemotingTestUpdateOperation;
+
+/**
+ * @author cmathew
+ * @date 26 Jun 2015
+ *
+ */
+@DataSet
+public class RemotingCdmUpdateOperationTest extends BaseOperationTest {
+
+    private static final Logger logger = Logger.getLogger(RemotingCdmUpdateOperationTest.class);
+
+    private static ITaxonNodeService taxonNodeService = getRemoteApplicationController().getTaxonNodeService();
+
+    private static UUID taxonNodeUuid1;
+    private static UUID taxonNodeUuid2;
+    private static UUID taxonNodeUuid3;
+    private static UUID taxonNodeUuid4;
+    private static UUID taxonNodeUuid5;
+
+
+    private static Set<TaxonNode> taxonNodes;
+    private static Set<CdmEntityIdentifier> ceis;
+
+    @BeforeClass
+    public static void initializeUpdatedObjects() {
+        taxonNodeUuid1 = UUID.fromString("b85b5b78-6760-409f-ac91-bb89e95ff2a1");
+        taxonNodeUuid2 = UUID.fromString("6ad8e9e2-f5f6-41ad-aa30-f62a903650db");
+        taxonNodeUuid3 = UUID.fromString("91698cec-615f-4472-9002-feda1a6acded");
+        taxonNodeUuid4 = UUID.fromString("b8439f51-6b96-445a-b401-7a836ba1cf58");
+        taxonNodeUuid5 = UUID.fromString("629b3fd3f-29b4-4011-ab12-9c1ad1607dbd");
+
+    }
+
+    @Test
+    public void testUpdateResultWithCdmEntities() throws ExecutionException {
+        TaxonNode taxonNode1 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid1));
+        TaxonNode taxonNode2 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid2));
+        TaxonNode taxonNode3 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid3));
+        TaxonNode taxonNode4 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid4));
+        TaxonNode taxonNode5 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid5));
+
+        taxonNodes = new HashSet<TaxonNode>();
+        taxonNodes.add(taxonNode1);
+        taxonNodes.add(taxonNode2);
+        taxonNodes.add(taxonNode3);
+        taxonNodes.add(taxonNode4);
+        taxonNodes.add(taxonNode5);
+
+        UpdateResult result = new UpdateResult();
+        result.addUpdatedObjects(taxonNodes);
+        result.setStatus(Status.OK);
+
+        sessionOwner.setExpectedUpdatedObjects(taxonNodes);
+
+        operation = new RemotingTestUpdateOperation(result, sessionOwner, false);
+        operation.execute(monitor, info);
+
+        Assert.assertEquals(taxonNodes, sessionOwner.getEventUpdatedObjects());
+    }
+
+    @Test
+    public void testUpdateResultWithCdmIdentities() throws ExecutionException {
+        TaxonNode taxonNode1 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid1));
+        TaxonNode taxonNode2 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid2));
+        TaxonNode taxonNode3 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid3));
+        TaxonNode taxonNode4 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid4));
+        TaxonNode taxonNode5 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid5));
+
+        taxonNodes = new HashSet<TaxonNode>();
+        taxonNodes.add(taxonNode1);
+        taxonNodes.add(taxonNode2);
+        taxonNodes.add(taxonNode3);
+        taxonNodes.add(taxonNode4);
+        taxonNodes.add(taxonNode5);
+
+        ceis = new HashSet<CdmEntityIdentifier>();
+        ceis.add(new CdmEntityIdentifier(taxonNode3.getId(),TaxonNode.class));
+        ceis.add(new CdmEntityIdentifier(taxonNode4.getId(),TaxonNode.class));
+        ceis.add(new CdmEntityIdentifier(taxonNode5.getId(),TaxonNode.class));
+
+        UpdateResult result = new UpdateResult();
+        result.addUpdatedObject(taxonNode1);
+        result.addUpdatedObject(taxonNode2);
+        result.addUpdatedCdmIds(ceis);
+
+        result.setStatus(Status.OK);
+        sessionOwner.setExpectedUpdatedObjects(taxonNodes);
+        operation = new RemotingTestUpdateOperation(result, sessionOwner, false);
+        operation.execute(monitor, info);
+
+        Assert.assertEquals(taxonNodes, sessionOwner.getEventUpdatedObjects());
+    }
+
+    @Test
+    public void testUpdateResultWithLoadedCdmIdentities() throws ExecutionException {
+        TaxonNode taxonNode1 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid1));
+        TaxonNode taxonNode2 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid2));
+        TaxonNode taxonNode3 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid3));
+        TaxonNode taxonNode4 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid4));
+        TaxonNode taxonNode5 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid5));
+
+        taxonNodes = new HashSet<TaxonNode>();
+        taxonNodes.add(taxonNode1);
+        taxonNodes.add(taxonNode2);
+        taxonNodes.add(taxonNode3);
+        taxonNodes.add(taxonNode4);
+        taxonNodes.add(taxonNode5);
+
+        ceis = new HashSet<CdmEntityIdentifier>();
+        ceis.add(new CdmEntityIdentifier(taxonNode3.getId(),TaxonNode.class));
+        ceis.add(new CdmEntityIdentifier(taxonNode4.getId(),TaxonNode.class));
+        ceis.add(new CdmEntityIdentifier(taxonNode5.getId(),TaxonNode.class));
+
+
+        UpdateResult result = new UpdateResult();
+        result.addUpdatedObject(taxonNode1);
+        result.addUpdatedObject(taxonNode2);
+        result.addUpdatedCdmIds(ceis);
+        result.addUpdatedCdmId(new CdmEntityIdentifier(46,TaxonNode.class));
+
+        result.setStatus(Status.OK);
+        sessionOwner.setExpectedUpdatedObjects(taxonNodes);
+        operation = new RemotingTestUpdateOperation(result, sessionOwner, false);
+        operation.execute(monitor, info);
+
+        Assert.assertEquals(taxonNodes, sessionOwner.getEventUpdatedObjects());
+    }
+
+    @Test
+    public void testDataChange() throws ExecutionException {
+        TaxonNode taxonNode = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid1));
+        CdmEntityIdentifier cei = new CdmEntityIdentifier(taxonNode.getId(), TaxonNode.class);
+
+        taxonNodes = new HashSet<TaxonNode>();
+        taxonNodes.add(taxonNode);
+
+        int taxonNodeCountChildren = taxonNode.getCountChildren();
+        sessionOwner.setExpectedUpdatedObjects(taxonNodes);
+
+        operation = new RemotingTestUpdateOperation(cei, sessionOwner, false);
+        operation.execute(monitor, info);
+
+        Set eventUpdatedObjects = sessionOwner.getEventUpdatedObjects();
+        Assert.assertEquals(taxonNodes, eventUpdatedObjects);
+        Assert.assertEquals(taxonNodeCountChildren + 1, ((TaxonNode)eventUpdatedObjects.iterator().next()).getCountChildren());
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/TaxonNameEditorTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/TaxonNameEditorTest.java
new file mode 100644 (file)
index 0000000..77fc90f
--- /dev/null
@@ -0,0 +1,212 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.operation;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.ExecutionException;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.unitils.dbunit.annotation.DataSet;
+
+import eu.etaxonomy.cdm.api.service.IClassificationService;
+import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.OriginalSourceType;
+import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.model.description.TextData;
+import eu.etaxonomy.cdm.model.name.BotanicalName;
+import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
+import eu.etaxonomy.cdm.model.name.NonViralName;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.taxon.Synonym;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInExistingHomotypicalGroupOperation;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author cmathew
+ * @date 3 Feb 2015
+ *
+ */
+
+@DataSet
+public class TaxonNameEditorTest extends BaseOperationTest {
+
+    private static final Logger logger = Logger.getLogger(TaxonNameEditorTest.class);
+
+    ITaxonNodeService taxonNodeService = getRemoteApplicationController().getTaxonNodeService();
+    ITaxonService taxonService = getRemoteApplicationController().getTaxonService();
+    IClassificationService classificationService = getRemoteApplicationController().getClassificationService();
+
+    Language english = Language.getLanguageFromUuid(Language.uuidEnglish);
+
+
+    @Test
+    public void testAddHomotypicSynonym() throws ExecutionException {
+        UUID taxonNodeUuid = UUID.fromString("ce54c396-3694-47f2-abb0-1d7b7e057985");
+
+        TaxonNode taxonNode = taxonNodeService.load(taxonNodeUuid);
+        Taxon taxon = taxonNode.getTaxon();
+        HomotypicalGroup group = taxon.getHomotypicGroup();
+        BotanicalName newSynonymName = BotanicalName.NewInstance(null);
+        newSynonymName.setTitleCache("New Synonym", true);
+        operation = new CreateSynonymInExistingHomotypicalGroupOperation("Create Synonym In Existing Homotypical Group",
+                undoContext, taxon, group, newSynonymName, postOperation);
+
+        operation.execute(monitor, info);
+        taxonNodeService.merge(taxonNode);
+        Assert.assertEquals(taxon.getHomotypicGroup().getTypifiedNames().size(), 2);
+        Assert.assertEquals(taxon.getSynonyms().size(), 1);
+        Iterator<Synonym> synonymItr = taxon.getSynonyms().iterator();
+        Synonym synonym = synonymItr.next();
+        Assert.assertTrue(taxon.getHomotypicGroup().getTypifiedNames().contains(synonym.getName()));
+    }
+
+    @Test
+    public void addHeterotypicSynonym() throws ExecutionException {
+        UUID taxonNodeUuid = UUID.fromString("ce54c396-3694-47f2-abb0-1d7b7e057985");
+
+        TaxonNode taxonNode = taxonNodeService.load(taxonNodeUuid);
+        Taxon taxon = taxonNode.getTaxon();
+        HomotypicalGroup group = taxon.getHomotypicGroup();
+        BotanicalName newSynonymName = BotanicalName.NewInstance(null);
+        newSynonymName.setTitleCache("New Synonym", true);
+        operation = new CreateSynonymInExistingHomotypicalGroupOperation("Create Synonym In Existing Homotypical Group",
+                undoContext, taxon, group, newSynonymName, postOperation);
+
+        operation.execute(monitor, info);
+        taxonNodeService.merge(taxonNode);
+
+
+    }
+
+    @Test
+    public void addDeleteAddHomotypicSynonym() throws ExecutionException {
+        UUID taxonNodeUuid = UUID.fromString("ce54c396-3694-47f2-abb0-1d7b7e057985");
+
+        TaxonNode taxonNode = taxonNodeService.load(taxonNodeUuid);
+        Taxon taxon = taxonNode.getTaxon();
+        HomotypicalGroup group = taxon.getHomotypicGroup();
+        BotanicalName newSynonymName = BotanicalName.NewInstance(null);
+        newSynonymName.setTitleCache("New Synonym", true);
+        operation = new CreateSynonymInExistingHomotypicalGroupOperation("Create Synonym In Existing Homotypical Group",
+                undoContext, taxon, group, newSynonymName, postOperation);
+
+        operation.execute(monitor, info);
+        taxonNodeService.merge(taxonNode);
+        Assert.assertEquals(taxon.getHomotypicGroup().getTypifiedNames().size(), 2);
+
+        Set<Synonym> synonyms = taxon.getSynonyms();
+        for(Synonym synonym : synonyms) {
+            taxonService.deleteSynonym(synonym.getUuid(), taxon.getUuid(), null);
+        }
+
+        taxonNodeService.merge(taxonNode);
+
+        newSynonymName = BotanicalName.NewInstance(null);
+        newSynonymName.setTitleCache("Another New Synonym", true);
+        operation = new CreateSynonymInExistingHomotypicalGroupOperation("Create Synonym In Existing Homotypical Group",
+                undoContext, taxon, group, newSynonymName, postOperation);
+
+        operation.execute(monitor, info);
+        taxonNodeService.merge(taxonNode);
+    }
+
+    @Test
+    public void swapSynonymWithAcceptedTaxon() throws ExecutionException {
+        List<TaxonNode> rootEntities = new ArrayList<TaxonNode>();
+        UUID taxonNodeUuid = UUID.fromString("d425a971-1abe-4895-9e1f-1e5c8ff1c84c");
+        TaxonNode taxonNode = taxonNodeService.load(taxonNodeUuid);
+        rootEntities.add(taxonNode);
+
+        UUID taxonUuid = UUID.fromString("9763e5f0-6cd4-4d96-b8a4-4420854f7727");
+        Taxon taxon = (Taxon)taxonService.load(taxonUuid);
+        TaxonNameBase taxonName = taxon.getName();
+
+        UUID synonymUuid = UUID.fromString("1eb173bd-b174-4162-8ff5-5136d8f1e746");
+        Synonym synonym = (Synonym)taxonService.load(synonymUuid);
+        TaxonNameBase synonymName = synonym.getName();
+
+        taxonService.swapSynonymAndAcceptedTaxon(synonym.getUuid(), taxon.getUuid());
+
+        Assert.assertEquals(taxonName, synonym.getName());
+        Assert.assertEquals(synonymName, taxon.getName());
+    }
+
+    @Test
+    public void addTaxon() {
+        NonViralName taxonName = NonViralName.NewInstance(null);
+        Taxon taxon = Taxon.NewInstance(taxonName, null);
+        taxonService.merge(taxon);
+    }
+
+    @Ignore
+    @Test
+    public void addDescription() {
+        UUID taxonNodeUuid = UUID.fromString("ce54c396-3694-47f2-abb0-1d7b7e057985");
+
+        TaxonNode taxonNode = taxonNodeService.load(taxonNodeUuid);
+        Taxon taxon = taxonNode.getTaxon();
+        TaxonDescription description = TaxonDescription.NewInstance(taxon);
+
+
+        TextData textData = TextData.NewInstance();
+
+        textData.setFeature(Feature.ECOLOGY());
+        description.addElement(textData);
+
+        DescriptionElementSource descriptionElementSource = DescriptionElementSource.NewInstance(OriginalSourceType.PrimaryTaxonomicSource);
+        textData.addSource(descriptionElementSource);
+
+
+        CdmStore.getService(ITaxonNodeService.class).merge(taxonNode);
+
+        description.getId();
+    }
+
+
+    @Test
+    public void addTaxonNodeCascadeProblem() {
+        UUID taxonNodeUuid = UUID.fromString("ce54c396-3694-47f2-abb0-1d7b7e057985");
+
+        TaxonNode taxonNode = taxonNodeService.load(taxonNodeUuid);
+        Taxon childTaxon = Taxon.NewInstance(null, null);
+        TaxonNode childTaxonNode = taxonNode.addChildTaxon(childTaxon, null, null);
+        Taxon grandChildTaxon = Taxon.NewInstance(null, null);
+        TaxonNode grandChildTaxonNode = childTaxonNode.addChildTaxon(grandChildTaxon, null, null);
+
+        CdmStore.getService(ITaxonNodeService.class).merge(taxonNode,true);
+
+        Assert.assertEquals(taxonNode.getChildNodes().get(0).getId(), childTaxonNode.getId());
+
+        Assert.assertTrue(childTaxonNode.treeIndex() != null);
+        Assert.assertEquals(taxonNode.getChildNodes().get(0).treeIndex(), childTaxonNode.treeIndex());
+        Assert.assertFalse(childTaxon.getId() == 0);
+        Assert.assertEquals(taxonNode.getChildNodes().get(0).getTaxon().getId(), childTaxon.getId());
+
+        Assert.assertTrue(grandChildTaxonNode.treeIndex() != null);
+        Assert.assertEquals(taxonNode.getChildNodes().get(0).getChildNodes().get(0).getId(), grandChildTaxonNode.getId());
+        Assert.assertFalse(grandChildTaxon.getId() == 0);
+        Assert.assertEquals(taxonNode.getChildNodes().get(0).getChildNodes().get(0).getTaxon().getId(), grandChildTaxon.getId());
+    }
+
+}
+
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/TaxonNavigatorTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/TaxonNavigatorTest.java
new file mode 100644 (file)
index 0000000..3b99b77
--- /dev/null
@@ -0,0 +1,272 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.operation;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.ExecutionException;
+import org.junit.Assert;
+import org.junit.Test;
+import org.unitils.dbunit.annotation.DataSet;
+
+import eu.etaxonomy.cdm.api.service.IClassificationService;
+import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.config.TaxonNodeDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.config.NodeDeletionConfigurator.ChildHandling;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.navigation.navigator.operation.RemotingChangeAcceptedTaxonToSynonymOperation;
+import eu.etaxonomy.taxeditor.navigation.navigator.operation.RemotingDeleteTaxonNodeOperation;
+import eu.etaxonomy.taxeditor.navigation.navigator.operation.RemotingMoveFactualDataOperation;
+import eu.etaxonomy.taxeditor.navigation.navigator.operation.RemotingMoveTaxonOperation;
+
+/**
+ * @author cmathew
+ * @date 9 Mar 2015
+ *
+ */
+@DataSet
+public class TaxonNavigatorTest extends BaseOperationTest {
+
+    private static final Logger logger = Logger.getLogger(TaxonNameEditorTest.class);
+
+    ITaxonNodeService taxonNodeService = getRemoteApplicationController().getTaxonNodeService();
+    ITaxonService taxonService = getRemoteApplicationController().getTaxonService();
+    IClassificationService classificationService = getRemoteApplicationController().getClassificationService();
+
+    Language english = Language.getLanguageFromUuid(Language.uuidEnglish);
+
+
+
+    @Test
+    public void testChangeAcceptedTaxonToSynonym() throws ExecutionException {
+
+
+        UUID oldTaxonNodeNodeUuid = UUID.fromString("b85b5b78-6760-409f-ac91-bb89e95ff2a1");
+        UUID newAcceptedTaxonNodeUuid = UUID.fromString("6ad8e9e2-f5f6-41ad-aa30-f62a903650db");
+
+        TaxonNode oldTaxonNode = taxonNodeService.load(oldTaxonNodeNodeUuid);
+        TaxonNameBase name = oldTaxonNode.getTaxon().getName();
+
+
+        TaxonNode newAcceptedTaxonNode = taxonNodeService.load(newAcceptedTaxonNodeUuid);
+        int countTargetSynonyms = newAcceptedTaxonNode.getTaxon().getSynonyms().size();
+        sessionOwner.addExpectedUpdatedObject(oldTaxonNode.getParent());
+        sessionOwner.addExpectedUpdatedObject(newAcceptedTaxonNode);
+
+        operation =  new RemotingChangeAcceptedTaxonToSynonymOperation(sessionOwner,
+                false,
+                oldTaxonNode.getUuid(),
+                newAcceptedTaxonNode.getUuid());
+        operation.execute(monitor, info);
+        newAcceptedTaxonNode = taxonNodeService.load(newAcceptedTaxonNodeUuid);
+        oldTaxonNode = taxonNodeService.load(oldTaxonNodeNodeUuid);
+        Assert.assertNull(oldTaxonNode);
+        Assert.assertEquals(countTargetSynonyms + 1,newAcceptedTaxonNode.getTaxon().getSynonyms().size());
+        Assert.assertEquals(name, newAcceptedTaxonNode.getTaxon().getSynonyms().iterator().next().getName());
+
+
+    }
+
+    @Test
+    public void testMoveTaxon() throws ExecutionException {
+
+        UUID taxonNodeToMoveUuid = UUID.fromString("b8439f51-6b96-445a-b401-7a836ba1cf58");
+        UUID newParentTreeNodeUuid = UUID.fromString("2f05d429-632d-4230-b9cb-70299360b470");
+        boolean moveToParentNode = true;
+
+        TaxonNode taxonNodeToMove = taxonNodeService.load(taxonNodeToMoveUuid);
+        TaxonNode oldParent = taxonNodeToMove.getParent();
+        sessionOwner.addExpectedUpdatedObject(oldParent);
+        int childCount = oldParent.getCountChildren();
+        TaxonNode newParentTreeNode = taxonNodeService.load(newParentTreeNodeUuid);
+        sessionOwner.addExpectedUpdatedObject(newParentTreeNode);
+        operation = new RemotingMoveTaxonOperation(sessionOwner,
+                false,
+                taxonNodeToMove.getUuid(),
+                newParentTreeNode.getUuid(),
+                moveToParentNode);
+        operation.execute(monitor, info);
+        Assert.assertEquals(childCount-1, oldParent.getCountChildren());
+        Assert.assertTrue(!oldParent.getChildNodes().contains(taxonNodeToMove));
+        Assert.assertTrue(newParentTreeNode.getChildNodes().contains(taxonNodeToMove));
+    }
+
+    @Test
+    public void testMoveFactualData() throws ExecutionException {
+        UUID sourceTaxonUuid = UUID.fromString("e40854d7-143f-4054-b229-6ed4cedb4bff");
+        UUID targetTaxonUuid = UUID.fromString("b8402dc4-5050-4882-a147-01b71e0e47d6");
+
+        Taxon sourceTaxon = CdmBase.deproxy(taxonService.load(sourceTaxonUuid), Taxon.class);
+        Set<TaxonDescription> sourceDescriptions = new HashSet(sourceTaxon.getDescriptions());
+        sessionOwner.addExpectedUpdatedObject(sourceTaxon);
+
+        Taxon targetTaxon = CdmBase.deproxy(taxonService.load(targetTaxonUuid), Taxon.class);
+        int countTargetDescriptions = targetTaxon.getDescriptions().size();
+        sessionOwner.addExpectedUpdatedObject(targetTaxon);
+
+        operation = new RemotingMoveFactualDataOperation(sessionOwner,
+                false,
+                sourceTaxonUuid,
+                targetTaxonUuid);
+        operation.execute(monitor, info);
+        Assert.assertEquals(0, sourceTaxon.getDescriptions().size());
+        Assert.assertEquals(sourceDescriptions.size() + countTargetDescriptions, targetTaxon.getDescriptions().size());
+        Assert.assertTrue(targetTaxon.getDescriptions().containsAll(sourceDescriptions));
+    }
+
+    @Test
+    public void testDeleteTaxonNodeWithDeleteChildren() throws ExecutionException {
+        UUID taxonNodeUuid = UUID.fromString("2f05d429-632d-4230-b9cb-70299360b470");
+        TaxonNode taxonNode = taxonNodeService.load(taxonNodeUuid);
+        List<TaxonNode> childNodes = taxonNode.getChildNodes();
+        List<UUID> childNodeUuids = new ArrayList<UUID>();
+        for(TaxonNode childNode : childNodes) {
+            childNodeUuids.add(childNode.getUuid());
+        }
+        Assert.assertTrue(taxonNode.getCountChildren() > 0);
+
+        Set<ITaxonTreeNode> nodes = new HashSet<ITaxonTreeNode>();
+        nodes.add(taxonNode);
+
+        TaxonNodeDeletionConfigurator configNodes = new TaxonNodeDeletionConfigurator();
+        configNodes.setChildHandling(ChildHandling.DELETE);
+        TaxonDeletionConfigurator config = new TaxonDeletionConfigurator();
+        config.setTaxonNodeConfig(configNodes);
+
+        sessionOwner.addExpectedUpdatedObject(taxonNode.getParent());
+
+        operation = new RemotingDeleteTaxonNodeOperation(sessionOwner,
+                false,
+                nodes,
+                config);
+        operation.execute(monitor, info);
+        TaxonNode reloadedNode = taxonNodeService.load(taxonNode.getUuid());
+        Assert.assertNull(reloadedNode);
+        for(UUID childNodeUuid : childNodeUuids) {
+            TaxonNode reloadedChildNode = taxonNodeService.load(childNodeUuid);
+            Assert.assertNull(reloadedChildNode);
+        }
+    }
+
+    @Test
+    public void testDeleteTaxonNodes() throws ExecutionException {
+        UUID taxonNode1Uuid = UUID.fromString("99f03b56-67cd-4e01-9ceb-2362d48f9d07");
+        UUID taxonNode2Uuid = UUID.fromString("91698cec-615f-4472-9002-feda1a6acded");
+        UUID taxonNode3Uuid = UUID.fromString("4fe03763-b966-4361-8334-352f6f777588");
+
+        TaxonNode taxonNode1 = taxonNodeService.load(taxonNode1Uuid);
+        TaxonNode taxonNode2 = taxonNodeService.load(taxonNode2Uuid);
+        TaxonNode taxonNode3 = taxonNodeService.load(taxonNode3Uuid);
+
+        Set<ITaxonTreeNode> nodes = new HashSet<ITaxonTreeNode>();
+        nodes.add(taxonNode1);
+        nodes.add(taxonNode2);
+        nodes.add(taxonNode3);
+
+        TaxonDeletionConfigurator config = new TaxonDeletionConfigurator();
+
+
+        sessionOwner.addExpectedUpdatedObject(taxonNode1.getParent());
+        sessionOwner.addExpectedUpdatedObject(taxonNode2.getParent());
+        sessionOwner.addExpectedUpdatedObject(taxonNode3.getParent());
+        operation = new RemotingDeleteTaxonNodeOperation(sessionOwner,
+                false,
+                nodes,
+                config);
+        operation.execute(monitor, info);
+        TaxonNode reloadedNode1 = taxonNodeService.load(taxonNode1.getUuid());
+        TaxonNode reloadedNode2 = taxonNodeService.load(taxonNode2.getUuid());
+        TaxonNode reloadedNode3 = taxonNodeService.load(taxonNode3.getUuid());
+        Assert.assertNull(reloadedNode1);
+        Assert.assertNull(reloadedNode2);
+        Assert.assertNull(reloadedNode3);
+
+    }
+
+    @Test
+    public void testDeleteTaxonNodeWithMovingChildrenToParentNode() throws ExecutionException {
+        UUID taxonNodeUuid = UUID.fromString("2f05d429-632d-4230-b9cb-70299360b470");
+        TaxonNode taxonNode = taxonNodeService.load(taxonNodeUuid);
+        TaxonNode parentTaxonNode = taxonNode.getParent();
+        List<TaxonNode> childNodes = taxonNode.getChildNodes();
+        List<UUID> childNodeUuids = new ArrayList<UUID>();
+        for(TaxonNode childNode : childNodes) {
+            childNodeUuids.add(childNode.getUuid());
+        }
+        Assert.assertTrue(taxonNode.getCountChildren() > 0);
+
+        Set<ITaxonTreeNode> nodes = new HashSet<ITaxonTreeNode>();
+        nodes.add(taxonNode);
+
+        TaxonNodeDeletionConfigurator configNodes = new TaxonNodeDeletionConfigurator();
+        configNodes.setChildHandling(ChildHandling.MOVE_TO_PARENT);
+        TaxonDeletionConfigurator config = new TaxonDeletionConfigurator();
+        config.setTaxonNodeConfig(configNodes);
+
+        sessionOwner.addExpectedUpdatedObject(taxonNode.getParent());
+        operation = new RemotingDeleteTaxonNodeOperation(sessionOwner,
+                false,
+                nodes,
+                config);
+        operation.execute(monitor, info);
+        TaxonNode reloadedNode = taxonNodeService.load(taxonNode.getUuid());
+        Assert.assertNull(reloadedNode);
+        List<TaxonNode> parentChildNodes = parentTaxonNode.getChildNodes();
+        List<UUID> parentChildNodeUuids = new ArrayList<UUID>();
+        for(TaxonNode parentChildNode : parentChildNodes) {
+            parentChildNodeUuids.add(parentChildNode.getUuid());
+        }
+        parentChildNodeUuids.containsAll(childNodeUuids);
+
+    }
+
+    @Test
+    @DataSet("TaxonNavigatorTest.testDeleteClassificationWithDeleteChildren.xml")
+    public void testDeleteClassificationWithDeleteChildren() throws ExecutionException {
+        UUID classificationUuid = UUID.fromString("0c2b5d25-7b15-4401-8b51-dd4be0ee5cab");
+        Classification classification = classificationService.load(classificationUuid);
+        TaxonNode rootNode = classification.getRootNode();
+        Set<ITaxonTreeNode> nodes = new HashSet<ITaxonTreeNode>();
+        nodes.add(classification);
+
+        TaxonNodeDeletionConfigurator configNodes = new TaxonNodeDeletionConfigurator();
+        configNodes.setChildHandling(ChildHandling.DELETE);
+        TaxonDeletionConfigurator config = new TaxonDeletionConfigurator();
+        config.setTaxonNodeConfig(configNodes);
+
+        operation = new RemotingDeleteTaxonNodeOperation(sessionOwner,
+                false,
+                nodes,
+                config);
+        operation.execute(monitor, info);
+
+        Classification reloadedClassification = classificationService.load(classification.getUuid());
+        Assert.assertNull(reloadedClassification);
+        TaxonNode reloadedRootNode = taxonNodeService.load(rootNode.getUuid());
+        Assert.assertNull(reloadedRootNode);
+
+    }
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/IOServiceExportTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/IOServiceExportTest.java
new file mode 100644 (file)
index 0000000..bf48ebd
--- /dev/null
@@ -0,0 +1,126 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.service;
+
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.List;
+import java.util.UUID;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.unitils.dbunit.annotation.DataSet;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.service.INameService;
+import eu.etaxonomy.cdm.io.common.ExportResult;
+import eu.etaxonomy.cdm.io.csv.caryophyllales.out.CsvNameExportConfigurator;
+import eu.etaxonomy.cdm.io.csv.redlist.demo.CsvDemoExportConfigurator;
+import eu.etaxonomy.cdm.io.jaxb.JaxbExportConfigurator;
+import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
+import eu.etaxonomy.cdm.io.service.IIOService;
+import eu.etaxonomy.taxeditor.httpinvoker.BaseRemotingTest;
+
+/**
+ * @author cmathew
+ * @date 31 Jul 2015
+ *
+ */
+@DataSet
+public class IOServiceExportTest extends BaseRemotingTest {
+
+    private final IIOService ioService = CdmApplicationState.getIOService();
+    private final INameService nameService = CdmApplicationState.getCurrentAppConfig().getNameService();
+
+    @Test
+    public void exportJaxbTest() throws IOException {
+        JaxbExportConfigurator config = JaxbExportConfigurator.NewInstance(null, null);
+        ExportResult result = ioService.export(config);
+        List<byte[]> dataList = result.getExportData();
+        Assert.assertEquals(1, dataList.size());
+        byte[] exportData = dataList.get(0);
+        String savePath = "target/exportjaxb.xml";
+        FileOutputStream stream = null;
+
+        stream = new FileOutputStream(savePath);
+        stream.write(exportData);
+        stream.close();
+    }
+
+    @Test
+    public void exportSDDTest() throws IOException {
+        SDDExportConfigurator config = SDDExportConfigurator.NewInstance(null, null, null);
+        ExportResult result = ioService.export(config);
+        List<byte[]> dataList = result.getExportData();
+        Assert.assertEquals(1, dataList.size());
+        byte[] exportData = dataList.get(0);
+        String savePath = "target/exportsdd.xml";
+        FileOutputStream stream = null;
+
+        stream = new FileOutputStream(savePath);
+        stream.write(exportData);
+        stream.close();
+
+    }
+
+    @Test
+    public void exportCSVTest() throws IOException {
+        HashSet<UUID> set = new HashSet<UUID>();
+        set.add(UUID.fromString("0c2b5d25-7b15-4401-8b51-dd4be0ee5cab"));
+        CsvDemoExportConfigurator config = CsvDemoExportConfigurator.NewInstance(null, null);
+        config.setClassificationUuids(set);
+        config.setDoTaxa(true);
+        config.setHasHeaderLines(true);
+        config.setClassification(true);
+        config.setTaxonName(true);
+        config.setAuthor(true);
+        config.setRank(true);
+        config.setLastChange(true);
+
+        ExportResult result = ioService.export(config);
+        List<byte[]> dataList = result.getExportData();
+        Assert.assertEquals(1, dataList.size());
+        byte[] exportData = dataList.get(0);
+        String savePath = "target/exportcsv.xml";
+        saveToFile(savePath, exportData);
+    }
+
+    @Test
+    public void exportCSVNameTest() throws IOException {
+        CsvNameExportConfigurator config = CsvNameExportConfigurator.NewInstance(null,null);
+        ExportResult result = ioService.export(config);
+        List<byte[]> dataList = result.getExportData();
+        Assert.assertEquals(1, dataList.size());
+        byte[] exportData = dataList.get(0);
+        String savePath = "target/exportcsvname.xml";
+        saveToFile(savePath, exportData);
+    }
+
+    @Test
+    public void exportCSVPrintTest() throws IOException {
+        CsvNameExportConfigurator config = CsvNameExportConfigurator.NewInstance(null,null);
+        config.setNamesOnly(false);
+        config.setClassificationUUID(UUID.fromString("0c2b5d25-7b15-4401-8b51-dd4be0ee5cab"));
+        ExportResult result = ioService.export(config);
+        List<byte[]> dataList = result.getExportData();
+        Assert.assertEquals(1, dataList.size());
+        byte[] exportData = dataList.get(0);
+        String savePath = "target/exportcsvprint.xml";
+        saveToFile(savePath, exportData);
+    }
+
+    private static void saveToFile(String filePath, byte[] data) throws IOException {
+        FileOutputStream stream = null;
+        stream = new FileOutputStream(filePath);
+        stream.write(data);
+        stream.close();
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/IOServiceImportTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/IOServiceImportTest.java
new file mode 100644 (file)
index 0000000..965304b
--- /dev/null
@@ -0,0 +1,149 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.service;
+
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.unitils.dbunit.annotation.DataSet;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.service.INameService;
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.database.DbSchemaValidation;
+import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
+import eu.etaxonomy.cdm.io.common.ImportResult;
+import eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitImportConfigurator;
+import eu.etaxonomy.cdm.io.sdd.in.SDDImportConfigurator;
+import eu.etaxonomy.cdm.io.service.IIOService;
+import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
+import eu.etaxonomy.cdm.io.specimen.excel.in.SpecimenCdmExcelImportConfigurator;
+import eu.etaxonomy.cdm.io.tcsxml.in.TcsXmlImportConfigurator;
+import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.taxeditor.httpinvoker.BaseRemotingTest;
+
+/**
+ *
+ * Note : One issue with this test class is that when the tests are run a second time
+ * against the same server there are errors due to the fact that not all the imported data is deleted.
+ * This needs to be fixed
+ * @author cmathew
+ * @date 5 Aug 2015
+ *
+ */
+@Ignore // seems to cause problems with other tests due to data not deleted
+@DataSet
+public class IOServiceImportTest extends BaseRemotingTest {
+
+    private final IIOService ioService = CdmApplicationState.getIOService();
+    private final INameService nameService = CdmApplicationState.getCurrentAppConfig().getNameService();
+    private final IOccurrenceService occurrenceService = CdmApplicationState.getCurrentAppConfig().getOccurrenceService();
+
+    @Test
+    public void importNormalExplicit() throws IOException {
+        String importFilePath = "src/test/resources/imports/NormalExplicitImport.xls";
+        NormalExplicitImportConfigurator config =
+                NormalExplicitImportConfigurator.NewInstance(null, null, null, null);
+        config.setNomenclaturalCode(NomenclaturalCode.ICNB);
+        config.setDbSchemaValidation(DbSchemaValidation.CREATE);
+        ImportResult result = ioService.importData(config, fileToByteArray(importFilePath), SOURCE_TYPE.URI);
+        Assert.assertTrue(result.isSuccess());
+        List<TaxonNameBase> list = nameService.list(TaxonNameBase.class, null, null, null, null);
+        Assert.assertEquals(9,list.size());
+    }
+
+
+    @Test
+    public void importAbcd() throws IOException {
+        String importFilePath = "src/test/resources/imports/ABCDImport.xml";
+        Abcd206ImportConfigurator config =
+                Abcd206ImportConfigurator.NewInstance(null, null);
+        config.setNomenclaturalCode(NomenclaturalCode.ICNB);
+        config.setDbSchemaValidation(DbSchemaValidation.CREATE);
+        ImportResult result = ioService.importData(config, fileToByteArray(importFilePath), SOURCE_TYPE.INPUTSTREAM);
+        Assert.assertTrue(result.isSuccess());
+        Assert.assertTrue(!result.getReports().isEmpty());
+        saveToFile("target/importAbcdReport.txt", result.getReports().get(0));
+        List<TaxonNameBase> list = nameService.list(TaxonNameBase.class, null, null, null, null);
+        Assert.assertEquals(2,list.size());
+    }
+
+    @Test
+    public void importSDD() throws IOException {
+        String importFilePath = "src/test/resources/imports/SDD.xml";
+        SDDImportConfigurator config =
+                SDDImportConfigurator.NewInstance(null, null);
+        config.setNomenclaturalCode(NomenclaturalCode.ICNB);
+        config.setDbSchemaValidation(DbSchemaValidation.CREATE);
+        ImportResult result = ioService.importData(config, fileToByteArray(importFilePath), SOURCE_TYPE.URI);
+        Assert.assertTrue(result.isSuccess());
+        List<TaxonNameBase> list = nameService.list(TaxonNameBase.class, null, null, null, null);
+        Assert.assertEquals(9,list.size());
+    }
+
+    @Test
+    public void importSpecimenExcel() throws IOException {
+        String importFilePath = "src/test/resources/imports/SpecimenExcelImport.xls";
+        SpecimenCdmExcelImportConfigurator config = SpecimenCdmExcelImportConfigurator.NewInstance(null, null);
+        config.setNomenclaturalCode(NomenclaturalCode.ICNB);
+        config.setDbSchemaValidation(DbSchemaValidation.CREATE);
+        ImportResult result = ioService.importData(config, fileToByteArray(importFilePath), SOURCE_TYPE.URI);
+        Assert.assertTrue(result.isSuccess());
+//        List<SpecimenOrObservationBase> occurrences = occurrenceService.list(SpecimenOrObservationBase.class, null, null, null, null);
+//        Assert.assertEquals(3,occurrences.size());
+    }
+
+    @Test
+    public void importTCS() throws IOException {
+        String importFilePath = "src/test/resources/imports/TcsImport.xml";
+        TcsXmlImportConfigurator config = TcsXmlImportConfigurator.NewInstance(null, null);
+        config.setNomenclaturalCode(NomenclaturalCode.ICNB);
+        config.setDbSchemaValidation(DbSchemaValidation.CREATE);
+        ImportResult result = ioService.importData(config, fileToByteArray(importFilePath), SOURCE_TYPE.URI);
+        Assert.assertTrue(result.isSuccess());
+        List<TaxonNameBase> list = nameService.list(TaxonNameBase.class, null, null, null, null);
+        Assert.assertEquals(16,list.size());
+    }
+
+    private byte[] fileToByteArray(String filePath) throws IOException {
+        Path path = Paths.get(filePath);
+        return Files.readAllBytes(path);
+    }
+
+    private static void saveToFile(String filePath, byte[] data) {
+        FileOutputStream stream = null;
+        try {
+            stream = new FileOutputStream(filePath);
+            stream.write(data);
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if(stream != null) {
+                    stream.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/ProgressMonitorServiceTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/ProgressMonitorServiceTest.java
new file mode 100644 (file)
index 0000000..76df490
--- /dev/null
@@ -0,0 +1,329 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.service;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Test;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.service.IProgressMonitorService;
+import eu.etaxonomy.cdm.api.service.ITestService;
+import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
+import eu.etaxonomy.cdm.common.monitor.RemotingProgressMonitor;
+import eu.etaxonomy.taxeditor.httpinvoker.RemotingSessionAwareTest;
+import eu.etaxonomy.taxeditor.operation.IFeedbackGenerator;
+import eu.etaxonomy.taxeditor.operation.IPostMoniteredOperationEnabled;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author cmathew
+ * @date 22 Oct 2015
+ *
+ */
+public class ProgressMonitorServiceTest extends RemotingSessionAwareTest {
+
+    private static final Logger logger = Logger.getLogger(ProgressMonitorServiceTest.class);
+
+    ITestService testService =  getRemoteApplicationController().getTestService();
+
+    IProgressMonitorService progressMonitorService = getRemoteApplicationController().getProgressMonitorService();
+
+
+
+    @After
+    public void revertAuthentication() {
+        authenticateDefaultUser();
+    }
+
+    @Test
+    public void testMonitLongRunningMethod() throws InterruptedException {
+        UUID uuid = testService.monitLongRunningMethod(null, null, 0);
+        int pollInterval = 1000;
+        RemotingProgressMonitor expectedMonitor = new RemotingProgressMonitor();
+        expectedMonitor.setResult("Success");
+        expectedMonitor.addReport("Report");
+        expectedMonitor.done();
+        CdmStore.getProgressMonitorClientManager().pollMonitor("Testing Progress Monitor",
+                uuid,
+                pollInterval,
+                new MockPostMoniteredOperationEnabled(expectedMonitor, uuid),
+                (IFeedbackGenerator)null,
+                new NullProgressMonitor());
+    }
+
+    @Test
+    public void testMonitLongRunningMethodByChangingUser() throws InterruptedException {
+
+        IllegalStateException ise = new IllegalStateException("IllegalStateException");
+        UUID uuid = testService.monitLongRunningMethod(ise, null, 0);
+        authenticateExtraUser();
+        IRemotingProgressMonitor monitor = progressMonitorService.getRemotingMonitor(uuid);
+        Assert.assertNull(monitor);
+
+    }
+
+    @Test
+    public void testMonitLongRunningMethodWithException() throws InterruptedException {
+        IllegalStateException ise = new IllegalStateException("IllegalStateException");
+        UUID uuid = testService.monitLongRunningMethod(ise, null, 0);
+        int pollInterval = 1000;
+        RemotingProgressMonitor expectedMonitor = new RemotingProgressMonitor();
+        expectedMonitor.setResult(ise);
+        expectedMonitor.setIsFailed(true);
+        expectedMonitor.done();
+        try {
+            CdmStore.getProgressMonitorClientManager().pollMonitor("Testing Progress Monitor",
+                    uuid,
+                    pollInterval,
+                    new MockPostMoniteredOperationEnabled(expectedMonitor, uuid),
+                    (IFeedbackGenerator)null,
+                    new NullProgressMonitor());
+            Assert.fail("Exception due to inconsistent number of feedback generators not thrown");
+        } catch(IllegalStateException e) {
+
+        }
+    }
+
+    @Test
+    public void testMonitLongRunningMethodWithInterrupt() {
+        IllegalStateException ise = new IllegalStateException("Interrupted Exception");
+        final UUID uuid = testService.monitLongRunningMethod(ise, null, 0);
+        final int pollInterval = 1000;
+        final RemotingProgressMonitor expectedMonitor = new RemotingProgressMonitor();
+        expectedMonitor.setResult(ise);
+        expectedMonitor.setCanceled(true);
+        expectedMonitor.setIsFailed(true);
+        expectedMonitor.done();
+
+        Thread thread = new Thread() {
+            @Override
+            public void run() {
+                try {
+                    CdmStore.getProgressMonitorClientManager().pollMonitor("Testing Progress Monitor",
+                            uuid,
+                            pollInterval,
+                            null,
+                            (IFeedbackGenerator)null,
+                            new NullProgressMonitor());
+                    Assert.fail("InterruptedException wrapped in an IllegalStateException should be thrown");
+                } catch (InterruptedException e) {
+
+                } catch (IllegalStateException e) {
+
+                }
+            }
+        };
+        thread.start();
+        while(!progressMonitorService.isMonitorThreadRunning(uuid)) {}
+
+        progressMonitorService.interrupt(uuid);
+
+        while(progressMonitorService.isMonitorThreadRunning(uuid)) {}
+
+        IRemotingProgressMonitor remotingMonitor = progressMonitorService.getRemotingMonitor(uuid);
+        new MockPostMoniteredOperationEnabled(expectedMonitor, uuid).postOperation(remotingMonitor);
+
+    }
+
+    @Test
+    public void testMonitLongRunningMethodWithCancellation() throws InterruptedException {
+
+        final UUID uuid = testService.monitLongRunningMethod(null, null, 0);
+        final int pollInterval = 1000;
+        final RemotingProgressMonitor expectedMonitor = new RemotingProgressMonitor();
+        expectedMonitor.setResult("Cancelled");
+        expectedMonitor.setCanceled(true);
+        expectedMonitor.done();
+
+        Thread thread = new Thread() {
+            @Override
+            public void run() {
+                try {
+                    CdmStore.getProgressMonitorClientManager().pollMonitor("Testing Progress Monitor",
+                            uuid,
+                            pollInterval,
+                            null,
+                            (IFeedbackGenerator)null,
+                            new NullProgressMonitor());
+                } catch (InterruptedException e) {
+
+                }
+            }
+
+        };
+        thread.start();
+        while(!progressMonitorService.isMonitorThreadRunning(uuid)) {}
+        progressMonitorService.cancel(uuid);
+        while(progressMonitorService.isMonitorThreadRunning(uuid)) {}
+        IRemotingProgressMonitor remotingMonitor = progressMonitorService.getRemotingMonitor(uuid);
+        new MockPostMoniteredOperationEnabled(expectedMonitor, uuid).postOperation(remotingMonitor);
+
+    }
+
+    @Test
+    public void testMonitLongRunningMethodWithWaitForFeedback() throws InterruptedException {
+
+        List<String> feedbacks = Arrays.asList("feedback1", "feedback2");
+        List<IFeedbackGenerator> feebackGenerators = new ArrayList<IFeedbackGenerator>();
+        final RemotingProgressMonitor expectedMonitor = new RemotingProgressMonitor();
+        expectedMonitor.setResult("Success");
+        for(String feedback : feedbacks) {
+            feebackGenerators.add(new MockFeedbackGenerator(feedback, 0));
+            expectedMonitor.addReport(feedback);
+        }
+        expectedMonitor.addReport("Report");
+        expectedMonitor.done();
+
+        final UUID uuid = testService.monitLongRunningMethod(null, feedbacks, 0);
+        final int pollInterval = 1000;
+
+        CdmStore.getProgressMonitorClientManager().pollMonitor("Testing Progress Monitor",
+                uuid,
+                pollInterval,
+                new MockPostMoniteredOperationEnabled(expectedMonitor, uuid),
+                feebackGenerators,
+                new NullProgressMonitor());
+
+    }
+
+    @Test
+    public void testMonitLongRunningMethodWithInconsistentWaitForFeedback() throws InterruptedException {
+
+        List<String> feedbacks = Arrays.asList("feedback1", "feedback2");
+        List<IFeedbackGenerator> feebackGenerators = new ArrayList<IFeedbackGenerator>();
+        final RemotingProgressMonitor expectedMonitor = new RemotingProgressMonitor();
+        expectedMonitor.setResult("Success");
+        for(String feedback : feedbacks) {
+            feebackGenerators.add(new MockFeedbackGenerator(feedback, 0));
+            expectedMonitor.addReport(feedback);
+        }
+        expectedMonitor.addReport("Report");
+        expectedMonitor.done();
+
+        final UUID uuid = testService.monitLongRunningMethod(null, feedbacks, 0);
+        final int pollInterval = 1000;
+
+        feebackGenerators.remove(1);
+
+        final UUID newUuid = testService.monitLongRunningMethod(null, feedbacks, 0);
+
+        try {
+            CdmStore.getProgressMonitorClientManager().pollMonitor("Testing Progress Monitor",
+                    newUuid,
+                    pollInterval,
+                    new MockPostMoniteredOperationEnabled(expectedMonitor, newUuid),
+                    feebackGenerators,
+                    new NullProgressMonitor());
+            Assert.fail("Exception due to inconsistent number of feedback generators not thrown");
+        } catch(IllegalStateException ise) {
+
+        }
+    }
+
+    @Test
+    public void testMonitLongRunningMethodWithWaitForFeedbackTimeout() throws InterruptedException {
+
+        List<String> feedbacks = Arrays.asList("feedback1");
+        List<IFeedbackGenerator> feebackGenerators = new ArrayList<IFeedbackGenerator>();
+        final RemotingProgressMonitor expectedMonitor = new RemotingProgressMonitor();
+        expectedMonitor.setResult(new IllegalStateException(new InterruptedException()));
+        for(String feedback : feedbacks) {
+            feebackGenerators.add(new MockFeedbackGenerator(feedback, 1000 * 15));
+
+        }
+        expectedMonitor.setCanceled(true);
+        expectedMonitor.setIsFailed(true);
+        expectedMonitor.done();
+
+        expectedMonitor.done();
+
+        final UUID uuid = testService.monitLongRunningMethod(null, feedbacks, 1000 * 5);
+        final int pollInterval = 1000;
+
+
+        try {
+            CdmStore.getProgressMonitorClientManager().pollMonitor("Testing Progress Monitor",
+                    uuid,
+                    pollInterval,
+                    new MockPostMoniteredOperationEnabled(expectedMonitor, uuid),
+                    feebackGenerators,
+                    new NullProgressMonitor());
+            Assert.fail("Exception due to inconsistent number of feedback generators not thrown");
+        } catch(IllegalStateException ise) {
+
+        }
+    }
+
+
+    class MockPostMoniteredOperationEnabled implements IPostMoniteredOperationEnabled {
+
+        private RemotingProgressMonitor expectedMonitor;
+        private UUID monitorUuid;
+
+        public MockPostMoniteredOperationEnabled(RemotingProgressMonitor expectedMonitor, UUID monitorUuid) {
+            this.expectedMonitor = expectedMonitor;
+            this.monitorUuid = monitorUuid;
+        }
+        /**
+         * {@inheritDoc}
+         */
+        @Override
+        public void postOperation(IRemotingProgressMonitor monitor) {
+            if(expectedMonitor.getResult() instanceof Exception) {
+                Exception expectedException = (Exception) expectedMonitor.getResult();
+                Exception exception = (Exception) monitor.getResult();
+                Assert.assertEquals(expectedException.getClass(), expectedException.getClass());
+                Assert.assertEquals(expectedException.getMessage(), expectedException.getMessage());
+            } else {
+                Assert.assertEquals(expectedMonitor.getResult(), monitor.getResult());
+            }
+            Assert.assertEquals(expectedMonitor.getReports(), monitor.getReports());
+            Assert.assertEquals(expectedMonitor.isCanceled(), monitor.isCanceled());
+            Assert.assertEquals(expectedMonitor.isFailed(), monitor.isFailed());
+            Assert.assertEquals(expectedMonitor.isDone(), monitor.isDone());
+            Assert.assertTrue(!progressMonitorService.isMonitorThreadRunning(monitorUuid));
+        }
+    }
+
+    class MockFeedbackGenerator implements IFeedbackGenerator {
+
+        private String feedback;
+        private long waitTime;
+
+        public MockFeedbackGenerator(String feedback, long waitTime) {
+            this.feedback = feedback;
+            this.waitTime = waitTime;
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        @Override
+        public void setFeedbackForMonitor(UUID uuid) {
+            if(waitTime > 0) {
+                try {
+                    Thread.sleep(waitTime);
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                }
+            }
+            CdmApplicationState.getCurrentAppConfig().getProgressMonitorService().setFeedback(uuid, feedback);
+        }
+
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/ServiceInterceptorTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/ServiceInterceptorTest.java
new file mode 100644 (file)
index 0000000..9eaee83
--- /dev/null
@@ -0,0 +1,38 @@
+package eu.etaxonomy.taxeditor.service;
+
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.junit.Assert;
+import org.junit.Test;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
+import eu.etaxonomy.cdm.api.service.ITermService;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.taxeditor.httpinvoker.RemotingSessionAwareTest;
+
+public class ServiceInterceptorTest extends RemotingSessionAwareTest {
+
+        private static final Logger logger = Logger.getLogger(ServiceInterceptorTest.class);
+        private final ITermService termService = getRemoteApplicationController().getTermService();
+        private static CdmServiceCacher cdmServiceCacher = CdmApplicationState.getCdmServiceCacher();
+
+
+           @Test
+           public void termServiceInterceptorTest() {
+               List<DefinedTermBase<?>> terms = termService.listByTermType(TermType.Language, null, null, null, null);
+               int cacheLanguageSize = 0;
+               List<UUID> keys = cdmServiceCacher.getDefaultCache().getKeys();
+               for(UUID key : keys) {
+                   if(cdmServiceCacher.getFromCache(key).getClass().equals(Language.class)) {
+                       cacheLanguageSize++;
+                   }
+               }
+               Assert.assertEquals(terms.size(), cacheLanguageSize);
+               // TO DO : get the static termTypeMap from TermServiceRequestExecutor and check the size
+           }
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmApplicationStateTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmApplicationStateTest.java
new file mode 100644 (file)
index 0000000..f09d37a
--- /dev/null
@@ -0,0 +1,31 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.session;
+
+import org.junit.Test;
+import org.springframework.util.Assert;
+import org.unitils.UnitilsJUnit4;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+
+/**
+ * @author cmathew
+ * @date 5 Oct 2015
+ *
+ */
+public class CdmApplicationStateTest extends UnitilsJUnit4 {
+
+    @Test
+    public void testCdmlibManifestInfoUpdate() {
+        CdmApplicationState.updateCdmlibManifestInfo();
+        Assert.notNull(CdmApplicationState.getCdmlibVersion());
+        Assert.notNull(CdmApplicationState.getCdmlibLastModified());
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionAwareTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionAwareTest.java
new file mode 100644 (file)
index 0000000..a54143c
--- /dev/null
@@ -0,0 +1,519 @@
+// $Id$
+/**
+ * Copyright (C) 2014 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.session;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.unitils.dbunit.annotation.DataSet;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.service.ICommonService;
+import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService;
+import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.api.service.ITermService;
+import eu.etaxonomy.cdm.api.service.IUserService;
+import eu.etaxonomy.cdm.api.service.IVocabularyService;
+import eu.etaxonomy.cdm.model.agent.AgentBase;
+import eu.etaxonomy.cdm.model.agent.Person;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.Credit;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.common.Extension;
+import eu.etaxonomy.cdm.model.common.IdentifiableSource;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.LanguageString;
+import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.cdm.model.description.KeyStatement;
+import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
+import eu.etaxonomy.cdm.model.media.Rights;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.httpinvoker.RemotingSessionAwareTest;
+import eu.etaxonomy.taxeditor.httpinvoker.TestThread;
+
+
+/**
+ * @author cmathew
+ * @date 7 Oct 2014
+ *
+ */
+@DataSet
+public class CdmEntitySessionAwareTest extends RemotingSessionAwareTest {
+
+    private static final Logger logger = Logger.getLogger(CdmEntitySessionAwareTest.class);
+
+    UUID polytomousKeyUuid = UUID.fromString("0d53ba20-7de4-4baa-bd8a-401048447d66");
+    UUID subKeyUuid = UUID.fromString("9d8bf4f6-a70a-4b80-8556-2ccfb436ff01");
+    //UUID polytomousKeyUuid = UUID.fromString("bab66772-2c83-428a-bb6d-655d12ac6097");
+    UUID taxon1Uuid = UUID.fromString("2b336df7-29e8-4f79-985f-66502739d22f");
+    UUID personUuid = UUID.fromString("945d08f2-eb92-45b6-9252-6275ea6d338b");
+
+
+
+    IPolytomousKeyService polytomousKeyService = getRemoteApplicationController().getPolytomousKeyService();
+    IPolytomousKeyNodeService polytomousKeyNodeService = getRemoteApplicationController().getPolytomousKeyNodeService();
+    ICommonService commonService = getRemoteApplicationController().getCommonService();
+    ITaxonService taxonService = getRemoteApplicationController().getTaxonService();
+    IVocabularyService vocabularyService = getRemoteApplicationController().getVocabularyService();
+    ITermService termService = getRemoteApplicationController().getTermService();
+    IUserService userService = getRemoteApplicationController().getUserService();
+
+    //Language english = Language.getLanguageFromUuid(Language.uuidEnglish);
+
+
+
+    @BeforeClass
+    public static void initializePolytomousKeyTest() {
+    }
+
+
+    @Test
+    public void readAllPolytomousKeys() {
+        List<PolytomousKey> pKeys = polytomousKeyService.list(PolytomousKey.class, null, null, null, null);
+        Iterator<PolytomousKey> pKeysItr = pKeys.iterator();
+        Assert.assertEquals(pKeysItr.next().getUuid(),UUID.fromString("9d8bf4f6-a70a-4b80-8556-2ccfb436ff01"));
+        Assert.assertEquals(pKeysItr.next().getUuid(),UUID.fromString("0d53ba20-7de4-4baa-bd8a-401048447d66"));
+    }
+
+
+    @Test
+    //@DataSet("PolytomousKeyTest.readPolytmousKeyData.xml")
+    public void readPolytmousKeyData() {
+        PolytomousKey pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+        Set<Taxon> taxonomicScope = pKey.getTaxonomicScope();
+        Iterator<Taxon> tsItr = taxonomicScope.iterator();
+        Taxon taxon = tsItr.next();
+
+        Assert.assertEquals("Achillea sec. Cyprus", taxon.getTitleCache());
+        Assert.assertEquals(tsItr.hasNext(), false);
+
+        List<Credit> credits = pKey.getCredits();
+        AgentBase agent = credits.get(0).getAgent();
+        Assert.assertEquals(agent.getId(),4809);
+        Assert.assertEquals(agent.getTitleCache(),"R. A. Graham");
+        Assert.assertEquals(credits.get(0).getText(),"Credits Text Test");
+
+        Set<Extension> exts = pKey.getExtensions();
+        Iterator<Extension> extItr = exts.iterator();
+        Extension ext = extItr.next();
+        Assert.assertEquals(ext.getValue(), "http://test.com");
+
+        Set<Rights> rights = pKey.getRights();
+        Iterator<Rights> rightsItr = rights.iterator();
+        Rights right = rightsItr.next();
+        Assert.assertEquals(right.getText(),"Rights Text Test");
+
+        Set<IdentifiableSource> sources = pKey.getSources();
+        Iterator<IdentifiableSource> sourcesItr = sources.iterator();
+        IdentifiableSource source = sourcesItr.next();
+        Assert.assertEquals(source.getId(), 23710);
+        source = sourcesItr.next();
+        Assert.assertEquals(source.getId(), 23711);
+
+        // TO DO : Added tests for Annotations , Markers
+    }
+
+
+
+    @Test
+    public void readPolytomousKeyDataFromNodes() {
+        PolytomousKey pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+        PolytomousKeyNode rootNode = pKey.getRoot();
+
+
+        Assert.assertEquals(rootNode.getId(), 2750);
+
+        Assert.assertEquals(rootNode.getChildAt(0).getId(), 2751);
+        Assert.assertEquals(rootNode.getChildAt(0).getParent().getId(), rootNode.getId());
+        Assert.assertEquals(rootNode.getKey().getId(), pKey.getId());
+        Integer sortIndex = (Integer)getFieldValueViaReflection(rootNode.getChildAt(0), "sortIndex");
+        Assert.assertEquals(sortIndex, new Integer(0));
+        String statement = "Capitula without ligulate ray-florets; leaves entire or subentire";
+        Assert.assertEquals(rootNode.getChildAt(0).getStatement().getLabelText(Language.ENGLISH()), statement);
+
+        Assert.assertEquals(rootNode.getChildAt(1).getId(), 2753);
+        Assert.assertEquals(rootNode.getChildAt(1).getParent().getId(), rootNode.getId());
+        Assert.assertEquals(rootNode.getChildAt(1).getKey().getId(), pKey.getId());
+        sortIndex = (Integer)getFieldValueViaReflection(rootNode.getChildAt(1), "sortIndex");
+        Assert.assertEquals(sortIndex, new Integer(1));
+        statement = "Capitula with ligulate ray-florets; leaves pinnatisect";
+        Assert.assertEquals(rootNode.getChildAt(1).getStatement().getLabelText(Language.ENGLISH()), statement);
+
+        Assert.assertEquals(rootNode.getChildAt(1).getChildAt(0).getId(), 2754);
+        Assert.assertEquals(rootNode.getChildAt(1).getChildAt(0).getParent().getId(), rootNode.getChildAt(1).getId());
+        Assert.assertEquals(rootNode.getChildAt(1).getChildAt(0).getKey().getId(), pKey.getId());
+        sortIndex = (Integer)getFieldValueViaReflection(rootNode.getChildAt(1).getChildAt(0), "sortIndex");
+        Assert.assertEquals(sortIndex, new Integer(0));
+        statement = "Ray-florets yellow";
+        Assert.assertEquals(rootNode.getChildAt(1).getChildAt(0).getStatement().getLabelText(Language.ENGLISH()), statement);
+        Assert.assertEquals(rootNode.getChildAt(1).getChildAt(0).getChildAt(0).getTaxon().getTitleCache(), "Achillea arabica Kotschy sec. Cyprus");
+    }
+
+    @Test
+    public void addGrandChildPolytomousKeyNode() {
+
+        PolytomousKey pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+        PolytomousKeyNode rootChildNode = pKey.getRoot().getChildAt(0);
+        PolytomousKeyNode grandChildNode = PolytomousKeyNode.NewInstance();
+        rootChildNode.addChild(grandChildNode);
+
+        polytomousKeyService.merge(pKey, true);
+        grandChildNode = pKey.getRoot().getChildAt(0).getChildAt(0);
+        Assert.assertTrue(0 != grandChildNode.getId());
+        KeyStatement ks = KeyStatement.NewInstance("test");
+        grandChildNode.setStatement(ks);
+        polytomousKeyService.merge(pKey, true);
+
+        //grandChildNode = pKey.getRoot().getChildAt(0).getChildAt(0);
+        //KeyStatement ks = grandChildNode.getStatement();
+        Assert.assertTrue(0 != ks.getId());
+
+    }
+
+    @Test
+    public void addGreatGrandChildPolytomousKeyNode() {
+
+        PolytomousKey pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+        PolytomousKeyNode rootChildNode = pKey.getRoot().getChildAt(0);
+        PolytomousKeyNode grandChildNode = PolytomousKeyNode.NewInstance();
+        rootChildNode.addChild(grandChildNode);
+
+
+        polytomousKeyNodeService.merge(grandChildNode);
+
+
+        Assert.assertFalse(pKey.getRoot().getChildAt(0).getChildAt(0).getId() == 0);
+    }
+
+    @Test
+    public void savePolytomousKeyNodeData() {
+        PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+
+        PolytomousKeyNode pkeynode = pkey.getRoot();
+        String newQuestion = "New Question";
+        String newStatement = "New Statement";
+
+        Assert.assertEquals("Question 1",pkeynode.getQuestion().getLabel().get(Language.ENGLISH()).getText());
+        for(PolytomousKeyNode node : pkeynode.getChildren()) {
+
+            node.setQuestion(null);
+            node.setStatement(null);
+        }
+        //FIXME:Remoting Add tests for feature after fixing problem
+
+        //Feature feature = pkeynode.getFeature();
+        //Assert.assertEquals(feature.getTitleCache(),"Systematics");
+        //pkeynode.setFeature(null);
+
+        Assert.assertEquals(pkeynode.getChildAt(0).getModifyingText().get(Language.ENGLISH()).getText(),"Modifying Text 1a");
+        String modifyingText = "Modifying Text 1a updated";
+
+        //pkeynode.getChildAt(0).putModifyingText(Language.ENGLISH(), modifyingText);
+
+        Assert.assertEquals(pkeynode.getChildAt(0).getSubkey().getId(),751);
+        Assert.assertEquals("Asphodeline", pkeynode.getChildAt(0).getSubkey().getTitleCache());
+        Assert.assertNull(pkeynode.getChildAt(1).getTaxon());
+        Taxon taxon = CdmBase.deproxy(taxonService.find(taxon1Uuid),Taxon.class);
+        pkeynode.getChildAt(1).setTaxon(taxon);
+
+        polytomousKeyService.merge(pkey);
+
+        pkey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+
+
+        pkeynode = pkey.getRoot();
+        for(PolytomousKeyNode node : pkeynode.getChildren()) {
+            Assert.assertNull(node.getQuestion());
+            node.setQuestion(KeyStatement.NewInstance(Language.ENGLISH(),newQuestion));
+            Assert.assertNull(node.getStatement());
+            node.setStatement(KeyStatement.NewInstance(Language.ENGLISH(),newStatement));
+        }
+
+        Assert.assertEquals(pkeynode.getChildAt(1).getTaxon(), taxon);
+
+        polytomousKeyService.merge(pkey);
+
+        pkey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+
+        pkeynode = pkey.getRoot();
+        for(PolytomousKeyNode node : pkeynode.getChildren()) {
+            Assert.assertNotNull(node.getQuestion());
+            Map<Language, LanguageString> label = node.getQuestion().getLabel();
+            Assert.assertEquals(newQuestion, label.get(Language.ENGLISH()).getText());
+            Assert.assertNotNull(node.getStatement());
+            Assert.assertEquals(newStatement, node.getStatement().getLabel(Language.ENGLISH()).getText());
+        }
+        //Assert.assertEquals(pkeynode.getFeature().getId(), feature.getId());
+
+    }
+
+
+    @Test
+    public void savePolytomousKeyNodeDataWithSameSubKey() {
+
+        PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+
+
+        PolytomousKeyNode pkeynode = pkey.getRoot();
+
+        PolytomousKey subkey1 = CdmBase.deproxy(pkeynode.getChildAt(0).getSubkey(), PolytomousKey.class);
+        String subkey1title = subkey1.getTitleCache();
+        subkey1.setTitleCache(subkey1title + "test", true);
+
+
+        PolytomousKey subkey2 = CdmBase.deproxy(pkeynode.getChildAt(1).getChildAt(0).getSubkey(), PolytomousKey.class);
+        String subkey2title = subkey2.getTitleCache();
+        subkey2.setTitleCache(subkey2title + "test", true);
+
+        Assert.assertSame(subkey1, subkey2);
+
+        polytomousKeyService.merge(pkey);
+    }
+
+    @Test
+    public void savePolytomousKeyNodeDataWithSameSubKeyUsingService() {
+
+        PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+
+
+        PolytomousKeyNode pkeynode = pkey.getRoot();
+//because of the check for null values in getChildren it isn't a persistent list anymore
+  //     PersistentCollection children = (PersistentCollection) pkeynode.getChildren();
+        PolytomousKeyNode childNode0 = (PolytomousKeyNode)commonService.get(pkeynode.getUuid(), "children", 0);
+        PolytomousKey subkey1 = CdmBase.deproxy(childNode0.getSubkey(),PolytomousKey.class);
+        String subkey1title = subkey1.getTitleCache();
+        subkey1.setTitleCache(subkey1title + "test", true);
+
+        PolytomousKeyNode childNode1 = (PolytomousKeyNode)commonService.get(pkeynode.getUuid(), "children", 1);
+        PolytomousKey subkey2 = CdmBase.deproxy(childNode1.getSubkey(),PolytomousKey.class);
+        String subkey2title = subkey2.getTitleCache();
+        subkey2.setTitleCache(subkey2title + "test", true);
+
+        Assert.assertNotSame(childNode0, childNode1);
+
+        Assert.assertSame(subkey1, subkey2);
+
+        polytomousKeyService.merge(pkey);
+    }
+
+
+
+    @Test
+    public void savePolytomousKeyNodeDataWithSameLanguageInLabel() {
+
+        PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+        PolytomousKeyNode pkeynode = pkey.getRoot();
+
+        Map<Language, LanguageString> label1 = pkeynode.getQuestion().getLabel();
+        label1.size();
+
+
+        Map<Language, LanguageString> label2 = pkeynode.getChildAt(0).getStatement().getLabel();
+        label2.size();
+
+
+        polytomousKeyService.merge(pkey);
+    }
+
+    @Test
+    public void deleteSubKeyInPolytomousSubKeyWithoutInitializing() {
+        PolytomousKey pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+
+
+        PolytomousKeyNode rootNode = pKey.getRoot();
+        PolytomousKeyNode child = rootNode.getChildAt(0);
+        PolytomousKey subKey = child.getSubkey();
+
+        polytomousKeyService.delete(subKey.getUuid());
+
+        // retrieving subkey shows its null
+        subKey = CdmBase.deproxy(polytomousKeyService.find(subKeyUuid),PolytomousKey.class);
+        Assert.assertNull(subKey);
+
+        pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+
+
+        rootNode = pKey.getRoot();
+        child = rootNode.getChildAt(0);
+        subKey = child.getSubkey();
+        // subkey will not be null, because the delete functionality of the subkey
+        // does not currently delete it from a polytomous key node
+
+        // FIXME: With the new delete functionality this should be null, shouldn't it ?
+        Assert.assertNotNull(subKey);
+    }
+
+
+    @Test
+    public void deleteSubKeyInPolytomousNode() {
+        PolytomousKey pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+
+
+        PolytomousKeyNode rootNode = pKey.getRoot();
+        List<PolytomousKeyNode> children = rootNode.getChildren();
+        PolytomousKeyNode child = rootNode.getChildAt(0);
+        polytomousKeyNodeService.delete(child.getUuid(), true);
+
+        pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+
+        rootNode = pKey.getRoot();
+        children = rootNode.getChildren();
+        Assert.assertFalse(children.contains(child));
+    }
+
+    @Test
+    public void deleteSubKeyInPolytomousSubKeyAfterInitializing() {
+        PolytomousKey pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+
+
+        PolytomousKeyNode rootNode = pKey.getRoot();
+        PolytomousKeyNode child = rootNode.getChildAt(0);
+        PolytomousKey subKey = child.getSubkey();
+        // this call initializes the subkey
+        subKey.getRoot();
+
+        polytomousKeyService.delete(subKey);
+
+        // since subKey was initialized before the delete, it will be
+        // accesible even after the delete. This behaviour is similar
+        // to hibernate session delete where the deleted object is
+        // made transient, but not deleted from the object graph
+
+        PolytomousKeyNode subKeyRootNode = subKey.getRoot();
+        Assert.assertNotNull(subKey);
+    }
+
+    @Test
+    public void saveNewTermVocabulary() {
+        TermVocabulary termVocabulary =
+                TermVocabulary.NewInstance(TermType.Feature,
+                        null,
+                        "Untitled",
+                        null,
+                        null);
+        try {
+            List<TermVocabulary<DefinedTermBase>> vocabularies = vocabularyService.findByTermType(TermType.Feature);
+
+            for(TermVocabulary vocab : vocabularies) {
+                vocab.getTermsOrderedByLabels(Language.ENGLISH());
+            }
+
+            termVocabulary = vocabularyService.merge(termVocabulary);
+            vocabularies.add(termVocabulary);
+            termVocabulary.setLabel("Test");
+            vocabularyService.merge(new ArrayList<TermVocabulary>(vocabularies));
+        } finally {
+            vocabularyService.delete(termVocabulary);
+        }
+    }
+
+    @Test
+    public void saveNewTerm() {
+        UUID vocNameFeatureUuid = UUID.fromString("fa7ca3eef-4092-49e1-beec-ed5096193e5e");
+        UUID vocFeatureUuid = UUID.fromString("b187d555-f06f-4d65-9e53-da7c93f8eaa8");
+        DefinedTermBase newTerm = TermType.Feature.getEmptyDefinedTermBase();
+        newTerm.setLabel("CreateTest");
+
+        try {
+
+            Assert.assertNotNull(newTerm);
+            TermVocabulary vocNameFeature = vocabularyService.find(vocNameFeatureUuid);
+            TermVocabulary vocFeature = vocabularyService.find(vocFeatureUuid);
+
+            List<TermVocabulary> vocs = new ArrayList<TermVocabulary>();
+
+            vocs.add(vocNameFeature);
+            vocs.add(vocFeature);
+
+            vocNameFeature.addTerm(newTerm);
+
+            vocs = vocabularyService.merge(vocs);
+            for(TermVocabulary voc : vocs) {
+                if(voc.getUuid().equals(vocNameFeatureUuid)) {
+                    vocNameFeature = voc;
+                }
+            }
+
+            Assert.assertTrue(vocNameFeature.getTerms().contains(newTerm));
+
+            for(Object obj : vocNameFeature.getTerms()) {
+                DefinedTermBase dtb = (DefinedTermBase)obj;
+                if("CreateTest".equals(dtb.getLabel())) {
+                    newTerm = dtb;
+                    Assert.assertNotNull(dtb.getCreatedBy());
+                    Assert.assertNotNull(dtb.getCreated());
+                } else {
+                    Assert.assertNull(dtb.getCreatedBy());
+                }
+            }
+            newTerm.setLabel("UpdateTest");
+            newTerm = termService.merge(newTerm);
+            Assert.assertNotNull(newTerm.getUpdatedBy());
+            Assert.assertNotNull(newTerm.getUpdated());
+
+            Assert.assertNull(vocNameFeature.getCreatedBy());
+            Assert.assertNull(vocFeature.getCreatedBy());
+        } finally {
+            if(termService.find(newTerm.getUuid()) != null) {
+                termService.delete(newTerm.getUuid());
+            }
+        }
+    }
+
+
+    @Test
+    public void updatePerson() {
+        // Test for #5138
+        Person person = (Person) CdmApplicationState.getCurrentAppConfig().getAgentService().load(personUuid);
+        person.setFirstname("Me");
+        CdmApplicationState.getCurrentAppConfig().getAgentService().merge(person);
+    }
+
+
+    @Test
+    public void createPerson() {
+        // Test for #5138
+        Person person = Person.NewInstance();
+        person = (Person) CdmApplicationState.getCurrentAppConfig().getAgentService().merge(person);
+        person = (Person) CdmApplicationState.getCurrentAppConfig().getAgentService().load(person.getUuid());
+        person.setFirstname("Some");
+        CdmApplicationState.getCurrentAppConfig().getAgentService().merge(person);
+    }
+
+    @Test
+    public void testThreadLocalActiveSession() throws InterruptedException {
+        MockSessionOwner<CdmBase> so1 = new MockSessionOwner<CdmBase>();
+        final ICdmEntitySession activeSession = getCdmEntitySessionManager().newSession(so1, true);
+        TestThread thread = new TestThread(true) {
+            @Override
+            public void doRun() throws InterruptedException {
+                ICdmEntitySession threadLocalActiveSession = getCdmEntitySessionManager().getActiveSession();
+                Assert.assertEquals(threadLocalActiveSession, activeSession);
+            }
+        };
+        invokeThread(thread);
+        MockSessionOwner<CdmBase> so2 = new MockSessionOwner<CdmBase>();
+        ICdmEntitySession newActiveSession = getCdmEntitySessionManager().newSession(so2, true);
+        Assert.assertFalse(activeSession.equals(newActiveSession));
+        thread.unblock();
+
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionManagerTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionManagerTest.java
new file mode 100644 (file)
index 0000000..a38e68c
--- /dev/null
@@ -0,0 +1,127 @@
+package eu.etaxonomy.taxeditor.session;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.unitils.dbunit.annotation.DataSet;
+
+import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService;
+import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.LanguageString;
+import eu.etaxonomy.cdm.model.description.KeyStatement;
+import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
+import eu.etaxonomy.cdm.persistence.dao.description.IPolytomousKeyNodeDao;
+import eu.etaxonomy.cdm.persistence.dto.MergeResult;
+import eu.etaxonomy.taxeditor.httpinvoker.RemotingSessionAwareTest;
+
+//FIXME:Remoting fix data issue : User#30
+//@Ignore
+@DataSet
+public class CdmEntitySessionManagerTest extends RemotingSessionAwareTest {
+
+       @SuppressWarnings("unused")
+       private static final Logger logger = Logger.getLogger(CdmEntitySessionManagerTest.class);
+
+
+       IPolytomousKeyService polytomousKeyService = getRemoteApplicationController().getPolytomousKeyService();
+       IPolytomousKeyNodeService polytomousKeyNodeService = getRemoteApplicationController().getPolytomousKeyNodeService();
+
+       private final UUID polytomousKeyUuid = UUID.fromString("0d53ba20-7de4-4baa-bd8a-401048447d66");
+       private final Language english = Language.getLanguageFromUuid(Language.uuidEnglish);
+
+
+       @BeforeClass
+       public static void initializeCdmEntitySessionManagerTest() {
+       }
+
+
+       @Test
+       public void manageNullSessionTest() {
+
+               PolytomousKey pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+               cdmEntitySessionManager.bind(null);
+               Assert.assertSame(pKey, pKey);
+               Assert.assertNull(getActiveSession());
+       }
+
+       @Test
+       public void manageSessionWithObjectTest() {
+               PolytomousKey pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+
+               Assert.assertNotNull(getActiveSession());
+
+
+               // FIXME:Remoting fix test of setting root entities
+               //Assert.assertEquals(rootEntities.size(),1);
+               //Assert.assertSame(rootEntities.get(0), pKey);
+
+               String upTitleCache = "Updated Title Cache";
+               String upStatement = "Updated Statement";
+               pKey.setTitleCache(upTitleCache, true);
+
+               PolytomousKeyNode node = pKey.getRoot().getChildAt(0);
+               node.getStatement().getLabel(english).setText(upStatement);
+               polytomousKeyService.merge(pKey, true);
+
+               pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+
+
+               Assert.assertEquals(pKey.getTitleCache(), upTitleCache);
+               node = pKey.getRoot().getChildAt(0);
+               KeyStatement statement = node.getStatement();
+               LanguageString label = statement.getLabel(english);
+               Assert.assertEquals(label.getText(), upStatement);
+       }
+
+       @Test
+       public void manageSessionWithListTest() {
+               List<PolytomousKey> pKeys = polytomousKeyService.list(PolytomousKey.class, null, null, null, null);
+               Assert.assertNotNull(getActiveSession());
+
+
+               // FIXME:Remoting fix test of setting root entities
+               //Assert.assertEquals(rootEntities.size(),2);
+               //Assert.assertSame(rootEntities.get(0),pKeys.get(0));
+               //Assert.assertEquals(rootEntities.get(0).getUuid(),UUID.fromString("9d8bf4f6-a70a-4b80-8556-2ccfb436ff01"));
+               //Assert.assertSame(rootEntities.get(1),pKeys.get(1));
+               //Assert.assertEquals(rootEntities.get(1).getUuid(),UUID.fromString("0d53ba20-7de4-4baa-bd8a-401048447d66"));
+
+               String upTitleCache = "Updated Title Cache";
+               String upStatement = "Updated Statement";
+               pKeys.get(0).setTitleCache(upTitleCache, true);
+               polytomousKeyService.merge(pKeys.get(0));
+               PolytomousKey key = pKeys.get(1);
+               PolytomousKeyNode root = key.getRoot();
+               root = HibernateProxyHelper.deproxy(root, PolytomousKeyNode.class);
+               PolytomousKeyNode node = root.getChildAt(0);
+               List<PolytomousKeyNode> nodes = root.getChildren();
+               node.getStatement().getLabel(english).setText(upStatement);
+               
+               MergeResult<PolytomousKey> result = polytomousKeyService.merge(key, true);
+               key = result.getMergedEntity();
+               pKeys = polytomousKeyService.list(PolytomousKey.class, null, null, null, null);
+
+               Assert.assertEquals(pKeys.get(0).getTitleCache(), upTitleCache);
+               key = pKeys.get(1);
+               root = key.getRoot();
+               nodes = root.getChildren();
+               Iterator<PolytomousKeyNode> it = nodes.iterator();
+               if (it.hasNext()){
+                       node = it.next();
+               } else {
+                       Assert.fail();
+               }
+               Assert.assertEquals(node.getStatement().getLabel(english).getText(), upStatement);
+
+       }
+
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/MockSessionOwner.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/MockSessionOwner.java
new file mode 100644 (file)
index 0000000..d04c17f
--- /dev/null
@@ -0,0 +1,100 @@
+package eu.etaxonomy.taxeditor.session;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.junit.Assert;
+
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
+import eu.etaxonomy.cdm.api.application.ICdmChangeListener;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+
+public class MockSessionOwner<T extends CdmBase> implements ICdmEntitySessionEnabled, ICdmChangeListener {
+
+    private static final Logger logger = Logger.getLogger(MockSessionOwner.class);
+
+    private final List<T> rootEntities;
+    private Set<T> expectedUpdatedObjects;
+    private Set<? extends CdmBase> eventUpdatedObjects;
+
+    private ICdmEntitySession session;
+
+    public MockSessionOwner() {
+        this.rootEntities = null;
+        this.expectedUpdatedObjects = new HashSet<T>();
+    }
+
+//    public MockSessionOwner(Set<T> updatedObjects) {
+//        this.rootEntities = null;
+//        this.updatedObjects = updatedObjects;
+//    }
+//
+//    public MockSessionOwner(List<T> rootEntities) {
+//        this.rootEntities = rootEntities;
+//    }
+
+    public void setExpectedUpdatedObjects(Set<T> updatedObjects) {
+        this.expectedUpdatedObjects = updatedObjects;
+    }
+
+    public void addExpectedUpdatedObject(T updatedObject) {
+        this.expectedUpdatedObjects.add(updatedObject);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getCdmEntitySession()
+     */
+    @Override
+    public ICdmEntitySession getCdmEntitySession() {
+        return session;
+    }
+
+    public void setCdmEntitySession(ICdmEntitySession session) {
+        this.session = session;;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getRootEntities()
+     */
+    @Override
+    public  List<T> getRootEntities() {
+        return rootEntities;
+    }
+
+    public void dispose() {
+        if(session != null) {
+            session.dispose();
+            logger.info("disposed of session from session owner : " + this);
+        }
+    }
+
+    public Set<? extends CdmBase> getEventUpdatedObjects() {
+        return eventUpdatedObjects;
+    }
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+     */
+    @Override
+    public void onChange(CdmChangeEvent event) {
+        eventUpdatedObjects = event.getChangedObjects();
+        if(expectedUpdatedObjects != null && !expectedUpdatedObjects.isEmpty()) {
+            for(CdmBase cb : expectedUpdatedObjects) {
+                Assert.assertTrue(event.getChangedObjects().contains(cb));
+            }
+        }
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+     */
+    @Override
+    public Map<Object, List<String>> getPropertyPathsMap() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/MockConversationEnabled.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/MockConversationEnabled.java
new file mode 100644 (file)
index 0000000..089a3e0
--- /dev/null
@@ -0,0 +1,41 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.test;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.conversation.ConversationHolderMock;
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+
+/**
+ * @author cmathew
+ * @date 15 Jun 2015
+ *
+ */
+public class MockConversationEnabled implements IConversationEnabled {
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
+     */
+    @Override
+    public void update(CdmDataChangeMap arg0) {
+        // TODO Auto-generated method stub
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
+     */
+    @Override
+    public ConversationHolder getConversationHolder() {
+        return new ConversationHolderMock();
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/dialogs/CdmServerInfoTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/dialogs/CdmServerInfoTest.java
new file mode 100644 (file)
index 0000000..7da28a2
--- /dev/null
@@ -0,0 +1,125 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.ui.dialogs;
+
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.unitils.UnitilsJUnit4;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.config.CdmSourceException;
+import eu.etaxonomy.taxeditor.remoting.server.CDMServerException;
+import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfo;
+import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfo.CdmInstanceInfo;
+import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfoConfig;
+
+/**
+ * @author cmathew
+ * @date 26 Jan 2015
+ *
+ */
+
+public class CdmServerInfoTest extends UnitilsJUnit4 {
+
+    @Test
+    public void pingServersTest() {
+        List<CdmServerInfo> servers = CdmServerInfo.getCdmServers();
+        for(CdmServerInfo server : servers) {
+            server.pingServer();
+        }
+    }
+
+
+    @Ignore // this should be targetting integration or production
+    @Test
+    public void pingInstancesTest() {
+        CdmServerInfo csii = new CdmServerInfo(new CdmServerInfoConfig("edit-test", "test.e-taxonomy.eu", 8080, "cdmserver/", false));
+        try {
+            csii.refreshInstances();
+            List<CdmInstanceInfo> instances = csii.getInstances();
+            for(CdmInstanceInfo instance : instances) {
+                Assert.assertTrue(csii.pingInstance(instance, 8080));
+            }
+        } catch (CDMServerException e) {
+            Assert.fail("Execption should not be thrown here");
+        }
+    }
+
+    @Test
+    public void refreshWrongInstancesTest() {
+        CdmServerInfo wrongCsii = new CdmServerInfo(new CdmServerInfoConfig("local", "local", 8080, "noserver", false));
+        try {
+            wrongCsii.refreshInstances();
+            List<CdmInstanceInfo> instances = wrongCsii.getInstances();
+            Assert.fail("Execption should be thrown here");
+        } catch (CDMServerException e) {
+
+        }
+    }
+
+    @Ignore // this should be targetting integration or production
+    @Test
+    public void refreshInstancesTest() throws CDMServerException {
+        CdmServerInfo cdmServerInfo = new CdmServerInfo(new CdmServerInfoConfig("edit-test", "test.e-taxonomy.eu", 8080, "cdmserver/", false));
+        cdmServerInfo.refreshInstances();
+        List<CdmInstanceInfo> instances = cdmServerInfo.getInstances();
+        Assert.assertTrue(instances != null && !instances.isEmpty());
+    }
+
+    @Test
+    public void compareCdmlibServicesVersionTest() throws CdmSourceException {
+        String editorVersion = CdmApplicationState.getCdmlibVersion();
+        String editorCdmlibLastModified = CdmApplicationState.getCdmlibLastModified();
+        Long editorCdmlibLastModifiedLong = Long.valueOf(editorCdmlibLastModified);
+
+        String[] editorVersionSplit = editorVersion.split("\\.");
+
+        Assert.assertEquals(0, CdmServerInfo.compareCdmlibServicesVersion(editorVersion, editorCdmlibLastModified));
+
+
+        int editorVersionMajor = Integer.valueOf(editorVersionSplit[0]);
+        int editorVersionMinor = Integer.valueOf(editorVersionSplit[1]);
+        int editorVersionPatch = Integer.valueOf(editorVersionSplit[2]);
+
+        String serverVersionMajorNew = String.valueOf(editorVersionMajor+1) + "." + String.valueOf(editorVersionMinor) + "." +  String.valueOf(editorVersionPatch);
+        Assert.assertTrue(CdmServerInfo.compareCdmlibServicesVersion(serverVersionMajorNew, editorCdmlibLastModified) > 0);
+
+        String serverVersionMinorNew = String.valueOf(editorVersionMajor) + "." + String.valueOf(editorVersionMinor+1) + "." + String.valueOf(editorVersionPatch);
+        Assert.assertTrue(CdmServerInfo.compareCdmlibServicesVersion(serverVersionMinorNew, editorCdmlibLastModified) > 0);
+
+        String serverVersionPatchNew = String.valueOf(editorVersionMajor) + "." + String.valueOf(editorVersionMinor) + "." + String.valueOf(editorVersionPatch+1);
+        Assert.assertTrue(CdmServerInfo.compareCdmlibServicesVersion(serverVersionPatchNew, editorCdmlibLastModified) > 0);
+
+        String serverVersionMajorOld = String.valueOf(editorVersionMajor-1) + "." + String.valueOf(editorVersionMinor) + "." + String.valueOf(editorVersionPatch);
+        Assert.assertTrue(CdmServerInfo.compareCdmlibServicesVersion(serverVersionMajorOld, editorCdmlibLastModified) < 0);
+
+        String serverVersionMinorOld = String.valueOf(editorVersionMajor) + "." + String.valueOf(editorVersionMinor-1) + "." + String.valueOf(editorVersionPatch);
+        Assert.assertTrue(CdmServerInfo.compareCdmlibServicesVersion(serverVersionMinorOld, editorCdmlibLastModified) < 0);
+
+        String serverVersionPatchOld = String.valueOf(editorVersionMajor) + "." + String.valueOf(editorVersionMinor) + "." + String.valueOf(editorVersionPatch-1);
+        Assert.assertTrue(CdmServerInfo.compareCdmlibServicesVersion(serverVersionPatchOld, editorCdmlibLastModified) < 0);
+
+        String serverCdmlibLastModifiedNew = String.valueOf(editorCdmlibLastModifiedLong+1);
+        Assert.assertTrue(CdmServerInfo.compareCdmlibServicesVersion(editorVersion, serverCdmlibLastModifiedNew) > 0);
+
+        String serverCdmlibLastModifiedOld = String.valueOf(editorCdmlibLastModifiedLong-1);
+        Assert.assertTrue(CdmServerInfo.compareCdmlibServicesVersion(editorVersion, serverCdmlibLastModifiedOld) < 0);
+
+    }
+
+    @Test
+    public void convertToServerConfigTest() {
+
+
+    }
+}
index 2905ba58ba38a88f2a32a1ddd41ec7459080f8b7..786f1fd2490e62896f91f0694ac10d05705b1416 100644 (file)
@@ -1,13 +1,14 @@
 package eu.etaxonomy.taxeditor.ui.dialogs;\r
 \r
 import org.eclipse.swtbot.eclipse.finder.waits.Conditions;\r
+import org.junit.Ignore;\r
 import org.junit.Test;\r
 \r
 import eu.etaxonomy.taxeditor.test.AbstractEditorTest;\r
 \r
-\r
+@Ignore\r
 public class LoginDialogTest extends AbstractEditorTest{\r
-               \r
+\r
        @Test\r
        public void canLoginAsAdmin() throws Exception {\r
                bot.menu("General").menu("Login").click();\r
@@ -16,12 +17,12 @@ public class LoginDialogTest extends AbstractEditorTest{
                bot.textWithLabel("Password").setText("00000");\r
                utils.ok();\r
        }\r
-       \r
+\r
        @Test\r
        public void canCancelLogin() throws Exception {\r
                bot.menu("General").menu("Login").click();\r
                bot.waitUntil(Conditions.shellIsActive("Login"));\r
                utils.cancel();\r
        }\r
-       \r
+\r
 }\r
index 245f93498c619b926cf4124710aa5026ab182868..233cd8127bf2f25099f3e8adc86d0004cfbc2a59 100644 (file)
@@ -1,19 +1,21 @@
 /**\r
- * \r
+ *\r
  */\r
 package eu.etaxonomy.taxeditor.ui.selection;\r
 \r
 import org.eclipse.swtbot.eclipse.finder.waits.Conditions;\r
+import org.junit.Ignore;\r
 import org.junit.Test;\r
 \r
 /**\r
- * This test will only test the selection element itself. The test may have to start other \r
- * dialogs open windows before to get at the selection element. Any errors on the way \r
+ * This test will only test the selection element itself. The test may have to start other\r
+ * dialogs open windows before to get at the selection element. Any errors on the way\r
  * should be handled by different tests.\r
- * \r
+ *\r
  * @author n.hoffmann\r
  *\r
  */\r
+@Ignore\r
 public class ClassificationSelectionElementTest extends AbstractSelectionElementTest{\r
        @Override\r
        public void setup() {\r
@@ -21,7 +23,7 @@ public class ClassificationSelectionElementTest extends AbstractSelectionElement
                bot.menu("General").menu("New").menu("Taxon").click();\r
                bot.waitUntil(Conditions.shellIsActive("New Entity"));\r
        }\r
-       \r
+\r
        @Test\r
        public void canSelectClassification() {\r
                utils.openFilteredSelection(0, "Choose a Classification");\r
index a8b653ca5c32cafd94f7fe9ebc313024ff076511..1f1badc2c7e28f91f3d2e228ef38a8cfd175b1fd 100644 (file)
@@ -1,15 +1,17 @@
 /**\r
- * \r
+ *\r
  */\r
 package eu.etaxonomy.taxeditor.ui.selection;\r
 \r
 import org.eclipse.swtbot.eclipse.finder.waits.Conditions;\r
+import org.junit.Ignore;\r
 import org.junit.Test;\r
 \r
 /**\r
  * @author n.hoffmann\r
  *\r
  */\r
+@Ignore\r
 public class NameSelectionElementTest extends AbstractSelectionElementTest {\r
        @Override\r
        public void setup() {\r
@@ -17,7 +19,7 @@ public class NameSelectionElementTest extends AbstractSelectionElementTest {
                bot.menu("General").menu("New").menu("Taxon").click();\r
                bot.waitUntil(Conditions.shellIsActive("New Entity"));\r
        }\r
-       \r
+\r
        @Test\r
        public void canSelectName() {\r
                utils.openFilteredSelection(3, "Choose a name");\r
index 2b29c873906e4a5a1a951daef1a3a6c82d8cca10..16697a4857268e186a3407d59b5dc259216e67b3 100644 (file)
@@ -1,15 +1,17 @@
 /**\r
- * \r
+ *\r
  */\r
 package eu.etaxonomy.taxeditor.ui.selection;\r
 \r
 import org.eclipse.swtbot.eclipse.finder.waits.Conditions;\r
+import org.junit.Ignore;\r
 import org.junit.Test;\r
 \r
 /**\r
  * @author n.hoffmann\r
  *\r
  */\r
+@Ignore\r
 public class TaxonNodeSelectionElementTest extends AbstractSelectionElementTest {\r
        @Override\r
        public void setup() {\r
@@ -17,11 +19,11 @@ public class TaxonNodeSelectionElementTest extends AbstractSelectionElementTest
                bot.menu("General").menu("New").menu("Taxon").click();\r
                bot.waitUntil(Conditions.shellIsActive("New Entity"));\r
        }\r
-       \r
+\r
        @Test\r
        public void canSelectTaxon() {\r
                utils.openFilteredSelection(1, "Select parent taxon");\r
                utils.cancel();\r
        }\r
-       \r
+\r
 }\r
index af84076b888edb7f4d49549cdc01ad657d2ca6c4..fef3859f671d184031b2fee83fc7c9882e015722 100644 (file)
@@ -1,19 +1,21 @@
 /**\r
- * \r
+ *\r
  */\r
 package eu.etaxonomy.taxeditor.ui.selection;\r
 \r
 import org.eclipse.swtbot.eclipse.finder.waits.Conditions;\r
+import org.junit.Ignore;\r
 import org.junit.Test;\r
 \r
 /**\r
- * This test will only test the selection element itself. The test may have to start other \r
- * dialogs open windows before to get at the selection element. Any errors on the way \r
+ * This test will only test the selection element itself. The test may have to start other\r
+ * dialogs open windows before to get at the selection element. Any errors on the way\r
  * should be handled by different tests.\r
- * \r
+ *\r
  * @author n.hoffmann\r
  *\r
  */\r
+@Ignore\r
 public class TaxonSelectionElementTest extends AbstractSelectionElementTest {\r
        @Override\r
        public void setup() {\r
@@ -21,7 +23,7 @@ public class TaxonSelectionElementTest extends AbstractSelectionElementTest {
                bot.menu("General").menu("New").menu("Taxon").click();\r
                bot.waitUntil(Conditions.shellIsActive("New Entity"));\r
        }\r
-       \r
+\r
        @Test\r
        public void canSelectTaxon() {\r
                utils.openFilteredSelection(2, "Choose a taxon");\r
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/util/H2DbSupport.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/util/H2DbSupport.java
new file mode 100644 (file)
index 0000000..2dddbf5
--- /dev/null
@@ -0,0 +1,166 @@
+package eu.etaxonomy.taxeditor.util;
+
+/**
+ * based on from http://code.google.com/p/java-tester/source/browse/trunk/src/main/java/org/jtester/unitils/database/H2DbSupport.java
+ */
+
+
+import java.util.Set;
+
+import org.unitils.core.dbsupport.DbSupport;
+
+public class H2DbSupport extends DbSupport {
+        /**
+         * Creates support for HsqlDb databases.
+         */
+        public H2DbSupport() {
+                super("h2");
+        }
+
+        @Override
+        public Set<String> getColumnNames(String tableName) {
+                return getSQLHandler().getItemsAsStringSet(
+                                "select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = '" + tableName
+                                                + "' AND TABLE_SCHEMA = '" + getSchemaName() + "'");
+        }
+
+        @Override
+        public Set<String> getTableNames() {
+                return getSQLHandler().getItemsAsStringSet(
+                                "select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_TYPE = 'TABLE' AND TABLE_SCHEMA = '"
+                                                + getSchemaName() + "'");
+        }
+
+        @Override
+        public Set<String> getViewNames() {
+                return getSQLHandler().getItemsAsStringSet(
+                                "select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_TYPE = 'VIEW' AND TABLE_SCHEMA = '"
+                                                + getSchemaName() + "'");
+        }
+
+        @Override
+        public Set<String> getSequenceNames() {
+                return getSQLHandler().getItemsAsStringSet(
+                                "select SEQUENCE_NAME from INFORMATION_SCHEMA.SEQUENCES where SEQUENCE_SCHEMA = '"
+                                                + getSchemaName() + "'");
+        }
+
+        @Override
+        public Set<String> getTriggerNames() {
+                return getSQLHandler().getItemsAsStringSet(
+                                "select TRIGGER_NAME from INFORMATION_SCHEMA.TRIGGERS where TRIGGER_SCHEMA = '" + getSchemaName()
+                                                + "'");
+        }
+
+        @Override
+        public long getSequenceValue(String sequenceName) {
+                return getSQLHandler().getItemAsLong(
+                                "select CURRENT_VALUE from INFORMATION_SCHEMA.SEQUENCES where SEQUENCE_SCHEMA = '"
+                                                + getSchemaName() + "' and SEQUENCE_NAME = '" + sequenceName + "'");
+        }
+
+        @Override
+        public boolean supportsSequences() {
+                return true;
+        }
+
+        @Override
+        public boolean supportsTriggers() {
+                return true;
+        }
+
+        @Override
+        public boolean supportsIdentityColumns() {
+                return true;
+        }
+
+        @Override
+        public void incrementSequenceToValue(String sequenceName, long newSequenceValue) {
+                getSQLHandler().executeUpdate(
+                       "alter sequence " + qualified(sequenceName) + " restart with " + newSequenceValue);
+        }
+
+        @Override
+        public void incrementIdentityColumnToValue(String tableName, String identityColumnName, long identityValue) {
+                getSQLHandler().executeUpdate(
+                      "alter table " + qualified(tableName) + " alter column " + quoted(identityColumnName)
+                           + " RESTART WITH " + identityValue);
+        }
+
+        @Override
+        public void disableReferentialConstraints() {
+                Set<String> tableNames = getTableNames();
+                for (String tableName : tableNames) {
+                       disableReferentialConstraints(tableName);
+                }
+        }
+
+        @Override
+        public void disableValueConstraints() {
+                Set<String> tableNames = getTableNames();
+                for (String tableName : tableNames) {
+                        disableValueConstraints(tableName);
+                }
+        }
+
+        private void disableReferentialConstraints(String tableName) {
+                Set<String> constraintNames = this.getForeignKeyConstraintNames(tableName);
+                for (String constraintName : constraintNames) {
+                       this.removeForeignKeyConstraint(tableName, constraintName);
+                }
+        }
+
+        private void disableValueConstraints(String tableName) {
+                Set<String> primaryKeyColumnNames = this.getPrimaryKeyColumnNames(tableName);
+
+                Set<String> notNullColumnNames = this.getNotNullColummnNames(tableName);
+                for (String notNullColumnName : notNullColumnNames) {
+                    if (primaryKeyColumnNames.contains(notNullColumnName)) {
+                            continue;
+                    }
+                    this.removeNotNullConstraint(tableName, notNullColumnName);
+                }
+        }
+
+        /**
+         * Gets the names of all identity columns of the given table.
+         * <p/>
+         * todo check, at this moment the PK columns are returned
+         *
+         * @param tableName The table, not null
+         * @return The names of the identity columns of the table with the given name
+         */
+        @Override
+        public Set<String> getIdentityColumnNames(String tableName) {
+            return getPrimaryKeyColumnNames(tableName);
+        }
+
+        private Set<String> getPrimaryKeyColumnNames(String tableName) {
+                return getSQLHandler().getItemsAsStringSet(
+                                "select COLUMN_NAME from INFORMATION_SCHEMA.INDEXES where PRIMARY_KEY=TRUE AND TABLE_NAME = '"
+                                                + tableName + "' AND TABLE_SCHEMA = '" + getSchemaName() + "'");
+        }
+
+        private Set<String> getNotNullColummnNames(String tableName) {
+                return getSQLHandler().getItemsAsStringSet(
+                                "select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where IS_NULLABLE = 'NO' AND TABLE_NAME = '"
+                                                + tableName + "' AND TABLE_SCHEMA = '" + getSchemaName() + "'");
+        }
+
+        private Set<String> getForeignKeyConstraintNames(String tableName) {
+                return getSQLHandler().getItemsAsStringSet(
+                                "select CONSTRAINT_NAME from INFORMATION_SCHEMA.CONSTRAINTS "
+                                                + "where CONSTRAINT_TYPE = 'REFERENTIAL' AND TABLE_NAME = '" + tableName
+                                                + "' AND CONSTRAINT_SCHEMA = '" + getSchemaName() + "'");
+        }
+
+        private void removeForeignKeyConstraint(String tableName, String constraintName) {
+                getSQLHandler().executeUpdate(
+                                "alter table " + qualified(tableName) + " drop constraint " + quoted(constraintName));
+        }
+
+        private void removeNotNullConstraint(String tableName, String columnName) {
+                getSQLHandler().executeUpdate(
+                                "alter table " + qualified(tableName) + " alter column " + quoted(columnName) + " set null");
+        }
+}
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/.cdmLibrary/writableResources/cdm.datasources.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/.cdmLibrary/writableResources/cdm.datasources.xml
new file mode 100644 (file)
index 0000000..be23b82
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans      http://www.springframework.org/schema/beans/spring-beans-2.5.xsd     http://www.springframework.org/schema/context     http://www.springframework.org/schema/context/spring-context-2.5.xsd">
+  ls
+  <bean id="cdmTestDataSource" class="eu.etaxonomy.cdm.database.LocalH2" lazy-init="true">
+    <property name="driverClassName" value="org.h2.Driver" />
+    <property name="url" value="jdbc:h2:file:./target/classes/h2/cdmTest;AUTO_SERVER=TRUE" />
+    <property name="username" value="sa" />
+    <property name="password" value="" />
+    <property name="mode" value="embedded" />
+    <property name="nomenclaturalCode" value="ICNAFP" />
+  </bean>
+</beans>
+
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/.cdmLibrary/writableResources/mgd.datasources.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/.cdmLibrary/writableResources/mgd.datasources.xml
new file mode 100644 (file)
index 0000000..3532951
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?> 
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:tx="http://www.springframework.org/schema/tx"
+  xmlns:context="http://www.springframework.org/schema/context"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+  http://www.springframework.org/schema/context   http://www.springframework.org/schema/context/spring-context-2.5.xsd
+  http://www.springframework.org/schema/tx   http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
+">
+ <bean id="dataSourceProperties" class="eu.etaxonomy.cdm.remote.config.DataSourceProperties">
+   <property name="propsMap">
+       <map/>
+   </property>
+ </bean>
+ <bean id="cdmTest" lazy-init="true" class="com.mchange.v2.c3p0.ComboPooledDataSource">
+   <property name="driverClass" value="org.h2.Driver"/>
+   <property name="user" value="sa"/>
+   <property name="password" value=""/>
+   <property name="jdbcUrl" value="jdbc:h2:file:./target/classes/h2/cdmTest;AUTO_SERVER=TRUE"/>
+ </bean>
+</beans>
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/.cdmLibrary/writableResources/test.mgd.datasources.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/.cdmLibrary/writableResources/test.mgd.datasources.xml
new file mode 100644 (file)
index 0000000..c352d50
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?> 
+<!-- DO NOT EDIT THIS FILE MANUALLY. --><!-- It is created by the Taxonomic Editor for launching a managed CDM Server. --><beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:tx="http://www.springframework.org/schema/tx"
+  xmlns:context="http://www.springframework.org/schema/context"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+  http://www.springframework.org/schema/context   http://www.springframework.org/schema/context/spring-context-2.5.xsd
+  http://www.springframework.org/schema/tx   http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
+">
+ <bean id="dataSourceProperties" class="eu.etaxonomy.cdm.remote.config.DataSourceProperties">
+   <property name="propsMap">
+       <map/>
+   </property>
+ </bean>
+ <bean id="MGD_cdmTest" lazy-init="true" class="com.mchange.v2.c3p0.ComboPooledDataSource">
+   <property name="driverClass" value="org.h2.Driver"/>
+   <property name="user" value="sa"/>
+   <property name="password" value=""/>
+   <property name="jdbcUrl" value="jdbc:h2:file:/home/andreas/workspaces/cdm/taxeditor/eu.etaxonomy.taxeditor.test/src/test/resources/.cdmLibrary/writableResources/h2/LocalH2/cdmTest;AUTO_SERVER=TRUE"/>
+ </bean>
+</beans>
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/datasources.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/datasources.xml
new file mode 100644 (file)
index 0000000..ca41919
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:tx="http://www.springframework.org/schema/tx"
+    xmlns:context="http://www.springframework.org/schema/context"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
+    http://www.springframework.org/schema/context   http://www.springframework.org/schema/context/spring-context-2.5.xsd
+    http://www.springframework.org/schema/tx   http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
+    ">
+
+    <!--
+      DataSourceProperties allow configuring specific properties of the datasources
+
+       * cdmlib-remote.xslBasePath:
+            alternative base path for REST services to retrieve XSL style sheets from.
+            the base path must be on the same domain since cross domain xsl loading is
+            not permitted
+      -->
+      <bean id="dataSourceProperties" class="eu.etaxonomy.cdm.remote.config.DataSourceProperties">
+        <property name="propsMap">
+          <map>
+            <!--
+            <entry key="dataSourceBeanID">
+                <props>
+                    <prop key="cdmlib-remote.xslBasePath">/xsl</prop>
+                </props>
+            </entry>
+             -->
+            </map>
+        </property>
+      </bean>
+
+    <bean id="cdmTest"  lazy-init="true" class="com.mchange.v2.c3p0.ComboPooledDataSource">
+        <property name="driverClass" value="org.h2.Driver"/>
+        <property name="user" value="sa" />
+        <property name="password" value="" />
+        <property name="jdbcUrl" value="jdbc:h2:file:${basedir}/target/classes/h2/cdmTest;AUTO_SERVER=TRUE"/>
+    </bean>
+</beans>
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/cdm/api/cache/CdmClientCachingTest.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/cdm/api/cache/CdmClientCachingTest.xml
new file mode 100644 (file)
index 0000000..6346576
--- /dev/null
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?><!--
+  generated by Jailer 4.3, Thu Oct 09 18:00:09 CEST 2014 from cmathew@cmbgbm-t530
+  
+  Extraction Model:  PolytomousKey where uuid like '0d53ba20-7de4-4baa-bd8a-401048447d66' (extractionmodel/by-example/SbE-PolytomousKey-17-59-56-907.csv)
+  Database URL:      jdbc:mysql://127.0.0.1:3306/local-cyprus
+  Database User:     root
+  
+  Exported Rows:     79
+      AgentBase                      1
+      Credit                         1
+      Extension                      1
+      KeyStatement                   10
+      KeyStatement_LanguageString    10
+      LanguageString                 19
+      OriginalSourceBase             2
+      PolytomousKey                  2
+      PolytomousKeyNode              10
+      PolytomousKeyNode_LanguageString 9
+      PolytomousKey_Credit           1
+      PolytomousKey_Extension        1
+      PolytomousKey_OriginalSourceBase 2
+      PolytomousKey_RightsInfo       1
+      PolytomousKey_Taxon            1
+      RightsInfo                     1
+      TaxonBase                      6
+  
+--><dataset>
+  <PolytomousKey_Extension PolytomousKey_id="1550" extensions_id="10"/>
+
+  <PolytomousKey_Credit PolytomousKey_id="1550" credits_id="20" sortIndex="0"/>
+
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2751" modifyingtext_id="13780" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2752" modifyingtext_id="13781" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2753" modifyingtext_id="13795" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2754" modifyingtext_id="13788" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2755" modifyingtext_id="13785" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2756" modifyingtext_id="13787" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2757" modifyingtext_id="13794" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2758" modifyingtext_id="13791" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2759" modifyingtext_id="13793" modifyingtext_mapkey_id="124"/>
+
+  <LanguageString id="13780" created="2014-03-10 10:03:09.0" uuid="cceaa60b-61f4-4c8a-bb0e-d45f0fa3e2dc" text="Modifying Text 1a" language_id="124"/>
+  <LanguageString id="13781" created="2014-03-10 10:03:17.0" uuid="01a0ace4-de49-4725-9909-e881fb13035d" text="Modifying Text 1b" language_id="124"/>
+  <LanguageString id="13782" created="2014-03-10 10:03:48.0" uuid="ec0fea40-69dd-4c3e-ab7a-34948037a069" updated="2014-03-10 10:06:32.0" text="Capitula with ligulate ray-florets; leaves pinnatisect" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13783" created="2014-03-10 10:04:03.0" uuid="82f8a3a0-567f-4d89-ba10-3f3699111d55" updated="2014-03-10 10:06:32.0" text="Ray-florets yellow" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13784" created="2014-03-10 10:04:21.0" uuid="4270501f-1efc-45c2-9e8f-c65f120e8f4c" updated="2014-03-10 10:06:32.0" text="Stem thinly pilose; leaves 10-15 mm wide, with spreading linear-subulate segments; perennial herb" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13785" created="2014-03-10 10:04:07.0" uuid="813f5fd6-c8f6-43e8-9a2b-1464f3ba052a" updated="2014-03-10 10:06:32.0" text="" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13786" created="2014-03-10 10:04:53.0" uuid="ba17ac94-632f-4d69-ac89-a882e19ff1c5" updated="2014-03-10 10:06:32.0" text="Stem white-tomentose; leaves 1-3 mm wide, with minute overlapping, transverse segments; small subshrubs with a woody base" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13787" created="2014-03-10 10:04:34.0" uuid="ab219a5d-e0c4-45fd-8405-6693c3fb8abf" updated="2014-03-10 10:06:32.0" text="" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13788" created="2014-03-10 10:03:53.0" uuid="2baec690-422d-4f85-bcfd-24f5718cbecf" updated="2014-03-10 10:06:32.0" text="" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13789" created="2014-03-10 10:05:16.0" uuid="7c6a7984-8e6f-48b1-86b2-d5d643199bf3" updated="2014-03-10 10:06:32.0" text="Ray-florets white" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13790" created="2014-03-10 10:05:34.0" uuid="72bd8bc9-1904-47ab-8bec-b9296a98b244" updated="2014-03-10 10:06:32.0" text="Perennial herb; stem pilose, hairy or glabrescent, but not tomentose; ligules 1-2 mm diam." createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13791" created="2014-03-10 10:05:20.0" uuid="c917e3fb-e48b-4207-b77d-c1c108e37906" updated="2014-03-10 10:06:32.0" text="" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13792" created="2014-03-10 10:06:15.0" uuid="c5dd35d8-da6a-4d05-b30c-6b55220bd989" updated="2014-03-10 10:06:32.0" text="Shrub with a woody base; stem white-tomentose or woolly; ligules 4-5 mm diam." createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13793" created="2014-03-10 10:06:03.0" uuid="227a17f6-1ca1-4d06-8480-25711b614863" updated="2014-03-10 10:06:32.0" text="" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13794" created="2014-03-10 10:05:07.0" uuid="2c434ab1-8ca7-4464-b5cd-4cee40db41ed" updated="2014-03-10 10:06:32.0" text="" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13795" created="2014-03-10 10:03:38.0" uuid="27190d54-f53b-401e-820c-edfb36d4bcbf" updated="2014-03-10 10:06:32.0" text="" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13796" created="2014-03-10 10:03:25.0" uuid="69cffb28-8a85-478f-bcae-533e20938ccd" updated="2014-03-10 10:06:32.0" text="Capitula without ligulate ray-florets; leaves entire or subentire" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="14570" created="2014-10-09 15:42:33.0" uuid="84967760-6dbe-4af4-8e0c-309f1af6ce20" updated="2014-10-09 15:42:44.0" text="Question 1" createdby_id="10" updatedby_id="10" language_id="124"/>
+  <LanguageString id="14571" created="2014-10-09 15:42:55.0" uuid="d82f37b1-f51d-42c1-a291-0c7820db155e" updated="2014-10-09 15:43:03.0" text="Question 2" createdby_id="10" updatedby_id="10" language_id="124"/>
+  <LanguageString id="14572" created="2014-10-09 15:42:55.0" uuid="d82f37b1-f51d-42c1-a291-0c7820db155f" updated="2014-10-09 15:43:03.0" text="Koi Sach Ya Sawal" createdby_id="30" updatedby_id="30" language_id="125"/>
+
+  <TaxonBase DTYPE="Taxon" id="32" created="2011-03-01 20:11:26.0" uuid="8217ef77-2ab1-4318-bd67-ccd0cdef07c4" protectedtitlecache="false" titleCache="Achillea arabica Kotschy sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="35" created="2010-12-21 15:09:43.0" uuid="fade44fd-34b2-455f-861a-d1372b866f06" protectedtitlecache="false" titleCache="Achillea sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="36" created="2011-03-01 20:11:26.0" uuid="05f0a2e1-e3c3-4e74-8fec-8a0ae89236c3" protectedtitlecache="false" titleCache="Achillea cretica L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="37" created="2011-03-01 20:11:26.0" uuid="0f8d18a9-e861-48e8-bfab-83e01a379bc0" protectedtitlecache="false" titleCache="Achillea maritima (L.)Ehrend. &amp; Y.-P. Guo subsp. maritima sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="40" created="2010-12-21 15:09:43.0" uuid="2b336df7-29e8-4f79-985f-66502739d22f" protectedtitlecache="false" titleCache="Achillea millefolium L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="41" created="2011-03-01 20:11:26.0" uuid="094e1af8-efd8-4605-b037-b4f715379562" protectedtitlecache="false" titleCache="Achillea santolinoides subsp. wilhelmsii (K. Koch) Greuter sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11" sec_id="10" publish="true"/>
+
+  <PolytomousKey_Taxon polytomousKey_id="1550" taxon_id="35"/>
+
+  <RightsInfo id="10" created="2014-10-09 15:45:53.0" uuid="bdfb572b-be25-45e7-9349-22a9da43531f" updated="2014-10-09 15:48:01.0" text="Rights Text Test" createdby_id="10" updatedby_id="10" agent_id="4808" type_id="2056"/>
+
+  <PolytomousKeyNode id="2750" created="2014-03-10 10:02:35.0" uuid="75e4c924-ff58-4ee7-a59d-fd9173517d08" updated="2014-03-10 10:02:42.0" nodenumber="1" createdby_id="30" updatedby_id="30" key_id="1550" question_id="2760" statement_id="2460"/>
+  <PolytomousKeyNode id="2751" created="2014-03-10 10:02:52.0" uuid="23e51ff7-11b1-443b-aff2-3fe8b5ace9fe" sortindex="0" key_id="1550" statement_id="2467" subkey_id="1550" taxon_id="37" parent_id="2750"/>
+  <PolytomousKeyNode id="2752" created="2014-03-10 10:03:16.0" uuid="dcf326f7-c0ad-4e76-b64e-43aea11f767c" key_id="1550"/>
+  <PolytomousKeyNode id="2753" created="2014-03-10 10:03:38.0" uuid="b775c027-13c0-4b87-8aa9-712faeaafbdc" updated="2014-03-10 10:06:32.0" nodenumber="2" sortindex="1" createdby_id="30" updatedby_id="30" key_id="1550" question_id="2761" statement_id="2460"  subkey_id="1550" parent_id="2750"/>
+  <PolytomousKeyNode id="2754" created="2014-03-10 10:03:52.0" uuid="df5d5922-35de-43d5-9d46-7730ae28eeb3" updated="2014-03-10 10:06:32.0" nodenumber="3" sortindex="0" createdby_id="30" updatedby_id="30" key_id="1550" statement_id="2461" subkey_id="1550" parent_id="2753"/>
+  <PolytomousKeyNode id="2755" created="2014-03-10 10:04:07.0" uuid="0c8583ee-399e-433c-b76b-272c54dbd9f5" updated="2014-03-10 10:06:32.0" sortindex="0" createdby_id="30" updatedby_id="30" key_id="1550" statement_id="2462" taxon_id="32" parent_id="2754"/>
+  <PolytomousKeyNode id="2756" created="2014-03-10 10:04:34.0" uuid="a10e1e61-82c0-470e-a245-10a927b80c9a" updated="2014-03-10 10:06:32.0" sortindex="1" createdby_id="30" updatedby_id="30" key_id="1550" statement_id="2463" taxon_id="41" parent_id="2754"/>
+  <PolytomousKeyNode id="2757" created="2014-03-10 10:05:07.0" uuid="19f7a6a2-4c55-49cb-8b92-d68a9fd9074c" updated="2014-03-10 10:06:32.0" nodenumber="4" sortindex="1" createdby_id="30" updatedby_id="30" key_id="1550" statement_id="2464" parent_id="2753"/>
+  <PolytomousKeyNode id="2758" created="2014-03-10 10:05:20.0" uuid="0a4d86d1-fba5-4088-8dcc-6f0e7268ca5b" updated="2014-03-10 10:06:32.0" sortindex="0" createdby_id="30" updatedby_id="30" key_id="1550" statement_id="2465" taxon_id="40" parent_id="2757"/>
+  <PolytomousKeyNode id="2759" created="2014-03-10 10:06:03.0" uuid="827c9df4-ac15-4163-95ab-616d51f62803" updated="2014-03-10 10:06:32.0" sortindex="1" createdby_id="30" updatedby_id="30" key_id="1550" statement_id="2466" taxon_id="36" parent_id="2757"/>
+
+  <Credit id="20" created="2014-10-09 15:45:22.0" uuid="aa412b15-ee6c-4834-b14e-a66969cb398d" updated="2014-10-09 15:48:01.0" text="Credits Text Test" createdby_id="10" updatedby_id="10" language_id="124" agent_id="4809"/>
+
+  <KeyStatement id="2460" created="2014-03-10 10:03:48.0" uuid="66da6df7-784c-4d5a-9378-58b2cf92ba13" updated="2014-03-10 10:06:32.0" createdby_id="30" updatedby_id="30"/>
+  <KeyStatement id="2461" created="2014-03-10 10:04:03.0" uuid="f9cfd498-de47-48fd-b38c-43cf57b63750" updated="2014-03-10 10:06:32.0" createdby_id="30" updatedby_id="30"/>
+  <KeyStatement id="2462" created="2014-03-10 10:04:21.0" uuid="817fb39e-91d4-4d8c-a942-6acab47575d1" updated="2014-03-10 10:06:32.0" createdby_id="30" updatedby_id="30"/>
+  <KeyStatement id="2463" created="2014-03-10 10:04:53.0" uuid="6b571b86-7764-4f27-925c-ae5e2653f7ad" updated="2014-03-10 10:06:32.0" createdby_id="30" updatedby_id="30"/>
+  <KeyStatement id="2464" created="2014-03-10 10:05:16.0" uuid="91bbb534-abdf-4915-9f6f-a0cb41f8cf58" updated="2014-03-10 10:06:32.0" createdby_id="30" updatedby_id="30"/>
+  <KeyStatement id="2465" created="2014-03-10 10:05:34.0" uuid="1991ca31-2630-4917-8db3-eb67cec8f231" updated="2014-03-10 10:06:32.0" createdby_id="30" updatedby_id="30"/>
+  <KeyStatement id="2466" created="2014-03-10 10:06:15.0" uuid="3e1bbc59-b098-4533-ac35-245e1140a0ae" updated="2014-03-10 10:06:32.0" createdby_id="30" updatedby_id="30"/>
+  <KeyStatement id="2467" created="2014-03-10 10:03:24.0" uuid="68fd99f6-64ce-4bb8-a6af-d2cf2c046e2c" updated="2014-03-10 10:06:32.0" createdby_id="30" updatedby_id="30"/>
+  <KeyStatement id="2760" created="2014-10-09 15:42:33.0" uuid="b9702653-f620-4208-bda9-a6fe082004d1" updated="2014-10-09 15:42:44.0" createdby_id="10" updatedby_id="10"/>
+  <KeyStatement id="2761" created="2014-10-09 15:42:55.0" uuid="688a432f-4b57-4c6f-a8f6-0c468a28cb7c" updated="2014-10-09 15:43:03.0" createdby_id="10" updatedby_id="10"/>
+
+  <AgentBase DTYPE="Person" id="4809" created="2010-12-21 15:09:59.0" uuid="945d08f2-eb92-45b6-9252-6275ea6d338b" protectedtitlecache="false" titleCache="R. A. Graham" nomenclaturaltitle="R. A. Graham" createdby_id="11"/>
+
+  <Extension id="10" created="2014-10-09 15:45:41.0" uuid="0d6f35d7-7e76-446a-a017-7e8355ee1b4c" updated="2014-10-09 15:48:01.0" extendedObj_type="eu.etaxonomy.cdm.model.description.PolytomousKey" extendedObj_id="1550" value="http://test.com" createdby_id="10" updatedby_id="10" type_id="2075"/>
+
+  <PolytomousKey_OriginalSourceBase PolytomousKey_id="1550" sources_id="23710"/>
+  <PolytomousKey_OriginalSourceBase PolytomousKey_id="1550" sources_id="23711"/>
+
+  <PolytomousKey_RightsInfo PolytomousKey_id="1550" rights_id="10"/>
+
+  <KeyStatement_LanguageString KeyStatement_id="2460" label_id="13782" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2461" label_id="13783" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2462" label_id="13784" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2463" label_id="13786" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2464" label_id="13789" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2465" label_id="13790" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2466" label_id="13792" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2467" label_id="13796" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2760" label_id="14570" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2761" label_id="14571" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2460" label_id="14572" label_mapkey_id="125"/>  
+
+  <PolytomousKey id="751" created="2013-03-24 11:17:08.0" uuid="9d8bf4f6-a70a-4b80-8556-2ccfb436ff01" protectedtitlecache="true" titleCache="Asphodeline" createdby_id="30"  startNumber="1"/>
+  <PolytomousKey id="1550" created="2014-03-10 10:02:35.0" uuid="0d53ba20-7de4-4baa-bd8a-401048447d66" updated="2014-03-10 10:02:42.0" protectedtitlecache="true" titleCache="Achillea" createdby_id="30" updatedby_id="30" root_id="2750" startNumber="1"/>
+
+  <OriginalSourceBase DTYPE="IdentifiableSource" id="23710" created="2014-03-10 10:06:57.0" uuid="95e05e82-499d-4b8a-ad6b-1085f74a7496" updated="2014-03-10 10:07:33.0" sourcedObj_type="eu.etaxonomy.cdm.model.description.PolytomousKey" sourcedObj_id="1550" createdby_id="30" updatedby_id="30" citation_id="1730" sourceType="PTS"/>
+  <OriginalSourceBase DTYPE="IdentifiableSource" id="23711" created="2014-03-10 10:06:48.0" uuid="f77555fe-0d98-4c9f-98ed-a5bca6b1e342" updated="2014-03-10 10:07:33.0" sourcedObj_type="eu.etaxonomy.cdm.model.description.PolytomousKey" sourcedObj_id="1550" createdby_id="30" updatedby_id="30" citation_id="50" sourceType="PTS"/>
+
+  
+</dataset>
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/cdm/testRemotingApplicationContext.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/cdm/testRemotingApplicationContext.xml
new file mode 100644 (file)
index 0000000..dda9952
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:context="http://www.springframework.org/schema/context"
+  xmlns:tx="http://www.springframework.org/schema/tx"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+    http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
+    http://www.springframework.org/schema/context
+    http://www.springframework.org/schema/context/spring-context-2.5.xsd
+    http://www.springframework.org/schema/tx
+    http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
+
+    <bean id="dataSource" class="org.unitils.database.UnitilsDataSourceFactoryBean"/>          
+
+</beans>
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/lazyloading/AbstractLazyInitializerTest.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/lazyloading/AbstractLazyInitializerTest.xml
new file mode 100644 (file)
index 0000000..babf19b
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?><!--
+  generated by Jailer 4.3, Mon Oct 06 13:11:21 CEST 2014 from cmathew@cmbgbm-t530
+  
+  Extraction Model:  TaxonBase where uuid like '8217ef77-2ab1-4318-bd67-ccd0cdef07c4' (extractionmodel/by-example/SbE-TaxonBase-13-09-59-049.csv)
+  Database URL:      jdbc:mysql://127.0.0.1:3306/local-cyprus
+  Database User:     root
+  
+  Exported Rows:     2
+      TaxonBase                      1
+      TaxonNameBase                  1
+  
+--><dataset>
+  <TaxonNameBase DTYPE="BotanicalName" id="32" created="2010-12-21 15:09:43.0" uuid="f8be96d0-9af9-4e19-b9f1-52a4c0ecc580" protectedtitlecache="true" titleCache="Achillea arabica Kotschy" fullTitleCache="Achillea arabica Kotschy" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="Kotschy" binomhybrid="false" genusoruninomial="Achillea" hybridformula="false" monomhybrid="false" namecache="Achillea arabica" protectedauthorshipcache="false" protectednamecache="false" specificepithet="arabica" trinomhybrid="false" anamorphic="false" createdby_id="11" homotypicalgroup_id="32" rank_id="778" />
+
+  <TaxonBase DTYPE="Taxon" id="32" created="2011-03-01 20:11:26.0" uuid="8217ef77-2ab1-4318-bd67-ccd0cdef07c4" updated="2014-09-17 09:27:47.0" protectedtitlecache="true" titleCache="Achillea arabica Kotschy sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11" name_id="32" sec_id="10" publish="true"/>
+
+  
+</dataset>
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/lazyloading/CdmEntityCacherTest.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/lazyloading/CdmEntityCacherTest.xml
new file mode 100644 (file)
index 0000000..c814154
--- /dev/null
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?><!--
+  generated by Jailer 4.3, Thu Oct 09 18:00:09 CEST 2014 from cmathew@cmbgbm-t530
+  
+  Extraction Model:  PolytomousKey where uuid like '0d53ba20-7de4-4baa-bd8a-401048447d66' (extractionmodel/by-example/SbE-PolytomousKey-17-59-56-907.csv)
+  Database URL:      jdbc:mysql://127.0.0.1:3306/local-cyprus
+  Database User:     root
+  
+  Exported Rows:     79
+      AgentBase                      1
+      Credit                         1
+      Extension                      1
+      KeyStatement                   10
+      KeyStatement_LanguageString    10
+      LanguageString                 19
+      OriginalSourceBase             2
+      PolytomousKey                  2
+      PolytomousKeyNode              10
+      PolytomousKeyNode_LanguageString 9
+      PolytomousKey_Credit           1
+      PolytomousKey_Extension        1
+      PolytomousKey_OriginalSourceBase 2
+      PolytomousKey_RightsInfo       1
+      PolytomousKey_Taxon            1
+      RightsInfo                     1
+      TaxonBase                      6
+  
+--><dataset>
+  <PolytomousKey_Extension PolytomousKey_id="1550" extensions_id="10"/>
+
+  <PolytomousKey_Credit PolytomousKey_id="1550" credits_id="20" sortIndex="0"/>
+
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2751" modifyingtext_id="13780" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2752" modifyingtext_id="13781" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2753" modifyingtext_id="13795" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2754" modifyingtext_id="13788" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2755" modifyingtext_id="13785" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2756" modifyingtext_id="13787" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2757" modifyingtext_id="13794" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2758" modifyingtext_id="13791" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2759" modifyingtext_id="13793" modifyingtext_mapkey_id="124"/>
+
+  <LanguageString id="13780" created="2014-03-10 10:03:09.0" uuid="cceaa60b-61f4-4c8a-bb0e-d45f0fa3e2dc" text="Modifying Text 1a" language_id="124"/>
+  <LanguageString id="13781" created="2014-03-10 10:03:17.0" uuid="01a0ace4-de49-4725-9909-e881fb13035d" text="" language_id="124"/>
+  <LanguageString id="13782" created="2014-03-10 10:03:48.0" uuid="ec0fea40-69dd-4c3e-ab7a-34948037a069" updated="2014-03-10 10:06:32.0" text="Capitula with ligulate ray-florets; leaves pinnatisect" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13783" created="2014-03-10 10:04:03.0" uuid="82f8a3a0-567f-4d89-ba10-3f3699111d55" updated="2014-03-10 10:06:32.0" text="Ray-florets yellow" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13784" created="2014-03-10 10:04:21.0" uuid="4270501f-1efc-45c2-9e8f-c65f120e8f4c" updated="2014-03-10 10:06:32.0" text="Stem thinly pilose; leaves 10-15 mm wide, with spreading linear-subulate segments; perennial herb" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13785" created="2014-03-10 10:04:07.0" uuid="813f5fd6-c8f6-43e8-9a2b-1464f3ba052a" updated="2014-03-10 10:06:32.0" text="" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13786" created="2014-03-10 10:04:53.0" uuid="ba17ac94-632f-4d69-ac89-a882e19ff1c5" updated="2014-03-10 10:06:32.0" text="Stem white-tomentose; leaves 1-3 mm wide, with minute overlapping, transverse segments; small subshrubs with a woody base" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13787" created="2014-03-10 10:04:34.0" uuid="ab219a5d-e0c4-45fd-8405-6693c3fb8abf" updated="2014-03-10 10:06:32.0" text="" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13788" created="2014-03-10 10:03:53.0" uuid="2baec690-422d-4f85-bcfd-24f5718cbecf" updated="2014-03-10 10:06:32.0" text="" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13789" created="2014-03-10 10:05:16.0" uuid="7c6a7984-8e6f-48b1-86b2-d5d643199bf3" updated="2014-03-10 10:06:32.0" text="Ray-florets white" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13790" created="2014-03-10 10:05:34.0" uuid="72bd8bc9-1904-47ab-8bec-b9296a98b244" updated="2014-03-10 10:06:32.0" text="Perennial herb; stem pilose, hairy or glabrescent, but not tomentose; ligules 1-2 mm diam." createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13791" created="2014-03-10 10:05:20.0" uuid="c917e3fb-e48b-4207-b77d-c1c108e37906" updated="2014-03-10 10:06:32.0" text="" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13792" created="2014-03-10 10:06:15.0" uuid="c5dd35d8-da6a-4d05-b30c-6b55220bd989" updated="2014-03-10 10:06:32.0" text="Shrub with a woody base; stem white-tomentose or woolly; ligules 4-5 mm diam." createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13793" created="2014-03-10 10:06:03.0" uuid="227a17f6-1ca1-4d06-8480-25711b614863" updated="2014-03-10 10:06:32.0" text="" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13794" created="2014-03-10 10:05:07.0" uuid="2c434ab1-8ca7-4464-b5cd-4cee40db41ed" updated="2014-03-10 10:06:32.0" text="" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13795" created="2014-03-10 10:03:38.0" uuid="27190d54-f53b-401e-820c-edfb36d4bcbf" updated="2014-03-10 10:06:32.0" text="" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="13796" created="2014-03-10 10:03:25.0" uuid="69cffb28-8a85-478f-bcae-533e20938ccd" updated="2014-03-10 10:06:32.0" text="Capitula without ligulate ray-florets; leaves entire or subentire" createdby_id="30" updatedby_id="30" language_id="124"/>
+  <LanguageString id="14570" created="2014-10-09 15:42:33.0" uuid="84967760-6dbe-4af4-8e0c-309f1af6ce20" updated="2014-10-09 15:42:44.0" text="Question 1" createdby_id="10" updatedby_id="10" language_id="124"/>
+  <LanguageString id="14571" created="2014-10-09 15:42:55.0" uuid="d82f37b1-f51d-42c1-a291-0c7820db155e" updated="2014-10-09 15:43:03.0" text="Question 2" createdby_id="10" updatedby_id="10" language_id="124"/>
+
+  <TaxonBase DTYPE="Taxon" id="32" created="2011-03-01 20:11:26.0" uuid="8217ef77-2ab1-4318-bd67-ccd0cdef07c4" protectedtitlecache="false" titleCache="Achillea arabica Kotschy sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="35" created="2010-12-21 15:09:43.0" uuid="fade44fd-34b2-455f-861a-d1372b866f06" protectedtitlecache="false" titleCache="Achillea sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="36" created="2011-03-01 20:11:26.0" uuid="05f0a2e1-e3c3-4e74-8fec-8a0ae89236c3" protectedtitlecache="false" titleCache="Achillea cretica L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="37" created="2011-03-01 20:11:26.0" uuid="0f8d18a9-e861-48e8-bfab-83e01a379bc0" protectedtitlecache="false" titleCache="Achillea maritima (L.)Ehrend. &amp; Y.-P. Guo subsp. maritima sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="40" created="2010-12-21 15:09:43.0" uuid="2b336df7-29e8-4f79-985f-66502739d22f" protectedtitlecache="false" titleCache="Achillea millefolium L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="41" created="2011-03-01 20:11:26.0" uuid="094e1af8-efd8-4605-b037-b4f715379562" protectedtitlecache="false" titleCache="Achillea santolinoides subsp. wilhelmsii (K. Koch) Greuter sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11" sec_id="10" publish="true"/>
+
+  <PolytomousKey_Taxon polytomousKey_id="1550" taxon_id="35"/>
+
+  <RightsInfo id="10" created="2014-10-09 15:45:53.0" uuid="bdfb572b-be25-45e7-9349-22a9da43531f" updated="2014-10-09 15:48:01.0" text="Rights Text Test" createdby_id="10" updatedby_id="10" agent_id="4808" type_id="2056"/>
+
+  <PolytomousKeyNode id="2750" created="2014-03-10 10:02:35.0" uuid="75e4c924-ff58-4ee7-a59d-fd9173517d08" updated="2014-03-10 10:02:42.0" nodenumber="1" createdby_id="30" updatedby_id="30" key_id="1550" question_id="2760"/>
+  <PolytomousKeyNode id="2751" created="2014-03-10 10:02:52.0" uuid="23e51ff7-11b1-443b-aff2-3fe8b5ace9fe" sortindex="0" key_id="1550" statement_id="2467" subkey_id="751" taxon_id="37" parent_id="2750"/>
+  <PolytomousKeyNode id="2752" created="2014-03-10 10:03:16.0" uuid="dcf326f7-c0ad-4e76-b64e-43aea11f767c" key_id="1550"/>
+  <PolytomousKeyNode id="2753" created="2014-03-10 10:03:38.0" uuid="b775c027-13c0-4b87-8aa9-712faeaafbdc" updated="2014-03-10 10:06:32.0" nodenumber="2" sortindex="1" createdby_id="30" updatedby_id="30" key_id="1550" question_id="2761" statement_id="2460"  subkey_id="751" parent_id="2750"/>
+  <PolytomousKeyNode id="2754" created="2014-03-10 10:03:52.0" uuid="df5d5922-35de-43d5-9d46-7730ae28eeb3" updated="2014-03-10 10:06:32.0" nodenumber="3" sortindex="0" createdby_id="30" updatedby_id="30" key_id="1550" statement_id="2461" subkey_id="751" parent_id="2753"/>
+  <PolytomousKeyNode id="2755" created="2014-03-10 10:04:07.0" uuid="0c8583ee-399e-433c-b76b-272c54dbd9f5" updated="2014-03-10 10:06:32.0" sortindex="0" createdby_id="30" updatedby_id="30" key_id="1550" statement_id="2462" taxon_id="32" parent_id="2754"/>
+  <PolytomousKeyNode id="2756" created="2014-03-10 10:04:34.0" uuid="a10e1e61-82c0-470e-a245-10a927b80c9a" updated="2014-03-10 10:06:32.0" sortindex="1" createdby_id="30" updatedby_id="30" key_id="1550" statement_id="2463" taxon_id="41" parent_id="2754"/>
+  <PolytomousKeyNode id="2757" created="2014-03-10 10:05:07.0" uuid="19f7a6a2-4c55-49cb-8b92-d68a9fd9074c" updated="2014-03-10 10:06:32.0" nodenumber="4" sortindex="1" createdby_id="30" updatedby_id="30" key_id="1550" statement_id="2464" parent_id="2753"/>
+  <PolytomousKeyNode id="2758" created="2014-03-10 10:05:20.0" uuid="0a4d86d1-fba5-4088-8dcc-6f0e7268ca5b" updated="2014-03-10 10:06:32.0" sortindex="0" createdby_id="30" updatedby_id="30" key_id="1550" statement_id="2465" taxon_id="40" parent_id="2757"/>
+  <PolytomousKeyNode id="2759" created="2014-03-10 10:06:03.0" uuid="827c9df4-ac15-4163-95ab-616d51f62803" updated="2014-03-10 10:06:32.0" sortindex="1" createdby_id="30" updatedby_id="30" key_id="1550" statement_id="2466" taxon_id="36" parent_id="2757"/>
+
+  <Credit id="20" created="2014-10-09 15:45:22.0" uuid="aa412b15-ee6c-4834-b14e-a66969cb398d" updated="2014-10-09 15:48:01.0" text="Credits Text Test" createdby_id="10" updatedby_id="10" language_id="124" agent_id="4809"/>
+
+  <KeyStatement id="2460" created="2014-03-10 10:03:48.0" uuid="66da6df7-784c-4d5a-9378-58b2cf92ba13" updated="2014-03-10 10:06:32.0" createdby_id="30" updatedby_id="30"/>
+  <KeyStatement id="2461" created="2014-03-10 10:04:03.0" uuid="f9cfd498-de47-48fd-b38c-43cf57b63750" updated="2014-03-10 10:06:32.0" createdby_id="30" updatedby_id="30"/>
+  <KeyStatement id="2462" created="2014-03-10 10:04:21.0" uuid="817fb39e-91d4-4d8c-a942-6acab47575d1" updated="2014-03-10 10:06:32.0" createdby_id="30" updatedby_id="30"/>
+  <KeyStatement id="2463" created="2014-03-10 10:04:53.0" uuid="6b571b86-7764-4f27-925c-ae5e2653f7ad" updated="2014-03-10 10:06:32.0" createdby_id="30" updatedby_id="30"/>
+  <KeyStatement id="2464" created="2014-03-10 10:05:16.0" uuid="91bbb534-abdf-4915-9f6f-a0cb41f8cf58" updated="2014-03-10 10:06:32.0" createdby_id="30" updatedby_id="30"/>
+  <KeyStatement id="2465" created="2014-03-10 10:05:34.0" uuid="1991ca31-2630-4917-8db3-eb67cec8f231" updated="2014-03-10 10:06:32.0" createdby_id="30" updatedby_id="30"/>
+  <KeyStatement id="2466" created="2014-03-10 10:06:15.0" uuid="3e1bbc59-b098-4533-ac35-245e1140a0ae" updated="2014-03-10 10:06:32.0" createdby_id="30" updatedby_id="30"/>
+  <KeyStatement id="2467" created="2014-03-10 10:03:24.0" uuid="68fd99f6-64ce-4bb8-a6af-d2cf2c046e2c" updated="2014-03-10 10:06:32.0" createdby_id="30" updatedby_id="30"/>
+  <KeyStatement id="2760" created="2014-10-09 15:42:33.0" uuid="b9702653-f620-4208-bda9-a6fe082004d1" updated="2014-10-09 15:42:44.0" createdby_id="10" updatedby_id="10"/>
+  <KeyStatement id="2761" created="2014-10-09 15:42:55.0" uuid="688a432f-4b57-4c6f-a8f6-0c468a28cb7c" updated="2014-10-09 15:43:03.0" createdby_id="10" updatedby_id="10"/>
+
+  <AgentBase DTYPE="Person" id="4809" created="2010-12-21 15:09:59.0" uuid="945d08f2-eb92-45b6-9252-6275ea6d338b" protectedtitlecache="false" titleCache="R. A. Graham" nomenclaturaltitle="R. A. Graham" createdby_id="11"/>
+
+  <Extension id="10" created="2014-10-09 15:45:41.0" uuid="0d6f35d7-7e76-446a-a017-7e8355ee1b4c" updated="2014-10-09 15:48:01.0" extendedObj_type="eu.etaxonomy.cdm.model.description.PolytomousKey" extendedObj_id="1550" value="http://test.com" createdby_id="10" updatedby_id="10" type_id="2075"/>
+
+  <PolytomousKey_OriginalSourceBase PolytomousKey_id="1550" sources_id="23710"/>
+  <PolytomousKey_OriginalSourceBase PolytomousKey_id="1550" sources_id="23711"/>
+
+  <PolytomousKey_RightsInfo PolytomousKey_id="1550" rights_id="10"/>
+
+  <KeyStatement_LanguageString KeyStatement_id="2460" label_id="13782" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2461" label_id="13783" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2462" label_id="13784" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2463" label_id="13786" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2464" label_id="13789" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2465" label_id="13790" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2466" label_id="13792" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2467" label_id="13796" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2760" label_id="14570" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2761" label_id="14571" label_mapkey_id="124"/>
+
+  <PolytomousKey id="751" created="2013-03-24 11:17:08.0" uuid="9d8bf4f6-a70a-4b80-8556-2ccfb436ff01" protectedtitlecache="true" titleCache="Asphodeline" createdby_id="30"  startNumber="1"/>
+  <PolytomousKey id="1550" created="2014-03-10 10:02:35.0" uuid="0d53ba20-7de4-4baa-bd8a-401048447d66" updated="2014-03-10 10:02:42.0" protectedtitlecache="true" titleCache="Achillea" createdby_id="30" updatedby_id="30" root_id="2750" startNumber="1"/>
+
+  <OriginalSourceBase DTYPE="IdentifiableSource" id="23710" created="2014-03-10 10:06:57.0" uuid="95e05e82-499d-4b8a-ad6b-1085f74a7496" updated="2014-03-10 10:07:33.0" sourcedObj_type="eu.etaxonomy.cdm.model.description.PolytomousKey" sourcedObj_id="1550" createdby_id="30" updatedby_id="30" citation_id="1730" sourceType="PTS"/>
+  <OriginalSourceBase DTYPE="IdentifiableSource" id="23711" created="2014-03-10 10:06:48.0" uuid="f77555fe-0d98-4c9f-98ed-a5bca6b1e342" updated="2014-03-10 10:07:33.0" sourcedObj_type="eu.etaxonomy.cdm.model.description.PolytomousKey" sourcedObj_id="1550" createdby_id="30" updatedby_id="30" citation_id="50" sourceType="PTS"/>
+
+  <LanguageString id="10"/>
+</dataset>
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/PolytomousKeyViewPartTest.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/PolytomousKeyViewPartTest.xml
new file mode 100644 (file)
index 0000000..ec6b580
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?><!--
+  generated by Jailer 4.3, Mon Jun 29 14:15:44 CEST 2015 from cmathew@cmbgbm-t530
+  
+  Extraction Model:  PolytomousKey where id = 90 or id = 111 or id = 112 or id = 113 or id = 114 or id = 115 or id = 116 (extractionmodel/by-example/SbE-PolytomousKey-14-15-18-725.csv)
+  Database URL:      jdbc:mysql://127.0.0.1:3306/local-cyprus
+  Database User:     root
+  
+  Exported Rows:     10
+      PolytomousKey                  7
+      PolytomousKeyNode              3
+  
+--><dataset>
+  <PolytomousKeyNode id="100" created="2012-11-23 19:53:37.0" uuid="c8e296da-441d-403b-9647-d729c00b2aa4" updated="2014-01-24 13:21:03.0" nodenumber="1"   key_id="90"/>
+  <PolytomousKeyNode id="101" created="2012-11-23 19:53:54.0" uuid="588754cd-6098-40d3-bb37-05d0a6676336" sortindex="0"  key_id="90"   parent_id="100"/>
+  <PolytomousKeyNode id="102" created="2012-11-23 19:54:42.0" uuid="52ea0b19-f29e-49fc-8326-02292fda4e43" sortindex="1"  key_id="90"   parent_id="100"/>
+
+  <PolytomousKey id="90" created="2012-11-23 19:53:37.0" uuid="f82cef88-5a9e-4917-9938-d08bda40836f" protectedtitlecache="true" titleCache="Cleome"  root_id="100" startNumber="1"/>
+  <PolytomousKey id="111" created="2013-02-15 16:26:38.0" uuid="a00ca7ec-b660-433c-bd14-596826ab2243" protectedtitlecache="true" titleCache="Ammi"   startNumber="1"/>
+  <PolytomousKey id="112" created="2013-02-15 16:31:54.0" uuid="197bc542-bf5b-4a52-aa66-c65df32c196b" protectedtitlecache="true" titleCache="Adonis"   startNumber="1"/>
+  <PolytomousKey id="113" created="2013-02-15 16:50:59.0" uuid="2ebacbb0-13f4-4407-8579-d5968e09a905" protectedtitlecache="true" titleCache="Enarthrocarpus"   startNumber="1"/>
+  <PolytomousKey id="114" created="2013-02-15 16:54:31.0" uuid="0426418c-5b76-4c19-8177-6bebb4d37329" protectedtitlecache="true" titleCache="Glaucium"  startNumber="1"/>
+  <PolytomousKey id="115" created="2013-02-15 17:05:42.0" uuid="6aa69b73-6242-4d3d-85c9-485aab9b1975" protectedtitlecache="true" titleCache="Sagina"   startNumber="1"/>
+  <PolytomousKey id="116" created="2013-02-15 17:09:43.0" uuid="cfe7626d-49cc-4dac-acbc-601825deb44a" protectedtitlecache="true" titleCache="Dianthus"   startNumber="1"/>
+
+  
+</dataset>
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/RemotingCdmUpdateOperationTest.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/RemotingCdmUpdateOperationTest.xml
new file mode 100644 (file)
index 0000000..b0afec0
--- /dev/null
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?><!--
+  generated by Jailer 4.3, Fri Jun 19 09:13:03 CEST 2015 from cmathew@cmbgbm-t530
+  
+  Extraction Model:  all rows from Classification (extractionmodel/by-example/SbE-Classification-09-10-20-259.csv)
+  Database URL:      jdbc:mysql://127.0.0.1:3306/local-cyprus
+  Database User:     root
+  
+  Exported Rows:     67
+      Classification                 1
+      DescriptionBase                22
+      TaxonBase                      14
+      TaxonNameBase                  14
+      TaxonNode                      16
+  
+--><dataset>
+  <TaxonNode id="46" created="2010-12-21 15:09:43.0" uuid="168a4d09-a2b0-4206-b4cc-5d13199f9306" countchildren="0"   classification_id="10" parent_id="47" taxon_id="48" treeIndex="#t10#4032#49#48#47#46#" sortIndex="0"/>
+  <TaxonNode id="47" created="2010-12-21 15:09:43.0" uuid="2f05d429-632d-4230-b9cb-70299360b470" countchildren="1"   classification_id="10" parent_id="48" taxon_id="51" treeIndex="#t10#4032#49#48#47#" sortIndex="0"/>
+  <TaxonNode id="48" created="2010-12-21 15:09:43.0" uuid="24773d3b-8f11-4400-99de-71658982b245" countchildren="6"   classification_id="10" parent_id="49"  treeIndex="#t10#4032#49#48#" sortIndex="0"/>
+  <TaxonNode id="49" created="2010-12-21 15:09:43.0" uuid="572290a9-7535-48c8-9f68-25ddbc9869ee" countchildren="10"   classification_id="10" parent_id="4032" taxon_id="49" treeIndex="#t10#4032#49#" sortIndex="0"/>
+  <TaxonNode id="236" created="2010-12-21 15:09:45.0" uuid="f5d97f8b-c673-4050-af06-bbfab33baaec" countchildren="0"   classification_id="10" parent_id="237" taxon_id="264" treeIndex="#t10#4032#49#48#237#236#" sortIndex="0"/>
+  <TaxonNode id="237" created="2010-12-21 15:09:45.0" uuid="4998de90-d0be-433b-a62f-0d57a1e399b0" countchildren="1"   classification_id="10" parent_id="48" taxon_id="265" treeIndex="#t10#4032#49#48#237#" sortIndex="1"/>
+  <TaxonNode id="714" created="2010-12-21 15:09:48.0" uuid="b85b5b78-6760-409f-ac91-bb89e95ff2a1" countchildren="0"   classification_id="10" parent_id="715" taxon_id="812" treeIndex="#t10#4032#49#48#715#714#" sortIndex="0"/>
+  <TaxonNode id="715" created="2010-12-21 15:09:48.0" uuid="91698cec-615f-4472-9002-feda1a6acded" countchildren="2"   classification_id="10" parent_id="48" taxon_id="814" treeIndex="#t10#4032#49#48#715#" sortIndex="2"/>
+  <TaxonNode id="716" created="2010-12-21 15:09:48.0" uuid="6ad8e9e2-f5f6-41ad-aa30-f62a903650db" countchildren="0"   classification_id="10" parent_id="715" taxon_id="815" treeIndex="#t10#4032#49#48#715#716#" sortIndex="1"/>
+  <TaxonNode id="828" created="2010-12-21 15:09:49.0" uuid="786622ba-cb2c-47f4-9eeb-65a6ebb7122b" countchildren="0"   classification_id="10" parent_id="829" taxon_id="946" treeIndex="#t10#4032#49#48#829#828#" sortIndex="0"/>
+  <TaxonNode id="829" created="2010-12-21 15:09:49.0" uuid="4fe03763-b966-4361-8334-352f6f777588" countchildren="1"   classification_id="10" parent_id="48" taxon_id="948" treeIndex="#t10#4032#49#48#829#" sortIndex="3"/>
+  <TaxonNode id="1915" created="2010-12-21 15:09:57.0" uuid="99f03b56-67cd-4e01-9ceb-2362d48f9d07" countchildren="0"   classification_id="10" parent_id="1916" taxon_id="2203" treeIndex="#t10#4032#49#48#1916#1915#" sortIndex="0"/>
+  <TaxonNode id="1916" created="2010-12-21 15:09:57.0" uuid="d8998200-500f-4312-90f4-2b60e6fd3a78" countchildren="1"   classification_id="10" parent_id="48" taxon_id="2205" treeIndex="#t10#4032#49#48#1916#" sortIndex="4"/>
+  <TaxonNode id="2354" created="2010-12-21 15:10:00.0" uuid="b8439f51-6b96-445a-b401-7a836ba1cf58" countchildren="0"   classification_id="10" parent_id="2355" taxon_id="2737" treeIndex="#t10#4032#49#48#2355#2354#" sortIndex="0"/>
+  <TaxonNode id="2355" created="2010-12-21 15:10:00.0" uuid="6da4e5b6-ebc3-4c46-bdce-24161b7bd0e2" countchildren="1"   classification_id="10" parent_id="48" taxon_id="2738" treeIndex="#t10#4032#49#48#2355#" sortIndex="5"/>
+  <TaxonNode id="4032" created="2014-01-16 10:24:29.0" uuid="29b3fd3f-29b4-4011-ab12-9c1ad1607dbd" countchildren="1" classification_id="10" treeIndex="#t10#4032#"/>
+
+  <TaxonNameBase DTYPE="BotanicalName" id="48" created="2010-12-21 15:09:43.0" uuid="7aceb517-2b91-46b9-a5a2-88b7e0fb3230" protectedtitlecache="false" titleCache="Adiantum capillus-veneris L." fullTitleCache="Adiantum capillus-veneris L." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="L." binomhybrid="false" genusoruninomial="Adiantum" hybridformula="false" monomhybrid="false" namecache="Adiantum capillus-veneris" protectedauthorshipcache="false" protectednamecache="false" specificepithet="capillus-veneris" trinomhybrid="false" anamorphic="false"    rank_id="778" />
+  <TaxonNameBase DTYPE="BotanicalName" id="49" created="2010-12-21 15:09:43.0" uuid="079fff38-ff2d-426b-a49e-70b0f1db6c31" protectedtitlecache="false" titleCache="Pteridophyta" fullTitleCache="Pteridophyta" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Pteridophyta" hybridformula="false" monomhybrid="false" namecache="Pteridophyta" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="810"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="51" created="2010-12-21 15:09:43.0" uuid="c8af63e0-7bd4-4fad-aa2d-3777cbe1210a" protectedtitlecache="false" titleCache="Adiantum" fullTitleCache="Adiantum" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Adiantum" hybridformula="false" monomhybrid="false" namecache="Adiantum" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="788"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="264" created="2010-12-21 15:09:45.0" uuid="b976da6a-dd84-4fcd-9a1b-9847afba1da2" protectedtitlecache="false" titleCache="Anogramma leptophylla (L.) Link" fullTitleCache="Anogramma leptophylla (L.) Link" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="(L.) Link" binomhybrid="false" genusoruninomial="Anogramma" hybridformula="false" monomhybrid="false" namecache="Anogramma leptophylla" protectedauthorshipcache="false" protectednamecache="false" specificepithet="leptophylla" trinomhybrid="false" anamorphic="false"    rank_id="778"  />
+  <TaxonNameBase DTYPE="BotanicalName" id="265" created="2010-12-21 15:09:45.0" uuid="c7f1db22-20fb-4eeb-810b-d37c5593b95d" protectedtitlecache="false" titleCache="Anogramma" fullTitleCache="Anogramma" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Anogramma" hybridformula="false" monomhybrid="false" namecache="Anogramma" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="788"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="812" created="2010-12-21 15:09:48.0" uuid="16450a2d-2085-471f-804a-defcd43c03e4" protectedtitlecache="false" titleCache="Cheilanthes acrostica (Balb.) Tod." fullTitleCache="Cheilanthes acrostica (Balb.) Tod." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="(Balb.) Tod." binomhybrid="false" genusoruninomial="Cheilanthes" hybridformula="false" monomhybrid="false" namecache="Cheilanthes acrostica" protectedauthorshipcache="false" protectednamecache="false" specificepithet="acrostica" trinomhybrid="false" anamorphic="false"    rank_id="778"  />
+  <TaxonNameBase DTYPE="BotanicalName" id="814" created="2010-12-21 15:09:48.0" uuid="bbb1c5be-5a0c-45e2-b8af-f37a80ccf858" protectedtitlecache="false" titleCache="Cheilanthes" fullTitleCache="Cheilanthes" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Cheilanthes" hybridformula="false" monomhybrid="false" namecache="Cheilanthes" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="788"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="815" created="2010-12-21 15:09:48.0" uuid="f04a9283-f856-4d28-b469-4a222472862b" protectedtitlecache="false" titleCache="Cheilanthes maderensis Lowe" fullTitleCache="Cheilanthes maderensis Lowe" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="Lowe" binomhybrid="false" genusoruninomial="Cheilanthes" hybridformula="false" monomhybrid="false" namecache="Cheilanthes maderensis" protectedauthorshipcache="false" protectednamecache="false" specificepithet="maderensis" trinomhybrid="false" anamorphic="false"    rank_id="778" />
+  <TaxonNameBase DTYPE="BotanicalName" id="946" created="2010-12-21 15:09:49.0" uuid="e30ef44b-52e4-41ff-a68d-9912d3c537f1" protectedtitlecache="false" titleCache="Cosentinia vellea (Aiton) Tod." fullTitleCache="Cosentinia vellea (Aiton) Tod." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="(Aiton) Tod." binomhybrid="false" genusoruninomial="Cosentinia" hybridformula="false" monomhybrid="false" namecache="Cosentinia vellea" protectedauthorshipcache="false" protectednamecache="false" specificepithet="vellea" trinomhybrid="false" anamorphic="false"    rank_id="778"  />
+  <TaxonNameBase DTYPE="BotanicalName" id="948" created="2010-12-21 15:09:49.0" uuid="21fda99e-0425-4f29-b7b2-196f8a51b054" protectedtitlecache="false" titleCache="Cosentinia" fullTitleCache="Cosentinia" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Cosentinia" hybridformula="false" monomhybrid="false" namecache="Cosentinia" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="788"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="2203" created="2010-12-21 15:09:57.0" uuid="8fe0bb4b-7687-4d32-8ff2-94e690980f81" protectedtitlecache="false" titleCache="Notholaena marantae (L.) Desv." fullTitleCache="Notholaena marantae (L.) Desv." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="(L.) Desv." binomhybrid="false" genusoruninomial="Notholaena" hybridformula="false" monomhybrid="false" namecache="Notholaena marantae" protectedauthorshipcache="false" protectednamecache="false" specificepithet="marantae" trinomhybrid="false" anamorphic="false"    rank_id="778"  />
+  <TaxonNameBase DTYPE="BotanicalName" id="2205" created="2010-12-21 15:09:57.0" uuid="77b7934f-8f62-4798-b96a-f3d12bfd5ebf" protectedtitlecache="false" titleCache="Notholaena" fullTitleCache="Notholaena" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Notholaena" hybridformula="false" monomhybrid="false" namecache="Notholaena" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="788"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="2737" created="2010-12-21 15:10:00.0" uuid="25560d66-07a3-41ce-8244-36ca98638c71" protectedtitlecache="false" titleCache="Pteris vittata L." fullTitleCache="Pteris vittata L." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="L." binomhybrid="false" genusoruninomial="Pteris" hybridformula="false" monomhybrid="false" namecache="Pteris vittata" protectedauthorshipcache="false" protectednamecache="false" specificepithet="vittata" trinomhybrid="false" anamorphic="false"    rank_id="778" />
+  <TaxonNameBase DTYPE="BotanicalName" id="2738" created="2010-12-21 15:10:00.0" uuid="a40593ce-e8cc-43bb-a391-2de988b09039" protectedtitlecache="false" titleCache="Pteris" fullTitleCache="Pteris" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Pteris" hybridformula="false" monomhybrid="false" namecache="Pteris" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="788"/>
+
+  <Classification id="10" created="2010-12-21 15:09:43.0" uuid="0c2b5d25-7b15-4401-8b51-dd4be0ee5cab" updated="2015-06-09 07:10:42.0" protectedtitlecache="false" titleCache="Cyprus"   updatedby_id="10" name_id="10"  rootnode_id="4032"/>
+
+  <TaxonBase DTYPE="Taxon" id="48" created="2011-03-01 20:11:26.0" uuid="b8402dc4-5050-4882-a147-01b71e0e47d6" protectedtitlecache="false" titleCache="Adiantum capillus-veneris L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="48"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="49" created="2010-12-21 15:09:43.0" uuid="1141a510-5ee8-4a59-ae60-7b4fea44872f" protectedtitlecache="false" titleCache="Pteridophyta sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="49"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="51" created="2010-12-21 15:09:43.0" uuid="233cac41-bb05-4925-bb9e-ab0bdf330973" protectedtitlecache="false" titleCache="Adiantum sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="51"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="264" created="2011-03-01 20:11:27.0" uuid="d679c5d0-53b3-40fc-97e1-0646aad7ed23" protectedtitlecache="false" titleCache="Anogramma leptophylla (L.) Link sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="264"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="265" created="2010-12-21 15:09:45.0" uuid="1fc1d927-1155-4282-a9f5-f07202f79ace" protectedtitlecache="false" titleCache="Anogramma sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="265"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="812" created="2011-03-01 20:11:29.0" uuid="e40854d7-143f-4054-b229-6ed4cedb4bff" protectedtitlecache="false" titleCache="Cheilanthes acrostica (Balb.) Tod. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="812"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="814" created="2010-12-21 15:09:48.0" uuid="433ad11a-b931-49a4-8128-d6f4d454914a" protectedtitlecache="false" titleCache="Cheilanthes sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="814"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="815" created="2010-12-21 15:09:48.0" uuid="7ea2c74a-f2b2-41f6-acdf-1ca35f5d03f8" protectedtitlecache="false" titleCache="Cheilanthes maderensis Lowe sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="815"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="946" created="2011-03-01 20:11:30.0" uuid="ba21b018-97d2-42d7-af6c-5e8db8e495ff" protectedtitlecache="false" titleCache="Cosentinia vellea (Aiton) Tod. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="946"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="948" created="2010-12-21 15:09:49.0" uuid="a2768f6d-80f2-4e0c-a6e3-99b7a9f3bc9d" protectedtitlecache="false" titleCache="Cosentinia sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="948"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="2203" created="2011-03-01 20:11:36.0" uuid="d9a0c5d5-baee-4b6b-974a-a7de5affe748" protectedtitlecache="false" titleCache="Notholaena marantae (L.) Desv. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="2203"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="2205" created="2010-12-21 15:09:57.0" uuid="c221d34c-76b0-4fc7-9901-e72efd4c899b" protectedtitlecache="false" titleCache="Notholaena sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="2205"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="2737" created="2011-03-01 20:11:39.0" uuid="6b46ac55-3e39-4c37-a1b6-b680b21599b2" protectedtitlecache="false" titleCache="Pteris vittata L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="2737"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="2738" created="2010-12-21 15:10:00.0" uuid="8ac3dca2-6bbf-4cd4-84b7-53ddc2973ed8" protectedtitlecache="false" titleCache="Pteris sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="2738"  publish="true"/>
+
+  <DescriptionBase DTYPE="TaxonDescription" id="28" created="2010-12-21 15:09:43.0" uuid="f04f8f66-ad92-42d0-89bc-04ac5b36163c" updated="2011-03-01 19:20:45.0" protectedtitlecache="false" titleCache="Taxon description for Adiantum capillus-veneris L." imagegallery="false"   taxon_id="48"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="149" created="2010-12-21 15:09:45.0" uuid="24df0fca-bfc4-4f0f-a269-336985ed6e5e" updated="2011-03-01 19:20:46.0" protectedtitlecache="false" titleCache="Taxon description for Anogramma leptophylla (L.) Link" imagegallery="false"   taxon_id="264"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="447" created="2010-12-21 15:09:48.0" uuid="01863b86-c6ae-48b8-a8da-f693be9087da" updated="2011-03-01 19:20:48.0" protectedtitlecache="false" titleCache="Taxon description for Cheilanthes acrostica (Balbis) Tod." imagegallery="false"   taxon_id="812"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="448" created="2010-12-21 15:09:48.0" uuid="aac7b184-e622-409b-8eda-e14998b9021d" protectedtitlecache="false" titleCache="Taxon description for Cheilanthes maderensis Lowe" imagegallery="false"   taxon_id="815"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="521" created="2010-12-21 15:09:49.0" uuid="2d672585-0f35-42f8-9923-dfd5545e6369" updated="2011-03-01 19:20:48.0" protectedtitlecache="false" titleCache="Taxon description for Cosentinia vellea (Aiton) Tod." imagegallery="false"   taxon_id="946"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="1234" created="2010-12-21 15:09:57.0" uuid="a8a734c2-122b-4d5b-9c89-a852f4ab4661" updated="2011-03-01 19:20:53.0" protectedtitlecache="false" titleCache="Taxon description for Notholaena marantae (L.) Desv." imagegallery="false"   taxon_id="2203"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="1524" created="2010-12-21 15:10:00.0" uuid="c4e66d46-e4fb-4da2-a432-3f1cf5353b81" updated="2011-03-01 19:20:55.0" protectedtitlecache="false" titleCache="Taxon description for Pteris vittata L." imagegallery="false"   taxon_id="2737"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4567" created="2011-03-01 19:20:45.0" uuid="dd0f7395-6162-4ce4-8ece-774011b09325" updated="2011-03-01 20:11:26.0" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Adiantum capillus-veneris L. sec. Cyprus" imagegallery="false" taxon_id="48"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4627" created="2011-03-01 19:20:46.0" uuid="34266202-eb5d-41ec-a0b2-da56deb11cc7" updated="2011-03-01 20:11:27.0" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Anogramma leptophylla (L.) Link sec. Cyprus" imagegallery="false" taxon_id="264"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4798" created="2011-03-01 19:20:48.0" uuid="504b0178-39e6-4c79-8e33-ca00b0662f27" updated="2011-03-01 20:11:29.0" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Cheilanthes acrostica (Balbis) Tod. sec. Cyprus" imagegallery="false" taxon_id="812"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4840" created="2011-03-01 19:20:48.0" uuid="73396d11-5d35-43fb-8b15-4d472bdcdd43" updated="2011-03-01 20:11:30.0" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Cosentinia vellea (Aiton) Tod. sec. Cyprus" imagegallery="false" taxon_id="946"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="5409" created="2011-03-01 19:20:55.0" uuid="64a797b2-7f92-4012-a4f5-d76f8aaeb6b4" updated="2011-03-01 20:11:39.0" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Pteris vittata L. sec. Cyprus" imagegallery="false" taxon_id="2737"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="5974" created="2011-03-01 19:20:53.0" uuid="71872861-8229-4cab-8042-b75dfa0e3f63" updated="2011-03-01 20:11:36.0" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Notholaena marantae (L.) Desv. sec. Cyprus" imagegallery="false" taxon_id="2203"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="11766" created="2012-07-30 15:39:44.0" uuid="6b4be8a2-ea86-4815-bd31-b022055a90f2" protectedtitlecache="false" titleCache="Image gallery for Pteris vittata L." imagegallery="true"   taxon_id="2737"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="12353" created="2012-12-03 12:21:48.0" uuid="b8d3a151-032e-48d9-9191-d7b8fb1fe1a0" protectedtitlecache="false" titleCache="Image gallery for Cheilanthes acrostica (Balbis) Tod." imagegallery="true"   taxon_id="812"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="12713" created="2013-02-10 21:43:33.0" uuid="61fbdc1b-80bf-4aea-b6cb-8f4d466bd923" protectedtitlecache="false" titleCache="Image gallery for Adiantum capillus-veneris L." imagegallery="true"   taxon_id="48"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="13728" created="2014-02-28 19:20:29.0" uuid="53b3125e-2a43-4433-a4dd-50dd9a4cf92c" updated="2014-02-28 19:20:29.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="48"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="13817" created="2014-02-28 19:20:34.0" uuid="7b108193-e689-417a-bcab-adaf6c49d532" updated="2014-02-28 19:20:34.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="264"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14043" created="2014-02-28 19:20:58.0" uuid="de29cc97-a160-4783-b996-b929157335d5" updated="2014-02-28 19:20:58.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="812"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14101" created="2014-02-28 19:21:07.0" uuid="815336d3-19d6-493d-9ea4-bcb320d1b922" updated="2014-02-28 19:21:08.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="946"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14658" created="2014-02-28 19:23:51.0" uuid="ce4068f8-17b0-46e2-9fbb-e8c16efb7255" updated="2014-02-28 19:23:51.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2203"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14864" created="2014-02-28 19:25:21.0" uuid="2d55f445-8e72-43d3-976a-133828e89599" updated="2014-02-28 19:25:21.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2737"/>
+
+  <SynonymRelationship/>
+  
+  <LanguageString id="10"/>
+</dataset>
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/TaxonNameEditorTest.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/TaxonNameEditorTest.xml
new file mode 100644 (file)
index 0000000..5d91d40
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?><!--
+  generated by Jailer 4.3, Wed Mar 04 16:11:14 CET 2015 from cmathew@cmbgbm-t530
+  
+  Extraction Model:  all rows from Classification (extractionmodel/by-example/SbE-Classification-16-11-06-737.csv)
+  Database URL:      jdbc:mysql://127.0.0.1:3306/local-cyprus
+  Database User:     root
+  
+  Exported Rows:     31
+      Classification                 1
+      HomotypicalGroup               2
+      SynonymRelationship            1
+      TaxonBase                      5
+      TaxonNameBase                  3
+      TaxonNode                      19
+  
+--><dataset>
+  
+  
+  <TaxonNode id="347" created="2010-12-21 15:09:45.0" uuid="d425a971-1abe-4895-9e1f-1e5c8ff1c84c" countchildren="0"  classification_id="10"  taxon_id="387" treeIndex="#t10#4032#49#346#345#347#" sortIndex="1"/>  
+  <TaxonNode id="351" created="2010-12-21 15:09:46.0" uuid="ce54c396-3694-47f2-abb0-1d7b7e057985" countchildren="0"  classification_id="10"  taxon_id="394" treeIndex="#t10#4032#49#346#345#351#" sortIndex="4"/>
+  
+  <HomotypicalGroup id="368" created="2010-12-21 15:09:45.0" uuid="d7eaa174-4efd-4d09-a427-dce4ed6513f7" />
+  <HomotypicalGroup id="375" created="2010-12-21 15:09:46.0" uuid="62ed57d6-2c69-4404-bb95-248a1c9bb24c" />
+
+  <TaxonNameBase DTYPE="BotanicalName" id="387" created="2010-12-21 15:09:45.0" uuid="d25985c7-6fb4-4b31-8a94-5d7c5ba6ad16" protectedtitlecache="false" titleCache="Asplenium ceterach L." fullTitleCache="Asplenium ceterach L." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="L." binomhybrid="false" genusoruninomial="Asplenium" hybridformula="false" monomhybrid="false" namecache="Asplenium ceterach" protectedauthorshipcache="false" protectednamecache="false" specificepithet="ceterach" trinomhybrid="false" anamorphic="false"  homotypicalgroup_id="368" rank_id="778" />
+  <TaxonNameBase DTYPE="BotanicalName" id="388" created="2010-12-21 15:09:45.0" uuid="747021f1-cf5f-4249-a825-228da3368399" protectedtitlecache="true" titleCache="Asplenium cyprium Viane &amp; Van den heede" fullTitleCache="Asplenium cyprium Viane &amp; Van den heede" parsingproblem="16" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" hybridformula="false" monomhybrid="false" namecache="Asplenium cyprium Viane &amp; Van den heede" protectedauthorshipcache="false" protectednamecache="true" trinomhybrid="false" anamorphic="false" />
+  <TaxonNameBase DTYPE="BotanicalName" id="394" created="2010-12-21 15:09:46.0" uuid="08f8f376-c9a4-4ea9-950d-3ac30b7fa689" protectedtitlecache="false" titleCache="Asplenium viride Huds." fullTitleCache="Asplenium viride Huds." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="Huds." binomhybrid="false" genusoruninomial="Asplenium" hybridformula="false" monomhybrid="false" namecache="Asplenium viride" protectedauthorshipcache="false" protectednamecache="false" specificepithet="viride" trinomhybrid="false" anamorphic="false"  homotypicalgroup_id="375" rank_id="778" />
+
+  <Classification id="10" created="2010-12-21 15:09:43.0" uuid="0c2b5d25-7b15-4401-8b51-dd4be0ee5cab" protectedtitlecache="false" titleCache="Cyprus"  name_id="10" reference_id="10" />
+  <TaxonBase DTYPE="Taxon" id="387" created="2011-03-01 20:11:27.0" uuid="9763e5f0-6cd4-4d96-b8a4-4420854f7727" protectedtitlecache="false" titleCache="Asplenium ceterach L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"  name_id="387" sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Synonym" id="388" created="2010-12-21 15:09:45.0" uuid="1eb173bd-b174-4162-8ff5-5136d8f1e746" protectedtitlecache="false" titleCache="Asplenium cyprium Viane &amp; Van den heede sec. Cyprus" doubtful="false" usenamecache="false"  name_id="388" sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="394" created="2011-03-01 20:11:27.0" uuid="aff4fa6f-9aa8-463d-ac07-ec8a1925eb57" protectedtitlecache="false" titleCache="Asplenium viride Huds. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"  name_id="394" sec_id="10" publish="true"/>
+
+  <SynonymRelationship id="50" created="2010-12-21 15:09:45.0" uuid="60d1466f-5823-4a69-a071-1887d0c1e72b" doubtful="false" partial="false" proparte="false"  relatedfrom_id="388" relatedto_id="387" />
+
+  <LanguageString id="10"/>
+  <DescriptionBase/>
+  <DescriptionElementBase/>
+</dataset>
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/TaxonNavigatorTest.testDeleteClassificationWithDeleteChildren.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/TaxonNavigatorTest.testDeleteClassificationWithDeleteChildren.xml
new file mode 100644 (file)
index 0000000..fec9221
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?><!--
+  generated by Jailer 4.3, Mon Jun 22 14:57:08 CEST 2015 from cmathew@cmbgbm-t530
+  
+  Extraction Model:  all rows from Classification (extractionmodel/by-example/SbE-Classification-14-56-50-312.csv)
+  Database URL:      jdbc:mysql://127.0.0.1:3306/local-cyprus
+  Database User:     root
+  
+  Exported Rows:     6
+      Classification                 1
+      TaxonBase                      2
+      TaxonNode                      3
+  
+--><dataset>
+  <TaxonNode id="13" created="2010-12-21 15:09:43.0" uuid="0ac32f24-6d55-44ae-8519-c86c83faa938" countchildren="122"  classification_id="10" parent_id="4032" taxon_id="11" treeIndex="#t10#4032#13#" sortIndex="0"/>
+  <TaxonNode id="49" created="2010-12-21 15:09:43.0" uuid="572290a9-7535-48c8-9f68-25ddbc9869ee" countchildren="10"  classification_id="10" parent_id="4032" taxon_id="49" treeIndex="#t10#4032#49#" sortIndex="1"/>
+  <TaxonNode id="4032" created="2014-01-16 10:24:29.0" uuid="29b3fd3f-29b4-4011-ab12-9c1ad1607dbd" countchildren="2" classification_id="10" treeIndex="#t10#4032#"/>
+
+  <Classification id="10" created="2010-12-21 15:09:43.0" uuid="0c2b5d25-7b15-4401-8b51-dd4be0ee5cab" updated="2015-06-09 07:10:42.0" protectedtitlecache="false" titleCache="Cyprus"  updatedby_id="10"   rootnode_id="4032"/>
+
+  <TaxonBase DTYPE="Taxon" id="11" created="2010-12-21 15:09:43.0" uuid="575347a4-fac0-4af7-8514-a4246b45fd7d" protectedtitlecache="false" titleCache="Spermatophyta sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"    publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="49" created="2010-12-21 15:09:43.0" uuid="1141a510-5ee8-4a59-ae60-7b4fea44872f" protectedtitlecache="false" titleCache="Pteridophyta sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"    publish="true"/>
+
+  
+</dataset>
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/TaxonNavigatorTest.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/TaxonNavigatorTest.xml
new file mode 100644 (file)
index 0000000..80bb4a9
--- /dev/null
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?><!--
+  generated by Jailer 4.3, Fri Jun 19 09:13:03 CEST 2015 from cmathew@cmbgbm-t530
+  
+  Extraction Model:  all rows from Classification (extractionmodel/by-example/SbE-Classification-09-10-20-259.csv)
+  Database URL:      jdbc:mysql://127.0.0.1:3306/local-cyprus
+  Database User:     root
+  
+  Exported Rows:     67
+      Classification                 1
+      DescriptionBase                22
+      TaxonBase                      14
+      TaxonNameBase                  14
+      TaxonNode                      16
+  
+--><dataset>
+  <TaxonNode id="46" created="2010-12-21 15:09:43.0" uuid="168a4d09-a2b0-4206-b4cc-5d13199f9306" countchildren="0"   classification_id="10" parent_id="47" taxon_id="48" treeIndex="#t10#4032#49#48#47#46#" sortIndex="0"/>
+  <TaxonNode id="47" created="2010-12-21 15:09:43.0" uuid="2f05d429-632d-4230-b9cb-70299360b470" countchildren="1"   classification_id="10" parent_id="48" taxon_id="51" treeIndex="#t10#4032#49#48#47#" sortIndex="0"/>
+  <TaxonNode id="48" created="2010-12-21 15:09:43.0"
+       uuid="24773d3b-8f11-4400-99de-71658982b245" countchildren="6"
+       classification_id="10" parent_id="49" treeIndex="#t10#4032#49#48#"
+       sortIndex="0" taxon_id="2739" />
+  <TaxonNode id="49" created="2010-12-21 15:09:43.0" uuid="572290a9-7535-48c8-9f68-25ddbc9869ee" countchildren="10"   classification_id="10" parent_id="4032" taxon_id="49" treeIndex="#t10#4032#49#" sortIndex="0"/>
+  <TaxonNode id="236" created="2010-12-21 15:09:45.0" uuid="f5d97f8b-c673-4050-af06-bbfab33baaec" countchildren="0"   classification_id="10" parent_id="237" taxon_id="264" treeIndex="#t10#4032#49#48#237#236#" sortIndex="0"/>
+  <TaxonNode id="237" created="2010-12-21 15:09:45.0" uuid="4998de90-d0be-433b-a62f-0d57a1e399b0" countchildren="1"   classification_id="10" parent_id="48" taxon_id="265" treeIndex="#t10#4032#49#48#237#" sortIndex="1"/>
+  <TaxonNode id="714" created="2010-12-21 15:09:48.0" uuid="b85b5b78-6760-409f-ac91-bb89e95ff2a1" countchildren="0"   classification_id="10" parent_id="715" taxon_id="812" treeIndex="#t10#4032#49#48#715#714#" sortIndex="0"/>
+  <TaxonNode id="715" created="2010-12-21 15:09:48.0" uuid="91698cec-615f-4472-9002-feda1a6acded" countchildren="2"   classification_id="10" parent_id="48" taxon_id="814" treeIndex="#t10#4032#49#48#715#" sortIndex="2"/>
+  <TaxonNode id="716" created="2010-12-21 15:09:48.0" uuid="6ad8e9e2-f5f6-41ad-aa30-f62a903650db" countchildren="0"   classification_id="10" parent_id="715" taxon_id="815" treeIndex="#t10#4032#49#48#715#716#" sortIndex="1"/>
+  <TaxonNode id="828" created="2010-12-21 15:09:49.0" uuid="786622ba-cb2c-47f4-9eeb-65a6ebb7122b" countchildren="0"   classification_id="10" parent_id="829" taxon_id="946" treeIndex="#t10#4032#49#48#829#828#" sortIndex="0"/>
+  <TaxonNode id="829" created="2010-12-21 15:09:49.0" uuid="4fe03763-b966-4361-8334-352f6f777588" countchildren="1"   classification_id="10" parent_id="48" taxon_id="948" treeIndex="#t10#4032#49#48#829#" sortIndex="3"/>
+  <TaxonNode id="1915" created="2010-12-21 15:09:57.0" uuid="99f03b56-67cd-4e01-9ceb-2362d48f9d07" countchildren="0"   classification_id="10" parent_id="1916" taxon_id="2203" treeIndex="#t10#4032#49#48#1916#1915#" sortIndex="0"/>
+  <TaxonNode id="1916" created="2010-12-21 15:09:57.0" uuid="d8998200-500f-4312-90f4-2b60e6fd3a78" countchildren="1"   classification_id="10" parent_id="48" taxon_id="2205" treeIndex="#t10#4032#49#48#1916#" sortIndex="4"/>
+  <TaxonNode id="2354" created="2010-12-21 15:10:00.0" uuid="b8439f51-6b96-445a-b401-7a836ba1cf58" countchildren="0"   classification_id="10" parent_id="2355" taxon_id="2737" treeIndex="#t10#4032#49#48#2355#2354#" sortIndex="0"/>
+  <TaxonNode id="2355" created="2010-12-21 15:10:00.0" uuid="6da4e5b6-ebc3-4c46-bdce-24161b7bd0e2" countchildren="1"   classification_id="10" parent_id="48" taxon_id="2738" treeIndex="#t10#4032#49#48#2355#" sortIndex="5"/>
+  <TaxonNode id="4032" created="2014-01-16 10:24:29.0" uuid="29b3fd3f-29b4-4011-ab12-9c1ad1607dbd" countchildren="1" classification_id="10" treeIndex="#t10#4032#"/>
+
+  <TaxonNameBase DTYPE="BotanicalName" id="48" created="2010-12-21 15:09:43.0" uuid="7aceb517-2b91-46b9-a5a2-88b7e0fb3230" protectedtitlecache="false" titleCache="Adiantum capillus-veneris L." fullTitleCache="Adiantum capillus-veneris L." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="L." binomhybrid="false" genusoruninomial="Adiantum" hybridformula="false" monomhybrid="false" namecache="Adiantum capillus-veneris" protectedauthorshipcache="false" protectednamecache="false" specificepithet="capillus-veneris" trinomhybrid="false" anamorphic="false"    rank_id="778" />
+  <TaxonNameBase DTYPE="BotanicalName" id="49" created="2010-12-21 15:09:43.0" uuid="079fff38-ff2d-426b-a49e-70b0f1db6c31" protectedtitlecache="false" titleCache="Pteridophyta" fullTitleCache="Pteridophyta" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Pteridophyta" hybridformula="false" monomhybrid="false" namecache="Pteridophyta" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="810"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="51" created="2010-12-21 15:09:43.0" uuid="c8af63e0-7bd4-4fad-aa2d-3777cbe1210a" protectedtitlecache="false" titleCache="Adiantum" fullTitleCache="Adiantum" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Adiantum" hybridformula="false" monomhybrid="false" namecache="Adiantum" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="788"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="264" created="2010-12-21 15:09:45.0" uuid="b976da6a-dd84-4fcd-9a1b-9847afba1da2" protectedtitlecache="false" titleCache="Anogramma leptophylla (L.) Link" fullTitleCache="Anogramma leptophylla (L.) Link" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="(L.) Link" binomhybrid="false" genusoruninomial="Anogramma" hybridformula="false" monomhybrid="false" namecache="Anogramma leptophylla" protectedauthorshipcache="false" protectednamecache="false" specificepithet="leptophylla" trinomhybrid="false" anamorphic="false"    rank_id="778"  />
+  <TaxonNameBase DTYPE="BotanicalName" id="265" created="2010-12-21 15:09:45.0" uuid="c7f1db22-20fb-4eeb-810b-d37c5593b95d" protectedtitlecache="false" titleCache="Anogramma" fullTitleCache="Anogramma" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Anogramma" hybridformula="false" monomhybrid="false" namecache="Anogramma" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="788"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="812" created="2010-12-21 15:09:48.0" uuid="16450a2d-2085-471f-804a-defcd43c03e4" protectedtitlecache="false" titleCache="Cheilanthes acrostica (Balb.) Tod." fullTitleCache="Cheilanthes acrostica (Balb.) Tod." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="(Balb.) Tod." binomhybrid="false" genusoruninomial="Cheilanthes" hybridformula="false" monomhybrid="false" namecache="Cheilanthes acrostica" protectedauthorshipcache="false" protectednamecache="false" specificepithet="acrostica" trinomhybrid="false" anamorphic="false"    rank_id="778"  />
+  <TaxonNameBase DTYPE="BotanicalName" id="814" created="2010-12-21 15:09:48.0" uuid="bbb1c5be-5a0c-45e2-b8af-f37a80ccf858" protectedtitlecache="false" titleCache="Cheilanthes" fullTitleCache="Cheilanthes" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Cheilanthes" hybridformula="false" monomhybrid="false" namecache="Cheilanthes" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="788"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="815" created="2010-12-21 15:09:48.0" uuid="f04a9283-f856-4d28-b469-4a222472862b" protectedtitlecache="false" titleCache="Cheilanthes maderensis Lowe" fullTitleCache="Cheilanthes maderensis Lowe" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="Lowe" binomhybrid="false" genusoruninomial="Cheilanthes" hybridformula="false" monomhybrid="false" namecache="Cheilanthes maderensis" protectedauthorshipcache="false" protectednamecache="false" specificepithet="maderensis" trinomhybrid="false" anamorphic="false"    rank_id="778" />
+  <TaxonNameBase DTYPE="BotanicalName" id="946" created="2010-12-21 15:09:49.0" uuid="e30ef44b-52e4-41ff-a68d-9912d3c537f1" protectedtitlecache="false" titleCache="Cosentinia vellea (Aiton) Tod." fullTitleCache="Cosentinia vellea (Aiton) Tod." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="(Aiton) Tod." binomhybrid="false" genusoruninomial="Cosentinia" hybridformula="false" monomhybrid="false" namecache="Cosentinia vellea" protectedauthorshipcache="false" protectednamecache="false" specificepithet="vellea" trinomhybrid="false" anamorphic="false"    rank_id="778"  />
+  <TaxonNameBase DTYPE="BotanicalName" id="948" created="2010-12-21 15:09:49.0" uuid="21fda99e-0425-4f29-b7b2-196f8a51b054" protectedtitlecache="false" titleCache="Cosentinia" fullTitleCache="Cosentinia" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Cosentinia" hybridformula="false" monomhybrid="false" namecache="Cosentinia" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="788"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="2203" created="2010-12-21 15:09:57.0" uuid="8fe0bb4b-7687-4d32-8ff2-94e690980f81" protectedtitlecache="false" titleCache="Notholaena marantae (L.) Desv." fullTitleCache="Notholaena marantae (L.) Desv." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="(L.) Desv." binomhybrid="false" genusoruninomial="Notholaena" hybridformula="false" monomhybrid="false" namecache="Notholaena marantae" protectedauthorshipcache="false" protectednamecache="false" specificepithet="marantae" trinomhybrid="false" anamorphic="false"    rank_id="778"  />
+  <TaxonNameBase DTYPE="BotanicalName" id="2205" created="2010-12-21 15:09:57.0" uuid="77b7934f-8f62-4798-b96a-f3d12bfd5ebf" protectedtitlecache="false" titleCache="Notholaena" fullTitleCache="Notholaena" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Notholaena" hybridformula="false" monomhybrid="false" namecache="Notholaena" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="788"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="2737" created="2010-12-21 15:10:00.0" uuid="25560d66-07a3-41ce-8244-36ca98638c71" protectedtitlecache="false" titleCache="Pteris vittata L." fullTitleCache="Pteris vittata L." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="L." binomhybrid="false" genusoruninomial="Pteris" hybridformula="false" monomhybrid="false" namecache="Pteris vittata" protectedauthorshipcache="false" protectednamecache="false" specificepithet="vittata" trinomhybrid="false" anamorphic="false"    rank_id="778" />
+  <TaxonNameBase DTYPE="BotanicalName" id="2738" created="2010-12-21 15:10:00.0" uuid="a40593ce-e8cc-43bb-a391-2de988b09039" protectedtitlecache="false" titleCache="Pteris" fullTitleCache="Pteris" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Pteris" hybridformula="false" monomhybrid="false" namecache="Pteris" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="788"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="2739" created="2010-12-21 15:10:00.0" uuid="81e2f844-70a9-4b14-82c2-9c2ba3fdb24e" protectedtitlecache="false" titleCache="Pteris cretica L." fullTitleCache="Pteris cretica L." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="L." binomhybrid="false" genusoruninomial="Pteris" hybridformula="false" monomhybrid="false" namecache="Pteris cretica" protectedauthorshipcache="false" protectednamecache="false" specificepithet="cretica" trinomhybrid="false" anamorphic="false"    rank_id="778" />
+
+       <Classification id="10" created="2010-12-21 15:09:43.0" uuid="0c2b5d25-7b15-4401-8b51-dd4be0ee5cab" updated="2015-06-09 07:10:42.0" protectedtitlecache="false" titleCache="Cyprus"   updatedby_id="10" name_id="10"  rootnode_id="4032"/>
+
+  <TaxonBase DTYPE="Taxon" id="48" created="2011-03-01 20:11:26.0" uuid="b8402dc4-5050-4882-a147-01b71e0e47d6" protectedtitlecache="false" titleCache="Adiantum capillus-veneris L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="48"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="49" created="2010-12-21 15:09:43.0" uuid="1141a510-5ee8-4a59-ae60-7b4fea44872f" protectedtitlecache="false" titleCache="Pteridophyta sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="49"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="51" created="2010-12-21 15:09:43.0" uuid="233cac41-bb05-4925-bb9e-ab0bdf330973" protectedtitlecache="false" titleCache="Adiantum sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="51"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="264" created="2011-03-01 20:11:27.0" uuid="d679c5d0-53b3-40fc-97e1-0646aad7ed23" protectedtitlecache="false" titleCache="Anogramma leptophylla (L.) Link sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="264"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="265" created="2010-12-21 15:09:45.0" uuid="1fc1d927-1155-4282-a9f5-f07202f79ace" protectedtitlecache="false" titleCache="Anogramma sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="265"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="812" created="2011-03-01 20:11:29.0" uuid="e40854d7-143f-4054-b229-6ed4cedb4bff" protectedtitlecache="false" titleCache="Cheilanthes acrostica (Balb.) Tod. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="812"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="814" created="2010-12-21 15:09:48.0" uuid="433ad11a-b931-49a4-8128-d6f4d454914a" protectedtitlecache="false" titleCache="Cheilanthes sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="814"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="815" created="2010-12-21 15:09:48.0" uuid="7ea2c74a-f2b2-41f6-acdf-1ca35f5d03f8" protectedtitlecache="false" titleCache="Cheilanthes maderensis Lowe sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="815"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="946" created="2011-03-01 20:11:30.0" uuid="ba21b018-97d2-42d7-af6c-5e8db8e495ff" protectedtitlecache="false" titleCache="Cosentinia vellea (Aiton) Tod. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="946"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="948" created="2010-12-21 15:09:49.0" uuid="a2768f6d-80f2-4e0c-a6e3-99b7a9f3bc9d" protectedtitlecache="false" titleCache="Cosentinia sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="948"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="2203" created="2011-03-01 20:11:36.0" uuid="d9a0c5d5-baee-4b6b-974a-a7de5affe748" protectedtitlecache="false" titleCache="Notholaena marantae (L.) Desv. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="2203"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="2205" created="2010-12-21 15:09:57.0" uuid="c221d34c-76b0-4fc7-9901-e72efd4c899b" protectedtitlecache="false" titleCache="Notholaena sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="2205"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="2737" created="2011-03-01 20:11:39.0" uuid="6b46ac55-3e39-4c37-a1b6-b680b21599b2" protectedtitlecache="false" titleCache="Pteris vittata L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="2737"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="2738" created="2010-12-21 15:10:00.0" uuid="8ac3dca2-6bbf-4cd4-84b7-53ddc2973ed8" protectedtitlecache="false" titleCache="Pteris sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="2738"  publish="true"/><TaxonBase
+       DTYPE="Taxon" id="2739" created="2010-12-21 15:10:00.0" uuid="79b45ff5-c17c-44ec-9114-fb6b3cd1aef4" protectedtitlecache="false"
+       titleCache="Pteris cretica sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" name_id="2739"
+       taxonomicchildrencount="0" publish="true" unplaced="false"
+       taxonstatusunknown="false">
+</TaxonBase>
+
+       <DescriptionBase DTYPE="TaxonDescription" id="28" created="2010-12-21 15:09:43.0" uuid="f04f8f66-ad92-42d0-89bc-04ac5b36163c" updated="2011-03-01 19:20:45.0" protectedtitlecache="false" titleCache="Taxon description for Adiantum capillus-veneris L." imagegallery="false"   taxon_id="48"></DescriptionBase>
+  <DescriptionBase DTYPE="TaxonDescription" id="149" created="2010-12-21 15:09:45.0" uuid="24df0fca-bfc4-4f0f-a269-336985ed6e5e" updated="2011-03-01 19:20:46.0" protectedtitlecache="false" titleCache="Taxon description for Anogramma leptophylla (L.) Link" imagegallery="false"   taxon_id="264"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="447" created="2010-12-21 15:09:48.0" uuid="01863b86-c6ae-48b8-a8da-f693be9087da" updated="2011-03-01 19:20:48.0" protectedtitlecache="false" titleCache="Taxon description for Cheilanthes acrostica (Balbis) Tod." imagegallery="false"   taxon_id="812"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="448" created="2010-12-21 15:09:48.0" uuid="aac7b184-e622-409b-8eda-e14998b9021d" protectedtitlecache="false" titleCache="Taxon description for Cheilanthes maderensis Lowe" imagegallery="false"   taxon_id="815"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="521" created="2010-12-21 15:09:49.0" uuid="2d672585-0f35-42f8-9923-dfd5545e6369" updated="2011-03-01 19:20:48.0" protectedtitlecache="false" titleCache="Taxon description for Cosentinia vellea (Aiton) Tod." imagegallery="false"   taxon_id="946"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="1234" created="2010-12-21 15:09:57.0" uuid="a8a734c2-122b-4d5b-9c89-a852f4ab4661" updated="2011-03-01 19:20:53.0" protectedtitlecache="false" titleCache="Taxon description for Notholaena marantae (L.) Desv." imagegallery="false"   taxon_id="2203"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="1524" created="2010-12-21 15:10:00.0" uuid="c4e66d46-e4fb-4da2-a432-3f1cf5353b81" updated="2011-03-01 19:20:55.0" protectedtitlecache="false" titleCache="Taxon description for Pteris vittata L." imagegallery="false"   taxon_id="2737"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4567" created="2011-03-01 19:20:45.0" uuid="dd0f7395-6162-4ce4-8ece-774011b09325" updated="2011-03-01 20:11:26.0" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Adiantum capillus-veneris L. sec. Cyprus" imagegallery="false" taxon_id="48"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4627" created="2011-03-01 19:20:46.0" uuid="34266202-eb5d-41ec-a0b2-da56deb11cc7" updated="2011-03-01 20:11:27.0" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Anogramma leptophylla (L.) Link sec. Cyprus" imagegallery="false" taxon_id="264"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4798" created="2011-03-01 19:20:48.0" uuid="504b0178-39e6-4c79-8e33-ca00b0662f27" updated="2011-03-01 20:11:29.0" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Cheilanthes acrostica (Balbis) Tod. sec. Cyprus" imagegallery="false" taxon_id="812"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4840" created="2011-03-01 19:20:48.0" uuid="73396d11-5d35-43fb-8b15-4d472bdcdd43" updated="2011-03-01 20:11:30.0" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Cosentinia vellea (Aiton) Tod. sec. Cyprus" imagegallery="false" taxon_id="946"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="5409" created="2011-03-01 19:20:55.0" uuid="64a797b2-7f92-4012-a4f5-d76f8aaeb6b4" updated="2011-03-01 20:11:39.0" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Pteris vittata L. sec. Cyprus" imagegallery="false" taxon_id="2737"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="5974" created="2011-03-01 19:20:53.0" uuid="71872861-8229-4cab-8042-b75dfa0e3f63" updated="2011-03-01 20:11:36.0" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Notholaena marantae (L.) Desv. sec. Cyprus" imagegallery="false" taxon_id="2203"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="11766" created="2012-07-30 15:39:44.0" uuid="6b4be8a2-ea86-4815-bd31-b022055a90f2" protectedtitlecache="false" titleCache="Image gallery for Pteris vittata L." imagegallery="true"   taxon_id="2737"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="12353" created="2012-12-03 12:21:48.0" uuid="b8d3a151-032e-48d9-9191-d7b8fb1fe1a0" protectedtitlecache="false" titleCache="Image gallery for Cheilanthes acrostica (Balbis) Tod." imagegallery="true"   taxon_id="812"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="12713" created="2013-02-10 21:43:33.0" uuid="61fbdc1b-80bf-4aea-b6cb-8f4d466bd923" protectedtitlecache="false" titleCache="Image gallery for Adiantum capillus-veneris L." imagegallery="true"   taxon_id="48"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="13728" created="2014-02-28 19:20:29.0" uuid="53b3125e-2a43-4433-a4dd-50dd9a4cf92c" updated="2014-02-28 19:20:29.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="48"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="13817" created="2014-02-28 19:20:34.0" uuid="7b108193-e689-417a-bcab-adaf6c49d532" updated="2014-02-28 19:20:34.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="264"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14043" created="2014-02-28 19:20:58.0" uuid="de29cc97-a160-4783-b996-b929157335d5" updated="2014-02-28 19:20:58.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="812"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14101" created="2014-02-28 19:21:07.0" uuid="815336d3-19d6-493d-9ea4-bcb320d1b922" updated="2014-02-28 19:21:08.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="946"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14658" created="2014-02-28 19:23:51.0" uuid="ce4068f8-17b0-46e2-9fbb-e8c16efb7255" updated="2014-02-28 19:23:51.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2203"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14864" created="2014-02-28 19:25:21.0" uuid="2d55f445-8e72-43d3-976a-133828e89599" updated="2014-02-28 19:25:21.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2737"/>
+
+  <SynonymRelationship/>
+  
+  <LanguageString id="10"/>
+</dataset>
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/service/IOServiceExportTest.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/service/IOServiceExportTest.xml
new file mode 100644 (file)
index 0000000..b0afec0
--- /dev/null
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?><!--
+  generated by Jailer 4.3, Fri Jun 19 09:13:03 CEST 2015 from cmathew@cmbgbm-t530
+  
+  Extraction Model:  all rows from Classification (extractionmodel/by-example/SbE-Classification-09-10-20-259.csv)
+  Database URL:      jdbc:mysql://127.0.0.1:3306/local-cyprus
+  Database User:     root
+  
+  Exported Rows:     67
+      Classification                 1
+      DescriptionBase                22
+      TaxonBase                      14
+      TaxonNameBase                  14
+      TaxonNode                      16
+  
+--><dataset>
+  <TaxonNode id="46" created="2010-12-21 15:09:43.0" uuid="168a4d09-a2b0-4206-b4cc-5d13199f9306" countchildren="0"   classification_id="10" parent_id="47" taxon_id="48" treeIndex="#t10#4032#49#48#47#46#" sortIndex="0"/>
+  <TaxonNode id="47" created="2010-12-21 15:09:43.0" uuid="2f05d429-632d-4230-b9cb-70299360b470" countchildren="1"   classification_id="10" parent_id="48" taxon_id="51" treeIndex="#t10#4032#49#48#47#" sortIndex="0"/>
+  <TaxonNode id="48" created="2010-12-21 15:09:43.0" uuid="24773d3b-8f11-4400-99de-71658982b245" countchildren="6"   classification_id="10" parent_id="49"  treeIndex="#t10#4032#49#48#" sortIndex="0"/>
+  <TaxonNode id="49" created="2010-12-21 15:09:43.0" uuid="572290a9-7535-48c8-9f68-25ddbc9869ee" countchildren="10"   classification_id="10" parent_id="4032" taxon_id="49" treeIndex="#t10#4032#49#" sortIndex="0"/>
+  <TaxonNode id="236" created="2010-12-21 15:09:45.0" uuid="f5d97f8b-c673-4050-af06-bbfab33baaec" countchildren="0"   classification_id="10" parent_id="237" taxon_id="264" treeIndex="#t10#4032#49#48#237#236#" sortIndex="0"/>
+  <TaxonNode id="237" created="2010-12-21 15:09:45.0" uuid="4998de90-d0be-433b-a62f-0d57a1e399b0" countchildren="1"   classification_id="10" parent_id="48" taxon_id="265" treeIndex="#t10#4032#49#48#237#" sortIndex="1"/>
+  <TaxonNode id="714" created="2010-12-21 15:09:48.0" uuid="b85b5b78-6760-409f-ac91-bb89e95ff2a1" countchildren="0"   classification_id="10" parent_id="715" taxon_id="812" treeIndex="#t10#4032#49#48#715#714#" sortIndex="0"/>
+  <TaxonNode id="715" created="2010-12-21 15:09:48.0" uuid="91698cec-615f-4472-9002-feda1a6acded" countchildren="2"   classification_id="10" parent_id="48" taxon_id="814" treeIndex="#t10#4032#49#48#715#" sortIndex="2"/>
+  <TaxonNode id="716" created="2010-12-21 15:09:48.0" uuid="6ad8e9e2-f5f6-41ad-aa30-f62a903650db" countchildren="0"   classification_id="10" parent_id="715" taxon_id="815" treeIndex="#t10#4032#49#48#715#716#" sortIndex="1"/>
+  <TaxonNode id="828" created="2010-12-21 15:09:49.0" uuid="786622ba-cb2c-47f4-9eeb-65a6ebb7122b" countchildren="0"   classification_id="10" parent_id="829" taxon_id="946" treeIndex="#t10#4032#49#48#829#828#" sortIndex="0"/>
+  <TaxonNode id="829" created="2010-12-21 15:09:49.0" uuid="4fe03763-b966-4361-8334-352f6f777588" countchildren="1"   classification_id="10" parent_id="48" taxon_id="948" treeIndex="#t10#4032#49#48#829#" sortIndex="3"/>
+  <TaxonNode id="1915" created="2010-12-21 15:09:57.0" uuid="99f03b56-67cd-4e01-9ceb-2362d48f9d07" countchildren="0"   classification_id="10" parent_id="1916" taxon_id="2203" treeIndex="#t10#4032#49#48#1916#1915#" sortIndex="0"/>
+  <TaxonNode id="1916" created="2010-12-21 15:09:57.0" uuid="d8998200-500f-4312-90f4-2b60e6fd3a78" countchildren="1"   classification_id="10" parent_id="48" taxon_id="2205" treeIndex="#t10#4032#49#48#1916#" sortIndex="4"/>
+  <TaxonNode id="2354" created="2010-12-21 15:10:00.0" uuid="b8439f51-6b96-445a-b401-7a836ba1cf58" countchildren="0"   classification_id="10" parent_id="2355" taxon_id="2737" treeIndex="#t10#4032#49#48#2355#2354#" sortIndex="0"/>
+  <TaxonNode id="2355" created="2010-12-21 15:10:00.0" uuid="6da4e5b6-ebc3-4c46-bdce-24161b7bd0e2" countchildren="1"   classification_id="10" parent_id="48" taxon_id="2738" treeIndex="#t10#4032#49#48#2355#" sortIndex="5"/>
+  <TaxonNode id="4032" created="2014-01-16 10:24:29.0" uuid="29b3fd3f-29b4-4011-ab12-9c1ad1607dbd" countchildren="1" classification_id="10" treeIndex="#t10#4032#"/>
+
+  <TaxonNameBase DTYPE="BotanicalName" id="48" created="2010-12-21 15:09:43.0" uuid="7aceb517-2b91-46b9-a5a2-88b7e0fb3230" protectedtitlecache="false" titleCache="Adiantum capillus-veneris L." fullTitleCache="Adiantum capillus-veneris L." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="L." binomhybrid="false" genusoruninomial="Adiantum" hybridformula="false" monomhybrid="false" namecache="Adiantum capillus-veneris" protectedauthorshipcache="false" protectednamecache="false" specificepithet="capillus-veneris" trinomhybrid="false" anamorphic="false"    rank_id="778" />
+  <TaxonNameBase DTYPE="BotanicalName" id="49" created="2010-12-21 15:09:43.0" uuid="079fff38-ff2d-426b-a49e-70b0f1db6c31" protectedtitlecache="false" titleCache="Pteridophyta" fullTitleCache="Pteridophyta" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Pteridophyta" hybridformula="false" monomhybrid="false" namecache="Pteridophyta" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="810"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="51" created="2010-12-21 15:09:43.0" uuid="c8af63e0-7bd4-4fad-aa2d-3777cbe1210a" protectedtitlecache="false" titleCache="Adiantum" fullTitleCache="Adiantum" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Adiantum" hybridformula="false" monomhybrid="false" namecache="Adiantum" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="788"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="264" created="2010-12-21 15:09:45.0" uuid="b976da6a-dd84-4fcd-9a1b-9847afba1da2" protectedtitlecache="false" titleCache="Anogramma leptophylla (L.) Link" fullTitleCache="Anogramma leptophylla (L.) Link" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="(L.) Link" binomhybrid="false" genusoruninomial="Anogramma" hybridformula="false" monomhybrid="false" namecache="Anogramma leptophylla" protectedauthorshipcache="false" protectednamecache="false" specificepithet="leptophylla" trinomhybrid="false" anamorphic="false"    rank_id="778"  />
+  <TaxonNameBase DTYPE="BotanicalName" id="265" created="2010-12-21 15:09:45.0" uuid="c7f1db22-20fb-4eeb-810b-d37c5593b95d" protectedtitlecache="false" titleCache="Anogramma" fullTitleCache="Anogramma" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Anogramma" hybridformula="false" monomhybrid="false" namecache="Anogramma" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="788"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="812" created="2010-12-21 15:09:48.0" uuid="16450a2d-2085-471f-804a-defcd43c03e4" protectedtitlecache="false" titleCache="Cheilanthes acrostica (Balb.) Tod." fullTitleCache="Cheilanthes acrostica (Balb.) Tod." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="(Balb.) Tod." binomhybrid="false" genusoruninomial="Cheilanthes" hybridformula="false" monomhybrid="false" namecache="Cheilanthes acrostica" protectedauthorshipcache="false" protectednamecache="false" specificepithet="acrostica" trinomhybrid="false" anamorphic="false"    rank_id="778"  />
+  <TaxonNameBase DTYPE="BotanicalName" id="814" created="2010-12-21 15:09:48.0" uuid="bbb1c5be-5a0c-45e2-b8af-f37a80ccf858" protectedtitlecache="false" titleCache="Cheilanthes" fullTitleCache="Cheilanthes" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Cheilanthes" hybridformula="false" monomhybrid="false" namecache="Cheilanthes" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="788"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="815" created="2010-12-21 15:09:48.0" uuid="f04a9283-f856-4d28-b469-4a222472862b" protectedtitlecache="false" titleCache="Cheilanthes maderensis Lowe" fullTitleCache="Cheilanthes maderensis Lowe" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="Lowe" binomhybrid="false" genusoruninomial="Cheilanthes" hybridformula="false" monomhybrid="false" namecache="Cheilanthes maderensis" protectedauthorshipcache="false" protectednamecache="false" specificepithet="maderensis" trinomhybrid="false" anamorphic="false"    rank_id="778" />
+  <TaxonNameBase DTYPE="BotanicalName" id="946" created="2010-12-21 15:09:49.0" uuid="e30ef44b-52e4-41ff-a68d-9912d3c537f1" protectedtitlecache="false" titleCache="Cosentinia vellea (Aiton) Tod." fullTitleCache="Cosentinia vellea (Aiton) Tod." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="(Aiton) Tod." binomhybrid="false" genusoruninomial="Cosentinia" hybridformula="false" monomhybrid="false" namecache="Cosentinia vellea" protectedauthorshipcache="false" protectednamecache="false" specificepithet="vellea" trinomhybrid="false" anamorphic="false"    rank_id="778"  />
+  <TaxonNameBase DTYPE="BotanicalName" id="948" created="2010-12-21 15:09:49.0" uuid="21fda99e-0425-4f29-b7b2-196f8a51b054" protectedtitlecache="false" titleCache="Cosentinia" fullTitleCache="Cosentinia" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Cosentinia" hybridformula="false" monomhybrid="false" namecache="Cosentinia" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="788"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="2203" created="2010-12-21 15:09:57.0" uuid="8fe0bb4b-7687-4d32-8ff2-94e690980f81" protectedtitlecache="false" titleCache="Notholaena marantae (L.) Desv." fullTitleCache="Notholaena marantae (L.) Desv." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="(L.) Desv." binomhybrid="false" genusoruninomial="Notholaena" hybridformula="false" monomhybrid="false" namecache="Notholaena marantae" protectedauthorshipcache="false" protectednamecache="false" specificepithet="marantae" trinomhybrid="false" anamorphic="false"    rank_id="778"  />
+  <TaxonNameBase DTYPE="BotanicalName" id="2205" created="2010-12-21 15:09:57.0" uuid="77b7934f-8f62-4798-b96a-f3d12bfd5ebf" protectedtitlecache="false" titleCache="Notholaena" fullTitleCache="Notholaena" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Notholaena" hybridformula="false" monomhybrid="false" namecache="Notholaena" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="788"/>
+  <TaxonNameBase DTYPE="BotanicalName" id="2737" created="2010-12-21 15:10:00.0" uuid="25560d66-07a3-41ce-8244-36ca98638c71" protectedtitlecache="false" titleCache="Pteris vittata L." fullTitleCache="Pteris vittata L." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="L." binomhybrid="false" genusoruninomial="Pteris" hybridformula="false" monomhybrid="false" namecache="Pteris vittata" protectedauthorshipcache="false" protectednamecache="false" specificepithet="vittata" trinomhybrid="false" anamorphic="false"    rank_id="778" />
+  <TaxonNameBase DTYPE="BotanicalName" id="2738" created="2010-12-21 15:10:00.0" uuid="a40593ce-e8cc-43bb-a391-2de988b09039" protectedtitlecache="false" titleCache="Pteris" fullTitleCache="Pteris" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Pteris" hybridformula="false" monomhybrid="false" namecache="Pteris" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false"    rank_id="788"/>
+
+  <Classification id="10" created="2010-12-21 15:09:43.0" uuid="0c2b5d25-7b15-4401-8b51-dd4be0ee5cab" updated="2015-06-09 07:10:42.0" protectedtitlecache="false" titleCache="Cyprus"   updatedby_id="10" name_id="10"  rootnode_id="4032"/>
+
+  <TaxonBase DTYPE="Taxon" id="48" created="2011-03-01 20:11:26.0" uuid="b8402dc4-5050-4882-a147-01b71e0e47d6" protectedtitlecache="false" titleCache="Adiantum capillus-veneris L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="48"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="49" created="2010-12-21 15:09:43.0" uuid="1141a510-5ee8-4a59-ae60-7b4fea44872f" protectedtitlecache="false" titleCache="Pteridophyta sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="49"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="51" created="2010-12-21 15:09:43.0" uuid="233cac41-bb05-4925-bb9e-ab0bdf330973" protectedtitlecache="false" titleCache="Adiantum sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="51"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="264" created="2011-03-01 20:11:27.0" uuid="d679c5d0-53b3-40fc-97e1-0646aad7ed23" protectedtitlecache="false" titleCache="Anogramma leptophylla (L.) Link sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="264"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="265" created="2010-12-21 15:09:45.0" uuid="1fc1d927-1155-4282-a9f5-f07202f79ace" protectedtitlecache="false" titleCache="Anogramma sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="265"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="812" created="2011-03-01 20:11:29.0" uuid="e40854d7-143f-4054-b229-6ed4cedb4bff" protectedtitlecache="false" titleCache="Cheilanthes acrostica (Balb.) Tod. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="812"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="814" created="2010-12-21 15:09:48.0" uuid="433ad11a-b931-49a4-8128-d6f4d454914a" protectedtitlecache="false" titleCache="Cheilanthes sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="814"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="815" created="2010-12-21 15:09:48.0" uuid="7ea2c74a-f2b2-41f6-acdf-1ca35f5d03f8" protectedtitlecache="false" titleCache="Cheilanthes maderensis Lowe sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="815"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="946" created="2011-03-01 20:11:30.0" uuid="ba21b018-97d2-42d7-af6c-5e8db8e495ff" protectedtitlecache="false" titleCache="Cosentinia vellea (Aiton) Tod. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="946"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="948" created="2010-12-21 15:09:49.0" uuid="a2768f6d-80f2-4e0c-a6e3-99b7a9f3bc9d" protectedtitlecache="false" titleCache="Cosentinia sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="948"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="2203" created="2011-03-01 20:11:36.0" uuid="d9a0c5d5-baee-4b6b-974a-a7de5affe748" protectedtitlecache="false" titleCache="Notholaena marantae (L.) Desv. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="2203"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="2205" created="2010-12-21 15:09:57.0" uuid="c221d34c-76b0-4fc7-9901-e72efd4c899b" protectedtitlecache="false" titleCache="Notholaena sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="2205"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="2737" created="2011-03-01 20:11:39.0" uuid="6b46ac55-3e39-4c37-a1b6-b680b21599b2" protectedtitlecache="false" titleCache="Pteris vittata L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="2737"  publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="2738" created="2010-12-21 15:10:00.0" uuid="8ac3dca2-6bbf-4cd4-84b7-53ddc2973ed8" protectedtitlecache="false" titleCache="Pteris sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false"   name_id="2738"  publish="true"/>
+
+  <DescriptionBase DTYPE="TaxonDescription" id="28" created="2010-12-21 15:09:43.0" uuid="f04f8f66-ad92-42d0-89bc-04ac5b36163c" updated="2011-03-01 19:20:45.0" protectedtitlecache="false" titleCache="Taxon description for Adiantum capillus-veneris L." imagegallery="false"   taxon_id="48"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="149" created="2010-12-21 15:09:45.0" uuid="24df0fca-bfc4-4f0f-a269-336985ed6e5e" updated="2011-03-01 19:20:46.0" protectedtitlecache="false" titleCache="Taxon description for Anogramma leptophylla (L.) Link" imagegallery="false"   taxon_id="264"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="447" created="2010-12-21 15:09:48.0" uuid="01863b86-c6ae-48b8-a8da-f693be9087da" updated="2011-03-01 19:20:48.0" protectedtitlecache="false" titleCache="Taxon description for Cheilanthes acrostica (Balbis) Tod." imagegallery="false"   taxon_id="812"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="448" created="2010-12-21 15:09:48.0" uuid="aac7b184-e622-409b-8eda-e14998b9021d" protectedtitlecache="false" titleCache="Taxon description for Cheilanthes maderensis Lowe" imagegallery="false"   taxon_id="815"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="521" created="2010-12-21 15:09:49.0" uuid="2d672585-0f35-42f8-9923-dfd5545e6369" updated="2011-03-01 19:20:48.0" protectedtitlecache="false" titleCache="Taxon description for Cosentinia vellea (Aiton) Tod." imagegallery="false"   taxon_id="946"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="1234" created="2010-12-21 15:09:57.0" uuid="a8a734c2-122b-4d5b-9c89-a852f4ab4661" updated="2011-03-01 19:20:53.0" protectedtitlecache="false" titleCache="Taxon description for Notholaena marantae (L.) Desv." imagegallery="false"   taxon_id="2203"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="1524" created="2010-12-21 15:10:00.0" uuid="c4e66d46-e4fb-4da2-a432-3f1cf5353b81" updated="2011-03-01 19:20:55.0" protectedtitlecache="false" titleCache="Taxon description for Pteris vittata L." imagegallery="false"   taxon_id="2737"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4567" created="2011-03-01 19:20:45.0" uuid="dd0f7395-6162-4ce4-8ece-774011b09325" updated="2011-03-01 20:11:26.0" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Adiantum capillus-veneris L. sec. Cyprus" imagegallery="false" taxon_id="48"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4627" created="2011-03-01 19:20:46.0" uuid="34266202-eb5d-41ec-a0b2-da56deb11cc7" updated="2011-03-01 20:11:27.0" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Anogramma leptophylla (L.) Link sec. Cyprus" imagegallery="false" taxon_id="264"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4798" created="2011-03-01 19:20:48.0" uuid="504b0178-39e6-4c79-8e33-ca00b0662f27" updated="2011-03-01 20:11:29.0" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Cheilanthes acrostica (Balbis) Tod. sec. Cyprus" imagegallery="false" taxon_id="812"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4840" created="2011-03-01 19:20:48.0" uuid="73396d11-5d35-43fb-8b15-4d472bdcdd43" updated="2011-03-01 20:11:30.0" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Cosentinia vellea (Aiton) Tod. sec. Cyprus" imagegallery="false" taxon_id="946"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="5409" created="2011-03-01 19:20:55.0" uuid="64a797b2-7f92-4012-a4f5-d76f8aaeb6b4" updated="2011-03-01 20:11:39.0" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Pteris vittata L. sec. Cyprus" imagegallery="false" taxon_id="2737"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="5974" created="2011-03-01 19:20:53.0" uuid="71872861-8229-4cab-8042-b75dfa0e3f63" updated="2011-03-01 20:11:36.0" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Notholaena marantae (L.) Desv. sec. Cyprus" imagegallery="false" taxon_id="2203"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="11766" created="2012-07-30 15:39:44.0" uuid="6b4be8a2-ea86-4815-bd31-b022055a90f2" protectedtitlecache="false" titleCache="Image gallery for Pteris vittata L." imagegallery="true"   taxon_id="2737"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="12353" created="2012-12-03 12:21:48.0" uuid="b8d3a151-032e-48d9-9191-d7b8fb1fe1a0" protectedtitlecache="false" titleCache="Image gallery for Cheilanthes acrostica (Balbis) Tod." imagegallery="true"   taxon_id="812"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="12713" created="2013-02-10 21:43:33.0" uuid="61fbdc1b-80bf-4aea-b6cb-8f4d466bd923" protectedtitlecache="false" titleCache="Image gallery for Adiantum capillus-veneris L." imagegallery="true"   taxon_id="48"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="13728" created="2014-02-28 19:20:29.0" uuid="53b3125e-2a43-4433-a4dd-50dd9a4cf92c" updated="2014-02-28 19:20:29.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="48"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="13817" created="2014-02-28 19:20:34.0" uuid="7b108193-e689-417a-bcab-adaf6c49d532" updated="2014-02-28 19:20:34.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="264"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14043" created="2014-02-28 19:20:58.0" uuid="de29cc97-a160-4783-b996-b929157335d5" updated="2014-02-28 19:20:58.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="812"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14101" created="2014-02-28 19:21:07.0" uuid="815336d3-19d6-493d-9ea4-bcb320d1b922" updated="2014-02-28 19:21:08.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="946"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14658" created="2014-02-28 19:23:51.0" uuid="ce4068f8-17b0-46e2-9fbb-e8c16efb7255" updated="2014-02-28 19:23:51.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2203"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14864" created="2014-02-28 19:25:21.0" uuid="2d55f445-8e72-43d3-976a-133828e89599" updated="2014-02-28 19:25:21.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2737"/>
+
+  <SynonymRelationship/>
+  
+  <LanguageString id="10"/>
+</dataset>
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/service/IOServiceImportTest.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/service/IOServiceImportTest.xml
new file mode 100644 (file)
index 0000000..e6c8bef
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+  <TaxonNameBase />
+  <TaxonBase />
+  <TaxonNode />
+  <Classification />
+</dataset>
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/session/CdmEntitySessionAwareTest.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/session/CdmEntitySessionAwareTest.xml
new file mode 100644 (file)
index 0000000..931c381
--- /dev/null
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?><!--
+  generated by Jailer 4.3, Thu Oct 09 18:00:09 CEST 2014 from cmathew@cmbgbm-t530
+  
+  Extraction Model:  PolytomousKey where uuid like '0d53ba20-7de4-4baa-bd8a-401048447d66' (extractionmodel/by-example/SbE-PolytomousKey-17-59-56-907.csv)
+  Database URL:      jdbc:mysql://127.0.0.1:3306/local-cyprus
+  Database User:     root
+  
+  Exported Rows:     79
+      AgentBase                      1
+      Credit                         1     
+      Extension                      1
+      KeyStatement                   10
+      KeyStatement_LanguageString    10
+      LanguageString                 19
+      OriginalSourceBase             2
+      PolytomousKey                  2
+      PolytomousKeyNode              10
+      PolytomousKeyNode_LanguageString 9
+      PolytomousKey_Credit           1
+      PolytomousKey_Extension        1
+      PolytomousKey_OriginalSourceBase 2
+      PolytomousKey_RightsInfo       1
+      PolytomousKey_Taxon            1
+      RightsInfo                     1
+      TaxonBase                      6
+  
+--><dataset>
+  <PolytomousKey_Extension PolytomousKey_id="1550" extensions_id="10"/>
+
+  <PolytomousKey_Credit PolytomousKey_id="1550" credits_id="20" sortIndex="0"/>
+
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2751" modifyingtext_id="13780" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2752" modifyingtext_id="13781" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2753" modifyingtext_id="13795" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2754" modifyingtext_id="13788" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2755" modifyingtext_id="13785" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2756" modifyingtext_id="13787" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2757" modifyingtext_id="13794" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2758" modifyingtext_id="13791" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2759" modifyingtext_id="13793" modifyingtext_mapkey_id="124"/>
+
+  <LanguageString id="13780" created="2014-03-10 10:03:09.0" uuid="cceaa60b-61f4-4c8a-bb0e-d45f0fa3e2dc" text="Modifying Text 1a" language_id="124"/>
+  <LanguageString id="13781" created="2014-03-10 10:03:17.0" uuid="01a0ace4-de49-4725-9909-e881fb13035d" text="" language_id="124"/>
+  <LanguageString id="13782" created="2014-03-10 10:03:48.0" uuid="ec0fea40-69dd-4c3e-ab7a-34948037a069" updated="2014-03-10 10:06:32.0" text="Capitula with ligulate ray-florets; leaves pinnatisect"   language_id="124"/>
+  <LanguageString id="13783" created="2014-03-10 10:04:03.0" uuid="82f8a3a0-567f-4d89-ba10-3f3699111d55" updated="2014-03-10 10:06:32.0" text="Ray-florets yellow"   language_id="124"/>
+  <LanguageString id="13784" created="2014-03-10 10:04:21.0" uuid="4270501f-1efc-45c2-9e8f-c65f120e8f4c" updated="2014-03-10 10:06:32.0" text="Stem thinly pilose; leaves 10-15 mm wide, with spreading linear-subulate segments; perennial herb"   language_id="124"/>
+  <LanguageString id="13785" created="2014-03-10 10:04:07.0" uuid="813f5fd6-c8f6-43e8-9a2b-1464f3ba052a" updated="2014-03-10 10:06:32.0" text=""   language_id="124"/>
+  <LanguageString id="13786" created="2014-03-10 10:04:53.0" uuid="ba17ac94-632f-4d69-ac89-a882e19ff1c5" updated="2014-03-10 10:06:32.0" text="Stem white-tomentose; leaves 1-3 mm wide, with minute overlapping, transverse segments; small subshrubs with a woody base"   language_id="124"/>
+  <LanguageString id="13787" created="2014-03-10 10:04:34.0" uuid="ab219a5d-e0c4-45fd-8405-6693c3fb8abf" updated="2014-03-10 10:06:32.0" text=""   language_id="124"/>
+  <LanguageString id="13788" created="2014-03-10 10:03:53.0" uuid="2baec690-422d-4f85-bcfd-24f5718cbecf" updated="2014-03-10 10:06:32.0" text=""   language_id="124"/>
+  <LanguageString id="13789" created="2014-03-10 10:05:16.0" uuid="7c6a7984-8e6f-48b1-86b2-d5d643199bf3" updated="2014-03-10 10:06:32.0" text="Ray-florets white"   language_id="124"/>
+  <LanguageString id="13790" created="2014-03-10 10:05:34.0" uuid="72bd8bc9-1904-47ab-8bec-b9296a98b244" updated="2014-03-10 10:06:32.0" text="Perennial herb; stem pilose, hairy or glabrescent, but not tomentose; ligules 1-2 mm diam."   language_id="124"/>
+  <LanguageString id="13791" created="2014-03-10 10:05:20.0" uuid="c917e3fb-e48b-4207-b77d-c1c108e37906" updated="2014-03-10 10:06:32.0" text=""   language_id="124"/>
+  <LanguageString id="13792" created="2014-03-10 10:06:15.0" uuid="c5dd35d8-da6a-4d05-b30c-6b55220bd989" updated="2014-03-10 10:06:32.0" text="Shrub with a woody base; stem white-tomentose or woolly; ligules 4-5 mm diam."   language_id="124"/>
+  <LanguageString id="13793" created="2014-03-10 10:06:03.0" uuid="227a17f6-1ca1-4d06-8480-25711b614863" updated="2014-03-10 10:06:32.0" text=""   language_id="124"/>
+  <LanguageString id="13794" created="2014-03-10 10:05:07.0" uuid="2c434ab1-8ca7-4464-b5cd-4cee40db41ed" updated="2014-03-10 10:06:32.0" text=""   language_id="124"/>
+  <LanguageString id="13795" created="2014-03-10 10:03:38.0" uuid="27190d54-f53b-401e-820c-edfb36d4bcbf" updated="2014-03-10 10:06:32.0" text=""   language_id="124"/>
+  <LanguageString id="13796" created="2014-03-10 10:03:25.0" uuid="69cffb28-8a85-478f-bcae-533e20938ccd" updated="2014-03-10 10:06:32.0" text="Capitula without ligulate ray-florets; leaves entire or subentire"   language_id="124"/>
+  <LanguageString id="14570" created="2014-10-09 15:42:33.0" uuid="84967760-6dbe-4af4-8e0c-309f1af6ce20" updated="2014-10-09 15:42:44.0" text="Question 1" createdby_id="10" updatedby_id="10" language_id="124"/>
+  <LanguageString id="14571" created="2014-10-09 15:42:55.0" uuid="d82f37b1-f51d-42c1-a291-0c7820db155e" updated="2014-10-09 15:43:03.0" text="Question 2" createdby_id="10" updatedby_id="10" language_id="124"/>
+
+  <TaxonBase DTYPE="Taxon" id="32" created="2011-03-01 20:11:26.0" uuid="8217ef77-2ab1-4318-bd67-ccd0cdef07c4" protectedtitlecache="false" titleCache="Achillea arabica Kotschy sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="35" created="2010-12-21 15:09:43.0" uuid="fade44fd-34b2-455f-861a-d1372b866f06" protectedtitlecache="false" titleCache="Achillea sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="36" created="2011-03-01 20:11:26.0" uuid="05f0a2e1-e3c3-4e74-8fec-8a0ae89236c3" protectedtitlecache="false" titleCache="Achillea cretica L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="37" created="2011-03-01 20:11:26.0" uuid="0f8d18a9-e861-48e8-bfab-83e01a379bc0" protectedtitlecache="false" titleCache="Achillea maritima (L.)Ehrend. &amp; Y.-P. Guo subsp. maritima sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="40" created="2010-12-21 15:09:43.0" uuid="2b336df7-29e8-4f79-985f-66502739d22f" protectedtitlecache="false" titleCache="Achillea millefolium L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="41" created="2011-03-01 20:11:26.0" uuid="094e1af8-efd8-4605-b037-b4f715379562" protectedtitlecache="false" titleCache="Achillea santolinoides subsp. wilhelmsii (K. Koch) Greuter sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11" sec_id="10" publish="true"/>
+
+  <PolytomousKey_Taxon polytomousKey_id="1550" taxon_id="35"/>
+
+  <RightsInfo id="10" created="2014-10-09 15:45:53.0" uuid="bdfb572b-be25-45e7-9349-22a9da43531f" updated="2014-10-09 15:48:01.0" text="Rights Text Test" createdby_id="10" updatedby_id="10" agent_id="4809" type_id="2056"/>
+
+
+  <PolytomousKeyNode id="2750" created="2014-03-10 10:02:35.0" uuid="75e4c924-ff58-4ee7-a59d-fd9173517d08" updated="2014-03-10 10:02:42.0" nodenumber="1"   key_id="1550" question_id="2760"/>
+  <PolytomousKeyNode id="2751" created="2014-03-10 10:02:52.0" uuid="23e51ff7-11b1-443b-aff2-3fe8b5ace9fe" sortindex="0" key_id="1550" statement_id="2467" subkey_id="751" taxon_id="37" parent_id="2750"/>
+  <PolytomousKeyNode id="2752" created="2014-03-10 10:03:16.0" uuid="dcf326f7-c0ad-4e76-b64e-43aea11f767c" key_id="1550"/>
+  <PolytomousKeyNode id="2753" created="2014-03-10 10:03:38.0" uuid="b775c027-13c0-4b87-8aa9-712faeaafbdc" updated="2014-03-10 10:06:32.0" nodenumber="2" sortindex="1"   key_id="1550" question_id="2761" statement_id="2460"  subkey_id="751" parent_id="2750"/>
+  <PolytomousKeyNode id="2754" created="2014-03-10 10:03:52.0" uuid="df5d5922-35de-43d5-9d46-7730ae28eeb3" updated="2014-03-10 10:06:32.0" nodenumber="3" sortindex="0"   key_id="1550" statement_id="2461" subkey_id="751" parent_id="2753"/>
+  <PolytomousKeyNode id="2755" created="2014-03-10 10:04:07.0" uuid="0c8583ee-399e-433c-b76b-272c54dbd9f5" updated="2014-03-10 10:06:32.0" sortindex="0"   key_id="1550" statement_id="2462" taxon_id="32" parent_id="2754"/>
+  <PolytomousKeyNode id="2756" created="2014-03-10 10:04:34.0" uuid="a10e1e61-82c0-470e-a245-10a927b80c9a" updated="2014-03-10 10:06:32.0" sortindex="1"   key_id="1550" statement_id="2463" taxon_id="41" parent_id="2754"/>
+  <PolytomousKeyNode id="2757" created="2014-03-10 10:05:07.0" uuid="19f7a6a2-4c55-49cb-8b92-d68a9fd9074c" updated="2014-03-10 10:06:32.0" nodenumber="4" sortindex="1"   key_id="1550" statement_id="2464" parent_id="2753"/>
+  <PolytomousKeyNode id="2758" created="2014-03-10 10:05:20.0" uuid="0a4d86d1-fba5-4088-8dcc-6f0e7268ca5b" updated="2014-03-10 10:06:32.0" sortindex="0"   key_id="1550" statement_id="2465" taxon_id="40" parent_id="2757"/>
+  <PolytomousKeyNode id="2759" created="2014-03-10 10:06:03.0" uuid="827c9df4-ac15-4163-95ab-616d51f62803" updated="2014-03-10 10:06:32.0" sortindex="1"   key_id="1550" statement_id="2466" taxon_id="36" parent_id="2757"/>
+
+  <Credit id="20" created="2014-10-09 15:45:22.0" uuid="aa412b15-ee6c-4834-b14e-a66969cb398d" updated="2014-10-09 15:48:01.0" text="Credits Text Test" createdby_id="10" updatedby_id="10" language_id="124" agent_id="4809"/>
+
+  <KeyStatement id="2460" created="2014-03-10 10:03:48.0" uuid="66da6df7-784c-4d5a-9378-58b2cf92ba13" updated="2014-03-10 10:06:32.0"  />
+  <KeyStatement id="2461" created="2014-03-10 10:04:03.0" uuid="f9cfd498-de47-48fd-b38c-43cf57b63750" updated="2014-03-10 10:06:32.0"  />
+  <KeyStatement id="2462" created="2014-03-10 10:04:21.0" uuid="817fb39e-91d4-4d8c-a942-6acab47575d1" updated="2014-03-10 10:06:32.0"  />
+  <KeyStatement id="2463" created="2014-03-10 10:04:53.0" uuid="6b571b86-7764-4f27-925c-ae5e2653f7ad" updated="2014-03-10 10:06:32.0"  />
+  <KeyStatement id="2464" created="2014-03-10 10:05:16.0" uuid="91bbb534-abdf-4915-9f6f-a0cb41f8cf58" updated="2014-03-10 10:06:32.0"  />
+  <KeyStatement id="2465" created="2014-03-10 10:05:34.0" uuid="1991ca31-2630-4917-8db3-eb67cec8f231" updated="2014-03-10 10:06:32.0"  />
+  <KeyStatement id="2466" created="2014-03-10 10:06:15.0" uuid="3e1bbc59-b098-4533-ac35-245e1140a0ae" updated="2014-03-10 10:06:32.0"  />
+  <KeyStatement id="2467" created="2014-03-10 10:03:24.0" uuid="68fd99f6-64ce-4bb8-a6af-d2cf2c046e2c" updated="2014-03-10 10:06:32.0"  />
+  <KeyStatement id="2760" created="2014-10-09 15:42:33.0" uuid="b9702653-f620-4208-bda9-a6fe082004d1" updated="2014-10-09 15:42:44.0" createdby_id="10" updatedby_id="10"/>
+  <KeyStatement id="2761" created="2014-10-09 15:42:55.0" uuid="688a432f-4b57-4c6f-a8f6-0c468a28cb7c" updated="2014-10-09 15:43:03.0" createdby_id="10" updatedby_id="10"/>
+
+  <AgentBase DTYPE="Person" id="4809" created="2010-12-21 15:09:59.0" uuid="945d08f2-eb92-45b6-9252-6275ea6d338b" protectedtitlecache="false" titleCache="R. A. Graham" nomenclaturaltitle="R. A. Graham"/>
+
+  <Extension id="10" created="2014-10-09 15:45:41.0" uuid="0d6f35d7-7e76-446a-a017-7e8355ee1b4c" updated="2014-10-09 15:48:01.0" extendedObj_type="eu.etaxonomy.cdm.model.description.PolytomousKey" extendedObj_id="1550" value="http://test.com" createdby_id="10" updatedby_id="10" type_id="2075"/>
+
+  <PolytomousKey_OriginalSourceBase PolytomousKey_id="1550" sources_id="23710"/>
+  <PolytomousKey_OriginalSourceBase PolytomousKey_id="1550" sources_id="23711"/>
+
+  <PolytomousKey_RightsInfo PolytomousKey_id="1550" rights_id="10"/>
+
+  <KeyStatement_LanguageString KeyStatement_id="2460" label_id="13782" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2461" label_id="13783" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2462" label_id="13784" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2463" label_id="13786" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2464" label_id="13789" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2465" label_id="13790" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2466" label_id="13792" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2467" label_id="13796" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2760" label_id="14570" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2761" label_id="14571" label_mapkey_id="124"/>
+
+  <PolytomousKey id="751" created="2013-03-24 11:17:08.0" uuid="9d8bf4f6-a70a-4b80-8556-2ccfb436ff01" protectedtitlecache="true" titleCache="Asphodeline"   startNumber="1"/>
+  <PolytomousKey id="1550" created="2014-03-10 10:02:35.0" uuid="0d53ba20-7de4-4baa-bd8a-401048447d66" updated="2014-03-10 10:02:42.0" protectedtitlecache="true" titleCache="Achillea"   root_id="2750" startNumber="1"/>
+
+  <OriginalSourceBase DTYPE="IdentifiableSource" id="23710" created="2014-03-10 10:06:57.0" uuid="95e05e82-499d-4b8a-ad6b-1085f74a7496" updated="2014-03-10 10:07:33.0" sourcedObj_type="eu.etaxonomy.cdm.model.description.PolytomousKey" sourcedObj_id="1550"    sourceType="PTS"/>
+  <OriginalSourceBase DTYPE="IdentifiableSource" id="23711" created="2014-03-10 10:06:48.0" uuid="f77555fe-0d98-4c9f-98ed-a5bca6b1e342" updated="2014-03-10 10:07:33.0" sourcedObj_type="eu.etaxonomy.cdm.model.description.PolytomousKey" sourcedObj_id="1550"    sourceType="PTS"/>   
+  
+</dataset>
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/session/CdmEntitySessionManagerTest.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/session/CdmEntitySessionManagerTest.xml
new file mode 100644 (file)
index 0000000..f5683e0
--- /dev/null
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?><!--
+  generated by Jailer 4.3, Thu Oct 09 18:00:09 CEST 2014 from cmathew@cmbgbm-t530
+  
+  Extraction Model:  PolytomousKey where uuid like '0d53ba20-7de4-4baa-bd8a-401048447d66' (extractionmodel/by-example/SbE-PolytomousKey-17-59-56-907.csv)
+  Database URL:      jdbc:mysql://127.0.0.1:3306/local-cyprus
+  Database User:     root
+  
+  Exported Rows:     79
+      AgentBase                      1
+      Credit                         1
+      Extension                      1
+      KeyStatement                   10
+      KeyStatement_LanguageString    10
+      LanguageString                 19
+      OriginalSourceBase             2
+      PolytomousKey                  2
+      PolytomousKeyNode              10
+      PolytomousKeyNode_LanguageString 9
+      PolytomousKey_Credit           1
+      PolytomousKey_Extension        1
+      PolytomousKey_OriginalSourceBase 2
+      PolytomousKey_RightsInfo       1
+      PolytomousKey_Taxon            1
+      RightsInfo                     1
+      TaxonBase                      6
+  
+--><dataset>
+  <PolytomousKey_Extension PolytomousKey_id="1550" extensions_id="10"/>
+
+  <PolytomousKey_Credit PolytomousKey_id="1550" credits_id="20" sortIndex="0"/>
+
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2751" modifyingtext_id="13780" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2752" modifyingtext_id="13781" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2753" modifyingtext_id="13795" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2754" modifyingtext_id="13788" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2755" modifyingtext_id="13785" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2756" modifyingtext_id="13787" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2757" modifyingtext_id="13794" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2758" modifyingtext_id="13791" modifyingtext_mapkey_id="124"/>
+  <PolytomousKeyNode_LanguageString PolytomousKeyNode_id="2759" modifyingtext_id="13793" modifyingtext_mapkey_id="124"/>
+
+  <LanguageString id="13780" created="2014-03-10 10:03:09.0" uuid="cceaa60b-61f4-4c8a-bb0e-d45f0fa3e2dc" text="Modifying Text 1a" language_id="124"/>
+  <LanguageString id="13781" created="2014-03-10 10:03:17.0" uuid="01a0ace4-de49-4725-9909-e881fb13035d" text="" language_id="124"/>
+  <LanguageString id="13782" created="2014-03-10 10:03:48.0" uuid="ec0fea40-69dd-4c3e-ab7a-34948037a069" updated="2014-03-10 10:06:32.0" text="Capitula with ligulate ray-florets; leaves pinnatisect"   language_id="124"/>
+  <LanguageString id="13783" created="2014-03-10 10:04:03.0" uuid="82f8a3a0-567f-4d89-ba10-3f3699111d55" updated="2014-03-10 10:06:32.0" text="Ray-florets yellow"   language_id="124"/>
+  <LanguageString id="13784" created="2014-03-10 10:04:21.0" uuid="4270501f-1efc-45c2-9e8f-c65f120e8f4c" updated="2014-03-10 10:06:32.0" text="Stem thinly pilose; leaves 10-15 mm wide, with spreading linear-subulate segments; perennial herb"   language_id="124"/>
+  <LanguageString id="13785" created="2014-03-10 10:04:07.0" uuid="813f5fd6-c8f6-43e8-9a2b-1464f3ba052a" updated="2014-03-10 10:06:32.0" text=""   language_id="124"/>
+  <LanguageString id="13786" created="2014-03-10 10:04:53.0" uuid="ba17ac94-632f-4d69-ac89-a882e19ff1c5" updated="2014-03-10 10:06:32.0" text="Stem white-tomentose; leaves 1-3 mm wide, with minute overlapping, transverse segments; small subshrubs with a woody base"   language_id="124"/>
+  <LanguageString id="13787" created="2014-03-10 10:04:34.0" uuid="ab219a5d-e0c4-45fd-8405-6693c3fb8abf" updated="2014-03-10 10:06:32.0" text=""   language_id="124"/>
+  <LanguageString id="13788" created="2014-03-10 10:03:53.0" uuid="2baec690-422d-4f85-bcfd-24f5718cbecf" updated="2014-03-10 10:06:32.0" text=""   language_id="124"/>
+  <LanguageString id="13789" created="2014-03-10 10:05:16.0" uuid="7c6a7984-8e6f-48b1-86b2-d5d643199bf3" updated="2014-03-10 10:06:32.0" text="Ray-florets white"   language_id="124"/>
+  <LanguageString id="13790" created="2014-03-10 10:05:34.0" uuid="72bd8bc9-1904-47ab-8bec-b9296a98b244" updated="2014-03-10 10:06:32.0" text="Perennial herb; stem pilose, hairy or glabrescent, but not tomentose; ligules 1-2 mm diam."   language_id="124"/>
+  <LanguageString id="13791" created="2014-03-10 10:05:20.0" uuid="c917e3fb-e48b-4207-b77d-c1c108e37906" updated="2014-03-10 10:06:32.0" text=""   language_id="124"/>
+  <LanguageString id="13792" created="2014-03-10 10:06:15.0" uuid="c5dd35d8-da6a-4d05-b30c-6b55220bd989" updated="2014-03-10 10:06:32.0" text="Shrub with a woody base; stem white-tomentose or woolly; ligules 4-5 mm diam."   language_id="124"/>
+  <LanguageString id="13793" created="2014-03-10 10:06:03.0" uuid="227a17f6-1ca1-4d06-8480-25711b614863" updated="2014-03-10 10:06:32.0" text=""   language_id="124"/>
+  <LanguageString id="13794" created="2014-03-10 10:05:07.0" uuid="2c434ab1-8ca7-4464-b5cd-4cee40db41ed" updated="2014-03-10 10:06:32.0" text=""   language_id="124"/>
+  <LanguageString id="13795" created="2014-03-10 10:03:38.0" uuid="27190d54-f53b-401e-820c-edfb36d4bcbf" updated="2014-03-10 10:06:32.0" text=""   language_id="124"/>
+  <LanguageString id="13796" created="2014-03-10 10:03:25.0" uuid="69cffb28-8a85-478f-bcae-533e20938ccd" updated="2014-03-10 10:06:32.0" text="Capitula without ligulate ray-florets; leaves entire or subentire"   language_id="124"/>
+  <LanguageString id="14570" created="2014-10-09 15:42:33.0" uuid="84967760-6dbe-4af4-8e0c-309f1af6ce20" updated="2014-10-09 15:42:44.0" text="Question 1" createdby_id="10" updatedby_id="10" language_id="124"/>
+  <LanguageString id="14571" created="2014-10-09 15:42:55.0" uuid="d82f37b1-f51d-42c1-a291-0c7820db155e" updated="2014-10-09 15:43:03.0" text="Question 2" createdby_id="10" updatedby_id="10" language_id="124"/>
+
+  <TaxonBase DTYPE="Taxon" id="32" created="2011-03-01 20:11:26.0" uuid="8217ef77-2ab1-4318-bd67-ccd0cdef07c4" protectedtitlecache="false" titleCache="Achillea arabica Kotschy sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="35" created="2010-12-21 15:09:43.0" uuid="fade44fd-34b2-455f-861a-d1372b866f06" protectedtitlecache="false" titleCache="Achillea sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="36" created="2011-03-01 20:11:26.0" uuid="05f0a2e1-e3c3-4e74-8fec-8a0ae89236c3" protectedtitlecache="false" titleCache="Achillea cretica L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="37" created="2011-03-01 20:11:26.0" uuid="0f8d18a9-e861-48e8-bfab-83e01a379bc0" protectedtitlecache="false" titleCache="Achillea maritima (L.)Ehrend. &amp; Y.-P. Guo subsp. maritima sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="40" created="2010-12-21 15:09:43.0" uuid="2b336df7-29e8-4f79-985f-66502739d22f" protectedtitlecache="false" titleCache="Achillea millefolium L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11"  sec_id="10" publish="true"/>
+  <TaxonBase DTYPE="Taxon" id="41" created="2011-03-01 20:11:26.0" uuid="094e1af8-efd8-4605-b037-b4f715379562" protectedtitlecache="false" titleCache="Achillea santolinoides subsp. wilhelmsii (K. Koch) Greuter sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" createdby_id="11" sec_id="10" publish="true"/>
+
+  <PolytomousKey_Taxon polytomousKey_id="1550" taxon_id="35"/>
+
+  <RightsInfo id="10" created="2014-10-09 15:45:53.0" uuid="bdfb572b-be25-45e7-9349-22a9da43531f" updated="2014-10-09 15:48:01.0" text="Rights Text Test" createdby_id="10" updatedby_id="10" agent_id="4809" type_id="2056"/>
+
+  <PolytomousKeyNode id="2750" created="2014-03-10 10:02:35.0" uuid="75e4c924-ff58-4ee7-a59d-fd9173517d08" updated="2014-03-10 10:02:42.0" nodenumber="1"   key_id="1550" question_id="2760"/>
+  <PolytomousKeyNode id="2751" created="2014-03-10 10:02:52.0" uuid="23e51ff7-11b1-443b-aff2-3fe8b5ace9fe" sortindex="0" key_id="1550" statement_id="2467" subkey_id="1550" taxon_id="37" parent_id="2750"/>
+  <PolytomousKeyNode id="2752" created="2014-03-10 10:03:16.0" uuid="dcf326f7-c0ad-4e76-b64e-43aea11f767c" key_id="1550"/>
+  <PolytomousKeyNode id="2753" created="2014-03-10 10:03:38.0" uuid="b775c027-13c0-4b87-8aa9-712faeaafbdc" updated="2014-03-10 10:06:32.0" nodenumber="2" sortindex="1"   key_id="1550" question_id="2761" statement_id="2460"  subkey_id="1550" parent_id="2750"/>
+  <PolytomousKeyNode id="2754" created="2014-03-10 10:03:52.0" uuid="df5d5922-35de-43d5-9d46-7730ae28eeb3" updated="2014-03-10 10:06:32.0" nodenumber="3" sortindex="0"   key_id="1550" statement_id="2461" subkey_id="1550" parent_id="2753"/>
+  <PolytomousKeyNode id="2755" created="2014-03-10 10:04:07.0" uuid="0c8583ee-399e-433c-b76b-272c54dbd9f5" updated="2014-03-10 10:06:32.0" sortindex="0"   key_id="1550" statement_id="2462" taxon_id="32" parent_id="2754"/>
+  <PolytomousKeyNode id="2756" created="2014-03-10 10:04:34.0" uuid="a10e1e61-82c0-470e-a245-10a927b80c9a" updated="2014-03-10 10:06:32.0" sortindex="1"   key_id="1550" statement_id="2463" taxon_id="41" parent_id="2754"/>
+  <PolytomousKeyNode id="2757" created="2014-03-10 10:05:07.0" uuid="19f7a6a2-4c55-49cb-8b92-d68a9fd9074c" updated="2014-03-10 10:06:32.0" nodenumber="4" sortindex="1"   key_id="1550" statement_id="2464" parent_id="2753"/>
+  <PolytomousKeyNode id="2758" created="2014-03-10 10:05:20.0" uuid="0a4d86d1-fba5-4088-8dcc-6f0e7268ca5b" updated="2014-03-10 10:06:32.0" sortindex="0"   key_id="1550" statement_id="2465" taxon_id="40" parent_id="2757"/>
+  <PolytomousKeyNode id="2759" created="2014-03-10 10:06:03.0" uuid="827c9df4-ac15-4163-95ab-616d51f62803" updated="2014-03-10 10:06:32.0" sortindex="1"   key_id="1550" statement_id="2466" taxon_id="36" parent_id="2757"/>
+
+  <Credit id="20" created="2014-10-09 15:45:22.0" uuid="aa412b15-ee6c-4834-b14e-a66969cb398d" updated="2014-10-09 15:48:01.0" text="Credits Text Test" createdby_id="10" updatedby_id="10" language_id="124" agent_id="4809"/>
+
+  <KeyStatement id="2460" created="2014-03-10 10:03:48.0" uuid="66da6df7-784c-4d5a-9378-58b2cf92ba13" updated="2014-03-10 10:06:32.0"  />
+  <KeyStatement id="2461" created="2014-03-10 10:04:03.0" uuid="f9cfd498-de47-48fd-b38c-43cf57b63750" updated="2014-03-10 10:06:32.0"  />
+  <KeyStatement id="2462" created="2014-03-10 10:04:21.0" uuid="817fb39e-91d4-4d8c-a942-6acab47575d1" updated="2014-03-10 10:06:32.0"  />
+  <KeyStatement id="2463" created="2014-03-10 10:04:53.0" uuid="6b571b86-7764-4f27-925c-ae5e2653f7ad" updated="2014-03-10 10:06:32.0"  />
+  <KeyStatement id="2464" created="2014-03-10 10:05:16.0" uuid="91bbb534-abdf-4915-9f6f-a0cb41f8cf58" updated="2014-03-10 10:06:32.0"  />
+  <KeyStatement id="2465" created="2014-03-10 10:05:34.0" uuid="1991ca31-2630-4917-8db3-eb67cec8f231" updated="2014-03-10 10:06:32.0"  />
+  <KeyStatement id="2466" created="2014-03-10 10:06:15.0" uuid="3e1bbc59-b098-4533-ac35-245e1140a0ae" updated="2014-03-10 10:06:32.0"  />
+  <KeyStatement id="2467" created="2014-03-10 10:03:24.0" uuid="68fd99f6-64ce-4bb8-a6af-d2cf2c046e2c" updated="2014-03-10 10:06:32.0"  />
+  <KeyStatement id="2760" created="2014-10-09 15:42:33.0" uuid="b9702653-f620-4208-bda9-a6fe082004d1" updated="2014-10-09 15:42:44.0" createdby_id="10" updatedby_id="10"/>
+  <KeyStatement id="2761" created="2014-10-09 15:42:55.0" uuid="688a432f-4b57-4c6f-a8f6-0c468a28cb7c" updated="2014-10-09 15:43:03.0" createdby_id="10" updatedby_id="10"/>
+
+  <AgentBase DTYPE="Person" id="4809" created="2010-12-21 15:09:59.0" uuid="945d08f2-eb92-45b6-9252-6275ea6d338b" protectedtitlecache="false" titleCache="R. A. Graham" nomenclaturaltitle="R. A. Graham" createdby_id="11"/>
+
+  <Extension id="10" created="2014-10-09 15:45:41.0" uuid="0d6f35d7-7e76-446a-a017-7e8355ee1b4c" updated="2014-10-09 15:48:01.0" extendedObj_type="eu.etaxonomy.cdm.model.description.PolytomousKey" extendedObj_id="1550" value="http://test.com" createdby_id="10" updatedby_id="10" type_id="2075"/>
+
+  <PolytomousKey_OriginalSourceBase PolytomousKey_id="1550" sources_id="23710"/>
+  <PolytomousKey_OriginalSourceBase PolytomousKey_id="1550" sources_id="23711"/>
+
+  <PolytomousKey_RightsInfo PolytomousKey_id="1550" rights_id="10"/>
+
+  <KeyStatement_LanguageString KeyStatement_id="2460" label_id="13782" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2461" label_id="13783" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2462" label_id="13784" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2463" label_id="13786" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2464" label_id="13789" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2465" label_id="13790" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2466" label_id="13792" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2467" label_id="13796" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2760" label_id="14570" label_mapkey_id="124"/>
+  <KeyStatement_LanguageString KeyStatement_id="2761" label_id="14571" label_mapkey_id="124"/>
+
+  <PolytomousKey id="751" created="2013-03-24 11:17:08.0" uuid="9d8bf4f6-a70a-4b80-8556-2ccfb436ff01" protectedtitlecache="true" titleCache="Asphodeline"   startNumber="1"/>
+  <PolytomousKey id="1550" created="2014-03-10 10:02:35.0" uuid="0d53ba20-7de4-4baa-bd8a-401048447d66" updated="2014-03-10 10:02:42.0" protectedtitlecache="true" titleCache="Achillea"   root_id="2750" startNumber="1"/>
+
+  <OriginalSourceBase DTYPE="IdentifiableSource" id="23710" created="2014-03-10 10:06:57.0" uuid="95e05e82-499d-4b8a-ad6b-1085f74a7496" updated="2014-03-10 10:07:33.0" sourcedObj_type="eu.etaxonomy.cdm.model.description.PolytomousKey" sourcedObj_id="1550"    sourceType="PTS"/>
+  <OriginalSourceBase DTYPE="IdentifiableSource" id="23711" created="2014-03-10 10:06:48.0" uuid="f77555fe-0d98-4c9f-98ed-a5bca6b1e342" updated="2014-03-10 10:07:33.0" sourcedObj_type="eu.etaxonomy.cdm.model.description.PolytomousKey" sourcedObj_id="1550"    sourceType="PTS"/>
+
+  
+</dataset>
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/h2/cdmTest.h2.db b/eu.etaxonomy.taxeditor.test/src/test/resources/h2/cdmTest.h2.db
new file mode 100644 (file)
index 0000000..98a3b77
Binary files /dev/null and b/eu.etaxonomy.taxeditor.test/src/test/resources/h2/cdmTest.h2.db differ
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/imports/ABCDImport.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/imports/ABCDImport.xml
new file mode 100644 (file)
index 0000000..b97b0f1
--- /dev/null
@@ -0,0 +1,737 @@
+<?xml version="1.0"?>
+<abcd:DataSets xmlns:abcd="http://www.tdwg.org/schemas/abcd/2.06" xmlns:biocase="http://www.biocase.org/schemas/protocol/1.3" xmlns:ns1="http://www.dnabank-network.org/test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.biocase.org/schemas/protocol/1.3 http://www.bgbm.org/biodivinf/schema/protocol_1_31.xsd">
+      <abcd:DataSet>
+        <abcd:DatasetGUID>www.floraweb.de/florkart/atlas/2007</abcd:DatasetGUID>
+        <abcd:TechnicalContacts>
+          <abcd:TechnicalContact>
+            <abcd:Name>Rudolf May</abcd:Name>
+            <abcd:Email>rudolf.may@bfn.de</abcd:Email>
+            <abcd:Phone>+49-228-84911441</abcd:Phone>
+            <abcd:Address>BfN, Konstantinstr. 110, D-53179 Bonn</abcd:Address>
+          </abcd:TechnicalContact>
+        </abcd:TechnicalContacts>
+        <abcd:ContentContacts>
+          <abcd:ContentContact>
+            <abcd:Name>Rudolf May</abcd:Name>
+            <abcd:Email>rudolf.may@bfn.de</abcd:Email>
+            <abcd:Phone>+49-228-84911441</abcd:Phone>
+            <abcd:Address>BfN, Konstantinstr. 110, D-53179 Bonn</abcd:Address>
+          </abcd:ContentContact>
+        </abcd:ContentContacts>
+        <abcd:Metadata>
+          <abcd:Description>
+            <abcd:Representation abcd:language="GE German Deutsch">
+              <abcd:Title>FlorKart - FlorenKartierung Gefaesspflanzen</abcd:Title>
+              <abcd:Details>Verbreitung der Farn- und Bluetenpflanzen in Deutschland, Vorkommensnachweise aggregiert auf Rasterfelder der Topographischen Karte im Massstab 1 : 25000 (TK25 = MTB), Blattschnitt 6 x 10 Minuten, sowie in Zeitperioden 'vor 1950', '1950 - 1980', '1980 - 2000'</abcd:Details>
+              <abcd:Coverage>Deutschland</abcd:Coverage>
+              <abcd:URI>http://www.floraweb.de</abcd:URI>
+            </abcd:Representation>
+          </abcd:Description>
+          <abcd:IconURI>http://www.floraweb.de/images/floraweb.gif</abcd:IconURI>
+          <abcd:Version>
+            <abcd:Major>2007</abcd:Major>
+          </abcd:Version>
+          <abcd:RevisionData>
+            <abcd:Creators>Netzwerk Phytodiversitaet Deutschlands (NetPhyD) und Bundesamt f&#xFC;r Naturschutz (BfN)</abcd:Creators>
+            <abcd:Contributors>Alle ehrenamtlich an der Floristischen Kartierung Deutschlands beteiligten Mitarbeiter</abcd:Contributors>
+            <abcd:DateCreated>2007-01-01</abcd:DateCreated>
+            <abcd:DateModified>2010-01-01</abcd:DateModified>
+          </abcd:RevisionData>
+          <abcd:Owners>
+            <abcd:Owner>
+              <abcd:Organisation>
+                <abcd:Name>
+                  <abcd:Representation abcd:language="GE German Deutsch">
+                    <abcd:Text>Bundesamt f&#xFC;r Naturschutz (BfN) und Netzwerk Phytodiversit&#xE4;t Deutschlands (NetPhyD)</abcd:Text>
+                    <abcd:Abbreviation>BfN/NetPhyD</abcd:Abbreviation>
+                  </abcd:Representation>
+                </abcd:Name>
+              </abcd:Organisation>
+              <abcd:Person>
+                <abcd:FullName>Rudolf May</abcd:FullName>
+              </abcd:Person>
+              <abcd:Roles>
+                <abcd:Role>Project Manager</abcd:Role>
+              </abcd:Roles>
+              <abcd:Addresses>
+                <abcd:Address>BfN, Konstantinstr. 110, D-53179 Bonn</abcd:Address>
+              </abcd:Addresses>
+              <abcd:TelephoneNumbers>
+                <abcd:TelephoneNumber>
+                  <abcd:Number>+49-228-84911441</abcd:Number>
+                  <abcd:Device>voice</abcd:Device>
+                </abcd:TelephoneNumber>
+              </abcd:TelephoneNumbers>
+              <abcd:EmailAddresses>
+                <abcd:EmailAddress>floraweb@bfn.de</abcd:EmailAddress>
+              </abcd:EmailAddresses>
+              <abcd:URIs>
+                <abcd:URL>http://www.bfn.de</abcd:URL>
+              </abcd:URIs>
+              <abcd:LogoURI>http://www.bfn.de/fileadmin/global/templates/images/logo_bfn.gif</abcd:LogoURI>
+            </abcd:Owner>
+          </abcd:Owners>
+          <abcd:IPRStatements>
+            <abcd:IPRDeclarations>
+              <abcd:IPRDeclaration abcd:language="GE German Deutsch">
+                <abcd:Text>Mitarbeiter der Floristischen Kartierung Deutschlands</abcd:Text>
+                <abcd:Details>Alle amtlich und ehrenamtlich an der Floristischen Kartierung Deutschlands beteiligten Mitarbeiter</abcd:Details>
+              </abcd:IPRDeclaration>
+            </abcd:IPRDeclarations>
+            <abcd:Copyrights>
+              <abcd:Copyright abcd:language="GE German Deutsch">
+                <abcd:Text>BfN/NetPhyD</abcd:Text>
+                <abcd:Details>Bundesamt fuer Naturschutz und Netzwerk Phytodiversitaet Deutschlands</abcd:Details>
+              </abcd:Copyright>
+            </abcd:Copyrights>
+            <abcd:TermsOfUseStatements>
+              <abcd:TermsOfUse abcd:language="GE German Deutsch">
+                <abcd:Text>Bei Verwendung in Publikationen bitte die Datenquelle vollstaendig zitieren.</abcd:Text>
+                <abcd:Details>Bei Verwendung in Publikationen bitte die Datenquelle vollstaendig zitieren.  Die Verwendung der Daten zu kommerziellen Zwecken wird untersagt.</abcd:Details>
+              </abcd:TermsOfUse>
+            </abcd:TermsOfUseStatements>
+            <abcd:Disclaimers>
+              <abcd:Disclaimer abcd:language="GE German Deutsch">
+                <abcd:Text>Fuer die Richtigkeit der Daten wird keine Gewaehrleistung uebernommen</abcd:Text>
+                <abcd:Details>Fuer die Richtigkeit der Daten wird keine Gewaehrleistung uebernommen</abcd:Details>
+              </abcd:Disclaimer>
+            </abcd:Disclaimers>
+            <abcd:Acknowledgements>
+              <abcd:Acknowledgement abcd:language="GE German Deutsch">
+                <abcd:Text>In Anerkennung der Leistungen der ehrenamtlichen Kartierer der Flora Deutschlands</abcd:Text>
+                <abcd:Details>Die Kompilation der Verbreitungsdaten beruht auf unentgeltlich erbrachten Kartierungsleistungen von &#xFC;ber 2000 ehrenamtlichen Mitarbeitern der Floristischen Kartierung Deutschlands, die in zahlreichen regionalen Kartierungsprojekten organisiert sind.</abcd:Details>
+                <abcd:URI>http://www.floraweb.de/pflanzenarten/hintergrundtexte_florkart_organisation.html</abcd:URI>
+              </abcd:Acknowledgement>
+            </abcd:Acknowledgements>
+            <abcd:Citations>
+              <abcd:Citation abcd:language="GE German Deutsch">
+                <abcd:Text>Datenbank FLORKART, BfN und NetPhyD</abcd:Text>
+                <abcd:Details>Datenbank FLORKART der Floristischen Kartierung Deutschlands, Stand 2007, Bundesamt f&#xFC;r Naturschutz (BfN) und Netzwerk Phytodiversitaet Deutschland (NetPhyD)</abcd:Details>
+              </abcd:Citation>
+            </abcd:Citations>
+          </abcd:IPRStatements>
+        </abcd:Metadata>
+        <abcd:Units>
+          <abcd:Unit>
+            <abcd:SourceInstitutionID>BfN</abcd:SourceInstitutionID>
+            <abcd:SourceID>FlorKart_BfN</abcd:SourceID>
+            <abcd:UnitID>1003121</abcd:UnitID>
+            <abcd:UnitReferences>
+              <abcd:UnitReference>
+                <abcd:TitleCitation>Datenbank FLORKART, BfN und NetPhyD</abcd:TitleCitation>
+                <abcd:CitationDetail>Datenbank FLORKART der Floristischen Kartierung Deutschlands, Stand 2007, Bundesamt f&#xFC;r Naturschutz (BfN) und Netzwerk Phytodiversitaet Deutschland (NetPhyD)</abcd:CitationDetail>
+              </abcd:UnitReference>
+            </abcd:UnitReferences>
+            <abcd:Identifications>
+              <abcd:Identification>
+                <abcd:Result>
+                  <abcd:TaxonIdentified>
+                    <abcd:HigherTaxa>
+                      <abcd:HigherTaxon>
+                        <abcd:HigherTaxonName>Asteraceae</abcd:HigherTaxonName>
+                      </abcd:HigherTaxon>
+                    </abcd:HigherTaxa>
+                    <abcd:ScientificName>
+                      <abcd:FullScientificNameString>Cichorium calvum Asch.</abcd:FullScientificNameString>
+                      <abcd:NameAtomised>
+                        <abcd:Botanical>
+                          <abcd:GenusOrMonomial>Cichorium</abcd:GenusOrMonomial>
+                          <abcd:FirstEpithet>calvum</abcd:FirstEpithet>
+                          <abcd:Rank>SPE</abcd:Rank>
+                          <abcd:AuthorTeamParenthesis>Asch.</abcd:AuthorTeamParenthesis>
+                        </abcd:Botanical>
+                      </abcd:NameAtomised>
+                    </abcd:ScientificName>
+                  </abcd:TaxonIdentified>
+                </abcd:Result>
+              </abcd:Identification>
+            </abcd:Identifications>
+            <abcd:Gathering>
+              <abcd:DateTime>
+                <abcd:DateText>1950-1980</abcd:DateText>
+                <abcd:PeriodExplicit>false</abcd:PeriodExplicit>
+              </abcd:DateTime>
+              <abcd:Agents>
+                <abcd:GatheringAgentsText>Mitarbeiter der Floristischen Kartierung Deutschlands</abcd:GatheringAgentsText>
+              </abcd:Agents>
+              <abcd:LocalityText>MTB 3915: Bockhorst</abcd:LocalityText>
+              <abcd:Country>
+                <abcd:Name language="German">Deutschland</abcd:Name>
+              </abcd:Country>
+              <abcd:SiteCoordinateSets>
+                <abcd:SiteCoordinates>
+                  <abcd:CoordinatesGrid>
+                    <abcd:GridCellSystem>German TK25</abcd:GridCellSystem>
+                    <abcd:GridCellCode>3915</abcd:GridCellCode>
+                  </abcd:CoordinatesGrid>
+                  <abcd:CoordinatesLatLong>
+                    <abcd:LongitudeDecimal>8.25</abcd:LongitudeDecimal>
+                    <abcd:LatitudeDecimal>52.06</abcd:LatitudeDecimal>
+                    <abcd:AccuracyStatement>Mittelpunkte von TK25-Rasterfeldern</abcd:AccuracyStatement>
+                    <abcd:CoordinateErrorDistanceInMeters>6363</abcd:CoordinateErrorDistanceInMeters>
+                  </abcd:CoordinatesLatLong>
+                </abcd:SiteCoordinates>
+              </abcd:SiteCoordinateSets>
+            </abcd:Gathering>
+          </abcd:Unit>
+          <abcd:Unit>
+            <abcd:SourceInstitutionID>BfN</abcd:SourceInstitutionID>
+            <abcd:SourceID>FlorKart_BfN</abcd:SourceID>
+            <abcd:UnitID>1003122</abcd:UnitID>
+            <abcd:UnitReferences>
+              <abcd:UnitReference>
+                <abcd:TitleCitation>Datenbank FLORKART, BfN und NetPhyD</abcd:TitleCitation>
+                <abcd:CitationDetail>Datenbank FLORKART der Floristischen Kartierung Deutschlands, Stand 2007, Bundesamt f&#xFC;r Naturschutz (BfN) und Netzwerk Phytodiversitaet Deutschland (NetPhyD)</abcd:CitationDetail>
+              </abcd:UnitReference>
+            </abcd:UnitReferences>
+            <abcd:Identifications>
+              <abcd:Identification>
+                <abcd:Result>
+                  <abcd:TaxonIdentified>
+                    <abcd:HigherTaxa>
+                      <abcd:HigherTaxon>
+                        <abcd:HigherTaxonName>Asteraceae</abcd:HigherTaxonName>
+                      </abcd:HigherTaxon>
+                    </abcd:HigherTaxa>
+                    <abcd:ScientificName>
+                      <abcd:FullScientificNameString>Cichorium calvum Asch.</abcd:FullScientificNameString>
+                      <abcd:NameAtomised>
+                        <abcd:Botanical>
+                          <abcd:GenusOrMonomial>Cichorium</abcd:GenusOrMonomial>
+                          <abcd:FirstEpithet>calvum</abcd:FirstEpithet>
+                          <abcd:Rank>SPE</abcd:Rank>
+                          <abcd:AuthorTeamParenthesis>Asch.</abcd:AuthorTeamParenthesis>
+                        </abcd:Botanical>
+                      </abcd:NameAtomised>
+                    </abcd:ScientificName>
+                  </abcd:TaxonIdentified>
+                </abcd:Result>
+              </abcd:Identification>
+            </abcd:Identifications>
+            <abcd:Gathering>
+              <abcd:DateTime>
+                <abcd:DateText>1950-1980</abcd:DateText>
+                <abcd:PeriodExplicit>false</abcd:PeriodExplicit>
+              </abcd:DateTime>
+              <abcd:Agents>
+                <abcd:GatheringAgentsText>Mitarbeiter der Floristischen Kartierung Deutschlands</abcd:GatheringAgentsText>
+              </abcd:Agents>
+              <abcd:LocalityText>MTB 3916: Halle  (Westfalen)</abcd:LocalityText>
+              <abcd:Country>
+                <abcd:Name language="German">Deutschland</abcd:Name>
+              </abcd:Country>
+              <abcd:SiteCoordinateSets>
+                <abcd:SiteCoordinates>
+                  <abcd:CoordinatesGrid>
+                    <abcd:GridCellSystem>German TK25</abcd:GridCellSystem>
+                    <abcd:GridCellCode>3916</abcd:GridCellCode>
+                  </abcd:CoordinatesGrid>
+                  <abcd:CoordinatesLatLong>
+                    <abcd:LongitudeDecimal>8.42</abcd:LongitudeDecimal>
+                    <abcd:LatitudeDecimal>52.06</abcd:LatitudeDecimal>
+                    <abcd:AccuracyStatement>Mittelpunkte von TK25-Rasterfeldern</abcd:AccuracyStatement>
+                    <abcd:CoordinateErrorDistanceInMeters>6363</abcd:CoordinateErrorDistanceInMeters>
+                  </abcd:CoordinatesLatLong>
+                </abcd:SiteCoordinates>
+              </abcd:SiteCoordinateSets>
+            </abcd:Gathering>
+          </abcd:Unit>
+          <abcd:Unit>
+            <abcd:SourceInstitutionID>BfN</abcd:SourceInstitutionID>
+            <abcd:SourceID>FlorKart_BfN</abcd:SourceID>
+            <abcd:UnitID>1003123</abcd:UnitID>
+            <abcd:UnitReferences>
+              <abcd:UnitReference>
+                <abcd:TitleCitation>Datenbank FLORKART, BfN und NetPhyD</abcd:TitleCitation>
+                <abcd:CitationDetail>Datenbank FLORKART der Floristischen Kartierung Deutschlands, Stand 2007, Bundesamt f&#xFC;r Naturschutz (BfN) und Netzwerk Phytodiversitaet Deutschland (NetPhyD)</abcd:CitationDetail>
+              </abcd:UnitReference>
+            </abcd:UnitReferences>
+            <abcd:Identifications>
+              <abcd:Identification>
+                <abcd:Result>
+                  <abcd:TaxonIdentified>
+                    <abcd:HigherTaxa>
+                      <abcd:HigherTaxon>
+                        <abcd:HigherTaxonName>Asteraceae</abcd:HigherTaxonName>
+                      </abcd:HigherTaxon>
+                    </abcd:HigherTaxa>
+                    <abcd:ScientificName>
+                      <abcd:FullScientificNameString>Cichorium calvum Asch.</abcd:FullScientificNameString>
+                      <abcd:NameAtomised>
+                        <abcd:Botanical>
+                          <abcd:GenusOrMonomial>Cichorium</abcd:GenusOrMonomial>
+                          <abcd:FirstEpithet>calvum</abcd:FirstEpithet>
+                          <abcd:Rank>SPE</abcd:Rank>
+                          <abcd:AuthorTeamParenthesis>Asch.</abcd:AuthorTeamParenthesis>
+                        </abcd:Botanical>
+                      </abcd:NameAtomised>
+                    </abcd:ScientificName>
+                  </abcd:TaxonIdentified>
+                </abcd:Result>
+              </abcd:Identification>
+            </abcd:Identifications>
+            <abcd:Gathering>
+              <abcd:DateTime>
+                <abcd:DateText>1950-1980</abcd:DateText>
+                <abcd:PeriodExplicit>false</abcd:PeriodExplicit>
+              </abcd:DateTime>
+              <abcd:Agents>
+                <abcd:GatheringAgentsText>Mitarbeiter der Floristischen Kartierung Deutschlands</abcd:GatheringAgentsText>
+              </abcd:Agents>
+              <abcd:LocalityText>MTB 5628: Bad K&#xF6;nigshofen im Grabfeld</abcd:LocalityText>
+              <abcd:Country>
+                <abcd:Name language="German">Deutschland</abcd:Name>
+              </abcd:Country>
+              <abcd:SiteCoordinateSets>
+                <abcd:SiteCoordinates>
+                  <abcd:CoordinatesGrid>
+                    <abcd:GridCellSystem>German TK25</abcd:GridCellSystem>
+                    <abcd:GridCellCode>5628</abcd:GridCellCode>
+                  </abcd:CoordinatesGrid>
+                  <abcd:CoordinatesLatLong>
+                    <abcd:LongitudeDecimal>10.42</abcd:LongitudeDecimal>
+                    <abcd:LatitudeDecimal>50.36</abcd:LatitudeDecimal>
+                    <abcd:AccuracyStatement>Mittelpunkte von TK25-Rasterfeldern</abcd:AccuracyStatement>
+                    <abcd:CoordinateErrorDistanceInMeters>6481</abcd:CoordinateErrorDistanceInMeters>
+                  </abcd:CoordinatesLatLong>
+                </abcd:SiteCoordinates>
+              </abcd:SiteCoordinateSets>
+            </abcd:Gathering>
+          </abcd:Unit>
+          <abcd:Unit>
+            <abcd:SourceInstitutionID>BfN</abcd:SourceInstitutionID>
+            <abcd:SourceID>FlorKart_BfN</abcd:SourceID>
+            <abcd:UnitID>1003124</abcd:UnitID>
+            <abcd:UnitReferences>
+              <abcd:UnitReference>
+                <abcd:TitleCitation>Datenbank FLORKART, BfN und NetPhyD</abcd:TitleCitation>
+                <abcd:CitationDetail>Datenbank FLORKART der Floristischen Kartierung Deutschlands, Stand 2007, Bundesamt f&#xFC;r Naturschutz (BfN) und Netzwerk Phytodiversitaet Deutschland (NetPhyD)</abcd:CitationDetail>
+              </abcd:UnitReference>
+            </abcd:UnitReferences>
+            <abcd:Identifications>
+              <abcd:Identification>
+                <abcd:Result>
+                  <abcd:TaxonIdentified>
+                    <abcd:HigherTaxa>
+                      <abcd:HigherTaxon>
+                        <abcd:HigherTaxonName>Asteraceae</abcd:HigherTaxonName>
+                      </abcd:HigherTaxon>
+                    </abcd:HigherTaxa>
+                    <abcd:ScientificName>
+                      <abcd:FullScientificNameString>Cichorium calvum Asch.</abcd:FullScientificNameString>
+                      <abcd:NameAtomised>
+                        <abcd:Botanical>
+                          <abcd:GenusOrMonomial>Cichorium</abcd:GenusOrMonomial>
+                          <abcd:FirstEpithet>calvum</abcd:FirstEpithet>
+                          <abcd:Rank>SPE</abcd:Rank>
+                          <abcd:AuthorTeamParenthesis>Asch.</abcd:AuthorTeamParenthesis>
+                        </abcd:Botanical>
+                      </abcd:NameAtomised>
+                    </abcd:ScientificName>
+                  </abcd:TaxonIdentified>
+                </abcd:Result>
+              </abcd:Identification>
+            </abcd:Identifications>
+            <abcd:Gathering>
+              <abcd:DateTime>
+                <abcd:DateText>1950-1980</abcd:DateText>
+                <abcd:PeriodExplicit>false</abcd:PeriodExplicit>
+              </abcd:DateTime>
+              <abcd:Agents>
+                <abcd:GatheringAgentsText>Mitarbeiter der Floristischen Kartierung Deutschlands</abcd:GatheringAgentsText>
+              </abcd:Agents>
+              <abcd:LocalityText>MTB 5634: Teuschnitz</abcd:LocalityText>
+              <abcd:Country>
+                <abcd:Name language="German">Deutschland</abcd:Name>
+              </abcd:Country>
+              <abcd:SiteCoordinateSets>
+                <abcd:SiteCoordinates>
+                  <abcd:CoordinatesGrid>
+                    <abcd:GridCellSystem>German TK25</abcd:GridCellSystem>
+                    <abcd:GridCellCode>5634</abcd:GridCellCode>
+                  </abcd:CoordinatesGrid>
+                  <abcd:CoordinatesLatLong>
+                    <abcd:LongitudeDecimal>11.42</abcd:LongitudeDecimal>
+                    <abcd:LatitudeDecimal>50.36</abcd:LatitudeDecimal>
+                    <abcd:AccuracyStatement>Mittelpunkte von TK25-Rasterfeldern</abcd:AccuracyStatement>
+                    <abcd:CoordinateErrorDistanceInMeters>6482</abcd:CoordinateErrorDistanceInMeters>
+                  </abcd:CoordinatesLatLong>
+                </abcd:SiteCoordinates>
+              </abcd:SiteCoordinateSets>
+            </abcd:Gathering>
+          </abcd:Unit>
+          <abcd:Unit>
+            <abcd:SourceInstitutionID>BfN</abcd:SourceInstitutionID>
+            <abcd:SourceID>FlorKart_BfN</abcd:SourceID>
+            <abcd:UnitID>1003125</abcd:UnitID>
+            <abcd:UnitReferences>
+              <abcd:UnitReference>
+                <abcd:TitleCitation>Datenbank FLORKART, BfN und NetPhyD</abcd:TitleCitation>
+                <abcd:CitationDetail>Datenbank FLORKART der Floristischen Kartierung Deutschlands, Stand 2007, Bundesamt f&#xFC;r Naturschutz (BfN) und Netzwerk Phytodiversitaet Deutschland (NetPhyD)</abcd:CitationDetail>
+              </abcd:UnitReference>
+            </abcd:UnitReferences>
+            <abcd:Identifications>
+              <abcd:Identification>
+                <abcd:Result>
+                  <abcd:TaxonIdentified>
+                    <abcd:HigherTaxa>
+                      <abcd:HigherTaxon>
+                        <abcd:HigherTaxonName>Asteraceae</abcd:HigherTaxonName>
+                      </abcd:HigherTaxon>
+                    </abcd:HigherTaxa>
+                    <abcd:ScientificName>
+                      <abcd:FullScientificNameString>Cichorium calvum Asch.</abcd:FullScientificNameString>
+                      <abcd:NameAtomised>
+                        <abcd:Botanical>
+                          <abcd:GenusOrMonomial>Cichorium</abcd:GenusOrMonomial>
+                          <abcd:FirstEpithet>calvum</abcd:FirstEpithet>
+                          <abcd:Rank>SPE</abcd:Rank>
+                          <abcd:AuthorTeamParenthesis>Asch.</abcd:AuthorTeamParenthesis>
+                        </abcd:Botanical>
+                      </abcd:NameAtomised>
+                    </abcd:ScientificName>
+                  </abcd:TaxonIdentified>
+                </abcd:Result>
+              </abcd:Identification>
+            </abcd:Identifications>
+            <abcd:Gathering>
+              <abcd:DateTime>
+                <abcd:DateText>1950-1980</abcd:DateText>
+                <abcd:PeriodExplicit>false</abcd:PeriodExplicit>
+              </abcd:DateTime>
+              <abcd:Agents>
+                <abcd:GatheringAgentsText>Mitarbeiter der Floristischen Kartierung Deutschlands</abcd:GatheringAgentsText>
+              </abcd:Agents>
+              <abcd:LocalityText>MTB 5635: Nordhalben</abcd:LocalityText>
+              <abcd:Country>
+                <abcd:Name language="German">Deutschland</abcd:Name>
+              </abcd:Country>
+              <abcd:SiteCoordinateSets>
+                <abcd:SiteCoordinates>
+                  <abcd:CoordinatesGrid>
+                    <abcd:GridCellSystem>German TK25</abcd:GridCellSystem>
+                    <abcd:GridCellCode>5635</abcd:GridCellCode>
+                  </abcd:CoordinatesGrid>
+                  <abcd:CoordinatesLatLong>
+                    <abcd:LongitudeDecimal>11.58</abcd:LongitudeDecimal>
+                    <abcd:LatitudeDecimal>50.36</abcd:LatitudeDecimal>
+                    <abcd:AccuracyStatement>Mittelpunkte von TK25-Rasterfeldern</abcd:AccuracyStatement>
+                    <abcd:CoordinateErrorDistanceInMeters>6483</abcd:CoordinateErrorDistanceInMeters>
+                  </abcd:CoordinatesLatLong>
+                </abcd:SiteCoordinates>
+              </abcd:SiteCoordinateSets>
+            </abcd:Gathering>
+          </abcd:Unit>
+          <abcd:Unit>
+            <abcd:SourceInstitutionID>BfN</abcd:SourceInstitutionID>
+            <abcd:SourceID>FlorKart_BfN</abcd:SourceID>
+            <abcd:UnitID>1003126</abcd:UnitID>
+            <abcd:UnitReferences>
+              <abcd:UnitReference>
+                <abcd:TitleCitation>Datenbank FLORKART, BfN und NetPhyD</abcd:TitleCitation>
+                <abcd:CitationDetail>Datenbank FLORKART der Floristischen Kartierung Deutschlands, Stand 2007, Bundesamt f&#xFC;r Naturschutz (BfN) und Netzwerk Phytodiversitaet Deutschland (NetPhyD)</abcd:CitationDetail>
+              </abcd:UnitReference>
+            </abcd:UnitReferences>
+            <abcd:Identifications>
+              <abcd:Identification>
+                <abcd:Result>
+                  <abcd:TaxonIdentified>
+                    <abcd:HigherTaxa>
+                      <abcd:HigherTaxon>
+                        <abcd:HigherTaxonName>Asteraceae</abcd:HigherTaxonName>
+                      </abcd:HigherTaxon>
+                    </abcd:HigherTaxa>
+                    <abcd:ScientificName>
+                      <abcd:FullScientificNameString>Cichorium calvum Asch.</abcd:FullScientificNameString>
+                      <abcd:NameAtomised>
+                        <abcd:Botanical>
+                          <abcd:GenusOrMonomial>Cichorium</abcd:GenusOrMonomial>
+                          <abcd:FirstEpithet>calvum</abcd:FirstEpithet>
+                          <abcd:Rank>SPE</abcd:Rank>
+                          <abcd:AuthorTeamParenthesis>Asch.</abcd:AuthorTeamParenthesis>
+                        </abcd:Botanical>
+                      </abcd:NameAtomised>
+                    </abcd:ScientificName>
+                  </abcd:TaxonIdentified>
+                </abcd:Result>
+              </abcd:Identification>
+            </abcd:Identifications>
+            <abcd:Gathering>
+              <abcd:DateTime>
+                <abcd:DateText>1950-1980</abcd:DateText>
+                <abcd:PeriodExplicit>false</abcd:PeriodExplicit>
+              </abcd:DateTime>
+              <abcd:Agents>
+                <abcd:GatheringAgentsText>Mitarbeiter der Floristischen Kartierung Deutschlands</abcd:GatheringAgentsText>
+              </abcd:Agents>
+              <abcd:LocalityText>MTB 5728: Oberlauringen</abcd:LocalityText>
+              <abcd:Country>
+                <abcd:Name language="German">Deutschland</abcd:Name>
+              </abcd:Country>
+              <abcd:SiteCoordinateSets>
+                <abcd:SiteCoordinates>
+                  <abcd:CoordinatesGrid>
+                    <abcd:GridCellSystem>German TK25</abcd:GridCellSystem>
+                    <abcd:GridCellCode>5728</abcd:GridCellCode>
+                  </abcd:CoordinatesGrid>
+                  <abcd:CoordinatesLatLong>
+                    <abcd:LongitudeDecimal>10.42</abcd:LongitudeDecimal>
+                    <abcd:LatitudeDecimal>50.26</abcd:LatitudeDecimal>
+                    <abcd:AccuracyStatement>Mittelpunkte von TK25-Rasterfeldern</abcd:AccuracyStatement>
+                    <abcd:CoordinateErrorDistanceInMeters>6487</abcd:CoordinateErrorDistanceInMeters>
+                  </abcd:CoordinatesLatLong>
+                </abcd:SiteCoordinates>
+              </abcd:SiteCoordinateSets>
+            </abcd:Gathering>
+          </abcd:Unit>
+          <abcd:Unit>
+            <abcd:SourceInstitutionID>BfN</abcd:SourceInstitutionID>
+            <abcd:SourceID>FlorKart_BfN</abcd:SourceID>
+            <abcd:UnitID>1003127</abcd:UnitID>
+            <abcd:UnitReferences>
+              <abcd:UnitReference>
+                <abcd:TitleCitation>Datenbank FLORKART, BfN und NetPhyD</abcd:TitleCitation>
+                <abcd:CitationDetail>Datenbank FLORKART der Floristischen Kartierung Deutschlands, Stand 2007, Bundesamt f&#xFC;r Naturschutz (BfN) und Netzwerk Phytodiversitaet Deutschland (NetPhyD)</abcd:CitationDetail>
+              </abcd:UnitReference>
+            </abcd:UnitReferences>
+            <abcd:Identifications>
+              <abcd:Identification>
+                <abcd:Result>
+                  <abcd:TaxonIdentified>
+                    <abcd:HigherTaxa>
+                      <abcd:HigherTaxon>
+                        <abcd:HigherTaxonName>Asteraceae</abcd:HigherTaxonName>
+                      </abcd:HigherTaxon>
+                    </abcd:HigherTaxa>
+                    <abcd:ScientificName>
+                      <abcd:FullScientificNameString>Cichorium calvum Asch.</abcd:FullScientificNameString>
+                      <abcd:NameAtomised>
+                        <abcd:Botanical>
+                          <abcd:GenusOrMonomial>Cichorium</abcd:GenusOrMonomial>
+                          <abcd:FirstEpithet>calvum</abcd:FirstEpithet>
+                          <abcd:Rank>SPE</abcd:Rank>
+                          <abcd:AuthorTeamParenthesis>Asch.</abcd:AuthorTeamParenthesis>
+                        </abcd:Botanical>
+                      </abcd:NameAtomised>
+                    </abcd:ScientificName>
+                  </abcd:TaxonIdentified>
+                </abcd:Result>
+              </abcd:Identification>
+            </abcd:Identifications>
+            <abcd:Gathering>
+              <abcd:DateTime>
+                <abcd:DateText>1950-1980</abcd:DateText>
+                <abcd:PeriodExplicit>false</abcd:PeriodExplicit>
+              </abcd:DateTime>
+              <abcd:Agents>
+                <abcd:GatheringAgentsText>Mitarbeiter der Floristischen Kartierung Deutschlands</abcd:GatheringAgentsText>
+              </abcd:Agents>
+              <abcd:LocalityText>MTB 6132: Buttenheim</abcd:LocalityText>
+              <abcd:Country>
+                <abcd:Name language="German">Deutschland</abcd:Name>
+              </abcd:Country>
+              <abcd:SiteCoordinateSets>
+                <abcd:SiteCoordinates>
+                  <abcd:CoordinatesGrid>
+                    <abcd:GridCellSystem>German TK25</abcd:GridCellSystem>
+                    <abcd:GridCellCode>6132</abcd:GridCellCode>
+                  </abcd:CoordinatesGrid>
+                  <abcd:CoordinatesLatLong>
+                    <abcd:LongitudeDecimal>11.08</abcd:LongitudeDecimal>
+                    <abcd:LatitudeDecimal>49.86</abcd:LatitudeDecimal>
+                    <abcd:AccuracyStatement>Mittelpunkte von TK25-Rasterfeldern</abcd:AccuracyStatement>
+                    <abcd:CoordinateErrorDistanceInMeters>6515</abcd:CoordinateErrorDistanceInMeters>
+                  </abcd:CoordinatesLatLong>
+                </abcd:SiteCoordinates>
+              </abcd:SiteCoordinateSets>
+            </abcd:Gathering>
+          </abcd:Unit>
+          <abcd:Unit>
+            <abcd:SourceInstitutionID>BfN</abcd:SourceInstitutionID>
+            <abcd:SourceID>FlorKart_BfN</abcd:SourceID>
+            <abcd:UnitID>1003128</abcd:UnitID>
+            <abcd:UnitReferences>
+              <abcd:UnitReference>
+                <abcd:TitleCitation>Datenbank FLORKART, BfN und NetPhyD</abcd:TitleCitation>
+                <abcd:CitationDetail>Datenbank FLORKART der Floristischen Kartierung Deutschlands, Stand 2007, Bundesamt f&#xFC;r Naturschutz (BfN) und Netzwerk Phytodiversitaet Deutschland (NetPhyD)</abcd:CitationDetail>
+              </abcd:UnitReference>
+            </abcd:UnitReferences>
+            <abcd:Identifications>
+              <abcd:Identification>
+                <abcd:Result>
+                  <abcd:TaxonIdentified>
+                    <abcd:HigherTaxa>
+                      <abcd:HigherTaxon>
+                        <abcd:HigherTaxonName>Asteraceae</abcd:HigherTaxonName>
+                      </abcd:HigherTaxon>
+                    </abcd:HigherTaxa>
+                    <abcd:ScientificName>
+                      <abcd:FullScientificNameString>Cichorium calvum Asch.</abcd:FullScientificNameString>
+                      <abcd:NameAtomised>
+                        <abcd:Botanical>
+                          <abcd:GenusOrMonomial>Cichorium</abcd:GenusOrMonomial>
+                          <abcd:FirstEpithet>calvum</abcd:FirstEpithet>
+                          <abcd:Rank>SPE</abcd:Rank>
+                          <abcd:AuthorTeamParenthesis>Asch.</abcd:AuthorTeamParenthesis>
+                        </abcd:Botanical>
+                      </abcd:NameAtomised>
+                    </abcd:ScientificName>
+                  </abcd:TaxonIdentified>
+                </abcd:Result>
+              </abcd:Identification>
+            </abcd:Identifications>
+            <abcd:Gathering>
+              <abcd:DateTime>
+                <abcd:DateText>1950-1980</abcd:DateText>
+                <abcd:PeriodExplicit>false</abcd:PeriodExplicit>
+              </abcd:DateTime>
+              <abcd:Agents>
+                <abcd:GatheringAgentsText>Mitarbeiter der Floristischen Kartierung Deutschlands</abcd:GatheringAgentsText>
+              </abcd:Agents>
+              <abcd:LocalityText>MTB 6232: Forchheim</abcd:LocalityText>
+              <abcd:Country>
+                <abcd:Name language="German">Deutschland</abcd:Name>
+              </abcd:Country>
+              <abcd:SiteCoordinateSets>
+                <abcd:SiteCoordinates>
+                  <abcd:CoordinatesGrid>
+                    <abcd:GridCellSystem>German TK25</abcd:GridCellSystem>
+                    <abcd:GridCellCode>6232</abcd:GridCellCode>
+                  </abcd:CoordinatesGrid>
+                  <abcd:CoordinatesLatLong>
+                    <abcd:LongitudeDecimal>11.08</abcd:LongitudeDecimal>
+                    <abcd:LatitudeDecimal>49.76</abcd:LatitudeDecimal>
+                    <abcd:AccuracyStatement>Mittelpunkte von TK25-Rasterfeldern</abcd:AccuracyStatement>
+                    <abcd:CoordinateErrorDistanceInMeters>6522</abcd:CoordinateErrorDistanceInMeters>
+                  </abcd:CoordinatesLatLong>
+                </abcd:SiteCoordinates>
+              </abcd:SiteCoordinateSets>
+            </abcd:Gathering>
+          </abcd:Unit>
+          <abcd:Unit>
+            <abcd:SourceInstitutionID>BfN</abcd:SourceInstitutionID>
+            <abcd:SourceID>FlorKart_BfN</abcd:SourceID>
+            <abcd:UnitID>1003129</abcd:UnitID>
+            <abcd:UnitReferences>
+              <abcd:UnitReference>
+                <abcd:TitleCitation>Datenbank FLORKART, BfN und NetPhyD</abcd:TitleCitation>
+                <abcd:CitationDetail>Datenbank FLORKART der Floristischen Kartierung Deutschlands, Stand 2007, Bundesamt f&#xFC;r Naturschutz (BfN) und Netzwerk Phytodiversitaet Deutschland (NetPhyD)</abcd:CitationDetail>
+              </abcd:UnitReference>
+            </abcd:UnitReferences>
+            <abcd:Identifications>
+              <abcd:Identification>
+                <abcd:Result>
+                  <abcd:TaxonIdentified>
+                    <abcd:HigherTaxa>
+                      <abcd:HigherTaxon>
+                        <abcd:HigherTaxonName>Asteraceae</abcd:HigherTaxonName>
+                      </abcd:HigherTaxon>
+                    </abcd:HigherTaxa>
+                    <abcd:ScientificName>
+                      <abcd:FullScientificNameString>Cichorium calvum Asch.</abcd:FullScientificNameString>
+                      <abcd:NameAtomised>
+                        <abcd:Botanical>
+                          <abcd:GenusOrMonomial>Cichorium</abcd:GenusOrMonomial>
+                          <abcd:FirstEpithet>calvum</abcd:FirstEpithet>
+                          <abcd:Rank>SPE</abcd:Rank>
+                          <abcd:AuthorTeamParenthesis>Asch.</abcd:AuthorTeamParenthesis>
+                        </abcd:Botanical>
+                      </abcd:NameAtomised>
+                    </abcd:ScientificName>
+                  </abcd:TaxonIdentified>
+                </abcd:Result>
+              </abcd:Identification>
+            </abcd:Identifications>
+            <abcd:Gathering>
+              <abcd:DateTime>
+                <abcd:DateText>1950-1980</abcd:DateText>
+                <abcd:PeriodExplicit>false</abcd:PeriodExplicit>
+              </abcd:DateTime>
+              <abcd:Agents>
+                <abcd:GatheringAgentsText>Mitarbeiter der Floristischen Kartierung Deutschlands</abcd:GatheringAgentsText>
+              </abcd:Agents>
+              <abcd:LocalityText>MTB 6235: Pegnitz</abcd:LocalityText>
+              <abcd:Country>
+                <abcd:Name language="German">Deutschland</abcd:Name>
+              </abcd:Country>
+              <abcd:SiteCoordinateSets>
+                <abcd:SiteCoordinates>
+                  <abcd:CoordinatesGrid>
+                    <abcd:GridCellSystem>German TK25</abcd:GridCellSystem>
+                    <abcd:GridCellCode>6235</abcd:GridCellCode>
+                  </abcd:CoordinatesGrid>
+                  <abcd:CoordinatesLatLong>
+                    <abcd:LongitudeDecimal>11.58</abcd:LongitudeDecimal>
+                    <abcd:LatitudeDecimal>49.76</abcd:LatitudeDecimal>
+                    <abcd:AccuracyStatement>Mittelpunkte von TK25-Rasterfeldern</abcd:AccuracyStatement>
+                    <abcd:CoordinateErrorDistanceInMeters>6523</abcd:CoordinateErrorDistanceInMeters>
+                  </abcd:CoordinatesLatLong>
+                </abcd:SiteCoordinates>
+              </abcd:SiteCoordinateSets>
+            </abcd:Gathering>
+          </abcd:Unit>
+          <abcd:Unit>
+            <abcd:SourceInstitutionID>BfN</abcd:SourceInstitutionID>
+            <abcd:SourceID>FlorKart_BfN</abcd:SourceID>
+            <abcd:UnitID>1003130</abcd:UnitID>
+            <abcd:UnitReferences>
+              <abcd:UnitReference>
+                <abcd:TitleCitation>Datenbank FLORKART, BfN und NetPhyD</abcd:TitleCitation>
+                <abcd:CitationDetail>Datenbank FLORKART der Floristischen Kartierung Deutschlands, Stand 2007, Bundesamt f&#xFC;r Naturschutz (BfN) und Netzwerk Phytodiversitaet Deutschland (NetPhyD)</abcd:CitationDetail>
+              </abcd:UnitReference>
+            </abcd:UnitReferences>
+            <abcd:Identifications>
+              <abcd:Identification>
+                <abcd:Result>
+                  <abcd:TaxonIdentified>
+                    <abcd:HigherTaxa>
+                      <abcd:HigherTaxon>
+                        <abcd:HigherTaxonName>Asteraceae</abcd:HigherTaxonName>
+                      </abcd:HigherTaxon>
+                    </abcd:HigherTaxa>
+                    <abcd:ScientificName>
+                      <abcd:FullScientificNameString>Cichorium calvum Asch.</abcd:FullScientificNameString>
+                      <abcd:NameAtomised>
+                        <abcd:Botanical>
+                          <abcd:GenusOrMonomial>Cichorium</abcd:GenusOrMonomial>
+                          <abcd:FirstEpithet>calvum</abcd:FirstEpithet>
+                          <abcd:Rank>SPE</abcd:Rank>
+                          <abcd:AuthorTeamParenthesis>Asch.</abcd:AuthorTeamParenthesis>
+                        </abcd:Botanical>
+                      </abcd:NameAtomised>
+                    </abcd:ScientificName>
+                  </abcd:TaxonIdentified>
+                </abcd:Result>
+              </abcd:Identification>
+            </abcd:Identifications>
+            <abcd:Gathering>
+              <abcd:DateTime>
+                <abcd:DateText>1950-1980</abcd:DateText>
+                <abcd:PeriodExplicit>false</abcd:PeriodExplicit>
+              </abcd:DateTime>
+              <abcd:Agents>
+                <abcd:GatheringAgentsText>Mitarbeiter der Floristischen Kartierung Deutschlands</abcd:GatheringAgentsText>
+              </abcd:Agents>
+              <abcd:LocalityText>MTB 7032: Bieswang</abcd:LocalityText>
+              <abcd:Country>
+                <abcd:Name language="German">Deutschland</abcd:Name>
+              </abcd:Country>
+              <abcd:SiteCoordinateSets>
+                <abcd:SiteCoordinates>
+                  <abcd:CoordinatesGrid>
+                    <abcd:GridCellSystem>German TK25</abcd:GridCellSystem>
+                    <abcd:GridCellCode>7032</abcd:GridCellCode>
+                  </abcd:CoordinatesGrid>
+                  <abcd:CoordinatesLatLong>
+                    <abcd:LongitudeDecimal>11.08</abcd:LongitudeDecimal>
+                    <abcd:LatitudeDecimal>48.96</abcd:LatitudeDecimal>
+                    <abcd:AccuracyStatement>Mittelpunkte von TK25-Rasterfeldern</abcd:AccuracyStatement>
+                    <abcd:CoordinateErrorDistanceInMeters>6575</abcd:CoordinateErrorDistanceInMeters>
+                  </abcd:CoordinatesLatLong>
+                </abcd:SiteCoordinates>
+              </abcd:SiteCoordinateSets>
+            </abcd:Gathering>
+          </abcd:Unit>
+        </abcd:Units>
+      </abcd:DataSet>
+    </abcd:DataSets>
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/imports/NormalExplicitImport.xls b/eu.etaxonomy.taxeditor.test/src/test/resources/imports/NormalExplicitImport.xls
new file mode 100644 (file)
index 0000000..1c69278
Binary files /dev/null and b/eu.etaxonomy.taxeditor.test/src/test/resources/imports/NormalExplicitImport.xls differ
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/imports/SDD.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/imports/SDD.xml
new file mode 100644 (file)
index 0000000..4154c28
--- /dev/null
@@ -0,0 +1,981 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Datasets xmlns="http://rs.tdwg.org/UBIF/2006/"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://rs.tdwg.org/UBIF/2006/ http://rs.tdwg.org/UBIF/2006/Schema/1.1/SDD.xsd">
+    <TechnicalMetadata created="1970-01-01T09:34:00">
+        <Generator name="Xper2"
+            notes="This software is developed and distributed by LIS - Laboratoire Informatique et SystÈmatique (LIS) - UniversitÈ Pierre et Marie Curie - Paris VI - Copyright (c) 2004-2009" version="1.1"/>
+    </TechnicalMetadata>
+    <Dataset xml:lang="fr">
+        <Representation>
+            <Label>ant base</Label>
+        </Representation>
+        <RevisionData>
+            <Creators>
+                <Agent ref="a0" role="aut"/>
+            </Creators>
+            <DateCreated>2012-06-06T09:34:58</DateCreated>
+            <DateModified>2012-06-06T09:34:58</DateModified>
+        </RevisionData>
+        <TaxonNames>
+            <TaxonName id="t1">
+                <Representation>
+                    <Label>Dolichoderinae</Label>
+                </Representation>
+            </TaxonName>
+            <TaxonName id="t2">
+                <Representation>
+                    <Label>Formicinae</Label>
+                </Representation>
+            </TaxonName>
+            <TaxonName id="t3">
+                <Representation>
+                    <Label>Ponerinae</Label>
+                </Representation>
+            </TaxonName>
+            <TaxonName id="t4">
+                <Representation>
+                    <Label>Myrmicinae</Label>
+                </Representation>
+            </TaxonName>
+            <TaxonName id="t5">
+                <Representation>
+                    <Label>Pseudomyrmecinae</Label>
+                </Representation>
+            </TaxonName>
+            <TaxonName id="t6">
+                <Representation>
+                    <Label>Ecitoninae</Label>
+                </Representation>
+            </TaxonName>
+            <TaxonName id="t7">
+                <Representation>
+                    <Label>Ectatomminae</Label>
+                </Representation>
+            </TaxonName>
+            <TaxonName id="t8">
+                <Representation>
+                    <Label>Cerapachyinae</Label>
+                </Representation>
+            </TaxonName>
+            <TaxonName id="t9">
+                <Representation>
+                    <Label>Genus Ectatom</Label>
+                </Representation>
+            </TaxonName>
+        </TaxonNames>
+        <TaxonHierarchies>
+            <TaxonHierarchy id="th1">
+                <Representation>
+                    <Label>Default Entity Tree</Label>
+                </Representation>
+                <TaxonHierarchyType>UnspecifiedTaxonomy</TaxonHierarchyType>
+                <Nodes>
+                    <Node id="tn1">
+                        <TaxonName ref="t1"/>
+                    </Node>
+                    <Node id="tn2">
+                        <TaxonName ref="t2"/>
+                    </Node>
+                    <Node id="tn3">
+                        <Parent ref="tn2"/>
+                        <TaxonName ref="t3"/>
+                    </Node>
+                    <Node id="tn4">
+                        <TaxonName ref="t4"/>
+                    </Node>
+                    <Node id="tn5">
+                        <Parent ref="tn4"/>
+                        <TaxonName ref="t5"/>
+                    </Node>
+                    <Node id="tn6">
+                        <TaxonName ref="t6"/>
+                    </Node>
+                    <Node id="tn7">
+                        <Parent ref="tn6"/>
+                        <TaxonName ref="t8"/>
+                    </Node>
+                </Nodes>
+            </TaxonHierarchy>
+        </TaxonHierarchies>
+        <Characters>
+            <CategoricalCharacter id="c1">
+                <Representation>
+                    <Label>Pétiole</Label>
+                    <Detail>Le &lt;b&gt;pétiole&lt;/b&gt; se situe entre le mésosoma et l'alitrunk.</Detail>
+                    <MediaObject ref="m35"/>
+                    <MediaObject ref="m36"/>
+                </Representation>
+                <States>
+                    <StateDefinition id="s1">
+                        <Representation>
+                            <Label>un seul article réduit ou isolé</Label>
+                            <MediaObject ref="m37"/>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s2">
+                        <Representation>
+                            <Label>deux articles réduits ou isolés</Label>
+                            <Detail>Les deux articles correspondent au&lt;b&gt;pétiole&lt;/b&gt; et au &lt;b&gt;post-pétiole&lt;/b&gt;.&lt;br&gt;Soit les deux segments sont plus ou moins réduits, soit le deuxième article est plus large que le premier, soit le postpétiole est largement plus réduit.</Detail>
+                            <MediaObject ref="m38"/>
+                        </Representation>
+                    </StateDefinition>
+                </States>
+            </CategoricalCharacter>
+            <CategoricalCharacter id="c2">
+                <Representation>
+                    <Label>Aiguillon venimeux</Label>
+                    <Detail>Quand il est vestigial et non fonctionnel, on le considère comme absent.</Detail>
+                    <MediaObject ref="m39"/>
+                    <MediaObject ref="m40"/>
+                </Representation>
+                <States>
+                    <StateDefinition id="s3">
+                        <Representation>
+                            <Label>absent</Label>
+                            <Detail>Apex du gastre &lt;b&gt;sans aiguillon&lt;/b&gt;.</Detail>
+                            <MediaObject ref="m41"/>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s4">
+                        <Representation>
+                            <Label>présent</Label>
+                            <Detail>C'est l'&lt;b&gt;apex du gastre&lt;/b&gt; qui porte l'aiguillon.&lt;br&gt;Il est considéré comme présent uniquement s'il &lt;b&gt;est fonctionnel&lt;/b&gt;. Certains aiguillons sont dévaginables, d'autres sont visibles de façon permanente.</Detail>
+                            <MediaObject ref="m42"/>
+                            <MediaObject ref="m43"/>
+                        </Representation>
+                    </StateDefinition>
+                </States>
+            </CategoricalCharacter>
+            <CategoricalCharacter id="c3">
+                <Representation>
+                    <Label>Acidopore</Label>
+                    <Detail>L'&lt;b&gt;acidopore&lt;/b&gt; est l'ouverture Ã  la base du gastre par laquelle le venin est Ã©jecté ou vaporisé</Detail>
+                    <MediaObject ref="m44"/>
+                    <MediaObject ref="m45"/>
+                </Representation>
+                <States>
+                    <StateDefinition id="s5">
+                        <Representation>
+                            <Label>circulaire et entouré de soies</Label>
+                            <Detail>Quand cette structure est présente, le venin est projeté sous forme de spray. L'&lt;b&gt;acidopore circulaire&lt;/b&gt; est parfois visible Ã  l'oeil nu chez les fourmis de grande taille.</Detail>
+                            <MediaObject ref="m46"/>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s6">
+                        <Representation>
+                            <Label>sous forme de fente</Label>
+                            <Detail>Contrairement Ã  l'acidopore circulaire, la &lt;b&gt;fente&lt;/b&gt; est rarement visible Ã  l'oeil nu.</Detail>
+                            <MediaObject ref="m47"/>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s7">
+                        <Representation>
+                            <Label>absent ou quasi invisible</Label>
+                        </Representation>
+                    </StateDefinition>
+                </States>
+            </CategoricalCharacter>
+            <CategoricalCharacter id="c4">
+                <Representation>
+                    <Label>Pygidium</Label>
+                    <Detail>Le &lt;b&gt;pygidium&lt;/b&gt; correspond au tergite Ã  l'apex du gastre.</Detail>
+                    <MediaObject ref="m48"/>
+                    <MediaObject ref="m49"/>
+                </Representation>
+                <States>
+                    <StateDefinition id="s8">
+                        <Representation>
+                            <Label>non armé</Label>
+                            <Detail>&lt;b&gt;Pygidium lisse non armé&lt;/b&gt; latéralement ou postérieurement.</Detail>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s9">
+                        <Representation>
+                            <Label>armé</Label>
+                            <Detail>&lt;b&gt;Pygidium armé &lt;/b&gt; latéralement, postérieurement ou les deux par une rangée de courtes Ã©pines ou dents.</Detail>
+                            <MediaObject ref="m50"/>
+                        </Representation>
+                    </StateDefinition>
+                </States>
+            </CategoricalCharacter>
+            <CategoricalCharacter id="c5">
+                <Representation>
+                    <Label>Marge clypéale</Label>
+                    <MediaObject ref="m51"/>
+                    <MediaObject ref="m52"/>
+                </Representation>
+                <States>
+                    <StateDefinition id="s10">
+                        <Representation>
+                            <Label>sans projection</Label>
+                            <Detail>Il s'agit de la &lt;b&gt;marge clypéale antérolatérale&lt;/b&gt;.</Detail>
+                            <MediaObject ref="m53"/>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s11">
+                        <Representation>
+                            <Label>avec projection</Label>
+                            <MediaObject ref="m54"/>
+                        </Representation>
+                    </StateDefinition>
+                </States>
+            </CategoricalCharacter>
+            <CategoricalCharacter id="c6">
+                <Representation>
+                    <Label>Yeux</Label>
+                    <Detail>Les &lt;b&gt;yeux&lt;/b&gt; des insectes sont des yeux composés d'&lt;b&gt;ommatidies&lt;/b&gt;. Attention Ã  ne pas les confondre avec les &lt;b&gt;ocelles&lt;/b&gt;, yeux simples souvent situés sur le dessu-de la tête, servant Ã  détecter les variations de luminosité.</Detail>
+                    <MediaObject ref="m55"/>
+                    <MediaObject ref="m56"/>
+                </Representation>
+                <States>
+                    <StateDefinition id="s12">
+                        <Representation>
+                            <Label>absents ou très réduits</Label>
+                            <Detail>Yeux absents ou très réduits c'est Ã  dire représentés seulement par une seule ou un petit nombre d'ommatidies.</Detail>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s13">
+                        <Representation>
+                            <Label>présents et bien visibles</Label>
+                            <Detail>Yeux présent et bien visibles composés d'un grand nombre d'ommatidies.</Detail>
+                            <MediaObject ref="m57"/>
+                        </Representation>
+                    </StateDefinition>
+                </States>
+            </CategoricalCharacter>
+            <CategoricalCharacter id="c7">
+                <Representation>
+                    <Label>Antennes</Label>
+                    <MediaObject ref="m58"/>
+                    <MediaObject ref="m59"/>
+                </Representation>
+                <States>
+                    <StateDefinition id="s14">
+                        <Representation>
+                            <Label>de 8 Ã  10 segments</Label>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s15">
+                        <Representation>
+                            <Label>de 12 segments</Label>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s16">
+                        <Representation>
+                            <Label>moins de 8 segments</Label>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s17">
+                        <Representation>
+                            <Label>10 ou 11 segments</Label>
+                        </Representation>
+                    </StateDefinition>
+                </States>
+            </CategoricalCharacter>
+            <CategoricalCharacter id="c8">
+                <Representation>
+                    <Label>Répartition mondiale</Label>
+                </Representation>
+                <States>
+                    <StateDefinition id="s18">
+                        <Representation>
+                            <Label>monde entier</Label>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s19">
+                        <Representation>
+                            <Label>régions tempérées</Label>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s20">
+                        <Representation>
+                            <Label>tropiques</Label>
+                            <Detail>Il s'agit des tropiques (voire subtropiques) du monden entier.</Detail>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s21">
+                        <Representation>
+                            <Label>néotropiques</Label>
+                            <Detail>Il s'agit des zones tropicales américaines.</Detail>
+                        </Representation>
+                    </StateDefinition>
+                </States>
+            </CategoricalCharacter>
+            <CategoricalCharacter id="c9">
+                <Representation>
+                    <Label>Lobes frontaux</Label>
+                    <MediaObject ref="m60"/>
+                    <MediaObject ref="m61"/>
+                </Representation>
+                <States>
+                    <StateDefinition id="s22">
+                        <Representation>
+                            <Label>absents ou très réduits et verticaux</Label>
+                            <MediaObject ref="m62"/>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s23">
+                        <Representation>
+                            <Label>présents et horizontaux</Label>
+                            <MediaObject ref="m63"/>
+                        </Representation>
+                    </StateDefinition>
+                </States>
+            </CategoricalCharacter>
+            <CategoricalCharacter id="c10">
+                <Representation>
+                    <Label>Bases antennaires</Label>
+                    <MediaObject ref="m64"/>
+                    <MediaObject ref="m65"/>
+                </Representation>
+                <States>
+                    <StateDefinition id="s24">
+                        <Representation>
+                            <Label>partiellement ou complètement camouflées</Label>
+                            <Detail>En vue de face, les &lt;b&gt;bases antennaires&lt;/b&gt; sont partiellement ou complètement recouvertes par les &lt;b&gt; lobes frontaux&lt;/b&gt; (jamais complètement exposées).</Detail>
+                            <MediaObject ref="m66"/>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s25">
+                        <Representation>
+                            <Label>totalement exposées</Label>
+                            <Detail>En vue de face, les &lt;b&gt;bases antennaires&lt;/b&gt; sont complètement exposées et non recouvertes par les lobes frontaux.</Detail>
+                            <MediaObject ref="m67"/>
+                        </Representation>
+                    </StateDefinition>
+                </States>
+            </CategoricalCharacter>
+            <CategoricalCharacter id="c11">
+                <Representation>
+                    <Label>Suture promésonotale</Label>
+                    <Detail>La &lt;b&gt;suture promésonotale&lt;/b&gt; est la suture (ligne de ligne de fusion) entre le pronotum et le mesonotum, les deux premiers articles du thorax.</Detail>
+                    <MediaObject ref="m68"/>
+                    <MediaObject ref="m69"/>
+                    <MediaObject ref="m70"/>
+                    <MediaObject ref="m71"/>
+                </Representation>
+                <States>
+                    <StateDefinition id="s26">
+                        <Representation>
+                            <Label>absente</Label>
+                            <MediaObject ref="m72"/>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s27">
+                        <Representation>
+                            <Label>vestigiale</Label>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s28">
+                        <Representation>
+                            <Label>présente</Label>
+                            <MediaObject ref="m73"/>
+                        </Representation>
+                    </StateDefinition>
+                </States>
+            </CategoricalCharacter>
+            <CategoricalCharacter id="c12">
+                <Representation>
+                    <Label>Ocelle(s)</Label>
+                    <Detail>Les &lt;b&gt;ocelles&lt;/b&gt; sont des yeux simples servant Ã  détecter les variations de luminosité. Les ouvrières peuvent avoir un ou plusieurs ocelles.</Detail>
+                    <MediaObject ref="m74"/>
+                    <MediaObject ref="m75"/>
+                </Representation>
+                <States>
+                    <StateDefinition id="s29">
+                        <Representation>
+                            <Label>absent(s)</Label>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s30">
+                        <Representation>
+                            <Label>présent(s)</Label>
+                        </Representation>
+                    </StateDefinition>
+                </States>
+            </CategoricalCharacter>
+            <CategoricalCharacter id="c13">
+                <Representation>
+                    <Label>Palpes maxillaires</Label>
+                    <MediaObject ref="m76"/>
+                </Representation>
+                <States>
+                    <StateDefinition id="s31">
+                        <Representation>
+                            <Label>présents et bien visibles</Label>
+                        </Representation>
+                    </StateDefinition>
+                    <StateDefinition id="s32">
+                        <Representation>
+                            <Label>absents ou très difficilement visibles</Label>
+                        </Representation>
+                    </StateDefinition>
+                </States>
+            </CategoricalCharacter>
+        </Characters>
+        <CharacterTrees>
+            <CharacterTree id="ct1">
+                <Representation>
+                    <Label>Ordre et dÈpendance entre caractËres</Label>
+                </Representation>
+                <ShouldContainAllCharacters>true</ShouldContainAllCharacters>
+                <Nodes>
+                    <CharNode>
+                        <Character ref="c1"/>
+                    </CharNode>
+                    <CharNode>
+                        <Character ref="c2"/>
+                    </CharNode>
+                    <CharNode>
+                        <DependencyRules>
+                            <InapplicableIf>
+                                <State ref="s2"/>
+                            </InapplicableIf>
+                        </DependencyRules>
+                        <Character ref="c3"/>
+                    </CharNode>
+                    <CharNode>
+                        <Character ref="c4"/>
+                    </CharNode>
+                    <CharNode>
+                        <DependencyRules>
+                            <InapplicableIf>
+                                <State ref="s3"/>
+                            </InapplicableIf>
+                        </DependencyRules>
+                        <Character ref="c5"/>
+                    </CharNode>
+                    <CharNode>
+                        <Character ref="c6"/>
+                    </CharNode>
+                    <CharNode>
+                        <Character ref="c7"/>
+                    </CharNode>
+                    <CharNode>
+                        <Character ref="c8"/>
+                    </CharNode>
+                    <CharNode>
+                        <Character ref="c9"/>
+                    </CharNode>
+                    <CharNode>
+                        <Character ref="c10"/>
+                    </CharNode>
+                    <CharNode>
+                        <Character ref="c11"/>
+                    </CharNode>
+                    <CharNode>
+                        <Character ref="c12"/>
+                    </CharNode>
+                    <CharNode>
+                        <Character ref="c13"/>
+                    </CharNode>
+                </Nodes>
+            </CharacterTree>
+        </CharacterTrees>
+        <CodedDescriptions>
+            <CodedDescription id="D1">
+                <Representation>
+                    <Label>Dolichoderinae</Label>
+                    <MediaObject ref="m1"/>
+                    <MediaObject ref="m2"/>
+                    <MediaObject ref="m3"/>
+                </Representation>
+                <Scope>
+                    <TaxonName ref="t1"/>
+                </Scope>
+                <SummaryData>
+                    <Categorical ref="c1">
+                        <State ref="s1"/>
+                    </Categorical>
+                    <Categorical ref="c2">
+                        <Note>Leur aiguillon venimeux est vestigial et non fonctionnel.</Note>
+                        <State ref="s3"/>
+                    </Categorical>
+                    <Categorical ref="c3">
+                        <State ref="s6"/>
+                    </Categorical>
+                    <Categorical ref="c4">
+                        <State ref="s8"/>
+                    </Categorical>
+                    <Categorical ref="c5"/>
+                    <Categorical ref="c6">
+                        <State ref="s13"/>
+                    </Categorical>
+                    <Categorical ref="c7">
+                        <Note>Les ouvrières possèdent généralement 11 articles antennaires, rarement 10 ou 11.</Note>
+                        <State ref="s14"/>
+                        <State ref="s15"/>
+                    </Categorical>
+                    <Categorical ref="c8">
+                        <State ref="s18"/>
+                    </Categorical>
+                    <Categorical ref="c9">
+                        <Status code="DataUnavailable"/>
+                    </Categorical>
+                    <Categorical ref="c10">
+                        <Note>Elles sont partiellement ou totalement cachées par la carèbe frontale, marge du lbe frontal.</Note>
+                        <State ref="s24"/>
+                    </Categorical>
+                    <Categorical ref="c11">
+                        <Note>Elle est présente et flexible.</Note>
+                        <State ref="s28"/>
+                    </Categorical>
+                    <Categorical ref="c12">
+                        <Note>Les ocelles sont pratiquement tout le temps absents.</Note>
+                        <State ref="s29"/>
+                    </Categorical>
+                    <Categorical ref="c13">
+                        <State ref="s31"/>
+                    </Categorical>
+                </SummaryData>
+            </CodedDescription>
+            <CodedDescription id="D2">
+                <Representation>
+                    <Label>Formicinae</Label>
+                    <MediaObject ref="m4"/>
+                    <MediaObject ref="m5"/>
+                    <MediaObject ref="m6"/>
+                    <MediaObject ref="m7"/>
+                    <MediaObject ref="m8"/>
+                </Representation>
+                <Scope>
+                    <TaxonName ref="t2"/>
+                </Scope>
+                <SummaryData>
+                    <Categorical ref="c1">
+                        <State ref="s1"/>
+                    </Categorical>
+                    <Categorical ref="c2">
+                        <Note>Leur aiguillon est non fonctionnel.</Note>
+                        <State ref="s3"/>
+                    </Categorical>
+                    <Categorical ref="c3">
+                        <State ref="s5"/>
+                    </Categorical>
+                    <Categorical ref="c4">
+                        <State ref="s8"/>
+                    </Categorical>
+                    <Categorical ref="c5"/>
+                    <Categorical ref="c6">
+                        <Note>Leurs yeux sont généralement bien développés, rarement réduits ou absents.</Note>
+                        <State ref="s12"/>
+                        <State ref="s13"/>
+                    </Categorical>
+                    <Categorical ref="c7">
+                        <State ref="s14"/>
+                        <State ref="s15"/>
+                        <State ref="s17"/>
+                    </Categorical>
+                    <Categorical ref="c8">
+                        <State ref="s18"/>
+                    </Categorical>
+                    <Categorical ref="c9">
+                        <Status code="DataUnavailable"/>
+                    </Categorical>
+                    <Categorical ref="c10">
+                        <State ref="s25"/>
+                    </Categorical>
+                    <Categorical ref="c11">
+                        <State ref="s28"/>
+                    </Categorical>
+                    <Categorical ref="c12">
+                        <Note>Les ocelles sont présents dans la grande majorité des genres.</Note>
+                        <State ref="s30"/>
+                    </Categorical>
+                    <Categorical ref="c13">
+                        <State ref="s31"/>
+                        <State ref="s32"/>
+                    </Categorical>
+                </SummaryData>
+            </CodedDescription>
+            <CodedDescription id="D3">
+                <Representation>
+                    <Label>Ponerinae</Label>
+                    <MediaObject ref="m9"/>
+                    <MediaObject ref="m10"/>
+                    <MediaObject ref="m11"/>
+                    <MediaObject ref="m12"/>
+                    <MediaObject ref="m13"/>
+                </Representation>
+                <Scope>
+                    <TaxonName ref="t3"/>
+                </Scope>
+                <SummaryData>
+                    <Categorical ref="c1">
+                        <State ref="s1"/>
+                    </Categorical>
+                    <Categorical ref="c2">
+                        <State ref="s4"/>
+                    </Categorical>
+                    <Categorical ref="c3">
+                        <State ref="s7"/>
+                    </Categorical>
+                    <Categorical ref="c4">
+                        <State ref="s8"/>
+                    </Categorical>
+                    <Categorical ref="c5">
+                        <State ref="s10"/>
+                    </Categorical>
+                    <Categorical ref="c6">
+                        <Note>Les Ponerinae possèdent des yeux bien développés dans la grande majorité des cas.</Note>
+                        <State ref="s13"/>
+                    </Categorical>
+                    <Categorical ref="c7">
+                        <Status code="DataUnavailable"/>
+                    </Categorical>
+                    <Categorical ref="c8">
+                        <State ref="s19"/>
+                        <State ref="s20"/>
+                    </Categorical>
+                    <Categorical ref="c9">
+                        <State ref="s23"/>
+                    </Categorical>
+                    <Categorical ref="c10">
+                        <State ref="s24"/>
+                    </Categorical>
+                    <Categorical ref="c11">
+                        <Note>Si les yeux et les lobes frontaux sont absents, la suture promésonotale est toujours absente.</Note>
+                        <State ref="s26"/>
+                        <State ref="s28"/>
+                    </Categorical>
+                    <Categorical ref="c12">
+                        <Note>En général les ouvrières de poneriane ne portent pas d'ocelles.</Note>
+                        <State ref="s29"/>
+                    </Categorical>
+                    <Categorical ref="c13">
+                        <State ref="s31"/>
+                        <State ref="s32"/>
+                    </Categorical>
+                </SummaryData>
+            </CodedDescription>
+            <CodedDescription id="D4">
+                <Representation>
+                    <Label>Myrmicinae</Label>
+                    <MediaObject ref="m14"/>
+                    <MediaObject ref="m15"/>
+                    <MediaObject ref="m16"/>
+                    <MediaObject ref="m17"/>
+                    <MediaObject ref="m18"/>
+                    <MediaObject ref="m19"/>
+                    <MediaObject ref="m20"/>
+                </Representation>
+                <Scope>
+                    <TaxonName ref="t4"/>
+                </Scope>
+                <SummaryData>
+                    <Categorical ref="c1">
+                        <State ref="s2"/>
+                    </Categorical>
+                    <Categorical ref="c2">
+                        <State ref="s4"/>
+                    </Categorical>
+                    <Categorical ref="c3"/>
+                    <Categorical ref="c4">
+                        <State ref="s8"/>
+                    </Categorical>
+                    <Categorical ref="c5">
+                        <State ref="s10"/>
+                    </Categorical>
+                    <Categorical ref="c6">
+                        <State ref="s13"/>
+                    </Categorical>
+                    <Categorical ref="c7">
+                        <Note>Le nombre d'articles antennaires peut varier de 4 Ã  12 chez les Myrmicinae.</Note>
+                        <State ref="s14"/>
+                        <State ref="s15"/>
+                        <State ref="s16"/>
+                    </Categorical>
+                    <Categorical ref="c8">
+                        <State ref="s18"/>
+                    </Categorical>
+                    <Categorical ref="c9">
+                        <State ref="s22"/>
+                        <State ref="s23"/>
+                    </Categorical>
+                    <Categorical ref="c10">
+                        <State ref="s24"/>
+                        <State ref="s25"/>
+                    </Categorical>
+                    <Categorical ref="c11">
+                        <Note>Elle est souvent complètement absente et rarement vestigiale. Quand c'est le cas, elle donne l'impression transversalement s'un arche en vue dorsale.</Note>
+                        <State ref="s26"/>
+                        <State ref="s27"/>
+                    </Categorical>
+                    <Categorical ref="c12">
+                        <Note>Les ocelles sont la plupart du temps absents, très rarement présents.</Note>
+                        <State ref="s29"/>
+                    </Categorical>
+                    <Categorical ref="c13">
+                        <State ref="s31"/>
+                        <State ref="s32"/>
+                    </Categorical>
+                </SummaryData>
+            </CodedDescription>
+            <CodedDescription id="D5">
+                <Representation>
+                    <Label>Pseudomyrmecinae</Label>
+                    <MediaObject ref="m21"/>
+                    <MediaObject ref="m22"/>
+                    <MediaObject ref="m23"/>
+                    <MediaObject ref="m24"/>
+                </Representation>
+                <Scope>
+                    <TaxonName ref="t5"/>
+                </Scope>
+                <SummaryData>
+                    <Categorical ref="c1">
+                        <State ref="s2"/>
+                    </Categorical>
+                    <Categorical ref="c2">
+                        <State ref="s4"/>
+                    </Categorical>
+                    <Categorical ref="c3"/>
+                    <Categorical ref="c4">
+                        <State ref="s8"/>
+                    </Categorical>
+                    <Categorical ref="c5">
+                        <Note>La projestion clypéale concernée est postérieure c'est Ã  dir vers les mandibules, et non vers le haut de la tête.</Note>
+                        <State ref="s10"/>
+                    </Categorical>
+                    <Categorical ref="c6">
+                        <State ref="s13"/>
+                    </Categorical>
+                    <Categorical ref="c7">
+                        <State ref="s15"/>
+                    </Categorical>
+                    <Categorical ref="c8">
+                        <State ref="s20"/>
+                    </Categorical>
+                    <Categorical ref="c9">
+                        <State ref="s22"/>
+                        <State ref="s23"/>
+                    </Categorical>
+                    <Categorical ref="c10">
+                        <State ref="s24"/>
+                    </Categorical>
+                    <Categorical ref="c11">
+                        <Note>Elle est très visible en vue dorsale.</Note>
+                        <State ref="s28"/>
+                    </Categorical>
+                    <Categorical ref="c12">
+                        <State ref="s30"/>
+                    </Categorical>
+                    <Categorical ref="c13">
+                        <State ref="s32"/>
+                    </Categorical>
+                </SummaryData>
+            </CodedDescription>
+            <CodedDescription id="D6">
+                <Representation>
+                    <Label>Ecitoninae</Label>
+                    <MediaObject ref="m25"/>
+                    <MediaObject ref="m26"/>
+                    <MediaObject ref="m27"/>
+                    <MediaObject ref="m28"/>
+                </Representation>
+                <Scope>
+                    <TaxonName ref="t6"/>
+                </Scope>
+                <SummaryData>
+                    <Categorical ref="c1">
+                        <State ref="s2"/>
+                    </Categorical>
+                    <Categorical ref="c2">
+                        <State ref="s4"/>
+                    </Categorical>
+                    <Categorical ref="c3"/>
+                    <Categorical ref="c4">
+                        <State ref="s8"/>
+                    </Categorical>
+                    <Categorical ref="c5">
+                        <State ref="s10"/>
+                    </Categorical>
+                    <Categorical ref="c6">
+                        <Note>Leurs yeux sont réduits Ã  une seule ommatidies ou absents.</Note>
+                        <State ref="s12"/>
+                    </Categorical>
+                    <Categorical ref="c7">
+                        <State ref="s15"/>
+                    </Categorical>
+                    <Categorical ref="c8">
+                        <State ref="s19"/>
+                        <State ref="s21"/>
+                    </Categorical>
+                    <Categorical ref="c9">
+                        <State ref="s22"/>
+                    </Categorical>
+                    <Categorical ref="c10">
+                        <State ref="s25"/>
+                    </Categorical>
+                    <Categorical ref="c11">
+                        <Note>Cette suture n'est jamais marqué et elle est flexible.</Note>
+                        <State ref="s26"/>
+                        <State ref="s27"/>
+                    </Categorical>
+                    <Categorical ref="c12">
+                        <State ref="s30"/>
+                    </Categorical>
+                    <Categorical ref="c13">
+                        <State ref="s32"/>
+                    </Categorical>
+                </SummaryData>
+            </CodedDescription>
+            <CodedDescription id="D7">
+                <Representation>
+                    <Label>Ectatomminae</Label>
+                    <MediaObject ref="m29"/>
+                    <MediaObject ref="m30"/>
+                </Representation>
+                <Scope>
+                    <TaxonName ref="t7"/>
+                </Scope>
+                <SummaryData>
+                    <Categorical ref="c1">
+                        <State ref="s1"/>
+                    </Categorical>
+                    <Categorical ref="c2">
+                        <State ref="s3"/>
+                    </Categorical>
+                    <Categorical ref="c3">
+                        <State ref="s7"/>
+                    </Categorical>
+                    <Categorical ref="c4">
+                        <State ref="s8"/>
+                    </Categorical>
+                    <Categorical ref="c5"/>
+                    <Categorical ref="c6">
+                        <State ref="s13"/>
+                    </Categorical>
+                    <Categorical ref="c7">
+                        <Status code="DataUnavailable"/>
+                    </Categorical>
+                    <Categorical ref="c8">
+                        <State ref="s18"/>
+                    </Categorical>
+                    <Categorical ref="c9">
+                        <State ref="s22"/>
+                    </Categorical>
+                    <Categorical ref="c10">
+                        <State ref="s24"/>
+                    </Categorical>
+                    <Categorical ref="c11">
+                        <Status code="DataUnavailable"/>
+                    </Categorical>
+                    <Categorical ref="c12">
+                        <State ref="s29"/>
+                    </Categorical>
+                    <Categorical ref="c13">
+                        <State ref="s32"/>
+                    </Categorical>
+                </SummaryData>
+            </CodedDescription>
+            <CodedDescription id="D8">
+                <Representation>
+                    <Label>Cerapachyinae</Label>
+                    <MediaObject ref="m31"/>
+                    <MediaObject ref="m32"/>
+                    <MediaObject ref="m33"/>
+                    <MediaObject ref="m34"/>
+                </Representation>
+                <Scope>
+                    <TaxonName ref="t8"/>
+                </Scope>
+                <SummaryData>
+                    <Categorical ref="c1">
+                        <State ref="s1"/>
+                    </Categorical>
+                    <Categorical ref="c2">
+                        <Note>Aiguillon bien dévellopé et fonctionnel.</Note>
+                        <State ref="s4"/>
+                    </Categorical>
+                    <Categorical ref="c3">
+                        <Status code="DataUnavailable"/>
+                    </Categorical>
+                    <Categorical ref="c4">
+                        <Note>Il existe un rangée apicale ou marginale de courtes dents ou Ã©pines.</Note>
+                        <State ref="s9"/>
+                    </Categorical>
+                    <Categorical ref="c5">
+                        <State ref="s11"/>
+                    </Categorical>
+                    <Categorical ref="c6">
+                        <Note>Les yeux sont généralement présents, très rarement réduits ou absents.</Note>
+                        <State ref="s12"/>
+                    </Categorical>
+                    <Categorical ref="c7">
+                        <State ref="s15"/>
+                        <State ref="s17"/>
+                    </Categorical>
+                    <Categorical ref="c8">
+                        <State ref="s20"/>
+                    </Categorical>
+                    <Categorical ref="c9">
+                        <Status code="DataUnavailable"/>
+                    </Categorical>
+                    <Categorical ref="c10">
+                        <State ref="s25"/>
+                    </Categorical>
+                    <Categorical ref="c11">
+                        <Note>La plupart du temps, elle est complètement absente. Elle n'est que très rarement visible.</Note>
+                        <State ref="s26"/>
+                        <State ref="s28"/>
+                    </Categorical>
+                    <Categorical ref="c12">
+                        <State ref="s30"/>
+                    </Categorical>
+                    <Categorical ref="c13">
+                        <Status code="DataUnavailable"/>
+                    </Categorical>
+                </SummaryData>
+            </CodedDescription>
+            <CodedDescription id="D9">
+                <Representation>
+                    <Label>Genus Ectatom</Label>
+                </Representation>
+                <Scope>
+                    <TaxonName ref="t9"/>
+                </Scope>
+                <SummaryData>
+                    <Categorical ref="c1"/>
+                    <Categorical ref="c2"/>
+                    <Categorical ref="c3"/>
+                    <Categorical ref="c4"/>
+                    <Categorical ref="c5"/>
+                    <Categorical ref="c6"/>
+                    <Categorical ref="c7"/>
+                    <Categorical ref="c8"/>
+                    <Categorical ref="c9"/>
+                    <Categorical ref="c10"/>
+                    <Categorical ref="c11"/>
+                    <Categorical ref="c12"/>
+                    <Categorical ref="c13"/>
+                </SummaryData>
+            </CodedDescription>
+        </CodedDescriptions>
+        <Agents>
+            <Agent id="a0">
+                <Representation>
+                    <Label>Unknown</Label>
+                </Representation>
+            </Agent>
+        </Agents>
+        <MediaObjects>
+            <MediaObject id="m1">
+                <Representation>
+                    <Label>Dolichoderinae - m1</Label>
+                    <Detail role="Caption">Dolichoderinae</Detail>
+                </Representation>
+                <Type>Image</Type>
+                <Source href="http://cybertaxonomy.eu/sites/wp5.e-taxonomy.eu/files/cybergate.PNG"/>
+            </MediaObject>
+            <MediaObject id="m2">
+                <Representation>
+                    <Label>Dolichoderinae - m2</Label>
+                    <Detail role="Caption">Dolichoderinae</Detail>
+                </Representation>
+                <Type>Image</Type>
+                <Source href="http://cybertaxonomy.eu/sites/wp5.e-taxonomy.eu/files/cybergate.PNG"/>
+            </MediaObject>
+        </MediaObjects>
+    </Dataset>
+</Datasets>
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/imports/SpecimenExcelImport.xls b/eu.etaxonomy.taxeditor.test/src/test/resources/imports/SpecimenExcelImport.xls
new file mode 100644 (file)
index 0000000..4b8db5b
Binary files /dev/null and b/eu.etaxonomy.taxeditor.test/src/test/resources/imports/SpecimenExcelImport.xls differ
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/imports/TcsImport.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/imports/TcsImport.xml
new file mode 100644 (file)
index 0000000..545f7c8
--- /dev/null
@@ -0,0 +1,382 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<DataSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.tdwg.org/schemas/tcs/1.01     http://tdwg.napier.ac.uk/TCS_1.01/v101.xsd" xmlns="http://www.tdwg.org/schemas/tcs/1.01">
+    <!-- This is an instance document that tests as many different
+    applications of the schema as possible within a single document.
+    It is not meant to a 'realistic' example of a real data set
+    but a illustration of all the different types of data that can 
+    be passed. -->
+    <MetaData>
+        <!-- to be completed -->
+        <Simple/>
+    </MetaData>
+    <Specimens>
+        <Specimen id="2">
+            <Simple/>
+            <Institution identifier=""/>
+            <Collection identifier="LE"/>
+            <SpecimenItem identifier=""/>
+        </Specimen>
+    </Specimens>
+    <Publications>
+        <Publication id="1">
+            <Simple>Fl. SSR</Simple>
+        </Publication>
+        <Publication id="2">
+            <Simple>Copeland, H.F. (1943). A study, anatomical and taxonomic, of the
+                genera of Rhododendroideae. Am. Midl.Nat. 30:533-625</Simple>
+        </Publication>
+        <Publication id="3">
+            <Simple>Wilson, E.H. &amp; Rehder, A. (1921). A monograph of the azaleas.
+                Publication of the Arnold Arboretum No. 9 Harvard University, Cambridge
+            MA.</Simple>
+        </Publication>
+        <Publication id="4">
+            <Simple>Judd, W.S. &amp; Kron, K.A. (1995) A Revision of Rhododendron VI
+                Edinb. J. Bot. 52(1): 1-54</Simple>
+        </Publication>
+        <Publication id="5">
+            <Simple>Maximoxicz, C.J. (1870) Rhododendron schlippenbachii. Mem. Acad. Sci.
+                St Petersbourg. ser.3 15.</Simple>
+        </Publication>
+    </Publications>
+    <TaxonNames>
+        <TaxonName id="0" nomenclaturalCode="Botanical">
+            <Simple>Rhododendron</Simple>
+        </TaxonName>
+        <TaxonName nomenclaturalCode="Botanical" id="1">
+            <Simple>Rhododendron subgenus Pentanthera (G. Don) Poyarkova</Simple>
+            <CanonicalName>
+                <Simple>Rhododedron subgenus Pentanthera</Simple>
+                <Genus>Rhododendron</Genus>
+                <InfragenericEpithet>Pentanthera</InfragenericEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>(G.Don) Poyarkova</Simple>
+                <BasionymAuthorship>
+                    <Simple>G. Don</Simple>
+                    <Authors>
+                        <AgentName>G. Don</AgentName>
+                    </Authors>
+                </BasionymAuthorship>
+                <CombinationAuthorship>
+                    <Simple>Poyarkova</Simple>
+                    <Authors>
+                        <AgentName>Poyarkova</AgentName>
+                    </Authors>
+                </CombinationAuthorship>
+            </CanonicalAuthorship>
+            <PublishedIn ref="1">Fl. SSR Vol 18 (1952)</PublishedIn>
+            <MicroReference>Page 57</MicroReference>
+            <Typification>
+                <Simple>Rhododendron flavum G.Don</Simple>
+                    <!--
+                        N.B. This could be linked to a full name entry if
+                        required but no details are in the current monograph so
+                        it isn't
+                    -->
+                <TypeName/>
+            </Typification>
+        </TaxonName>
+        <TaxonName id="2" nomenclaturalCode="Botanical">
+            <Simple>Rhododendron sect. Sciadorhodion Rehder &amp; Wilson</Simple>
+            <CanonicalName>
+                <Simple>Rhododendron sect. Sciadorhodion</Simple>
+                <Genus>Rhododendron</Genus>
+                <InfragenericEpithet>Sciadorhodion</InfragenericEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>Rehder &amp; Wilson</Simple>
+                <BasionymAuthorship>
+                    <Simple>Rehder &amp; Wilson</Simple>
+                </BasionymAuthorship>
+            </CanonicalAuthorship>
+            <PublishedIn linkType="local" ref="3">Wislon &amp; Rehder Monogr. Azaleas 79 (1921)</PublishedIn>
+            <MicroReference>Page 79</MicroReference>
+            <Typification>
+                <Simple/>
+                <TypeName>
+                    <NameReference linkType="local" ref="3">Rhododendron quinquefolium Bisset
+                        &amp; Moore</NameReference>
+                    <LectotypePublication ref="2">Copeland, H.F.(1943)</LectotypePublication>
+                </TypeName>
+            </Typification>
+            <Basionym>
+                <RelatedName ref="4">Azalea subgen. Sciadorhodion (Rhehder &amp; Wilson)
+                    Copeland</RelatedName>
+            </Basionym>
+        </TaxonName>
+        <TaxonName id="3" nomenclaturalCode="Botanical">
+            <Simple>Rhododendron quinquefolium Bisset &amp; Moore</Simple>
+        </TaxonName>
+        <TaxonName id="4" nomenclaturalCode="Botanical">
+            <!-- for brevity this NameObject isn't fully expanded -->
+            <Simple>Azalea subgen. Sciadorhodion (Rhehder &amp; Wilson) Copeland </Simple>
+            <Basionym>
+                <RelatedName ref="2">Rhododendron sect. Sciadorhodion Rehder &amp;
+                Wilson</RelatedName>
+            </Basionym>
+        </TaxonName>
+        <TaxonName id="5" nomenclaturalCode="Botanical">
+            <Simple>Rhododendron schlippenbachii Maxim.</Simple>
+            <Rank code="sp">Species</Rank>
+            <CanonicalName>
+                <Simple>Rhododendron schlippenbachii</Simple>
+                <Genus>Rhododendron</Genus>
+                <SpecificEpithet>schlippenbachii</SpecificEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>Maxim.</Simple>
+                <BasionymAuthorship>
+                    <Simple>Maxim.</Simple>
+                    <Authors>
+                        <AgentName>Maximoxicz, C.J.</AgentName>
+                    </Authors>
+                </BasionymAuthorship>
+            </CanonicalAuthorship>
+            <PublishedIn ref="5">Bull. Acad. Sci. St Petersbourg, ser. 3 15 (1870)</PublishedIn>
+            <MicroReference>Page 226</MicroReference>
+            <Typification>
+                <Simple/>
+                <TypeVouchers>
+                <TypeVoucher typeOfType="lecto">
+                    <VoucherReference linkType="local" ref="1"/>
+                    <LectotypePublication ref="4"/>
+                    <LectotypeMicroReference>Page 15</LectotypeMicroReference>
+                </TypeVoucher>
+                <TypeVoucher typeOfType="isolecto">
+                    <VoucherReference linkType="local" ref="2"/>
+                    <LectotypePublication ref="4"/>
+                    <LectotypeMicroReference>Page 15</LectotypeMicroReference>
+                </TypeVoucher>
+                </TypeVouchers>
+            </Typification>
+        </TaxonName>
+        <TaxonName id="6" nomenclaturalCode="Botanical">
+            <Simple>Azalea schlippenbachii (Maxim.) Kuntze</Simple>
+            <CanonicalName>
+                <Simple>Azalea schlippenbachii</Simple>
+                <Genus>Azalea</Genus>
+                <SpecificEpithet>schlippenbachii</SpecificEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>(Maxim.) Kuntze</Simple>
+                <BasionymAuthorship>
+                    <Simple>Maxim.</Simple>
+                </BasionymAuthorship>
+                <CombinationAuthorship>
+                    <Simple>Kuntze</Simple>
+                </CombinationAuthorship>
+            </CanonicalAuthorship>
+            <PublishedIn>Revis. Gen.Pl. 2:387 (1891)</PublishedIn>
+            <Typification>
+                <Simple/>
+                <TypeVouchers>
+                <TypeVoucher typeOfType="lecto">
+                    <VoucherReference ref="2">[Russia] Manchuria, shores of Possiet Bay, [SW of
+                        Vladivostok], 1860, C. Maximowicz LE</VoucherReference>
+                    <LectotypePublication ref="4"/>
+                    <LectotypeMicroReference>Page 15</LectotypeMicroReference>
+                </TypeVoucher>
+               </TypeVouchers>
+            </Typification>
+        </TaxonName>
+        <TaxonName id="7" nomenclaturalCode="Botanical">
+            <Simple>Rhododendron pentaphyllum Maxim.</Simple>
+            <CanonicalName>
+                <Simple>Rhododendron pentaphyllum</Simple>
+                <Genus>Rhododendron</Genus>
+                <SpecificEpithet>pentaphyllum</SpecificEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>Maxim.</Simple>
+            </CanonicalAuthorship>
+            <PublishedIn>Bull. Acad. Sci. St Petersbourg, ser. 3, 31:65 (1887)</PublishedIn>
+            <Typification>
+                <Simple/>
+                <TypeVouchers>
+                    <TypeVoucher typeOfType="holo">
+                        <VoucherReference>Japan, Kyushiu, prov. Osumi, summit, Mt Taka-kuma, Tashiro
+                            (LE)</VoucherReference>
+                    </TypeVoucher>
+                </TypeVouchers>
+           
+            </Typification>
+        </TaxonName>
+        <TaxonName id="8" nomenclaturalCode="Botanical">
+            <Simple>Azalea pentaphylla (Maxim.) Copeland</Simple>
+            <CanonicalName>
+                <Simple>Azalea pentaphylla</Simple>
+                <Genus>Azalea</Genus>
+                <SpecificEpithet>pentaphylla</SpecificEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>(Maxim.) Copeland</Simple>
+                <BasionymAuthorship>
+                    <Simple>Maxim.</Simple>
+                </BasionymAuthorship>
+                <CombinationAuthorship>
+                    <Simple>Copeland</Simple>
+                </CombinationAuthorship>
+            </CanonicalAuthorship>
+            <PublishedIn>Am.Midl.Nat. 30:595 (1943)</PublishedIn>
+            <Typification>
+                <Simple/>
+                <TypeVouchers>
+                    <TypeVoucher typeOfType="holo">
+                        <VoucherReference>Japan, Kyushiu, prov. Osumi, summit, Mt Taka-kuma, Tashiro
+                            (LE)</VoucherReference>
+                    </TypeVoucher>
+                </TypeVouchers>
+            </Typification>
+        </TaxonName>
+        <TaxonName id="9" nomenclaturalCode="Botanical">
+            <Simple>Rhododendron pentaphyllum var. nikoense Komatsu</Simple>
+            <Rank code="var">variety</Rank>
+            <CanonicalName>
+                <Simple>Rhododendron pentaphyllum var. nikoense</Simple>
+                <Genus ref="0">Rhododendron</Genus>
+                <SpecificEpithet>pentaphyllum</SpecificEpithet>
+                <InfraspecificEpithet>nikoense</InfraspecificEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>Konatsu</Simple>
+            </CanonicalAuthorship>
+            <PublishedIn>Icon. Pl. Koisikav. 3: 45, t 168 (1916)</PublishedIn>
+        </TaxonName>
+        <TaxonName id="10" nomenclaturalCode="Botanical">
+            <Simple>Rhododendron nikoense (Komatsu) Nakai</Simple>
+            <Rank code="sp">Species</Rank>
+            <CanonicalName>
+                <Simple>Rhododendron nikoense</Simple>
+                <Genus ref="0">Rhododendron</Genus>
+                <SpecificEpithet>nikoense</SpecificEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>(Komatsu) Nakai</Simple>
+                <BasionymAuthorship>
+                    <Simple>Komatsu</Simple>
+                </BasionymAuthorship>
+                <CombinationAuthorship>
+                    <Simple>Nakai</Simple>
+                </CombinationAuthorship>
+            </CanonicalAuthorship>
+            <PublishedIn>Nakai &amp; Koidz. Trees and Shrubs Japan 1: 68 (1922)</PublishedIn>
+            <Basionym>
+                <RelatedName ref="9">Rhododendron pentaphyllum var. nikoense</RelatedName>
+            </Basionym>
+        </TaxonName>
+        <TaxonName id="11" nomenclaturalCode="Botanical">
+            <Simple>Rhododendron quinquefolium Bisset &amp; S. Moore var. roseum Rehder</Simple>
+            <Rank code="var">variety</Rank>
+            <CanonicalName>
+                <Simple>Rhododendron quinquefolium</Simple>
+                <Genus ref="0">Rhododendron</Genus>
+                <SpecificEpithet>quinquefolium</SpecificEpithet>
+                <InfraspecificEpithet>roseum</InfraspecificEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>Rehder</Simple>
+            </CanonicalAuthorship>
+            <PublishedIn>Bailey, Stand. Cycl. Hort. 5: 2947 (1916)</PublishedIn>
+        </TaxonName>
+        <TaxonName id="12" nomenclaturalCode="Botanical">
+            <Simple>Rhododendron pentaphyllum Maxim. var. shikokianum T. Yamazaki</Simple>
+            <Rank code="sp">species</Rank>
+            <CanonicalName>
+                <Simple>Rhododendron pentaphyllum var. shikokianum</Simple>
+                <Genus ref="0">Rhododendron</Genus>
+                <SpecificEpithet>pentaphyllum</SpecificEpithet>
+                <InfraspecificEpithet>shikokianum</InfraspecificEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>T. Yamazaki</Simple>
+            </CanonicalAuthorship>
+            <PublishedIn>Jap. Bot. 63: 312 (1988)</PublishedIn>
+        </TaxonName>
+    </TaxonNames>
+    <TaxonConcepts>
+        <TaxonConcept id="1">
+            <Name scientific="true" linkType="local" ref="2">Rhododendron sect. Sciadorhodion Rehder
+                &amp; Wilson</Name>
+            <Rank code="sect">Section</Rank>
+            <AccordingTo>
+                <Simple>Judd &amp; Kron (1995)</Simple>
+                <AccordingToDetailed>
+                    <PublishedIn linkType="local" ref="4">Judd &amp; Kron (1995) A Revision of
+                        Rhododendron VI </PublishedIn>
+                    <MicroReference>Page 13-14</MicroReference>
+                </AccordingToDetailed>
+            </AccordingTo>
+            <TaxonRelationships>
+                <TaxonRelationship type="is parent taxon of">
+                    <ToTaxonConcept linkType="local" ref="2"/>
+                </TaxonRelationship>
+            </TaxonRelationships>
+        </TaxonConcept>
+        <TaxonConcept id="2">
+            <Name scientific="true" linkType="local" ref="5">Rhododendron schlippenbachii Maxim.</Name>
+            <AccordingTo>
+                <Simple>Judd &amp; Kron (1995)</Simple>
+                <AccordingToDetailed>
+                    <PublishedIn linkType="local" ref="4"/>
+                    <MicroReference>Page 15</MicroReference>
+                </AccordingToDetailed>
+            </AccordingTo>
+            <TaxonRelationships>
+                <TaxonRelationship type="is child taxon of">
+                    <ToTaxonConcept ref="1">Rhododendron sect. Sciadorhodion Rehder &amp;
+                    Wilson</ToTaxonConcept>
+                </TaxonRelationship>
+            </TaxonRelationships>
+        </TaxonConcept>
+        <TaxonConcept id="3">
+            <Name scientific="true" ref="6">Azalea schlippenbachii (Maxim.) Kuntze</Name>
+            <AccordingTo>
+                <Simple>Kuntze (1891)</Simple>
+            </AccordingTo>
+            <TaxonRelationships>
+                <TaxonRelationship type="is congruent to">
+                    <ToTaxonConcept ref="2"/>
+                </TaxonRelationship>
+            </TaxonRelationships>
+        </TaxonConcept>
+        <TaxonConcept id="4">
+            <Name scientific="true" ref="7">Rhododendron pentaphyllum Maxim.</Name>
+            <AccordingTo>
+                <Simple>Judd &amp; Kron (1995)</Simple>
+            </AccordingTo>
+            <TaxonRelationships>
+                <!-- relationships linking to taxonconcept without any descriptive string -->
+                <TaxonRelationship type="has synonym">
+                    <ToTaxonConcept ref="6"/>
+                </TaxonRelationship>
+                <TaxonRelationship type="has synonym">
+                    <ToTaxonConcept ref="7"/>
+                </TaxonRelationship>
+                <!-- relationship with linking reference to another taxon concept and string description of concept -->
+                <TaxonRelationship type="has synonym">
+                    <ToTaxonConcept ref="8">Rhododendron pentaphyllum var. nikoense
+                    Komatsu</ToTaxonConcept>
+                </TaxonRelationship>
+                <!-- relationships without linking -->
+                <TaxonRelationship type="has synonym">
+                    <ToTaxonConcept>Rhododendron pentaphyllum Maxim. var. shikokianum T.
+                    Yamazaki</ToTaxonConcept>
+                </TaxonRelationship>
+                <TaxonRelationship type="has synonym">
+                    <ToTaxonConcept>Rhododendron quinquefolium Bisset &amp; S. Moore var. roseum
+                        Rehder</ToTaxonConcept>
+                </TaxonRelationship>
+            </TaxonRelationships>
+        </TaxonConcept>
+        <TaxonConcept id="6">
+            <Name scientific="true">Rhododendron nikoense (Komatsu) Nakai</Name>
+        </TaxonConcept>
+        <TaxonConcept id="7">
+            <Name scientific="true" ref="10">Rhododendron nikoense (Komatsu) Nakai</Name>
+        </TaxonConcept>
+        <TaxonConcept id="8">
+            <Name scientific="true" ref="9">Rhododendron pentaphyllum var. nikoense Komatsu</Name>
+        </TaxonConcept>
+    </TaxonConcepts>
+</DataSet>
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/log4j.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/log4j.xml
new file mode 100644 (file)
index 0000000..11c15a6
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
+  debug="false">
+  <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+    <param name="Target" value="System.out" />
+    <layout class="org.apache.log4j.PatternLayout">
+      <param name="ConversionPattern" value="%d %p [%c] - %m%n" />
+    </layout>
+  </appender>
+  <root>
+    <priority value="WARN" />
+    <appender-ref ref="CONSOLE" />
+  </root>
+</log4j:configuration>
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/server.properties b/eu.etaxonomy.taxeditor.test/src/test/resources/server.properties
new file mode 100644 (file)
index 0000000..06d7199
--- /dev/null
@@ -0,0 +1,6 @@
+httpPort=9090
+stopPort=9191
+stopKey=jetty-cdm-server
+user=admin
+password=00000
+contextPath=
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/unitils.properties b/eu.etaxonomy.taxeditor.test/src/test/resources/unitils.properties
new file mode 100644 (file)
index 0000000..daea61b
--- /dev/null
@@ -0,0 +1,69 @@
+#
+# NOTE: this is the unitils.properties file for the cdmlib-persistence module
+# a separate unitils.properties exists for cdmlib-io and for cdmlib-services
+#
+#
+# the list of all properties is found in
+# http://unitils.org/unitils-default.properties
+#
+
+### Unitils Modules ###
+# List of modules that is loaded. Overloading this list is normally not useful, unless you want to add a custom
+# module. Disabling a module can be performed by setting unitils.module.<modulename>.enabled to false.
+# If a module's specific dependencies are not found (e.g. hibernate is not in you classpath), this module is not loaded,
+# even if it is in this list and the enabled property is set to true. It's therefore not strictly necessary to disable
+# any of these modules.
+#DEFAULT: unitils.modules=database,dbunit,hibernate,mock,easymock,inject,spring,jpa
+unitils.module.easymock.enabled=false
+unitils.module.mock.enabled=false
+
+
+### Database ###
+#
+# Name or path of the user specific properties file. This file should contain the necessary parameters to connect to the
+# developer's own unit test schema. It is recommended to override the name of this file in the project specific properties
+# file, to include the name of the project. The system will try to find this file in the classpath, the user home folder
+# (recommended) or the local filesystem.
+#
+unitils.configuration.localFileName=unitils-cdmlib-local.properties
+
+# H2 #
+#
+database.driverClassName=org.h2.Driver
+#database.url=jdbc:h2:file:./src/main/resources/h2/cdmTest;AUTO_SERVER=TRUE
+database.url=jdbc:h2:file:./target/classes/h2/cdmTest;AUTO_SERVER=TRUE
+database.dialect=h2
+database.userName=sa
+database.password=
+database.schemaNames=PUBLIC
+org.dbunit.dataset.datatype.IDataTypeFactory.implClassName.h2=org.dbunit.ext.h2.H2DataTypeFactory
+org.unitils.core.dbsupport.DbSupport.implClassName.h2=eu.etaxonomy.taxeditor.util.H2DbSupport
+database.storedIndentifierCase.h2=auto
+database.identifierQuoteString.h2=auto
+
+
+#### Transaction mode ###
+#
+# If set to commit or rollback, each test is run in a transaction,
+# which is committed or rolled back after the test is finished.
+# Since we have many tests with incomplete data these tests would be
+# failing during commit so it is better use rollback as default
+# and set commit for individual test where necessary
+DatabaseModule.Transactional.value.default=rollback
+
+# org.unitils.database.transaction.impl.DefaultUnitilsTransactionManager is used by default:
+#
+#   Implements transactions for unit tests, by delegating to a spring PlatformTransactionManager.
+#   The concrete implementation of PlatformTransactionManager that is used depends on the test class.
+#   If a custom PlatformTransactionManager was configured in a spring ApplicationContext, this one is used.
+#   If not, a suitable subclass of PlatformTransactionManager is created, depending on the configuration
+#   of a test. E.g. if some ORM persistence unit was configured on the test, a PlatformTransactionManager
+#   that can offer transactional behavior for such a persistence unit is used.
+#   If no such configuration is found, a DataSourceTransactionManager is used.
+#
+# org.unitils.database.transaction.UnitilsTransactionManager.implClassName=org.unitils.database.transaction.impl.SpringTransactionManager
+
+### Hibernate ###
+#
+HibernateModule.configuration.implClassName=org.hibernate.cfg.Configuration
+
diff --git a/eu.etaxonomy.taxeditor.webapp/.classpath b/eu.etaxonomy.taxeditor.webapp/.classpath
new file mode 100644 (file)
index 0000000..d162d85
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry exported="true" kind="lib" path="lib/c3p0-0.9.5.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/mysql-connector-java-5.1.24.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/javax.servlet-api-3.1.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jetty-all-9.2.9.v20150224.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/log4j-1.2.17.jar"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry kind="src" path="src/main/java"/>
+       <classpathentry kind="src" path="src/main/resources"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/eu.etaxonomy.taxeditor.webapp/.gitignore b/eu.etaxonomy.taxeditor.webapp/.gitignore
new file mode 100644 (file)
index 0000000..09e3bc9
--- /dev/null
@@ -0,0 +1,2 @@
+/bin/
+/target/
diff --git a/eu.etaxonomy.taxeditor.webapp/.project b/eu.etaxonomy.taxeditor.webapp/.project
new file mode 100644 (file)
index 0000000..4dba6d3
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>eu.etaxonomy.taxeditor.webapp</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/eu.etaxonomy.taxeditor.webapp/.settings/org.eclipse.jdt.core.prefs b/eu.etaxonomy.taxeditor.webapp/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..d17b672
--- /dev/null
@@ -0,0 +1,12 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/eu.etaxonomy.taxeditor.webapp/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.webapp/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..82c965c
--- /dev/null
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Webapp
+Bundle-SymbolicName: eu.etaxonomy.taxeditor.webapp;singleton:=true
+Bundle-Version: 4.0.0.qualifier
+Require-Bundle: org.eclipse.core.runtime
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-ActivationPolicy: lazy
+Export-Package: eu.etaxonomy.taxeditor.webapp
+Bundle-ClassPath: .,
+ lib/log4j-1.2.17.jar,
+ lib/jetty-all-9.2.9.v20150224.jar,
+ lib/javax.servlet-api-3.1.0.jar,
+ lib/mysql-connector-java-5.1.24.jar,
+ lib/c3p0-0.9.5.2.jar
+Bundle-Vendor: EDIT
+Import-Package: org.eclipse.jface.resource,
+ org.eclipse.ui.plugin
+Bundle-Activator: eu.etaxonomy.taxeditor.webapp.TaxeditorWebappPlugin
diff --git a/eu.etaxonomy.taxeditor.webapp/build.properties b/eu.etaxonomy.taxeditor.webapp/build.properties
new file mode 100644 (file)
index 0000000..ca2dc6a
--- /dev/null
@@ -0,0 +1,10 @@
+source.. = src/main/java/,\           
+           src/main/resources/           
+bin.includes = META-INF/,\
+               .,\
+               lib/log4j-1.2.17.jar,\
+               lib/jetty-all-9.2.9.v20150224.jar,\
+               lib/javax.servlet-api-3.1.0.jar,\
+               lib/mysql-connector-java-5.1.24.jar,\
+               lib/cdmlib-remote-webapp.war,\
+               lib/c3p0-0.9.5.2.jar
diff --git a/eu.etaxonomy.taxeditor.webapp/lib/c3p0-0.9.5.2.jar b/eu.etaxonomy.taxeditor.webapp/lib/c3p0-0.9.5.2.jar
new file mode 100644 (file)
index 0000000..579cedd
Binary files /dev/null and b/eu.etaxonomy.taxeditor.webapp/lib/c3p0-0.9.5.2.jar differ
diff --git a/eu.etaxonomy.taxeditor.webapp/lib/javax.servlet-api-3.1.0.jar b/eu.etaxonomy.taxeditor.webapp/lib/javax.servlet-api-3.1.0.jar
new file mode 100644 (file)
index 0000000..6b14c3d
Binary files /dev/null and b/eu.etaxonomy.taxeditor.webapp/lib/javax.servlet-api-3.1.0.jar differ
diff --git a/eu.etaxonomy.taxeditor.webapp/lib/jetty-all-9.2.9.v20150224.jar b/eu.etaxonomy.taxeditor.webapp/lib/jetty-all-9.2.9.v20150224.jar
new file mode 100644 (file)
index 0000000..2926f45
Binary files /dev/null and b/eu.etaxonomy.taxeditor.webapp/lib/jetty-all-9.2.9.v20150224.jar differ
diff --git a/eu.etaxonomy.taxeditor.webapp/lib/log4j-1.2.17.jar b/eu.etaxonomy.taxeditor.webapp/lib/log4j-1.2.17.jar
new file mode 100644 (file)
index 0000000..1d425cf
Binary files /dev/null and b/eu.etaxonomy.taxeditor.webapp/lib/log4j-1.2.17.jar differ
diff --git a/eu.etaxonomy.taxeditor.webapp/pom.xml b/eu.etaxonomy.taxeditor.webapp/pom.xml
new file mode 100644 (file)
index 0000000..677c316
--- /dev/null
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>eu.etaxonomy</groupId>
+    <artifactId>taxeditor-parent</artifactId>
+    <version>4.0.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>eu.etaxonomy.taxeditor.webapp</artifactId>
+  <packaging>eclipse-plugin</packaging>
+  <name>CDM Library Webapp Plugin</name>
+  <description>CDM Library webapp as a plugin</description>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <version>2.7</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>2.4</version>
+        <executions>
+          <execution>
+            <id>copy-dependency-war</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>copy-dependencies</goal>
+            </goals>
+            <configuration>
+              <includeArtifactIds>
+                cdmlib-remote-webapp
+              </includeArtifactIds>
+              <outputDirectory>
+                ${basedir}/lib
+              </outputDirectory>
+              <overWriteReleases>true</overWriteReleases>
+              <overWriteSnapshots>true</overWriteSnapshots>
+              <excludeTransitive>true</excludeTransitive>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.7</version>
+        <executions>
+          <execution>
+            <id>update-snapshot-jar-names</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <target>
+                <echo>Anonymizing war</echo>
+                <move todir="./lib">
+                  <fileset dir="./lib" />
+                  <mapper type="regexp"
+                    from="(^cdmlib\-remote\-webapp).*(\.war)" to="\1\2" />
+                </move>
+              </target>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <repositories>
+    <repository>
+      <id>SpringSource Enterprise Bundle Repository - External Bundle
+        Milestones
+      </id>
+      <url>http://repository.springsource.com/maven/bundles/milestone
+      </url>
+    </repository>
+    <repository>
+      <id>SpringSource Enterprise Bundle Repository - SpringSource
+        Bundle
+        Releases
+      </id>
+      <url>http://repository.springsource.com/maven/bundles/release
+      </url>
+    </repository>
+    <repository>
+      <id>SpringSource Enterprise Bundle Repository - External Bundle
+        Releases
+      </id>
+      <url>http://repository.springsource.com/maven/bundles/external
+      </url>
+    </repository>
+  </repositories>
+  <dependencies>
+    <dependency>
+      <groupId>eu.etaxonomy</groupId>
+      <artifactId>cdmlib-remote-webapp</artifactId>
+      <version>${cdmlib.version}</version>
+      <type>war</type>
+    </dependency>
+  </dependencies>
+</project>
+
diff --git a/eu.etaxonomy.taxeditor.webapp/src/main/java/eu/etaxonomy/taxeditor/webapp/CDMEmbeddedServerException.java b/eu.etaxonomy.taxeditor.webapp/src/main/java/eu/etaxonomy/taxeditor/webapp/CDMEmbeddedServerException.java
new file mode 100644 (file)
index 0000000..456e073
--- /dev/null
@@ -0,0 +1,31 @@
+// $Id$
+/**
+* Copyright (C) 2014 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.webapp;
+
+/**
+ * @author cmathew
+ * @date 23 Sep 2014
+ *
+ */
+public class CDMEmbeddedServerException extends Exception {
+
+    public CDMEmbeddedServerException(String message) {
+        super(message);
+    }
+
+    public CDMEmbeddedServerException(Exception e) {
+        super(e);
+    }
+
+    public CDMEmbeddedServerException(String message,Exception e) {
+        super(message,e);
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.webapp/src/main/java/eu/etaxonomy/taxeditor/webapp/CDMServer.java b/eu.etaxonomy.taxeditor.webapp/src/main/java/eu/etaxonomy/taxeditor/webapp/CDMServer.java
new file mode 100644 (file)
index 0000000..98e68a5
--- /dev/null
@@ -0,0 +1,241 @@
+// $Id$
+/**
+ * Copyright (C) 2014 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.webapp;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanException;
+import javax.management.MBeanServerConnection;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.management.ReflectionException;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.util.StringUtil;
+import org.eclipse.jetty.util.preventers.AppContextLeakPreventer;
+import org.eclipse.jetty.webapp.WebAppContext;
+import org.osgi.framework.Bundle;
+
+/**
+ *
+ * (Singleton) Server instance which manages a compatible cdmlib-webapp-war.
+ * This is done by launching a jetty instance (using jetty-runner) as an
+ * executed process. The choice of the external process over a more
+ * preferable 'embedded jetty' instance is due to problems arising from the
+ * class loading of classes (e.g. from hibernate core) which are needed
+ * for both the webapp as well as the remoting client.
+ *
+ * @author cmathew
+ * @date 23 Sep 2014
+ *
+ */
+
+public class CDMServer {
+
+    public static final Logger logger = Logger.getLogger(CDMServer.class);
+
+
+    private final String dataSourceName;
+    private final String host = "127.0.0.1";
+    private int httpPort = 9090;
+    private final String contextPath = "/";
+
+    private File warFile;
+    private Server server;
+
+
+    public CDMServer(String dataSourceName, File dataSourcesFile) throws CDMEmbeddedServerException {
+        if(StringUtil.isBlank(dataSourceName)) {
+            throw new CDMEmbeddedServerException("DataSource name is not valid");
+        }
+
+        if(dataSourcesFile == null || !dataSourcesFile.exists()) {
+            throw new CDMEmbeddedServerException("DataSource config file does not exist");
+        }
+        this.dataSourceName = dataSourceName;
+        Bundle bundle = Platform.getBundle("eu.etaxonomy.taxeditor.webapp");
+        URL warURL = bundle.getEntry("lib/cdmlib-remote-webapp.war");
+
+        try {
+            URL resolvedWarURL = FileLocator.toFileURL(warURL);
+            // We need to use the 3-arg constructor of URI in order to properly escape file system chars
+            URI resolvedURI = new URI(resolvedWarURL.getProtocol(), resolvedWarURL.getPath(), null);
+            warFile = new File(resolvedURI);
+            System.out.println("war url : " + warFile.getAbsolutePath());
+
+            if(warFile == null || !warFile.exists()) {
+                throw new CDMEmbeddedServerException("Cdmlib War file does not exist");
+            }
+        } catch (URISyntaxException use) {
+            throw new CDMEmbeddedServerException(use);
+        } catch (IOException ioe) {
+            throw new CDMEmbeddedServerException(ioe);
+        }
+
+        System.setProperty("spring.profiles.active", "remoting");
+        System.setProperty("cdm.beanDefinitionFile", dataSourcesFile.getAbsolutePath());
+        System.setProperty("cdm.datasource", dataSourceName);
+
+        httpPort = findFreePort();
+
+        logger.warn("Starting server on port : " + httpPort);
+
+        server = new Server(httpPort);
+
+        server.addBean(new AppContextLeakPreventer());
+
+        WebAppContext webapp = new WebAppContext();
+        webapp.setContextPath(contextPath);
+        webapp.setWar(warFile.getAbsolutePath());
+
+        server.setHandler(webapp);
+    }
+
+    public String getDataSourceName() {
+        return dataSourceName;
+    }
+    public String getHost() {
+        return host;
+    }
+
+    public int getPort() {
+        return httpPort;
+    }
+
+    public String getContextPath() {
+        return contextPath;
+    }
+
+    private static int findFreePort() throws CDMEmbeddedServerException {
+        ServerSocket socket = null;
+        try {
+            socket = new ServerSocket(0);
+            socket.setReuseAddress(true);
+            int port = socket.getLocalPort();
+            try {
+                socket.close();
+            } catch (IOException e) {
+
+            }
+            return port;
+        } catch (IOException e) {
+        } finally {
+            if (socket != null) {
+                try {
+                    socket.close();
+                } catch (IOException e) {
+                }
+            }
+        }
+        throw new CDMEmbeddedServerException("Could not find a free TCP/IP port to start embedded Jetty HTTP Server on");
+    }
+
+    public void start(ICDMServerError cdmServerError) throws CDMEmbeddedServerException {
+        start(true, cdmServerError);
+    }
+
+    public void start(boolean wait, final ICDMServerError cdmServerError) throws CDMEmbeddedServerException {
+
+        if(server == null) {
+            throw new CDMEmbeddedServerException("Server is already disposed");
+        }
+
+        if(server.isStarting()) {
+            throw new CDMEmbeddedServerException("Server is starting");
+        }
+
+        if(server.isStarted()) {
+            throw new CDMEmbeddedServerException("Server has started");
+        }
+
+        if(server.isRunning()) {
+            throw new CDMEmbeddedServerException("Server is running");
+        }
+
+        if(server.isStopping()) {
+            throw new CDMEmbeddedServerException("Server is currently stopping. Please re-try in about 10 seconds");
+        }
+
+        Thread serverThread = new Thread() {
+
+            @Override
+            public void run() {
+                try {
+                    server.start();
+                    server.join();
+                } catch (Throwable t) {
+                    cdmServerError.handleError(t);
+                }
+            }
+        };
+
+        serverThread.start();
+
+        if(wait) {
+            while(!server.isStarted()) {}
+
+        }
+    }
+
+    public boolean isAlive()  {
+        return server.isRunning() || server.isStarting() || server.isStarted();
+    }
+
+    public boolean isStarted() {
+        return server.isStarted();
+    }
+
+    public void stop() throws Exception {
+        server.stop();
+        server.destroy();
+        server = null;
+    }
+
+
+
+
+    public static void stopServerViaJMX(int jmxPort) throws CDMEmbeddedServerException  {
+        String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:" + jmxPort + "/jmxrmi";
+        logger.warn("Shutting down Jetty instance ... ");
+
+        try {
+            JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), null);
+            connector.connect(null);
+            MBeanServerConnection connection = connector.getMBeanServerConnection();
+            ObjectName objectName = new ObjectName("org.eclipse.jetty.server:type=server,id=0");
+            connection.invoke(objectName, "stop", null, null);
+            logger.warn("Shutdown command sent");
+        } catch (InstanceNotFoundException e) {
+            throw new CDMEmbeddedServerException(e);
+        } catch (MBeanException e) {
+            throw new CDMEmbeddedServerException(e);
+        } catch (ReflectionException e) {
+            throw new CDMEmbeddedServerException(e);
+        } catch (IOException e) {
+            throw new CDMEmbeddedServerException(e);
+        } catch (MalformedObjectNameException e) {
+            throw new CDMEmbeddedServerException(e);
+        }
+    }
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.webapp/src/main/java/eu/etaxonomy/taxeditor/webapp/ICDMServerError.java b/eu.etaxonomy.taxeditor.webapp/src/main/java/eu/etaxonomy/taxeditor/webapp/ICDMServerError.java
new file mode 100644 (file)
index 0000000..88cc1a4
--- /dev/null
@@ -0,0 +1,21 @@
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.webapp;
+
+/**
+ * @author cmathew
+ * @date 16 Nov 2015
+ *
+ */
+public interface ICDMServerError {
+
+    public void handleError(Throwable t);
+
+}
diff --git a/eu.etaxonomy.taxeditor.webapp/src/main/java/eu/etaxonomy/taxeditor/webapp/TaxeditorWebappPlugin.java b/eu.etaxonomy.taxeditor.webapp/src/main/java/eu/etaxonomy/taxeditor/webapp/TaxeditorWebappPlugin.java
new file mode 100644 (file)
index 0000000..83c0949
--- /dev/null
@@ -0,0 +1,81 @@
+package eu.etaxonomy.taxeditor.webapp;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ *
+ * @author n.hoffmann
+ * @version $Id: $
+ */
+public class TaxeditorWebappPlugin extends AbstractUIPlugin {
+
+       // The plug-in ID
+       /** Constant <code>PLUGIN_ID="eu.etaxonomy.taxeditor.editor"</code> */
+       public static final String PLUGIN_ID = "eu.etaxonomy.taxeditor.editor";
+
+       // The shared instance
+       private static TaxeditorWebappPlugin plugin;
+
+       /**
+        * The constructor
+        */
+       public TaxeditorWebappPlugin() {
+       }
+
+       /*
+        * (non-Javadoc)
+        * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+        */
+       /** {@inheritDoc} */
+       @Override
+    public void start(BundleContext context) throws Exception {
+               super.start(context);
+               plugin = this;
+       }
+
+       /*
+        * (non-Javadoc)
+        * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+        */
+       /** {@inheritDoc} */
+       @Override
+    public void stop(BundleContext context) throws Exception {
+               plugin = null;
+               super.stop(context);
+       }
+
+       /**
+        * Returns the shared instance
+        *
+        * @return the shared instance
+        */
+       public static TaxeditorWebappPlugin getDefault() {
+               return plugin;
+       }
+
+       /**
+        * Returns an image descriptor for the image file at the given
+        * plug-in relative path
+        *
+        * @param path the path
+        * @return the image descriptor
+        */
+       public static ImageDescriptor getImageDescriptor(String path) {
+               return imageDescriptorFromPlugin(PLUGIN_ID, path);
+       }
+
+
+       /**
+        * Exposes this normally protected method.
+        *
+        * @return a {@link org.eclipse.jface.resource.ImageRegistry} object.
+        */
+       @Override
+    public ImageRegistry createImageRegistry(){
+               return super.createImageRegistry();
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.webapp/src/main/resources/etc/jetty/.svnignore b/eu.etaxonomy.taxeditor.webapp/src/main/resources/etc/jetty/.svnignore
new file mode 100644 (file)
index 0000000..a09ae97
--- /dev/null
@@ -0,0 +1 @@
+cdmlib-remote-webapp.war
diff --git a/eu.etaxonomy.taxeditor.webapp/src/main/resources/etc/jetty/jetty-runner-9.2.3.v20140905.jar b/eu.etaxonomy.taxeditor.webapp/src/main/resources/etc/jetty/jetty-runner-9.2.3.v20140905.jar
new file mode 100644 (file)
index 0000000..91c88d6
Binary files /dev/null and b/eu.etaxonomy.taxeditor.webapp/src/main/resources/etc/jetty/jetty-runner-9.2.3.v20140905.jar differ
diff --git a/eu.etaxonomy.taxeditor.webapp/src/main/resources/etc/jetty/start-9.2.3.v20140905.jar b/eu.etaxonomy.taxeditor.webapp/src/main/resources/etc/jetty/start-9.2.3.v20140905.jar
new file mode 100644 (file)
index 0000000..ef2faaf
Binary files /dev/null and b/eu.etaxonomy.taxeditor.webapp/src/main/resources/etc/jetty/start-9.2.3.v20140905.jar differ
index 3446faf90f1926ee4bb2b230c4ec8ee62efaabbc..412e52cdec972aa242b13395e22eaf8a779f989b 100644 (file)
@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.application"/>\r
-       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.bulkeditor"/>\r
-       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.cdmlib"/>\r
-       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.editor"/>\r
-       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.navigation"/>\r
-       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.printpublisher"/>\r
-       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.store"/>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.application"/>
+       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.bulkeditor"/>
+       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.cdmlib"/>
+       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.editor"/>
+       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.navigation"/>
+       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.printpublisher"/>
+       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.store"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index ba79cb2965e11c063686d144465972190211b7a5..e8b1c02335a258c3da7f3b6226826374ff1da856 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<?pde version="3.5"?><product application="eu.etaxonomy.taxeditor.application.application" id="eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product" includeLaunchers="true" name="EDIT Taxonomic Editor" uid="eu.etaxonomy.taxeditor.product" useFeatures="true" version="3.8.0.qualifier">
+<?pde version="3.5"?><product application="eu.etaxonomy.taxeditor.application.application" id="eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product" includeLaunchers="true" name="EDIT Taxonomic Editor" uid="eu.etaxonomy.taxeditor.product" useFeatures="true" version="4.0.0.qualifier">
   <aboutInfo>
     <image path="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
     <text>
@@ -8,9 +8,12 @@
   </aboutInfo>
   <configIni use="default"></configIni>
   <launcherArgs>
-    <programArgs>-data @user.home/.cdmLibrary -Dserver_port=58080</programArgs>
-    <vmArgs>-Xmx512M -XX:MaxPermSize=256M -Dorg.eclipse.update.reconcile=false -Declipse.p2.unsignedPolicy=allow</vmArgs>
-    <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
+    <programArgs>-data @user.home/.cdmLibrary -Dserver_port=58080
+      </programArgs>
+    <vmArgs>-Xmx512M -XX:MaxPermSize=256M -Dorg.eclipse.update.reconcile=false -Declipse.p2.unsignedPolicy=allow
+      </vmArgs>
+    <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
+      </vmArgsMac>
   </launcherArgs>
   <windowImages i16="/eu.etaxonomy.taxeditor.application/icons/256color_16x16.gif" i32="/eu.etaxonomy.taxeditor.application/icons/256color_32x32.gif" i48="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
   <splash location="eu.etaxonomy.taxeditor.application" startupForegroundColor="000000" startupMessageRect="7,432,360,20" startupProgressRect="5,447,366,15"/>
index 7998db3a2427f9f5930a82bebae98cff91867f6d..6ab272ad2d75c10a1b34f937ac350b8cdc3fad68 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?pde version="3.5"?>
 
-<product name="EDIT Taxonomic Editor" uid="eu.etaxonomy.taxeditor.product.jre" id="eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product" application="eu.etaxonomy.taxeditor.application.application" version="3.8.0.qualifier" useFeatures="true" includeLaunchers="true">
+<product name="EDIT Taxonomic Editor" uid="eu.etaxonomy.taxeditor.product.jre" id="eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product" application="eu.etaxonomy.taxeditor.application.application" version="4.0.0.qualifier" useFeatures="true" includeLaunchers="true">
 
    <aboutInfo>
       <image path="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
index 09c338c76e97538ae64f8ecb946f9b16d03af2c7..b38dd652ba813426c25641f8993d7c01580230b9 100644 (file)
@@ -2,7 +2,7 @@
   <parent>
     <groupId>eu.etaxonomy</groupId>
     <artifactId>taxeditor-parent</artifactId>
-    <version>3.8.0-SNAPSHOT</version>
+    <version>4.0.0-SNAPSHOT</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
   <name>EDIT Taxonomic Editor Product</name>
   <description>The EDIT Taxonomic Desktop Editor</description>
   <url>http://wp5.e-taxonomy.eu/taxeditor</url>
-  <properties>    
+  <properties>
     <product.id>eu.etaxonomy.taxeditor.product</product.id>
   </properties>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.eclipse.tycho</groupId>
-        <artifactId>tycho-p2-director-plugin</artifactId>
-        <version>${tycho.version}</version>
-        <executions>
-          <execution>
-            <id>materialize-products</id>
-            <goals>
-              <goal>materialize-products</goal>
-            </goals>
-          </execution>
-          <execution>
-            <id>archive-products</id>
-            <goals>
-              <goal>archive-products</goal>
-            </goals>
-          </execution>
-        </executions>
-        <configuration>
-          <products>
-            <product>
-              <id>${product.id}</id>
-              <rootFolder>EDIT Taxonomic Editor</rootFolder>
-            </product>
-          </products>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
+
   <profiles>
+    <profile>
+      <id>buildProducts</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.eclipse.tycho</groupId>
+            <artifactId>tycho-p2-director-plugin</artifactId>
+            <version>${tycho.version}</version>
+            <executions>
+              <execution>
+                <id>materialize-products</id>
+                <goals>
+                  <goal>materialize-products</goal>
+                </goals>
+              </execution>
+              <execution>
+                <id>archive-products</id>
+                <goals>
+                  <goal>archive-products</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+              <products>
+                <product>
+                  <id>${product.id}</id>
+                  <rootFolder>EDIT Taxonomic Editor</rootFolder>
+                </product>
+              </products>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
     <profile>
       <id>signJars</id>
       <build>
diff --git a/pom.xml b/pom.xml
index 44ff82a0435db2349a683eb4e550959c0dfce9c0..2d28e140b85ba2bcd507d93cea2eb601314e04a4 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <prerequisites>
     <maven>3.0</maven>
   </prerequisites>
   <groupId>eu.etaxonomy</groupId>
   <artifactId>taxeditor-parent</artifactId>
-  <version>3.8.0-SNAPSHOT</version>
+  <version>4.0.0-SNAPSHOT</version>
   <name>EDIT Taxonomic Editor</name>
   <description>The Taxonomic Editor for EDIT's platform for
     cybertaxonomy
   <properties>
     <java.codelevel>1.6</java.codelevel>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <cdmlib.version>3.8.0-SNAPSHOT</cdmlib.version>
+    <cdmlib.version>4.0.0-SNAPSHOT</cdmlib.version>
     <!-- TODO can we use project.version ????? -->
     <tycho.version>0.22.0</tycho.version>
-    <taxeditor.version>3.8.0-SNAPSHOT</taxeditor.version>
+    <taxeditor.version>4.0.0-SNAPSHOT</taxeditor.version>
     <update.dir>snapshot</update.dir>
+    <unitils.version>3.4.2</unitils.version>
   </properties>
   <modules>
     <module>eu.etaxonomy.taxeditor.cdmlib</module>
     <module>eu.etaxonomy.taxeditor.help</module>
     <module>eu.etaxonomy.taxeditor.molecular</module>
     <module>eu.etaxonomy.taxeditor.molecular.lib</module>
+    <module>eu.etaxonomy.taxeditor.webapp</module>
     <module>eu.etaxonomy.taxeditor.application</module>
     <module>eu.etaxonomy.taxeditor.feature.platform</module>
     <module>eu.etaxonomy.taxeditor.feature</module>
+    <module>eu.etaxonomy.taxeditor.feature.jre.linux64</module>
     <module>eu.etaxonomy.taxeditor</module>
   </modules>
   <scm>