Subversion Repositories SmartDukaan

Rev

Rev 28320 | Rev 28344 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28320 Rev 28339
Line 7... Line 7...
7
import java.util.Map;
7
import java.util.Map;
8
import java.util.Properties;
8
import java.util.Properties;
9
 
9
 
10
import org.apache.logging.log4j.LogManager;
10
import org.apache.logging.log4j.LogManager;
11
import org.apache.logging.log4j.Logger;
11
import org.apache.logging.log4j.Logger;
-
 
12
import org.apache.velocity.app.VelocityEngine;
-
 
13
import org.apache.velocity.exception.VelocityException;
12
import org.springframework.context.annotation.Bean;
14
import org.springframework.context.annotation.Bean;
13
import org.springframework.context.annotation.ComponentScan;
15
import org.springframework.context.annotation.ComponentScan;
14
import org.springframework.context.annotation.Configuration;
16
import org.springframework.context.annotation.Configuration;
15
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
17
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
16
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
18
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
17
import org.springframework.core.io.ClassPathResource;
19
import org.springframework.core.io.ClassPathResource;
18
import org.springframework.core.io.Resource;
20
import org.springframework.core.io.Resource;
19
import org.springframework.mail.javamail.JavaMailSender;
21
import org.springframework.mail.javamail.JavaMailSender;
20
import org.springframework.mail.javamail.JavaMailSenderImpl;
22
import org.springframework.mail.javamail.JavaMailSenderImpl;
-
 
23
import org.springframework.ui.velocity.VelocityEngineFactoryBean;
21
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
24
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
22
import org.springframework.web.servlet.ViewResolver;
25
import org.springframework.web.servlet.ViewResolver;
23
import org.springframework.web.servlet.view.BeanNameViewResolver;
26
import org.springframework.web.servlet.view.BeanNameViewResolver;
24
import org.springframework.web.servlet.view.velocity.VelocityConfigurer;
27
import org.springframework.web.servlet.view.velocity.VelocityConfigurer;
25
import org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver;
28
import org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver;
Line 64... Line 67...
64
		attributesMap.put("dateMonthFormatter", dateMonthFormatter);
67
		attributesMap.put("dateMonthFormatter", dateMonthFormatter);
65
		attributesMap.put("datehiphenFormatter", datehiphenFormatter);
68
		attributesMap.put("datehiphenFormatter", datehiphenFormatter);
66
		attributesMap.put("noData",
69
		attributesMap.put("noData",
67
				"<tr><td colspan=\"20\" style=\"text-align:center;\">No results found for the given criteria</td></tr>");
70
				"<tr><td colspan=\"20\" style=\"text-align:center;\">No results found for the given criteria</td></tr>");
68
		attributesMap.put("dateTimeFormatter", dateTimeFormatter);
71
		attributesMap.put("dateTimeFormatter", dateTimeFormatter);
69
		attributesMap.put("version", "49");
72
		attributesMap.put("version", "50");
70
		attributesMap.put("cssVersion", "9");
73
		attributesMap.put("cssVersion", "9");
71
		attributesMap.put("isDev", getActiveProfile().equals("dev"));
74
		attributesMap.put("isDev", getActiveProfile().equals("dev"));
72
		attributesMap.put("vmUtils", new Utils());
75
		attributesMap.put("vmUtils", new Utils());
73
		bean.setAttributesMap(attributesMap);
76
		bean.setAttributesMap(attributesMap);
74
		return bean;
77
		return bean;
Line 161... Line 164...
161
 
164
 
162
		return gson;
165
		return gson;
163
 
166
 
164
	}
167
	}
165
 
168
 
-
 
169
	@Bean(name = "veloctyEngine")
-
 
170
	public VelocityEngine velocityEngine() throws VelocityException, IOException {
-
 
171
		VelocityEngineFactoryBean factory = new VelocityEngineFactoryBean();
-
 
172
		// Properties props = new Properties();
-
 
173
		// props.put("resource.loader", "file");
-
 
174
 
-
 
175
		// props.put("file.resource.loader.description", "Velocity File Resource
-
 
176
		// Loader");
-
 
177
		// props.put("file.resource.loader.class",
-
 
178
		// "org.apache.velocity.runtime.resource.loader.FileResourceLoader");
-
 
179
		// props.put("file.resource.loader.cache", true);
-
 
180
		// props.put("file.resource.loader.path", ".");
-
 
181
 
-
 
182
		Properties velocityProperties = new Properties();
-
 
183
		velocityProperties.put("resource.loader", "class");
-
 
184
		velocityProperties.put("class.resource.loader.class",
-
 
185
				"org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
-
 
186
		velocityProperties.put("file.resource.loader.cache", true);
-
 
187
		velocityProperties.put("file.resource.loader.unicode", true);
-
 
188
		velocityProperties.put("input.encoding", "UTF-8");
-
 
189
		velocityProperties.put("output.encoding", "UTF-8");
-
 
190
		velocityProperties.put("overrideLogging", true);
-
 
191
 
-
 
192
		// velocityProperties.put("file.resource.loader.path", ".");
-
 
193
 
-
 
194
		factory.setVelocityProperties(velocityProperties);
-
 
195
 
-
 
196
		return factory.createVelocityEngine();
-
 
197
 
-
 
198
	}
-
 
199
 
166
}
200
}
167
201