The /atg/endeca/assembler/cartridge/renderer/ContentItemToRendererPath component is responsible for locating the correct renderer for the ContentItem that has been return by the Assembler in response to a request. The ContentItemToRendererPath component is an instance of the class atg.endeca.assembler.cartridge.renderer.CartridgeRenderingPathMapperImpl, which implements the atg.endeca.assembler.cartridge.renderer.CartridgeRenderingMapper interface. The core method of the CartridgeRenderingMapper interface is:

public String getRendererPathForContentItem(ContentItem pItem);

The getRendererPathForContentItem() method returns the web-app relative path of the JSP file used to render the ContentItem.

Creating the Path

The ContentItemToRendererPath component provides some configurable properties that control how a ContentItem is mapped to a JSP path:

To create the path, getRendererPathForContentItem() creates a replacement map that gets populated with values calculated by other components or retrieved from other contexts. The replacement map values are then used to replace placeholders in the ContentItemToRendererPath.formatString property, resulting in a string that defines the relative path of the JSP file.

ReplacementValueProducer and SelectorReplacementValueProducer

The atg.endeca.assembler.cartridge.renderer.ReplacementValueProducer interface can be implemented by components that need to make new, perhaps dynamically-generated, values available for use in the replacement map and, by extension, the formatString. It contains one method that adds values to the replacement map.

/** Add any replacement values to pMap. Note that a given
 * instance may add a single value, multiple values, or none.
 *
 * @param pMap--The map to add parameters to.
 * @param pContentItem--The ContentItem (available for reference
 *   and calculating replacement values based on the content item)
 *   ContentItem should not be modified.
 * @param pRequest--The current request. May be null, if invoked
 *   outside of a request.
 */
public void addReplacementValues(Map<String, String> pMap,
                                   ContentItem pContentItem,
                                   HttpServletRequest pRequest);

Out of the box, the ATG Platform includes one replacement value producer, the /atg/endeca/assembler/cartridge/renderer/SelectorReplacementValueProducer. This component adds a selector and selectorSuffix to the replacement map, if needed. A selector represents the type of device being used to view the web page, for example, a mobile device. The selectorSuffix is a corresponding suffix—for example, “_mobile”—that gets added to the end of the JSP renderer path, so that the correct JSP is rendered for that type of device.

The SelectorReplacementValueProducer component is of class atg.endeca.assembler.cartridge.renderer and its primary configurable properties are:


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