Search Component Data Builder customization
Version: Windchill 12.0
Use Case: Performing Global Search on "Name & Number" only behavior, without Index Search when users select a check box added next to global search Field
Description:
Hello PTC Community !
I'm looking for a way to implement the use case requested by my client on Windchill 12.0.2.7 and Windchill 13.0.2.6 (upgrade in progress).
At first I proposed to automatically set following user's preferences values when he checks the box:
- Enable Index Search to "No"
/com/ptc/windchill/enterprise/search/includeIndexGlobalSearch - Keyword Search Behavior to "Name & Number" (3)
/com/ptc/windchill/enterprise/search/controlKeywordSearchBehaviour
But this solution implies to save previous users's values to reset them whhile unchecking the box and the client wants that we study a way to implement the use case without impacting those preferences.
So, I tried to override the ootb DATA_ONLY component builder: com.ptc.windchill.enterprise.search.mvc.builders.SearchDataBuilder with following class added in codebase/config/mvc/custom.xml as we do for some other MVC Component Builders customizations.
Please find below an abstract of the code:
package com.client.search.builders;
import com.ptc.mvc.components.OverrideComponentBuilder;
import com.ptc.windchill.enterprise.search.mvc.builders.SearchDataBuilder;
@OverrideComponentBuilder
public class ClientSearchDataBuilder extends SearchDataBuilder {
}
But once deployed, I've this error raised in MethodServer:
org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.ptc.windchill.enterprise.search.mvc.builders.SearchDataBuilder' available: expected single matching bean but found 2: com.ptc.windchill.enterprise.search.mvc.builders.SearchDataBuilder#0,com.client.search.builders.ClientSearchDataBuilder#0I tried many things in addition to make Spring configuration working, but it's still running like if @OverrideComponentBuilder annotation was not taken into account here.
FYI, OOTB SearchDataBuilder is defined like this:
@ComponentBuilder(value = {"search.default.searchResults"}, type = ComponentBuilderType.DATA_ONLY)
public class SearchDataBuilder extends AbstractJcaDataSourceComponentDataBuilderThanks in advance for your help/advices/other solutions...
Regards,
Julien


