Alfresco 共享高级搜索定制

标签 alfresco alfresco-share advanced-search

我正在尝试修改 share-config-custom.xml,以便可以通过以下属性搜索电子邮件:

           <!-- cm:emailed aspect -->
           <show id="cm:originator" />
           <show id="cm:addressee" />
           <show id="cm:addressees" />
           <show id="cm:sentdate" />
           <show id="cm:subjectline" />

这是我的 share-config-custom.xml:

    <config evaluator="model-type" condition="cm:content">
    <forms> 
        <form label="Mails">
            <field-visibility>
               <show id="cm:originator" />
               <show id="cm:addressee" />
               <show id="cm:addressees" />
               <show id="cm:sentdate" />
               <show id="cm:subjectline" />
            </field-visibility>
        </form>
    </forms>
   </config>

  <config evaluator="string-compare" condition="AdvancedSearch">
  <advanced-search>
     <!-- Forms for the advanced search type list -->
     <forms>
        <!--
           The 'form' config element contains the name of the model type
           of the form to display.

           The element supports the following optional attributes:
              id = form id, the id of "search" will be assumed if not set
              label = label text to display - defaults to model type if not set
              labelId = I18N message id of label text to display
              description = description text to display
              descriptionId = I18N message id of description text to display
        -->
    <form labelId="Mails" descriptionId="Search for Mails">cm:content</form>
     </forms>
  </advanced-search>

而且它不起作用。我已经尝试过aspect , node-type而不是model-type 。我使用了 force="true" 的许多组合, for-mode="view" ...仍然无法让它发挥作用。在搜索表单中我看不到与属性相关的任何内容。这只是一个默认的搜索表单。任何帮助将不胜感激。

up:需要明确的是,问题是我有一些带有 cm:emailed 方面的文档。我想创建一个仅用于搜索此类文档的表单。但是,当我说“<form labelId="Mails" descriptionId="Search for Mails">cm:content</form>”时,默认内容搜索表单也被修改。我相信一定有一些简单的方法。我不想在自定义模型中定义新类型,所以我将此解决方案留到最后。

最佳答案

共享配置不正确。看看https://wiki.alfresco.com/wiki/Share_Advanced_Search#Search_Forms

您需要使用方面字段更改 cm:content form id="search" 的模型类型。

我正在打电话,所以答案可能很短。

--更新-- 您无法在高级搜索的下拉列表中选择方面,Alfresco 的当前实现不允许这样做。

在大多数情况下,我所做的就是将方面字段添加到默认的 cm:content 类型。

或者,当我对何时应用方面有更多控制时,我只需创建一个新类型 custom:mailed 并将父 cm:content 作为强制方面cm:通过电子邮件发送。然后,您可以创建一个将类型专门化为 custom:mailed 的行为,或者在 Alfresco 中创建一个在 hasAspect cm:emailed 上触发的入站规则。

我希望这能澄清一点。

关于Alfresco 共享高级搜索定制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30709408/

相关文章:

Alfresco Activiti - 如何更新生产/QA 中的流程定义

Java Web CMS 和 HTML 演示、模板

alfresco - 在 Alfresco 中创建方面时出错

java - 露天工作流程 Activity : How can I populate webservice result in dropdown

mysql - 最少按不同分组 - SQL

MySQL 只选择不为空的列

java - 设置tomcat上下文路径

alfresco - 如何从露天存储库下载多个文件

javascript - 露天网络脚本。列出所有文件夹、子文件夹和文件