public class ContentSlotHandler extends AbstractCartridgeHandler
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
.
Modifier and Type | Field and Description |
---|---|
static String |
AUDIT_CONTENTS
Key for the list of audit content items.
|
static String |
CONTENT_SOURCE_CONFIGURATION_ERROR |
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
|
protected ContentSource |
contentSource |
Constructor and Description |
---|
ContentSlotHandler() |
Modifier and Type | Method and Description |
---|---|
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.
|
void |
setContentSource(ContentSource pContentSource) |
initialize
public static final String CONTENTS
public static final String CONTENT_SOURCE_CONFIGURATION_ERROR
public static final String AUDIT_CONTENTS
protected ContentSource contentSource
protected MdexContentRequestBroker contentBroker
public void setContentSource(ContentSource pContentSource)
public void setContentBroker(MdexContentRequestBroker pContentBroker)
ContentSlotHandler
. Use of the MdexContentRequestBroker in other classes
is not supported.public void preprocess(ContentItem pContentItem) throws CartridgeHandlerException
CONTENTS
.preprocess
in interface CartridgeHandler<ContentItem>
preprocess
in class AbstractCartridgeHandler
pContentItem
- the cartridge configuration returned by
AbstractCartridgeHandler.initialize(ContentItem)
.CartridgeHandlerException
- exceptions are never thrown by
this no-op implementationpublic ContentItem process(ContentItem pContentItem) throws CartridgeHandlerException
CartridgeHandler
If a CartridgeHandlerException is thrown during the preprocess method, then the process method is not called.
pContentItem
- the cartridge configuration returned by
CartridgeHandler.initialize(ContentItem)
. Note that this instance may have been modified by
the CartridgeHandler.preprocess(ContentItem)
method.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 © 2013, Oracle and/or its affiliates. All rights reserved.