atg.projects.store.assembler.cartridge
Class CrossCartridgeItemsLookup

java.lang.Object
  extended by atg.projects.store.assembler.cartridge.ContentItemTreeIterator
      extended by atg.projects.store.assembler.cartridge.CrossCartridgeItemsLookup

public class CrossCartridgeItemsLookup
extends ContentItemTreeIterator

This is the subclass of ContentItemTreeIterator that iterates through the content item tree looking for the items displayed in different kind of cartridges. The main purpose of this class is to put all displayed items into one bucket so that other component can check it to avoid duplicates in the cartridges.

The class looks for displayed items only in the cartridges with types configured in the typeToPropertyNameMap. The typeToPropertyNameMap contains mapping between cartridge type and property name where the displayed items are stored. Items are expected to be RepositoryItems or Endeca Record objects. If detected items are RepositoryItems the repository ID is stored into the storage. If items are Endeca Records, then the ID of item is retrieved from the property configured in the itemIdKey property.

The ContentItemTreeIterator also performs caching of content items with IDs configured in the contentItemsToCache list. The cached content items can be used in cases where displayed items are not part of content item but retrieved in the renderer code.

Version:
$Id: //hosting-blueprint/B2CBlueprint/version/10.2.1/Endeca/Assembler/src/atg/projects/store/assembler/cartridge/CrossCartridgeItemsLookup.java#2 $$Change: 788983 $
Author:
Natallia Paulouskaya

Field Summary
protected static java.lang.String CLASS_VERSION
          Class version string.
 
Constructor Summary
CrossCartridgeItemsLookup()
           
 
Method Summary
 java.util.Map<java.lang.String,java.util.List<com.endeca.infront.assembler.ContentItem>> getContentItemsCache()
           
 java.util.List<java.lang.String> getContentItemsToCache()
           
 java.util.List<java.lang.String> getDisplayedItems()
           
 java.lang.String getItemIdKey()
           
 java.util.Map<java.lang.String,java.lang.String> getTypeToPropertyNameMap()
           
 void process(com.endeca.infront.assembler.ContentItem pContentItem)
           The implementation of content item process method.
 void setContentItemsCache(java.util.Map<java.lang.String,java.util.List<com.endeca.infront.assembler.ContentItem>> pContentItemsCache)
           
 void setContentItemsToCache(java.util.List<java.lang.String> pContentItemsToCache)
           
 void setDisplayedItems(java.util.List<java.lang.String> pDisplayedItems)
           
 void setItemIdKey(java.lang.String pItemIdKey)
           
 void setTypeToPropertyNameMap(java.util.Map<java.lang.String,java.lang.String> pTypeToPropertyNameMap)
           
 
Methods inherited from class atg.projects.store.assembler.cartridge.ContentItemTreeIterator
getCircularReferenceErrorMessage, traverse, traverseChildren, traverseList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

protected static final java.lang.String CLASS_VERSION
Class version string.

See Also:
Constant Field Values
Constructor Detail

CrossCartridgeItemsLookup

public CrossCartridgeItemsLookup()
Method Detail

getDisplayedItems

public java.util.List<java.lang.String> getDisplayedItems()
Returns:
The list of displayed items.

setDisplayedItems

public void setDisplayedItems(java.util.List<java.lang.String> pDisplayedItems)
Parameters:
pDisplayedItems - - The list of displayed items to set.

getTypeToPropertyNameMap

public java.util.Map<java.lang.String,java.lang.String> getTypeToPropertyNameMap()
Returns:
the mapping between cartridge types and property names where the items we are looking for stored.

setTypeToPropertyNameMap

public void setTypeToPropertyNameMap(java.util.Map<java.lang.String,java.lang.String> pTypeToPropertyNameMap)
Parameters:
pTypeToPropertyNameMap - - The mapping between cartridge types and property names where the items we are looking for stored.

getContentItemsToCache

public java.util.List<java.lang.String> getContentItemsToCache()
Returns:
the array of content item types which should be cached during content item tree iteration.

setContentItemsToCache

public void setContentItemsToCache(java.util.List<java.lang.String> pContentItemsToCache)
Parameters:
pContentItemsToCache - - The array of content item types which should be cached during content item tree iteration.

getContentItemsCache

public java.util.Map<java.lang.String,java.util.List<com.endeca.infront.assembler.ContentItem>> getContentItemsCache()
Returns:
the mapping between cartridge types and list of content items assembled for this request.

setContentItemsCache

public void setContentItemsCache(java.util.Map<java.lang.String,java.util.List<com.endeca.infront.assembler.ContentItem>> pContentItemsCache)
Parameters:
pContentItemsCache - - The mapping between cartridge types and list of content items assembled for this request.

getItemIdKey

public java.lang.String getItemIdKey()
Returns:
the content item key where the item's ID stored.

setItemIdKey

public void setItemIdKey(java.lang.String pItemIdKey)
Parameters:
pItemIdKey - - The content item key where the item's ID stored.

process

public void process(com.endeca.infront.assembler.ContentItem pContentItem)

The implementation of content item process method. This method checks whether the passed in content item has one of the types configured in typeToPropertyNameMap and if so, retrieves items from the property mapped to the corresponding cartridge type.

Item IDs are stored in the displayedItems list. If the retrieved items are RepositoryItems, the ID is taken from the repositoryId property. In the case when the retrieved items are Endeca records, the IDs are taken from the property configured in the itemIdKey.

Specified by:
process in class ContentItemTreeIterator
Parameters:
pContentItem - The configuration item.