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.String
MEDIA_CONTENT_HEADER_NAME
static java.lang.String
PARAM_CODE
static java.lang.String
PARAM_FILE_PATH
static java.lang.String
PARAM_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 boolean
canHandleAttribute(ExcelClassificationAttribute excelClassificationAttribute)
protected java.lang.String
catalogVersionData(java.util.Map<java.lang.String,java.lang.String> params)
protected ImpexHeaderValue
createMediaCatalogVersionHeader()
protected ImpexHeaderValue
createMediaCodeHeader()
protected ImpexHeaderValue
createMediaContentHeader()
protected ImpexHeaderValue
createMediaFolderHeader()
protected ImpexHeaderValue
createMediaHeader(ExcelClassificationAttribute attribute)
protected java.util.Map<ImpexHeaderValue,java.lang.Object>
createMediaRow(java.util.Map<java.lang.String,java.lang.String> params)
protected java.lang.String
createMediaValue(java.util.Map<java.lang.String,java.lang.String> params)
protected java.lang.String
exportCatalogVersionData(CatalogVersionModel objectToExport)
java.util.Optional<java.lang.String>
exportSingle(ExcelClassificationAttribute excelAttribute, FeatureValue featureToExport)
protected java.lang.String
getCode(java.util.Map<java.lang.String,java.lang.String> params)
int
getOrder()
protected boolean
hasImportData(java.util.Map<java.lang.String,java.lang.String> singleParams)
Impex
importData(ExcelAttribute excelAttribute, ImportParameters importParameters, ExcelImportContext excelImportContext)
Imports data based on provided importParameters for given excel attribute.protected ImpexValue
importSingle(ExcelClassificationAttribute excelAttribute, ImportParameters importParameters, ExcelImportContext excelImportContext)
void
setExportUrl(boolean exportUrl)
void
setMediaCodeGenerator(KeyGenerator mediaCodeGenerator)
void
setMediaFolderProvider(MediaFolderProvider mediaFolderProvider)
void
setOrder(int order)
void
setTypeService(TypeService typeService)
java.lang.String
singleReferenceFormat(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:
canHandleAttribute
in classAbstractClassificationAttributeTranslator
-
singleReferenceFormat
public java.lang.String singleReferenceFormat(ExcelClassificationAttribute excelAttribute)
- Specified by:
singleReferenceFormat
in classAbstractClassificationAttributeTranslator
-
exportSingle
public java.util.Optional<java.lang.String> exportSingle(ExcelClassificationAttribute excelAttribute, FeatureValue featureToExport)
- Specified by:
exportSingle
in classAbstractClassificationAttributeTranslator
-
exportCatalogVersionData
protected java.lang.String exportCatalogVersionData(CatalogVersionModel objectToExport)
-
importData
public Impex importData(ExcelAttribute excelAttribute, ImportParameters importParameters, ExcelImportContext excelImportContext)
Description copied from interface:ExcelAttributeTranslator
Imports data based on provided importParameters for given excel attribute. The method returnsImpex
thanks to that it is possible to creating additional entries ( or example creating part-of entries: product - price row, ect.)- Specified by:
importData
in interfaceExcelAttributeTranslator<ExcelClassificationAttribute>
- Overrides:
importData
in 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:
Impex
object 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:
importSingle
in 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)
-
-