com.endeca.infront.cartridge
Class MediaBannerHandler

java.lang.Object
  extended by com.endeca.infront.cartridge.NavigationCartridgeHandler<MediaBannerConfig,MediaBanner>
      extended by com.endeca.infront.cartridge.MediaBannerHandler
All Implemented Interfaces:
CartridgeHandler<MediaBannerConfig>

public class MediaBannerHandler
extends NavigationCartridgeHandler<MediaBannerConfig,MediaBanner>

Cartridge handler that creates MediaObject model objects.


Constructor Summary
MediaBannerHandler()
           
 
Method Summary
 ContentSource getContentSource()
          Returns the content source that will be used to create Action objects.
 List<MediaSourceConfig> getMediaSourceList()
          Returns the list of MediaSourceConfig objects.
 NavigationStateBuilder getNavigationStateBuilder()
          Returns the NavigationStateBuilder that will be used by the LinkBuilder to create a navigation state and generate links.
 void preprocess(MediaBannerConfig config)
          Verifies the configuration for this handler.
 MediaBanner process(MediaBannerConfig config)
          Creates a response model of the form:
 void setContentSource(ContentSource contentSource)
          Sets the content source that will be used to create Action objects.
 void setMediaSourceList(List<MediaSourceConfig> mediaSrcList)
          Sets the list of MediaSourceConfig objects.
 void setNavigationStateBuilder(NavigationStateBuilder navigationStateBuilder)
          Sets the NavigationStateBuilder
protected  MediaBannerConfig wrapConfig(ContentItem pContentItem)
          Wraps the input ContentItem as a typed config object.
 
Methods inherited from class com.endeca.infront.cartridge.NavigationCartridgeHandler
createMdexRequest, dispatchNavigationEventInformation, executeMdexRequest, getActionPathProvider, getContentItemInitializer, getMdexRequestBroker, getNavigationState, initialize, populateNavigationPathDefaults, setActionPathProvider, setContentItemInitializer, setMdexRequestBroker, setNavigationState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MediaBannerHandler

public MediaBannerHandler()
Method Detail

getNavigationStateBuilder

public NavigationStateBuilder getNavigationStateBuilder()
Returns the NavigationStateBuilder that will be used by the LinkBuilder to create a navigation state and generate links.

Returns:
the NavigationStateBuilder of this media banner handler

setNavigationStateBuilder

public void setNavigationStateBuilder(NavigationStateBuilder navigationStateBuilder)
Sets the NavigationStateBuilder

See Also:
getNavigationStateBuilder()

getMediaSourceList

public List<MediaSourceConfig> getMediaSourceList()
Returns the list of MediaSourceConfig objects.

Returns:
a list of MediaSourceConfig objects. If this is null, a CartridgeHandlerException will be thrown from preprocess(com.endeca.infront.cartridge.MediaBannerConfig).

setMediaSourceList

public void setMediaSourceList(List<MediaSourceConfig> mediaSrcList)
Sets the list of MediaSourceConfig objects.

See Also:
getMediaSourceList()

getContentSource

public ContentSource getContentSource()
Returns the content source that will be used to create Action objects.


setContentSource

public void setContentSource(ContentSource contentSource)
Sets the content source that will be used to create Action objects.


preprocess

public void preprocess(MediaBannerConfig config)
                throws CartridgeHandlerException
Verifies the configuration for this handler.

Specified by:
preprocess in interface CartridgeHandler<MediaBannerConfig>
Overrides:
preprocess in class NavigationCartridgeHandler<MediaBannerConfig,MediaBanner>
Parameters:
config - the cartridge configuration returned by CartridgeHandler.initialize(ContentItem). This cartridge configuration may be modified by this handler. Note that this cartridge configuration is also passed to CartridgeHandler.process(ContentItem).
Throws:
CartridgeHandlerException - if mediaSourceList, navigationStateBuilder, or mdexResource have not been set. Also throws an exception if the MediaBannerConfig is not valid.
See Also:
getMediaSourceList()

process

public MediaBanner process(MediaBannerConfig config)
                    throws CartridgeHandlerException
Creates a response model of the form:
   {
     link: LinkBuilder,
     media: MediaObject
   }
 

Specified by:
process in interface CartridgeHandler<MediaBannerConfig>
Overrides:
process in class NavigationCartridgeHandler<MediaBannerConfig,MediaBanner>
Parameters:
config - 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.

wrapConfig

protected MediaBannerConfig wrapConfig(ContentItem pContentItem)
Description copied from class: NavigationCartridgeHandler
Wraps the input ContentItem as a typed config object. It is not expected that subclasses will mutate the input ContentItem, beyond passing it into their typed configuration class as a constructor argument.

Specified by:
wrapConfig in class NavigationCartridgeHandler<MediaBannerConfig,MediaBanner>
Parameters:
pContentItem - the configuration for this cartridge handler. This will either be the fully initialized configuration object, if a ContentItemInitializer has been set, or it will simply be the instance configuration.
Returns:
an instance of ConfigType which wraps the input ContentItem.
See Also:
NavigationCartridgeHandler.initialize(ContentItem), NavigationCartridgeHandler.setContentItemInitializer(ContentItemInitializer)


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