From: Andreas Kohlbecker Date: Mon, 10 Sep 2012 13:30:17 +0000 (+0000) Subject: merging in latest changes from trunk, up to r15854 (editor starts without issues) X-Git-Tag: 3.6.0~1022^2~14 X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/208a905011659fd9ae53edc24de1f75cb7b94001 merging in latest changes from trunk, up to r15854 (editor starts without issues) --- diff --git a/eu.etaxonomy.taxeditor.application/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.application/META-INF/MANIFEST.MF index 5ec49f46c..dbec5dc9d 100644 --- a/eu.etaxonomy.taxeditor.application/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.application/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Application Bundle-SymbolicName: eu.etaxonomy.taxeditor.application;singleton:=true -Bundle-Version: 3.0.12.qualifier +Bundle-Version: 3.0.13.qualifier Bundle-Activator: eu.etaxonomy.taxeditor.TaxonomicEditorPlugin Bundle-Vendor: EDIT Bundle-Localization: plugin diff --git a/eu.etaxonomy.taxeditor.application/pom.xml b/eu.etaxonomy.taxeditor.application/pom.xml index b70e907c2..9226f9008 100644 --- a/eu.etaxonomy.taxeditor.application/pom.xml +++ b/eu.etaxonomy.taxeditor.application/pom.xml @@ -4,7 +4,7 @@ eu.etaxonomy taxeditor-parent - 3.0.12-SNAPSHOT + 3.0.13-SNAPSHOT 4.0.0 diff --git a/eu.etaxonomy.taxeditor.bulkeditor/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.bulkeditor/META-INF/MANIFEST.MF index da5914383..3e0f83f77 100644 --- a/eu.etaxonomy.taxeditor.bulkeditor/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.bulkeditor/META-INF/MANIFEST.MF @@ -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.0.12.qualifier +Bundle-Version: 3.0.13.qualifier Bundle-Activator: eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin Bundle-Vendor: EDIT Export-Package: eu.etaxonomy.taxeditor.annotatedlineeditor,eu.etaxonomy.taxeditor.annotatedlineeditor.handler,eu.etaxonomy.taxeditor.bulkeditor,eu.etaxonomy.taxeditor.bulkeditor.command,eu.etaxonomy.taxeditor.bulkeditor.handler,eu.etaxonomy.taxeditor.bulkeditor.input,eu.etaxonomy.taxeditor.bulkeditor.internal,eu.etaxonomy.taxeditor.bulkeditor.referencingobjects diff --git a/eu.etaxonomy.taxeditor.bulkeditor/pom.xml b/eu.etaxonomy.taxeditor.bulkeditor/pom.xml index db7b958d0..331178b9a 100644 --- a/eu.etaxonomy.taxeditor.bulkeditor/pom.xml +++ b/eu.etaxonomy.taxeditor.bulkeditor/pom.xml @@ -4,7 +4,7 @@ eu.etaxonomy taxeditor-parent - 3.0.12-SNAPSHOT + 3.0.13-SNAPSHOT 4.0.0 diff --git a/eu.etaxonomy.taxeditor.cdmlib/.classpath b/eu.etaxonomy.taxeditor.cdmlib/.classpath index af0efc67d..02f3ef81e 100644 --- a/eu.etaxonomy.taxeditor.cdmlib/.classpath +++ b/eu.etaxonomy.taxeditor.cdmlib/.classpath @@ -108,13 +108,21 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF index 7ccdcee89..213d960c1 100644 --- a/eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: CDM Library Dependencies Plugin Bundle-SymbolicName: eu.etaxonomy.taxeditor.cdmlib;singleton:=true -Bundle-Version: 3.0.12.qualifier +Bundle-Version: 3.0.13.qualifier Eclipse-BundleShape: dir Export-Package: com.google.api, com.google.api.detect, @@ -878,11 +878,19 @@ Bundle-ClassPath: ., lib/xstream-1.3.1.jar, lib/hibernate-envers-3.4.0-SNAPSHOT.jar, lib/spring-xml-1.5.6.jar, - lib/cdmlib-commons-3.0.12-SNAPSHOT.jar, - lib/cdmlib-ext-3.0.12-SNAPSHOT.jar, - lib/cdmlib-io-3.0.12-SNAPSHOT.jar, - lib/cdmlib-model-3.0.12-SNAPSHOT.jar, - lib/cdmlib-persistence-3.0.12-SNAPSHOT.jar, - lib/cdmlib-print-3.0.12-SNAPSHOT.jar, - lib/cdmlib-remote-3.0.12-SNAPSHOT.jar, - lib/cdmlib-services-3.0.12-SNAPSHOT.jar + lib/cdmlib-commons-3.0.13-SNAPSHOT-sources.jar, + lib/cdmlib-commons-3.0.13-SNAPSHOT.jar, + lib/cdmlib-ext-3.0.13-SNAPSHOT-sources.jar, + lib/cdmlib-ext-3.0.13-SNAPSHOT.jar, + lib/cdmlib-io-3.0.13-SNAPSHOT-sources.jar, + lib/cdmlib-io-3.0.13-SNAPSHOT.jar, + lib/cdmlib-model-3.0.13-SNAPSHOT-sources.jar, + lib/cdmlib-model-3.0.13-SNAPSHOT.jar, + lib/cdmlib-persistence-3.0.13-SNAPSHOT-sources.jar, + lib/cdmlib-persistence-3.0.13-SNAPSHOT.jar, + lib/cdmlib-print-3.0.13-SNAPSHOT-sources.jar, + lib/cdmlib-print-3.0.13-SNAPSHOT.jar, + lib/cdmlib-remote-3.0.13-SNAPSHOT-sources.jar, + lib/cdmlib-remote-3.0.13-SNAPSHOT.jar, + lib/cdmlib-services-3.0.13-SNAPSHOT-sources.jar, + lib/cdmlib-services-3.0.13-SNAPSHOT.jar diff --git a/eu.etaxonomy.taxeditor.cdmlib/build.properties b/eu.etaxonomy.taxeditor.cdmlib/build.properties index 425f3b320..0338fa88c 100644 --- a/eu.etaxonomy.taxeditor.cdmlib/build.properties +++ b/eu.etaxonomy.taxeditor.cdmlib/build.properties @@ -121,14 +121,22 @@ bin.includes = META-INF/,\ lib/poi-3.6.jar,\ lib/hibernate-envers-3.4.0-SNAPSHOT.jar,\ lib/spring-xml-1.5.6.jar,\ - lib/cdmlib-commons-3.0.12-SNAPSHOT.jar,\ - lib/cdmlib-ext-3.0.12-SNAPSHOT.jar,\ - lib/cdmlib-io-3.0.12-SNAPSHOT.jar,\ - lib/cdmlib-model-3.0.12-SNAPSHOT.jar,\ - lib/cdmlib-persistence-3.0.12-SNAPSHOT.jar,\ - lib/cdmlib-print-3.0.12-SNAPSHOT.jar,\ - lib/cdmlib-remote-3.0.12-SNAPSHOT.jar,\ - lib/cdmlib-services-3.0.12-SNAPSHOT.jar + lib/cdmlib-commons-3.0.13-SNAPSHOT-sources.jar,\ + lib/cdmlib-commons-3.0.13-SNAPSHOT.jar,\ + lib/cdmlib-ext-3.0.13-SNAPSHOT-sources.jar,\ + lib/cdmlib-ext-3.0.13-SNAPSHOT.jar,\ + lib/cdmlib-io-3.0.13-SNAPSHOT-sources.jar,\ + lib/cdmlib-io-3.0.13-SNAPSHOT.jar,\ + lib/cdmlib-model-3.0.13-SNAPSHOT-sources.jar,\ + lib/cdmlib-model-3.0.13-SNAPSHOT.jar,\ + lib/cdmlib-persistence-3.0.13-SNAPSHOT-sources.jar,\ + lib/cdmlib-persistence-3.0.13-SNAPSHOT.jar,\ + lib/cdmlib-print-3.0.13-SNAPSHOT-sources.jar,\ + lib/cdmlib-print-3.0.13-SNAPSHOT.jar,\ + lib/cdmlib-remote-3.0.13-SNAPSHOT-sources.jar,\ + lib/cdmlib-remote-3.0.13-SNAPSHOT.jar,\ + lib/cdmlib-services-3.0.13-SNAPSHOT-sources.jar,\ + lib/cdmlib-services-3.0.13-SNAPSHOT.jar jars.compile.order = cdmLibrary.jar src.includes = lib/ bin.excludes = lib/activation-1.1src.zip,\ diff --git a/eu.etaxonomy.taxeditor.cdmlib/pom.xml b/eu.etaxonomy.taxeditor.cdmlib/pom.xml index 13c544b11..f0b190157 100644 --- a/eu.etaxonomy.taxeditor.cdmlib/pom.xml +++ b/eu.etaxonomy.taxeditor.cdmlib/pom.xml @@ -3,7 +3,7 @@ eu.etaxonomy taxeditor-parent - 3.0.12-SNAPSHOT + 3.0.13-SNAPSHOT 4.0.0 eu.etaxonomy.taxeditor.cdmlib diff --git a/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF index 65af27355..d6a5875ca 100644 --- a/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF @@ -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.0.12.qualifier +Bundle-Version: 3.0.13.qualifier Bundle-Activator: eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin Bundle-Vendor: %Bundle-Vendor.0 Bundle-Localization: plugin diff --git a/eu.etaxonomy.taxeditor.editor/pom.xml b/eu.etaxonomy.taxeditor.editor/pom.xml index 044ef40a5..bb22d5cce 100644 --- a/eu.etaxonomy.taxeditor.editor/pom.xml +++ b/eu.etaxonomy.taxeditor.editor/pom.xml @@ -4,7 +4,7 @@ eu.etaxonomy taxeditor-parent - 3.0.12-SNAPSHOT + 3.0.13-SNAPSHOT 4.0.0 diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/UseObjectManager.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/UseObjectManager.java index d9940520b..b4dafb7e7 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/UseObjectManager.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/UseObjectManager.java @@ -38,6 +38,8 @@ import eu.etaxonomy.taxeditor.store.StoreUtil; * @version 1.0 */ public class UseObjectManager extends ContextListenerAdapter{ + + @Override public void contextRefresh(IProgressMonitor monitor) { monitor.subTask("Refreshing the Uses View"); @@ -54,60 +56,99 @@ public class UseObjectManager extends ContextListenerAdapter{ } private void setupNecessaryItems(IProgressMonitor monitor) { - MarkerType existingMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType); - TermVocabulary stateVocabulary = (TermVocabulary) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidUseCategoryVocabulary); + + //retrieve terms and vocabularies from db Feature featureUseRecord = (Feature) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseRecordFeature); Feature featureUseSummary = (Feature) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseSummaryFeature); - TermVocabulary countryVocabulary = (TermVocabulary) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidCountryVocabulary); - TermVocabulary plantPartVocabulary = (TermVocabulary) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidPlantPartVocabulary); - TermVocabulary humanGroupVocabulary = (TermVocabulary) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidHumanGroupVocabulary); ConversationHolder conversation = CdmStore.createConversation(); - if (existingMarkertype == null) { - existingMarkertype = MarkerType.NewInstance(UsageTermCollection.useMakerLabel, UsageTermCollection.useMakerLabel, null); - existingMarkertype.setUuid( UsageTermCollection.uuidUseMarkerType); - TermVocabulary markerTypeVocabulary = (TermVocabulary)CdmStore.getService(IVocabularyService.class).find((UsageTermCollection.uuidMarkersVocabulary)); - markerTypeVocabulary.addTerm(existingMarkertype); - CdmStore.getService(IVocabularyService.class).saveOrUpdate(markerTypeVocabulary); - conversation.commit(true); - } - if (stateVocabulary == null) { - monitor.subTask("stateVocabulary empty"); - URI termSourceUri = null; - try { - termSourceUri = new URI("eu.etaxonomy.cdm.model.description.State"); - } catch (URISyntaxException e) { - e.printStackTrace(); + + + //create use marker type if not exists + createUseMarkerType(conversation); + + //create state vocabulary if not exists + createStateVocabulary(monitor, conversation); + + //create state vocabulary if not exists + createCountryVocabulary(monitor, conversation); + + //create plant part vocabulary + createPlantVocabulary(monitor, conversation); + + //create human group vocabulary + createHumanGroupVocabulary(monitor, conversation); + + if(featureUseRecord == null || featureUseSummary == null) { + TermVocabulary featureVocabulary = (TermVocabulary)CdmStore.getService(IVocabularyService.class).find((UsageTermCollection.uuidFeatureVocabulary)); + FeatureTree palmWebFeatureTree = CdmStore.getService(IFeatureTreeService.class).find(UsageTermCollection.uuidPalmWebFeatureTree); + + if (featureUseRecord == null ) { + featureUseRecord = Feature.NewInstance(UsageTermCollection.useRecordFeatureLabel, UsageTermCollection.useRecordFeatureLabel, null); + featureUseRecord.setUuid(UsageTermCollection.uuidUseRecordFeature); + featureUseRecord.isSupportsCategoricalData(); + featureUseRecord.setSupportsCategoricalData(true); + featureVocabulary.addTerm(featureUseRecord); + if (palmWebFeatureTree != null){ + FeatureNode useRecFeatureNode = FeatureNode.NewInstance(featureUseRecord); + palmWebFeatureTree.getRoot().addChild(useRecFeatureNode); + }else{ + StoreUtil.warn(getClass(), "No current feature tree available to add useRecord feature"); + } + } + if (featureUseSummary == null) { + featureUseSummary = Feature.NewInstance(UsageTermCollection.useSummaryFeatureLabel, UsageTermCollection.useSummaryFeatureLabel, null); + featureUseSummary.setUuid(UsageTermCollection.uuidUseSummaryFeature); + featureUseSummary.isSupportsTextData(); + featureUseSummary.setSupportsTextData(true); + featureVocabulary.addTerm(featureUseSummary); + if (palmWebFeatureTree != null){ + FeatureNode useSumFeatureNode = FeatureNode.NewInstance(featureUseSummary); + palmWebFeatureTree.getRoot().addChild(useSumFeatureNode); + }else{ + StoreUtil.warn(getClass(), "No current feature tree available to add use summary feature"); + } + } + + CdmStore.getService(IVocabularyService.class).saveOrUpdate(featureVocabulary); + if (palmWebFeatureTree != null){ + CdmStore.getService(IFeatureTreeService.class).saveOrUpdate(palmWebFeatureTree); } - stateVocabulary = TermVocabulary.NewInstance(UsageTermCollection.useCategoryVocabularyLabel, UsageTermCollection.useCategoryVocabularyLabel, null, termSourceUri); - stateVocabulary.setUuid(UsageTermCollection.uuidUseCategoryVocabulary); - State newDummyState = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null); - newDummyState.setUuid(UsageTermCollection.uuidUseCategoryDummy); - State newDummySubCat = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null); - newDummySubCat.setUuid(UsageTermCollection.uuidUseSubCategoryDummy); - newDummyState.addIncludes(newDummySubCat); - stateVocabulary.addTerm(newDummyState); - CdmStore.getService(IVocabularyService.class).saveOrUpdate(stateVocabulary); conversation.commit(true); + } - if (countryVocabulary == null) { - monitor.subTask("countryVocabulary empty"); + conversation.close(); + } + + + private void createHumanGroupVocabulary(IProgressMonitor monitor,ConversationHolder conversation) { + TermVocabulary humanGroupVocabulary = (TermVocabulary) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidHumanGroupVocabulary); + if (humanGroupVocabulary == null){ + monitor.subTask("create human group vocabulary"); URI termSourceUri = null; try { termSourceUri = new URI("eu.etaxonomy.cdm.model.description.Modifier"); } catch (URISyntaxException e) { e.printStackTrace(); } - countryVocabulary = TermVocabulary.NewInstance(UsageTermCollection.countryLabel, UsageTermCollection.countryLabel, null, termSourceUri); - countryVocabulary.setUuid(UsageTermCollection.uuidCountryVocabulary); + humanGroupVocabulary = TermVocabulary.NewInstance(UsageTermCollection.humanGroupLabel, UsageTermCollection.humanGroupLabel, null, termSourceUri); + humanGroupVocabulary.setUuid(UsageTermCollection.uuidHumanGroupVocabulary); Modifier newDummyModifier = Modifier.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null); - newDummyModifier.setUuid(UsageTermCollection.uuidCountryDummy); - countryVocabulary.addTerm(newDummyModifier); - CdmStore.getService(IVocabularyService.class).saveOrUpdate(countryVocabulary); + newDummyModifier.setUuid(UsageTermCollection.uuidHumanGroupDummy); + Modifier newSubDummyModifier = Modifier.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null); + newSubDummyModifier.setUuid(UsageTermCollection.uuidEthnicGroupDummy); + newDummyModifier.addIncludes(newSubDummyModifier); + humanGroupVocabulary.addTerm(newDummyModifier); + CdmStore.getService(IVocabularyService.class).saveOrUpdate(humanGroupVocabulary); conversation.commit(true); } - if (plantPartVocabulary == null) { - monitor.subTask("plantPartVocabulary empty"); + } + + + private void createPlantVocabulary(IProgressMonitor monitor, ConversationHolder conversation) { + TermVocabulary plantPartVocabulary = (TermVocabulary) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidPlantPartVocabulary); + if (plantPartVocabulary == null){ + monitor.subTask("create plant part vocabulary"); URI termSourceUri = null; try { termSourceUri = new URI("eu.etaxonomy.cdm.model.description.Modifier"); @@ -122,54 +163,63 @@ public class UseObjectManager extends ContextListenerAdapter{ CdmStore.getService(IVocabularyService.class).saveOrUpdate(plantPartVocabulary); conversation.commit(true); } - if (humanGroupVocabulary == null) { - monitor.subTask("humanGroupVocabulary empty"); + } + + + private void createCountryVocabulary(IProgressMonitor monitor, ConversationHolder conversation) { + TermVocabulary countryVocabulary = (TermVocabulary) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidCountryVocabulary); + if (countryVocabulary == null){ + monitor.subTask("create country vocabulary"); URI termSourceUri = null; try { termSourceUri = new URI("eu.etaxonomy.cdm.model.description.Modifier"); } catch (URISyntaxException e) { e.printStackTrace(); } - humanGroupVocabulary = TermVocabulary.NewInstance(UsageTermCollection.humanGroupLabel, UsageTermCollection.humanGroupLabel, null, termSourceUri); - humanGroupVocabulary.setUuid(UsageTermCollection.uuidHumanGroupVocabulary); + countryVocabulary = TermVocabulary.NewInstance(UsageTermCollection.countryLabel, UsageTermCollection.countryLabel, null, termSourceUri); + countryVocabulary.setUuid(UsageTermCollection.uuidCountryVocabulary); Modifier newDummyModifier = Modifier.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null); - newDummyModifier.setUuid(UsageTermCollection.uuidHumanGroupDummy); - Modifier newSubDummyModifier = Modifier.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null); - newSubDummyModifier.setUuid(UsageTermCollection.uuidEthnicGroupDummy); - newDummyModifier.addIncludes(newSubDummyModifier); - humanGroupVocabulary.addTerm(newDummyModifier); - CdmStore.getService(IVocabularyService.class).saveOrUpdate(humanGroupVocabulary); + newDummyModifier.setUuid(UsageTermCollection.uuidCountryDummy); + countryVocabulary.addTerm(newDummyModifier); + CdmStore.getService(IVocabularyService.class).saveOrUpdate(countryVocabulary); conversation.commit(true); } - - if(featureUseRecord == null|| featureUseSummary == null) { - TermVocabulary featureVocabulary = (TermVocabulary)CdmStore.getService(IVocabularyService.class).find((UsageTermCollection.uuidFeatureVocabulary)); - FeatureTree palmWebFeatureTree = CdmStore.getService(IFeatureTreeService.class).find(UsageTermCollection.uuidPalmWebFeatureTree); - - if (featureUseRecord == null ) { - featureUseRecord = Feature.NewInstance(UsageTermCollection.useRecordFeatureLabel, UsageTermCollection.useRecordFeatureLabel, null); - featureUseRecord.setUuid(UsageTermCollection.uuidUseRecordFeature); - featureUseRecord.isSupportsCategoricalData(); - featureUseRecord.setSupportsCategoricalData(true); - featureVocabulary.addTerm(featureUseRecord); - FeatureNode useRecFeatureNode = FeatureNode.NewInstance(featureUseRecord); - palmWebFeatureTree.getRoot().addChild(useRecFeatureNode); - } - if (featureUseSummary == null) { - featureUseSummary = Feature.NewInstance(UsageTermCollection.useSummaryFeatureLabel, UsageTermCollection.useSummaryFeatureLabel, null); - featureUseSummary.setUuid(UsageTermCollection.uuidUseSummaryFeature); - featureUseSummary.isSupportsTextData(); - featureUseSummary.setSupportsTextData(true); - featureVocabulary.addTerm(featureUseSummary); - FeatureNode useSumFeatureNode = FeatureNode.NewInstance(featureUseSummary); - palmWebFeatureTree.getRoot().addChild(useSumFeatureNode); + } + + + private void createStateVocabulary(IProgressMonitor monitor, ConversationHolder conversation) { + TermVocabulary stateVocabulary = (TermVocabulary) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidUseCategoryVocabulary); + if (stateVocabulary == null){ + monitor.subTask("create state vocabulary"); + URI termSourceUri = null; + try { + termSourceUri = new URI("eu.etaxonomy.cdm.model.description.State"); + } catch (URISyntaxException e) { + e.printStackTrace(); } - - CdmStore.getService(IVocabularyService.class).saveOrUpdate(featureVocabulary); - CdmStore.getService(IFeatureTreeService.class).saveOrUpdate(palmWebFeatureTree); + stateVocabulary = TermVocabulary.NewInstance(UsageTermCollection.useCategoryVocabularyLabel, UsageTermCollection.useCategoryVocabularyLabel, null, termSourceUri); + stateVocabulary.setUuid(UsageTermCollection.uuidUseCategoryVocabulary); + State newDummyState = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null); + newDummyState.setUuid(UsageTermCollection.uuidUseCategoryDummy); + State newDummySubCat = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null); + newDummySubCat.setUuid(UsageTermCollection.uuidUseSubCategoryDummy); + newDummyState.addIncludes(newDummySubCat); + stateVocabulary.addTerm(newDummyState); + CdmStore.getService(IVocabularyService.class).saveOrUpdate(stateVocabulary); + conversation.commit(true); + } + } + + + private void createUseMarkerType(ConversationHolder conversation) { + MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType); + if (useMarkertype == null){ + useMarkertype = MarkerType.NewInstance(UsageTermCollection.useMakerLabel, UsageTermCollection.useMakerLabel, null); + useMarkertype.setUuid( UsageTermCollection.uuidUseMarkerType); + TermVocabulary markerTypeVocabulary = (TermVocabulary)CdmStore.getService(IVocabularyService.class).find((UsageTermCollection.uuidMarkersVocabulary)); + markerTypeVocabulary.addTerm(useMarkertype); + CdmStore.getService(IVocabularyService.class).saveOrUpdate(markerTypeVocabulary); conversation.commit(true); - } - conversation.close(); } } diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/internal/TaxeditorEditorPlugin.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/internal/TaxeditorEditorPlugin.java index 2d4261bfa..648e35a6a 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/internal/TaxeditorEditorPlugin.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/internal/TaxeditorEditorPlugin.java @@ -41,8 +41,9 @@ public class TaxeditorEditorPlugin extends AbstractUIPlugin { super.start(context); EditorStateManager stateManager = new EditorStateManager(); - UseObjectManager useManager = new UseObjectManager(); CdmStore.getContextManager().addContextListener(stateManager); + + UseObjectManager useManager = new UseObjectManager(); CdmStore.getContextManager().addContextListener(useManager); plugin = this; diff --git a/eu.etaxonomy.taxeditor.feature.platform/feature.xml b/eu.etaxonomy.taxeditor.feature.platform/feature.xml index 943b7de6d..9bd198d4a 100644 --- a/eu.etaxonomy.taxeditor.feature.platform/feature.xml +++ b/eu.etaxonomy.taxeditor.feature.platform/feature.xml @@ -1,933 +1,926 @@ - - - - - The contents of this file are subject to the Eclipse Public License Version 1.0 (the "License"); 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 "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + The contents of this file are subject to the Eclipse Public License Version 1.0 (the "License"); 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 "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eu.etaxonomy.taxeditor.feature.platform/pom.xml b/eu.etaxonomy.taxeditor.feature.platform/pom.xml index 0d665cf5a..9e32e4f58 100644 --- a/eu.etaxonomy.taxeditor.feature.platform/pom.xml +++ b/eu.etaxonomy.taxeditor.feature.platform/pom.xml @@ -3,7 +3,7 @@ eu.etaxonomy taxeditor-parent - 3.0.12-SNAPSHOT + 3.0.13-SNAPSHOT 4.0.0 eu.etaxonomy.taxeditor.feature.platform diff --git a/eu.etaxonomy.taxeditor.feature/feature.xml b/eu.etaxonomy.taxeditor.feature/feature.xml index 1518c3138..7ab92abb0 100644 --- a/eu.etaxonomy.taxeditor.feature/feature.xml +++ b/eu.etaxonomy.taxeditor.feature/feature.xml @@ -2,7 +2,7 @@ eu.etaxonomy taxeditor-parent - 3.0.12-SNAPSHOT + 3.0.13-SNAPSHOT 4.0.0 eu.etaxonomy.taxeditor.feature diff --git a/eu.etaxonomy.taxeditor.help/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.help/META-INF/MANIFEST.MF index 9ccd37e3d..48e42be74 100644 --- a/eu.etaxonomy.taxeditor.help/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.help/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Help Bundle-SymbolicName: eu.etaxonomy.taxeditor.help; singleton:=true -Bundle-Version: 3.0.12.qualifier +Bundle-Version: 3.0.13.qualifier Bundle-Activator: eu.etaxonomy.taxeditor.help.Activator Bundle-Vendor: EDIT Require-Bundle: org.eclipse.ui, diff --git a/eu.etaxonomy.taxeditor.help/pom.xml b/eu.etaxonomy.taxeditor.help/pom.xml index dd947da4c..82e1701d1 100644 --- a/eu.etaxonomy.taxeditor.help/pom.xml +++ b/eu.etaxonomy.taxeditor.help/pom.xml @@ -4,7 +4,7 @@ eu.etaxonomy taxeditor-parent - 3.0.12-SNAPSHOT + 3.0.13-SNAPSHOT 4.0.0 diff --git a/eu.etaxonomy.taxeditor.navigation/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.navigation/META-INF/MANIFEST.MF index 740c1909c..eacdda6b2 100644 --- a/eu.etaxonomy.taxeditor.navigation/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.navigation/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Navigation Bundle Bundle-SymbolicName: eu.etaxonomy.taxeditor.navigation;singleton:=true -Bundle-Version: 3.0.12.qualifier +Bundle-Version: 3.0.13.qualifier Bundle-Vendor: EDIT Export-Package: eu.etaxonomy.cdm, eu.etaxonomy.taxeditor.navigation, diff --git a/eu.etaxonomy.taxeditor.navigation/pom.xml b/eu.etaxonomy.taxeditor.navigation/pom.xml index aa33ad597..e93fecd4b 100644 --- a/eu.etaxonomy.taxeditor.navigation/pom.xml +++ b/eu.etaxonomy.taxeditor.navigation/pom.xml @@ -4,7 +4,7 @@ eu.etaxonomy taxeditor-parent - 3.0.12-SNAPSHOT + 3.0.13-SNAPSHOT 4.0.0 diff --git a/eu.etaxonomy.taxeditor.printpublisher/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.printpublisher/META-INF/MANIFEST.MF index 3e55623bb..68fce39e6 100644 --- a/eu.etaxonomy.taxeditor.printpublisher/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.printpublisher/META-INF/MANIFEST.MF @@ -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.0.12.qualifier +Bundle-Version: 3.0.13.qualifier Require-Bundle: org.eclipse.osgi, org.eclipse.ui, eu.etaxonomy.taxeditor.cdmlib, diff --git a/eu.etaxonomy.taxeditor.printpublisher/pom.xml b/eu.etaxonomy.taxeditor.printpublisher/pom.xml index 633947cfc..05c2fcbfa 100644 --- a/eu.etaxonomy.taxeditor.printpublisher/pom.xml +++ b/eu.etaxonomy.taxeditor.printpublisher/pom.xml @@ -4,7 +4,7 @@ taxeditor-parent eu.etaxonomy - 3.0.12-SNAPSHOT + 3.0.13-SNAPSHOT 4.0.0 diff --git a/eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF index f8efcac30..4462122ea 100644 --- a/eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF @@ -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.0.12.qualifier +Bundle-Version: 3.0.13.qualifier Bundle-Activator: eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin Bundle-Vendor: EDIT Export-Package: eu.etaxonomy.cdm, diff --git a/eu.etaxonomy.taxeditor.store/pom.xml b/eu.etaxonomy.taxeditor.store/pom.xml index 40ddc832b..1857531f9 100644 --- a/eu.etaxonomy.taxeditor.store/pom.xml +++ b/eu.etaxonomy.taxeditor.store/pom.xml @@ -4,7 +4,7 @@ eu.etaxonomy taxeditor-parent - 3.0.12-SNAPSHOT + 3.0.13-SNAPSHOT 4.0.0 diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NamedAreaSelectionDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NamedAreaSelectionDialog.java index a57cbc7df..cf39589ad 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NamedAreaSelectionDialog.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NamedAreaSelectionDialog.java @@ -169,7 +169,14 @@ public class NamedAreaSelectionDialog extends /** {@inheritDoc} */ @Override protected String getTitle(NamedArea namedArea) { - return NamedArea.labelWithLevel(namedArea, CdmStore.getDefaultLanguage()); + try { + 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()); + return namedArea.getTitleCache(); + } } /** {@inheritDoc} */ diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/ProtologueSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/ProtologueSection.java index 4f4e24f5f..f9401eeee 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/ProtologueSection.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/ProtologueSection.java @@ -10,7 +10,9 @@ package eu.etaxonomy.taxeditor.ui.section.name; +import java.util.ArrayList; import java.util.Collection; +import java.util.List; import eu.etaxonomy.cdm.api.conversation.ConversationHolder; import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; @@ -58,9 +60,14 @@ public class ProtologueSection extends AbstractEntityCollectionSection getCollection( - TaxonNameBase entity) { - return getTaxonNameDescription(entity).getElements(); + public Collection getCollection(TaxonNameBase entity) { + Collection result = new ArrayList(); + List descriptions = getTaxonNameDescriptions(entity); + for (TaxonNameDescription desc : descriptions){ + result.addAll(desc.getElements()); + } + return result; +//OLD: return getTaxonNameDescription(entity).getElements(); } @@ -80,13 +87,17 @@ public class ProtologueSection extends AbstractEntityCollectionSection descriptions = getTaxonNameDescriptions(getEntity()); + for (TaxonNameDescription desc : descriptions){ + desc.removeElement(element); + } } /** {@inheritDoc} */ @@ -96,13 +107,33 @@ public class ProtologueSection extends AbstractEntityCollectionSection getTaxonNameDescriptions(TaxonNameBase name){ + List result = new ArrayList(); + if(name.getDescriptions().size() == 0){ + name.addDescription(TaxonNameDescription.NewInstance(name)); + } + for (TaxonNameDescription desc : name.getDescriptions()){ + result.add(desc); + } + return result; + } /* (non-Javadoc) * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase) diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailElement.java index 8422ed5d9..1569bc08e 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailElement.java @@ -41,7 +41,7 @@ public class DerivedUnitBaseDetailElement extends private TextWithLabelElement text_derivedUnitDefinitions; - private TextWithLabelElement text_accessionNumber; + private TextWithLabelElement text_barcode; private TextWithLabelElement text_catalogNumber; @@ -82,9 +82,8 @@ public class DerivedUnitBaseDetailElement extends // "Specimen Definition", // facade.getDerivedUnitDefinition(CdmStore.getDefaultLanguage()), // style); - text_accessionNumber = formFactory.createTextWithLabelElement( - formElement, "Accession Number", entity.getAccessionNumber(), - style); + text_barcode = formFactory.createTextWithLabelElement(formElement, + "Barcode", entity.getBarcode(), style); text_catalogNumber = formFactory .createTextWithLabelElement(formElement, "Catalog Number", entity.getCatalogNumber(), style); @@ -134,8 +133,8 @@ public class DerivedUnitBaseDetailElement extends getEntity().addDerivedUnitDefinition( text_derivedUnitDefinitions.getText(), CdmStore.getDefaultLanguage()); - } else if (eventSource == text_accessionNumber) { - getEntity().setAccessionNumber(text_accessionNumber.getText()); + } else if (eventSource == text_barcode) { + getEntity().setBarcode(text_barcode.getText()); } else if (eventSource == text_catalogNumber) { getEntity().setCatalogNumber(text_catalogNumber.getText()); } else if (eventSource == combo_preservationMethod) { diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralDetailElement.java index 5951b23db..30f43dd00 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralDetailElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralDetailElement.java @@ -44,7 +44,7 @@ public class GeneralDetailElement extends private EntitySelectionElement selection_collector; private TextWithLabelElement text_collectingNumber; private EntitySelectionElement selection_collection; - private TextWithLabelElement text_barcode; + private TextWithLabelElement text_accessionNumber; /** * @param formFactory @@ -94,8 +94,10 @@ public class GeneralDetailElement extends getConversationHolder(), formElement, "Collection", entity.getCollection(), EntitySelectionElement.ALL, style); - text_barcode = formFactory.createTextWithLabelElement(formElement, - "Barcode", entity.getBarcode(), style); + text_accessionNumber = formFactory.createTextWithLabelElement( + formElement, "Accession Number", entity.getAccessionNumber(), + style); + } /* @@ -127,8 +129,8 @@ public class GeneralDetailElement extends getEntity().setFieldNumber(text_collectingNumber.getText()); } else if (eventSource == selection_collection) { getEntity().setCollection(selection_collection.getSelection()); - } else if (eventSource == text_barcode) { - getEntity().setBarcode(text_barcode.getText()); + } else if (eventSource == text_accessionNumber) { + getEntity().setAccessionNumber(text_accessionNumber.getText()); } if (eventSource != toggleableText_titleCache) { diff --git a/eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product b/eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product index 4a714859d..322cbc32c 100644 --- a/eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product +++ b/eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product @@ -1,7 +1,7 @@ - + diff --git a/eu.etaxonomy.taxeditor/pom.xml b/eu.etaxonomy.taxeditor/pom.xml index 73d0bbd11..139334f4e 100644 --- a/eu.etaxonomy.taxeditor/pom.xml +++ b/eu.etaxonomy.taxeditor/pom.xml @@ -3,7 +3,7 @@ eu.etaxonomy taxeditor-parent - 3.0.12-SNAPSHOT + 3.0.13-SNAPSHOT 4.0.0