自定义 Facet 搜索
Facet 中的模型化属性可见性
模型化属性在 SearchableAttributesByType.properties.xconf 中表示时,将显示为 Facet。
默认情况下,SearchableAttributesByType.properties.xconf 包括 advancedSearch 属性的定义。例如:
<Property name="advancedSearch.wt.part.WTPart"
default=
"thePersistInfo.createStamp,iterationInfo.creator,defaultUnit,lock.locker,state.state,partType,thePersistInfo.modifyStamp,
iterationInfo.modifier,defaultTraceCode,genericType"
/>
如果某个模型化属性以 advancedSearch 属性值表示,则该属性符合显示为结果 Facet 的条件。
但是,您可以通过将 facetSearch 属性添加到 SearchableAttributesByType.properties.xconf 来显式阻止某个模型化属性的显示。添加完成后,仅 facetSearch 属性中列出的那些模型化属性符合显示条件。例如:
<Property name="facetSearch.wt.part.WTPart"
default=
"defaultUnit,thePersistInfo.createStamp,thePersistInfo.modifyStamp,"
/>
条目特定于类型。如果要针对多个类型隐藏任何特定属性,则需要为适用的类型添加多个条目。
用于从 Facet 中隐藏 IBA 的自定义
您可以自定义显示在 Facet 上的 IBA 的可见性。
实现 FacetService 接口。使用 service.properties 中的自定义类更新服务条目。
元素
类型
说明
FacetService
Com.ptc.windchill.enterprise.search.facet
接口
接口可控制 Facet 上 IBA 的可见性。
自定义点
在 "service.properties" 中使用自定义类更新服务条目,如示例代码所示。在示例中,facetCustomClass 是自定义类的名称。
wt.services/svc/default/com.ptc.windchill.enterprise.search.facet.FacetService/null/null/0=com.ptc.windchill.enterprise.search.facet.FacetCustomClass/duplicate
实现继承的方法 FacetService.isAttributeVisible(AttributeTypeIdentifier)isAttributeVisible API 会返回布尔值,默认情况下此值设置为 true。您可以自定义 theisAttributeVisible API,如果客户需要隐藏 Facet 中的任何 IBA,则返回 false。
示例:
public booleanisAttributeVisible(AttributeTypeIdentifier ibaAttribute){
if(ibaAttribute.getAttributeName().equals("name of attribute")){
return false;
}
return true;
}
这对您有帮助吗?