search cancel

Catalog Search not showing "Entire Catalog" as Default

book

Article ID: 109316

calendar_today

Updated On:

Products

CA Service Catalog CA Service Management - Asset Portfolio Management CA Service Management - Service Desk Manager

Issue/Introduction

In 17.1, 17.2 or 17.3 Service Catalog, if you use the request view, when you search for service offerings, this does not search the entire catalog by default but starts by searching the top level folder. If you want to search the entire catalog you need to scroll down and select "entire catalog".

Environment

Service Catalog 17.1, 17.2, 17.3

Cause

This behavior is introduced in 17.1 to show a specific default folder for the end user to search for a specific offering\option.
The reason behind for not making Entire Catalog as default is that it will a run an expensive Query to fetch the results, then more time required as compared to folder search.  So, by default, it is changed to the first folder.

Resolution

If you need the default search to 'Entire Catalog' , you will need to do the following customization :

Steps to achieve the behavior to make entire catalog as default view:
====================================================
1. Need to customize the file catalogbrowse.xsl (Location: %USM_HOME%\view\webapps\usm\explorer\request)

2. Copy the original catalogbrowse.xsl from the file store folder, and place it under catalog's %USM_HOME%\filestore\custom\explorer\request\ folder (the folder 'request' may not exist yet, f so, then you may create it).

3. Change the following section :

from :

<select id="foldercombo" tabindex="0" class="ie8-auto-expand" aria-label="{$xslcontent/search_in}" onkeydown="cartpress(event);">  <!-- Accesskey for Combobox for search -->
                <xsl:for-each select="/xmlRoot/COLLECTION/BROWSE_CATALOG/FOLDER[folder_parent_id=$rootID and not(folder_name/LITERAL='___SYSTEM___')]">
                  <option title="{folder_name/LITERAL}" alt="{folder_name/LITERAL}" value="{folder_id/LITERAL}">
                    <xsl:call-template name="shortenName">
                      <xsl:with-param name="str" select="folder_name/LITERAL"/>
                      <xsl:with-param name="shortenLength" select="number(60)"/>
                    </xsl:call-template>
                  </option>
                  <xsl:variable name="curOID" select="folder_id/LITERAL"/>
                  <xsl:for-each select="/xmlRoot/COLLECTION/BROWSE_CATALOG/FOLDER[folder_parent_id/LITERAL=$curOID]">
                    <option title="{folder_name/LITERAL}" alt="{folder_name/LITERAL}" value="{folder_id/LITERAL}">&#xa0;&#xa0;&gt;
                      <xsl:call-template name="shortenName">
                        <xsl:with-param name="str" select="folder_name/LITERAL"/>
                        <xsl:with-param name="shortenLength" select="number(60)"/>
                      </xsl:call-template>
                    </option>
                  </xsl:for-each>
                </xsl:for-each>
                <option title="{$xslcontent/entire_catalog}" alt="{$xslcontent/entire_catalog}" value=""><xsl:value-of select="$xslcontent/entire_catalog"/></option>
              </select>&#xa0;


TO   

            <select id="foldercombo" tabindex="0" class="ie8-auto-expand" aria-label="{$xslcontent/search_in}" onkeydown="cartpress(event);">  <!-- Accesskey for Combobox for search -->
                <option title="{$xslcontent/entire_catalog}" alt="{$xslcontent/entire_catalog}" value=""><xsl:value-of select="$xslcontent/entire_catalog"/></option>
                <xsl:for-each select="/xmlRoot/COLLECTION/BROWSE_CATALOG/FOLDER[folder_parent_id=$rootID and not(folder_name/LITERAL='___SYSTEM___')]">
                  <option title="{folder_name/LITERAL}" alt="{folder_name/LITERAL}" value="{folder_id/LITERAL}">
                    <xsl:call-template name="shortenName">
                      <xsl:with-param name="str" select="folder_name/LITERAL"/>
                      <xsl:with-param name="shortenLength" select="number(60)"/>
                    </xsl:call-template>
                  </option>
                  <xsl:variable name="curOID" select="folder_id/LITERAL"/>
                  <xsl:for-each select="/xmlRoot/COLLECTION/BROWSE_CATALOG/FOLDER[folder_parent_id/LITERAL=$curOID]">
                    <option title="{folder_name/LITERAL}" alt="{folder_name/LITERAL}" value="{folder_id/LITERAL}">&#xa0;&#xa0;&gt;
                      <xsl:call-template name="shortenName">
                        <xsl:with-param name="str" select="folder_name/LITERAL"/>
                        <xsl:with-param name="shortenLength" select="number(60)"/>
                      </xsl:call-template>
                    </option>
                  </xsl:for-each>
                </xsl:for-each>
               
              </select>&#xa0;




In other words ,  you  need to move  highlighted line  
<option title="{$xslcontent/entire_catalog}" alt="{$xslcontent/entire_catalog}" value=""><xsl:value-of select="$xslcontent/entire_catalog"/></option>
up and place it below <select id> tag line 


4.  Stop catalog service.

5.  Delete all the files under USM_HOME\view\translets\ .

6.  Restart the catalog service to have the change take effect.

5. Restart catalog catalog service to have the 
 

Additional Information

catalogbrowse.xsl  file,  the section before change :

the section after change :

Attachments