在客户类型Hybris中添加新字段

在客户类型Hybris中添加新字段,hybris,Hybris,我是海布里斯的初学者。我需要在Hybris Customer Type中添加一个字符串类型的新字段/属性。此字段应出现在后台的用户/客户/一般/基本列中(图1)。 我如何添加它?通过弹劾 我只能向Customer类型的属性添加一个字段(通过extensionname items.xml)(图2)。 要自定义backoffice,首先需要使用ybackoffice模板创建自定义扩展 检查 成功创建扩展名后,应该在resources文件夹中自动生成extension-backoffice-confi

我是海布里斯的初学者。我需要在Hybris Customer Type中添加一个字符串类型的新字段/属性。此字段应出现在后台的用户/客户/一般/基本列中(图1)。 我如何添加它?通过弹劾

我只能向Customer类型的属性添加一个字段(通过extensionname items.xml)(图2)。

要自定义backoffice,首先需要使用ybackoffice模板创建自定义扩展

检查

成功创建扩展名后,应该在resources文件夹中自动生成extension-backoffice-config.xml文件

OOTB中有多个可用的编辑器。在platformbackoffice-backoffice-config.xml或任何现有的*-backoffice-config.xml中检查编辑器区域、创建向导、基础、简单搜索、高级搜索、列表视图等。您将了解如何为任何类型定义这些配置

此时,您对查看客户类型配置更感兴趣。在platformbackoffice-backoffice-config.xml中检查以下配置

<context merge-by="type" parent="User" type="Customer" component="editor-area">
    <editorArea:editorArea name="">
        <editorArea:essentials>
            <editorArea:essentialSection name="hmc.essential">
                <editorArea:attribute qualifier="newAttribute"/>                    
            </editorArea:essentialSection>
        </editorArea:essentials>
    </editorArea:editorArea>

第一个用于编辑类型实例,第二个用于在backoffice中创建新的类型实例

Backoffice还提供了使用merge by上下文标记的灵活性,该标记可帮助您在不同扩展中定义时合并配置

在编辑器区域自定义客户类型。在您的extension-backoffice-config.xml中执行此操作

<context merge-by="type" parent="User" type="Customer" component="editor-area">
    <editorArea:editorArea name="">
        <editorArea:essentials>
            <editorArea:essentialSection name="hmc.essential">
                <editorArea:attribute qualifier="newAttribute"/>                    
            </editorArea:essentialSection>
        </editorArea:essentials>
    </editorArea:editorArea>

要在创建向导中自定义客户类型

<context merge-by="type parent="User" type="Customer" component="create-wizard">
    <wz:flow id="CustomerWizard" title="create.title(ctx.TYPE_CODE)">
        <wz:prepare id="custPrepare">
            <wz:initialize property="newCust" type="ctx.TYPE_CODE"/>
        </wz:prepare>
        <wz:step id="step1" label="create.customer.essential.label" sublabel="create.customer.essential.sublabel">
            <wz:content id="step1.content">
                <wz:property-list root="newCust">
                    <wz:property qualifier="newAttribute" type="java.lang.String"/>                     
                </wz:property-list>
            </wz:content>
        </wz:step>  
      </wz:flow>
</context>