添加自定义自动提示搜索小组件
执行以下步骤以添加自定义自动提示搜索小组件:
1. 在位于 <WINDCHILL_HOME>\codebase\config\actionsactions.xml 文件中添加以下条目。
<action name="customActionGWT" ajax="component">
<command class="com.ptc.cat.ui.client.action.CustomSearchAndLaunchURLAction" method="execute" url="/ptc1/psb/customURLAction" windowType="popup"/>
</action>
* 
CustomSearchAndLaunchURLAction 是默认实现类。您可以定义自己的用于实现 SearchWidgetAction 接口的类。
2. 在位于 <WINDCHILL_HOME>\codebase\config\actionsactionmodels.xml 文件中添加以下条目。
<action name="customActionGWT" type="psb">
<ribbonInfo buttonType="searchwidget" orientation="vertical"/>
</action>
* 
不需要为 buttonscale 提供值,因为这是多余的,buttonscale 值始终为 SMALL
3. 根据您的配置设置以下特性。
gwt.buttontype.searchwidget.ActionNames -Action Names defined in actions.xml, which have buttontype set as searchwidget. This can be multivalued.
gwt.buttontype.searchwidget.<yourActionName>.SearchOnAttribute -The attribute on which you want to perform search.
gwt.buttontype.searchwidget.<yourActionName>.SearchOnAttributeType -The type on which the above attribute is defined.
gwt.buttontype.searchwidget.<yourActionName>.SearchOnTypes -The Types you want to search. This can be multivalued.
gwt.buttontype.searchwidget.<yourActionName>.AttributesToLoad -Any additional attributes to be displayed in search result. By default, identity is displayed.
This can be multivalued but currently only 2 values are supported.
请参见以下示例。
4. 重启方法服务器。
xconfmanager -s "gwt.buttontype.searchwidget.ActionNames=customActionGWT" -t codebase/wt.properties -p
xconfmanager -s "gwt.buttontype.searchwidget.customActionGWT.SearchOnAttribute=name" -t codebase/wt.properties -p
xconfmanager -s "gwt.buttontype.searchwidget.customActionGWT.SearchAttributeOnType=wt.epm.EPMDocument" -t codebase/wt.properties -p
xconfmanager -s "gwt.buttontype.searchwidget.customActionGWT.SearchOnTypes=wt.epm.EPMDocument,wt.doc.WTDocument" -t codebase/wt.properties -p
xconfmanager -s "gwt.buttontype.searchwidget.customActionGWT.AttributesToLoad=state" -t codebase/wt.properties -p
这对您有帮助吗?