| Line 6... |
Line 6... |
| 6 |
import com.spice.profitmandi.dao.convertor.LocalDateTimeJsonConverter;
|
6 |
import com.spice.profitmandi.dao.convertor.LocalDateTimeJsonConverter;
|
| 7 |
import org.apache.logging.log4j.LogManager;
|
7 |
import org.apache.logging.log4j.LogManager;
|
| 8 |
import org.apache.logging.log4j.Logger;
|
8 |
import org.apache.logging.log4j.Logger;
|
| 9 |
import org.apache.velocity.app.VelocityEngine;
|
9 |
import org.apache.velocity.app.VelocityEngine;
|
| 10 |
import org.apache.velocity.exception.VelocityException;
|
10 |
import org.apache.velocity.exception.VelocityException;
|
| - |
|
11 |
import org.apache.velocity.tools.generic.EscapeTool;
|
| 11 |
import org.springframework.context.annotation.Bean;
|
12 |
import org.springframework.context.annotation.Bean;
|
| 12 |
import org.springframework.context.annotation.ComponentScan;
|
13 |
import org.springframework.context.annotation.ComponentScan;
|
| 13 |
import org.springframework.context.annotation.Configuration;
|
14 |
import org.springframework.context.annotation.Configuration;
|
| 14 |
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
15 |
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
| 15 |
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
|
16 |
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
|
| Line 52... |
Line 53... |
| 52 |
|
53 |
|
| 53 |
public void setResource(Resource resource) {
|
54 |
public void setResource(Resource resource) {
|
| 54 |
AppConfig.resource = resource;
|
55 |
AppConfig.resource = resource;
|
| 55 |
}
|
56 |
}
|
| 56 |
|
57 |
|
| 57 |
@Bean
|
58 |
|
| 58 |
public ViewResolver viewResolver() {
|
- |
|
| 59 |
VelocityLayoutViewResolver bean = new VelocityLayoutViewResolver();
|
- |
|
| 60 |
bean.setPrefix("");
|
- |
|
| 61 |
bean.setSuffix(VELOCITY_PATH_SUFFIX);
|
59 |
@Bean(value = "velocityAttributesMap")
|
| 62 |
bean.setRequestContextAttribute("rc");
|
60 |
public Map<String, Object> velocityAttributesMap() {
|
| 63 |
Map<String, Object> attributesMap = new HashMap<>();
|
61 |
Map<String, Object> attributesMap = new HashMap<>();
|
| 64 |
DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("dd/MM/yyyy");
|
62 |
DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("dd/MM/yyyy");
|
| 65 |
DateTimeFormatter dateMonthFormatter = DateTimeFormatter.ofPattern("dd''MMM");
|
63 |
DateTimeFormatter dateMonthFormatter = DateTimeFormatter.ofPattern("dd''MMM");
|
| 66 |
DateTimeFormatter datehiphenFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
64 |
DateTimeFormatter datehiphenFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
| 67 |
DateTimeFormatter dateYearMonthFormatter = DateTimeFormatter.ofPattern("MMM''uu");
|
65 |
DateTimeFormatter dateYearMonthFormatter = DateTimeFormatter.ofPattern("MMM''uu");
|
| Line 79... |
Line 77... |
| 79 |
attributesMap.put("datehiphenFormatter", datehiphenFormatter);
|
77 |
attributesMap.put("datehiphenFormatter", datehiphenFormatter);
|
| 80 |
attributesMap.put("dateYearMonthFormatter", dateYearMonthFormatter);
|
78 |
attributesMap.put("dateYearMonthFormatter", dateYearMonthFormatter);
|
| 81 |
attributesMap.put("dateMonthYearFormatter", dateMonthYearFormatter);
|
79 |
attributesMap.put("dateMonthYearFormatter", dateMonthYearFormatter);
|
| 82 |
attributesMap.put("dateMonthChYear", dateMonthChYear);
|
80 |
attributesMap.put("dateMonthChYear", dateMonthChYear);
|
| 83 |
attributesMap.put("decimalFormatter", decimalFormatter);
|
81 |
attributesMap.put("decimalFormatter", decimalFormatter);
|
| 84 |
|
- |
|
| 85 |
attributesMap.put("noData",
|
82 |
attributesMap.put("noData",
|
| 86 |
"<tr><td colspan=\"20\" style=\"text-align:center;\">No results found for the given criteria</td></tr>");
|
83 |
"<tr><td colspan=\"20\" style=\"text-align:center;\">No results found for the given criteria</td></tr>");
|
| 87 |
attributesMap.put("dateTimeFormatter", dateTimeFormatter);
|
84 |
attributesMap.put("dateTimeFormatter", dateTimeFormatter);
|
| 88 |
attributesMap.put("version", "120");
|
85 |
attributesMap.put("version", "120");
|
| 89 |
attributesMap.put("cssVersion", "10");
|
86 |
attributesMap.put("cssVersion", "10");
|
| 90 |
attributesMap.put("isDev", getActiveProfile().equals("dev"));
|
87 |
attributesMap.put("isDev", getActiveProfile().equals("dev"));
|
| 91 |
attributesMap.put("vmUtils", new Utils());
|
88 |
attributesMap.put("vmUtils", new Utils());
|
| - |
|
89 |
attributesMap.put("esc", new EscapeTool());
|
| - |
|
90 |
return attributesMap;
|
| - |
|
91 |
}
|
| - |
|
92 |
|
| - |
|
93 |
@Bean
|
| - |
|
94 |
public ViewResolver viewResolver() {
|
| - |
|
95 |
VelocityLayoutViewResolver bean = new VelocityLayoutViewResolver();
|
| - |
|
96 |
bean.setPrefix("");
|
| - |
|
97 |
bean.setSuffix(VELOCITY_PATH_SUFFIX);
|
| - |
|
98 |
bean.setRequestContextAttribute("rc");
|
| 92 |
bean.setAttributesMap(attributesMap);
|
99 |
bean.setAttributesMap(this.velocityAttributesMap());
|
| 93 |
return bean;
|
100 |
return bean;
|
| 94 |
}
|
101 |
}
|
| 95 |
|
102 |
|
| 96 |
@Bean
|
103 |
@Bean
|
| 97 |
public ViewResolver beanNameViewResolver() {
|
104 |
public ViewResolver beanNameViewResolver() {
|
| Line 167... |
Line 174... |
| 167 |
Properties javaMailProperties = new Properties();
|
174 |
Properties javaMailProperties = new Properties();
|
| 168 |
javaMailProperties.put("mail.smtp.starttls.enable", "false");
|
175 |
javaMailProperties.put("mail.smtp.starttls.enable", "false");
|
| 169 |
javaMailProperties.put("mail.smtp.auth", "true");
|
176 |
javaMailProperties.put("mail.smtp.auth", "true");
|
| 170 |
javaMailProperties.put("mail.transport.protocol", "smtp");
|
177 |
javaMailProperties.put("mail.transport.protocol", "smtp");
|
| 171 |
javaMailProperties.put("mail.debug", "true");// Prints out everything on
|
178 |
javaMailProperties.put("mail.debug", "true");// Prints out everything on
|
| 172 |
// screen
|
179 |
// screen
|
| 173 |
|
180 |
|
| 174 |
mailSender.setJavaMailProperties(javaMailProperties);
|
181 |
mailSender.setJavaMailProperties(javaMailProperties);
|
| 175 |
return mailSender;
|
182 |
return mailSender;
|
| 176 |
}
|
183 |
}
|
| 177 |
|
184 |
|
| Line 209... |
Line 216... |
| 209 |
velocityProperties.put("overrideLogging", true);
|
216 |
velocityProperties.put("overrideLogging", true);
|
| 210 |
|
217 |
|
| 211 |
// velocityProperties.put("file.resource.loader.path", ".");
|
218 |
// velocityProperties.put("file.resource.loader.path", ".");
|
| 212 |
|
219 |
|
| 213 |
factory.setVelocityProperties(velocityProperties);
|
220 |
factory.setVelocityProperties(velocityProperties);
|
| 214 |
|
- |
|
| 215 |
return factory.createVelocityEngine();
|
221 |
return factory.createVelocityEngine();
|
| 216 |
|
222 |
|
| 217 |
}
|
223 |
}
|
| 218 |
|
224 |
|
| 219 |
}
|
225 |
}
|
| 220 |
|
226 |
|