*/
package org.onap.portalapp.conf;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.sql.DataSource;
-
import org.onap.portalapp.login.LoginStrategyImpl;
import org.onap.portalapp.scheduler.RegistryAdapter;
import org.onap.portalsdk.core.auth.LoginStrategy;
import org.onap.portalsdk.core.util.SystemProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-import org.springframework.context.annotation.Profile;
-import org.springframework.context.annotation.PropertySource;
+import org.springframework.context.annotation.*;
+import org.springframework.core.io.Resource;
+import org.springframework.jdbc.datasource.init.DataSourceInitializer;
+import org.springframework.jdbc.datasource.init.DatabasePopulator;
+import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
+import org.springframework.scheduling.quartz.SpringBeanJobFactory;
+import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.core.io.Resource;
-import org.springframework.jdbc.datasource.init.DataSourceInitializer;
-import org.springframework.jdbc.datasource.init.DatabasePopulator;
-import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
+
+import javax.sql.DataSource;
+import java.util.ArrayList;
+import java.util.List;
/**
* ONAP Portal SDK sample application. Extends core AppConfig class to
@Profile("src")
@EnableAsync
@EnableScheduling
+@EnableAspectJAutoProxy(proxyTargetClass=true)
public class ExternalAppConfig extends AppConfig implements Configurable {
private RegistryAdapter schedulerRegistryAdapter;
* populates it with triggers.
*
* @return New instance of {@link SchedulerFactoryBean}
- * @throws Exception
*/
- // @Bean // ANNOTATION COMMENTED OUT
- // APPLICATIONS REQUIRING QUARTZ SHOULD RESTORE ANNOTATION
- public SchedulerFactoryBean schedulerFactoryBean() throws Exception {
- SchedulerFactoryBean scheduler = new SchedulerFactoryBean();
- scheduler.setTriggers(schedulerRegistryAdapter.getTriggers());
- scheduler.setConfigLocation(appApplicationContext.getResource("WEB-INF/conf/quartz.properties"));
- scheduler.setDataSource(dataSource());
- return scheduler;
+ @Bean
+ public SchedulerFactoryBean schedulerFactoryBean() {
+ SchedulerFactoryBean schedulerFactory = new SchedulerFactoryBean();
+ schedulerFactory.setJobFactory(new SpringBeanJobFactory());
+ return schedulerFactory;
}
return populator;
}
+
+ /*@Bean
+ public SpringLiquibase liquibaseBean(DataSource dataSource) {
+ SpringLiquibase springLiquibase = new SpringLiquibase();
+ springLiquibase.setDataSource(dataSource);
+ springLiquibase.setChangeLog("classpath:db-master-changelog.xml");
+ return springLiquibase;
+ }*/
/**
* Sets the scheduler registry adapter.
public LoginStrategy loginStrategy() {
return new LoginStrategyImpl();
}
+
+ @Bean
+ public CommonsMultipartResolver multipartResolver() {
+ CommonsMultipartResolver resolver=new CommonsMultipartResolver();
+ resolver.setDefaultEncoding("utf-8");
+ return resolver;
+ }
+
}