Merge branch 'release/5.19.0'
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / element / CdmFormFactory.java
index 866011b2d9004edb8f8d3003f5c2ed8efbbcab4b..4613c961196db43dfaeb2e4b69f40a71ffae50fb 100644 (file)
@@ -1,9 +1,13 @@
 /**
- *
- */
+* 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 java.net.URI;
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.HashSet;
@@ -52,6 +56,7 @@ import org.springframework.security.core.GrantedAuthority;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.common.DOI;
+import eu.etaxonomy.cdm.common.URI;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.agent.ORCID;
 import eu.etaxonomy.cdm.model.agent.Person;
@@ -121,8 +126,11 @@ import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.term.IEnumTerm;
 import eu.etaxonomy.cdm.model.term.Representation;
 import eu.etaxonomy.cdm.model.term.TermBase;
+import eu.etaxonomy.cdm.model.term.TermTree;
 import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.model.term.TermVocabulary;
+import eu.etaxonomy.cdm.persistence.dto.TermDto;
+import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
 import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
@@ -196,18 +204,26 @@ import eu.etaxonomy.taxeditor.ui.section.description.detail.TemporalDataDetailEl
 import eu.etaxonomy.taxeditor.ui.section.description.detail.TextDataDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.feature.CharacterDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.feature.CharacterDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.feature.CharacterDtoDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.feature.CharacterDtoDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.feature.CharacterNodeDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.feature.CharacterNodeDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.feature.CharacterNodeDtoDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.feature.CharacterNodeDtoDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.feature.FeatureDistributionDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.feature.FeatureDistributionDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.feature.FeatureNodeDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.feature.FeatureNodeDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.feature.FeatureTreeDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.feature.FeatureTreeDetailElementForNode;
 import eu.etaxonomy.taxeditor.ui.section.feature.FeatureTreeDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.feature.FeatureTreeDetailSectionForNode;
 import eu.etaxonomy.taxeditor.ui.section.feature.InapplicableIfCollectionElement;
 import eu.etaxonomy.taxeditor.ui.section.feature.InapplicableIfEntityCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.feature.InapplicableIfEntityCollectionSectionForNode;
 import eu.etaxonomy.taxeditor.ui.section.feature.OnlyApplicableIfCollectionElement;
 import eu.etaxonomy.taxeditor.ui.section.feature.OnlyApplicableIfEntityCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.feature.OnlyApplicableIfEntityCollectionSectionForNode;
 import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityCollectionElement;
 import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailSection;
@@ -242,8 +258,6 @@ import eu.etaxonomy.taxeditor.ui.section.name.NomenclaturalStatusElement;
 import eu.etaxonomy.taxeditor.ui.section.name.NomenclaturalStatusSection;
 import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.name.ProtologueElement;
-import eu.etaxonomy.taxeditor.ui.section.name.ProtologueSection;
 import eu.etaxonomy.taxeditor.ui.section.name.RuleConsideredElement;
 import eu.etaxonomy.taxeditor.ui.section.name.SpecimenTypeDesignationElement;
 import eu.etaxonomy.taxeditor.ui.section.name.TextTypeDesignationElement;
@@ -317,8 +331,11 @@ import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.TissueSampleGeneralDetai
 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.TissueSampleGeneralDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.media.MediaSpecimenGeneralDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.media.MediaSpecimenGeneralDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.reference.AdvancedNomenclaturalSourceElement;
+import eu.etaxonomy.taxeditor.ui.section.reference.AdvancedSourceElement;
 import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalSourceElement;
 import eu.etaxonomy.taxeditor.ui.section.reference.OriginalSourceAdvancedSection;
 import eu.etaxonomy.taxeditor.ui.section.reference.OriginalSourceElement;
 import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceDetailElement;
@@ -364,14 +381,22 @@ import eu.etaxonomy.taxeditor.ui.section.vocabulary.DefinedTermDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.FeatureDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.MeasurementUnitCollectionElement;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.MeasurementUnitCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.MeasurementUnitDtoCollectionElement;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.MeasurementUnitDtoCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.PresenceAbsenceTermDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierDtoVocabulariesElement;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierVocabulariesCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierVocabulariesDtoCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierVocabulariesElement;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateVocabularyCollectionElement;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateVocabularyCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateVocabularyDtoCollectionElement;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateVocabularyDtoCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.StatisticalMeasureCollectionElement;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.StatisticalMeasureCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.StatisticalMeasureDtoCollectionElement;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.StatisticalMeasureDtoCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermMediaSection;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermVocabularyDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermVocabularyDetailSection;
@@ -668,6 +693,14 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
+    public TranslatableRepresentationElement createTranslatableRepresentationElementDto(ICdmFormElement parentElement, Representation representation, TermDto term,int textHeight, int style, boolean fillDetails) {
+        TranslatableRepresentationElement element = new TranslatableRepresentationElement(this, parentElement, representation, term, textHeight, style, fillDetails);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+
     public KeyStatementElement createKeyStatementElement(ICdmFormElement parentElement, String labelString,
             KeyStatement keyStatement, int textHeight, int style) {
         KeyStatementElement element = new KeyStatementElement(this, parentElement, labelString, keyStatement,
@@ -914,6 +947,7 @@ public class CdmFormFactory extends FormToolkit {
         parentElement.addElement(element);
         return element;
     }
+
     /**
      * @deprecated Use {@link #createDefinedTermComboElement(TermType, ICdmFormElement, String, DefinedTermBase, int)} instead
      */
@@ -954,6 +988,14 @@ public class CdmFormFactory extends FormToolkit {
                        int style) {
                return  this.createDefinedTermComboElement(termType, null, null, parentElement, labelString, selection, true, style, false, null);
        }
+       public <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElementDto(
+            TermType termType,
+            ICdmFormElement parentElement,
+            String labelString,
+            TermDto selection,
+            int style) {
+        return  this.createDefinedTermComboElement(termType, null, null, parentElement, labelString, selection, true, style, false, null);
+    }
 
        public <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
             List<T> terms,
@@ -963,6 +1005,7 @@ public class CdmFormFactory extends FormToolkit {
             int style) {
         return  this.createDefinedTermComboElement(null, null, terms, parentElement, labelString, selection, true, style, false, null);
     }
+
        public <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
                List<T> terms,
                ICdmFormElement parentElement,
@@ -972,6 +1015,7 @@ public class CdmFormFactory extends FormToolkit {
                int style) {
            return  this.createDefinedTermComboElement(null, null, terms, parentElement, labelString, selection, addEmptyElement, style, false, null);
        }
+
     public <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
                        TermType termType,
                        ICdmFormElement parentElement,
@@ -1015,6 +1059,7 @@ public class CdmFormFactory extends FormToolkit {
                int style,
                boolean useAbbrevLabel,
                Comparator<T> comparator) {
+
            if(termType!=null){
                TermComboElement<T> element = new TermComboElement<T>(this, parentElement, termType, labelString, selection, addEmptyElement, style, useAbbrevLabel, comparator);
                adapt(element);
@@ -1045,6 +1090,30 @@ public class CdmFormFactory extends FormToolkit {
            }
        }
 
+          private <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
+                   TermType termType,
+                   TermVocabulary<?> termVocabulary,
+                   List<T> terms,
+                   ICdmFormElement parentElement,
+                   String labelString,
+                   TermDto selection,
+                   boolean addEmptyElement,
+                   int style,
+                   boolean useAbbrevLabel,
+                   Comparator<T> comparator) {
+               if(termType!=null){
+                   TermComboElement<T> element = new TermComboElement<T>(this, parentElement, termType, labelString, selection, addEmptyElement, style, useAbbrevLabel, comparator);
+                   adapt(element);
+                   parentElement.addElement(element);
+                   return element;
+               }
+
+               else {
+                   //this should never happen
+                   return null;
+               }
+           }
+
        public NameRelationshipTypeCombo createNameRelationshipTypeCombo(ICdmFormElement parentElement,
             String labelString,
             int style,
@@ -1096,13 +1165,21 @@ public class CdmFormFactory extends FormToolkit {
            return element;
        }
 
+       public <TERM extends DefinedTermBase<TERM>, VOC extends TermVocabulary<TERM>> VocabularyComboElement<TERM, VOC> createVocabularyDtoComboElement(
+            TermType termType, String label, TermVocabularyDto selection, ICdmFormElement parentElement, int style) {
+        VocabularyComboElement<TERM, VOC> element = new VocabularyComboElement<TERM, VOC>(this, parentElement, termType, label, selection, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
     /**
      * <p>
      * createBrowserElement
      * </p>
      *
      * @param imageUri
-     *            a {@link java.net.URI} object.
+     *            a {@link eu.etaxonomy.cdm.common.URI} object.
      * @param style
      *            a int.
      * @param parentElement
@@ -1127,7 +1204,7 @@ public class CdmFormFactory extends FormToolkit {
      *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
      *            object.
      * @param imageUri
-     *            a {@link java.net.URI} object.
+     *            a {@link eu.etaxonomy.cdm.common.URI} object.
      * @param style
      *            a int.
      * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
@@ -1271,28 +1348,12 @@ public class CdmFormFactory extends FormToolkit {
     }
 
     /**
-     * <p>
-     * createToggleableTextField
-     * </p>
-     *
-     * @param parentElement
-     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-     *            object.
-     * @param labelString
-     *            a {@link java.lang.String} object.
-     * @param initialText
-     *            a {@link java.lang.String} object.
-     * @param initialState
-     *            a boolean.
-     * @param style
-     *            a int.
-     * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
-     *         object.
+     * createToggleableTextField with relevance
      */
     public ToggleableTextElement createToggleableTextField(ICdmFormElement parentElement, String labelString,
-            String initialText, boolean initialState, int style) {
+            String initialText, boolean initialState, CacheRelevance relevance, int style) {
         ToggleableTextElement element = new ToggleableTextElement(this, parentElement, labelString, initialText,
-                initialState, style | orientation);
+                initialState, relevance, style | orientation);
 
         adapt(element);
         parentElement.addElement(element);
@@ -1300,21 +1361,17 @@ public class CdmFormFactory extends FormToolkit {
     }
 
     /**
-     * <p>
+     * like {@link #createToggleableTextField(ICdmFormElement, String, String, boolean, CacheRelevance, int)}
+     * but with predefined cache relevance == 1
+     */
+    public ToggleableTextElement createToggleableTextField(ICdmFormElement parentElement, String labelString,
+            String initialText, boolean initialState, int style) {
+        return createToggleableTextField(parentElement, labelString, initialText, initialState, CacheRelevance.CACHE1, style);
+    }
+
+
+    /**
      * createTimePeriodElement
-     * </p>
-     *
-     * @param parentElement
-     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-     *            object.
-     * @param labelString
-     *            a {@link java.lang.String} object.
-     * @param timePeriod
-     *            a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
-     * @param style
-     *            a int.
-     * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
-     *         object.
      */
     public TimePeriodElement createTimePeriodElement(ICdmFormElement parentElement, String labelString,
             TimePeriod timePeriod, int style) {
@@ -1325,21 +1382,7 @@ public class CdmFormFactory extends FormToolkit {
     }
 
     /**
-     * <p>
      * createVerbatimTimePeriodElement
-     * </p>
-     *
-     * @param parentElement
-     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-     *            object.
-     * @param labelString
-     *            a {@link java.lang.String} object.
-     * @param timePeriod
-     *            a {@link eu.etaxonomy.cdm.model.common.VerbatimTimePeriod} object.
-     * @param style
-     *            a int.
-     * @return a {@link eu.etaxonomy.taxeditor.ui.element.VerbatimTimePeriodElement}
-     *         object.
      */
     public VerbatimTimePeriodElement createVerbatimTimePeriodElement(ICdmFormElement parentElement, String labelString,
             VerbatimTimePeriod timePeriod, int style) {
@@ -1349,24 +1392,8 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-
-
        /**
-        * <p>
         * createGatheringEventUnitElement
-        * </p>
-        *
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param labelString
-        *            a {@link java.lang.String} object.
-        * @param timePeriod
-        *            a {@link eu.etaxonomy.cdm.model.common.GatheringEvent} object.
-        * @param style
-        *            a int.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement}
-        *         object.
         */
        public GatheringEventUnitElement createGatheringEventUnitElement(
                        ICdmFormElement parentElement,
@@ -1386,18 +1413,7 @@ public class CdmFormFactory extends FormToolkit {
        }
 
     /**
-     * <p>
      * createPointElement
-     * </p>
-     *
-     * @param style
-     *            a int.
-     * @param parentElement
-     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-     *            object.
-     * @param point
-     *            a {@link eu.etaxonomy.cdm.model.location.Point} object.
-     * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
      */
     public PointElement createPointElement(ICdmFormElement parentElement, Point point, int style) {
         PointElement element = new PointElement(this, parentElement, point, style);
@@ -1787,23 +1803,45 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
+    public CharacterNodeDtoDetailSection createCharacterNodeDtoDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        CharacterNodeDtoDetailSection section = new CharacterNodeDtoDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
     public CharacterDetailSection createCharacterDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
         CharacterDetailSection section = new CharacterDetailSection(this, conversation, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
+    public CharacterDtoDetailSection createCharacterDtoDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        CharacterDtoDetailSection section = new CharacterDtoDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
     public CharacterNodeDetailElement createCharacterNodeDetailElement(ICdmFormElement parentElement, int style){
         CharacterNodeDetailElement element = new CharacterNodeDetailElement(this, parentElement);
         addAndAdaptElement(parentElement, element);
         return element;
     }
+    public CharacterNodeDtoDetailElement createCharacterNodeDtoDetailElement(ICdmFormElement parentElement, int style){
+        CharacterNodeDtoDetailElement element = new CharacterNodeDtoDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
 
     public CharacterDetailElement createCharacterDetailElement(ICdmFormElement parentElement, int style){
         CharacterDetailElement element = new CharacterDetailElement(this, parentElement);
         addAndAdaptElement(parentElement, element);
         return element;
     }
+    public CharacterDtoDetailElement createCharacterDtoDetailElement(ICdmFormElement parentElement, int style){
+        CharacterDtoDetailElement element = new CharacterDtoDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
 
     public FeatureTreeDetailElement createFeatureTreeDetailElement(ICdmFormElement parentElement, int style){
         FeatureTreeDetailElement element = new FeatureTreeDetailElement(this, parentElement);
@@ -1811,6 +1849,18 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
+    /**
+     * @param parentElement
+     * @param style
+     * @return
+     */
+    public AbstractCdmDetailElement<TermTree> createFeatureTreeDetailElementForTree(
+            AbstractCdmDetailSection<TermTree> parentElement, int style) {
+        FeatureTreeDetailElementForNode element = new FeatureTreeDetailElementForNode(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
     public FeatureNodeDetailElement createFeatureNodeDetailElement(ICdmFormElement parentElement, int style){
         FeatureNodeDetailElement element = new FeatureNodeDetailElement(this, parentElement);
         addAndAdaptElement(parentElement, element);
@@ -1836,6 +1886,11 @@ public class CdmFormFactory extends FormToolkit {
         addAndAdaptSection(parentElement, section);
         return section;
     }
+    public FeatureTreeDetailSectionForNode createFeatureTreeDetailSectionForTree(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        FeatureTreeDetailSectionForNode section = new FeatureTreeDetailSectionForNode(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
 
     public ReferenceDetailSection createReferenceDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
         ReferenceDetailSection section = new ReferenceDetailSection(this, conversation, parentElement, selectionProvider, style);
@@ -1855,6 +1910,18 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
+    public AdvancedSourceElement createAdvancedSourceDetailElement(ICdmFormElement parentElement, int style){
+        AdvancedSourceElement element = new AdvancedSourceElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public AdvancedSourceElement createAdvancedNomenclaturalSourceDetailElement(ICdmFormElement parentElement, int style){
+        AdvancedNomenclaturalSourceElement element = new AdvancedNomenclaturalSourceElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
     public SingleSourceSection createSingleSourceSection(ConversationHolder conversation, ICdmFormElement parentElement, CdmBase cdmEntity, ISelectionProvider selectionProvider, String label, int style){
         SingleSourceSection section = new SingleSourceSection(this, conversation, parentElement, cdmEntity, selectionProvider, style, label);
         addAndAdaptSection(parentElement, section);
@@ -2211,6 +2278,13 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
+
+    public NomenclaturalSourceElement createNomenclaturalSourceElement(ICdmFormElement parentElement, CdmBase cdmEntity, String label){
+        NomenclaturalSourceElement element = new NomenclaturalSourceElement(this, parentElement, cdmEntity, label);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
     public TaxonRelationshipDetailElement createTaxonRelationshipDetailElement(ICdmFormElement parentElement){
         TaxonRelationshipDetailElement element = new TaxonRelationshipDetailElement(this, parentElement);
         addAndAdaptElement(parentElement, element);
@@ -2351,8 +2425,8 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-    public ReferenceDetailElement createReferenceDetailElement(ICdmFormElement parentElement, int style, boolean isWizard){
-        ReferenceDetailElement element = new ReferenceDetailElement(this, parentElement, style, isWizard);
+    public ReferenceDetailElement createReferenceDetailElement(ICdmFormElement parentElement, int style){
+        ReferenceDetailElement element = new ReferenceDetailElement(this, parentElement, style);
         addAndAdaptElement(parentElement, element);
         return element;
     }
@@ -2536,6 +2610,18 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
+    public InapplicableIfEntityCollectionSectionForNode createInapplicableIfEntityCollectionSectionForNode(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        InapplicableIfEntityCollectionSectionForNode section = new InapplicableIfEntityCollectionSectionForNode(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public OnlyApplicableIfEntityCollectionSectionForNode createOnlyApplicableIfEntityCollectionSectionForNode(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        OnlyApplicableIfEntityCollectionSectionForNode section = new OnlyApplicableIfEntityCollectionSectionForNode(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
     public AnnotationSection createAnnotationSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
         AnnotationSection section = new AnnotationSection(this, conversation, parentElement, style);
         addAndAdaptSection(parentElement, section);
@@ -2612,13 +2698,19 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
-    public ProtologueSection createProtologueSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        ProtologueSection section = new ProtologueSection(this, conversation, parentElement, style);
+//    public ProtologueSection createProtologueSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+//        ProtologueSection section = new ProtologueSection(this, conversation, parentElement, style);
+//        addAndAdaptSection(parentElement, section);
+//        return section;
+//    }
+    public ExternalLinksSection createExternalLinksSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        ExternalLinksSection section = new ExternalLinksSection(this, conversation, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
-    public ExternalLinksSection createExternalLinksSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        ExternalLinksSection section = new ExternalLinksSection(this, conversation, parentElement, style);
+
+    public ExternalLinksSection createExternalLinksSection(ConversationHolder conversation, ICdmFormElement parentElement, String label, int style){
+        ExternalLinksSection section = new ExternalLinksSection(this, conversation, parentElement, label, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
@@ -2678,11 +2770,22 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
+    public StateVocabularyDtoCollectionSection createStateVocabulariesDtoSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        StateVocabularyDtoCollectionSection section = new StateVocabularyDtoCollectionSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
     public RecommendedModifierVocabulariesCollectionSection createRecommendedModifierVocabulariesCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
         RecommendedModifierVocabulariesCollectionSection section = new RecommendedModifierVocabulariesCollectionSection(this, conversation, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
+    public RecommendedModifierVocabulariesDtoCollectionSection createRecommendedModifierVocabulariesDtoCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        RecommendedModifierVocabulariesDtoCollectionSection section = new RecommendedModifierVocabulariesDtoCollectionSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
 
     public MeasurementUnitCollectionSection createMeasurementUnitCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
         MeasurementUnitCollectionSection section = new MeasurementUnitCollectionSection(this, conversation, parentElement, style);
@@ -2690,12 +2793,23 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
+    public MeasurementUnitDtoCollectionSection createMeasurementUnitDtoCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        MeasurementUnitDtoCollectionSection section = new MeasurementUnitDtoCollectionSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
     public StatisticalMeasureCollectionSection createStatisticalMeasureCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
         StatisticalMeasureCollectionSection section = new StatisticalMeasureCollectionSection(this, conversation, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
+    public StatisticalMeasureDtoCollectionSection createStatisticalMeasureDtoCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        StatisticalMeasureDtoCollectionSection section = new StatisticalMeasureDtoCollectionSection(this, conversation, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
     public CollectingAreasDetailSection createCollectingAreasDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
         CollectingAreasDetailSection section = new CollectingAreasDetailSection(this, conversation, parentElement, style);
         addAndAdaptSection(parentElement, section);
@@ -2804,7 +2918,6 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
-
     public AbstractEntityCollectionElement createEntityCollectionElement(AbstractFormSection parentElement,
             Object versionableEntity, SelectionListener removeListener, Color backgroundColor, int style) {
         AbstractEntityCollectionElement<?> element = null;
@@ -2952,9 +3065,9 @@ public class CdmFormFactory extends FormToolkit {
             // this is the special case for protologs, maybe we can do this
             // differently when API improves
             DescriptionElementBase descriptionElement = (DescriptionElementBase) entity;
-            if (descriptionElement.getFeature().equals(Feature.PROTOLOGUE())) {
-                element = new ProtologueElement(this, parentElement, descriptionElement, removeListener, style);
-            }
+//            if (descriptionElement.getFeature().equals(Feature.PROTOLOGUE())) {
+//                element = new ProtologueElement(this, parentElement, descriptionElement, removeListener, style);
+//            }
         } else if (entity instanceof Identifier) {
             if(parentElement instanceof AbstractSampleDesignationDetailSection){
                 element = new SampleDesignationTextDetailElement(this, parentElement, (Identifier<DnaSample>) entity, removeListener, backgroundColor, style);
@@ -2974,9 +3087,27 @@ public class CdmFormFactory extends FormToolkit {
             default:
                 break;
             }
-        } else if (entity instanceof MeasurementUnit) {
+        }else if (entity instanceof TermVocabularyDto) {
+            TermVocabularyDto termVocabulary = (TermVocabularyDto)entity;
+            switch (termVocabulary.getTermType()) {
+            case State:
+                element = new StateVocabularyDtoCollectionElement(this, parentElement, termVocabulary, removeListener, backgroundColor, style);
+                break;
+            case Modifier:
+                element = new RecommendedModifierDtoVocabulariesElement(this, parentElement, termVocabulary, removeListener, backgroundColor, style);
+                break;
+            default:
+                break;
+            }
+        }else if (entity instanceof MeasurementUnit) {
             element = new MeasurementUnitCollectionElement(this, parentElement, (MeasurementUnit) entity, removeListener, backgroundColor, style);
-        } else if (entity instanceof StatisticalMeasure) {
+        }else if (entity instanceof TermDto) {
+            if(((TermDto)entity).getTermType().equals(TermType.MeasurementUnit)){
+                element = new MeasurementUnitDtoCollectionElement(this, parentElement, (TermDto) entity, removeListener, backgroundColor, style);
+            }else if (((TermDto)entity).getTermType().equals(TermType.StatisticalMeasure)){
+                element = new StatisticalMeasureDtoCollectionElement(this, parentElement, (TermDto) entity, removeListener, backgroundColor, style);
+            }
+        }else if (entity instanceof StatisticalMeasure) {
             element = new StatisticalMeasureCollectionElement(this, parentElement, (StatisticalMeasure) entity, removeListener, backgroundColor, style);
         } else if (entity instanceof FeatureState && parentElement instanceof InapplicableIfEntityCollectionSection) {
             element = new InapplicableIfCollectionElement(this, parentElement, (FeatureState) entity, removeListener, backgroundColor, style);
@@ -3391,6 +3522,8 @@ public class CdmFormFactory extends FormToolkit {
     }
 
 
+
+
 //     public RichTextWithLabelElement createRichTextLabelElement(ICdmFormElement parentElement, String labelString, String initialText, int textHeight, int style) {
 //              RichTextWithLabelElement element = new RichTextWithLabelElement(this, parentElement, labelString,
 //                              initialText, textHeight, style);