com.endeca.infront.content.source
Class AbstractContentSource

java.lang.Object
  extended by com.endeca.infront.content.source.AbstractContentSource
All Implemented Interfaces:
ContentSource
Direct Known Subclasses:
AuthoringContentSource, LiveContentSource

public abstract class AbstractContentSource
extends Object
implements ContentSource

Base implementation of the ContentSource interface.

Provides an empty destroy() method and a working implementation of resolveContent(HttpServletRequest) which makes use of the abstract ContentSource.resolveContent(String) method.


Field Summary
protected  String defaultSiteRootPath
           
 
Constructor Summary
AbstractContentSource(String defaultSiteRootPath)
          Constructs a content source with the given default site root path.
 
Method Summary
 void destroy()
          Empty implementation of the destroy method
 ContentLocator resolveContent(HttpServletRequest request)
          Attempts to resolve content based on the given request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.endeca.infront.content.source.ContentSource
resolveContent
 

Field Detail

defaultSiteRootPath

protected String defaultSiteRootPath
Constructor Detail

AbstractContentSource

public AbstractContentSource(String defaultSiteRootPath)
Constructs a content source with the given default site root path.

Parameters:
defaultSiteRootPath - If a valid content URI cannot be extracted from the request in the resolveContent(HttpServletRequest) method, it will attempt to resolve the content URI using this default site root path.
Method Detail

resolveContent

public ContentLocator resolveContent(HttpServletRequest request)
                              throws ContentException
Attempts to resolve content based on the given request.

If a valid content URI cannot be extracted from the request, we will attempt to resolve the content URI using the default site root path that was provided when this object was constructed.

Specified by:
resolveContent in interface ContentSource
Parameters:
request - The HttpServletRequest containing the content URI.
Returns:
a ContentLocator with the information that was inferred from the HttpServletRequest.
Throws:
ContentException - Thrown when there is an error accessing or forming content.

destroy

public void destroy()
Empty implementation of the destroy method

Specified by:
destroy in interface ContentSource


Copyright © 2012. All Rights Reserved.