create terms and vocabularies with default language representation
authorKatja Luther <k.luther@bgbm.org>
Fri, 1 Apr 2022 08:25:25 +0000 (10:25 +0200)
committerKatja Luther <k.luther@bgbm.org>
Fri, 1 Apr 2022 08:25:25 +0000 (10:25 +0200)
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

index cc7f7a85f56d0e2b78ee91bd819b2e571f01fc2a..d2df0c47781994f7dd5e3496a2bf1505f97db23a 100644 (file)
@@ -23,6 +23,7 @@ import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
 import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 \r
 /**\r
@@ -52,10 +53,10 @@ public class CreateDefinedTermOperation extends AbstractPostOperation<DefinedTer
                        throws ExecutionException {\r
            TermDto newTerm = null;\r
            if(parent instanceof TermDto){\r
-               newTerm = CdmStore.getService(ITermService.class).addNewTerm(definedTermInput.getTermType(), parent.getUuid(), addTermAsKindOf);\r
+               newTerm = CdmStore.getService(ITermService.class).addNewTerm(definedTermInput.getTermType(), parent.getUuid(), addTermAsKindOf, PreferencesUtil.getGlobalLanguage());\r
            }\r
            else if(parent instanceof TermVocabularyDto){\r
-               newTerm = CdmStore.getService(IVocabularyService.class).addNewTerm(definedTermInput.getTermType(), parent.getUuid());\r
+               newTerm = CdmStore.getService(IVocabularyService.class).addNewTerm(definedTermInput.getTermType(), parent.getUuid(), PreferencesUtil.getGlobalLanguage());\r
            }\r
 //         newTerm.setTitleCache("_" + newTerm.getTitleCache());\r
                return postExecute(newTerm);\r
index a9bbe222c6772541450c00d40ff612e20a22d0f4..abd02ec73393f0c86fac95c9dc50b4638fac97d1 100644 (file)
@@ -24,6 +24,7 @@ import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
 import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;\r
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 \r
 /**\r
@@ -48,14 +49,14 @@ public class CreateTermVocabularyOperation extends AbstractPostTaxonOperation {
                        throws ExecutionException {\r
 \r
           TermType type= definedEditorInput.getTermType();\r
-          DefinedTermBase test = type.getEmptyDefinedTermBase();\r
+          DefinedTermBase test = type.getEmptyDefinedTermBase(PreferencesUtil.getGlobalLanguage());\r
           TermVocabulary termVocabulary = null;\r
           if (test instanceof OrderedTermBase){\r
              termVocabulary = OrderedTermVocabulary.NewInstance(definedEditorInput.getTermType(),\r
                        null,\r
                        "Untitled",\r
                        null,\r
-                       null);\r
+                       null, PreferencesUtil.getGlobalLanguage());\r
           }\r
 \r
           if (termVocabulary == null){\r