2020-03-31 14:02:29 +02:00
|
|
|
package eu.dnetlib.uoaadmintools;
|
|
|
|
|
2021-02-25 20:00:05 +01:00
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
2021-09-16 00:02:16 +02:00
|
|
|
import eu.dnetlib.uoaadmintools.configuration.GlobalVars;
|
2022-10-10 12:52:19 +02:00
|
|
|
import eu.dnetlib.uoaadmintools.configuration.properties.APIProperties;
|
2022-08-11 14:50:59 +02:00
|
|
|
import eu.dnetlib.uoaadmintools.configuration.properties.BrowserCacheConfig;
|
2021-02-25 20:00:05 +01:00
|
|
|
import eu.dnetlib.uoaadmintools.configuration.properties.ManagersApiConfig;
|
2020-03-31 14:02:29 +02:00
|
|
|
import eu.dnetlib.uoaadmintools.configuration.properties.MongoConfig;
|
2021-12-07 12:21:43 +01:00
|
|
|
import eu.dnetlib.uoaadmintoolslibrary.UoaAdminToolsLibraryConfiguration;
|
2021-02-25 12:57:22 +01:00
|
|
|
import eu.dnetlib.uoaauthorizationlibrary.configuration.AuthorizationConfiguration;
|
2020-03-31 14:02:29 +02:00
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
2021-02-25 20:00:05 +01:00
|
|
|
import org.springframework.context.annotation.Bean;
|
2020-09-24 14:02:39 +02:00
|
|
|
import org.springframework.context.annotation.Import;
|
2020-03-31 14:02:29 +02:00
|
|
|
import org.springframework.context.annotation.PropertySource;
|
|
|
|
import org.springframework.context.annotation.PropertySources;
|
2021-02-25 20:00:05 +01:00
|
|
|
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
|
|
|
import org.springframework.web.client.RestTemplate;
|
2020-03-31 14:02:29 +02:00
|
|
|
|
2021-12-07 12:21:43 +01:00
|
|
|
@SpringBootApplication(scanBasePackages = {"eu.dnetlib.uoaadmintools"})
|
2020-03-31 14:02:29 +02:00
|
|
|
@PropertySources({
|
2021-09-16 00:02:16 +02:00
|
|
|
@PropertySource("classpath:authorization.properties"),
|
|
|
|
@PropertySource("classpath:admintoolslibrary.properties"),
|
2020-03-31 14:02:29 +02:00
|
|
|
@PropertySource("classpath:admintools.properties"),
|
2020-04-10 14:34:43 +02:00
|
|
|
@PropertySource(value = "classpath:dnet-override.properties", ignoreResourceNotFound = true)
|
2020-03-31 14:02:29 +02:00
|
|
|
})
|
2022-10-10 12:52:19 +02:00
|
|
|
@EnableConfigurationProperties({MongoConfig.class, ManagersApiConfig.class, BrowserCacheConfig.class, GlobalVars.class, APIProperties.class})
|
2021-12-07 12:21:43 +01:00
|
|
|
@Import({AuthorizationConfiguration.class, UoaAdminToolsLibraryConfiguration.class})
|
2020-03-31 14:02:29 +02:00
|
|
|
public class UoaAdminToolsApplication {
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
SpringApplication.run(UoaAdminToolsApplication.class, args);
|
|
|
|
}
|
2021-02-25 20:00:05 +01:00
|
|
|
|
|
|
|
@Bean
|
|
|
|
RestTemplate restTemplate() {
|
|
|
|
RestTemplate restTemplate = new RestTemplate();
|
|
|
|
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
|
|
|
|
converter.setObjectMapper(new ObjectMapper());
|
|
|
|
restTemplate.getMessageConverters().add(converter);
|
|
|
|
return restTemplate;
|
|
|
|
}
|
2020-03-31 14:02:29 +02:00
|
|
|
}
|