Search in sources :

Example 1 with PortalConfig

use of com.haulmont.cuba.portal.config.PortalConfig in project cuba by cuba-platform.

the class FreeMarkerView method buildTemplateModel.

@Override
protected SimpleHash buildTemplateModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) {
    PortalConfig config = AppBeans.get(Configuration.class).getConfig(PortalConfig.class);
    SimpleHash context = super.buildTemplateModel(model, request, response);
    SecurityContext securityContext = AppContext.getSecurityContext();
    if (securityContext != null)
        context.put("userSession", securityContext.getSession());
    context.put("messages", messages);
    context.put("message", new MessageMethod());
    context.put("theme", config.getTheme());
    return context;
}
Also used : Configuration(com.haulmont.cuba.core.global.Configuration) PortalConfig(com.haulmont.cuba.portal.config.PortalConfig) SecurityContext(com.haulmont.cuba.core.sys.SecurityContext)

Aggregations

Configuration (com.haulmont.cuba.core.global.Configuration)1 SecurityContext (com.haulmont.cuba.core.sys.SecurityContext)1 PortalConfig (com.haulmont.cuba.portal.config.PortalConfig)1