1

如何为 CSV 文件添加新属性以及如何/在何处更新hot-folder流程代码?

4

2 回答 2

5

在 HybrisHot Folder原理中,我们使用可以使用 Spring Integration 逻辑配置的特定标头将文件转换为CSV文件。ImpEx

要更新/配置的文件:

要指定/添加/更新您的Hot Folder逻辑/标题的配置,请hot-folder-spring.xmlhot-folder自定义扩展中查找类似名称的文件。

添加什么:

在位于配置文件中的类型的标题中添加您的属性,例如:ImpExhot-folder

<bean id="myTypeConverter" class="de.hybris.platform.acceleratorservices.dataimport.batch.converter.impl.DefaultImpexConverter">
    <property name="header">
        <value># ImpEx for Importing MyType objects into $CATALOG$
            $catalog=$CATALOG$
            #% impex.setLocale(Locale.ENGLISH);
            INSERT_UPDATE MyType;code[unique=true];myAttribute[translator=com.dataimport.batch.converter.MyAttributeTranslator]// translator if need
        </value>
    </property>
    <property name="impexRow">
        <value>;{+0};{+1}</value> //{+1} = the number 1 is the position of the column of your attribute value {+csv-attribute-column-position}
    </property>
</bean>

笔记:

Hot Folder 是一个文件夹,只需将数据放入文件夹即可自动将数据导入平台。

数据是 CSV 文件,可以转换为 ImpEx 文件

于 2018-03-08T17:37:17.177 回答
2

您可以遵循一个 hybris Trail,它详细解释了热文件夹配置需要执行的步骤:

https://wiki.hybris.com/pages/viewpage.action?pageId=294094383

您可以看到如何定义文件名、目录、时间间隔等。

于 2018-03-09T10:09:28.347 回答