【问题标题】:Adding new field in Customer type Hybris在客户类型 Hybris 中添加新字段
【发布时间】:2018-01-06 12:09:09
【问题描述】:

我是 Hybris 的初学者。我需要在 Hybris 客户类型中添加一个字符串类型的新字段/属性。该字段应出现在后台的 User / Customers / General / Essential 列中(图 1)。 figure 1 我怎样才能添加它?通过Impex?

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

【问题讨论】:

    标签: hybris


    【解决方案1】:

    要自定义后台,您需要先使用 ybackoffice 模板创建自定义扩展。

    查看Creating a Custom Backoffice Extension

    成功创建扩展后,您应该会在资源文件夹中自动生成您的extension-backoffice-config.xml 文件。

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

    此时,您更感兴趣的是查看 Customer 类型的配置。检查platformbackoffice-backoffice-config.xml中的以下配置

    <context merge-by="type" parent="User" type="Customer" component="editor-area">

    OR
    

    <context component="create-wizard" type="Customer">

    第一个用于编辑类型实例,后一个用于在后台创建新类型实例。

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

    在编辑器区域自定义客户类型。在 yourextension-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>
    

    还有一个非常简单的步骤可以检查 Backoffice 中的现有配置。使用 admin/nimda 登录并按 F4 按钮进入 Application Orchestrator 模式。然后点击左上角的show conckpit-config.xml。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-26
      • 1970-01-01
      • 2015-12-14
      • 2020-04-20
      相关资源
      最近更新 更多