CatalogVersion与catalogId' xxxProductCatalog'和版本'分阶段'未找到

时间:2018-05-18 14:32:51

标签: hybris

我按照那个教程

https://wiki.hybris.com/pages/viewpage.action?pageId=294094418&showComments=true

首先我将impex名称更改为mystore名称。

然后我去了hac console并只更新了我的扩展名mystoreinitialdata。

但是它会给出这些错误:

Creating project data for mystoreinitialdata ...
Begin importing common data for [mystoremystoreinitialdata]
Begin importing product catalog data for [xxx]
Begin importing content catalog data for [xx]
Begin synchronizing Product Catalog [xxx]




Error creating sample data for mystoreainitialdata. See console output.
  

错误[hybrisHTTP39] [初始化]   de.hybris.platform.servicelayer.exceptions.UnknownIdentifierException:   CatalogVersion与catalogId' xxxProductCatalog'和版本'分阶段'   没找到!

我搜索过,我的代码中没有xxxProductCatalog。

我该怎么办?

1 个答案:

答案 0 :(得分:2)

确保在InitialDataSystemSetup中创建的ImportData具有ProductCatalog和Content Catalog属性的有效名称。像这样:

final List<ImportData> importData = new ArrayList<ImportData>();

final ImportData sampleImportData = new ImportData();
sampleImportData.setProductCatalogName("mystore");
sampleImportData.setContentCatalogNames(Arrays.asList("mystore"));
sampleImportData.setStoreNames(Arrays.asList("mystore"));
importData.add(sampleImportData);

getCoreDataImportService().execute(this, context, importData);
getEventService().publishEvent(new CoreDataImportedEvent(context, importData));

getSampleDataImportService().execute(this, context, importData);
getEventService().publishEvent(new SampleDataImportedEvent(context, importData));

还要确保在以下文件的impex文件中创建名为“mystoreContentCatalog”和“mystoreProductCatalog”的目录:

/mystoreinitialdata/resources/mystoreinitialdata/import/coredata/contentCatalogs/mystoreContentCatalog/catalog.impex

$contentCatalog=mystoreContentCatalog
$languages=ja,en,de,zh

INSERT_UPDATE ContentCatalog;id[unique=true]
;$contentCatalog

INSERT_UPDATE CatalogVersion;catalog(id)[unique=true];version[unique=true];active;languages(isoCode)
;$contentCatalog;Staged;false;$languages
;$contentCatalog;Online;true;$languages

/mystoreinitialdata/resources/mystoreinitialdata/import/coredata/productCatalogs/mystoreProductCatalog/catalog.impex

$productCatalog=mystoreProductCatalog
$catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Staged'])[unique=true,default=$productCatalog:Staged]
$languages=ja,en,de,zh

INSERT_UPDATE Catalog;id[unique=true]
;$productCatalog

INSERT_UPDATE CatalogVersion;catalog(id)[unique=true];version[unique=true];active;languages(isoCode);readPrincipals(uid)
;$productCatalog;Staged;false;$languages;employeegroup
;$productCatalog;Online;true;$languages;employeegroup