在露天的 aikau 小部件中覆盖函数的最佳方法是什么?

What is the best way to override a function in an aikau widget in alfresco?

我正在使用 Alfresco 6.2 企业版。我有一个要求需要在 https://dev.alfresco.com/resource/docs/aikau-jsdoc/AlfSearchList.js_.html 模块中进行一些修改。

  1. 覆盖 onScopeSelection 函数的最佳方法是什么?
  2. 有没有办法修改 searchPayload 以包含新属性?

我已经阅读了 Alfresco 文档,但无法找出覆盖现有 aikau 的最佳方法。

在 Aikau 中覆盖功能的最佳选择通常是扩展有问题的小部件模块并使用模块 "class hierarchy" 覆盖从 AlfSearchList 继承的功能。 OOTBee 支持工具项目有一个 module extending AlfList and overriding its onDataLoadSuccess function. Once you have your own custom module, you can use a Surf Extension Module to customise the JSON model of the faceted search page to change the name of the module used for the search list 给你的例子。

不幸的是,除了重写 loadData 函数之外,没有其他方法可以修改 searchPayload。然后添加的属性将不会执行任何操作,除非您还通过再次修改页面的 JSON 模型来覆盖 SearchService's onSearchRequest function and used your custom service instead of the default