Class DataCollectionComboboxToSelectionNodeConverter
java.lang.Object
overit.geocallapp.wfm.core.bl.datacollection.converter.template.structure.node.DataCollectionNodeConverter
overit.geocallapp.wfm.core.bl.datacollection.converter.template.structure.node.DataCollectionComboboxToSelectionNodeConverter
- Direct Known Subclasses:
DataCollectionBooleanToSelectionNodeConverter,DataCollectionMultiSelectToMultiSelectionNodeConverter,DataCollectionTableToSelectionNodeConverter
Convert a node old Combobox node to a new Selection node.
In old DCS implementation the Yes/No (Boolean) node was defined by the
ADTNID_LDDT = 4
and was represented by a ComboBox with Yes and No values pre-valorized.
We have chosen to convert the Boolean node into a Selection node because we don’t want to lose any additional data
the user may have added.- Since:
- 13.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DataCollectionNodeConversionResultconvertBody(overit.geocallapp.wfm.survey.template.TemplateTree currentNode, DataCollectionNodeConversionResult conversionResult) Contains the logic to convert a Combobox node into aDataCollectionNodeSelection.protected List<DataCollectionNodeSelectionOption> getDataCollectionNodeSelectionOptions(overit.geocallapp.wfm.survey.template.TemplateTree currentNode) Returns a List ofDataCollectionNodeSelectionOptioncomposing the new options of the Selection node.getDescriptionLangMap(overit.geocallapp.wfm.survey.template.TemplateTree currentNode, String fieldName) Returns the mapping between language and the list of option's description.protected DataCollectionNodeSelectionReturns the instance ofDataCollectionNodeSelection.protected voidsetInitialValue(DataCollectionNode newNode, HashGetter data) Contains the logic to transform the old default value into the new initial value.Methods inherited from class overit.geocallapp.wfm.core.bl.datacollection.converter.template.structure.node.DataCollectionNodeConverter
convert, getDataCollectionNodeConversionResult, getLocalizedField, getLocalizedField, getStackTrace, initNode, loadDefaultFields
-
Constructor Details
-
DataCollectionComboboxToSelectionNodeConverter
public DataCollectionComboboxToSelectionNodeConverter()
-
-
Method Details
-
convertBody
protected DataCollectionNodeConversionResult convertBody(overit.geocallapp.wfm.survey.template.TemplateTree currentNode, DataCollectionNodeConversionResult conversionResult) throws DataCollectionInitialValueException Contains the logic to convert a Combobox node into aDataCollectionNodeSelection.- Specified by:
convertBodyin classDataCollectionNodeConverter- Parameters:
currentNode- the old nodeconversionResult- theDataCollectionNodeConversionResultto populate- Returns:
- the conversion result
DataCollectionNodeConversionResult - Throws:
DataCollectionInitialValueException
-
setInitialValue
Contains the logic to transform the old default value into the new initial value. If no default value where present this method does nothing.- Specified by:
setInitialValuein classDataCollectionNodeConverter- Parameters:
newNode- the new nodedata- old node data
-
getDataCollectionNodeSelectionOptions
protected List<DataCollectionNodeSelectionOption> getDataCollectionNodeSelectionOptions(overit.geocallapp.wfm.survey.template.TemplateTree currentNode) Returns a List ofDataCollectionNodeSelectionOptioncomposing the new options of the Selection node.- Parameters:
currentNode- the old node- Returns:
- the list of options
-
getNodeType
Returns the instance ofDataCollectionNodeSelection.- Returns:
- the instance of
DataCollectionNodeSelection.
-
getDescriptionLangMap
protected Map<Lang,String[]> getDescriptionLangMap(overit.geocallapp.wfm.survey.template.TemplateTree currentNode, String fieldName) Returns the mapping between language and the list of option's description.- Parameters:
currentNode- the old nodefieldName- the name of the option field- Returns:
- a map language/description
-