on 2018 Sep 12 11:50 AM
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
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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'"")"
| User | Count |
|---|---|
| 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.