Class PageRenderController

java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.support.WebContentGenerator
org.springframework.web.servlet.mvc.AbstractController
org.craftercms.engine.controller.PageRenderController
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.mvc.Controller

public class PageRenderController extends org.springframework.web.servlet.mvc.AbstractController
Default controller for rendering Crafter pages. If the site context is the fallback context, a fallback page is always rendered. The controller also tries to find a script controller for the page URL (when not fallback). If one is found, it's executed and its return value is interpreted as a view name to be rendered.
Author:
Alfonso Vasquez, Dejan Brkic
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
    protected String
     
    protected String
     
    protected PluginService
     
    protected org.craftercms.core.service.ContentStoreService
     

    Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator

    HEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POST
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Map<String,Object>
    createScriptVariables(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Map<String,Object> model)
     
    protected String
    executeScript(Script script, Map<String,Object> scriptVariables)
     
    protected Script
    getControllerScript(SiteContext siteContext, javax.servlet.http.HttpServletRequest request, String pageUrl)
     
    protected String
    getScriptUrl(SiteContext siteContext, ScriptFactory scriptFactory, javax.servlet.http.HttpServletRequest request, String pageUrl)
     
    protected org.springframework.web.servlet.ModelAndView
    handleRequestInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
     
    void
    setDisableVariableRestrictions(boolean disableVariableRestrictions)
     
    void
    setFallbackMessage(String fallbackMessage)
     
    void
    setFallbackPageUrl(String fallbackPageUrl)
     
    void
     
    void
    setStoreService(org.craftercms.core.service.ContentStoreService storeService)
     

    Methods inherited from class org.springframework.web.servlet.mvc.AbstractController

    handleRequest, isSynchronizeOnSession, setSynchronizeOnSession

    Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator

    applyCacheControl, applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isAlwaysMustRevalidate, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, prepareResponse, preventCaching, setAlwaysMustRevalidate, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader, setVaryByRequestHeaders

    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, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • fallbackPageUrl

      protected String fallbackPageUrl
    • fallbackMessage

      protected String fallbackMessage
    • storeService

      protected org.craftercms.core.service.ContentStoreService storeService
    • disableVariableRestrictions

      protected boolean disableVariableRestrictions
    • pluginService

      protected PluginService pluginService
  • Constructor Details

    • PageRenderController

      public PageRenderController()
  • Method Details

    • setFallbackPageUrl

      public void setFallbackPageUrl(String fallbackPageUrl)
    • setFallbackMessage

      public void setFallbackMessage(String fallbackMessage)
    • setStoreService

      public void setStoreService(org.craftercms.core.service.ContentStoreService storeService)
    • setDisableVariableRestrictions

      public void setDisableVariableRestrictions(boolean disableVariableRestrictions)
    • setPluginService

      public void setPluginService(PluginService pluginService)
    • handleRequestInternal

      protected org.springframework.web.servlet.ModelAndView handleRequestInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
      Specified by:
      handleRequestInternal in class org.springframework.web.servlet.mvc.AbstractController
      Throws:
      Exception
    • getControllerScript

      protected Script getControllerScript(SiteContext siteContext, javax.servlet.http.HttpServletRequest request, String pageUrl)
    • getScriptUrl

      protected String getScriptUrl(SiteContext siteContext, ScriptFactory scriptFactory, javax.servlet.http.HttpServletRequest request, String pageUrl)
    • createScriptVariables

      protected Map<String,Object> createScriptVariables(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Map<String,Object> model)
    • executeScript

      protected String executeScript(Script script, Map<String,Object> scriptVariables) throws Exception
      Throws:
      Exception