com.endeca.infront.cartridge
Class ContentSlotHandler

java.lang.Object
  extended by com.endeca.infront.assembler.AbstractCartridgeHandler
      extended by com.endeca.infront.cartridge.ContentSlotHandler
All Implemented Interfaces:
CartridgeHandler<ContentItem>

public class ContentSlotHandler
extends AbstractCartridgeHandler

This CartridgeHandler handles content slot invocations. It expects to modify a ContentItem of the form, ContentSlotConfig, which species a content collection and a rule limit. It also expects a ContentManager to be configured using setContentBroker(MdexContentRequestBroker).

This handler modifies the given content item in the preprocess() method by adding the List of ContentItem objects returned by the ContentManager to the given content item using the key, CONTENTS.


Field Summary
static String AUDIT_CONTENTS
          Key for the list of audit content items.
protected  MdexContentRequestBroker contentBroker
          The broker for querying the MDEX.
static String CONTENTS
          The key for the list of content items to be added to the content slot
 
Constructor Summary
ContentSlotHandler()
           
 
Method Summary
 void preprocess(ContentItem pContentItem)
          Adds the List of ContentItem objects returned by the ContentManager to the input content item using the key, CONTENTS.
 ContentItem process(ContentItem pContentItem)
          Called by the assembler after the preprocess method has been called for all cartridges in a complete response model.
 void setContentBroker(MdexContentRequestBroker pContentBroker)
          Provider of essential services to dynamic content handlers.
 
Methods inherited from class com.endeca.infront.assembler.AbstractCartridgeHandler
initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENTS

public static final String CONTENTS
The key for the list of content items to be added to the content slot

See Also:
Constant Field Values

AUDIT_CONTENTS

public static final String AUDIT_CONTENTS
Key for the list of audit content items.

See Also:
Constant Field Values

contentBroker

protected MdexContentRequestBroker contentBroker
The broker for querying the MDEX.

Constructor Detail

ContentSlotHandler

public ContentSlotHandler()
Method Detail

setContentBroker

public void setContentBroker(MdexContentRequestBroker pContentBroker)
Provider of essential services to dynamic content handlers. Through this broker, a dynamic content slot handler may query the content source associated with the request. The MdexContentRequestBroker must be available within the scope of the request, but should not be modified or used outside the scope of the ContentSlotHandler. Use of the MdexContentRequestBroker in other classes is not supported.


preprocess

public void preprocess(ContentItem pContentItem)
                throws CartridgeHandlerException
Adds the List of ContentItem objects returned by the ContentManager to the input content item using the key, CONTENTS.

Specified by:
preprocess in interface CartridgeHandler<ContentItem>
Overrides:
preprocess in class AbstractCartridgeHandler
Parameters:
pContentItem - the cartridge configuration returned by AbstractCartridgeHandler.initialize(ContentItem).
Throws:
CartridgeHandlerException - exceptions are never thrown by this no-op implementation

process

public ContentItem process(ContentItem pContentItem)
                    throws CartridgeHandlerException
Description copied from interface: CartridgeHandler
Called by the assembler after the preprocess method has been called for all cartridges in a complete response model. The assembler uses a post-order traversal pattern, so all children should be processed by the time this method is called.

If a CartridgeHandlerException is thrown during the preprocess method, then the process method is not called.

Parameters:
pContentItem - the cartridge configuration returned by CartridgeHandler.initialize(ContentItem). Note that this instance may have been modified by the CartridgeHandler.preprocess(ContentItem) method.
Returns:
the output value for this cartridge. If null is returned, then the corresponding node in the output tree will be deleted.
Throws:
CartridgeHandlerException - if an error occurs that is scoped to an individual cartridge instance. This exception will not halt the entire assembly process, which occurs across multiple cartridges; instead, this exception will be packaged in the overall response model. If an unchecked exception is thrown, then the entire assembly process will be halted.


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