2

我正在尝试修改 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>

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

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

4

1 回答 1

5

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

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

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

--UPDATE-- 您不能在高级搜索的下拉列表中选择一个方面,Alfresco 的当前实现不允许这样做。

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

或者当我对应用方面有更多控制权时,我只需创建一个新类型custom:mailed并拥有父级cm:content和强制方面cm:emailed。然后,您可以创建一个将类型专门用于custom: mailed 的行为,或者在 Alfresco 中创建一个在 hasAspect cm: emailed 上触发的入站规则。

我希望这能澄清一点。

于 2015-06-08T20:44:22.717 回答