Updating the store JSP file to set the URL navigation suggestion

Feature Pack 4Feature Pack 3In this lesson, you are updating your store JSP file to set the URL for your warranty type suggestion group for the auto-suggest menu

Procedure

  1. In the Enterprise Explorer view, navigate to Stores > WebContent > Madisons > Snippets > Search.
  2. Open SearchSetup.jspf for editing.
  3. Find the <c:choose> block that contains the block of code checking for searchTermScope:
    <c:choose>
        <c:when test = "${WCParam.searchTermScope == 3}">
            <c:set var = "navigationView" value = "getCatalogNavigationAttachmentView" scope = "request"/>
            <c:set var = "searchProfile" value = "IBM_findCatalogEntryByUnstructureField" scope = "request"/>
        </c:when>
        <c:when test = "${WCParam.searchTermScope == 2}">
            <c:set var = "navigationView" value = "getCatalogNavigationView" scope = "request"/>
            <c:set var = "searchProfile" value = "IBM_findCatalogEntryByName" scope = "request"/>
        </c:when>
        <c:otherwise>
            <c:set var = "navigationView" value = "getCatalogNavigationView" scope = "request"/>
            <c:set var = "searchProfile" value = "IBM_findCatalogEntryByNameAndShortDescription" scope = "request"/>
        </c:otherwise>
    </c:choose>
  4. Insert searchTermScope handling to use the warranty term search profile added in a previous lesson.
    <c:when test="${WCParam.searchTermScope == 100}">
    				<c:set var="navigationView" value="getCatalogNavigationView" scope="request"/>
    				<c:set var="searchProfile" value="x_findCatalogEntryByWarranty" scope="request"/>
    			</c:when>	
    

    For example:

    <c:choose>
        <c:when test = "${WCParam.searchTermScope == 100}">
            <c:set var = "navigationView" value = "getCatalogNavigationView" scope = "request"/>
            <c:set var = "searchProfile" value = "x_findCatalogEntryByWarranty" scope = "request"/>
        </c:when>
        <c:when test = "${WCParam.searchTermScope == 3}">
            <c:set var = "navigationView" value = "getCatalogNavigationAttachmentView" scope = "request"/>
            <c:set var = "searchProfile" value = "IBM_findCatalogEntryByUnstructureField" scope = "request"/>
        </c:when>
        <c:when test = "${WCParam.searchTermScope == 2}">
            <c:set var = "navigationView" value = "getCatalogNavigationView" scope = "request"/>
            <c:set var = "searchProfile" value = "IBM_findCatalogEntryByName" scope = "request"/>
        </c:when>
        <c:otherwise>
            <c:set var = "navigationView" value = "getCatalogNavigationView" scope = "request"/>
            <c:set var = "searchProfile" value = "IBM_findCatalogEntryByNameAndShortDescription" scope = "request"/>
        </c:otherwise>
    </c:choose>
  5. Save and close the file.
  6. Restart the server.

Results

For your reference, the compressed file that you downloaded at the beginning of this tutorial contains a custom CachedSuggestions.jsp file with the changes in this lesson.