Class ExcelMediaImportValidator
java.lang.Object
com.hybris.backoffice.excel.validators.ExcelMediaImportValidator
- All Implemented Interfaces:
ExcelSingleMediaValidator,ExcelValidator
- Direct Known Subclasses:
ExcelMediaCollectionImportValidator,ExcelMediaFilenameExtensionValidator
Validator which checks if media import data is correct. Checks:
- if at least one
AbstractExcelMediaImportTranslator.PARAM_FILE_PATHorAbstractExcelMediaImportTranslator.PARAM_CODEis defined - if given
AbstractExcelMediaImportTranslator.PARAM_FILE_PATHexists in uploaded content - if there is only one reference defined
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected TypeServicestatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface com.hybris.backoffice.excel.validators.ExcelValidator
CTX_MEDIA_CONTENT_ENTRIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanHandle(ImportParameters importParameters, AttributeDescriptorModel attributeDescriptor) Indicates whether given validator can handle a cell based on attribute descriptor and import parameters.Deprecated, for removal: This API element is subject to removal in a future version.since 1808, not used anymoreprotected booleanhasImportData(ImportParameters importParameters) voidsetImportService(ExcelImportService importService) Deprecated, for removal: This API element is subject to removal in a future version.since 1808, not used anymorevoidsetTypeService(TypeService typeService) validate(ImportParameters importParameters, AttributeDescriptorModel attributeDescriptor, Map<String, Object> context) Validates given cell and returns validation result.Allows to validate single media.
-
Field Details
-
VALIDATION_DECLARED_MULTIPLE_REFERENCES
- See Also:
-
VALIDATION_PATH_AND_CODE_EMPTY
- See Also:
-
VALIDATION_MISSING_FILE_IN_ZIP
- See Also:
-
VALIDATION_MISSING_ZIP
- See Also:
-
typeService
-
-
Constructor Details
-
ExcelMediaImportValidator
public ExcelMediaImportValidator()
-
-
Method Details
-
canHandle
public boolean canHandle(ImportParameters importParameters, AttributeDescriptorModel attributeDescriptor) Description copied from interface:ExcelValidatorIndicates whether given validator can handle a cell based on attribute descriptor and import parameters.- Specified by:
canHandlein interfaceExcelValidator- Returns:
- boolean whether validator can handle the cell.
-
hasImportData
-
validate
public ExcelValidationResult validate(ImportParameters importParameters, AttributeDescriptorModel attributeDescriptor, Map<String, Object> context) Description copied from interface:ExcelValidatorValidates given cell and returns validation result. If cell doesn't have validation issues thenExcelValidationResult.SUCCESSshould be returned.- Specified by:
validatein interfaceExcelValidatorcontext- - map which can be used as a cache. The map is shared between all request for given excel sheet.- Returns:
ExcelValidationResult
-
validateSingleValue
public List<ValidationMessage> validateSingleValue(Map<String, Object> context, Map<String, String> parameters) Description copied from interface:ExcelSingleMediaValidatorAllows to validate single media.- Specified by:
validateSingleValuein interfaceExcelSingleMediaValidator- Parameters:
context- which allows to hold information about the file.parameters- values of excel's cell.- Returns:
- the collection of errors. If media has no errors, then the empty collection should be returned.
-
getTypeService
-
setTypeService
-
getImportService
Deprecated, for removal: This API element is subject to removal in a future version.since 1808, not used anymore -
setImportService
@Deprecated(since="1808", forRemoval=true) public void setImportService(ExcelImportService importService) Deprecated, for removal: This API element is subject to removal in a future version.since 1808, not used anymore
-