org.broadleafcommerce.cms.web
Class PageURLProcessor

java.lang.Object
  extended by org.broadleafcommerce.cms.web.PageURLProcessor
All Implemented Interfaces:
URLProcessor

@Component(value="blPageURLProcessor")
public class PageURLProcessor
extends Object
implements URLProcessor

Based on the passed in request, this processor determines if a CMS managed page exists that matches the passed in URL. The ProcessURLFilter will check it's internal cache to determine which URL processor should be invoked for a passed in URL. If it is unable to find a matching processor in cache, then it will call each processor in turn to provide an attempt to process the URL. Created by bpolster.


Constructor Summary
PageURLProcessor()
           
 
Method Summary
 boolean canProcessURL(String key)
          Implementors of this interface will return true if they are able to process the current in request.
 String getBlcPageTemplateDirectory()
          Defaults to /WEB-INF/jsp/templates but can be overridden via Spring configuration.
 void processURL(String key)
          Determines if the requestURI for the passed in request matches a custom content managed page.
 void setBlcPageTemplateDirectory(String blcPageTemplateDirectory)
          Sets the directory where JSP page templates are stored.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageURLProcessor

public PageURLProcessor()
Method Detail

canProcessURL

public boolean canProcessURL(String key)
Implementors of this interface will return true if they are able to process the current in request. Implementors of this method will need to rely on the BroadleafRequestContext class which provides access to the current sandbox, locale, request, and response via a threadlocal context

Specified by:
canProcessURL in interface URLProcessor
Returns:
true if this URLProcessor is able to process the passed in request
See Also:
BroadleafRequestContext

processURL

public void processURL(String key)
                throws IOException,
                       javax.servlet.ServletException
Determines if the requestURI for the passed in request matches a custom content managed page. If so, the request is forwarded to the correct page template. The page object will be stored in the request attribute "BLC_PAGE".

Specified by:
processURL in interface URLProcessor
Parameters:
key - The URI to process
Throws:
IOException
javax.servlet.ServletException

getBlcPageTemplateDirectory

public String getBlcPageTemplateDirectory()
Defaults to /WEB-INF/jsp/templates but can be overridden via Spring configuration.

Returns:

setBlcPageTemplateDirectory

public void setBlcPageTemplateDirectory(String blcPageTemplateDirectory)
Sets the directory where JSP page templates are stored. If this method is not called, the default value of "/WEB-INF/jsp/templates" is used.



Copyright © 2011. All Rights Reserved.