org.zodiac.autoconfigure.report.PlatformReportAutoConfiguration Maven / Gradle / Ivy
package org.zodiac.autoconfigure.report;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.core.annotation.Order;
import org.zodiac.autoconfigure.report.condition.ConditionalOnReportEnabled;
import org.zodiac.autoconfigure.ureport.condition.ConditionalOnUReportEnabled;
@Order
@SpringBootConfiguration
@ConditionalOnReportEnabled
@ConditionalOnUReportEnabled
//@ImportResource(value = {"classpath:ureport-console-context.xml"})
//@EnableConfigurationProperties(value = {PlatformReportProperties.class, PlatformReportDatabaseProperties.class})
@ConditionalOnClass(name = {"com.bstek.ureport.provider.report.ReportProvider", "org.zodiac.report.config.PlatfromReportInfo"})
//@ConditionalOnProperty(value = org.zodiac.report.constants.PlatformReportSystemPropertiesConstants.PLATFORM_REPORT_ENABLED, havingValue = "true", matchIfMissing = true)
public class PlatformReportAutoConfiguration {
public PlatformReportAutoConfiguration() {
}
@Bean
@ConditionalOnMissingBean
@ConfigurationProperties(prefix = org.zodiac.report.constants.PlatformReportSystemPropertiesConstants.PLATFORM_REPORT_PREFIX, ignoreInvalidFields = true)
protected PlatformReportProperties platformReportProperties() {
return new PlatformReportProperties();
}
@Bean
@ConditionalOnMissingBean
@ConfigurationProperties(prefix = org.zodiac.report.constants.PlatformReportSystemPropertiesConstants.PLATFORM_REPORT_DATABASE_PROVIDER_PREFIX, ignoreInvalidFields = true)
protected PlatformReportDatabaseProperties platformReportDatabaseProperties() {
return new PlatformReportDatabaseProperties();
}
@Bean
@ConditionalOnMissingBean
protected com.bstek.ureport.UReportPropertyPlaceholderConfigurer uReportPropertyPlaceholderConfigurer(PlatformReportProperties platformReportProperties) {
return new org.zodiac.report.provider.PlatformReportPlaceholderProvider(platformReportProperties);
}
}