While it has a similar purpose, the MediaBanner cartridge that is implemented for Commerce Reference Store behaves differently from the MediaBanner cartridge that is included out of the box with Oracle Endeca Commerce. The Oracle Endeca Commerce MediaBanner cartridge retrieves media items that have been uploaded to the MDEX Engine or the Endeca Configuration Repository. The Commerce Reference Store version of the cartridge requires that you manually specify a URL for the image in Experience Manager. Both cartridges use the same classes for the associated content item and configuration, com.endeca.infront.cartridge.MediaBanner and com.endeca.infront.cartridge.MediaBannerConfig, respectively. However, they have different cartridge handler classes. The Commerce Reference Store version of the handler class is described below.

The /atg/endeca/assembler/cartridge/handler/MediaBannerHandler component, which is of class atg.projects.store.assembler.cartridge.handler.MediaBannerHandler, is responsible for creating and populating the MediaBanner object. The MediaBannerHandler class is an extension of the com.endeca.infront.cartridge.NavigationCartridgeHandler class with overridden wrapConfig() and process() methods.

The wrapConfig() method wraps the content item created from the XML template into a MediaBannerConfig object. The MediaBannerConfig object has a link property that contains the com.endeca.infront.cartridge.model.LinkBuilder object (this is the same LinkBuilder object that is referenced in the template). The LinkBuilder object represents the settings specified for the link in Experience Manager. Commerce Reference Store uses Oracle Endeca Commerce’s LinkBuilderEditor to render the appropriate link-related settings in Experience Manager and then those settings are stored in the LinkBuilder object.

This illustration is described in the surrounding text.

Note: The Config classes for the Oracle Endeca Commerce navigation cartridges, such as MediaBannerConfig, are an implementation-specific convention. They exist to simplify the initialize() method of the associated cartridge handler by externalizing the steps for aggregating all of the necessary cartridge configuration from various sources. This includes default configuration, business user configuration in Experience Manager, and URL configuration specified by the application end user. Because the Commerce Reference Store version of the MediaBanner cartridge is based on the Oracle Endeca Commerce version, it also uses the MediaBannerConfig class (though all of the configuration comes solely from Experience Manager). The resulting MediaBannerConfig object contains the full set of properties required by the MediaBannerHandler. Note that the other Oracle ATG Web Commerce-specific cartridges do not use Config classes as part of their implementation.

The process() method creates a new MediaBanner object and populates its link property (the imageURL property comes directly from the configuration in Experience Manager). To populate the link property, the MediaBannerHandler calls the createAction() method on the LinkBuilder object contained in the MediaBannerConfig object. This method constructs a link to a navigation state or a static page and then returns it in an object of one of the following types, each of which is a sub-class of the com.endeca.infront.cartridge.model.Action class:

The MediaBannerHandler component has several configurable properties. These properties reference components that the LinkBuilder object requires in order to construct the link associated with the media banner image.

Note: See the ATG-Endeca Integration Guide for more details on the WorkbenchContentSource and DefaultActionPathProvider components.

Finally, the MediaBanner cartridge name does not match the name of its handler exactly, so it must be added to the NucleusAssemblerFactory.handlerMapping property so that the Assembler can identify the proper handler for it. See Registering Cartridges with the NucleusAssemblerFactory for details.


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