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

How to import only en impex during system update in Hybris

Former Member
0 Likes
1,499

I did system update only with Create essential data checkbox selected. I noticed there are many impex get imported. For example essential-data.impex, essential-data_en.impex, essential-data_de.impex, essential-data_ch.impex ja, br etc. Nearly 7 different language specific impex are get imported. But I wanted to import only en version of it and other I don't want to import. Could you please suggest me how to achieve this. Thank you.

Accepted Solutions (0)

Answers (2)

Answers (2)

pgundoju
Explorer
0 Likes

Please take a look at the following code snippet in DefaultSetupImpexService.importImpexFile

final List<LanguageModel> languages = getCommonI18NService().getAllLanguages();

Yes, it loops through all available languages.

Option#1 Cleanup multi languages from system if your application doesn't need them.

Option#2 Override SetupImpexService to pull languages from the current user (admin) and configure your desired language (en) to this user.

StefanKruk
Active Participant
0 Likes

What you want is not OOTB possible with Hybris. In https://help.sap.com/viewer/d0224eca81e249cb821f2cdf45a82ace/1905/en-US/8beedbec8669101491c4a5cd1ffc... it is documented that the pattern for importing essentialdata is: "essentialdata*.impex" so every Impex that is lying in "<extension_name>/resources/impex" and has this Pattern will be imported.

You can change the pattern via property as described on the Help Site.

Still, this means that your Impexes are not imported via convention unless they are referenced in the default essentialdata.impex with:

"#% impex.includeExternalData(SampleDataManager.class.getResourceAsStream(""/1.csv""), ""utf-8"", 0, 0 );";
"#% impex.includeExternalData(SampleDataManager.class.getResourceAsStream(""/2.csv""), ""utf-8"", 0, 0 );";

and instead will be imported via implementation (SystemSetup).

For this please see: https://help.sap.com/viewer/d0224eca81e249cb821f2cdf45a82ace/1905/en-US/2664f2c96b2f4444b550bd317992...

Maybe you can change the implementation so that you are able to select the import language or just import the file for "en" only