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

impex.exportItems syntax

rbespalovnc
Participant
0 Kudos
4,984

Hybris help contains some examples of using impex.exportItems for exporting data. E.g. https://help.hybris.com/1808/hcd/31ffc3dd858d47209614a97fd084d12d.html

 # ---- Extension: core ---- Type: Address ---- 
 "#% impex.setTargetFile( ""Address.csv"" , true );"
 insert_update Address; pk[unique=true]; country(isocode); duplicate; email; firstname; gender(itemtype(code),code); lastname; postalcode; region(isocode); streetname; streetnumber; town; owner(pk); cellphone; company; district; title(code)
 "#% impex.exportItems( ""select {pk}from {Address} where {duplicate}='false'"", Collections.EMPTY_MAP, Collections.singletonList( Item.class ), true, true, -1, -1 );"

and

 # ---- Extension: core ---- Type: User ----
 "#% impex.setTargetFile( ""User.csv"" , true );"
 insert_update User; pk[unique=true]; uid[unique=true]; addresses(pk); sessionLanguage(isocode); description; hmcLoginDisabled; loginDisabled; name; password; passwordAnswer; passwordQuestion; sessionCurrency(isocode);
 "#% impex.exportItems( ""User"" , true );"

Can someone please explain the syntax of the impex.exportItems command? It looks completely different in these two cases. Exactly what those parameters mean and what other usages are possible?

Links to the help/wiki are appreciated as well

Accepted Solutions (1)

Accepted Solutions (1)

mpern
Product and Topic Expert
Product and Topic Expert
0 Kudos

You can find the full JavaDoc for the Exporter (the class that is available via the variable impex in export scripts) here:

https://help.hybris.com/1808/api/commerce-suite/de/hybris/platform/impex/jalo/exp/Exporter.html

There are various overloaded methods fetch the items you want to export

andyfletcher
Active Contributor
0 Kudos

Following that url you find that exportItems(java.lang.String query, java.util.Map values, java.util.List resultClasses, boolean failOnUnknownFields, boolean dontNeedTotal, int start, int count) has been deprecated since ages

Seems someone didn't tell the script generator team!

And if you read the javadoc of exportItemsFlexibleSearch(java.lang.String query) you find that the default options used are the same as used in the script generator so you could replace with

 "#% impex.exportItemsFlexibleSearch( ""select {pk}from {Address} where {duplicate}='false'"")"

Answers (0)