org.hippoecm.hst.sitemapitemhandler
Class AbstractHstSiteMapHandler

java.lang.Object
  extended by org.hippoecm.hst.sitemapitemhandler.AbstractHstSiteMapHandler
All Implemented Interfaces:
HstSiteMapItemHandler

public abstract class AbstractHstSiteMapHandler
extends Object
implements HstSiteMapItemHandler

The abstract implementation of the HstSiteMapItemHandler interface. Note that HstSiteMapItemHandler's are used concurrent and are not thread-safe. Implementations should take care of concurrency.


Constructor Summary
AbstractHstSiteMapHandler()
           
 
Method Summary
 void destroy()
          Override this method when the destroy of this HstSiteMapItemHandler should invoke some processing, for example clear a cache
 javax.servlet.ServletContext getServletContext()
           
 SiteMapItemHandlerConfiguration getSiteMapItemHandlerConfiguration()
          Through the SiteMapItemHandlerConfiguration all (resolved) configuration properties can be accessed.
 HstURLFactory getURLFactory(ResolvedSiteMapItem resolvedSiteMapItem)
           
 void init(javax.servlet.ServletContext servletContext, SiteMapItemHandlerConfiguration handlerConfig)
          Allows the HstSiteMapItemHandler to initialize itself
 ResolvedSiteMapItem matchSiteMapItem(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ResolvedSiteMapItem currentResolvedSiteMapItem, String pathInfo)
          Resolves with the help of the current resolvedSiteMapItem to a new sitemap item with path pathInfo
 ResolvedSiteMapItem process(ResolvedSiteMapItem resolvedSiteMapItem, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Override this method when you are implementing your own real HstSiteMapHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractHstSiteMapHandler

public AbstractHstSiteMapHandler()
Method Detail

init

public void init(javax.servlet.ServletContext servletContext,
                 SiteMapItemHandlerConfiguration handlerConfig)
          throws HstSiteMapItemHandlerException
Description copied from interface: HstSiteMapItemHandler
Allows the HstSiteMapItemHandler to initialize itself

Specified by:
init in interface HstSiteMapItemHandler
handlerConfig - the componentConfigBean configuration
Throws:
HstSiteMapItemHandlerException

process

public ResolvedSiteMapItem process(ResolvedSiteMapItem resolvedSiteMapItem,
                                   javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response)
                            throws HstSiteMapItemHandlerException
Override this method when you are implementing your own real HstSiteMapHandler. By default, the AbstractHstSiteMapHandler returns the resolvedSiteMapItem directly.

Specified by:
process in interface HstSiteMapItemHandler
Returns:
a new or the original ResolvedSiteMapItem, or null when the handler did for example already write the entire response and request processing can be stopped
Throws:
HstSiteMapItemHandlerException

destroy

public void destroy()
             throws HstSiteMapItemHandlerException
Override this method when the destroy of this HstSiteMapItemHandler should invoke some processing, for example clear a cache

Specified by:
destroy in interface HstSiteMapItemHandler
Throws:
HstSiteMapItemHandlerException

getSiteMapItemHandlerConfiguration

public SiteMapItemHandlerConfiguration getSiteMapItemHandlerConfiguration()
Description copied from interface: HstSiteMapItemHandler
Through the SiteMapItemHandlerConfiguration all (resolved) configuration properties can be accessed.

Specified by:
getSiteMapItemHandlerConfiguration in interface HstSiteMapItemHandler
Returns:
the SiteMapItemHandlerConfiguration backing this HstSiteMapItemHandler

getServletContext

public javax.servlet.ServletContext getServletContext()
Specified by:
getServletContext in interface HstSiteMapItemHandler
Returns:
Retrieves the servletContext to which this HstSiteMapItemHandler is bound

matchSiteMapItem

public ResolvedSiteMapItem matchSiteMapItem(javax.servlet.http.HttpServletRequest request,
                                            javax.servlet.http.HttpServletResponse response,
                                            ResolvedSiteMapItem currentResolvedSiteMapItem,
                                            String pathInfo)
                                     throws MatchException
Resolves with the help of the current resolvedSiteMapItem to a new sitemap item with path pathInfo

Parameters:
request -
response -
currentResolvedSiteMapItem -
pathInfo -
Returns:
a new ResolvedSiteMapItem
Throws:
MatchException - when the pathInfo cannot be matched

getURLFactory

public HstURLFactory getURLFactory(ResolvedSiteMapItem resolvedSiteMapItem)
Parameters:
resolvedSiteMapItem -
Returns:
the HstURLFactory


Copyright © 2008-2012 Hippo. All Rights Reserved.