new*_*zad 2 alfresco advanced-search alfresco-share
我正在尝试修改 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" />
Run Code Online (Sandbox Code Playgroud)
这是我的 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>
Run Code Online (Sandbox Code Playgroud)
它不起作用。我试过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"。
我正在打电话,所以答案可能很短。
--UPDATE-- 您不能在高级搜索的下拉列表中选择一个方面,Alfresco 的当前实现不允许这样做。
大多数情况下,我只是将方面字段添加到默认的cm:content类型中。
或者,当我对应用方面有更多控制权时,我只需创建一个新类型custom:mailed并具有父cm:content和强制方面cm:emailed。然后,您可以创建一个将类型专门化为custom: mailed的行为,或者在 Alfresco 中创建一个在 hasAspect cm: emailed 上触发的入站规则。
我希望这会清除一点。
| 归档时间: |
|
| 查看次数: |
2361 次 |
| 最近记录: |