You can modify the Search Testing UI to add an “Advanced Inputs” section that contains your custom Search Testing inputs. This allows you to test searches using properties that are not included in the default Search Testing configuration. When you save a search test, the value of your input is automatically saved as long as it follows the format provided in the default advancedIputs.jsp file.
Note: ATG does not support changes to the out-of-the-box search test inputs.
This topic contains the following information:
The following figure illustrates how custom inputs appear in Search Testing:

Steps to Add an Input to Search Testing
To add an input to Search Testing:
Create an application module for your customizations. See Creating a New Application Module in the ATG Platform Programming Guide.
ATG recommends that you create a new module to ensure that you always have a working application and to avoid issues when you upgrade.
If the input you are adding requires a change to the search query request, for example, a date range input that narrows the search results by availability date, you must extend the form handler class used by the
atg/search/web/assetmanager/SearchTestingFormHandlercomponent, as follows:Create a subclass of the underlying form handler class,
atg.search.web.assetmanager.SearchTestingFormHandlerlocated inDCS-UI.Search.In the subclass, override the
preSearchmethod of the class to implement the search request logic required for your custom search test inputs.See Sample Search Testing Form Handler Subclass for sample code that you can use as a starting point.
Copy the
advancedInputs.jspfile to your module and give it a custom name, such asmyAdvancedInputs.jsp. The file is located in theDCS-UI.Searchmodule at:<ATG9dir>/DCS-UI9.1/DCS-UI/Search/j2ee-apps/DCS-UI-Search.ear/DCS-UI-Search.war/searchTesting/inputEdit the JSP file to add your custom inputs. Sample code is provided in the default
advancedInputs.jspfile as a starting point.See Sample Advanced Inputs JSP for an example.
Override the
SearchTestingFormHandlercomponent to update thepageConfigMapproperty with your new JSP file. There are two things you must specify in the mapping:The name and location of the new JSP file.
The web application context root for the file. (The context identifies your web application so the DSP include can include that file.)
The following shows an example of the
pageConfigMapproperty with an updated advanced inputs JSP file:pageConfigMap+=\advancedInputsPage=/custom/myAdvancedInputs.jsp,\advancedInputsContext=DCS-UI-Search,\For more information about overriding a component, see the ATG Platform Programming Guide.
In your
SearchTestingFormHandlercomponent, update the$classvalue to reference your new subclass.(Optional) Customize the results list output to display search result data related to your custom inputs. See Customizing the Results List Output.
Assemble the Merchandising application and include your module in the modules list. See Assembling a Merchandising Application.
Deploy and start Merchandising.
Verify that your new search test inputs work as expected.
Sample Search Testing Form Handler Subclass
Use the following sample code as a starting point for creating a subclass of the atg.search.web.assetmanager.SearchTestingFormHandler class:
Public void preSearch(
DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse
) throws ServletException, IOException {
QueryFormHandler queryFormHandler =
getQueryFormHandler();
QueryRequest request =
(QueryRequest)queryFormHandler.getSearchRequest();
String myControlValue =
getAdvancedParameters().get( "myControl" );
/*
logic to set something in request based on myControlValue
*/
super.preSearch( pRequest, pResponse );
}Sample Advanced Inputs JSP
The advancedInputs.jsp file contains the following sample code as a starting point for writing the JSP for your custom inputs:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="dspel" uri="http://www.atg.com/taglibs/daf/dspjspELTaglib1_0"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ taglib prefix="assetui-search"
uri="http://www.atg.com/taglibs/assetui search" %>
<%@ taglib prefix="web-ui" uri="http://www.atg.com/taglibs/web-ui" %>
<%-- dspel:page>
<c:set var="formHandlerPath" value="${requestScope.formHandlerPath}"/>
<c:set var="formHandler" value="${requestScope.formHandler}"/>
<dt>My Control:</dt>
<dd>
<dspel:input id="myControl" type="text"
bean="${formHandlerPath}.advancedParameters.myControl" />
</dd>
</dspel:page--%>
