use of org.craftercms.engine.util.spring.ApplicationContextAccessor in project engine by craftercms.
the class GroovyScriptUtils method addJobScriptVariables.
public static void addJobScriptVariables(Map<String, Object> variables, ServletContext servletContext) {
SiteContext siteContext = SiteContext.getCurrent();
if (siteContext != null && siteContext.getApplicationContext() != null) {
ApplicationContextAccessor appContext = new ApplicationContextAccessor();
appContext.setApplicationContext(siteContext.getApplicationContext());
variables.put(VARIABLE_APPLICATION_CONTEXT, appContext);
}
variables.put(VARIABLE_APPLICATION, servletContext);
variables.put(VARIABLE_LOGGER, GROOVY_SCRIPT_LOGGER);
addSiteContextVariable(variables);
addSiteConfigVariable(variables);
}
use of org.craftercms.engine.util.spring.ApplicationContextAccessor in project engine by craftercms.
the class CrafterFreeMarkerView method initServletContext.
@Override
protected void initServletContext(ServletContext servletContext) throws BeansException {
super.initServletContext(servletContext);
servletContextHashModel = new ServletContextHashModel(servletContext, getObjectWrapper());
applicationContextAccessor = new ApplicationContextAccessor(getApplicationContext());
}
Aggregations