1 package edu.calpoly.records.spring;
2
3 import java.util.ArrayList;
4 import java.util.List;
5 import java.util.Properties;
6
7 import org.kuali.common.util.execute.Executable;
8 import org.kuali.common.util.execute.ExecutablesExecutable;
9 import org.kuali.maven.plugins.spring.MavenConstants;
10 import org.springframework.beans.factory.annotation.Autowired;
11 import org.springframework.beans.factory.annotation.Qualifier;
12 import org.springframework.context.annotation.Bean;
13 import org.springframework.context.annotation.Configuration;
14 import org.springframework.context.annotation.Import;
15 import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
16
17 @Configuration
18 @Import(PrintMessageConfig.class)
19 public class PowerWebappConfig {
20
21 @Autowired
22 PrintMessageConfig pmc;
23
24 @Autowired
25 @Qualifier(MavenConstants.DEFAULT_MAVEN_PROPERTIES_BEAN_NAME)
26 Properties mavenProperties;
27
28 @Bean
29 public static PropertySourcesPlaceholderConfigurer pspc() {
30 return new PropertySourcesPlaceholderConfigurer();
31 }
32
33 @Bean
34 public Executable showProperties() {
35 ShowPropertiesExecutable spe = new ShowPropertiesExecutable();
36 spe.setProperties(mavenProperties);
37 return spe;
38 }
39
40 @Bean(initMethod = "execute")
41 public Executable executablesExecutable() {
42 List<Executable> executables = new ArrayList<Executable>();
43 executables.add(pmc.printMessageExecutable());
44 executables.add(showProperties());
45
46 ExecutablesExecutable ee = new ExecutablesExecutable();
47 ee.setExecutables(executables);
48 return ee;
49 }
50 }