您可以通过其他方式导出实例:
步骤1 :
转到HMC界面,选择脚本生成器tool System->Tools->Script Generator,然后生成ImpEx脚本模型,并选择要导出的实例类型脚本,如:
"#% impex.setTargetFile( ""Customer.csv"" );" // 1. where to export
insert_update Customer;&Item;@password[translator=de.hybris.platform.impex.jalo.translators.UserPasswordTranslator];CN;CodeNaf(code);DN;Europe1PriceFactory_UDG(code,itemtype(code));Europe1PriceFactory_UPG(code,itemtype(code));Europe1PriceFactory_UTG(code,itemtype(code));accountOrigine(&Item);accountVerificationType;addresses(&Item);authentificationDate[dateformat=dd.MM.yyyy hh:mm:ss];authorizedToUnlockPages[allownull=true];birthDate[dateformat=dd.MM.yyyy hh:mm:ss];carts(code);codeAPE;codeRCS;codeSiret;company;companyType(code,itemtype(code));creationtime[forceWrite=true,dateformat=dd.MM.yyyy hh:mm:ss];customerID;dateOfBirth[dateformat=dd.MM.yyyy hh:mm:ss];defaultPaymentAddress(&Item);defaultPaymentInfo(&Item);defaultShipmentAddress(&Item);description;domain;emailAlias;encodedPassword;enseigne(code)[allownull=true];erosId;europe1Discounts(&Item);firstname;fraudStatus(code,itemtype(code));hmcLoginDisabled;interestAreaList(code,itemtype(code));isprofessionnel;lastLogin[dateformat=dd.MM.yyyy hh:mm:ss];lastname;ldapaccount[allownull=true];ldaplogin;ldapsearchbase;locationType(code,itemtype(code));loginDisabled[allownull=true];modifiedtime[dateformat=dd.MM.yyyy hh:mm:ss];name;nbChild;nbGodSon;orders(code,versionID);origin;originalUid;owner(&Item)[allownull=true];password;passwordAnswer;passwordEncoding;passwordQuestion;paymentInfos(&Item);previewCatalogVersions(catalog(id),version);profilePicture(catalogVersion(catalog(id),version),code);recevedDocs;sessionCurrency(isocode);sessionLanguage(isocode);subscriptionTelContact(&Item);title(code);token;type(code,itemtype(code));uid[unique=true,allownull=true];userprofile(&Item);verificationDate[dateformat=dd.MM.yyyy hh:mm:ss];verificationflag // 2. how to export
"#% impex.exportItems( ""Customer"" , false );" // 3. what to export
Run Code Online (Sandbox Code Playgroud)
为了增加你想要的东西,我将重点关注第3行
#% impex.exportItems( ""Customer"" , false );" // 3. what to export
所以你可以用不同的方式使用exportItems方法:
按项目集的exportItems:
public void exportItems( Collection<Item> items )
public void exportItems( String[] pklist )
这些方法导出给定项目,其中项目可以作为PK(String)列表传递,也可以直接用作项目集合.
exportItems按类型代码:
public void exportItems( String typecode )
public void exportItems( String typecode, int count )
public void exportItems( String typecode, boolean inclSubTypes )
public void exportItems( String typecode, int count, boolean inclSubTypes )
flexSearch的exportItems:
public void exportItemsFlexibleSearch( String query )
public void exportItemsFlexibleSearch( String query, Map values, List resultClasses, final boolean failOnUnknownFields, final boolean dontNeedTotal, int start, int count )
public void exportItemsFlexibleSearch( String query, int count )
注意:默认情况下,导出程序API使用搜索结果的分页.因此,要获得准确的结果,您的FlexibleSearch查询必须包含一个ORDER BY子句示例:
impex.exportItemsFlexibleSearch(""select {PK} from {Customer} where {uid}='anonymous' ORDER BY {pk}"")
Run Code Online (Sandbox Code Playgroud)
如果您有权访问help.hybris检查:
如果您只能访问维基:
第2步:
转到HAC界面,ImpEx Export然后输入您的脚本并导出您的项目.
我可以从后台 -> 工具 -> 生成的脚本生成导出模型。
然后我可以添加一个灵活的搜索查询来过滤导出的结果:
# ---- Extension: core ---- Type: Customer ----
"#% impex.setTargetFile( ""Customer.csv"" );"
insert_update Customer;&Item;Europe1PriceFactory_UDG(code,itemtype(code));Europe1PriceFactory_UPG(code,itemtype(code));Europe1PriceFactory_UTG(code,itemtype(code));allowSubstitution[allownull=true];...
"#% impex.exportItemsFlexibleSearch(""select {PK} from {Customer} where {uid}='anonymous'"", Collections.EMPTY_MAP, Collections.singletonList( Item.class ), true, true, -1, -1 );"
Run Code Online (Sandbox Code Playgroud)
Cf :有关文档的Impex APIimpex.exportItems[FlexibleSearch]和此页面的更多示例
| 归档时间: |
|
| 查看次数: |
3204 次 |
| 最近记录: |