com.endeca.infront.cartridge
Class ContentIncludeHandler

java.lang.Object
  extended by com.endeca.infront.assembler.AbstractCartridgeHandler
      extended by com.endeca.infront.cartridge.ContentIncludeHandler
All Implemented Interfaces:
CartridgeHandler<ContentItem>
Direct Known Subclasses:
RedirectAwareContentIncludeHandler

public class ContentIncludeHandler
extends AbstractCartridgeHandler

Cartridge handler that handles content from a URI.

See Also:
ContentInclude

Field Summary
static String ENDECA_CONTENT_PATH
          The key for the content root value.
static String ENDECA_SITE_ROOT_PATH
          The key for the site root value.
 
Constructor Summary
ContentIncludeHandler()
           
 
Method Summary
protected  ContentItem getContent(ContentLocator locator)
          A method that allows subclasses to control the content returned by the preprocess(com.endeca.infront.assembler.ContentItem) method.
 ContentSource getContentSource()
          Gets the content source used by this handler.
 void preprocess(ContentItem pContentItem)
          Gets content from the ContentSource and stores it in the input ContentItem.
 ContentItem process(ContentItem pContentItem)
          Returns the content obtained from the ContentSource (retrieved in preprocess(com.endeca.infront.assembler.ContentItem)).
 void setContentSource(ContentSource pContentSource)
          Sets the content source used by this handler.
 
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

ENDECA_CONTENT_PATH

public static final String ENDECA_CONTENT_PATH
The key for the content root value.

See Also:
Constant Field Values

ENDECA_SITE_ROOT_PATH

public static final String ENDECA_SITE_ROOT_PATH
The key for the site root value.

See Also:
Constant Field Values
Constructor Detail

ContentIncludeHandler

public ContentIncludeHandler()
Method Detail

getContentSource

public ContentSource getContentSource()
Gets the content source used by this handler.


setContentSource

public void setContentSource(ContentSource pContentSource)
Sets the content source used by this handler.


preprocess

public final void preprocess(ContentItem pContentItem)
                      throws CartridgeHandlerException
Gets content from the ContentSource and stores it in the input ContentItem.

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

getContent

protected ContentItem getContent(ContentLocator locator)
                          throws CartridgeHandlerException,
                                 ContentException
A method that allows subclasses to control the content returned by the preprocess(com.endeca.infront.assembler.ContentItem) method. This method will be called only if the content source is able to resolve content.

Parameters:
locator - the ContentLocator obtained from the ContentSource in the preprocess(com.endeca.infront.assembler.ContentItem) method.
Throws:
CartridgeHandlerException
ContentException

process

public ContentItem process(ContentItem pContentItem)
                    throws CartridgeHandlerException
Returns the content obtained from the ContentSource (retrieved in preprocess(com.endeca.infront.assembler.ContentItem)).

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.