Class SiteContextFactory

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware

    public class SiteContextFactory
    extends Object
    implements org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware
    Factory for creating SiteContext with common properties. It also uses the MacroResolver to resolve any macros specified in the rootFolderPath before creating the context (remember that macros can vary between requests).
    Author:
    Alfonso Vásquez
    • Field Detail

      • DEFAULT_SHUTDOWN_TIMEOUT

        public static final long DEFAULT_SHUTDOWN_TIMEOUT
        See Also:
        Constant Field Values
      • DEFAULT_PUBLISHING_TARGET_MACRO_NAME

        public static final String DEFAULT_PUBLISHING_TARGET_MACRO_NAME
        See Also:
        Constant Field Values
      • servletContext

        protected javax.servlet.ServletContext servletContext
      • siteNameMacroName

        protected String siteNameMacroName
      • storeType

        protected String storeType
      • rootFolderPath

        protected String rootFolderPath
      • staticAssetsPath

        protected String staticAssetsPath
      • templatesPath

        protected String templatesPath
      • initScriptPath

        protected String initScriptPath
      • restScriptsPath

        protected String restScriptsPath
      • controllerScriptsPath

        protected String controllerScriptsPath
      • configPaths

        protected String[] configPaths
      • applicationContextPaths

        protected String[] applicationContextPaths
      • urlRewriteConfPaths

        protected String[] urlRewriteConfPaths
      • proxyConfigPaths

        protected String[] proxyConfigPaths
      • translationConfigPaths

        protected String[] translationConfigPaths
      • groovyClassesPath

        protected String groovyClassesPath
      • mergingOn

        protected boolean mergingOn
      • cacheOn

        protected boolean cacheOn
      • maxAllowedItemsInCache

        protected int maxAllowedItemsInCache
      • ignoreHiddenFiles

        protected boolean ignoreHiddenFiles
      • freeMarkerConfigFactory

        protected org.springframework.beans.factory.ObjectFactory<org.springframework.web.servlet.view.freemarker.FreeMarkerConfig> freeMarkerConfigFactory
      • urlTransformationEngine

        protected org.craftercms.core.url.UrlTransformationEngine urlTransformationEngine
      • storeService

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

        protected org.craftercms.core.util.cache.CacheTemplate cacheTemplate
      • globalApplicationContext

        protected org.springframework.context.ApplicationContext globalApplicationContext
      • jobThreadPoolExecutor

        protected Executor jobThreadPoolExecutor
      • cacheWarmUpEnabled

        protected boolean cacheWarmUpEnabled
      • initTimeout

        protected long initTimeout
      • configurationReader

        protected org.craftercms.commons.config.EncryptionAwareConfigurationReader configurationReader
      • disableVariableRestrictions

        protected boolean disableVariableRestrictions
      • defaultPublicBeans

        protected String[] defaultPublicBeans
      • shutdownTimeout

        protected long shutdownTimeout
      • publishingTargetResolver

        protected org.craftercms.commons.config.PublishingTargetResolver publishingTargetResolver
      • publishingTargetMacroName

        protected String publishingTargetMacroName
      • enableScriptSandbox

        protected boolean enableScriptSandbox
      • enableSandboxBlacklist

        protected boolean enableSandboxBlacklist
      • sandboxBlacklist

        protected String sandboxBlacklist
      • enableExpressions

        protected boolean enableExpressions
      • enableTranslation

        protected boolean enableTranslation
    • Constructor Detail

      • SiteContextFactory

        public SiteContextFactory()
    • Method Detail

      • setServletContext

        public void setServletContext​(javax.servlet.ServletContext servletContext)
        Specified by:
        setServletContext in interface org.springframework.web.context.ServletContextAware
      • setSiteNameMacroName

        public void setSiteNameMacroName​(String siteNameMacroName)
      • setStoreType

        public void setStoreType​(String storeType)
      • setRootFolderPath

        public void setRootFolderPath​(String rootFolderPath)
      • setStaticAssetsPath

        public void setStaticAssetsPath​(String staticAssetsPath)
      • setTemplatesPath

        public void setTemplatesPath​(String templatesPath)
      • setInitScriptPath

        public void setInitScriptPath​(String initScriptPath)
      • setRestScriptsPath

        public void setRestScriptsPath​(String restScriptsPath)
      • setControllerScriptsPath

        public void setControllerScriptsPath​(String controllerScriptsPath)
      • setConfigPaths

        public void setConfigPaths​(String[] configPaths)
      • setApplicationContextPaths

        public void setApplicationContextPaths​(String[] applicationContextPaths)
      • setUrlRewriteConfPaths

        public void setUrlRewriteConfPaths​(String[] urlRewriteConfPaths)
      • setProxyConfigPaths

        public void setProxyConfigPaths​(String[] proxyConfigPaths)
      • setTranslationConfigPaths

        public void setTranslationConfigPaths​(String[] translationConfigPaths)
      • setGroovyClassesPath

        public void setGroovyClassesPath​(String groovyClassesPath)
      • setGroovyGlobalVars

        public void setGroovyGlobalVars​(Map<String,​Object> groovyGlobalVars)
      • setMergingOn

        public void setMergingOn​(boolean mergingOn)
      • setCacheOn

        public void setCacheOn​(boolean cacheOn)
      • setMaxAllowedItemsInCache

        public void setMaxAllowedItemsInCache​(int maxAllowedItemsInCache)
      • setIgnoreHiddenFiles

        public void setIgnoreHiddenFiles​(boolean ignoreHiddenFiles)
      • setFreeMarkerConfigFactory

        public void setFreeMarkerConfigFactory​(org.springframework.beans.factory.ObjectFactory<org.springframework.web.servlet.view.freemarker.FreeMarkerConfig> freeMarkerConfigFactory)
      • setUrlTransformationEngine

        public void setUrlTransformationEngine​(org.craftercms.core.url.UrlTransformationEngine urlTransformationEngine)
      • setStoreService

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

        public void setCacheTemplate​(org.craftercms.core.util.cache.CacheTemplate cacheTemplate)
      • setMacroResolver

        public void setMacroResolver​(MacroResolver macroResolver)
      • setJobThreadPoolExecutor

        public void setJobThreadPoolExecutor​(Executor jobThreadPoolExecutor)
      • setGraphQLFactory

        public void setGraphQLFactory​(GraphQLFactory graphQLFactory)
      • setCacheWarmUpEnabled

        public void setCacheWarmUpEnabled​(boolean cacheWarmUpEnabled)
      • setCacheWarmer

        public void setCacheWarmer​(SiteCacheWarmer cacheWarmer)
      • setInitTimeout

        public void setInitTimeout​(long initTimeout)
      • setConfigurationReader

        public void setConfigurationReader​(org.craftercms.commons.config.EncryptionAwareConfigurationReader configurationReader)
      • setDisableVariableRestrictions

        public void setDisableVariableRestrictions​(boolean disableVariableRestrictions)
      • setDefaultPublicBeans

        public void setDefaultPublicBeans​(String[] defaultPublicBeans)
      • setShutdownTimeout

        public void setShutdownTimeout​(long shutdownTimeout)
      • setPublishingTargetResolver

        public void setPublishingTargetResolver​(org.craftercms.commons.config.PublishingTargetResolver publishingTargetResolver)
      • setEnableScriptSandbox

        public void setEnableScriptSandbox​(boolean enableScriptSandbox)
      • setEnableSandboxBlacklist

        public void setEnableSandboxBlacklist​(boolean enableSandboxBlacklist)
      • setSandboxBlacklist

        public void setSandboxBlacklist​(String sandboxBlacklist)
      • setEnableExpressions

        public void setEnableExpressions​(boolean enableExpressions)
      • setEnableTranslation

        public void setEnableTranslation​(boolean enableTranslation)
      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException
      • getConfig

        protected org.apache.commons.configuration2.HierarchicalConfiguration getConfig​(SiteContext siteContext,
                                                                                        String[] configPaths,
                                                                                        org.springframework.core.io.ResourceLoader resourceLoader)
      • configureScriptSandbox

        protected void configureScriptSandbox​(SiteContext siteContext,
                                              org.springframework.core.io.ResourceLoader resourceLoader)
      • getApplicationContext

        protected org.springframework.context.ConfigurableApplicationContext getApplicationContext​(SiteContext siteContext,
                                                                                                   URLClassLoader classLoader,
                                                                                                   org.apache.commons.configuration2.HierarchicalConfiguration config,
                                                                                                   String[] applicationContextPaths,
                                                                                                   org.springframework.core.io.ResourceLoader resourceLoader)
      • getUrlRewriter

        protected org.tuckey.web.filters.urlrewrite.UrlRewriter getUrlRewriter​(SiteContext siteContext,
                                                                               String[] urlRewriteConfPaths,
                                                                               org.springframework.core.io.ResourceLoader resourceLoader)
      • getProxyConfig

        protected org.apache.commons.configuration2.HierarchicalConfiguration getProxyConfig​(SiteContext siteContext,
                                                                                             List<String> configPaths,
                                                                                             org.springframework.core.io.ResourceLoader resourceLoader)
      • getTranslationConfig

        protected org.apache.commons.configuration2.HierarchicalConfiguration getTranslationConfig​(SiteContext siteContext,
                                                                                                   List<String> configPaths,
                                                                                                   org.springframework.core.io.ResourceLoader resourceLoader)
      • buildLocaleResolver

        protected org.springframework.web.servlet.LocaleResolver buildLocaleResolver​(org.apache.commons.configuration2.HierarchicalConfiguration<?> configuration)
      • scheduleJobs

        protected org.quartz.Scheduler scheduleJobs​(SiteContext siteContext)