Several of Commerce Reference Store’s features, such as the Continue Shopping and breadcrumbs features, require knowing the most recent category a customer has browsed. To enable tracking of a customer’s catalog navigation, Commerce Reference Store implements the /atg/store/catalog/CatalogNavigation component, of class This session-based component stores information about the customer’s current category and that category’s position in the Category dimension hierarchy. The CatalogNavigation component provides:

The data stored in the CatalogNavigation component is updated each time the customer makes a request for a category page.

To determine if the request is for a category page, first the URL is parsed. This is the responsibility of the /atg/endeca/assembler/cartridge/manager/NavigationStateBuilder component, which is of class atg.endeca.assembler.navigation.ExtendedNavigationStateBuilder class. The ExtendedNavigationStateBuilder class is an extension of the endeca.infront.navigation.url.UrlNavigationStateBuilder class. The UrlNavigationStateBuilder class parses the URL and creates an initial com.endeca.infront.navigation.NavigationState object. The ExtendedNavigationStateBuilder class then modifies that NavigationState object.

To specify how the NavigationState object should be modified, the NavigationStateBuilder component has a navigationStateProcessors property that consists of a list of NavigationStateProcessor components. These components must be of a class that implements the atg.endeca.assembler.navigation.NavigationStateProcessor interface. This interface defines a process() method that contains logic that modifies the NavigationState object in some manner. The NavigationStateBuilder component invokes each NavigationStateProcessor, executing the logic contained within.

Commerce Reference Store implements a new processor component, /atg/endeca/assembler/cartridge/manager/StoreNavigationStateProcessor, and adds it to the NavigationStateBuilder.navigationStateProcessors property. The StoreNavigationStateProcessor component is of class and it determines if the request is for a single dimension value ID. If it does, the StoreNavigationStateProcessor component retrieves the dimension value ID from the NavigationState object and attempts to find a match for it in the dimension value cache. If the ID exists in the cache, it indicates that this is a Category dimension value ID (as opposed to a dimension value ID from another dimension) because the cache only contains Category dimension value IDs.

If the StoreNavigationStateProcessor component finds a match, it does the following:

Note that categories that can be accessed via multiple paths in the Category hierarchy have multiple dimension value IDs, one for each path. Therefore, the ID that is parsed from the URL will indicate not only the Category dimension value itself, but also its hierarchical path. This ensures that when the StoreNavigationStateProcessor component maps the dimension value ID to the category ID in the dimension value cache, it also maps to the correct hierarchy.

Copyright © 1997, 2012 Oracle and/or its affiliates. All rights reserved. Legal Notices