cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to use the existing Excel Import Action to Import price rows?

Former Member
0 Likes
1,359

How to use the existing Excel Import backoffice action to Import price rows via xlsx?

Accepted Solutions (1)

Accepted Solutions (1)

former_member638520
Contributor
0 Likes

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

Former Member
0 Likes

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??

former_member638520
Contributor
0 Likes

Hi,

Will it Import the price row If i add this action to price row list view actions ?

Yes

Can I insert any columns(attributes) in xlsx?

You can select only attributes which are supported (if there is reference, then appropriate excel translator will be required)

How will it identify the attributes and convert this to impex?

Check documentation about backoffice excel export/import Regards Lukasz
Former Member
0 Likes

Need to know how an attribute is defined as supported? Didn't find any documentation ,Found DefaultExcelTemplateService getSelectedAttributeQualifiers method returning SelectedAttributeQualifier.qualifier as null.

former_member638520
Contributor
0 Likes

Hi,

Each translator has canHandle method. You can easily check whether attribute is supported by invoking ExcelTranslatorRegistry.canHandle(attributeDescriptor)

Regards

Lukasz

Former Member
0 Likes

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.

Former Member
0 Likes

Where is the typesystemsheet located ?

Answers (0)