FIME:3.3MC tags for code to be aligned with the 3.3 model changes related to the...
authorCherian Mathew <c.mathew@bgbm.org>
Tue, 23 Jul 2013 15:34:26 +0000 (15:34 +0000)
committerCherian Mathew <c.mathew@bgbm.org>
Tue, 23 Jul 2013 15:34:26 +0000 (15:34 +0000)
eu.etaxonomy.taxeditor.application/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/UseObjectManager.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/internal/TaxeditorEditorPlugin.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java

index 61f897c866ce4cf0eb0288cb8a0558c4db4eddd5..92ca4981ba913769d30dbb4756289aa40acca357 100644 (file)
             id="eu.etaxonomy.taxeditor.application.perspective.polytomous"\r
             name="Polytomous Key">\r
       </perspective>\r
-       <perspective\r
+      <!-- FIXME:3.3MC -->\r
+       <!--perspective\r
             class="eu.etaxonomy.taxeditor.perspective.Uses"\r
             id="eu.etaxonomy.taxeditor.application.perspective.uses"\r
             name="Uses">\r
-      </perspective>\r
+      </perspective-->\r
      \r
    </extension>\r
    <!--extension\r
index bfe4e7369dab6723e78f6a370039026afc2dae06..3d40d7c2e68f8729b9296103fdaf480cf8e3abcc 100644 (file)
@@ -25,6 +25,7 @@ import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.FeatureNode;\r
 import eu.etaxonomy.cdm.model.description.FeatureTree;\r
 import eu.etaxonomy.cdm.model.description.State;\r
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;\r
 import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 import eu.etaxonomy.taxeditor.store.StoreUtil;\r
@@ -131,12 +132,25 @@ public class UseObjectManager extends ContextListenerAdapter{
                        } catch (URISyntaxException e) {\r
                                e.printStackTrace();\r
                        }\r
-                       humanGroupVocabulary = TermVocabulary.NewInstance(UsageTermCollection.humanGroupLabel, UsageTermCollection.humanGroupLabel, null, termSourceUri);\r
+                       \r
+                       //FIXME:3.3MC----\r
+                       //humanGroupVocabulary = TermVocabulary.NewInstance(UsageTermCollection.humanGroupLabel, UsageTermCollection.humanGroupLabel, null, termSourceUri);\r
+                       humanGroupVocabulary = null;\r
                        humanGroupVocabulary.setUuid(UsageTermCollection.uuidHumanGroupVocabulary);\r
-                       DefinedTerm newDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+                       //FIXME:3.3MC----\r
+                       \r
+                       //FIXME:3.3MC----\r
+                       //DefinedTerm newDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+                       DefinedTerm newDummyModifier = null;\r
                        newDummyModifier.setUuid(UsageTermCollection.uuidHumanGroupDummy);\r
-                       DefinedTerm newSubDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+                       //FIXME:3.3MC----\r
+                       \r
+                       //FIXME:3.3MC----\r
+                       //DefinedTerm newSubDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+                       DefinedTerm newSubDummyModifier = null;\r
                        newSubDummyModifier.setUuid(UsageTermCollection.uuidEthnicGroupDummy);\r
+                       //FIXME:3.3MC----\r
+                       \r
                        newDummyModifier.addIncludes(newSubDummyModifier);\r
                        humanGroupVocabulary.addTerm(newDummyModifier);\r
                        CdmStore.getService(IVocabularyService.class).saveOrUpdate(humanGroupVocabulary);\r
@@ -155,11 +169,19 @@ public class UseObjectManager extends ContextListenerAdapter{
                        } catch (URISyntaxException e) {\r
                                e.printStackTrace();\r
                        }\r
-                       plantPartVocabulary = TermVocabulary.NewInstance(UsageTermCollection.plantPartLabel, UsageTermCollection.plantPartLabel, null, termSourceUri);\r
+                       //FIXME:3.3MC----\r
+                       //plantPartVocabulary = TermVocabulary.NewInstance(UsageTermCollection.plantPartLabel, UsageTermCollection.plantPartLabel, null, termSourceUri);\r
+                       plantPartVocabulary = null;\r
                        plantPartVocabulary.setUuid(UsageTermCollection.uuidPlantPartVocabulary);\r
-                       DefinedTerm newDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+                       //FIXME:3.3MC----\r
+                       \r
+                       //FIXME:3.3MC----\r
+                       //DefinedTerm newDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+                       DefinedTerm newDummyModifier = null;\r
                        newDummyModifier.setUuid(UsageTermCollection.uuidPlantPartDummy);\r
                        plantPartVocabulary.addTerm(newDummyModifier);\r
+                       //FIXME:3.3MC----\r
+                       \r
                        CdmStore.getService(IVocabularyService.class).saveOrUpdate(plantPartVocabulary);\r
                        conversation.commit(true);\r
                }\r
@@ -176,10 +198,17 @@ public class UseObjectManager extends ContextListenerAdapter{
                        } catch (URISyntaxException e) {\r
                                e.printStackTrace();\r
                        }\r
-                       countryVocabulary = TermVocabulary.NewInstance(UsageTermCollection.countryLabel, UsageTermCollection.countryLabel, null, termSourceUri);\r
+                       //FIXME:3.3MC----\r
+                       //countryVocabulary = TermVocabulary.NewInstance(UsageTermCollection.countryLabel, UsageTermCollection.countryLabel, null, termSourceUri);\r
+                       countryVocabulary = null;\r
                        countryVocabulary.setUuid(UsageTermCollection.uuidCountryVocabulary);\r
-                       DefinedTerm newDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+                       //FIXME:3.3MC----\r
+                       \r
+                       //FIXME:3.3MC----\r
+                       //DefinedTerm newDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+                       DefinedTerm newDummyModifier = null;\r
                        newDummyModifier.setUuid(UsageTermCollection.uuidCountryDummy);\r
+                       //FIXME:3.3MC----\r
                        countryVocabulary.addTerm(newDummyModifier);\r
                        CdmStore.getService(IVocabularyService.class).saveOrUpdate(countryVocabulary);\r
                        conversation.commit(true);\r
@@ -197,8 +226,11 @@ public class UseObjectManager extends ContextListenerAdapter{
                        } catch (URISyntaxException e) {\r
                                e.printStackTrace();\r
                        }\r
-                       stateVocabulary = TermVocabulary.NewInstance(UsageTermCollection.useCategoryVocabularyLabel, UsageTermCollection.useCategoryVocabularyLabel, null, termSourceUri);\r
+                       //FIXME:3.3MC----\r
+                       //stateVocabulary = TermVocabulary.NewInstance(UsageTermCollection.useCategoryVocabularyLabel, UsageTermCollection.useCategoryVocabularyLabel, null, termSourceUri);\r
+                       stateVocabulary = null;\r
                        stateVocabulary.setUuid(UsageTermCollection.uuidUseCategoryVocabulary);\r
+                       //FIXME:3.3MC----\r
                        State newDummyState = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
                        newDummyState.setUuid(UsageTermCollection.uuidUseCategoryDummy);\r
                        State newDummySubCat = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
index 648e35a6aa197b55afbec8f72d96caa9cd9073da..0f7cadb8a79e08dba1229f1a37409b61cf432619 100644 (file)
@@ -43,8 +43,10 @@ public class TaxeditorEditorPlugin extends AbstractUIPlugin {
                EditorStateManager stateManager = new EditorStateManager();
                CdmStore.getContextManager().addContextListener(stateManager);
                
-               UseObjectManager useManager = new UseObjectManager();
-               CdmStore.getContextManager().addContextListener(useManager);
+               //FIXME:3.3MC----
+               //UseObjectManager useManager = new UseObjectManager();
+               //CdmStore.getContextManager().addContextListener(useManager);
+               //FIXME:3.3MC----
                
                plugin = this;
                logger.trace("Plugin started: " + this.getBundle().getSymbolicName());
index cf0133919fc607a35cea903ddcfb07d87babc20a..81ba19af39e3aca1d78c05140a68e652cba14968 100644 (file)
@@ -30,6 +30,7 @@ import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.common.IDefinedTerm;
+import eu.etaxonomy.cdm.model.common.ISimpleTerm;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.common.MarkerType;
 import eu.etaxonomy.cdm.model.common.TermBase;
@@ -229,6 +230,25 @@ public class PreferencesUtil implements IPreferenceKeys {
                }
                return key;
        }
+       
+       /**
+        * Construct a unique key using the CdmBase object's uuid
+        * 
+        * @param cdmBase
+        * @return
+        */
+       public static String getPreferenceKey(ISimpleTerm simpleTerm) {
+               simpleTerm = (ISimpleTerm) HibernateProxyHelper.deproxy(simpleTerm);
+               String key = simpleTerm.getClass().getName().concat(".")
+                               .concat(simpleTerm.getUuid().toString());
+               if (key.contains("javassist")) {
+                       StoreUtil.warn(PreferencesUtil.class,
+                                       "Trying to persist a preference based on a proxy class.");
+               }
+               return key;
+       }
+       
+       
 
        /**
         * Construct a unique key using the CdmBase object's uuid