org.riotfamily.pages.mapping
Class PageHandlerMapping

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.springframework.web.servlet.handler.AbstractHandlerMapping
              extended by org.riotfamily.common.web.mapping.AbstractReverseHandlerMapping
                  extended by org.riotfamily.pages.mapping.PageHandlerMapping
All Implemented Interfaces:
ReverseHandlerMapping, ApplicationContextAware, Ordered, ServletContextAware, HandlerMapping

public class PageHandlerMapping
extends AbstractReverseHandlerMapping

Since:
6.5
Author:
Felix Gnass [fgnass at neteye dot de], Jan-Frederic Linde [jfl at neteye dot de]

Field Summary
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Fields inherited from interface org.riotfamily.common.web.mapping.ReverseHandlerMapping
TOP_LEVEL_HANDLER_NAME_ATTRIBUTE
 
Fields inherited from interface org.springframework.web.servlet.HandlerMapping
PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
PageHandlerMapping(PageDao pageDao, PageResolver pageResolver, PathCompleter pathCompleter)
           
 
Method Summary
protected  void exposeAttributes(String antPattern, String urlPath, HttpServletRequest request)
           
protected  void exposePathWithinMapping(String pathWithinMapping, HttpServletRequest request)
          Copied from AbstractUrlHandlerMapping
protected  Object getHandlerInternal(HttpServletRequest request)
           
protected  Object getPageHandler(Page page, HttpServletRequest request)
          Returns the handler for the given page.
protected  Object getPageNotFoundHandler(Site site, String path)
          Checks if an alias is registered for the given site and path and returns a RedirectController, or null in case no alias can be found.
protected  List<AttributePattern> getPatternsForHandler(String beanName, UrlResolverContext context)
          Subclasses must implement this method and return all patterns for the handler with the specified name.
 void setDefaultPageHandler(Object defaultPageHandler)
          Sets the handler to use if no matching handler for the page's pageType is found.
 
Methods inherited from class org.riotfamily.common.web.mapping.AbstractReverseHandlerMapping
addServletMappingIfNecessary, exposeHandlerName, getDefaults, getPatternForHandler, getPatternForHandler, getPatternsForHandler, getUrlForHandler, getUrlForHandler, getWildcardAttributes
 
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, initApplicationContext, initInterceptors, setDefaultHandler, setInterceptors, setOrder
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageHandlerMapping

public PageHandlerMapping(PageDao pageDao,
                          PageResolver pageResolver,
                          PathCompleter pathCompleter)
Method Detail

setDefaultPageHandler

public void setDefaultPageHandler(Object defaultPageHandler)
Sets the handler to use if no matching handler for the page's pageType is found. The handler will only be returned when the request maps to a page. Otherwise the default handler will be used.


getHandlerInternal

protected Object getHandlerInternal(HttpServletRequest request)
                             throws Exception
Specified by:
getHandlerInternal in class AbstractHandlerMapping
Throws:
Exception

getPageHandler

protected Object getPageHandler(Page page,
                                HttpServletRequest request)
Returns the handler for the given page.


getPageNotFoundHandler

protected Object getPageNotFoundHandler(Site site,
                                        String path)
Checks if an alias is registered for the given site and path and returns a RedirectController, or null in case no alias can be found.


exposePathWithinMapping

protected void exposePathWithinMapping(String pathWithinMapping,
                                       HttpServletRequest request)
Copied from AbstractUrlHandlerMapping


exposeAttributes

protected void exposeAttributes(String antPattern,
                                String urlPath,
                                HttpServletRequest request)

getPatternsForHandler

protected List<AttributePattern> getPatternsForHandler(String beanName,
                                                       UrlResolverContext context)
Description copied from class: AbstractReverseHandlerMapping
Subclasses must implement this method and return all patterns for the handler with the specified name.

Specified by:
getPatternsForHandler in class AbstractReverseHandlerMapping