Search in sources :

Example 1 with MessageBundleProperties

use of org.apereo.cas.configuration.model.core.web.MessageBundleProperties in project cas by apereo.

the class CasCoreWebConfiguration method messageSource.

@RefreshScope
@Bean
public HierarchicalMessageSource messageSource(@Qualifier("casCommonMessages") final Properties casCommonMessages) {
    final CasReloadableMessageBundle bean = new CasReloadableMessageBundle();
    final MessageBundleProperties mb = casProperties.getMessageBundle();
    bean.setDefaultEncoding(mb.getEncoding());
    bean.setCacheSeconds(mb.getCacheSeconds());
    bean.setFallbackToSystemLocale(mb.isFallbackSystemLocale());
    bean.setUseCodeAsDefaultMessage(mb.isUseCodeMessage());
    bean.setBasenames(mb.getBaseNames().toArray(new String[] {}));
    bean.setCommonMessages(casCommonMessages);
    return bean;
}
Also used : CasReloadableMessageBundle(org.apereo.cas.web.view.CasReloadableMessageBundle) MessageBundleProperties(org.apereo.cas.configuration.model.core.web.MessageBundleProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) PropertiesFactoryBean(org.springframework.beans.factory.config.PropertiesFactoryBean) FactoryBean(org.springframework.beans.factory.FactoryBean) SimpleUrlValidatorFactoryBean(org.apereo.cas.web.SimpleUrlValidatorFactoryBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

MessageBundleProperties (org.apereo.cas.configuration.model.core.web.MessageBundleProperties)1 SimpleUrlValidatorFactoryBean (org.apereo.cas.web.SimpleUrlValidatorFactoryBean)1 CasReloadableMessageBundle (org.apereo.cas.web.view.CasReloadableMessageBundle)1 FactoryBean (org.springframework.beans.factory.FactoryBean)1 PropertiesFactoryBean (org.springframework.beans.factory.config.PropertiesFactoryBean)1 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)1 Bean (org.springframework.context.annotation.Bean)1