要自定义后台,您需要先使用 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。