Search in sources :

Example 21 with FreeMarkerConfigurationFactoryBean

use of org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean in project springframework-source-5.1.x by wb02125055.

the class FreeMarkerConfigurerTests method freeMarkerConfigurationFactoryBeanWithConfigLocation.

@Test(expected = IOException.class)
public void freeMarkerConfigurationFactoryBeanWithConfigLocation() throws Exception {
    FreeMarkerConfigurationFactoryBean fcfb = new FreeMarkerConfigurationFactoryBean();
    fcfb.setConfigLocation(new FileSystemResource("myprops.properties"));
    Properties props = new Properties();
    props.setProperty("myprop", "/mydir");
    fcfb.setFreemarkerSettings(props);
    fcfb.afterPropertiesSet();
}
Also used : FreeMarkerConfigurationFactoryBean(org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean) FileSystemResource(org.springframework.core.io.FileSystemResource) Properties(java.util.Properties) Test(org.junit.Test)

Example 22 with FreeMarkerConfigurationFactoryBean

use of org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean in project igloo-parent by igloo-project.

the class NotificationTestConfig method freemarkerMailConfiguration.

@Bean
public FreeMarkerConfigurationFactoryBean freemarkerMailConfiguration() {
    FreeMarkerConfigurationFactoryBean configuration = new FreeMarkerConfigurationFactoryBean();
    configuration.setTemplateLoaderPath("classpath:notification");
    return configuration;
}
Also used : FreeMarkerConfigurationFactoryBean(org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean) FreeMarkerConfigurationFactoryBean(org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 23 with FreeMarkerConfigurationFactoryBean

use of org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean in project igloo-parent by igloo-project.

the class BasicApplicationCoreNotificationConfig method freemarkerMailConfiguration.

@Bean
public FreeMarkerConfigurationFactoryBean freemarkerMailConfiguration() {
    FreeMarkerConfigurationFactoryBean configuration = new FreeMarkerConfigurationFactoryBean();
    configuration.setTemplateLoaderPath("classpath:notification");
    return configuration;
}
Also used : FreeMarkerConfigurationFactoryBean(org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean) FreeMarkerConfigurationFactoryBean(org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 24 with FreeMarkerConfigurationFactoryBean

use of org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean in project tutorials-java by Artister.

the class GeneratorConfig method freeMarkerConfigurationFactoryBean.

@Bean
public FreeMarkerConfigurationFactoryBean freeMarkerConfigurationFactoryBean() {
    FreeMarkerConfigurationFactoryBean factoryBean = new FreeMarkerConfigurationFactoryBean();
    factoryBean.setTemplateLoaderPath("template");
    Properties properties = new Properties();
    properties.setProperty("defaultEncoding", "UTF-8");
    factoryBean.setFreemarkerSettings(properties);
    return factoryBean;
}
Also used : FreeMarkerConfigurationFactoryBean(org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean) Properties(java.util.Properties) GeneratorProperties(org.ko.generator.properties.GeneratorProperties) EnableConfigurationProperties(org.springframework.boot.context.properties.EnableConfigurationProperties) ConfigurationProperties(org.springframework.boot.context.properties.ConfigurationProperties) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) FreeMarkerConfigurationFactoryBean(org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

FreeMarkerConfigurationFactoryBean (org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean)24 Configuration (freemarker.template.Configuration)10 Test (org.junit.Test)6 BeforeEach (org.junit.jupiter.api.BeforeEach)6 Bean (org.springframework.context.annotation.Bean)6 HashMap (java.util.HashMap)5 Properties (java.util.Properties)5 Before (org.junit.Before)5 FileSystemResource (org.springframework.core.io.FileSystemResource)4 CloudInstance (com.sequenceiq.cloudbreak.cloud.model.CloudInstance)3 Image (com.sequenceiq.cloudbreak.cloud.model.Image)3 InstanceAuthentication (com.sequenceiq.cloudbreak.cloud.model.InstanceAuthentication)3 InstanceTemplate (com.sequenceiq.cloudbreak.cloud.model.InstanceTemplate)3 Security (com.sequenceiq.cloudbreak.cloud.model.Security)3 Group (com.sequenceiq.cloudbreak.cloud.model.Group)2 PortDefinition (com.sequenceiq.cloudbreak.cloud.model.PortDefinition)2 SecurityRule (com.sequenceiq.cloudbreak.cloud.model.SecurityRule)2 Volume (com.sequenceiq.cloudbreak.cloud.model.Volume)2 InstanceGroupType (com.sequenceiq.common.api.type.InstanceGroupType)2 Template (freemarker.template.Template)2