Class DataCollectionNodeConverter
java.lang.Object
overit.geocallapp.wfm.core.bl.datacollection.converter.template.structure.node.DataCollectionNodeConverter
- Direct Known Subclasses:
DataCollectionAttachmentToAttachmentNodeConverter,DataCollectionBarcodeToBarcodeNodeConverter,DataCollectionBooleanToBooleanNodeConverter,DataCollectionComboboxToSelectionNodeConverter,DataCollectionCoordinatesToCoordinateNodeConverter,DataCollectionDateToDateNodeConverter,DataCollectionDiscardNodeConverter,DataCollectionDoubleToDoubleNodeConverter,DataCollectionEuroToDoubleNodeConverter,DataCollectionNodeToSectionNodeConverter,DataCollectionNumberToLongNodeConverter,DataCollectionOptionalNodeToSectionNodeConverter,DataCollectionPersonalizedFormatToRegExNodeConverter,DataCollectionQuestionsGroupToSectionNodeConverter,DataCollectionSignatureToSignatureNodeConverter,DataCollectionTimeToTimeNodeConverter,DataCollectionVarcharToTextNodeConverter
This class is the base for the node converters. It manages the
All node converter are added to the
This is the class to extend to build a custom Node Converter.
DataCollectionNodeProperties and
the mandatory field of DataCollectionNodeExpressions.All node converter are added to the
DataCollectionNodeConverterBucket and associated to
the node type they convert. This is the class to extend to build a custom Node Converter.
- Since:
- 13.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvert(overit.geocallapp.wfm.survey.template.TemplateTree currentNode) Main method to call to convert an oldTemplateTreeinto a newDataCollectionNode.protected abstract DataCollectionNodeConversionResultconvertBody(overit.geocallapp.wfm.survey.template.TemplateTree currentNode, DataCollectionNodeConversionResult conversionResult) Contains the logic to convert specific node characteristics.protected DataCollectionNodeConversionResultGet theDataCollectionNodeConversionResultstarting from the newNode.protected LocalizedStringgetLocalizedField(String description) Create aLocalizedStringstarting from input stringprotected LocalizedStringgetLocalizedField(overit.geocallapp.wfm.survey.template.TemplateTree currentNode, String fieldName, String code) Create aLocalizedStringcopying old values divided by language.protected StringConvert an exception to a string.protected DataCollectionNodeinitNode(overit.geocallapp.wfm.survey.template.TemplateTree currentNode, DataCollectionNodeConversionResult conversionResult) Initialize the new node withDataCollectionNodePropertiesand mandatory and initial value fields ofDataCollectionNodeExpressions.protected voidloadDefaultFields(overit.geocallapp.wfm.survey.template.TemplateTree currentNode, StringBuilder sbNote) Add the Value class, Value, Feature class and Featurevalues to the notes.protected abstract voidsetInitialValue(DataCollectionNode newNode, HashGetter data) Contains the logic to transform the old default value into the new initial value.
-
Constructor Details
-
DataCollectionNodeConverter
public DataCollectionNodeConverter()
-
-
Method Details
-
convertBody
protected abstract DataCollectionNodeConversionResult convertBody(overit.geocallapp.wfm.survey.template.TemplateTree currentNode, DataCollectionNodeConversionResult conversionResult) throws DataCollectionInitialValueException Contains the logic to convert specific node characteristics.- 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.- Parameters:
newNode- the new nodedata- old node data
-
convert
public DataCollectionNodeConversionResult convert(overit.geocallapp.wfm.survey.template.TemplateTree currentNode) Main method to call to convert an oldTemplateTreeinto a newDataCollectionNode.- Parameters:
currentNode- the old node- Returns:
- the conversion result
-
initNode
protected DataCollectionNode initNode(overit.geocallapp.wfm.survey.template.TemplateTree currentNode, DataCollectionNodeConversionResult conversionResult) throws DataCollectionInitialValueException Initialize the new node withDataCollectionNodePropertiesand mandatory and initial value fields ofDataCollectionNodeExpressions.- Parameters:
currentNode- the old nodeconversionResult- the conversion result- Returns:
- the new node with the base value
- Throws:
DataCollectionInitialValueException
-
getLocalizedField
Create aLocalizedStringstarting from input string- Parameters:
description-- Returns:
- a LocalizedString object
-
getLocalizedField
protected LocalizedString getLocalizedField(overit.geocallapp.wfm.survey.template.TemplateTree currentNode, String fieldName, String code) Create aLocalizedStringcopying old values divided by language.- Parameters:
currentNode- the old nodefieldName- the field to copy fromcode- the node's code- Returns:
- the
LocalizedStringdescription
-
getStackTrace
Convert an exception to a string.- Parameters:
e- the exception- Returns:
- the sting representation of the exception
-
getDataCollectionNodeConversionResult
protected DataCollectionNodeConversionResult getDataCollectionNodeConversionResult(DataCollectionNode newNode) Get theDataCollectionNodeConversionResultstarting from the newNode.- Parameters:
newNode- the new node- Returns:
- the conversion result
-
loadDefaultFields
protected void loadDefaultFields(overit.geocallapp.wfm.survey.template.TemplateTree currentNode, StringBuilder sbNote) Add the Value class, Value, Feature class and Featurevalues to the notes.- Parameters:
currentNode- the old nodesbNote- the note
-