public class SiteContextFactory extends Object implements org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware
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).Modifier and Type | Field and Description |
---|---|
protected String[] |
applicationContextPaths |
protected boolean |
cacheOn |
protected String[] |
configPaths |
protected String |
controllerScriptsPath |
static String |
DEFAULT_SITE_NAME_MACRO_NAME |
protected org.springframework.beans.factory.ObjectFactory<org.springframework.web.servlet.view.freemarker.FreeMarkerConfig> |
freeMarkerConfigFactory |
protected org.springframework.context.ApplicationContext |
globalApplicationContext |
protected String |
groovyClassesPath |
protected Map<String,Object> |
groovyGlobalVars |
protected boolean |
ignoreHiddenFiles |
protected String |
initScriptPath |
protected List<ScriptJobResolver> |
jobResolvers |
protected MacroResolver |
macroResolver |
protected int |
maxAllowedItemsInCache |
protected boolean |
mergingOn |
protected PreviewOverlayCallback |
overlayCallback |
protected String |
password |
protected String |
restScriptsPath |
protected String |
rootFolderPath |
protected javax.servlet.ServletContext |
servletContext |
protected String |
siteNameMacroName |
protected String |
staticAssetsPath |
protected String |
storeServerUrl |
protected org.craftercms.core.service.ContentStoreService |
storeService |
protected String |
storeType |
protected String |
templatesPath |
protected org.craftercms.commons.crypto.TextEncryptor |
textEncryptor |
protected org.craftercms.core.url.UrlTransformationEngine |
urlTransformationEngine |
protected String |
username |
Constructor and Description |
---|
SiteContextFactory() |
Modifier and Type | Method and Description |
---|---|
SiteContext |
createContext(String siteName) |
protected void |
executeInitScript(SiteContext siteContext,
ScriptFactory scriptFactory) |
protected org.springframework.context.ConfigurableApplicationContext |
getApplicationContext(SiteContext siteContext,
URLClassLoader classLoader,
org.apache.commons.configuration2.HierarchicalConfiguration config,
String[] applicationContextPaths,
org.springframework.core.io.ResourceLoader resourceLoader) |
protected URLClassLoader |
getClassLoader(SiteContext siteContext) |
protected org.apache.commons.configuration2.HierarchicalConfiguration |
getConfig(SiteContext siteContext,
String[] configPaths,
org.springframework.core.io.ResourceLoader resourceLoader) |
protected ScriptFactory |
getScriptFactory(SiteContext siteContext,
URLClassLoader classLoader) |
protected org.quartz.Scheduler |
scheduleJobs(SiteContext siteContext) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setApplicationContextPaths(String[] applicationContextPaths) |
void |
setCacheOn(boolean cacheOn) |
void |
setConfigPaths(String[] configPaths) |
void |
setControllerScriptsPath(String controllerScriptsPath) |
void |
setFreeMarkerConfigFactory(org.springframework.beans.factory.ObjectFactory<org.springframework.web.servlet.view.freemarker.FreeMarkerConfig> freeMarkerConfigFactory) |
void |
setGroovyClassesPath(String groovyClassesPath) |
void |
setGroovyGlobalVars(Map<String,Object> groovyGlobalVars) |
void |
setIgnoreHiddenFiles(boolean ignoreHiddenFiles) |
void |
setInitScriptPath(String initScriptPath) |
void |
setJobResolvers(List<ScriptJobResolver> jobResolvers) |
void |
setMacroResolver(MacroResolver macroResolver) |
void |
setMaxAllowedItemsInCache(int maxAllowedItemsInCache) |
void |
setMergingOn(boolean mergingOn) |
void |
setOverlayCallback(PreviewOverlayCallback overlayCallback) |
void |
setPassword(String password) |
void |
setRestScriptsPath(String restScriptsPath) |
void |
setRootFolderPath(String rootFolderPath) |
void |
setServletContext(javax.servlet.ServletContext servletContext) |
void |
setSiteNameMacroName(String siteNameMacroName) |
void |
setStaticAssetsPath(String staticAssetsPath) |
void |
setStoreServerUrl(String storeServerUrl) |
void |
setStoreService(org.craftercms.core.service.ContentStoreService storeService) |
void |
setStoreType(String storeType) |
void |
setTemplatesPath(String templatesPath) |
void |
setTextEncryptor(org.craftercms.commons.crypto.TextEncryptor textEncryptor) |
void |
setUrlTransformationEngine(org.craftercms.core.url.UrlTransformationEngine urlTransformationEngine) |
void |
setUsername(String username) |
public static final String DEFAULT_SITE_NAME_MACRO_NAME
protected javax.servlet.ServletContext servletContext
protected String siteNameMacroName
protected String storeType
protected String storeServerUrl
protected String username
protected String password
protected String rootFolderPath
protected String staticAssetsPath
protected String templatesPath
protected String initScriptPath
protected String restScriptsPath
protected String controllerScriptsPath
protected String[] configPaths
protected String[] applicationContextPaths
protected String groovyClassesPath
protected boolean mergingOn
protected boolean cacheOn
protected int maxAllowedItemsInCache
protected boolean ignoreHiddenFiles
protected org.springframework.beans.factory.ObjectFactory<org.springframework.web.servlet.view.freemarker.FreeMarkerConfig> freeMarkerConfigFactory
protected org.craftercms.core.url.UrlTransformationEngine urlTransformationEngine
protected PreviewOverlayCallback overlayCallback
protected org.craftercms.core.service.ContentStoreService storeService
protected MacroResolver macroResolver
protected org.springframework.context.ApplicationContext globalApplicationContext
protected List<ScriptJobResolver> jobResolvers
protected org.craftercms.commons.crypto.TextEncryptor textEncryptor
public void setServletContext(javax.servlet.ServletContext servletContext)
setServletContext
in interface org.springframework.web.context.ServletContextAware
public void setSiteNameMacroName(String siteNameMacroName)
public void setStoreType(String storeType)
public void setStoreServerUrl(String storeServerUrl)
public void setUsername(String username)
public void setPassword(String password)
public void setRootFolderPath(String rootFolderPath)
public void setStaticAssetsPath(String staticAssetsPath)
public void setTemplatesPath(String templatesPath)
public void setInitScriptPath(String initScriptPath)
public void setRestScriptsPath(String restScriptsPath)
public void setControllerScriptsPath(String controllerScriptsPath)
public void setConfigPaths(String[] configPaths)
public void setApplicationContextPaths(String[] applicationContextPaths)
public void setGroovyClassesPath(String groovyClassesPath)
public void setMergingOn(boolean mergingOn)
public void setCacheOn(boolean cacheOn)
public void setMaxAllowedItemsInCache(int maxAllowedItemsInCache)
public void setIgnoreHiddenFiles(boolean ignoreHiddenFiles)
public void setFreeMarkerConfigFactory(org.springframework.beans.factory.ObjectFactory<org.springframework.web.servlet.view.freemarker.FreeMarkerConfig> freeMarkerConfigFactory)
public void setUrlTransformationEngine(org.craftercms.core.url.UrlTransformationEngine urlTransformationEngine)
public void setOverlayCallback(PreviewOverlayCallback overlayCallback)
public void setStoreService(org.craftercms.core.service.ContentStoreService storeService)
public void setMacroResolver(MacroResolver macroResolver)
public void setJobResolvers(List<ScriptJobResolver> jobResolvers)
public void setTextEncryptor(org.craftercms.commons.crypto.TextEncryptor textEncryptor)
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public SiteContext createContext(String siteName)
protected org.apache.commons.configuration2.HierarchicalConfiguration getConfig(SiteContext siteContext, String[] configPaths, org.springframework.core.io.ResourceLoader resourceLoader)
protected URLClassLoader getClassLoader(SiteContext siteContext)
protected org.springframework.context.ConfigurableApplicationContext getApplicationContext(SiteContext siteContext, URLClassLoader classLoader, org.apache.commons.configuration2.HierarchicalConfiguration config, String[] applicationContextPaths, org.springframework.core.io.ResourceLoader resourceLoader)
protected ScriptFactory getScriptFactory(SiteContext siteContext, URLClassLoader classLoader)
protected org.quartz.Scheduler scheduleJobs(SiteContext siteContext)
protected void executeInitScript(SiteContext siteContext, ScriptFactory scriptFactory)
Copyright © 2019 CrafterCMS. All rights reserved.