SAP Hybris 扩展后台 - Spring bean 覆盖

问题描述

我正在尝试覆盖具有 bean 的后台类,但它位于 Web 上下文中。

在我们的项目中,我们已经有一个自定义后台包,但是没有 spring.xml。该包中的其他类也没有任何 bean。

更具体地说,我试图覆盖这个类:hybris/bin/ext-backoffice/backoffice/web/webroot/WEB-INF/classes/com/hybris/backoffice/widgets/searchadapters/conditions/products/FlexibleSearchUncategorizedConditionAdapter.class

我们的后台扩展看起来像这样:

├── backoffice <-- webroot
│   ├── resources
│   │   └── widgets
│   │       ├── projectbackofficeWidget
│   │       │   ├── deFinition.xml
│   │       │   ├── images
│   │       │   │   └── ...
│   │       │   ├── labels
│   │       │   │   └── ...
│   │       │   ├── projectbackofficewidget.scss
│   │       │   └── projectbackofficewidget.zul
│   │       └── actions
│   │           └── ...
│   ├── src
│   │   └── de
│   │       └── company
│   │           └── project
│   │               └── backoffice
│   │                   ├── b2bcommerce
│   │                   │   └── actions
│   │                   │       └── ...
│   │                   ├── editors
│   │                   │   └── ...
│   │                   ├── services
│   │                   │   └── ...
│   │                   └── widgets
│   │                       ├── ...
│   │                       └── searchadapters
│   │                           └── myFlexibleSearchUncategorizedConditionAdapter.java
│   └── testsrc
│       └── ...
├── build.xml
├── buildcallbacks.xml
├── extensioninfo.xml
├── extensioninfo.xsd
├── gensrc
│   └── ...
├── platformhome.properties
├── project.properties
├── resources
│   ├── backoffice
│   │   └── projectbackoffice_bof.jar
│   ├── beans.xsd
│   ├── cockpitng
│   │   └── ...
│   ├── items.xsd
│   ├── projectbackoffice
│   │   ├── projectbackoffice-testclasses.xml
│   │   └── projectbackoffice-webtestclasses.xml
│   ├── projectbackoffice-backoffice-config.xml
│   ├── projectbackoffice-backoffice-labels
│   │   └── ...
│   ├── projectbackoffice-backoffice-spring.xml
│   ├── projectbackoffice-backoffice-widgets.xml
│   ├── projectbackoffice-beans.xml
│   ├── projectbackoffice-items.xml
│   ├── projectbackoffice-spring.xml
│   ├── projectbackoffice.build.number
│   └── localization
│       └── ...
├── src
│   └── de
│       └── company
│           └── project
│               └── backoffice
│                   ├── projectbackofficeStandalone.java
│                   ├── constants
│                   │   └── projectbackofficeConstants.java
│                   └── jalo
│                       └── projectbackofficeManager.java
└── testsrc
    └── ...

我知道有一个 spring.xml,但它不能用于 webroot 中的类。 在所有其他网络扩展程序中,都有单独的文件
如何添加 spring.xml 以便覆盖该 OOTB bean?或者我如何使用现有的 spring.xml ?

解决方法

您可以为此使用 customize,但似乎有更好的解决方案可以让您附加上述 here 中的后台 web spring 配置。