Class GenericImporterActionServiceImpl
java.lang.Object
ch.tocco.nice2.entityoperation.impl.action.GenericImporterActionServiceImpl
- All Implemented Interfaces:
GenericImporterActionService
,GenericImporterService
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.entityoperation.api.GenericImporterActionService
GenericImporterActionService.ColumnModelFieldType, GenericImporterActionService.FormData
Nested classes/interfaces inherited from interface ch.tocco.nice2.entityoperation.api.GenericImporterService
GenericImporterService.ColumnModel, GenericImporterService.RelationData
-
Field Summary
Fields inherited from interface ch.tocco.nice2.entityoperation.api.GenericImporterActionService
IMPORT_MODE_CREATE, IMPORT_MODE_CREATE_OR_UPDATE, IMPORT_MODE_UPDATE
-
Constructor Summary
ConstructorDescriptionGenericImporterActionServiceImpl
(Context context, org.slf4j.Logger log, NiceDataModel dataModel, TextResources textResources, TaskSchedulingService taskSchedulingService, BusinessUnitManager businessUnitManager, GenericImportValidator genericImportValidator, ColumnModelService columnModelService, GenericImporterReportService reportService) -
Method Summary
Modifier and TypeMethodDescriptionconvertAndValidateValue
(org.apache.poi.ss.usermodel.Cell cell, GenericImporterService.ColumnModel columnModel, int rowNumber, String firstColumnValue, GenericImporterValidateResult validateResult, ImportConverterService importConverterService) void
doImport
(String mainEntityName, String importMode, String filePath, boolean cancel, Integer splitSize) exportErrors
(String filePath) void
handleValidationResult
(GenericImporterValidateResult validateResult, String column, AbstractValidationResult validationResult, int rowNumber, String firstColumnValue, Object validatedValue) loadEntities
(String queryString, int start, int limit) validateHeader
(GenericImporterValidateResult validateResult, org.apache.poi.ss.usermodel.Sheet importSheet, EntityModel mainEntityModel)
-
Constructor Details
-
GenericImporterActionServiceImpl
public GenericImporterActionServiceImpl(Context context, org.slf4j.Logger log, NiceDataModel dataModel, TextResources textResources, TaskSchedulingService taskSchedulingService, BusinessUnitManager businessUnitManager, GenericImportValidator genericImportValidator, ColumnModelService columnModelService, GenericImporterReportService reportService)
-
-
Method Details
-
validate
public GenericImporterValidateResult validate(GenericImporterActionService.FormData formData) throws GenericImporterException - Specified by:
validate
in interfaceGenericImporterActionService
- Throws:
GenericImporterException
-
doImport
public void doImport(String mainEntityName, String importMode, String filePath, boolean cancel, Integer splitSize) throws GenericImporterException - Specified by:
doImport
in interfaceGenericImporterActionService
- Throws:
GenericImporterException
-
exportErrors
- Specified by:
exportErrors
in interfaceGenericImporterActionService
-
loadEntities
public JsonReaderResponse<Map<String,Object>> loadEntities(String queryString, int start, int limit) throws PersistException - Specified by:
loadEntities
in interfaceGenericImporterActionService
- Throws:
PersistException
-
handleValidationResult
public void handleValidationResult(GenericImporterValidateResult validateResult, String column, AbstractValidationResult validationResult, int rowNumber, String firstColumnValue, Object validatedValue) - Specified by:
handleValidationResult
in interfaceGenericImporterService
-
validateHeader
public List<GenericImporterService.ColumnModel> validateHeader(GenericImporterValidateResult validateResult, org.apache.poi.ss.usermodel.Sheet importSheet, EntityModel mainEntityModel) throws IOException - Specified by:
validateHeader
in interfaceGenericImporterService
- Throws:
IOException
-
convertAndValidateValue
public Object convertAndValidateValue(org.apache.poi.ss.usermodel.Cell cell, GenericImporterService.ColumnModel columnModel, int rowNumber, String firstColumnValue, GenericImporterValidateResult validateResult, ImportConverterService importConverterService) - Specified by:
convertAndValidateValue
in interfaceGenericImporterService
-