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:
WorkbenchContentSource

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.


Constructor Summary
AbstractContentSource()
          Constructs a content source.
AbstractContentSource(String defaultSiteRootPath)
          Deprecated. 
 
Method Summary
 void destroy()
          Performs any actions needed to clean up after the content source.
 String getDefaultSiteRootPath()
          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.
 ContentLocator resolveContent(javax.servlet.http.HttpServletRequest request)
          Attempts to resolve content based on the given request.
 void setDefaultSiteRootPath(String defaultSiteRootPath)
           
 
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
 

Constructor Detail

AbstractContentSource

@Deprecated
public AbstractContentSource(String defaultSiteRootPath)
Deprecated. 

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.

AbstractContentSource

public AbstractContentSource()
Constructs a content source.

Method Detail

getDefaultSiteRootPath

public String getDefaultSiteRootPath()
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.

Returns:
The Default Site Root Path.

setDefaultSiteRootPath

public void setDefaultSiteRootPath(String defaultSiteRootPath)

resolveContent

public ContentLocator resolveContent(javax.servlet.http.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()
Description copied from interface: ContentSource
Performs any actions needed to clean up after the content source.

Specified by:
destroy in interface ContentSource


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