alfresco - 为什么我的共享标题自定义在搜索页面上不起作用

标签 alfresco alfresco-share aikau

这是在 Alfresco JIRA、论坛和 Alfresco IRC 上反复询问的问题,所以我想我会在这里提问和回答,因为这是人们最有可能找到解决方案的地方,问题是......

I've created a customization to the Alfresco Share header following the steps described in this blog post to remove a menu item.

However, when I login to Alfresco that the customization works on everything except the search page - What am I doing wrong?

最佳答案

Alfresco Share 中的搜索页面是应用程序中为数不多的完整 Aikau 页面之一。 Share 中的大部分页面是在创建 Aikau 之前编写的,并且由多个 Surf 组件组成——其中的标题已由 Aikau 自 4.2 版以来呈现。

搜索页面在 5.0 中更新为完整的 Aikau 页面,并且不使用相同的 Surf 组件来呈现标题。

这意味着标准标题自定义将仅针对 Surf 组件 WebScript 而不是整页 WebScript。

要使其工作,您需要利用 alwaysApply模块配置中的元素。

因此,例如,针对 header 的典型扩展模块可能如下所示:

<extension>
  <modules>
    <module>
      <id>Extension Module</id>
      <auto-deploy>true</auto-deploy>
      <evaluator type="default.extensibility.evaluator"/>
        <customizations>   
          <customization>
            <targetPackageRoot>org.alfresco</targetPackageRoot>
            <sourcePackageRoot>org.alfresco.share.pages.customizations</sourcePackageRoot>
          </customization>
        </customizations>
      </evaluator>
    </module>
  </modules>
</extension>

这将针对 org.alfresco 中的所有 Web 脚本。并会在 org.alfresco.share.pages.customizations 中查找匹配的文件包裹。

所以 Share header 是由 share-header.get.js WebScript 定义的,如果你的扩展文件应该在 org.alfresco.share.pages.customizations.share-header.get.js .

但是,org.alfresco.share-header.get.js搜索页面没有使用 WebScript,这就是自定义不会生效的原因。

相反,您应该包含一个额外的 customization block 以确保应用您的扩展,它应该类似于以下内容:
<customization>    
  <targetPackageRoot>org.alfresco.share.pages</targetPackageRoot>
  <sourcePackageRoot>org.alfresco.share.pages.customizations.share.header</sourcePackageRoot>
  <alwaysApply>
    <webscript>share-header</webscript>
  </alwaysApply>
</customization>

这表示对于 org.alfresco.share.pages 中的所有 WebScript包(这是定义所有完整 Aikau 页面的地方)。您应该始终应用名为“share-header”的扩展文件(因此 .get.js、.get.html.ftl 和 .get.properties 文件也会匹配)。

请注意 sourcePackageRoot准确定义了扩展文件的位置。

关于alfresco - 为什么我的共享标题自定义在搜索页面上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37023215/

相关文章:

open-source - 哪个更容易扩展,Alfresco 还是 Nuxeo?

forms - Alfresco:定义新的控制参数

用于下载文档的 Alfresco REST API

javascript - Alfresco Aikau 使用现有门票登录

javascript - aikau widget中url.context是如何初始化的?

alfresco - 限制露天特定用户的文档访问

java - 如何上传新版本的文档使用 alfresco restful api?

postgresql - 如何列出有关所有 Alfresco 文件的信息(Postgresql)?