Class DataCollectionTemplateStructureConverter
java.lang.Object
overit.geocallapp.wfm.core.bl.datacollection.converter.DataCollectionBaseConverter<BODataCollectionTemplateVersionConversion,DataCollectionTemplateVersionConversionInsertEvent>
overit.geocallapp.wfm.core.bl.datacollection.converter.DataCollectionSubConverter<BODataCollectionTemplateVersionConversion,DataCollectionTemplateVersionConversionInsertEvent,DataCollectionTemplateStructureConversionResult>
overit.geocallapp.wfm.core.bl.datacollection.converter.template.structure.DataCollectionTemplateStructureConverter
public class DataCollectionTemplateStructureConverter
extends DataCollectionSubConverter<BODataCollectionTemplateVersionConversion,DataCollectionTemplateVersionConversionInsertEvent,DataCollectionTemplateStructureConversionResult>
This class convert all old template versions to new template structure.
- Since:
- 13.0
- GCApi:
- bo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataCollectionOutcomeReasonConverterprotected DataCollectionPdfFileConverterprotected Dateprotected DataCollectionSheetScopeConverterprotected LongFields inherited from class overit.geocallapp.wfm.core.bl.datacollection.converter.DataCollectionBaseConverter
CONNECTION_POOL_NAME, logger, teacherDuty -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvert(PoolKit poolKit, overit.geocallapp.wfm.survey.template.TemplateTree oldTemplateTree, DataCollectionTemplate newTemplate) Convert all template versions.convertTemplateStructure(PoolKit poolKit, overit.geocallapp.wfm.survey.template.TemplateTree oldTemplateTree, DataCollectionTemplate newTemplate, HashGetter rowMap, Long rootNodeId, boolean isLastRelease, boolean isFirstStructure) Convert the specified template version.protected DateinitPreviousStartDate(DBView versionsDbView) Calculate the structure start date.protected LongloadTemplateType(PoolKit poolKit, overit.geocallapp.wfm.survey.template.TemplateTree oldTemplateTree) Load old template type.voidsetLogger(overit.geocallapp.wfm.util.wfmtasklog.WfmTaskLog logger) Sets the class used to log.Methods inherited from class overit.geocallapp.wfm.core.bl.datacollection.converter.DataCollectionBaseConverter
commit, getLocalizedDescription, getTeacher, insertConversionResult, rollback
-
Field Details
-
sheetScopeConverter
-
pdfFileConverter
-
outcomeReasonConverter
-
workingCopyId
-
previousStartDate
-
-
Constructor Details
-
DataCollectionTemplateStructureConverter
public DataCollectionTemplateStructureConverter()
-
-
Method Details
-
convert
public List<DataCollectionTemplateStructureConversionResult> convert(PoolKit poolKit, overit.geocallapp.wfm.survey.template.TemplateTree oldTemplateTree, DataCollectionTemplate newTemplate) throws DAException, DAValidateException Convert all template versions.- Specified by:
convertin classDataCollectionSubConverter<BODataCollectionTemplateVersionConversion,DataCollectionTemplateVersionConversionInsertEvent, DataCollectionTemplateStructureConversionResult> - Parameters:
poolKit- the PoolKitoldTemplateTree- old templatenewTemplate- new template- Returns:
- a result list of
DataCollectionTemplateStructureConversionResult - Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception- See Also:
-
convertTemplateStructure
protected DataCollectionTemplateStructureConversionResult convertTemplateStructure(PoolKit poolKit, overit.geocallapp.wfm.survey.template.TemplateTree oldTemplateTree, DataCollectionTemplate newTemplate, HashGetter rowMap, Long rootNodeId, boolean isLastRelease, boolean isFirstStructure) throws DAValidateException, DAException Convert the specified template version.- Parameters:
poolKit- thePoolKitoldTemplateTree- the old templatenewTemplate- the new templaterowMap- old structure datarootNodeId- old node root idisLastRelease- specifies whether it is the last releaseisFirstStructure- specifies whether it is the first version- Returns:
- the
DataCollectionTemplateStructureConversionResult - Throws:
DAValidateExceptionDAException
-
initPreviousStartDate
Calculate the structure start date.- Parameters:
versionsDbView- theDBViewcontaining old template structure data- Returns:
- the start date
-
loadTemplateType
protected Long loadTemplateType(PoolKit poolKit, overit.geocallapp.wfm.survey.template.TemplateTree oldTemplateTree) throws DAException, DAValidateException Load old template type.- Parameters:
poolKit- thePoolKitoldTemplateTree- the old template- Returns:
- the old template type id
- Throws:
DAExceptionDAValidateException
-
setLogger
public void setLogger(overit.geocallapp.wfm.util.wfmtasklog.WfmTaskLog logger) Sets the class used to log.- Overrides:
setLoggerin classDataCollectionBaseConverter<BODataCollectionTemplateVersionConversion,DataCollectionTemplateVersionConversionInsertEvent> - Parameters:
logger- the logger
-