on ‎2018 May 09 10:11 AM
How to use the existing Excel Import backoffice action to Import price rows via xlsx?
Request clarification before answering.
Hi,
You need to add the following cockpit configuration:
<context type="PriceRow" component="listviewactions" merge-by="type">
<y:actions>
<y:extended-group qualifier="export" show-group-header="false">
<y:action action-id="com.hybris.backoffice.widgets.actions.excel.export" property="pageable.typeCode">
<y:parameter>
<y:name>actionName</y:name>
<y:value>label.export.excel</y:value>
</y:parameter>
</y:action>
<y:action action-id="com.hybris.backoffice.widgets.actions.excel.exporttemplate" property="pageable.typeCode">
<y:parameter>
<y:name>actionName</y:name>
<y:value>label.export.exceltemplate</y:value>
</y:parameter>
</y:action>
<y:extended-action action-id="com.hybris.backoffice.widgets.actions.excel.export"/>
</y:extended-group>
<y:group qualifier="import" show-group-header="false">
<y:action action-id="com.hybris.backoffice.widgets.actions.excel.import" property="pageable.typeCode">
<y:parameter>
<y:name>actionName</y:name>
<y:value>label.import.excel</y:value>
</y:parameter>
</y:action>
</y:group>
</y:actions>
</context>
But be aware that if PriceRow consists of some references then implementation of custom translators will be required. See: https://help.hybris.com/6.7.0/hcd/70240af7af8a4bb29573c86f90d17527.html#loio70240af7af8a4bb29573c86f...
Regards,
Lukasz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lukasz,
Thanks for the reply. Will it Import the price row If i add this action to price row list view actions ? Can I insert any columns(attributes) in xlsx? How will it identify the attributes and convert this to impex?
So for e.g PriceRow has unit as mandatory attribute does that mean to import that do I need to write an translator like e.g. ExcelPriceRowUnitTranslator??
Hi,
YesWill it Import the price row If i add this action to price row list view actions ?
You can select only attributes which are supported (if there is reference, then appropriate excel translator will be required)Can I insert any columns(attributes) in xlsx?
Check documentation about backoffice excel export/import Regards LukaszHow will it identify the attributes and convert this to impex?
Hi Lukasz, Thanks for responding immediately, I wrote a custom translator(ExcelUnitTypeTranslator) too, but before the control goes to the registry and respective translator it is throwing an error in this class :
WorkBookTypeCodeAndSelectedAttributeValidator.class.
It says attribute Unit not found for type PriceRow . while I drilled down further found that DefaultExcelTemplateService.getSelectedAttributeQualifiers method returns List which contains name and Qualifier.
name is returning as Unit, but qualifier is null. but for other attributes such as scale and price it is working.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.