}
private void initPlatformTheme(HttpServletRequest request) {
final ServletContext context = getServletContext();
final ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(context);
final RequestUtil requestUtil = (RequestUtil) ctx.getBean("requestUtil");
// THEME
try {
final RequestData requestData = requestUtil.getRequestData(request);
final MarketArea marketArea = requestData.getMarketArea();
if (marketArea != null && StringUtils.isNotEmpty(marketArea.getTheme())) {
String themeFolder = marketArea.getTheme();
requestUtil.updateCurrentTheme(request, themeFolder);
} else {
final Market market = requestData.getMarket();
if (market != null && StringUtils.isNotEmpty(market.getTheme())) {
String themeFolder = market.getTheme();
requestUtil.updateCurrentTheme(request, themeFolder);
} else {
final MarketPlace marketPlace = requestData.getMarketPlace();
if (marketPlace != null && StringUtils.isNotEmpty(marketPlace.getTheme())) {
String themeFolder = marketPlace.getTheme();
requestUtil.updateCurrentTheme(request, themeFolder);
}
}
}
} catch (Exception e) {