ClassName

atg.repository.servlet.NavHistoryCollector

Component

(None provided with ATG Adaptive Scenario Engine.)

The NavHistoryCollector servlet bean can track each page that a user visits and makes it easy for that user to backtrack and return to pages he or she has already visited. NavHistoryCollector keeps track of a user’s path from the top of the site to the current location in a stack of information that is manipulated differently depending on how the user navigates through the site. For more information about different ways of catalog navigation, see CatalogNavigation in the CatalogNavigationandSearching chapter of the ATGCommerceAdministrationandDevelopmentGuide.

Input Parameters

navAction
Set this optional parameter to the action you want to take. Choices are push, pop, and jump. An unset navAction parameter is treated as a push command.

navCount
Detects when a user clicks on the Back button in order to reset the navigation path.

item
This is the item to add to the historyList. You must specify either this parameter, or the itemName parameter.

itemName
The name of the current page that is an anchor text in a link back to the current page. You can use this parameter in place of the item parameter.

The NavHistoryCollector servlet bean has no output parameters.

Example

The Pioneer Cycling Reference Application uses the component /atg/commerce/catalog/CatalogNavHistoryCollector to collect the locations visited and to add them to the array of visited locations. In Pioneer Cycling, the visited locations are the repository items that represent the products and categories of the product catalog. This snippet, taken from breadcrumbs.jsp, invokes the CatalogNavHistoryCollector:

<dsp:droplet name="/atg/dynamo/droplet/Switch">
  <dsp:param name="value" param="no_new_crumb"/>
  <dsp:oparam name="true">
  </dsp:oparam>
  <dsp:oparam name="default">
     <dsp:droplet name="CatalogNavHistoryCollector">
        <dsp:param name="navAction" param="navAction"/>
        <dsp:param name="item" param="element"/>
     </dsp:droplet>
  </dsp:oparam>
</dsp:droplet>

Although both techniques used in this code sample are specific to the Pioneer Cycling implementation, they can be applied to any site. First, notice that the required parameter navCount is not passed to CatalogNavHistoryCollector. The navCount parameter is set in the page that invokes this JSP snippet. Because JSP files invoked as servlets from other JSP files are in a sub-scope of their callers, they have access to the same parameters as the caller. Second, the no_new_crumb parameter decides whether or not to invoke the snippet. This is just a switch on a parameter passed to the page to determine whether to add the current location to the NavHistory or not. However, it demonstrates how Pioneer Cycling addresses navigation for pages that do not represent catalog items. For example, the search page, the shopping cart, and the user profile page are not added to the NavHistory like regular catalog pages. For more information on navigation in the Pioneer Cycling demo, see AddingCatalogNavigation in the DisplayingandAccessingtheProductCatalog chapter of the ATG Consumer Commerce Reference Application Guide.

 
loading table of contents...