Class ExcelClassificationMediaTranslator
- java.lang.Object
-
- com.hybris.backoffice.excel.translators.classification.AbstractClassificationAttributeTranslator
-
- com.hybris.backoffice.excel.translators.classification.ExcelClassificationMediaTranslator
-
- All Implemented Interfaces:
ExcelAttributeTranslator<ExcelClassificationAttribute>,org.springframework.core.Ordered
public class ExcelClassificationMediaTranslator extends AbstractClassificationAttributeTranslator
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringMEDIA_CONTENT_HEADER_NAMEstatic java.lang.StringPARAM_CODEstatic java.lang.StringPARAM_FILE_PATHstatic java.lang.StringPARAM_FOLDER-
Fields inherited from class com.hybris.backoffice.excel.translators.classification.AbstractClassificationAttributeTranslator
COMPLEX_TYPE_WITH_UNITS_REFERENCE_FORMAT, SIMPLE_TYPE_WITH_UNITS_REFERENCE_FORMAT, VALUE_WITH_UNITS_FORMAT
-
-
Constructor Summary
Constructors Constructor Description ExcelClassificationMediaTranslator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanHandleAttribute(ExcelClassificationAttribute excelClassificationAttribute)protected java.lang.StringcatalogVersionData(java.util.Map<java.lang.String,java.lang.String> params)protected ImpexHeaderValuecreateMediaCatalogVersionHeader()protected ImpexHeaderValuecreateMediaCodeHeader()protected ImpexHeaderValuecreateMediaContentHeader()protected ImpexHeaderValuecreateMediaFolderHeader()protected ImpexHeaderValuecreateMediaHeader(ExcelClassificationAttribute attribute)protected java.util.Map<ImpexHeaderValue,java.lang.Object>createMediaRow(java.util.Map<java.lang.String,java.lang.String> params)protected java.lang.StringcreateMediaValue(java.util.Map<java.lang.String,java.lang.String> params)protected java.lang.StringexportCatalogVersionData(CatalogVersionModel objectToExport)java.util.Optional<java.lang.String>exportSingle(ExcelClassificationAttribute excelAttribute, FeatureValue featureToExport)protected java.lang.StringgetCode(java.util.Map<java.lang.String,java.lang.String> params)intgetOrder()protected booleanhasImportData(java.util.Map<java.lang.String,java.lang.String> singleParams)ImpeximportData(ExcelAttribute excelAttribute, ImportParameters importParameters, ExcelImportContext excelImportContext)Imports data based on provided importParameters for given excel attribute.protected ImpexValueimportSingle(ExcelClassificationAttribute excelAttribute, ImportParameters importParameters, ExcelImportContext excelImportContext)voidsetExportUrl(boolean exportUrl)voidsetMediaCodeGenerator(KeyGenerator mediaCodeGenerator)voidsetMediaFolderProvider(MediaFolderProvider mediaFolderProvider)voidsetOrder(int order)voidsetTypeService(TypeService typeService)java.lang.StringsingleReferenceFormat(ExcelClassificationAttribute excelAttribute)-
Methods inherited from class com.hybris.backoffice.excel.translators.classification.AbstractClassificationAttributeTranslator
canHandle, canHandleRange, canHandleUnit, exportData, exportWithUnit, getClassificationAttributeHeaderValueCreator, getClassificationService, getClassificationSystemService, getCommonI18NService, getExcelParserSplitter, getFeatureValues, getLocalizedFeatureValues, getPartitionedData, getStreamOfValuesToJoin, getUnlocalizedFeatureValues, importValue, referenceFormat, setClassificationAttributeHeaderValueCreator, setClassificationService, setClassificationSystemService, setCommonI18NService, setExcelParserSplitter
-
-
-
-
Field Detail
-
PARAM_FILE_PATH
public static final java.lang.String PARAM_FILE_PATH
- See Also:
- Constant Field Values
-
PARAM_FOLDER
public static final java.lang.String PARAM_FOLDER
- See Also:
- Constant Field Values
-
PARAM_CODE
public static final java.lang.String PARAM_CODE
- See Also:
- Constant Field Values
-
MEDIA_CONTENT_HEADER_NAME
protected static final java.lang.String MEDIA_CONTENT_HEADER_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
canHandleAttribute
public boolean canHandleAttribute(ExcelClassificationAttribute excelClassificationAttribute)
- Specified by:
canHandleAttributein classAbstractClassificationAttributeTranslator
-
singleReferenceFormat
public java.lang.String singleReferenceFormat(ExcelClassificationAttribute excelAttribute)
- Specified by:
singleReferenceFormatin classAbstractClassificationAttributeTranslator
-
exportSingle
public java.util.Optional<java.lang.String> exportSingle(ExcelClassificationAttribute excelAttribute, FeatureValue featureToExport)
- Specified by:
exportSinglein classAbstractClassificationAttributeTranslator
-
exportCatalogVersionData
protected java.lang.String exportCatalogVersionData(CatalogVersionModel objectToExport)
-
importData
public Impex importData(ExcelAttribute excelAttribute, ImportParameters importParameters, ExcelImportContext excelImportContext)
Description copied from interface:ExcelAttributeTranslatorImports data based on provided importParameters for given excel attribute. The method returnsImpexthanks to that it is possible to creating additional entries ( or example creating part-of entries: product - price row, ect.)- Specified by:
importDatain interfaceExcelAttributeTranslator<ExcelClassificationAttribute>- Overrides:
importDatain classAbstractClassificationAttributeTranslator- Parameters:
excelAttribute- describes attribute which should be importedimportParameters- contains information about language for localized field, type code, parsed parameters inserted into excel's cell.excelImportContext- excel's context- Returns:
Impexobject which is representation of impex script.
-
hasImportData
protected boolean hasImportData(java.util.Map<java.lang.String,java.lang.String> singleParams)
-
createMediaRow
protected java.util.Map<ImpexHeaderValue,java.lang.Object> createMediaRow(java.util.Map<java.lang.String,java.lang.String> params)
-
createMediaCodeHeader
protected ImpexHeaderValue createMediaCodeHeader()
-
getCode
protected java.lang.String getCode(java.util.Map<java.lang.String,java.lang.String> params)
-
createMediaCatalogVersionHeader
protected ImpexHeaderValue createMediaCatalogVersionHeader()
-
catalogVersionData
protected java.lang.String catalogVersionData(java.util.Map<java.lang.String,java.lang.String> params)
-
createMediaFolderHeader
protected ImpexHeaderValue createMediaFolderHeader()
-
createMediaContentHeader
protected ImpexHeaderValue createMediaContentHeader()
-
createMediaValue
protected java.lang.String createMediaValue(java.util.Map<java.lang.String,java.lang.String> params)
-
createMediaHeader
protected ImpexHeaderValue createMediaHeader(ExcelClassificationAttribute attribute)
-
importSingle
@Nullable protected ImpexValue importSingle(@Nonnull ExcelClassificationAttribute excelAttribute, @Nonnull ImportParameters importParameters, @Nonnull ExcelImportContext excelImportContext)
- Specified by:
importSinglein classAbstractClassificationAttributeTranslator
-
setTypeService
public void setTypeService(TypeService typeService)
-
setMediaCodeGenerator
public void setMediaCodeGenerator(KeyGenerator mediaCodeGenerator)
-
setMediaFolderProvider
public void setMediaFolderProvider(MediaFolderProvider mediaFolderProvider)
-
getOrder
public int getOrder()
-
setOrder
public void setOrder(int order)
-
setExportUrl
public void setExportUrl(boolean exportUrl)
-
-